PandaRoot
DecayChain.h
Go to the documentation of this file.
1 // ******************************************************
2 // DecayTreeFitter Package
3 // We thank the original author Wouter Hulsbergen
4 // (BaBar, LHCb) for providing the sources.
5 // http://arxiv.org/abs/physics/0503191v1 (2005)
6 // Adaptation & Development for PANDA: Ralf Kliemt (2015)
7 // ******************************************************
8 #ifndef DECAYCHAIN_H
9 #define DECAYCHAIN_H 1
10 
11 #include <map>
12 #include "ParticleBase.h"
13 #include "MergedConstraint.h"
14 #include "Rtypes.h"
15 
16 // namespace LHCb {
17 // class Particle ;
18 // class VertexBase ;
19 //}
20 
21 namespace DecayTreeFitter {
22 
23 class FitParams;
24 class ParticleBase;
25 
26 class DecayChain {
27  public:
28  DecayChain() : m_mother(nullptr) {}
29 
30  DecayChain(RhoCandidate *bc, const Configuration &config);
31  DecayChain(RhoCandidate *bc, const RhoVector3Err &pv, const Configuration &config);
32  DecayChain(RhoCandidate *bc, const RhoLorentzVectorErr &lv, const Configuration &config);
33  DecayChain(RhoCandidate *bc, const RhoLorentzVectorErr &lv, const RhoVector3Err &pv, const Configuration &config);
34 
35  virtual ~DecayChain();
36 
37  int dim() const { return m_dim; }
38 
39  void initConstraintList();
40  ErrCode init(FitParams *par);
41  ErrCode filter(FitParams *par, bool firstpass = true);
42  double chiSquare(const FitParams *par) const;
43 
44  ParticleBase *mother() { return m_mother; }
45  const ParticleBase *cand() { return m_cand; }
46  const ParticleBase *mother() const { return m_mother; }
47  const ParticleBase *locate(RhoCandidate *bc) const;
48  // void locate( RhoCandidate* pid, ParticleBase::ParticleContainer& result ) ;
49 
50  int index(RhoCandidate *bc) const;
51  int posIndex(RhoCandidate *bc) const;
52  int momIndex(RhoCandidate *bc) const;
53  int lenIndex(RhoCandidate *bc) const;
54  void setOwner(bool b) { m_isOwner = b; }
55  // int momIndex() const ;
56 
57  void printConstraints(std::ostream &os = std::cout) const;
58  void setMassConstraint(RhoCandidate *bc, bool add = true);
59  void setMassConstraint(RhoCandidate *bc, double mass);
60  // void setMassConstraint( RhoCandidate* pid, bool add=true) ;
61  // void setMassConstraint( RhoCandidate* pid, double mass) ;
62 
63  ChiSquare chiSquare(RhoCandidate *bc, const FitParams *fitpars) const;
64 
65  private:
66  int m_dim;
67  ParticleBase *m_mother; // head of decay tree
68  const ParticleBase *m_cand; // fit candidate (not same to mother in case of bs/be constraint)
69  ParticleBase::constraintlist m_constraintlist;
70  std::vector<Constraint *> m_mergedconstraintlist;
71  MergedConstraint m_mergedconstraint;
72  typedef std::map<RhoCandidate *, const ParticleBase *> ParticleMap;
73  mutable ParticleMap m_particleMap;
74  bool m_isOwner;
75  ClassDef(DecayChain, 1)
76 };
77 
78 } // namespace DecayTreeFitter
79 
80 #endif
int posIndex(RhoCandidate *bc) const
std::vector< DecayTreeFitter::Constraint > constraintlist
Definition: ParticleBase.h:102
ErrCode init(FitParams *par)
ParticleBase * mother()
Definition: DecayChain.h:44
ErrCode filter(FitParams *par, bool firstpass=true)
int momIndex(RhoCandidate *bc) const
const ParticleBase * mother() const
Definition: DecayChain.h:46
const ParticleBase * cand()
Definition: DecayChain.h:45
void printConstraints(std::ostream &os=std::cout) const
int index(RhoCandidate *bc) const
double chiSquare(const FitParams *par) const
const ParticleBase * locate(RhoCandidate *bc) const
int lenIndex(RhoCandidate *bc) const
void setMassConstraint(RhoCandidate *bc, bool add=true)