Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DCutActions.cc
Go to the documentation of this file.
1 #ifdef VTRACE
2 #include "vt_user.h"
3 #endif
4 
5 #include "ANALYSIS/DCutActions.h"
6 
7 void DCutAction_MinTrackHits::Initialize(JEventLoop* locEventLoop)
8 {
9  locEventLoop->GetSingle(dParticleID);
10 }
11 
13 {
14  ostringstream locStream;
15  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinTrackHits;
16  return locStream.str();
17 }
18 
19 bool DCutAction_MinTrackHits::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
20 {
21  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
22  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
23  {
24  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
25  auto locTrackTimeBased = locChargedTrackHypothesis->Get_TrackTimeBased();
26 
27  set<int> locCDCRings, locFDCPlanes;
28  dParticleID->Get_CDCRings(locTrackTimeBased->dCDCRings, locCDCRings);
29  dParticleID->Get_FDCPlanes(locTrackTimeBased->dFDCPlanes, locFDCPlanes);
30  unsigned int locNumTrackHits = locCDCRings.size() + locFDCPlanes.size();
31  if(locNumTrackHits < dMinTrackHits)
32  return false;
33  }
34  return true;
35 }
36 
38 {
39  ostringstream locStream;
40  locStream << DAnalysisAction::Get_ActionName() << "_" << dExclusiveMatchFlag;
41  return locStream.str();
42 }
43 
44 void DCutAction_ThrownTopology::Initialize(JEventLoop* locEventLoop)
45 {
46  locEventLoop->GetSingle(dAnalysisUtilities);
47 }
48 
49 bool DCutAction_ThrownTopology::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
50 {
52 }
53 
54 bool DCutAction_AllTracksHaveDetectorMatch::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
55 {
56  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
57  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
58  {
59  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
60  if(locChargedTrackHypothesis->Get_SCHitMatchParams() != NULL)
61  continue;
62  if(locChargedTrackHypothesis->Get_TOFHitMatchParams() != NULL)
63  continue;
64  if(locChargedTrackHypothesis->Get_BCALShowerMatchParams() != NULL)
65  continue;
66  if(locChargedTrackHypothesis->Get_FCALShowerMatchParams() != NULL)
67  continue;
68  return false;
69  }
70  return true;
71 }
72 
74 {
75  ostringstream locStream;
76  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumConfidenceLevel;
77  return locStream.str();
78 }
79 
80 bool DCutAction_PIDFOM::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
81 {
82  auto locSteps = locParticleCombo->Get_ParticleComboSteps();
83  for(size_t loc_i = 0; loc_i < locSteps.size(); ++loc_i)
84  {
86  continue;
87  auto locParticles = locSteps[loc_i]->Get_FinalParticles_Measured(Get_Reaction()->Get_ReactionStep(loc_i), d_AllCharges);
88  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
89  {
90  if((locParticles[loc_j]->PID() != dParticleID) && (dParticleID != Unknown))
91  continue;
92  if(ParticleCharge(dParticleID) == 0)
93  {
94  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
95  if((locNeutralParticleHypothesis->Get_FOM() < dMinimumConfidenceLevel) && (locNeutralParticleHypothesis->Get_NDF() > 0))
96  return false;
97  if(dCutNDFZeroFlag && (locNeutralParticleHypothesis->Get_NDF() == 0))
98  return false;
99  }
100  else
101  {
102  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
103  if((locChargedTrackHypothesis->Get_FOM() < dMinimumConfidenceLevel) && (locChargedTrackHypothesis->Get_NDF() > 0))
104  return false;
105  if(dCutNDFZeroFlag && (locChargedTrackHypothesis->Get_NDF() == 0))
106  return false;
107  }
108  }
109  }
110  return true;
111 }
112 
114 {
115  ostringstream locStream;
116  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumConfidenceLevel;
117  return locStream.str();
118 }
119 
120 bool DCutAction_EachPIDFOM::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
121 {
122  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
123  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
124  {
125  if(ParticleCharge(locParticles[loc_i]->PID()) == 0)
126  {
127  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
128  if(dCutNDFZeroFlag && (locNeutralParticleHypothesis->Get_NDF() == 0))
129  return false;
130  if((locNeutralParticleHypothesis->Get_FOM() < dMinimumConfidenceLevel) && (locNeutralParticleHypothesis->Get_NDF() > 0))
131  return false;
132  }
133  else
134  {
135  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
136  if(dCutNDFZeroFlag && (locChargedTrackHypothesis->Get_NDF() == 0))
137  return false;
138  if((locChargedTrackHypothesis->Get_FOM() < dMinimumConfidenceLevel) && (locChargedTrackHypothesis->Get_NDF() > 0))
139  return false;
140  }
141  }
142  return true;
143 }
144 
146 {
147  ostringstream locStream;
148  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumConfidenceLevel;
149  return locStream.str();
150 }
151 
152 bool DCutAction_CombinedPIDFOM::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
153 {
154  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
155 
156  unsigned int locTotalNDF = 0;
157  double locTotalChiSq = 0.0;
158  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
159  {
160  if(ParticleCharge(locParticles[loc_i]->PID()) == 0)
161  {
162  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
163  if(dCutNDFZeroFlag && (locNeutralParticleHypothesis->Get_NDF() == 0))
164  return false;
165  locTotalNDF += locNeutralParticleHypothesis->Get_NDF();
166  locTotalChiSq += locNeutralParticleHypothesis->Get_ChiSq();
167  }
168  else
169  {
170  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
171  if(dCutNDFZeroFlag && (locChargedTrackHypothesis->Get_NDF() == 0))
172  return false;
173  locTotalNDF += locChargedTrackHypothesis->Get_NDF();
174  locTotalChiSq += locChargedTrackHypothesis->Get_ChiSq();
175  }
176  }
177  return ((locTotalNDF == 0) ? true : (TMath::Prob(locTotalChiSq, locTotalNDF) >= dMinimumConfidenceLevel));
178 }
179 
181 {
182  ostringstream locStream;
183  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumConfidenceLevel;
184  return locStream.str();
185 }
186 
187 bool DCutAction_CombinedTrackingFOM::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
188 {
189  unsigned int locTotalNDF = 0;
190  double locTotalChiSq = 0.0;
191 
192  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
193  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
194  {
195  auto locTrackTimeBased = (dynamic_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]))->Get_TrackTimeBased();
196  locTotalNDF += locTrackTimeBased->Ndof;
197  locTotalChiSq += locTrackTimeBased->chisq;
198  }
199 
200  return ((locTotalNDF == 0) ? true : (TMath::Prob(locTotalChiSq, locTotalNDF) >= dMinimumConfidenceLevel));
201 }
202 
204 {
205  ostringstream locStream;
206  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumMissingMass << "_" << dMaximumMissingMass;
207  return locStream.str();
208 }
209 
210 void DCutAction_MissingMass::Initialize(JEventLoop* locEventLoop)
211 {
212  locEventLoop->GetSingle(dAnalysisUtilities);
213 }
214 
215 bool DCutAction_MissingMass::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
216 {
217  //build all possible combinations of the included pids
218  set<set<size_t> > locIndexCombos = dAnalysisUtilities->Build_IndexCombos(Get_Reaction()->Get_ReactionStep(dMissingMassOffOfStepIndex), dMissingMassOffOfPIDs);
219 
220  //loop over them: Must fail ALL to fail. if any succeed, return true
221  set<set<size_t> >::iterator locComboIterator = locIndexCombos.begin();
222  for(; locComboIterator != locIndexCombos.end(); ++locComboIterator)
223  {
224  DLorentzVector locMissingP4 = dAnalysisUtilities->Calc_MissingP4(Get_Reaction(), locParticleCombo, 0, dMissingMassOffOfStepIndex, *locComboIterator, Get_UseKinFitResultsFlag());
225  double locMissingMass = locMissingP4.M();
226  if((locMissingMass >= dMinimumMissingMass) && (locMissingMass <= dMaximumMissingMass))
227  return true;
228  }
229 
230  return false; //all failed
231 }
232 
234 {
235  ostringstream locStream;
236  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumMissingMassSq << "_" << dMaximumMissingMassSq;
237  return locStream.str();
238 }
239 
240 void DCutAction_MissingMassSquared::Initialize(JEventLoop* locEventLoop)
241 {
242  locEventLoop->GetSingle(dAnalysisUtilities);
243 }
244 
245 bool DCutAction_MissingMassSquared::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
246 {
247  //build all possible combinations of the included pids
248  set<set<size_t> > locIndexCombos = dAnalysisUtilities->Build_IndexCombos(Get_Reaction()->Get_ReactionStep(dMissingMassOffOfStepIndex), dMissingMassOffOfPIDs);
249 
250  //loop over them: Must fail ALL to fail. if any succeed, return true
251  set<set<size_t> >::iterator locComboIterator = locIndexCombos.begin();
252  for(; locComboIterator != locIndexCombos.end(); ++locComboIterator)
253  {
254  DLorentzVector locMissingP4 = dAnalysisUtilities->Calc_MissingP4(Get_Reaction(), locParticleCombo, 0, dMissingMassOffOfStepIndex, *locComboIterator, Get_UseKinFitResultsFlag());
255  double locMissingMassSq = locMissingP4.M2();
256  if((locMissingMassSq >= dMinimumMissingMassSq) && (locMissingMassSq <= dMaximumMissingMassSq))
257  return true;
258  }
259 
260  return false; //all failed
261 }
262 
264 {
265  ostringstream locStream;
266  locStream << DAnalysisAction::Get_ActionName() << "_" << dInitialPID << "_" << dMinMass << "_" << dMaxMass;
267  return locStream.str();
268 }
269 
270 void DCutAction_InvariantMass::Initialize(JEventLoop* locEventLoop)
271 {
272  locEventLoop->GetSingle(dAnalysisUtilities);
273 }
274 
275 bool DCutAction_InvariantMass::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
276 {
277  for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i)
278  {
279  const DReactionStep* locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i);
280  if((dInitialPID != Unknown) && (locReactionStep->Get_InitialPID() != dInitialPID))
281  continue;
282  if((dStepIndex != -1) && (int(loc_i) != dStepIndex))
283  continue;
284 
285  //build all possible combinations of the included pids
286  set<set<size_t> > locIndexCombos = dAnalysisUtilities->Build_IndexCombos(locReactionStep, dToIncludePIDs);
287 
288  //loop over them: Must fail ALL to fail. if any succeed, go to the next step
289  set<set<size_t> >::iterator locComboIterator = locIndexCombos.begin();
290  bool locAnyOKFlag = false;
291  for(; locComboIterator != locIndexCombos.end(); ++locComboIterator)
292  {
293  DLorentzVector locFinalStateP4 = dAnalysisUtilities->Calc_FinalStateP4(Get_Reaction(), locParticleCombo, loc_i, *locComboIterator, Get_UseKinFitResultsFlag());
294  double locInvariantMass = locFinalStateP4.M();
295  if((locInvariantMass > dMaxMass) || (locInvariantMass < dMinMass))
296  continue;
297  locAnyOKFlag = true;
298  break;
299  }
300  if(!locAnyOKFlag)
301  return false;
302  }
303 
304  return true;
305 }
306 
308 {
309  ostringstream locStream;
310  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinVertexZ << "_" << dMaxVertexZ;
311  return locStream.str();
312 }
313 
314 bool DCutAction_AllVertexZ::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
315 {
316  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
317  double locVertexZ;
318  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
319  {
320  locVertexZ = locParticles[loc_i]->position().Z();
321  if((locVertexZ < dMinVertexZ) || (locVertexZ > dMaxVertexZ))
322  return false;
323  }
324  return true;
325 }
326 
328 {
329  ostringstream locStream;
330  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinVertexZ << "_" << dMaxVertexZ;
331  return locStream.str();
332 }
333 
334 bool DCutAction_ProductionVertexZ::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
335 {
336  const DParticleComboStep* locStep = locParticleCombo->Get_ParticleComboStep(0);
337  double locVertexZ = locStep->Get_Position().Z();
338  return ((locVertexZ >= dMinVertexZ) && (locVertexZ <= dMaxVertexZ));
339 }
340 
342 {
343  ostringstream locStream;
344  locStream << DAnalysisAction::Get_ActionName() << "_" << dMaxTrackDOCA;
345  return locStream.str();
346 }
347 
348 void DCutAction_MaxTrackDOCA::Initialize(JEventLoop* locEventLoop)
349 {
350  locEventLoop->GetSingle(dAnalysisUtilities);
351 }
352 
353 bool DCutAction_MaxTrackDOCA::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
354 {
355  //should be improved...: the particles at a given vertex may span several steps
356  auto locSteps = locParticleCombo->Get_ParticleComboSteps();
357  for(size_t loc_i = 0; loc_i < locSteps.size(); ++loc_i)
358  {
360  continue;
361  auto locParticles = locSteps[loc_i]->Get_FinalParticles_Measured(Get_Reaction()->Get_ReactionStep(loc_i), d_Charged);
362  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
363  {
364  for(size_t loc_k = loc_j + 1; loc_k < locParticles.size(); ++loc_k)
365  {
366  auto locDOCA = dAnalysisUtilities->Calc_DOCA(locParticles[loc_j], locParticles[loc_k]);
367  if(locDOCA > dMaxTrackDOCA)
368  return false;
369  }
370  }
371  }
372  return true;
373 }
374 
376 {
377  ostringstream locStream;
378  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinimumConfidenceLevel;
379  return locStream.str();
380 }
381 
382 bool DCutAction_KinFitFOM::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
383 {
384  const DKinFitResults* locKinFitResults = locParticleCombo->Get_KinFitResults();
385  if(locKinFitResults == NULL)
386  return false;
387  return (locKinFitResults->Get_ConfidenceLevel() > dMinimumConfidenceLevel);
388 }
389 
390 void DCutAction_BDTSignalCombo::Initialize(JEventLoop* locEventLoop)
391 {
394  locEventLoop->GetSingle(dAnalysisUtilities);
395 }
396 
397 bool DCutAction_BDTSignalCombo::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
398 {
399 #ifdef VTRACE
400  VT_TRACER("DCutAction_BDTSignalCombo::Perform_Action()");
401 #endif
402 
403  vector<const DMCThrownMatching*> locMCThrownMatchingVector;
404  locEventLoop->Get(locMCThrownMatchingVector);
405  if(locMCThrownMatchingVector.empty())
406  return false; //not a simulated event
407  const DMCThrownMatching* locMCThrownMatching = locMCThrownMatchingVector[0];
408 
409  //Check DReaction vs thrown (i.e. not combo contents)
411  return false;
412 
413  //Do we need to pick the beam photon? If so, look for it
415  if(locPID == Gamma)
416  {
417  if(!(*dCutAction_TrueBeamParticle)(locEventLoop, locParticleCombo))
418  return false; //needed the true beam photon, didn't have it
419  }
420 
421  //get & organize throwns
422  vector<const DMCThrown*> locMCThrowns;
423  locEventLoop->Get(locMCThrowns);
424 
425  map<int, const DMCThrown*> locMCThrownMyIDMap; //map of myid -> thrown
426  for(size_t loc_i = 0; loc_i < locMCThrowns.size(); ++loc_i)
427  locMCThrownMyIDMap[locMCThrowns[loc_i]->myid] = locMCThrowns[loc_i];
428 
429  //OK, now need to check and see if the particles have the right PID & the right parent chain
430  for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i)
431  {
432  const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i);
433  auto locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i);
434 
435  auto locParticles = locParticleComboStep->Get_FinalParticles_Measured(locReactionStep, d_AllCharges);
436  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
437  {
438  const DMCThrown* locMCThrown = NULL;
439  double locMatchFOM = 0.0;
440  if(ParticleCharge(locParticles[loc_j]->PID()) == 0)
441  {
442  //check if good neutral & PID
443  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_j]);
444  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locNeutralParticleHypothesis, locMatchFOM);
445  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
446  return false; //not matched
447  if(((Particle_t)locMCThrown->type) != locParticles[loc_j]->PID())
448  return false; //bad PID
449  }
450  else
451  {
452  //check if good track & PID
453  double locMatchFOM = 0.0;
454  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_j]);
455  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locChargedTrackHypothesis, locMatchFOM);
456  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
457  return false; //not matched
458  if(((Particle_t)locMCThrown->type) != locParticles[loc_j]->PID())
459  return false; //bad PID
460  }
461 
462  //check if parent is correct
463  auto locParentSearchReactionStep = locReactionStep;
464  int locParentID = locMCThrown->parentid;
465  int locSearchStepIndex = loc_i;
466 
467  do
468  {
469  if(locParentID == -1)
470  return false; //parent particle is not listed: matched to knock-out particle, is wrong. bail
471 
472  if(locParentID == 0)
473  {
474  //parent id of 0 is directly produced
475  Particle_t locInitPID = locParentSearchReactionStep->Get_InitialPID();
476  if((locInitPID == phiMeson) || (locInitPID == omega))
477  {
478  //these particles are not constrained: check their parent step instead
479  locSearchStepIndex = DAnalysis::Get_InitialParticleDecayFromIndices(Get_Reaction(), locSearchStepIndex).first;
480  locReactionStep = Get_Reaction()->Get_ReactionStep(locSearchStepIndex);
481  continue;
482  }
483  if(locInitPID != Gamma)
484  return false; //was directly (photo-) produced, but not so in combo: bail
485  break; //good: this is the only "good" exit point of the do-loop
486  }
487 
488  const DMCThrown* locMCThrownParent = locMCThrownMyIDMap[locParentID];
489  Particle_t locPID = locMCThrownParent->PID();
490  if((locPID == Unknown) || IsResonance(locPID) || (locPID == omega) || (locPID == phiMeson))
491  {
492  //intermediate (unknown, resonance, phi, or omega) particle: go to its parent
493  locParentID = locMCThrownParent->parentid;
494  continue;
495  }
496 
497  if(locPID != locParentSearchReactionStep->Get_InitialPID())
498  {
499  //the true particle was produced from a different parent
501  return false; //will not consider intermediate decays: bail
502 
503  //it could still be BDT signal, if the thrown parent eventually came from the combo parent particle
504  //treat as an intermediate decaying particle: go to its parent
505  locParentID = locMCThrownParent->parentid;
506  continue;
507  }
508 
509  //OK, we've determined that the particle in question decayed from the correct particle.
510  //HOWEVER, we need to determine whether the PARENT decayed from the correct particle (and on(back)wards until the production step)
511  locParentID = locMCThrownParent->parentid;
512  locSearchStepIndex = DAnalysis::Get_InitialParticleDecayFromIndices(Get_Reaction(), locSearchStepIndex).first;
513  locReactionStep = Get_Reaction()->Get_ReactionStep(locSearchStepIndex);
514  }
515  while(true);
516  }
517  }
518 
519  return true; //we made it!
520 }
521 
523 {
524  if(dCutAction_TrueBeamParticle != NULL)
526 }
527 
528 void DCutAction_TrueCombo::Initialize(JEventLoop* locEventLoop)
529 {
533  dCutAction_ThrownTopology->Initialize(locEventLoop);
534 }
535 
536 bool DCutAction_TrueCombo::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
537 {
538 #ifdef VTRACE
539  VT_TRACER("DCutAction_TrueCombo::Perform_Action()");
540 #endif
541 
542  vector<const DMCThrownMatching*> locMCThrownMatchingVector;
543  locEventLoop->Get(locMCThrownMatchingVector);
544  if(locMCThrownMatchingVector.empty())
545  return false; //not a simulated event
546  const DMCThrownMatching* locMCThrownMatching = locMCThrownMatchingVector[0];
547 
548  if(!(*dCutAction_ThrownTopology)(locEventLoop, locParticleCombo))
549  return false; //not the thrown topology: bail
550 
551  //Do we need to pick the beam photon? If so, look for it
553  {
554  if(!(*dCutAction_TrueBeamParticle)(locEventLoop, locParticleCombo))
555  return false; //needed the true beam photon, didn't have it
556  }
557 
558  //get & organize throwns
559  vector<const DMCThrown*> locMCThrowns;
560  locEventLoop->Get(locMCThrowns);
561 
562  map<int, const DMCThrown*> locMCThrownMyIDMap; //map of myid -> thrown
563  for(size_t loc_i = 0; loc_i < locMCThrowns.size(); ++loc_i)
564  locMCThrownMyIDMap[locMCThrowns[loc_i]->myid] = locMCThrowns[loc_i];
565 
566  //OK, now need to check and see if the particles have the right PID & the right parent chain
567  for(size_t loc_i = 0; loc_i < locParticleCombo->Get_NumParticleComboSteps(); ++loc_i)
568  {
569  const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(loc_i);
570  auto locReactionStep = Get_Reaction()->Get_ReactionStep(loc_i);
571 
572  auto locParticles = locParticleComboStep->Get_FinalParticles_Measured(locReactionStep, d_AllCharges);
573  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
574  {
575  const DMCThrown* locMCThrown = NULL;
576  double locMatchFOM = 0.0;
577  if(ParticleCharge(locParticles[loc_j]->PID()) == 0)
578  {
579  //check if good neutral & PID
580  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_j]);
581  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locNeutralParticleHypothesis, locMatchFOM);
582  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
583  return false; //not matched
584  if(((Particle_t)locMCThrown->type) != locParticles[loc_j]->PID())
585  return false; //bad PID
586  }
587  else
588  {
589  //check if good track & PID
590  double locMatchFOM = 0.0;
591  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_j]);
592  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locChargedTrackHypothesis, locMatchFOM);
593  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
594  return false; //not matched
595  if(((Particle_t)locMCThrown->type) != locParticles[loc_j]->PID())
596  return false; //bad PID
597  }
598 
599  //check if parent is correct
600  auto locParentSearchReactionStep = locReactionStep;
601  int locParentID = locMCThrown->parentid;
602  int locSearchStepIndex = loc_i;
603 
604  do
605  {
606  if(locParentID == -1)
607  return false; //parent particle is not listed: matched to knock-out particle, is wrong. bail
608  if(locParentID == 0)
609  {
610  //parent id of 0 is directly produced
611  if(locParentSearchReactionStep->Get_InitialPID() != Gamma)
612  return false; //was directly (photo-) produced, but not so in combo: bail
613  break; //good: this is the only "good" exit point of the do-loop
614  }
615 
616  const DMCThrown* locMCThrownParent = locMCThrownMyIDMap[locParentID];
617  Particle_t locPID = locMCThrownParent->PID();
618  if((locPID == Unknown) || IsResonance(locPID))
619  {
620  //intermediate (unknown or resonance) particle: go to its parent
621  locParentID = locMCThrownParent->parentid;
622  continue;
623  }
624  if(locPID != locParentSearchReactionStep->Get_InitialPID())
625  return false; //the true particle was produced from a different parent: bail
626 
627  //OK, we've determined that the particle in question decayed from the correct particle.
628  //HOWEVER, we need to determine whether the PARENT decayed from the correct particle (and on(back)wards until the production step)
629  locParentID = locMCThrownParent->parentid;
630  locSearchStepIndex = DAnalysis::Get_InitialParticleDecayFromIndices(Get_Reaction(), locSearchStepIndex).first;
631  if(locSearchStepIndex < 0)
632  {
633  //DReaction is not the full reaction (i.e. doesn't contain beam (e.g. only pi0 decay))
635  return false;
636  break; //good
637  }
638  locParentSearchReactionStep = Get_Reaction()->Get_ReactionStep(locSearchStepIndex);
639  }
640  while(true);
641  }
642  }
643 
644  return true; //we made it!
645 }
646 
648 {
649  if(dCutAction_TrueBeamParticle != NULL)
651  if(dCutAction_ThrownTopology != NULL)
653 }
654 
655 bool DCutAction_TrueBeamParticle::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
656 {
657  vector<const DBeamPhoton*> locBeamPhotons;
658  locEventLoop->Get(locBeamPhotons, "TAGGEDMCGEN");
659  if(locBeamPhotons.empty())
660  return false; //true not tagged
661 
662  const DKinematicData* locKinematicData = locParticleCombo->Get_ParticleComboStep(0)->Get_InitialParticle_Measured();
663  if(locKinematicData == NULL)
664  return false; //initial step is not production step
665 
666  const DBeamPhoton* locBeamPhoton = dynamic_cast<const DBeamPhoton*>(locKinematicData);
667  if(locBeamPhoton == NULL)
668  return false; //dunno how could be possible ...
669 
670  double locDeltaT = fabs(locBeamPhoton->time() - locBeamPhotons[0]->time());
671  return ((locBeamPhoton->dSystem == locBeamPhotons[0]->dSystem) && (locBeamPhoton->dCounter == locBeamPhotons[0]->dCounter) && (locDeltaT < 1.0));
672 }
673 
674 bool DCutAction_TruePID::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
675 {
676  vector<const DMCThrownMatching*> locMCThrownMatchingVector;
677  locEventLoop->Get(locMCThrownMatchingVector);
678  const DMCThrownMatching* locMCThrownMatching = locMCThrownMatchingVector[0];
679 
680  auto locSteps = locParticleCombo->Get_ParticleComboSteps();
681  for(size_t loc_i = 0; loc_i < locSteps.size(); ++loc_i)
682  {
684  continue;
685  auto locParticles = locSteps[loc_i]->Get_FinalParticles_Measured(Get_Reaction()->Get_ReactionStep(loc_i), d_AllCharges);
686  for(size_t loc_j = 0; loc_j < locParticles.size(); ++loc_j)
687  {
688  if((locParticles[loc_j]->PID() != dTruePID) && (dTruePID != Unknown))
689  continue;
690 
691  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
692  {
693  if(ParticleCharge(dTruePID) == 0)
694  {
695  double locMatchFOM = 0.0;
696  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
697  auto locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locNeutralParticleHypothesis, locMatchFOM);
698  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
699  return false;
700  if(((Particle_t)locMCThrown->type) != dTruePID)
701  return false;
702  }
703  else
704  {
705  double locMatchFOM = 0.0;
706  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
707  auto locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locChargedTrackHypothesis, locMatchFOM);
708  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
709  return false;
710  if(((Particle_t)locMCThrown->type) != dTruePID)
711  return false;
712  }
713  }
714  }
715  }
716  return true;
717 }
718 
719 bool DCutAction_AllTruePID::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
720 {
721  vector<const DMCThrownMatching*> locMCThrownMatchingVector;
722  locEventLoop->Get(locMCThrownMatchingVector);
723  const DMCThrownMatching* locMCThrownMatching = locMCThrownMatchingVector[0];
724  const DMCThrown* locMCThrown;
725 
726  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
727  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
728  {
729  if(ParticleCharge(locParticles[loc_i]->PID()) == 0)
730  {
731  double locMatchFOM = 0.0;
732  const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
733  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locNeutralParticleHypothesis, locMatchFOM);
734  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
735  return false;
736  if(((Particle_t)locMCThrown->type) != locParticles[loc_i]->PID())
737  return false;
738  }
739  else
740  {
741  double locMatchFOM = 0.0;
742  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
743  locMCThrown = locMCThrownMatching->Get_MatchingMCThrown(locChargedTrackHypothesis, locMatchFOM);
744  if((locMCThrown == NULL) || (locMatchFOM < dMinThrownMatchFOM))
745  return false;
746  if(((Particle_t)locMCThrown->type) != locParticles[loc_i]->PID())
747  return false;
748  }
749  }
750  return true;
751 }
752 
754 {
755  ostringstream locStream;
756  locStream << DAnalysisAction::Get_ActionName() << "_" << dCutIfBadRFBunchFlag;
757  return locStream.str();
758 }
759 
760 bool DCutAction_GoodEventRFBunch::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
761 {
762  const DEventRFBunch* locEventRFBunch = locParticleCombo->Get_EventRFBunch();
763  return (locEventRFBunch->dTime == locEventRFBunch->dTime);
764 }
765 
767 {
768  ostringstream locStream;
769  locStream << DAnalysisAction::Get_ActionName() << "_" << dMaxTransverseMomentum;
770  return locStream.str();
771 }
772 
773 bool DCutAction_TransverseMomentum::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
774 {
775  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
776 
777  DVector3 locTotalMomentum;
778  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
779  locTotalMomentum += locParticles[loc_i]->momentum();
780 
781  return (dMaxTransverseMomentum >= locTotalMomentum.Perp());
782 }
783 
785 {
786  ostringstream locStream;
787  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinHitRingsPerCDCSuperlayer << "_" << dMinHitPlanesPerFDCPackage;
788  return locStream.str();
789 }
790 
791 bool DCutAction_TrackHitPattern::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
792 {
793  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
794 
795  const DParticleID* locParticleID = NULL;
796  locEventLoop->GetSingle(locParticleID);
797 
798  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
799  {
800  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
801  auto locTrackTimeBased = locChargedTrackHypothesis->Get_TrackTimeBased();
802  if(!Cut_TrackHitPattern(locParticleID, locTrackTimeBased))
803  return false;
804  }
805 
806  return true;
807 }
808 
809 bool DCutAction_TrackHitPattern::Cut_TrackHitPattern(const DParticleID* locParticleID, const DKinematicData* locTrack) const
810 {
811  const DTrackTimeBased* locTrackTimeBased = dynamic_cast<const DTrackTimeBased*>(locTrack);
812  const DTrackWireBased* locTrackWireBased = dynamic_cast<const DTrackWireBased*>(locTrack);
813  const DTrackCandidate* locTrackCandidate = dynamic_cast<const DTrackCandidate*>(locTrack);
814 
815  map<int, int> locNumHitRingsPerSuperlayer, locNumHitPlanesPerPackage;
816  if(locTrackTimeBased != NULL)
817  {
818  locParticleID->Get_CDCNumHitRingsPerSuperlayer(locTrackTimeBased->dCDCRings, locNumHitRingsPerSuperlayer);
819  locParticleID->Get_FDCNumHitPlanesPerPackage(locTrackTimeBased->dFDCPlanes, locNumHitPlanesPerPackage);
820  }
821  else if(locTrackWireBased != NULL)
822  {
823  locParticleID->Get_CDCNumHitRingsPerSuperlayer(locTrackWireBased->dCDCRings, locNumHitRingsPerSuperlayer);
824  locParticleID->Get_FDCNumHitPlanesPerPackage(locTrackWireBased->dFDCPlanes, locNumHitPlanesPerPackage);
825  }
826  else if(locTrackCandidate != NULL)
827  {
828  locParticleID->Get_CDCNumHitRingsPerSuperlayer(locTrackCandidate->dCDCRings, locNumHitRingsPerSuperlayer);
829  locParticleID->Get_FDCNumHitPlanesPerPackage(locTrackCandidate->dFDCPlanes, locNumHitPlanesPerPackage);
830  }
831  else
832  return false;
833 
834  //CDC: find inner-most & outer-most superlayers
835  int locInnermostCDCSuperlayer = 10, locOutermostCDCSuperlayer = 0;
836  for(auto& locSuperlayerPair : locNumHitRingsPerSuperlayer)
837  {
838  if(locSuperlayerPair.second == 0)
839  continue; //0 hits
840  if(locSuperlayerPair.first < locInnermostCDCSuperlayer)
841  locInnermostCDCSuperlayer = locSuperlayerPair.first;
842  if(locSuperlayerPair.first > locOutermostCDCSuperlayer)
843  locOutermostCDCSuperlayer = locSuperlayerPair.first;
844  }
845 
846  //CDC: loop again, cutting
847  for(auto& locSuperlayerPair : locNumHitRingsPerSuperlayer)
848  {
849  if(locSuperlayerPair.first == locOutermostCDCSuperlayer)
850  break; //don't check the last one: track could be leaving
851  if(locSuperlayerPair.first < locInnermostCDCSuperlayer)
852  continue; //don't check before the first one: could be detached vertex
853  if(locSuperlayerPair.second < int(dMinHitRingsPerCDCSuperlayer))
854  return false;
855  }
856 
857  //FDC: find inner-most & outer-most superlayers
858  int locOutermostFDCPlane = 0;
859  for(auto& locPackagePair : locNumHitPlanesPerPackage)
860  {
861  if(locPackagePair.second == 0)
862  continue; //0 hits
863  if(locPackagePair.first > locOutermostFDCPlane)
864  locOutermostFDCPlane = locPackagePair.first;
865  }
866 
867  //FDC: loop again, cutting
868  for(auto& locPackagePair : locNumHitPlanesPerPackage)
869  {
870  if(locPackagePair.first == locOutermostFDCPlane)
871  break; //don't check the last one: track could be leaving
872  if(locPackagePair.second == 0)
873  continue; //0 hits: is ok: could be curling through beamline
874  if(locPackagePair.second < int(dMinHitPlanesPerFDCPackage))
875  return false;
876  }
877 
878  if((locOutermostCDCSuperlayer <= 2) && locNumHitPlanesPerPackage.empty())
879  return false; //would have at least expected it to hit the first FDC package //is likely spurious
880 
881  return true;
882 }
883 
884 void DCutAction_dEdx::Initialize(JEventLoop* locEventLoop)
885 {
886  japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! //I have no idea why this is needed, but without it it crashes. Sigh.
887  {
888  if(dCutMap.find(Proton) == dCutMap.end())
889  {
890  dCutMap[Proton].first = new TF1("df_dEdxCut_ProtonLow", "exp(-1.0*[0]*x + [1]) + [2]", 0.0, 12.0);
891  dCutMap[Proton].first->SetParameters(3.93024, 3.0, 1.0);
892  dCutMap[Proton].second = new TF1("df_dEdxCut_ProtonHigh", "[0]", 0.0, 12.0);
893  dCutMap[Proton].second->SetParameter(0, 9999999.9);
894  }
895 
896  if(dCutMap.find(PiPlus) == dCutMap.end())
897  {
898  dCutMap[PiPlus].first = new TF1("df_dEdxCut_PionLow", "[0]", 0.0, 12.0);
899  dCutMap[PiPlus].first->SetParameter(0, -1.0);
900  dCutMap[PiPlus].second = new TF1("df_dEdxCut_PionHigh", "exp(-1.0*[0]*x + [1]) + [2]", 0.0, 12.0);
901  dCutMap[PiPlus].second->SetParameters(6.0, 2.80149, 2.55);
902  }
903  }
904  japp->RootUnLock(); //RELEASE ROOT LOCK!!
905 }
906 
907 bool DCutAction_dEdx::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
908 {
909  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
910  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
911  {
912  auto locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
913  if(!Cut_dEdx(locChargedTrackHypothesis))
914  return false;
915  }
916 
917  return true;
918 }
919 
920 bool DCutAction_dEdx::Cut_dEdx(const DChargedTrackHypothesis* locChargedTrackHypothesis)
921 {
922  auto locTrackTimeBased = locChargedTrackHypothesis->Get_TrackTimeBased();
923 
924  Particle_t locPID = locChargedTrackHypothesis->PID();
925  if(dCutMap.find(locPID) == dCutMap.end())
926  return true;
927  auto locCutPair = dCutMap[locPID];
928 
929  if(locTrackTimeBased->dNumHitsUsedFordEdx_CDC == 0)
930  return true;
931 
932  auto locP = locTrackTimeBased->momentum().Mag();
933  auto locdEdx = locTrackTimeBased->ddEdx_CDC_amp*1.0E6;
934 
935  return ((locdEdx >= locCutPair.first->Eval(locP)) && (locdEdx <= locCutPair.second->Eval(locP)));
936 }
937 
939 {
940  ostringstream locStream;
941  locStream << DAnalysisAction::Get_ActionName() << "_" << dMinBeamEnergy << "_" << dMaxBeamEnergy;
942  return locStream.str();
943 }
944 
945 bool DCutAction_BeamEnergy::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
946 {
947  const DKinematicData* locInitParticle = NULL;
949  locInitParticle = locParticleCombo->Get_ParticleComboStep(0)->Get_InitialParticle();
950  else
951  locInitParticle = locParticleCombo->Get_ParticleComboStep(0)->Get_InitialParticle_Measured();
952  if(locInitParticle == NULL)
953  return false;
954 
955  double locBeamEnergy = locInitParticle->energy();
956  return ((locBeamEnergy >= dMinBeamEnergy) && (locBeamEnergy <= dMaxBeamEnergy));
957 }
958 
960 {
961  ostringstream locStream;
962  locStream << DAnalysisAction::Get_ActionName() << "_" << dShowerEOverPCut;
963  return locStream.str();
964 }
965 
966 bool DCutAction_TrackFCALShowerEOverP::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
967 {
968  // For all charged tracks except e+/e-, cuts those with E/p > input value
969  // For e+/e-, cuts those with E/p < input value
970  // Does not cut tracks without a matching FCAL shower
971 
972  auto locParticles = Get_UseKinFitResultsFlag() ? locParticleCombo->Get_FinalParticles(Get_Reaction(), false, false, d_Charged) : locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
973  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
974  {
975  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
976  auto locFCALShowerMatchParams = locChargedTrackHypothesis->Get_FCALShowerMatchParams();
977  if(locFCALShowerMatchParams == NULL)
978  continue;
979 
980  Particle_t locPID = locChargedTrackHypothesis->PID();
981  const DFCALShower* locFCALShower = locFCALShowerMatchParams->dFCALShower;
982  double locShowerEOverP = locFCALShower->getEnergy()/locChargedTrackHypothesis->momentum().Mag();
983 
984  if((locPID == Electron) || (locPID == Positron))
985  {
986  if(locShowerEOverP < dShowerEOverPCut)
987  return false;
988  }
989  else if(locShowerEOverP > dShowerEOverPCut)
990  return false;
991  }
992 
993  return true;
994 }
995 
997 {
998  ostringstream locStream;
999  locStream << DAnalysisAction::Get_ActionName() << "_" << dDetector << "_" << dPID << "_" << dShowerEOverPCut;
1000  return locStream.str();
1001 }
1002 
1003 bool DCutAction_TrackShowerEOverP::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
1004 {
1005  // For all charged tracks except e+/e-, cuts those with E/p > input value
1006  // For e+/e-, cuts those with E/p < input value
1007  // Does not cut tracks without a matching FCAL shower
1008 
1009  auto locParticles = Get_UseKinFitResultsFlag() ? locParticleCombo->Get_FinalParticles(Get_Reaction(), false, false, d_Charged) : locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
1010  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
1011  {
1012  const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
1013 
1014  Particle_t locPID = locChargedTrackHypothesis->PID();
1015  if(locPID != dPID)
1016  continue;
1017 
1018  double locP = locChargedTrackHypothesis->momentum().Mag();
1019  double locShowerEOverP = 0.0;
1020  if(dDetector == SYS_FCAL)
1021  {
1022  auto locFCALShowerMatchParams = locChargedTrackHypothesis->Get_FCALShowerMatchParams();
1023  if(locFCALShowerMatchParams == NULL)
1024  continue;
1025 
1026  const DFCALShower* locFCALShower = locFCALShowerMatchParams->dFCALShower;
1027  locShowerEOverP = locFCALShower->getEnergy()/locP;
1028  }
1029  else if(dDetector == SYS_BCAL)
1030  {
1031  auto locBCALShowerMatchParams = locChargedTrackHypothesis->Get_BCALShowerMatchParams();
1032  if(locBCALShowerMatchParams == NULL)
1033  continue;
1034 
1035  const DBCALShower* locBCALShower = locBCALShowerMatchParams->dBCALShower;
1036  locShowerEOverP = locBCALShower->E/locP;
1037  }
1038  else
1039  continue; //what??
1040 
1041  if((locPID == Electron) || (locPID == Positron))
1042  {
1043  if(locShowerEOverP < dShowerEOverPCut)
1044  return false;
1045  }
1046  else if(locShowerEOverP > dShowerEOverPCut)
1047  return false;
1048  }
1049 
1050  return true;
1051 }
1052 
1054 {
1055  ostringstream locStream;
1056  locStream << DAnalysisAction::Get_ActionName() << "_" << dPID << "_" << dSystem << "_" << dDeltaTCut;
1057  return locStream.str();
1058 }
1059 
1060 bool DCutAction_PIDDeltaT::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
1061 {
1062  //if dPID = Unknown, apply cut to all PIDs
1063  //if dSystem = SYS_NULL, apply cut to all systems
1064 
1065  auto locParticles = Get_UseKinFitResultsFlag() ? locParticleCombo->Get_FinalParticles(Get_Reaction(), false, false, d_AllCharges) : locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
1066  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
1067  {
1068  if((dPID != Unknown) && (locParticles[loc_i]->PID() != dPID))
1069  continue;
1070 
1071  auto locChargedHypo = dynamic_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
1072  if(locChargedHypo != nullptr)
1073  {
1074  if((dSystem != SYS_NULL) && (locChargedHypo->t1_detector() != dSystem))
1075  continue;
1076 // double locDeltaT = locChargedHypo->time() - (locChargedHypo->t0() + (locChargedHypo->position().Z() - locVertex.Z())/SPEED_OF_LIGHT); //COMPARE: to old
1077  double locDeltaT = locChargedHypo->Get_TimeAtPOCAToVertex() - locChargedHypo->t0(); //UNCOMMENT WHEN DONE COMPARING
1078  if(fabs(locDeltaT) > dDeltaTCut)
1079  return false;
1080  continue;
1081  }
1082  auto locNeutralHypo = dynamic_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
1083  if(locNeutralHypo != nullptr)
1084  {
1085  if((dSystem != SYS_NULL) && (locNeutralHypo->t1_detector() != dSystem))
1086  continue;
1087  double locDeltaT = locParticles[loc_i]->time() - locNeutralHypo->t0();
1088  if(fabs(locDeltaT) > dDeltaTCut)
1089  return false;
1090  continue;
1091  }
1092  }
1093 
1094  return true;
1095 }
1096 
1098 {
1099  ostringstream locStream;
1100  locStream << DAnalysisAction::Get_ActionName() << "_" << dPID << "_" << dSystem << "_" << dMinBeta << "_" << dMaxBeta;
1101  return locStream.str();
1102 }
1103 
1104 bool DCutAction_PIDTimingBeta::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
1105 {
1106  //if dPID = Unknown, apply cut to all PIDs
1107  //if dSystem = SYS_NULL, apply cut to all systems
1108 
1109  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_AllCharges);
1110  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
1111  {
1112  if((dPID != Unknown) && (locParticles[loc_i]->PID() != dPID))
1113  continue;
1114 
1115  auto locChargedHypo = dynamic_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
1116  if(locChargedHypo != nullptr)
1117  {
1118  if((dSystem != SYS_NULL) && (locChargedHypo->t1_detector() != dSystem))
1119  continue;
1120  double locBeta = locChargedHypo->measuredBeta();
1121  if((locBeta < dMinBeta) || (locBeta > dMaxBeta))
1122  return false;
1123  continue;
1124  }
1125  auto locNeutralHypo = dynamic_cast<const DNeutralParticleHypothesis*>(locParticles[loc_i]);
1126  if(locNeutralHypo != nullptr)
1127  {
1128  if((dSystem != SYS_NULL) && (locNeutralHypo->t1_detector() != dSystem))
1129  continue;
1130  double locBeta = locNeutralHypo->measuredBeta();
1131  if((locBeta < dMinBeta) || (locBeta > dMaxBeta))
1132  return false;
1133  continue;
1134  }
1135  }
1136 
1137  return true;
1138 }
1139 
1141 {
1142  ostringstream locStream;
1143  locStream << DAnalysisAction::Get_ActionName() << "_" << dPID;
1144  return locStream.str();
1145 }
1146 
1147 bool DCutAction_NoPIDHit::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
1148 {
1149  //if dPID = Unknown, apply cut to all PIDs
1150 
1151  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
1152  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
1153  {
1154  if((dPID != Unknown) && (locParticles[loc_i]->PID() != dPID))
1155  continue;
1156  auto locChargedHypo = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
1157  if(locChargedHypo->t1_detector() == SYS_NULL)
1158  return false;
1159  }
1160 
1161  return true;
1162 }
1163 
1164 void DCutAction_OneVertexKinFit::Initialize(JEventLoop* locEventLoop)
1165 {
1166  dKinFitUtils = new DKinFitUtils_GlueX(locEventLoop);
1169 
1170  // Optional: Useful utility functions.
1171  locEventLoop->GetSingle(dAnalysisUtilities);
1172 
1173  //CREATE THE HISTOGRAMS
1174  //Since we are creating histograms, the contents of gDirectory will be modified: must use JANA-wide ROOT lock
1175  japp->RootWriteLock(); //ACQUIRE ROOT LOCK!!
1176  {
1177  //Required: Create a folder in the ROOT output file that will contain all of the output ROOT objects (if any) for this action.
1178  //If another thread has already created the folder, it just changes to it.
1180 
1181  dHist_ConfidenceLevel = GetOrCreate_Histogram<TH1I>("ConfidenceLevel", "Vertex Kinematic Fit;Confidence Level", 500, 0.0, 1.0);
1182  dHist_VertexZ = GetOrCreate_Histogram<TH1I>("VertexZ", "Vertex Kinematic Fit;Vertex-Z (cm)", 500, 0.0, 200.0);
1183  dHist_VertexYVsX = GetOrCreate_Histogram<TH2I>("VertexYVsX", "Vertex Kinematic Fit;Vertex-X (cm);Vertex-Y (cm)", 300, -10.0, 10.0, 300, -10.0, 10.0);
1184  }
1185  japp->RootUnLock(); //RELEASE ROOT LOCK!!
1186 }
1187 
1188 bool DCutAction_OneVertexKinFit::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo)
1189 {
1190  //need to call prior to use in each event (cleans up memory allocated from last event)
1191  //this call invalidates memory from previous fits (but that's OK, we aren't saving them anywhere)
1194 
1195  //Get particles for fit (all detected q+)
1196  auto locParticles = locParticleCombo->Get_FinalParticles_Measured(Get_Reaction(), d_Charged);
1197 
1198  //Make DKinFitParticle objects for each one
1199  deque<shared_ptr<DKinFitParticle>> locKinFitParticles;
1200  set<shared_ptr<DKinFitParticle>> locKinFitParticleSet;
1201  for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i)
1202  {
1203  auto locChargedTrackHypothesis = static_cast<const DChargedTrackHypothesis*>(locParticles[loc_i]);
1204  auto locKinFitParticle = dKinFitUtils->Make_DetectedParticle(locChargedTrackHypothesis);
1205  locKinFitParticles.push_back(locKinFitParticle);
1206  locKinFitParticleSet.insert(locKinFitParticle);
1207  }
1208 
1209  // vertex guess
1210  TVector3 locVertexGuess = dAnalysisUtilities->Calc_CrudeVertex(locParticles);
1211 
1212  // make & set vertex constraint
1213  auto locVertexConstraint = dKinFitUtils->Make_VertexConstraint(locKinFitParticleSet, {}, locVertexGuess);
1214  dKinFitter->Add_Constraint(locVertexConstraint);
1215 
1216  // PERFORM THE KINEMATIC FIT
1217  if(!dKinFitter->Fit_Reaction())
1218  {
1219  dKinFitter->Recycle_LastFitMemory(); //RESET MEMORY FROM LAST KINFIT!! //results no longer needed
1220  return (dMinKinFitCL < 0.0); //fit failed to converge, return false if converge required
1221  }
1222 
1223  // GET THE FIT RESULTS
1224  double locConfidenceLevel = dKinFitter->Get_ConfidenceLevel();
1225  auto locResultVertexConstraint = std::dynamic_pointer_cast<DKinFitConstraint_Vertex>(*dKinFitter->Get_KinFitConstraints().begin());
1226  TVector3 locFitVertex = locResultVertexConstraint->Get_CommonVertex();
1227 
1228  //RESET MEMORY FROM LAST KINFIT!!
1229  dKinFitter->Recycle_LastFitMemory(); //results no longer needed
1230 
1231  //FILL HISTOGRAMS
1232  //Since we are filling histograms local to this action, it will not interfere with other ROOT operations: can use action-wide ROOT lock
1233  //Note, the mutex is unique to this DReaction + action_string combo: actions of same class with different hists will have a different mutex
1234  Lock_Action(); //ACQUIRE ROOT LOCK!!
1235  {
1236  dHist_ConfidenceLevel->Fill(locConfidenceLevel);
1237  dHist_VertexZ->Fill(locFitVertex.Z());
1238  dHist_VertexYVsX->Fill(locFitVertex.X(), locFitVertex.Y());
1239  }
1240  Unlock_Action(); //RELEASE ROOT LOCK!!
1241 
1242  if(locConfidenceLevel < dMinKinFitCL)
1243  return false;
1244  if(dMinVertexZ < dMaxVertexZ) //don't cut otherwise
1245  {
1246  if((locFitVertex.Z() < dMinVertexZ) || (locFitVertex.Z() > dMaxVertexZ))
1247  return false;
1248  }
1249  return true;
1250 }
1251 
1253 {
1254  if(dKinFitter != NULL)
1255  delete dKinFitter;
1256  if(dKinFitUtils != NULL)
1257  delete dKinFitUtils;
1258 }
1259 
vector< const DKinematicData * > Get_FinalParticles_Measured(void) const
unsigned int dCounter
Definition: DBeamPhoton.h:18
void Reset_NewEvent(void)
Definition: DKinFitter.cc:71
bool Get_IsFirstStepBeam(const DReaction *locReaction)
Definition: DReaction.h:178
shared_ptr< DKinFitConstraint_Vertex > Make_VertexConstraint(const set< shared_ptr< DKinFitParticle >> &locFullConstrainParticles, const set< shared_ptr< DKinFitParticle >> &locNoConstrainParticles, TVector3 locVertexGuess=TVector3())
void Set_UpdateCovarianceMatricesFlag(bool locUpdateCovarianceMatricesFlag)
Definition: DKinFitUtils.h:52
double getEnergy() const
Definition: DFCALShower.h:156
bool Fit_Reaction(void)
Definition: DKinFitter.cc:723
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:907
void Get_FDCPlanes(unsigned int locBitPattern, set< int > &locFDCPlanes) const
Particle_t dParticleID
Definition: DCutActions.h:128
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:791
void Get_CDCRings(unsigned int locBitPattern, set< int > &locCDCRings) const
DCutAction_TrueBeamParticle * dCutAction_TrueBeamParticle
Definition: DCutActions.h:245
TVector3 Get_CommonVertex(void) const
unsigned int dMinHitPlanesPerFDCPackage
Definition: DCutActions.h:520
string Get_ActionName(void) const
Definition: DCutActions.cc:784
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:49
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:773
string Get_ActionName(void) const
Definition: DCutActions.cc:180
pair< int, int > Get_InitialParticleDecayFromIndices(const DReaction *locReaction, int locStepIndex)
Definition: DReaction.cc:93
unsigned int Get_NDF(void) const
size_t Get_NumParticleComboSteps(void) const
unsigned int dCDCRings
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:884
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:397
TVector3 DVector3
Definition: DVector3.h:14
Definition: GlueX.h:16
double energy(void) const
const DReaction * Get_Reaction(void) const
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:459
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:348
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.h:187
static unsigned short int IsResonance(Particle_t p)
Definition: particleType.h:802
string Get_ActionName(void) const
Definition: DCutActions.cc:73
double Get_TimeAtPOCAToVertex(void) const
string Get_ActionName(void) const
Definition: DCutActions.cc:37
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:7
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:390
string Get_ActionName(void) const
Definition: DCutActions.cc:263
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:382
bool Check_IsBDTSignalEvent(JEventLoop *locEventLoop, const DReaction *locReaction, bool locExclusiveMatchFlag, bool locIncludeDecayingToReactionFlag) const
const DTrackTimeBased * Get_TrackTimeBased(void) const
string Get_ActionName(void) const
Definition: DCutActions.cc:341
double dMinThrownMatchFOM
Definition: DCutActions.h:263
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:945
TDirectoryFile * CreateAndChangeTo_ActionDirectory(void)
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:327
set< set< size_t > > Build_IndexCombos(const DReactionStep *locReactionStep, deque< Particle_t > locToIncludePIDs) const
unsigned int dFDCPlanes
double measuredBeta(void) const
shared_ptr< DKinFitParticle > Make_DetectedParticle(const DKinematicData *locKinematicData)
deque< Particle_t > dMissingMassOffOfPIDs
Definition: DCutActions.h:385
const DKinematicData * Get_InitialParticle_Measured(void) const
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:695
TLorentzVector DLorentzVector
deque< Particle_t > dToIncludePIDs
Definition: DCutActions.h:455
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:387
const DEventRFBunch * Get_EventRFBunch(void) const
static int ParticleCharge(Particle_t p)
map< Particle_t, pair< TF1 *, TF1 * > > dCutMap
Definition: DCutActions.h:533
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:966
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:215
unsigned int dFDCPlanes
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:99
double Calc_DOCA(const DVector3 &locUnitDir1, const DVector3 &locUnitDir2, const DVector3 &locVertex1, const DVector3 &locVertex2) const
bool Get_UseKinFitResultsFlag(void) const
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:44
Definition: GlueX.h:19
shared_ptr< const DTOFHitMatchParams > Get_TOFHitMatchParams(void) const
void Recycle_LastFitMemory(void)
Definition: DKinFitter.cc:98
string Get_ActionName(void) const
Definition: DCutActions.cc:145
JApplication * japp
DKinFitUtils_GlueX * dKinFitUtils
Definition: DCutActions.h:694
string Get_ActionName(void) const
double dMinimumConfidenceLevel
Definition: DCutActions.h:146
void Add_Constraint(const shared_ptr< DKinFitConstraint > &locKinFitConstraint)
Definition: DKinFitter.h:54
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:334
void Get_FDCNumHitPlanesPerPackage(int locBitPattern, map< int, int > &locNumHitPlanesPerPackage) const
unsigned int dFDCPlanes
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:760
string Get_ActionName(void) const
Definition: DCutActions.cc:753
double time(void) const
vector< const DParticleComboStep * > Get_ParticleComboSteps(void) const
DCutAction_TrueBeamParticle * dCutAction_TrueBeamParticle
Definition: DCutActions.h:213
string Get_ActionName(void) const
Definition: DCutActions.cc:307
DetectorSystem_t dSystem
Definition: DCutActions.h:649
void Get_CDCNumHitRingsPerSuperlayer(int locBitPattern, map< int, int > &locNumHitRingsPerSuperlayer) const
DLorentzVector Calc_FinalStateP4(const DReaction *locReaction, const DParticleCombo *locParticleCombo, size_t locStepIndex, bool locUseKinFitDataFlag) const
vector< const DKinematicData * > Get_FinalParticles(const DReaction *locReaction, bool locIncludeMissingFlag=true, bool locIncludeDecayingFlag=true, Charge_t locCharge=d_AllCharges) const
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:210
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
string Get_ActionName(void) const
Definition: DCutActions.cc:327
Particle_t Get_InitialPID(void) const
Definition: DReactionStep.h:81
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:152
double dMinimumConfidenceLevel
Definition: DCutActions.h:343
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:245
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:54
DVector3 Calc_CrudeVertex(const vector< const DKinematicData * > &locParticles) const
DLorentzVector Calc_MissingP4(const DReaction *locReaction, const DParticleCombo *locParticleCombo, bool locUseKinFitDataFlag) const
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:275
double dMinimumConfidenceLevel
Definition: DCutActions.h:129
int parentid
id of parent of this particle from original generator
Definition: DMCThrown.h:23
Definition: GlueX.h:22
vector< const DKinematicData * > Get_FinalParticles_Measured(const DReaction *locReaction, Charge_t locCharge=d_AllCharges) const
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:246
deque< Particle_t > dMissingMassOffOfPIDs
Definition: DCutActions.h:429
const DAnalysisUtilities * dAnalysisUtilities
Definition: DCutActions.h:431
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:314
set< shared_ptr< DKinFitConstraint > > Get_KinFitConstraints(void) const
Definition: DKinFitter.h:99
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:120
string Get_ActionName(void) const
double Get_ConfidenceLevel(void) const
string Get_ActionName(void) const
Definition: DCutActions.cc:959
string Get_ActionName(void) const
Definition: DCutActions.cc:996
shared_ptr< const DSCHitMatchParams > Get_SCHitMatchParams(void) const
Particle_t dTruePID
Definition: DCutActions.h:261
&lt;A href=&quot;index.html#legend&quot;&gt; &lt;IMG src=&quot;CORE.png&quot; width=&quot;100&quot;&gt; &lt;/A&gt;
string Get_ActionName(void) const
Definition: DCutActions.cc:375
shared_ptr< const DFCALShowerMatchParams > Get_FCALShowerMatchParams(void) const
unsigned int dCDCRings
const DKinematicData * Get_InitialParticle(void) const
unsigned int dMinHitRingsPerCDCSuperlayer
Definition: DCutActions.h:519
DetectorSystem_t dSystem
Definition: DBeamPhoton.h:19
unsigned int dCDCRings
unsigned int Get_NDF(void) const
double Get_ConfidenceLevel(void) const
Definition: DKinFitter.h:89
string Get_ActionName(void) const
Definition: DCutActions.cc:113
const DVector3 & momentum(void) const
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
bool Cut_TrackHitPattern(const DParticleID *locParticleID, const DKinematicData *locTrack) const
Definition: DCutActions.cc:809
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:19
string Get_ActionName(void) const
string Get_ActionName(void) const
Definition: DCutActions.cc:203
DCutAction_ThrownTopology * dCutAction_ThrownTopology
Definition: DCutActions.h:212
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:536
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
const DReactionStep * Get_ReactionStep(size_t locStepIndex) const
Definition: DReaction.h:84
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
const DKinFitResults * Get_KinFitResults(void) const
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:674
DVector3 Get_Position(void) const
shared_ptr< const DBCALShowerMatchParams > Get_BCALShowerMatchParams(void) const
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:80
bool Check_ThrownsMatchReaction(JEventLoop *locEventLoop, const DReaction *locReaction, bool locExclusiveMatchFlag) const
unsigned int dMinTrackHits
Definition: DCutActions.h:79
string Get_ActionName(void) const
Definition: DCutActions.cc:938
string Get_ActionName(void) const
Definition: DCutActions.cc:233
const DParticleComboStep * Get_ParticleComboStep(size_t locStepIndex) const
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:270
string Get_ActionName(void) const
Definition: DCutActions.cc:766
int type
GEANT particle ID.
Definition: DMCThrown.h:20
const DParticleID * dParticleID
Definition: DCutActions.h:80
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:655
Particle_t dInitialPID
Definition: DCutActions.h:262
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:240
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:187
bool Cut_dEdx(const DChargedTrackHypothesis *locChargedTrackHypothesis)
Definition: DCutActions.cc:920
DetectorSystem_t dDetector
Definition: DCutActions.h:599
string Get_ActionName(void) const
Definition: DCutActions.cc:12
Particle_t PID(void) const
const DMCThrown * Get_MatchingMCThrown(const DChargedTrackHypothesis *locChargedTrackHypothesis, double &locMatchFOM) const
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:353
void Initialize(JEventLoop *locEventLoop)
bool Perform_Action(JEventLoop *locEventLoop, const DParticleCombo *locParticleCombo)
Definition: DCutActions.cc:719
Particle_t dStepPID
Definition: DCutActions.h:127
void Initialize(JEventLoop *locEventLoop)
Definition: DCutActions.cc:528
DetectorSystem_t dSystem
Definition: DCutActions.h:624
Particle_t
Definition: particleType.h:12