23 vector<const DMCReaction*> locMCReactions;
24 locEventLoop->Get(locMCReactions);
25 if(locMCReactions.empty())
30 locEventLoop->GetSingle(locMCGenBeam,
"MCGEN");
33 auto locSystem = locMCGenBeam->
dSystem;
38 vector<const DBeamPhoton*> locBeamPhotons;
39 locEventLoop->Get(locBeamPhotons);
42 double locBestDeltaT = 9.9E9;
44 for(
auto& locBeamPhoton : locBeamPhotons)
46 if(locBeamPhoton->dSystem != locSystem)
48 if(locBeamPhoton->dCounter != locMCGenBeam->
dCounter)
51 auto locDeltaT = fabs(locMCGenBeam->
time() - locBeamPhoton->time());
52 if(locDeltaT >= locBestDeltaT)
54 locBestDeltaT = locDeltaT;
55 locBestPhoton = locBeamPhoton;
58 if(locBestPhoton ==
nullptr)
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
Called every event.