Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMCThrownMatching.h
Go to the documentation of this file.
1 #ifndef _DMCThrownMatching_
2 #define _DMCThrownMatching_
3 
4 #include <map>
5 #include <deque>
6 
7 #include "JANA/JObject.h"
8 #include "TRACKING/DMCThrown.h"
10 #include "PID/DChargedTrack.h"
12 #include "PID/DNeutralParticle.h"
13 #include "PID/DNeutralShower.h"
14 #include "PID/DBeamPhoton.h"
15 
16 #include "TOF/DTOFPoint.h"
17 #include "TOF/DTOFTruth.h"
18 #include "BCAL/DBCALShower.h"
19 #include "BCAL/DBCALTruthShower.h"
20 #include "FCAL/DFCALShower.h"
21 #include "FCAL/DFCALTruthShower.h"
22 
23 using namespace std;
24 using namespace jana;
25 
26 class DMCThrownMatching : public JObject
27 {
28  //uses measured tracks/photons/etc. for matching, not kinfit ones
29  public:
30 
31  JOBJECT_PUBLIC(DMCThrownMatching);
32 
33  //GETTERS: INDIVIDUAL PARTICLES
34  const DBeamPhoton* Get_TaggedMCGENBeamPhoton(void) const{return dTaggedMCGENBeamPhoton;}
35  const DBeamPhoton* Get_MCGENBeamPhoton(void) const{return dMCGENBeamPhoton;}
36 
37  //the below two functions return the hypothesis with PID = MC PID. if not available, returns one with best PID FOM
38  const DChargedTrackHypothesis* Get_MatchingChargedHypothesis(const DMCThrown* locInputMCThrown, double& locMatchFOM) const;
39  const DNeutralParticleHypothesis* Get_MatchingNeutralHypothesis(const DMCThrown* locInputMCThrown, double& locMatchFOM) const;
40 
41  bool Get_MatchingChargedHypotheses(const DMCThrown* locInputMCThrown, deque<const DChargedTrackHypothesis*>& locMatchingChargedHypotheses, double& locMatchFOM) const;
42  const DChargedTrack* Get_MatchingChargedTrack(const DMCThrown* locInputMCThrown, double& locMatchFOM) const;
43 
44  bool Get_MatchingNeutralHypotheses(const DMCThrown* locInputMCThrown, deque<const DNeutralParticleHypothesis*>& locMatchingNeutralHypotheses, double& locMatchFOM) const;
45  const DNeutralParticle* Get_MatchingNeutralParticle(const DMCThrown* locInputMCThrown, double& locMatchFOM) const;
46  const DNeutralShower* Get_MatchingNeutralShower(const DMCThrown* locInputMCThrown, double& locMatchFOM) const;
47 
48  const DMCThrown* Get_MatchingMCThrown(const DChargedTrackHypothesis* locChargedTrackHypothesis, double& locMatchFOM) const;
49  const DMCThrown* Get_MatchingMCThrown(const DChargedTrack* locChargedTrack, double& locMatchFOM) const;
50 
51  const DMCThrown* Get_MatchingMCThrown(const DNeutralParticleHypothesis* locNeutralParticleHypothesis, double& locMatchFOM) const;
52  const DMCThrown* Get_MatchingMCThrown(const DNeutralParticle* locNeutralParticle, double& locMatchFOM) const;
53  const DMCThrown* Get_MatchingMCThrown(const DNeutralShower* locNeutralShower, double& locMatchFOM) const;
54 
55  const DBeamPhoton* Get_MatchingReconPhoton(const DBeamPhoton* locTruthBeamPhoton) const;
56  const DBeamPhoton* Get_MatchingTruthPhoton(const DBeamPhoton* locReconBeamPhoton) const;
57 
58  //GETTERS: INDIVIDUAL HITS
59  const DTOFPoint* Get_MatchingTOFPoint(const DTOFTruth* locTOFTruth, double& locMatchFOM) const;
60  const DTOFTruth* Get_MatchingTOFTruth(const DTOFPoint* locTOFPoint, double& locMatchFOM) const;
61 
62  const DBCALShower* Get_MatchingBCALShower(const DBCALTruthShower* locBCALTruthShower, double& locMatchFOM) const;
63  const DBCALTruthShower* Get_MatchingBCALTruthShower(const DBCALShower* locBCALShower, double& locMatchFOM) const;
64 
65  const DFCALShower* Get_MatchingFCALShower(const DFCALTruthShower* locFCALTruthShower, double& locMatchFOM) const;
66  const DFCALTruthShower* Get_MatchingFCALTruthShower(const DFCALShower* locFCALShower, double& locMatchFOM) const;
67 
68  //GETTERS: WHOLE MAPS
69  inline void Get_ChargedHypoToThrownMap(map<const DChargedTrackHypothesis*, pair<const DMCThrown*, double> >& locChargedHypoToThrownMap) const{locChargedHypoToThrownMap = dChargedHypoToThrownMap;}
70  inline void Get_ThrownToChargedHypoMap(map<const DMCThrown*, pair<deque<const DChargedTrackHypothesis*>, double> >& locThrownToChargedHypoMap) const{locThrownToChargedHypoMap = dThrownToChargedHypoMap;}
71 
72  inline void Get_ChargedToThrownMap(map<const DChargedTrack*, pair<const DMCThrown*, double> >& locChargedToThrownMap) const{locChargedToThrownMap = dChargedToThrownMap;}
73  inline void Get_ThrownToChargedMap(map<const DMCThrown*, pair<const DChargedTrack*, double> >& locThrownToChargedMap) const{locThrownToChargedMap = dThrownToChargedMap;}
74 
75  inline void Get_NeutralHypoToThrownMap(map<const DNeutralParticleHypothesis*, pair<const DMCThrown*, double> >& locNeutralHypoToThrownMap) const{locNeutralHypoToThrownMap = dNeutralHypoToThrownMap;}
76  inline void Get_ThrownToNeutralHypoMap(map<const DMCThrown*, pair<deque<const DNeutralParticleHypothesis*>, double> >& locThrownToNeutralHypoMap) const{locThrownToNeutralHypoMap = dThrownToNeutralHypoMap;}
77 
78  inline void Get_NeutralToThrownMap(map<const DNeutralParticle*, pair<const DMCThrown*, double> >& locNeutralToThrownMap) const{locNeutralToThrownMap = dNeutralToThrownMap;}
79  inline void Get_ThrownToNeutralMap(map<const DMCThrown*, pair<const DNeutralParticle*, double> >& locThrownToNeutralMap) const{locThrownToNeutralMap = dThrownToNeutralMap;}
80 
81  inline void Get_TOFPointToTruthMap(map<const DTOFPoint*, pair<const DTOFTruth*, double> >& locTOFPointToTruthMap) const{locTOFPointToTruthMap = dTOFPointToTruthMap;}
82  inline void Get_TOFTruthToPointMap(map<const DTOFTruth*, pair<const DTOFPoint*, double> >& locTOFTruthToPointMap) const{locTOFTruthToPointMap = dTOFTruthToPointMap;}
83 
84  inline void Get_BCALShowerToTruthMap(map<const DBCALShower*, pair<const DBCALTruthShower*, double> >& locBCALShowerToTruthMap) const{locBCALShowerToTruthMap = dBCALShowerToTruthMap;}
85  inline void Get_BCALTruthToShowerMap(map<const DBCALTruthShower*, pair<const DBCALShower*, double> >& locBCALTruthToShowerMap) const{locBCALTruthToShowerMap = dBCALTruthToShowerMap;}
86 
87  inline void Get_FCALShowerToTruthMap(map<const DFCALShower*, pair<const DFCALTruthShower*, double> >& locFCALShowerToTruthMap) const{locFCALShowerToTruthMap = dFCALShowerToTruthMap;}
88  inline void Get_FCALTruthToShowerMap(map<const DFCALTruthShower*, pair<const DFCALShower*, double> >& locFCALTruthToShowerMap) const{locFCALTruthToShowerMap = dFCALTruthToShowerMap;}
89 
90  //SETTERS
91  inline void Set_ChargedHypoToThrownMap(const map<const DChargedTrackHypothesis*, pair<const DMCThrown*, double> >& locChargedHypoToThrownMap){dChargedHypoToThrownMap = locChargedHypoToThrownMap;}
92  inline void Set_ThrownToChargedHypoMap(const map<const DMCThrown*, pair<deque<const DChargedTrackHypothesis*>, double> >& locThrownToChargedHypoMap){dThrownToChargedHypoMap = locThrownToChargedHypoMap;}
93 
94  inline void Set_ChargedToThrownMap(const map<const DChargedTrack*, pair<const DMCThrown*, double> >& locChargedToThrownMap){dChargedToThrownMap = locChargedToThrownMap;}
95  inline void Set_ThrownToChargedMap(const map<const DMCThrown*, pair<const DChargedTrack*, double> >& locThrownToChargedMap){dThrownToChargedMap = locThrownToChargedMap;}
96 
97  inline void Set_NeutralHypoToThrownMap(const map<const DNeutralParticleHypothesis*, pair<const DMCThrown*, double> >& locNeutralHypoToThrownMap){dNeutralHypoToThrownMap = locNeutralHypoToThrownMap;}
98  inline void Set_ThrownToNeutralHypoMap(const map<const DMCThrown*, pair<deque<const DNeutralParticleHypothesis*>, double> >& locThrownToNeutralHypoMap){dThrownToNeutralHypoMap = locThrownToNeutralHypoMap;}
99 
100  inline void Set_NeutralToThrownMap(const map<const DNeutralParticle*, pair<const DMCThrown*, double> >& locNeutralToThrownMap){dNeutralToThrownMap = locNeutralToThrownMap;}
101  inline void Set_ThrownToNeutralMap(const map<const DMCThrown*, pair<const DNeutralParticle*, double> >& locThrownToNeutralMap){dThrownToNeutralMap = locThrownToNeutralMap;}
102 
103  inline void Set_TOFPointToTruthMap(const map<const DTOFPoint*, pair<const DTOFTruth*, double> >& locTOFPointToTruthMap){dTOFPointToTruthMap = locTOFPointToTruthMap;}
104  inline void Set_TOFTruthToPointMap(const map<const DTOFTruth*, pair<const DTOFPoint*, double> >& locTOFTruthToPointMap){dTOFTruthToPointMap = locTOFTruthToPointMap;}
105 
106  inline void Set_BCALShowerToTruthMap(map<const DBCALShower*, pair<const DBCALTruthShower*, double> >& locBCALShowerToTruthMap){dBCALShowerToTruthMap = locBCALShowerToTruthMap;}
107  inline void Set_BCALTruthToShowerMap(map<const DBCALTruthShower*, pair<const DBCALShower*, double> >& locBCALTruthToShowerMap){dBCALTruthToShowerMap = locBCALTruthToShowerMap;}
108 
109  inline void Set_FCALShowerToTruthMap(map<const DFCALShower*, pair<const DFCALTruthShower*, double> >& locFCALShowerToTruthMap){dFCALShowerToTruthMap = locFCALShowerToTruthMap;}
110  inline void Set_FCALTruthToShowerMap(map<const DFCALTruthShower*, pair<const DFCALShower*, double> >& locFCALTruthToShowerMap){dFCALTruthToShowerMap = locFCALTruthToShowerMap;}
111 
112  inline void Set_BeamPhotonToTruthMap(map<const DBeamPhoton*, const DBeamPhoton*>& locBeamPhotonToTruthMap){dBeamPhotonToTruthMap = locBeamPhotonToTruthMap;}
113  inline void Set_BeamTruthToPhotonMap(map<const DBeamPhoton*, const DBeamPhoton*>& locBeamTruthToPhotonMap){dBeamTruthToPhotonMap = locBeamTruthToPhotonMap;}
114 
115  inline void Set_TaggedMCGENBeamPhoton(const DBeamPhoton* locBeamPhoton){dTaggedMCGENBeamPhoton = locBeamPhoton;}
116  inline void Set_MCGENBeamPhoton(const DBeamPhoton* locBeamPhoton){dMCGENBeamPhoton = locBeamPhoton;}
117 
118  private:
119 
120  //doubles are match FOM (for BCAL/FCAL/TOF: is match distance)
121  map<const DChargedTrackHypothesis*, pair<const DMCThrown*, double> > dChargedHypoToThrownMap;
122  map<const DMCThrown*, pair<deque<const DChargedTrackHypothesis*>, double> > dThrownToChargedHypoMap;
123 
124  map<const DChargedTrack*, pair<const DMCThrown*, double> > dChargedToThrownMap;
125  map<const DMCThrown*, pair<const DChargedTrack*, double> > dThrownToChargedMap;
126 
127  map<const DNeutralParticleHypothesis*, pair<const DMCThrown*, double> > dNeutralHypoToThrownMap;
128  map<const DMCThrown*, pair<deque<const DNeutralParticleHypothesis*>, double> > dThrownToNeutralHypoMap;
129 
130  map<const DNeutralParticle*, pair<const DMCThrown*, double> > dNeutralToThrownMap;
131  map<const DMCThrown*, pair<const DNeutralParticle*, double> > dThrownToNeutralMap;
132 
133  map<const DTOFPoint*, pair<const DTOFTruth*, double> > dTOFPointToTruthMap;
134  map<const DTOFTruth*, pair<const DTOFPoint*, double> > dTOFTruthToPointMap;
135 
136  map<const DBCALShower*, pair<const DBCALTruthShower*, double> > dBCALShowerToTruthMap;
137  map<const DBCALTruthShower*, pair<const DBCALShower*, double> > dBCALTruthToShowerMap;
138 
139  map<const DFCALShower*, pair<const DFCALTruthShower*, double> > dFCALShowerToTruthMap;
140  map<const DFCALTruthShower*, pair<const DFCALShower*, double> > dFCALTruthToShowerMap;
141 
142  map<const DBeamPhoton*, const DBeamPhoton*> dBeamPhotonToTruthMap;
143  map<const DBeamPhoton*, const DBeamPhoton*> dBeamTruthToPhotonMap;
144 
145  const DBeamPhoton* dMCGENBeamPhoton; //the generated photon that caused the event
146  const DBeamPhoton* dTaggedMCGENBeamPhoton; //the reconstructed photon that matches the MCGEN photon
147 };
148 
149 inline const DBeamPhoton* DMCThrownMatching::Get_MatchingReconPhoton(const DBeamPhoton* locTruthBeamPhoton) const
150 {
151  map<const DBeamPhoton*, const DBeamPhoton*>::const_iterator locIterator = dBeamTruthToPhotonMap.find(locTruthBeamPhoton);
152  if(locIterator == dBeamTruthToPhotonMap.end())
153  return NULL;
154  return locIterator->second;
155 }
156 
157 inline const DBeamPhoton* DMCThrownMatching::Get_MatchingTruthPhoton(const DBeamPhoton* locReconBeamPhoton) const
158 {
159  map<const DBeamPhoton*, const DBeamPhoton*>::const_iterator locIterator = dBeamPhotonToTruthMap.find(locReconBeamPhoton);
160  if(locIterator != dBeamPhotonToTruthMap.end())
161  return locIterator->second;
162 
163  //perhaps this is an object produced from the factories with the "KinFit" or "Combo" flags: try the source object
164  const DBeamPhoton* locAssociatedBeamPhoton = NULL;
165  locReconBeamPhoton->GetSingle(locAssociatedBeamPhoton);
166  if(locAssociatedBeamPhoton == NULL)
167  return NULL;
168  return Get_MatchingTruthPhoton(locAssociatedBeamPhoton);
169 }
170 
171 inline bool DMCThrownMatching::Get_MatchingChargedHypotheses(const DMCThrown* locInputMCThrown, deque<const DChargedTrackHypothesis*>& locMatchingChargedHypotheses, double& locMatchFOM) const
172 {
173  locMatchingChargedHypotheses.clear();
174  map<const DMCThrown*, pair<deque<const DChargedTrackHypothesis*>, double> >::const_iterator locIterator = dThrownToChargedHypoMap.find(locInputMCThrown);
175  if(locIterator == dThrownToChargedHypoMap.end())
176  return false;
177 
178  locMatchingChargedHypotheses = locIterator->second.first;
179  locMatchFOM = locIterator->second.second;
180  return true;
181 }
182 
183 inline const DChargedTrack* DMCThrownMatching::Get_MatchingChargedTrack(const DMCThrown* locInputMCThrown, double& locMatchFOM) const
184 {
185  map<const DMCThrown*, pair<const DChargedTrack*, double> >::const_iterator locIterator = dThrownToChargedMap.find(locInputMCThrown);
186  if(locIterator == dThrownToChargedMap.end())
187  return NULL;
188 
189  locMatchFOM = locIterator->second.second;
190  return locIterator->second.first;
191 }
192 
193 inline const DChargedTrackHypothesis* DMCThrownMatching::Get_MatchingChargedHypothesis(const DMCThrown* locInputMCThrown, double& locMatchFOM) const
194 {
195  map<const DMCThrown*, pair<deque<const DChargedTrackHypothesis*>, double> >::const_iterator locIterator = dThrownToChargedHypoMap.find(locInputMCThrown);
196  if(locIterator == dThrownToChargedHypoMap.end())
197  return NULL;
198  deque<const DChargedTrackHypothesis*> locHypotheses = locIterator->second.first;
199  locMatchFOM = locIterator->second.second;
200 
201  const DChargedTrackHypothesis* locBestHypothesis = NULL;
202  for(size_t loc_i = 0; loc_i < locHypotheses.size(); ++loc_i)
203  {
204  if(locHypotheses[loc_i]->PID() == locInputMCThrown->PID())
205  return locHypotheses[loc_i];
206  if(locBestHypothesis == NULL)
207  locBestHypothesis = locHypotheses[loc_i];
208  else if(locHypotheses[loc_i]->Get_FOM() > locBestHypothesis->Get_FOM())
209  locBestHypothesis = locHypotheses[loc_i];
210  }
211  return locBestHypothesis;
212 }
213 
214 inline const DNeutralParticleHypothesis* DMCThrownMatching::Get_MatchingNeutralHypothesis(const DMCThrown* locInputMCThrown, double& locMatchFOM) const
215 {
216  map<const DMCThrown*, pair<deque<const DNeutralParticleHypothesis*>, double> >::const_iterator locIterator = dThrownToNeutralHypoMap.find(locInputMCThrown);
217  if(locIterator == dThrownToNeutralHypoMap.end())
218  return NULL;
219  deque<const DNeutralParticleHypothesis*> locHypotheses = locIterator->second.first;
220  locMatchFOM = locIterator->second.second;
221 
222  const DNeutralParticleHypothesis* locBestHypothesis = NULL;
223  for(size_t loc_i = 0; loc_i < locHypotheses.size(); ++loc_i)
224  {
225  if(locHypotheses[loc_i]->PID() == locInputMCThrown->PID())
226  return locHypotheses[loc_i];
227  if(locBestHypothesis == NULL)
228  locBestHypothesis = locHypotheses[loc_i];
229  else if(locHypotheses[loc_i]->Get_FOM() > locBestHypothesis->Get_FOM())
230  locBestHypothesis = locHypotheses[loc_i];
231  }
232  return locBestHypothesis;
233 }
234 
235 inline bool DMCThrownMatching::Get_MatchingNeutralHypotheses(const DMCThrown* locInputMCThrown, deque<const DNeutralParticleHypothesis*>& locMatchingNeutralHypotheses, double& locMatchFOM) const
236 {
237  locMatchingNeutralHypotheses.clear();
238  map<const DMCThrown*, pair<deque<const DNeutralParticleHypothesis*>, double> >::const_iterator locIterator = dThrownToNeutralHypoMap.find(locInputMCThrown);
239  if(locIterator == dThrownToNeutralHypoMap.end())
240  return false;
241  locMatchFOM = locIterator->second.second;
242  locMatchingNeutralHypotheses = locIterator->second.first;
243  return true;
244 }
245 
246 inline const DNeutralParticle* DMCThrownMatching::Get_MatchingNeutralParticle(const DMCThrown* locInputMCThrown, double& locMatchFOM) const
247 {
248  map<const DMCThrown*, pair<const DNeutralParticle*, double> >::const_iterator locIterator = dThrownToNeutralMap.find(locInputMCThrown);
249  if(locIterator == dThrownToNeutralMap.end())
250  return NULL;
251  locMatchFOM = locIterator->second.second;
252  return locIterator->second.first;
253 }
254 
255 inline const DMCThrown* DMCThrownMatching::Get_MatchingMCThrown(const DChargedTrackHypothesis* locChargedTrackHypothesis, double& locMatchFOM) const
256 {
257  map<const DChargedTrackHypothesis*, pair<const DMCThrown*, double> >::const_iterator locIterator = dChargedHypoToThrownMap.find(locChargedTrackHypothesis);
258  if(locIterator != dChargedHypoToThrownMap.end())
259  {
260  locMatchFOM = locIterator->second.second;
261  return locIterator->second.first;
262  }
263 
264  //perhaps this is an object produced from the factories with the "KinFit" or "Combo" flags: try the source object
265  vector<const DChargedTrack*> locAssociatedChargedTracks;
266  locChargedTrackHypothesis->Get(locAssociatedChargedTracks);
267  for(size_t loc_i = 0; loc_i < locAssociatedChargedTracks.size(); ++loc_i)
268  {
269  const DMCThrown* locMCThrown = Get_MatchingMCThrown(locAssociatedChargedTracks[loc_i], locMatchFOM);
270  if(locMCThrown != NULL)
271  return locMCThrown;
272  }
273  return NULL;
274 }
275 
276 inline const DMCThrown* DMCThrownMatching::Get_MatchingMCThrown(const DChargedTrack* locChargedTrack, double& locMatchFOM) const
277 {
278  auto locIterator = dChargedToThrownMap.find(locChargedTrack);
279  if(locIterator != dChargedToThrownMap.end())
280  {
281  locMatchFOM = locIterator->second.second;
282  return locIterator->second.first;
283  }
284 
285  //See if there's an associated charged track (e.g. input is "Combo" factory charged track, but matching done with default-factory objects
286  vector<const DChargedTrack*> locAssocTracks;
287  locChargedTrack->Get(locAssocTracks);
288  if(locAssocTracks.empty())
289  return NULL;
290 
291  return Get_MatchingMCThrown(locAssocTracks[0], locMatchFOM);
292 }
293 
294 inline const DMCThrown* DMCThrownMatching::Get_MatchingMCThrown(const DNeutralParticleHypothesis* locNeutralParticleHypothesis, double& locMatchFOM) const
295 {
296  map<const DNeutralParticleHypothesis*, pair<const DMCThrown*, double> >::const_iterator locIterator = dNeutralHypoToThrownMap.find(locNeutralParticleHypothesis);
297  if(locIterator != dNeutralHypoToThrownMap.end())
298  {
299  locMatchFOM = locIterator->second.second;
300  return locIterator->second.first;
301  }
302 
303  const DNeutralShower* locAssociatedNeutralShower_Input = locNeutralParticleHypothesis->Get_NeutralShower();
304  if(locAssociatedNeutralShower_Input == NULL)
305  return NULL;
306 
307  //look for a particle with the same source object
308  map<const DNeutralParticle*, pair<const DMCThrown*, double> >::const_iterator locParticleIterator;
309  for(locParticleIterator = dNeutralToThrownMap.begin(); locParticleIterator != dNeutralToThrownMap.end(); ++locParticleIterator)
310  {
311  auto locAssociatedNeutralShower_Check = locParticleIterator->first->dNeutralShower;
312  if(locAssociatedNeutralShower_Check->dShowerID == locAssociatedNeutralShower_Input->dShowerID)
313  {
314  locMatchFOM = locParticleIterator->second.second;
315  return locParticleIterator->second.first;
316  }
317  }
318  return NULL;
319 }
320 
321 inline const DMCThrown* DMCThrownMatching::Get_MatchingMCThrown(const DNeutralParticle* locNeutralParticle, double& locMatchFOM) const
322 {
323  map<const DNeutralParticle*, pair<const DMCThrown*, double> >::const_iterator locIterator = dNeutralToThrownMap.find(locNeutralParticle);
324  if(locIterator == dNeutralToThrownMap.end())
325  return NULL;
326  locMatchFOM = locIterator->second.second;
327  return locIterator->second.first;
328 }
329 
330 inline const DMCThrown* DMCThrownMatching::Get_MatchingMCThrown(const DNeutralShower* locNeutralShower, double& locMatchFOM) const
331 {
332  map<const DNeutralParticle*, pair<const DMCThrown*, double> >::const_iterator locIterator = dNeutralToThrownMap.begin();
333  for(; locIterator != dNeutralToThrownMap.end(); ++locIterator)
334  {
335  if(locIterator->first->dNeutralShower != locNeutralShower)
336  continue;
337  locMatchFOM = locIterator->second.second;
338  return locIterator->second.first;
339  }
340  return NULL;
341 }
342 
343 inline const DNeutralShower* DMCThrownMatching::Get_MatchingNeutralShower(const DMCThrown* locInputMCThrown, double& locMatchFOM) const
344 {
345  map<const DMCThrown*, pair<const DNeutralParticle*, double> >::const_iterator locIterator = dThrownToNeutralMap.begin();
346  for(; locIterator != dThrownToNeutralMap.end(); ++locIterator)
347  {
348  if(locIterator->first != locInputMCThrown)
349  continue;
350  locMatchFOM = locIterator->second.second;
351  return locIterator->second.first->dNeutralShower;
352  }
353  return NULL;
354 }
355 
356 inline const DTOFPoint* DMCThrownMatching::Get_MatchingTOFPoint(const DTOFTruth* locTOFTruth, double& locMatchFOM) const
357 {
358  map<const DTOFTruth*, pair<const DTOFPoint*, double> >::const_iterator locIterator = dTOFTruthToPointMap.find(locTOFTruth);
359  if(locIterator == dTOFTruthToPointMap.end())
360  return NULL;
361  locMatchFOM = locIterator->second.second;
362  return locIterator->second.first;
363 }
364 
365 inline const DTOFTruth* DMCThrownMatching::Get_MatchingTOFTruth(const DTOFPoint* locTOFPoint, double& locMatchFOM) const
366 {
367  map<const DTOFPoint*, pair<const DTOFTruth*, double> >::const_iterator locIterator = dTOFPointToTruthMap.find(locTOFPoint);
368  if(locIterator == dTOFPointToTruthMap.end())
369  return NULL;
370  locMatchFOM = locIterator->second.second;
371  return locIterator->second.first;
372 }
373 
374 inline const DBCALShower* DMCThrownMatching::Get_MatchingBCALShower(const DBCALTruthShower* locBCALTruthShower, double& locMatchFOM) const
375 {
376  map<const DBCALTruthShower*, pair<const DBCALShower*, double> >::const_iterator locIterator = dBCALTruthToShowerMap.find(locBCALTruthShower);
377  if(locIterator == dBCALTruthToShowerMap.end())
378  return NULL;
379  locMatchFOM = locIterator->second.second;
380  return locIterator->second.first;
381 }
382 
383 inline const DBCALTruthShower* DMCThrownMatching::Get_MatchingBCALTruthShower(const DBCALShower* locBCALShower, double& locMatchFOM) const
384 {
385  map<const DBCALShower*, pair<const DBCALTruthShower*, double> >::const_iterator locIterator = dBCALShowerToTruthMap.find(locBCALShower);
386  if(locIterator == dBCALShowerToTruthMap.end())
387  return NULL;
388  locMatchFOM = locIterator->second.second;
389  return locIterator->second.first;
390 }
391 
392 inline const DFCALShower* DMCThrownMatching::Get_MatchingFCALShower(const DFCALTruthShower* locFCALTruthShower, double& locMatchFOM) const
393 {
394  map<const DFCALTruthShower*, pair<const DFCALShower*, double> >::const_iterator locIterator = dFCALTruthToShowerMap.find(locFCALTruthShower);
395  if(locIterator == dFCALTruthToShowerMap.end())
396  return NULL;
397  locMatchFOM = locIterator->second.second;
398  return locIterator->second.first;
399 }
400 
401 inline const DFCALTruthShower* DMCThrownMatching::Get_MatchingFCALTruthShower(const DFCALShower* locFCALShower, double& locMatchFOM) const
402 {
403  map<const DFCALShower*, pair<const DFCALTruthShower*, double> >::const_iterator locIterator = dFCALShowerToTruthMap.find(locFCALShower);
404  if(locIterator == dFCALShowerToTruthMap.end())
405  return NULL;
406  locMatchFOM = locIterator->second.second;
407  return locIterator->second.first;
408 }
409 
410 #endif // _DMCThrownMatching_
411 
void Set_ThrownToChargedMap(const map< const DMCThrown *, pair< const DChargedTrack *, double > > &locThrownToChargedMap)
void Set_ThrownToNeutralMap(const map< const DMCThrown *, pair< const DNeutralParticle *, double > > &locThrownToNeutralMap)
map< const DMCThrown *, pair< deque< const DChargedTrackHypothesis * >, double > > dThrownToChargedHypoMap
const DBeamPhoton * dTaggedMCGENBeamPhoton
map< const DMCThrown *, pair< deque< const DNeutralParticleHypothesis * >, double > > dThrownToNeutralHypoMap
void Set_FCALTruthToShowerMap(map< const DFCALTruthShower *, pair< const DFCALShower *, double > > &locFCALTruthToShowerMap)
void Set_FCALShowerToTruthMap(map< const DFCALShower *, pair< const DFCALTruthShower *, double > > &locFCALShowerToTruthMap)
void Get_ThrownToChargedMap(map< const DMCThrown *, pair< const DChargedTrack *, double > > &locThrownToChargedMap) const
const DBeamPhoton * Get_MatchingTruthPhoton(const DBeamPhoton *locReconBeamPhoton) const
map< const DBCALTruthShower *, pair< const DBCALShower *, double > > dBCALTruthToShowerMap
const DBeamPhoton * Get_MatchingReconPhoton(const DBeamPhoton *locTruthBeamPhoton) const
void Set_NeutralHypoToThrownMap(const map< const DNeutralParticleHypothesis *, pair< const DMCThrown *, double > > &locNeutralHypoToThrownMap)
void Get_BCALTruthToShowerMap(map< const DBCALTruthShower *, pair< const DBCALShower *, double > > &locBCALTruthToShowerMap) const
map< const DChargedTrack *, pair< const DMCThrown *, double > > dChargedToThrownMap
void Get_ChargedToThrownMap(map< const DChargedTrack *, pair< const DMCThrown *, double > > &locChargedToThrownMap) const
void Set_BCALTruthToShowerMap(map< const DBCALTruthShower *, pair< const DBCALShower *, double > > &locBCALTruthToShowerMap)
const DBeamPhoton * Get_MCGENBeamPhoton(void) const
map< const DBeamPhoton *, const DBeamPhoton * > dBeamPhotonToTruthMap
map< const DBCALShower *, pair< const DBCALTruthShower *, double > > dBCALShowerToTruthMap
void Set_TOFTruthToPointMap(const map< const DTOFTruth *, pair< const DTOFPoint *, double > > &locTOFTruthToPointMap)
map< const DFCALTruthShower *, pair< const DFCALShower *, double > > dFCALTruthToShowerMap
const DNeutralShower * Get_NeutralShower(void) const
void Set_TaggedMCGENBeamPhoton(const DBeamPhoton *locBeamPhoton)
const DFCALShower * Get_MatchingFCALShower(const DFCALTruthShower *locFCALTruthShower, double &locMatchFOM) const
void Set_ThrownToChargedHypoMap(const map< const DMCThrown *, pair< deque< const DChargedTrackHypothesis * >, double > > &locThrownToChargedHypoMap)
map< const DMCThrown *, pair< const DChargedTrack *, double > > dThrownToChargedMap
map< const DChargedTrackHypothesis *, pair< const DMCThrown *, double > > dChargedHypoToThrownMap
void Get_NeutralToThrownMap(map< const DNeutralParticle *, pair< const DMCThrown *, double > > &locNeutralToThrownMap) const
void Set_ThrownToNeutralHypoMap(const map< const DMCThrown *, pair< deque< const DNeutralParticleHypothesis * >, double > > &locThrownToNeutralHypoMap)
const DTOFPoint * Get_MatchingTOFPoint(const DTOFTruth *locTOFTruth, double &locMatchFOM) const
bool Get_MatchingChargedHypotheses(const DMCThrown *locInputMCThrown, deque< const DChargedTrackHypothesis * > &locMatchingChargedHypotheses, double &locMatchFOM) const
const DChargedTrack * Get_MatchingChargedTrack(const DMCThrown *locInputMCThrown, double &locMatchFOM) const
map< const DTOFPoint *, pair< const DTOFTruth *, double > > dTOFPointToTruthMap
void Get_TOFTruthToPointMap(map< const DTOFTruth *, pair< const DTOFPoint *, double > > &locTOFTruthToPointMap) const
void Get_ChargedHypoToThrownMap(map< const DChargedTrackHypothesis *, pair< const DMCThrown *, double > > &locChargedHypoToThrownMap) const
const DNeutralShower * Get_MatchingNeutralShower(const DMCThrown *locInputMCThrown, double &locMatchFOM) const
void Set_BeamTruthToPhotonMap(map< const DBeamPhoton *, const DBeamPhoton * > &locBeamTruthToPhotonMap)
const DBeamPhoton * Get_TaggedMCGENBeamPhoton(void) const
void Set_TOFPointToTruthMap(const map< const DTOFPoint *, pair< const DTOFTruth *, double > > &locTOFPointToTruthMap)
const DNeutralParticle * Get_MatchingNeutralParticle(const DMCThrown *locInputMCThrown, double &locMatchFOM) const
map< const DBeamPhoton *, const DBeamPhoton * > dBeamTruthToPhotonMap
const DBCALTruthShower * Get_MatchingBCALTruthShower(const DBCALShower *locBCALShower, double &locMatchFOM) const
void Get_TOFPointToTruthMap(map< const DTOFPoint *, pair< const DTOFTruth *, double > > &locTOFPointToTruthMap) const
void Set_ChargedToThrownMap(const map< const DChargedTrack *, pair< const DMCThrown *, double > > &locChargedToThrownMap)
const DTOFTruth * Get_MatchingTOFTruth(const DTOFPoint *locTOFPoint, double &locMatchFOM) const
void Set_NeutralToThrownMap(const map< const DNeutralParticle *, pair< const DMCThrown *, double > > &locNeutralToThrownMap)
void Get_FCALTruthToShowerMap(map< const DFCALTruthShower *, pair< const DFCALShower *, double > > &locFCALTruthToShowerMap) const
void Get_NeutralHypoToThrownMap(map< const DNeutralParticleHypothesis *, pair< const DMCThrown *, double > > &locNeutralHypoToThrownMap) const
map< const DFCALShower *, pair< const DFCALTruthShower *, double > > dFCALShowerToTruthMap
void Get_ThrownToNeutralMap(map< const DMCThrown *, pair< const DNeutralParticle *, double > > &locThrownToNeutralMap) const
void Set_MCGENBeamPhoton(const DBeamPhoton *locBeamPhoton)
const DFCALTruthShower * Get_MatchingFCALTruthShower(const DFCALShower *locFCALShower, double &locMatchFOM) const
void Get_BCALShowerToTruthMap(map< const DBCALShower *, pair< const DBCALTruthShower *, double > > &locBCALShowerToTruthMap) const
const DBeamPhoton * dMCGENBeamPhoton
void Set_ChargedHypoToThrownMap(const map< const DChargedTrackHypothesis *, pair< const DMCThrown *, double > > &locChargedHypoToThrownMap)
void Set_BeamPhotonToTruthMap(map< const DBeamPhoton *, const DBeamPhoton * > &locBeamPhotonToTruthMap)
const DBCALShower * Get_MatchingBCALShower(const DBCALTruthShower *locBCALTruthShower, double &locMatchFOM) const
map< const DMCThrown *, pair< const DNeutralParticle *, double > > dThrownToNeutralMap
void Get_ThrownToChargedHypoMap(map< const DMCThrown *, pair< deque< const DChargedTrackHypothesis * >, double > > &locThrownToChargedHypoMap) const
map< const DNeutralParticle *, pair< const DMCThrown *, double > > dNeutralToThrownMap
void Set_BCALShowerToTruthMap(map< const DBCALShower *, pair< const DBCALTruthShower *, double > > &locBCALShowerToTruthMap)
void Get_FCALShowerToTruthMap(map< const DFCALShower *, pair< const DFCALTruthShower *, double > > &locFCALShowerToTruthMap) const
map< const DTOFTruth *, pair< const DTOFPoint *, double > > dTOFTruthToPointMap
bool Get_MatchingNeutralHypotheses(const DMCThrown *locInputMCThrown, deque< const DNeutralParticleHypothesis * > &locMatchingNeutralHypotheses, double &locMatchFOM) const
const DChargedTrackHypothesis * Get_MatchingChargedHypothesis(const DMCThrown *locInputMCThrown, double &locMatchFOM) const
const DNeutralParticleHypothesis * Get_MatchingNeutralHypothesis(const DMCThrown *locInputMCThrown, double &locMatchFOM) const
map< const DNeutralParticleHypothesis *, pair< const DMCThrown *, double > > dNeutralHypoToThrownMap
Particle_t PID(void) const
const DMCThrown * Get_MatchingMCThrown(const DChargedTrackHypothesis *locChargedTrackHypothesis, double &locMatchFOM) const
void Get_ThrownToNeutralHypoMap(map< const DMCThrown *, pair< deque< const DNeutralParticleHypothesis * >, double > > &locThrownToNeutralHypoMap) const