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 }
personalPlayback.level
level
Definition: personalPlayback.py:22
BPHDecayVertex::getTrackSearchList
const std::string & getTrackSearchList(const reco::Candidate *cand) const
retrieve track search list
Definition: BPHDecayVertex.cc:154
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
BPHKinematicFit::getMassSigma
double getMassSigma(const reco::Candidate *cand) const
retrieve particle mass sigma
Definition: BPHKinematicFit.cc:315
BPHRecoCandidate::fill
void fill(BPHRecoCandidate *ptr, int level) const override
Definition: BPHRecoCandidate.cc:61
BPHDecayVertex::getEventSetup
const edm::EventSetup * getEventSetup() const
retrieve EventSetup
Definition: BPHDecayVertex.cc:152
BPHDecayMomentum::getDaug
virtual const reco::Candidate * getDaug(const std::string &name) const
Definition: BPHDecayMomentum.cc:94
BPHKinematicFit::constrMass
double constrMass() const
retrieve the constraint
Definition: BPHKinematicFit.cc:99
BPHRecoBuilder
Definition: BPHRecoBuilder.h:50
BPHDecayMomentum
Definition: BPHDecayMomentum.h:35
BPHDecayVertex
Definition: BPHDecayVertex.h:43
BPHRecoBuilder::ComponentSet
Definition: BPHRecoBuilder.h:127
BPHKinematicFit::constrSigma
double constrSigma() const
Definition: BPHKinematicFit.cc:101
BPHDecayMomentum::getComp
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
Definition: BPHDecayMomentum.cc:106
edm::EventSetup
Definition: EventSetup.h:57
BPHRecoCandidate::~BPHRecoCandidate
~BPHRecoCandidate() override
Definition: BPHRecoCandidate.cc:38
BPHDecayMomentum::nComp
std::vector< std::string > nComp
Definition: BPHDecayMomentum.h:138
BPHRecoBuilder.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
BPHKinematicFit::mass
virtual ParticleMass mass() const
Definition: BPHKinematicFit.cc:297
BPHKinematicFit::setConstraint
void setConstraint(double mass, double sigma)
apply a mass constraint
Definition: BPHKinematicFit.cc:91
reco::Candidate
Definition: Candidate.h:27
BPHDecayMomentum::compNames
virtual const std::vector< std::string > & compNames() const
Definition: BPHDecayMomentum.cc:71
std
Definition: JetResolutionObject.h:76
BPHRecoCandidate::BPHRecoCandidate
BPHRecoCandidate(const edm::EventSetup *es)
Definition: BPHRecoCandidate.cc:30
BPHDecayMomentum::originalReco
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
Definition: BPHDecayMomentum.cc:82
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
BPHRecoCandidate::build
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
Definition: BPHRecoCandidate.cc:43
BPHRecoCandidate.h
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
BPHRecoCandidate::add
virtual void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
Definition: BPHRecoCandidate.h:69
BPHRecoCandidate::clone
virtual BPHRecoCandidate * clone(int level=-1) const
Definition: BPHRecoCandidate.cc:53
ztail.d
d
Definition: ztail.py:151
BPHKinematicFit
Definition: BPHKinematicFit.h:38
BPHDecayMomentum::daugNames
virtual const std::vector< std::string > & daugNames() const
Definition: BPHDecayMomentum.cc:69
BPHRecoCandidate
Definition: BPHRecoCandidate.h:46
BPHKinematicFit::getIndependentFit
bool getIndependentFit(const std::string &name) const
retrieve independent fit flag
Definition: BPHKinematicFit.cc:321
BPHDecayMomentum::cList
std::vector< BPHRecoConstCandPtr > cList
Definition: BPHDecayMomentum.h:143
BPHKinematicFit::setIndependentFit
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
Definition: BPHKinematicFit.cc:104
BPHRecoConstCandPtr
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
Definition: BPHRecoCandidatePtr.h:9