CMS 3D CMS Logo

BPHRecoCandidate.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author Paolo Ronchese INFN Padova
5  *
6  */
7 
8 //-----------------------
9 // This Class' Header --
10 //-----------------------
12 
13 //-------------------------------
14 // Collaborating Class Headers --
15 //-------------------------------
17 
18 //---------------
19 // C++ Headers --
20 //---------------
21 using namespace std;
22 
23 //-------------------
24 // Initializations --
25 //-------------------
26 
27 //----------------
28 // Constructors --
29 //----------------
31 
33  : BPHDecayMomentum(compList.daugMap, compList.compMap), BPHDecayVertex(this, es), BPHKinematicFit(this) {}
34 
35 //--------------
36 // Destructor --
37 //--------------
39 
40 //--------------
41 // Operations --
42 //--------------
43 vector<BPHRecoConstCandPtr> BPHRecoCandidate::build(const BPHRecoBuilder& builder, double mass, double msig) {
44  // create a list of pointers to BPHRecoCandidate and fill it
45  // with particle combinations selected by the BPHRecoBuilder
46  vector<BPHRecoConstCandPtr> cList;
47  fill<BPHRecoCandidate>(cList, builder, mass, msig);
48  return cList;
49 }
50 
55  fill(ptr, level);
56  return ptr;
57 }
58 
59 // function doing the job to clone reconstructed decays:
60 // copy stable particles and clone cascade decays up to chosen level
63  const std::vector<std::string>& nDaug = daugNames();
64  int id;
65  int nd = nDaug.size();
66  for (id = 0; id < nd; ++id) {
67  const string& n = nDaug[id];
68  const reco::Candidate* d = getDaug(n);
69  ptr->add(n, originalReco(d), getTrackSearchList(d), d->mass(), getMassSigma(d));
70  }
71  const std::vector<std::string>& nComp = compNames();
72  int ic;
73  int nc = nComp.size();
74  for (ic = 0; ic < nc; ++ic) {
75  const string& n = nComp[ic];
77  if (level)
78  ptr->add(n, BPHRecoConstCandPtr(c->clone(level - 1)));
79  else
80  ptr->add(n, c);
81  if (getIndependentFit(n))
82  ptr->setIndependentFit(n);
83  }
84  return;
85 }
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
std::vector< BPHRecoConstCandPtr > cList
virtual BPHRecoCandidate * clone(int level=-1) const
BPHRecoCandidate(const edm::EventSetup *es)
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
void setIndependentFit(const std::string &name, bool flag=true, double mass=-1.0, double sigma=-1.0)
set a decaying daughter as an unique particle fitted independently
~BPHRecoCandidate() override
const std::string & getTrackSearchList(const reco::Candidate *cand) const
retrieve track search list
virtual const reco::Candidate * getDaug(const std::string &name) const
void fill(BPHRecoCandidate *ptr, int level) const override
const edm::EventSetup * getEventSetup() const
retrieve EventSetup
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
virtual void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
d
Definition: ztail.py:151
virtual const std::vector< std::string > & compNames() const
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
virtual const std::vector< std::string > & daugNames() const
double constrMass() const
retrieve the constraint
void setConstraint(double mass, double sigma)
apply a mass constraint
double getMassSigma(const reco::Candidate *cand) const
retrieve particle mass sigma
virtual ParticleMass mass() const
std::vector< std::string > nComp
bool getIndependentFit(const std::string &name) const
retrieve independent fit flag
double constrSigma() const