138 std::cout<<
"============================================"<<std::endl
139 <<
"Run = "<<
event.run()<<
", SubRun = "<<
event.subRun()<<
", Event = "<<
event.id().event()<<std::endl
140 <<
"============================================"<<std::endl;
148 auto particleHandle =
event.getValidHandle<std::vector<simb::MCParticle>>(
fSimModuleLabel);
150 std::map<int, simb::MCParticle> particles;
151 for (
auto const& particle: (*particleHandle)){
152 int partID = particle.TrackId();
153 particles[partID] = particle;
157 auto tpcTrackHandle =
event.getValidHandle<std::vector<recob::Track>>(
fTPCTrackLabel);
160 art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event,
fTPCTrackLabel);
163 art::FindManyP<anab::T0> findManyHitT0(tpcTrackHandle, event,
fCRTHitT0Label);
166 art::FindManyP<anab::T0> findManyTrackT0(tpcTrackHandle, event,
fCRTTrackT0Label);
172 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
175 for (
auto const& tpcTrack : (*tpcTrackHandle)){
177 std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
181 if(particles.find(trackTrueID) == particles.end())
continue;
184 if(!(
std::abs(particles[trackTrueID].PdgCode()) == 13 && particles[trackTrueID].Mother() == 0))
continue;
187 double trueTime = particles[trackTrueID].T() * 1
e-3;
193 std::vector<art::Ptr<anab::T0>> hitT0s = findManyHitT0.at(tpcTrack.ID());
194 if(hitT0s.size() < 1){
199 double hitT0 = hitT0s[0]->Time() * 1
e-3;
205 std::vector<art::Ptr<anab::T0>> trackT0s = findManyTrackT0.at(tpcTrack.ID());
206 if(trackT0s.size() < 1){
211 double trackT0 = trackT0s[0]->Time() * 1
e-3;
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
BEGIN_PROLOG could also be cout