153 std::cout<<
"============================================"<<std::endl
154 <<
"Run = "<<
event.run()<<
", SubRun = "<<
event.subRun()<<
", Event = "<<
event.id().event()<<std::endl
155 <<
"============================================"<<std::endl;
163 auto particleHandle =
event.getValidHandle<std::vector<simb::MCParticle>>(
fSimModuleLabel);
165 std::map<int, simb::MCParticle> particles;
166 for (
auto const& particle: (*particleHandle)){
167 int partID = particle.TrackId();
168 particles[partID] = particle;
172 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCRTHitLabel);
173 std::vector<sbn::crt::CRTHit> crtHits;
174 for(
auto const&
hit : (*crtHitHandle)){
175 crtHits.push_back(
hit);
179 auto crtTrackHandle =
event.getValidHandle<std::vector<sbn::crt::CRTTrack>>(
fCRTTrackLabel);
180 std::vector<sbn::crt::CRTTrack> crtTracks;
181 for(
auto const&
track : (*crtTrackHandle)){
182 crtTracks.push_back(
track);
186 auto tpcTrackHandle =
event.getValidHandle<std::vector<recob::Track>>(
fTPCTrackLabel);
189 art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event,
fTPCTrackLabel);
195 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
196 auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(event, clockData);
199 for (
auto const& tpcTrack : (*tpcTrackHandle)){
201 std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(tpcTrack.ID());
205 if(particles.find(trackTrueID) == particles.end())
continue;
208 if(!(
std::abs(particles[trackTrueID].PdgCode()) == 13 && particles[trackTrueID].Mother() == 0))
continue;
211 double trueTime = particles[trackTrueID].T() * 1
e-3;
228 if(trackT0 == -99999){
process_name use argoneut_mc_hitfinder track
art::InputTag fCRTHitLabel
name of CRT hit producer
art::InputTag fSimModuleLabel
name of detsim producer
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
CRTT0MatchAlg fCRTHitMatch
CRT hit - TPC track matching algorithms.
CRTTrackMatchAlg fCRTTrackMatch
CRT track - TPC track matching algorithms.
double T0FromCRTHits(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTHit > crtHits, const art::Event &event)
bool fVerbose
print information about what's going on
double T0FromCRTTracks(detinfo::DetectorPropertiesData const &detProp, recob::Track tpcTrack, std::vector< sbn::crt::CRTTrack > crtTracks, const art::Event &event)
art::InputTag fTPCTrackLabel
name of TPC track producer
art::InputTag fCRTTrackLabel
name of CRT track producer
BEGIN_PROLOG could also be cout