136 TCanvas *c1 =
new TCanvas(
"c1",
"",700,700);
187 auto crtDataHandle =
event.getValidHandle<std::vector<sbnd::crt::CRTData>>(
fCRTDataLabel);
190 for(
auto const& data : (*crtDataHandle)){
211 if(
fPrint)
std::cout<<
"->True ID: "<<trueId<<
", channel = "<<data.Channel()<<
", tagger = "
221 auto crtHitHandle =
event.getValidHandle<std::vector<sbn::crt::CRTHit>>(
fCRTHitLabel);
222 for(
auto const&
hit : (*crtHitHandle)){
225 double time = (double)(
int)
hit.ts1_ns * 1
e-3;
232 double rmin[3] = {
hit.x_pos -
hit.x_err,
235 double rmax[3] = {
hit.x_pos +
hit.x_err,
241 <<
hit.y_pos<<
", "<<
hit.z_pos<<
"), time = "<<time<<
"\n";
250 auto crtTrackHandle =
event.getValidHandle<std::vector<sbn::crt::CRTTrack>>(
fCRTTrackLabel);
251 for(
auto const&
track : (*crtTrackHandle)){
254 double time = (double)(
int)
track.ts1_ns * 1
e-3;
261 TPolyLine3D *line =
new TPolyLine3D(2);
266 if(
track.complete) line->Draw();
270 if(start.Y() <
end.Y()) std::swap(start,
end);
271 TVector3 diff = (
end - start).Unit();
273 line->SetPoint(0, start.X(), start.Y(), start.Z());
274 line->SetPoint(1, newEnd.X(), newEnd.Y(), newEnd.Z());
280 <<
", "<<
track.y2_pos<<
", "<<
track.z2_pos<<
"), time = "<<time<<
"\n";
289 auto tpcTrackHandle =
event.getValidHandle<std::vector<recob::Track>>(
fTPCTrackLabel);
290 art::FindManyP<recob::Hit> findManyHits(tpcTrackHandle, event,
fTPCTrackLabel);
291 for(
auto const&
track : (*tpcTrackHandle)){
294 std::vector<art::Ptr<recob::Hit>> hits = findManyHits.at(
track.ID());
298 size_t npts =
track.NumberTrajectoryPoints();
299 TPolyLine3D *line =
new TPolyLine3D(npts);
304 for(
size_t i = 0; i < npts; i++){
305 auto& pos =
track.LocationAtPoint(i);
308 if(!
track.HasValidPoint(i))
continue;
317 line->SetPoint(ipt, pos.X(), pos.Y(), pos.Z());
324 if(
fPrint)
std::cout<<
"->True ID: "<<trueId<<
", start = ("<<start.X()<<
", "<<start.Y()<<
", "
325 <<start.Z()<<
"), end = ("<<
end.X()<<
", "<<
end.Y()<<
", "<<
end.Z()<<
")\n";
334 auto particleHandle =
event.getValidHandle<std::vector<simb::MCParticle>>(
fSimLabel);
336 for(
auto const& part : (*particleHandle)){
342 double time = part.T() * 1
e-3;
351 size_t npts = part.NumberTrajectoryPoints();
352 TPolyLine3D *line =
new TPolyLine3D(npts);
357 for(
size_t i = 0; i < npts; i++){
361 if(pos.X() < crtLims[0] || pos.X() > crtLims[3] || pos.Y() < crtLims[1]
362 || pos.Y() > crtLims[4] || pos.Z() < crtLims[2] || pos.Z() > crtLims[5])
continue;
370 line->SetPoint(ipt, pos.X(), pos.Y(), pos.Z());
377 if(
fPrint)
std::cout<<
"->True ID: "<<part.TrackId()<<
", start = ("<<start.X()<<
", "<<start.Y()<<
", "
378 <<start.Z()<<
"), end = ("<<
end.X()<<
", "<<
end.Y()<<
", "<<
end.Z()<<
")\n";
382 c1->SaveAs(
"crtEventDisplay.root");
art::InputTag fTPCTrackLabel
bool IsVisible(const simb::MCParticle &particle)
size_t NumModules() const
CRTTaggerGeo GetTagger(std::string taggerName) const
double fIncompleteTrackLength
process_name use argoneut_mc_hitfinder track
int TrueIdFromTotalEnergy(const art::Event &event, const sbnd::crt::CRTData &data)
CRTModuleGeo GetModule(std::string moduleName) const
void DrawCube(TCanvas *c1, double *rmin, double *rmax, int colour)
CRTBackTracker fCrtBackTrack
std::string ChannelToStripName(size_t channel) const
auto end(FixedBins< T, C > const &) noexcept
CRTStripGeo GetStrip(std::string stripName) const
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
size_t NumTaggers() const
art::InputTag fCRTTrackLabel
bool fDrawIncompleteTracks
art::InputTag fCRTDataLabel
art::InputTag fCRTHitLabel
bool EntersVolume(const simb::MCParticle &particle)
std::vector< double > CRTLimits() const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
BEGIN_PROLOG could also be cout