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