// $Id$ // // File: DCustomAction_CutCombinedPID_NoBCAL.cc // Created: Mon May 12 09:54:57 EDT 2014 // Creator: pmatt (on Darwin pmattLaptop 10.8.0 i386) // #include "DCustomAction_CutCombinedPID_NoBCAL.h" bool DCustomAction_CutCombinedPID_NoBCAL::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) { deque locParticles; locParticleCombo->Get_DetectedFinalParticles_Measured(locParticles); unsigned int locTotalNDF = 0; double locTotalChiSq = 0.0; for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i) { if(ParticleCharge(locParticles[loc_i]->PID()) == 0) { const DNeutralParticleHypothesis* locNeutralParticleHypothesis = static_cast(locParticles[loc_i]); locTotalNDF += locNeutralParticleHypothesis->dNDF; locTotalChiSq += locNeutralParticleHypothesis->dChiSq; } else { const DChargedTrackHypothesis* locChargedTrackHypothesis = static_cast(locParticles[loc_i]); locTotalNDF += locChargedTrackHypothesis->dNDF_DCdEdx; locTotalChiSq += locChargedTrackHypothesis->dChiSq_DCdEdx; if(locChargedTrackHypothesis->t1_detector() != SYS_BCAL) { locTotalNDF += locChargedTrackHypothesis->dNDF_Timing; locTotalChiSq += locChargedTrackHypothesis->dChiSq_Timing; } } } return ((locTotalNDF == 0) ? true : (TMath::Prob(locTotalChiSq, locTotalNDF) >= dMinimumConfidenceLevel)); }