44 vector<const DParticleID *> locPIDAlgorithms;
45 eventLoop->Get(locPIDAlgorithms);
46 if(locPIDAlgorithms.size() < 1){
47 _DBG_<<
"Unable to get a DParticleID object! NO PID will be done!"<<endl;
48 return RESOURCE_UNAVAILABLE;
51 locPIDAlgorithm =
const_cast<DParticleID*
>(locPIDAlgorithms[0]);
55 _DBG_<<
"Unable to get a DParticleID object! NO PID will be done!"<<endl;
56 return RESOURCE_UNAVAILABLE;
59 vector<const DMCThrown*> locDMCThrownVector;
61 loop->Get(locDMCThrownVector);
63 vector<const DChargedTrackHypothesis*> locChargedTrackHypothesisVector;
65 loop->Get(locChargedTrackHypothesisVector);
70 float locThrownMass, locMomentum, locBeta;
72 if(locDMCThrownVector.size() != 1)
74 if(locChargedTrackHypothesisVector.size() == 0)
76 locDMCThrown = locDMCThrownVector[0];
80 bool locPIDMatchFlag =
false;
81 for(
unsigned int loc_i = 0; loc_i < locChargedTrackHypothesisVector.size(); loc_i++){
82 locChargedTrackHypothesis = locChargedTrackHypothesisVector[loc_i];
83 locTrackTimeBased = locChargedTrackHypothesis->dTrackTimeBased;
84 locReconstructedPID = locChargedTrackHypothesis->dPID;
85 if(locReconstructedPID == locThrownPID){
86 locPIDMatchFlag =
true;
90 if(locPIDMatchFlag ==
false)
91 locTrackTimeBased = locChargedTrackHypothesisVector[0]->dTrackTimeBased;
93 locMomentum = locTrackTimeBased->
momentum().Mag();
94 locBeta = locMomentum/
sqrt(locThrownMass*locThrownMass + locMomentum*locMomentum);
97 japp->RootWriteLock();
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
DCdEdxInformation * dDCdEdxInformation
TTree * dPluginTree_DCdEdxInformation
jerror_t fini(void)
Called after last event of last event source has been processed.
static double ParticleMass(Particle_t p)
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t init(void)
Called once at program start.
const DVector3 & momentum(void) const
int type
GEANT particle ID.
jerror_t brun(JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
unsigned int dNumHitsUsedFordEdx_FDC
unsigned int dNumHitsUsedFordEdx_CDC