CMS 3D CMS Logo

BPHDecayMomentum.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHDecayMomentum_h
2 #define HeavyFlavorAnalysis_RecoDecay_BPHDecayMomentum_h
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
16 
17 //------------------------------------
18 // Collaborating Class Declarations --
19 //------------------------------------
22 class BPHRecoBuilder;
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 #include <vector>
28 #include <map>
29 #include <string>
30 
31 // ---------------------
32 // -- Class Interface --
33 // ---------------------
34 
36  friend class BPHRecoBuilder;
37 
38 public:
42  // deleted copy constructor and assignment operator
43  BPHDecayMomentum(const BPHDecayMomentum& x) = delete;
44  BPHDecayMomentum& operator=(const BPHDecayMomentum& x) = delete;
45 
48  virtual ~BPHDecayMomentum();
49 
53  virtual const pat::CompositeCandidate& composite() const;
55 
60  virtual const std::vector<std::string>& daugNames() const;
61 
66  virtual const std::vector<std::string>& compNames() const;
67 
73  virtual const std::vector<const reco::Candidate*>& daughters() const;
74 
81  virtual const std::vector<const reco::Candidate*>& daughFull() const;
82 
84  virtual const reco::Candidate* originalReco(const reco::Candidate* daug) const;
85 
90  virtual const std::vector<BPHRecoConstCandPtr>& daughComp() const;
91 
94  virtual const reco::Candidate* getDaug(const std::string& name) const;
95 
98  virtual BPHRecoConstCandPtr getComp(const std::string& name) const;
99 
100 protected:
101  struct Component {
103  double mass;
104  double msig;
106  };
107 
108  // constructors
110  BPHDecayMomentum(const std::map<std::string, Component>& daugMap);
111  BPHDecayMomentum(const std::map<std::string, Component>& daugMap,
112  const std::map<std::string, BPHRecoConstCandPtr> compMap);
113 
114  // get an object filled in the constructor
115  // to be used in the creation of other bases of BPHRecoCandidate
116  const std::vector<Component>& componentList() const;
117 
120  virtual void addP(const std::string& name, const reco::Candidate* daug, double mass = -1.0);
122  virtual void addP(const std::string& name, const BPHRecoConstCandPtr& comp);
123 
124  // utility function used to cash reconstruction results
125  virtual void setNotUpdated() const;
126 
127  // function doing the job to clone reconstructed decays:
128  // copy stable particles and clone cascade decays up to chosen level
129  virtual void fill(BPHRecoCandidate* ptr, int level) const = 0;
130 
131 private:
132  // object filled in the constructor
133  // to be used in the creation of other bases of BPHRecoCandidate
134  std::vector<Component> compList;
135 
136  // names used for simple and previously reconstructed particles
137  std::vector<std::string> nList;
138  std::vector<std::string> nComp;
139 
140  // pointers to simple and previously reconstructed particles
141  // (clones stored for simple particles)
142  std::vector<const reco::Candidate*> dList;
143  std::vector<BPHRecoConstCandPtr> cList;
144 
145  // maps linking names to decay products
146  // (simple and previously reconstructed particles)
147  std::map<std::string, const reco::Candidate*> dMap;
148  std::map<std::string, BPHRecoConstCandPtr> cMap;
149 
150  // map linking cloned particles to original ones
151  std::map<const reco::Candidate*, const reco::Candidate*> clonesMap;
152 
153  // reconstruction results cache
154  mutable bool oldMom;
155  mutable std::vector<const reco::Candidate*> dFull;
157 
158  // create clones of simple particles, store them and their names
159  void clonesList(const std::map<std::string, Component>& daugMap);
160 
161  // fill lists of previously reconstructed particles and their names
162  // and retrieve cascade decay products
163  void dCompList();
164 
165  // compute the total momentum of simple particles, produced
166  // directly or in cascade decays
167  virtual void sumMomentum(const std::vector<const reco::Candidate*> dl) const;
168 
169  // recursively fill the list of simple particles, produced
170  // directly or in cascade decays
171  virtual void fillDaug(std::vector<const reco::Candidate*>& ad) const;
172 
173  // compute the total momentum and cache it
174  virtual void computeMomentum() const;
175 };
176 
177 #endif
personalPlayback.level
level
Definition: personalPlayback.py:22
BPHDecayMomentum::daughComp
virtual const std::vector< BPHRecoConstCandPtr > & daughComp() const
Definition: BPHDecayMomentum.cc:89
CompositeCandidate.h
BPHDecayMomentum::addP
virtual void addP(const std::string &name, const reco::Candidate *daug, double mass=-1.0)
BPHDecayMomentum::composite
virtual const pat::CompositeCandidate & composite() const
get a composite by the simple sum of simple particles
Definition: BPHDecayMomentum.cc:63
pat::CompositeCandidate
Analysis-level particle class.
Definition: CompositeCandidate.h:31
BPHDecayMomentum::cMap
std::map< std::string, BPHRecoConstCandPtr > cMap
Definition: BPHDecayMomentum.h:148
DDAxes::x
BPHDecayMomentum::getDaug
virtual const reco::Candidate * getDaug(const std::string &name) const
Definition: BPHDecayMomentum.cc:94
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
BPHDecayMomentum::compList
std::vector< Component > compList
Definition: BPHDecayMomentum.h:134
BPHDecayMomentum::Component::msig
double msig
Definition: BPHDecayMomentum.h:104
BPHDecayMomentum::sumMomentum
virtual void sumMomentum(const std::vector< const reco::Candidate * > dl) const
Definition: BPHDecayMomentum.cc:207
BPHDecayMomentum::computeMomentum
virtual void computeMomentum() const
Definition: BPHDecayMomentum.cc:225
BPHDecayMomentum::dList
std::vector< const reco::Candidate * > dList
Definition: BPHDecayMomentum.h:142
BPHDecayMomentum::BPHDecayMomentum
BPHDecayMomentum()
Definition: BPHDecayMomentum.cc:32
BPHDecayMomentum::Component::mass
double mass
Definition: BPHDecayMomentum.h:103
BPHDecayMomentum::fill
virtual void fill(BPHRecoCandidate *ptr, int level) const =0
BPHDecayMomentum::oldMom
bool oldMom
Definition: BPHDecayMomentum.h:154
BPHRecoBuilder
Definition: BPHRecoBuilder.h:50
BPHDecayMomentum::fillDaug
virtual void fillDaug(std::vector< const reco::Candidate * > &ad) const
Definition: BPHDecayMomentum.cc:215
BPHDecayMomentum::operator=
BPHDecayMomentum & operator=(const BPHDecayMomentum &x)=delete
BPHDecayMomentum
Definition: BPHDecayMomentum.h:35
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BPHDecayMomentum::clonesMap
std::map< const reco::Candidate *, const reco::Candidate * > clonesMap
Definition: BPHDecayMomentum.h:151
BPHDecayMomentum::Component
Definition: BPHDecayMomentum.h:101
BPHDecayMomentum::Component::cand
const reco::Candidate * cand
Definition: BPHDecayMomentum.h:102
BPHDecayMomentum::getComp
virtual BPHRecoConstCandPtr getComp(const std::string &name) const
Definition: BPHDecayMomentum.cc:106
BPHDecayMomentum::nComp
std::vector< std::string > nComp
Definition: BPHDecayMomentum.h:138
BPHDecayMomentum::setNotUpdated
virtual void setNotUpdated() const
Definition: BPHDecayMomentum.cc:149
BPHDecayMomentum::dFull
std::vector< const reco::Candidate * > dFull
Definition: BPHDecayMomentum.h:155
reco::Candidate
Definition: Candidate.h:27
BPHDecayMomentum::nList
std::vector< std::string > nList
Definition: BPHDecayMomentum.h:137
BPHDecayMomentum::compNames
virtual const std::vector< std::string > & compNames() const
Definition: BPHDecayMomentum.cc:71
BPHDecayMomentum::originalReco
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
Definition: BPHDecayMomentum.cc:82
BPHDecayMomentum::Component::searchList
std::string searchList
Definition: BPHDecayMomentum.h:105
BPHDecayMomentum::daughFull
virtual const std::vector< const reco::Candidate * > & daughFull() const
Definition: BPHDecayMomentum.cc:75
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
BPHRecoCandidatePtr.h
BPHDecayMomentum::clonesList
void clonesList(const std::map< std::string, Component > &daugMap)
Definition: BPHDecayMomentum.cc:154
BPHDecayMomentum::daughters
virtual const std::vector< const reco::Candidate * > & daughters() const
Definition: BPHDecayMomentum.cc:73
BPHDecayMomentum::daugNames
virtual const std::vector< std::string > & daugNames() const
Definition: BPHDecayMomentum.cc:69
BPHRecoCandidate
Definition: BPHRecoCandidate.h:46
BPHDecayMomentum::componentList
const std::vector< Component > & componentList() const
Definition: BPHDecayMomentum.cc:118
BPHDecayMomentum::dCompList
void dCompList()
Definition: BPHDecayMomentum.cc:188
BPHDecayMomentum::dMap
std::map< std::string, const reco::Candidate * > dMap
Definition: BPHDecayMomentum.h:147
BPHDecayMomentum::cList
std::vector< BPHRecoConstCandPtr > cList
Definition: BPHDecayMomentum.h:143
BPHDecayMomentum::compCand
pat::CompositeCandidate compCand
Definition: BPHDecayMomentum.h:156
BPHRecoConstCandPtr
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
Definition: BPHRecoCandidatePtr.h:9
BPHDecayMomentum::~BPHDecayMomentum
virtual ~BPHDecayMomentum()
Definition: BPHDecayMomentum.cc:53