25 #include "nusimdata/SimulationBase/MCParticle.h"
28 #include "art/Framework/Core/EDAnalyzer.h"
29 #include "art/Framework/Core/ModuleMacros.h"
30 #include "art/Framework/Principal/Event.h"
31 #include "art/Framework/Principal/Handle.h"
32 #include "art/Framework/Services/Registry/ServiceHandle.h"
33 #include "art_root_io/TFileService.h"
34 #include "canvas/Persistency/Common/FindManyP.h"
35 #include "fhiclcpp/ParameterSet.h"
36 #include "messagefacility/MessageLogger/MessageLogger.h"
44 #define MAX_TRACKS 1000
56 void beginJob()
override;
57 void endJob()
override;
58 void beginRun(
const art::Run& run)
override;
61 void processEff(
const art::Event& evt,
bool& isFiducial);
66 const simb::MCParticle*& MCparticle,
69 double& TotalRecoEnergy);
71 void FuncDistanceAndAngleBetweenTracks(art::Ptr<recob::Track> Track1,
72 art::Ptr<recob::Track> Track2,
73 double& TempDistanceBetweenTracks,
74 double& TempAngleBetweenTracks,
75 double& TempCriteriaTwoTracks);
77 void FuncDistanceAndAngleBetweenTruthAndRecoTrack(
const simb::MCParticle*& MCparticle,
78 art::Ptr<recob::Track>
Track,
79 double& TempDistanceBetweenTruthAndRecoTrack,
80 double& TempAngleBeetweenTruthAndRecoTrack);
82 double truthLength(
const simb::MCParticle* MCparticle);
84 bool insideFV(
double vertex[4]);
86 void doEfficiencies();
96 double MCTruthMuonVertex[4];
104 double MCTruthMuonThetaXZ = 0;
105 double MCTruthMuonThetaYZ = 0;
108 int EventCounter = 0;
110 int CountMCTruthMuon = 0;
111 int CountRecoMuon = 0;
113 int CountGoodLeadingMuonTrack = 0;
114 int CountNoRecoTracks = 0;
115 int CountNoMuonTracks = 0;
116 int CountBadLeadingMuonTrack = 0;
117 int CountCompleteness = 0;
119 int CountTrackLengthTooShort = 0;
120 int CountTrackLengthTooLong = 0;
122 int CountBadLeadingMuonTrackAndOnlyOneMuonTrack = 0;
123 int CountBadLeadingMuonTrackButLeadingPlusSecondGood = 0;
124 int CountBadLeadingMuonTrackAndLeadingPlusSecondBad = 0;
126 int CountBadLeadingMuonTrackAndLeadingPlusSecondBadCompleteness = 0;
127 int CountBadLeadingMuonTrackAndLeadingPlusSecondBadPurity = 0;
128 int CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooShort = 0;
129 int CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooLong = 0;
131 int CountBadLeadingMuonTrackAndOnlyOneMuonTrackCompleteness = 0;
132 int CountBadLeadingMuonTrackAndOnlyOneMuonTrackPurity = 0;
133 int CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooShort = 0;
134 int CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooLong = 0;
139 int GoodEvents1MuonTrack = 0;
140 int GoodEvents2MuonTrack = 0;
141 int GoodEvents3MuonTrack = 0;
142 int GoodEvents4OrMoreMuonTrack = 0;
144 int BadEvents0MuonTrack = 0;
145 int BadEvents1MuonTrack = 0;
146 int BadEvents2MuonTrack = 0;
147 int BadEvents3MuonTrack = 0;
148 int BadEvents4OrMoreMuonTrack = 0;
267 art::ServiceHandle<geo::Geometry const>
geom;
270 int NThetaXZBins = 36;
271 int ThetaXZBinMin = 0;
272 int ThetaXZBinMax = 360;
274 int NThetaYZBins = 18;
275 int ThetaYZBinMin = -90;
276 int ThetaYZBinMax = 90;
278 int NSinThetaYZBins = 18;
279 int SinThetaYZBinMin = -1;
280 int SinThetaYZBinMax = 1;
282 int NCriteriaBins = 13;
283 double CriteriaBinMin = -0.25;
284 double CriteriaBinMax = 6.25;
286 int NRecoTracksBins = 19;
287 double RecoTracksBinMin = -0.25;
288 double RecoTracksBinMax = 9.25;
293 MuonTrackingEff::MuonTrackingEff(fhicl::ParameterSet
const&
p) : EDAnalyzer(p)
306 std::cout <<
"job begin..." << std::endl;
308 auto const* geo = lar::providerFrom<geo::Geometry>();
317 for (
size_t i = 0; i < geo->NTPC(); ++i) {
318 double local[3] = {0., 0., 0.};
319 double world[3] = {0., 0., 0.};
322 if (minx > world[0] - geo->DetHalfWidth(i)) minx = world[0] - geo->DetHalfWidth(i);
323 if (maxx < world[0] + geo->DetHalfWidth(i)) maxx = world[0] + geo->DetHalfWidth(i);
324 if (miny > world[1] - geo->DetHalfHeight(i)) miny = world[1] - geo->DetHalfHeight(i);
325 if (maxy < world[1] + geo->DetHalfHeight(i)) maxy = world[1] + geo->DetHalfHeight(i);
326 if (minz > world[2] - geo->DetLength(i) / 2.) minz = world[2] - geo->DetLength(i) / 2.;
327 if (maxz < world[2] + geo->DetLength(i) / 2.) maxz = world[2] + geo->DetLength(i) / 2.;
343 art::ServiceHandle<art::TFileService const>
tfs;
346 gStyle->SetTitleOffset(1.3,
"Y");
350 tfs->make<TH1D>(
"h_Purity",
"All events: Purity vs. # events; Purity; # events", 60, 0, 1.2);
353 "h_Completeness",
"All events: Completeness vs # events; Completeness; # events", 60, 0, 1.2);
357 tfs->make<TH1D>(
"h_TrackRes",
358 "All events: L_{reco}/L_{truth} vs. # events; L_{reco}/L_{truth}; # events;",
365 "All events: Total reco energy (sum of all hits in all "
366 "tracks) vs. # events; E_{reco., tot.} [MeV]; # events",
373 "All events: truth muon length vs. # events; truth muon length [cm]; # events",
380 "All events: Vertex residuals vs. # events; #Delta vertex_{truth-teco} [cm]; # events",
387 "All events: Angular residuals vs. # events; #Delta#theta_{truth-reco} [#circ]; # events",
394 tfs->make<TH1D>(
"h_Efficiency_ThetaXZ",
395 "Muon reco efficiency vs. #theta_{XZ}; #theta_{XZ} [#circ]; Efficiency",
400 tfs->make<TH1D>(
"h_ThetaXZ_den",
401 "# generated muons vs. #theta_{XZ}; #theta_{XZ} [#circ]; # generated muons",
407 "# reconstructed muons vs. #theta_{XZ}; #theta_{XZ} [#circ]; # reconstructed muons",
414 "h_Efficiency_ThetaYZ",
415 "Muon reco efficiency vs. #theta_{YZ}; #theta_{YZ} [#circ]; Muon reco efficiency",
421 tfs->make<TH1D>(
"h_ThetaYZ_den",
422 "# generated muons vs. #theta_{YZ}; #theta_{YZ} [#circ]; # generated muons",
428 "# reconstructed muons vs. #theta_{YZ}; #theta_{YZ} [#circ]; # reconstructed muons",
435 "h_Efficiency_SinThetaYZ",
436 "Muon reco efficiency vs. sin(#theta_{YZ}); sin(#theta_{YZ}); Muon reco efficiency",
442 tfs->make<TH1D>(
"h_SinThetaYZ_den",
443 "# generated muons vs. sin(#theta_{YZ}); sin(#theta_{YZ}); # generated muons",
449 "# reconstructed muons vs. sin(#theta_{YZ}); sin(#theta_{YZ}); # reconstructed muons",
458 h_TruthLength->Sumw2();
459 h_VertexRes->Sumw2();
460 h_DirectionRes->Sumw2();
462 h_Efficiency_SinThetaYZ->Sumw2();
464 h_SinThetaYZ_num->Sumw2();
466 h_Efficiency_ThetaXZ->Sumw2();
467 h_ThetaXZ_den->Sumw2();
468 h_ThetaXZ_num->Sumw2();
470 h_Efficiency_ThetaYZ->Sumw2();
472 h_ThetaYZ_num->Sumw2();
477 "h_Efficiency_ThetaXZ_ThetaYZ",
478 "Muon reco efficiency: #theta_{XZ} vs. #theta_{YZ}; #theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
488 "h_ThetaXZ_ThetaYZ_den",
489 "# generated muons: #theta_{XZ} vs. #theta_{YZ}; #theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
499 "# reconstructed muons: #theta_{XZ} vs. #theta_{YZ}; "
500 "#theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
510 tfs->make<TH2D>(
"h_FailedReconstruction_ThetaXZ_ThetaYZ",
511 "# failed reconstructions: #theta_{XZ} vs. #theta_{YZ}; #theta_{XZ} [#circ]; "
512 "#theta_{YZ} [#circ]",
523 tfs->make<TH2D>(
"h_Efficiency_ThetaXZ_SinThetaYZ",
524 "Muon reco efficiency: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} "
525 "[#circ]; sin(#theta_{YZ})",
535 "h_ThetaXZ_SinThetaYZ_den",
536 "# generated muons: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} [#circ]; sin(#theta_{YZ})",
546 tfs->make<TH2D>(
"h_ThetaXZ_SinThetaYZ_num",
547 "# reconstructed muons: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} "
548 "[#circ]; sin(#theta_{YZ}); #theta_{XZ} [#circ]; sin(#theta_{YZ})",
558 tfs->make<TH2D>(
"h_FailedReconstruction_ThetaXZ_SinThetaYZ",
559 "# failed reconstructions: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} "
560 "[#circ]; sin(#theta_{YZ})",
571 tfs->make<TH2D>(
"h_Efficiency_ThetaXZ_ThetaYZ_LeadingPlusSecond",
572 "Muon reco efficiency after stitching: #theta_{XZ} vs. #theta_{YZ}; "
573 "#theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
583 tfs->make<TH2D>(
"h_ThetaXZ_ThetaYZ_LeadingPlusSecondOk",
584 "# reconstructed muons after stitching (failed before stitching): "
585 "#theta_{XZ} vs #theta_{YZ}; #theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
595 tfs->make<TH2D>(
"h_ThetaXZ_ThetaYZ_LeadingPlusSecondOk_num",
596 "# reconstructed muons after stitching: #theta_{XZ} vs. #theta_{YZ}; "
597 "#theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
608 tfs->make<TH2D>(
"h_Efficiency_ThetaXZ_SinThetaYZ_LeadingPlusSecond",
609 "Muon reco efficiency after stitching: #theta_{XZ} vs. sin(#theta_{YZ}); "
610 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
620 tfs->make<TH2D>(
"h_ThetaXZ_SinThetaYZ_LeadingPlusSecondOk",
621 "# reconstructed muons after stitching (failed before stitching): "
622 "#theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} [#circ]; sin(#theta_{YZ})",
632 tfs->make<TH2D>(
"h_ThetaXZ_SinThetaYZ_LeadingPlusSecondOk_num",
633 "# reconstructed muons after stitching: #theta_{XZ} vs. sin(#theta_{YZ}); "
634 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
645 tfs->make<TH2D>(
"h_Efficiency_ThetaXZ_ThetaYZ_DifferenceLeadingAndLeadingPlusSecond",
646 "Muon reco efficiency: difference before and after stitching: #theta_{XZ} "
647 "vs. #theta_{YZ}; #theta_{XZ} [#circ]; #theta_{YZ} [#circ]",
658 tfs->make<TH2D>(
"h_NoRecoTrackAtAll_ThetaXZ_SinThetaYZ",
659 "# events with no reco track at all: #theta_{XZ} vs. sin(#theta_{YZ}); "
660 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
670 tfs->make<TH2D>(
"h_NoMuonTrack_ThetaXZ_SinThetaYZ",
671 "# events with no muon track: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} "
672 "[#circ]; sin(#theta_{YZ})",
682 tfs->make<TH2D>(
"h_TrackTooShort_ThetaXZ_SinThetaYZ",
683 "# events with L_{reco}/L_{truth} < 75%: #theta_{XZ} vs. sin(#theta_{YZ}); "
684 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
694 tfs->make<TH2D>(
"h_TrackTooLong_ThetaXZ_SinThetaYZ",
695 "#events with L_{reco}/L_{truth} > 125%: #theta_{XZ} vs. sin(#theta_{YZ}); "
696 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
706 tfs->make<TH2D>(
"h_Completeness_ThetaXZ_SinThetaYZ",
707 "# events with Completeness < 50%: #theta_{XZ} vs. sin(#theta_{YZ}); "
708 "#theta_{XZ} [#circ]; sin(#theta_{YZ})",
718 tfs->make<TH2D>(
"h_Purity_ThetaXZ_SinThetaYZ",
719 "# events with Purity < 50%: #theta_{XZ} vs. sin(#theta_{YZ}); #theta_{XZ} "
720 "[#circ]; sin(#theta_{YZ})",
731 tfs->make<TH2D>(
"h_Criteria_NRecoTrack",
732 "Ratio: criteria vs. # reco tracks; Criteria; # reco tracks",
742 tfs->make<TH2D>(
"h_Criteria_NRecoTrack_num",
743 "# events: criteria vs. # reco tracks; Criteria; # reco tracks",
753 "Divider histogram; Criteria; # reco tracks",
764 tfs->make<TH2D>(
"h_Criteria_NMuonTrack",
765 "Ratio: criteria vs. # muon tracks; Criteria; # muon tracks",
775 tfs->make<TH2D>(
"h_Criteria_NMuonTrack_num",
776 "# events: criteria vs. # muon tracks; Criteria; # muon tracks",
786 "Divider histogram; Criteria; # muon tracks",
797 "h_NoMuonTrack_MaxTrackLength_PDGCode",
798 "Events with no muon track: L_{reco, max} vs. PDG Code; L_{reco} [cm]; PDG Code",
809 tfs->make<TH2D>(
"h_MuonTrackStitching_TrackRes_Completeness",
810 "All events: L_{reco}/L_{truth} (leading) vs. Completeness (leading); "
811 "L_{reco}/L_{truth} (leading); Completeness (leading)",
821 tfs->make<TH2D>(
"h_MuonTrackStitching_TrackResLeading_TrackResSecond",
822 "All events: L_{reco}/L_{truth} (leading) vs. L_{reco}/L_{truth} (second); "
823 "L_{reco}/L_{truth} (leading); L_{reco}/L_{truth} (second)",
833 tfs->make<TH2D>(
"h_MuonTrackStitching_Distance_Angle",
834 "All events: distance vs. angle b/w leading and second muon track; Distance "
835 "[cm]; Angle [#circ]",
845 tfs->make<TH2D>(
"h_MuonTrackStitching_TrackResSecondMuon_Angle",
846 "All events: L_{reco}/L_{truth} (second) vs. angle; L_{reco}/L_{truth} "
847 "(second); Angle [#circ]",
857 "h_MuonTrackStitching_CompletenessSecondMuon_Angle",
858 "All events: Completeness (second) vs. angle; Completeness (second); Angle [#circ]",
868 tfs->make<TH2D>(
"h_MuonTrackStitching_CriteriaTwoTracks_Angle",
869 "All events: CriteriaTwoTracks vs. angle; Criteria; Angle [#circ]",
880 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteria_TrackRes_Completeness",
881 "Bad events: L_{reco}/L_{truth} (leading) vs. Completeness (leading); "
882 "L_{reco}/L_{truth} (leading); Completeness (leading)",
892 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteria_Distance_Angle",
893 "Bad events: distance vs. angle b/w leading and second muon track; Distance "
894 "[cm]; Angle [#circ]",
904 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteria_TrackResLeading_TrackResSecond",
905 "Bad events: L_{reco}/L_{truth} (leading) vs. L_{reco}/L_{truth} (second); "
906 "L_{reco}/L_{truth} (leading); L_{reco}/L_{truth} (second)",
916 tfs->make<TH2D>(
"*h_MuonTrackStitching_FailedCriteria_CompletenessLeading_CompletenessSecond",
917 "Bad events: Completeness (leading) vs. Completeness (second); Completeness "
918 "(leading); Completeness (second)",
928 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteria_TrackResSecondMuon_Angle",
929 "Bad events: L_{reco}/L_{truth} (second) vs. angle; L_{reco}/L_{truth} "
930 "(second); Angle [#circ]",
940 "h_MuonTrackStitching_FailedCriteria_CompletenessSecondMuon_Angle",
941 "Bad events: Completeness (second) vs. angle; Completeness (second); Angle [#circ]",
951 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteria_CriteriaTwoTracks_Angle",
952 "Bad events: CriteriaTwoTracks vs. angle; Criteria; Angle [#circ]",
963 tfs->make<TH2D>(
"h_MuonTrackStitching_MatchedCriteria_TrackRes_Completeness",
964 "Good events: L_{reco}/L_{truth} (leading) vs. Completeness (leading); "
965 "L_{reco}/L_{truth} (leading); Completeness (leading)",
975 tfs->make<TH2D>(
"h_MuonTrackStitching_MatchedCriteria_Distance_Angle",
976 "Good events: distance vs. angle b/w leading and second muon track; Distance "
977 "[cm]; Angle [#circ]",
987 tfs->make<TH2D>(
"h_MuonTrackStitching_MatchedCriteria_TrackResLeading_TrackResSecond",
988 "Good events: L_{reco}/L_{truth} (leading) vs. L_{reco}/L_{truth} (second); "
989 "L_{reco}/L_{truth} (leading); L_{reco}/L_{truth} (second)",
999 tfs->make<TH2D>(
"h_MuonTrackStitching_MatchedCriteria_CriteriaTwoTracks_Angle",
1000 "Good events: CriteriaTwoTracks vs. angle b/w leading and second muon track; "
1001 "Criteria; Angle [#circ]",
1013 "h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_TrackRes_Completeness",
1014 "Bad events but leading + second is good: L_{reco}/L_{truth} (leading) vs. Completeness "
1015 "(leading); L_{reco}/L_{truth} (leading); Completeness (leading)",
1026 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_Distance_Angle",
1027 "Bad events but leading + second is good: distance vs. angle b/w leading and "
1028 "second muon track; Distance [cm]; Angle [#circ]",
1039 "h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_TrackResLeading_"
1041 "Bad events but leading + second is good: L_{reco}/L_{truth} (leading) vs. "
1042 "L_{reco}/L_{truth} (second); L_{reco}/L_{truth} (leading); L_{reco}/L_{truth} (second)",
1050 ->SetOption(
"colz");
1055 "h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_TrackRes_Completeness",
1056 "Bad events and leading + second is bad: L_{reco}/L_{truth} (leading) vs. Completeness "
1057 "(leading); L_{reco}/L_{truth} (leading); Completeness (leading)",
1068 tfs->make<TH2D>(
"h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_Distance_Angle",
1069 "Bad events and leading + second is bad: distance vs. angle b/w leading and "
1070 "second muon track; Distance [cm]; Angle [#circ]",
1081 "h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_TrackResLeading_TrackResSecond",
1082 "Bad events and leading + second is bad: L_{reco}/L_{truth} (leading) vs. "
1083 "L_{reco}/L_{truth} (second); L_{reco}/L_{truth} (leading); L_{reco}/L_{truth} (second)",
1091 ->SetOption(
"colz");
1104 mf::LogInfo(
"MuonTrackingEff") <<
"begin run..." << std::endl;
1110 if (event.isRealData())
return;
1112 bool isFiducial =
false;
1121 simb::MCParticle* MCTruthMuonParticle = NULL;
1123 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
1124 const sim::ParticleList& plist = pi_serv->ParticleList();
1125 simb::MCParticle* particle = 0;
1127 for (sim::ParticleList::const_iterator ipar = plist.begin(); ipar != plist.end(); ++ipar) {
1128 particle = ipar->second;
1130 if (particle->Mother() ==
1132 const TLorentzVector& positionStart = particle->Position(0);
1133 positionStart.GetXYZT(
1138 MCTruthMuonParticle = particle;
1141 sqrt(pow(particle->Momentum().Px(), 2) + pow(particle->Momentum().Py(), 2) +
1142 pow(particle->Momentum().Pz(), 2));
1144 if (particle->Momentum().Pz() >= 0 && particle->Momentum().Px() >= 0) {
1146 (180.0 / 3.14159) * atan(particle->Momentum().Px() / particle->Momentum().Pz());
1148 else if (particle->Momentum().Pz() < 0 && particle->Momentum().Px() >= 0) {
1150 180.0 + (180.0 / 3.14159) * atan(particle->Momentum().Px() / particle->Momentum().Pz());
1152 else if (particle->Momentum().Pz() < 0 && particle->Momentum().Px() < 0) {
1154 180.0 + (180.0 / 3.14159) * atan(particle->Momentum().Px() / particle->Momentum().Pz());
1156 else if (particle->Momentum().Pz() >= 0 && particle->Momentum().Px() < 0) {
1158 360.0 + (180.0 / 3.14159) * atan(particle->Momentum().Px() / particle->Momentum().Pz());
1165 double MCTruthLengthMuon =
truthLength(MCTruthMuonParticle);
1172 if (!isFiducial)
return;
1175 if (MCTruthMuonParticle) {
1189 int NMuonTracks = 0;
1191 art::Handle<std::vector<recob::Track>> TrackListHandle;
1193 std::vector<art::Ptr<recob::Track>> TrackList;
1194 art::fill_ptr_vector(TrackList, TrackListHandle);
1195 int NRecoTracks = TrackList.size();
1196 art::FindManyP<recob::Hit> track_hits(TrackListHandle, event,
fTrackModuleLabel);
1197 if (NRecoTracks == 0) {
1198 MF_LOG_DEBUG(
"MuonTrackingEff") <<
"There are no reco tracks... bye";
1199 std::cout <<
"There are no reco tracks! MCTruthMuonThetaXZ: " << std::endl;
1212 MF_LOG_DEBUG(
"MuonTrackingEff") <<
"Found this many reco tracks " << NRecoTracks;
1216 double PurityLeadingMuon = 0.;
1217 double CompletenessLeadingMuon = 0.;
1218 double RecoLengthLeadingMuon = 0.;
1219 art::Ptr<recob::Track> TrackLeadingMuon;
1221 double RecoLengthSecondMuon = 0.;
1222 double CompletenessSecondMuon = 0.;
1223 double PuritySecondMuon = 0.;
1224 art::Ptr<recob::Track> TrackSecondMuon;
1226 double TrackLengthMuonSum = 0.;
1227 double tmpTotalRecoEnergy = 0.;
1229 double MaxLengthNoRecoMuon = 0;
1230 int PDGCodeMaxLengthNoRecoMuon = 0;
1232 const simb::MCParticle* RecoMuonParticle = NULL;
1234 std::vector<art::Ptr<recob::Hit>> tmp_TrackHits = track_hits.at(0);
1235 std::vector<art::Ptr<recob::Hit>> AllHits;
1236 art::Handle<std::vector<recob::Hit>> HitHandle;
1237 if (event.get(tmp_TrackHits[0].id(), HitHandle)) art::fill_ptr_vector(AllHits, HitHandle);
1239 auto const clockData =
1240 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(event);
1243 for (
int i = 0; i < NRecoTracks; i++) {
1244 art::Ptr<recob::Track>
track = TrackList[i];
1245 std::vector<art::Ptr<recob::Hit>> TrackHits = track_hits.at(i);
1246 double tmpPurity = 0.;
1247 double tmpCompleteness = 0.;
1248 const simb::MCParticle* particle;
1251 clockData, AllHits, TrackHits, particle, tmpPurity, tmpCompleteness, tmpTotalRecoEnergy);
1254 std::cout <<
"ERROR: Truth matcher didn't find a particle!" << std::endl;
1258 if (track->Length() > MaxLengthNoRecoMuon && particle->PdgCode() !=
fMuonPDGCode &&
1260 MaxLengthNoRecoMuon = track->Length();
1261 PDGCodeMaxLengthNoRecoMuon = particle->PdgCode();
1265 tmpCompleteness > 0 && tmpPurity > 0) {
1268 TrackLengthMuonSum += track->Length();
1270 if (NMuonTracks == 1) {
1271 CompletenessLeadingMuon = tmpCompleteness;
1272 PurityLeadingMuon = tmpPurity;
1273 RecoLengthLeadingMuon = track->Length();
1274 TrackLeadingMuon =
track;
1276 RecoMuonParticle = particle;
1279 if (NMuonTracks >= 2 && tmpCompleteness > CompletenessLeadingMuon) {
1281 CompletenessSecondMuon = CompletenessLeadingMuon;
1282 PuritySecondMuon = PurityLeadingMuon;
1283 RecoLengthSecondMuon = RecoLengthLeadingMuon;
1284 TrackSecondMuon = TrackLeadingMuon;
1286 CompletenessLeadingMuon = tmpCompleteness;
1287 PurityLeadingMuon = tmpPurity;
1288 RecoLengthLeadingMuon = track->Length();
1289 TrackLeadingMuon =
track;
1291 RecoMuonParticle = particle;
1294 else if (NMuonTracks >= 2 && tmpCompleteness < CompletenessLeadingMuon &&
1295 tmpCompleteness > CompletenessSecondMuon) {
1296 CompletenessSecondMuon = tmpCompleteness;
1297 PuritySecondMuon = tmpPurity;
1298 RecoLengthSecondMuon = track->Length();
1299 TrackSecondMuon =
track;
1309 if (RecoMuonParticle && MCTruthMuonParticle) {
1313 h_TrackRes->Fill(RecoLengthLeadingMuon / MCTruthLengthMuon);
1315 std::cout <<
"TrackLeadingMuon->Vertex().X(): " << TrackLeadingMuon->Vertex().X()
1317 std::cout <<
"MCTruthMuonParticle->Vz(): " << MCTruthMuonParticle->Vz() << std::endl;
1320 double DistanceBetweenTruthAndRecoTrack;
1321 double AngleBetweenTruthAndRecoTrack;
1324 DistanceBetweenTruthAndRecoTrack,
1325 AngleBetweenTruthAndRecoTrack);
1327 h_VertexRes->Fill(DistanceBetweenTruthAndRecoTrack);
1331 CompletenessLeadingMuon);
1332 if (NMuonTracks >= 2) {
1333 double DistanceBetweenTracks;
1334 double AngleBetweenTracks;
1335 double CriteriaTwoTracks;
1339 DistanceBetweenTracks,
1344 RecoLengthLeadingMuon / MCTruthLengthMuon, RecoLengthSecondMuon / MCTruthLengthMuon);
1347 RecoLengthSecondMuon / MCTruthLengthMuon, AngleBetweenTracks);
1349 AngleBetweenTracks);
1354 if (CompletenessLeadingMuon < 0.5) {
1363 if (PurityLeadingMuon < 0.5) {
1372 if (RecoLengthLeadingMuon / MCTruthLengthMuon < 0.75) {
1381 if (RecoLengthLeadingMuon / MCTruthLengthMuon > 1.25) {
1409 if (CompletenessLeadingMuon < 0.5 || PurityLeadingMuon < 0.5 ||
1410 RecoLengthLeadingMuon / MCTruthLengthMuon < 0.75 ||
1411 RecoLengthLeadingMuon / MCTruthLengthMuon > 1.25) {
1417 RecoLengthLeadingMuon / MCTruthLengthMuon, CompletenessLeadingMuon);
1424 if (NMuonTracks >= 2) {
1425 double AngleBetweenTracks;
1426 double DistanceBetweenTracks;
1427 double CriteriaTwoTracks;
1430 DistanceBetweenTracks,
1434 if (AngleBetweenTracks > 160.) {
1436 std::cout <<
"Angle b/w tracks: " << AngleBetweenTracks << std::endl;
1437 std::cout <<
"CriteriaTwoTracks: " << CriteriaTwoTracks << std::endl;
1438 std::cout <<
"CompletenessLeadingMuon: " << CompletenessLeadingMuon << std::endl;
1439 std::cout <<
"CompletenessSecondMuon: " << CompletenessSecondMuon << std::endl;
1440 std::cout <<
"PurityLeadingMuon: " << PurityLeadingMuon << std::endl;
1441 std::cout <<
"PuritySecondMuon: " << PuritySecondMuon << std::endl;
1442 std::cout <<
"TrackLeadingMuon: " << RecoLengthLeadingMuon / MCTruthLengthMuon
1444 std::cout <<
"TrackResSecondMuon: " << RecoLengthSecondMuon / MCTruthLengthMuon
1446 std::cout <<
"TrackID leading: " << TrackLeadingMuon->ID() << std::endl;
1447 std::cout <<
"TrackID second: " << TrackSecondMuon->ID() << std::endl;
1451 AngleBetweenTracks);
1453 RecoLengthLeadingMuon / MCTruthLengthMuon, RecoLengthSecondMuon / MCTruthLengthMuon);
1455 CompletenessLeadingMuon, CompletenessSecondMuon);
1457 RecoLengthSecondMuon / MCTruthLengthMuon, AngleBetweenTracks);
1459 CompletenessSecondMuon, AngleBetweenTracks);
1461 AngleBetweenTracks);
1462 if ((CompletenessLeadingMuon + CompletenessSecondMuon) >= 0.5 &&
1463 PurityLeadingMuon >= 0.5 && PuritySecondMuon >= 0.5 &&
1464 (RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon >= 0.75 &&
1465 (RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon <= 1.25) {
1472 RecoLengthLeadingMuon / MCTruthLengthMuon, CompletenessLeadingMuon);
1474 ->Fill(RecoLengthLeadingMuon / MCTruthLengthMuon,
1475 RecoLengthSecondMuon / MCTruthLengthMuon);
1477 DistanceBetweenTracks, AngleBetweenTracks);
1479 if ((CompletenessLeadingMuon + CompletenessSecondMuon) < 0.5 || PurityLeadingMuon < 0.5 ||
1480 PuritySecondMuon < 0.5 ||
1481 (RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon < 0.75 ||
1482 (RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon > 1.25) {
1486 RecoLengthLeadingMuon / MCTruthLengthMuon, CompletenessLeadingMuon);
1488 ->Fill(RecoLengthLeadingMuon / MCTruthLengthMuon,
1489 RecoLengthSecondMuon / MCTruthLengthMuon);
1491 DistanceBetweenTracks, AngleBetweenTracks);
1493 if ((CompletenessLeadingMuon + CompletenessSecondMuon) < 0.5) {
1496 if (PurityLeadingMuon < 0.5 || PuritySecondMuon < 0.5) {
1499 if ((RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon < 0.75) {
1502 if ((RecoLengthLeadingMuon + RecoLengthSecondMuon) / MCTruthLengthMuon > 1.25) {
1506 else if (NMuonTracks == 1) {
1508 if (CompletenessLeadingMuon < 0.5) {
1512 if (RecoLengthLeadingMuon / MCTruthLengthMuon < 0.75) {
1515 if (RecoLengthLeadingMuon / MCTruthLengthMuon > 1.25) {
1521 if (CompletenessLeadingMuon >= 0.5 && PurityLeadingMuon >= 0.5 &&
1522 RecoLengthLeadingMuon / MCTruthLengthMuon >= 0.75 &&
1523 RecoLengthLeadingMuon / MCTruthLengthMuon <= 1.25) {
1536 RecoLengthLeadingMuon / MCTruthLengthMuon, CompletenessLeadingMuon);
1543 if (NMuonTracks >= 2) {
1545 RecoLengthLeadingMuon / MCTruthLengthMuon, RecoLengthSecondMuon / MCTruthLengthMuon);
1547 double AngleBetweenTracks;
1548 double DistanceBetweenTracks;
1549 double CriteriaTwoTracks;
1552 DistanceBetweenTracks,
1556 AngleBetweenTracks);
1558 AngleBetweenTracks);
1563 if (!RecoMuonParticle && MCTruthMuonParticle) {
1575 static_cast<double>(PDGCodeMaxLengthNoRecoMuon));
1583 const simb::MCParticle*& MCparticle,
1585 double& Completeness,
1586 double& TotalRecoEnergy)
1588 art::ServiceHandle<cheat::BackTrackerService const> bt_serv;
1589 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
1590 std::map<int, double> trkID_E;
1592 for (
size_t j = 0; j < track_hits.size(); ++j) {
1593 art::Ptr<recob::Hit>
hit = track_hits[j];
1594 std::vector<sim::TrackIDE>
TrackIDs =
1595 bt_serv->HitToTrackIDEs(clockData,
1603 for (
size_t k = 0;
k < TrackIDs.size();
k++) {
1604 trkID_E[TrackIDs[
k].trackID] +=
1611 double max_E = -999.0;
1612 double TotalEnergyTrack = 0.0;
1614 double PartialEnergyTrackID =
1620 if (!trkID_E.size()) {
1624 for (std::map<int, double>::iterator ii = trkID_E.begin(); ii != trkID_E.end();
1628 TotalEnergyTrack += ii->second;
1630 if ((ii->second) > max_E) {
1632 PartialEnergyTrackID = ii->second;
1634 TrackID = ii->first;
1637 if (TrackID < 0) E_em += ii->second;
1640 MCparticle = pi_serv->TrackIdToParticle_P(TrackID);
1646 if (TrackID < 0) {
return; }
1649 Purity = PartialEnergyTrackID / TotalEnergyTrack;
1652 TotalRecoEnergy = 0;
1653 for (
size_t k = 0;
k < AllHits.size();
1656 art::Ptr<recob::Hit>
hit = AllHits[
k];
1657 std::vector<sim::TrackIDE>
TrackIDs = bt_serv->HitToTrackIDEs(clockData, hit);
1658 for (
size_t l = 0; l < TrackIDs.size(); ++l) {
1659 if (TrackIDs[l].trackID == TrackID)
1660 TotalRecoEnergy += TrackIDs[l].energy;
1664 Completeness = PartialEnergyTrackID / TotalRecoEnergy;
1669 art::Ptr<recob::Track> Track2,
1670 double& TempDistanceBetweenTracks,
1671 double& TempAngleBetweenTracks,
1672 double& TempCriteriaTwoTracks)
1675 TempDistanceBetweenTracks = sqrt(pow(Track1->End().X() - Track2->Vertex().X(), 2) +
1676 pow(Track1->End().Y() - Track2->Vertex().Y(), 2) +
1677 pow(Track1->End().Z() - Track2->Vertex().Z(), 2));
1678 TempAngleBetweenTracks = (180.0 / 3.14159) * Track1->EndDirection<TVector3>().Angle(
1679 Track2->VertexDirection<TVector3>());
1680 TempCriteriaTwoTracks = 1.;
1682 if (TempDistanceBetweenTracks > sqrt(pow(Track1->End().X() - Track2->End().X(), 2) +
1683 pow(Track1->End().Y() - Track2->End().Y(), 2) +
1684 pow(Track1->End().Z() - Track2->End().Z(), 2))) {
1685 TempDistanceBetweenTracks = sqrt(pow(Track1->End().X() - Track2->End().X(), 2) +
1686 pow(Track1->End().Y() - Track2->End().Y(), 2) +
1687 pow(Track1->End().Z() - Track2->End().Z(), 2));
1688 TempAngleBetweenTracks = 180. - (180.0 / 3.14159) * Track1->EndDirection<TVector3>().Angle(
1689 Track2->EndDirection<TVector3>());
1690 TempCriteriaTwoTracks = 2.;
1693 if (TempDistanceBetweenTracks > sqrt(pow(Track1->Vertex().X() - Track2->End().X(), 2) +
1694 pow(Track1->Vertex().Y() - Track2->End().Y(), 2) +
1695 pow(Track1->Vertex().Z() - Track2->End().Z(), 2))) {
1696 TempDistanceBetweenTracks = sqrt(pow(Track1->Vertex().X() - Track2->End().X(), 2) +
1697 pow(Track1->Vertex().Y() - Track2->End().Y(), 2) +
1698 pow(Track1->Vertex().Z() - Track2->End().Z(), 2));
1699 TempAngleBetweenTracks = (180.0 / 3.14159) * Track1->VertexDirection<TVector3>().Angle(
1700 Track2->EndDirection<TVector3>());
1701 TempCriteriaTwoTracks = 3.;
1704 if (TempDistanceBetweenTracks > sqrt(pow(Track1->Vertex().X() - Track2->Vertex().X(), 2) +
1705 pow(Track1->Vertex().Y() - Track2->Vertex().Y(), 2) +
1706 pow(Track1->Vertex().Z() - Track2->Vertex().Z(), 2))) {
1707 TempDistanceBetweenTracks = sqrt(pow(Track1->Vertex().X() - Track2->Vertex().X(), 2) +
1708 pow(Track1->Vertex().Y() - Track2->Vertex().Y(), 2) +
1709 pow(Track1->Vertex().Z() - Track2->Vertex().Z(), 2));
1710 TempAngleBetweenTracks = 180. - (180.0 / 3.14159) * Track1->VertexDirection<TVector3>().Angle(
1711 Track2->VertexDirection<TVector3>());
1712 TempCriteriaTwoTracks = 4.;
1718 const simb::MCParticle*& MCparticle,
1719 art::Ptr<recob::Track>
Track,
1720 double& TempDistanceBetweenTruthAndRecoTrack,
1721 double& TempAngleBeetweenTruthAndRecoTrack)
1723 TempDistanceBetweenTruthAndRecoTrack = sqrt(pow(Track->Vertex().X() - MCparticle->Vx(), 2) +
1724 pow(Track->Vertex().Y() - MCparticle->Vy(), 2) +
1725 pow(Track->Vertex().Z() - MCparticle->Vz(), 2));
1727 TempAngleBeetweenTruthAndRecoTrack = 0;
1737 if (!MCparticle)
return -999.0;
1738 int numberTrajectoryPoints = MCparticle->NumberTrajectoryPoints();
1739 std::vector<double> TPCLengthHits(numberTrajectoryPoints, 0);
1740 int FirstHit = 0, LastHit = 0;
1741 double TPCLength = 0.0;
1742 bool BeenInVolume =
false;
1744 for (
unsigned int MCHit = 0; MCHit < TPCLengthHits.size(); ++MCHit) {
1745 const TLorentzVector& tmpPosition = MCparticle->Position(MCHit);
1746 double const tmpPosArray[] = {tmpPosition[0], tmpPosition[1], tmpPosition[2]};
1748 TPCLengthHits[MCHit] = sqrt(pow((MCparticle->Vx(MCHit - 1) - MCparticle->Vx(MCHit)), 2) +
1749 pow((MCparticle->Vy(MCHit - 1) - MCparticle->Vy(MCHit)), 2) +
1750 pow((MCparticle->Vz(MCHit - 1) - MCparticle->Vz(MCHit)), 2));
1752 if (tpcid.isValid) {
1754 if (!BeenInVolume) {
1755 BeenInVolume =
true;
1760 for (
int Hit = FirstHit + 1; Hit <= LastHit; ++Hit)
1761 TPCLength += TPCLengthHits[Hit];
1769 double x = vertex[0];
1770 double y = vertex[1];
1771 double z = vertex[2];
1791 <<
"%" << std::endl;
1793 std::cout <<
"CountGoodLeadingMuonTrack (=good events): "
1797 <<
"%" << std::endl;
1799 std::cout <<
"CountBadLeadingMuonTrack+CountNoRecoTracks+CountNoMuonTracks (=bad events): "
1805 <<
"%" << std::endl;
1807 std::cout <<
"CountNoRecoTracks+CountNoMuonTracks: "
1811 <<
"%" << std::endl;
1813 std::cout <<
"CountTrackLengthTooShort: "
1817 <<
"%" << std::endl;
1823 <<
"%" << std::endl;
1825 std::cout <<
"CountTrackLengthTooLong: "
1829 <<
"%" << std::endl;
1834 <<
"%" << std::endl;
1838 std::cout <<
"GoodLeadingMuonTrack+CountBadLeadingMuonTrackButLeadingPlusSecondGood (=good "
1839 "events after stitching): "
1847 <<
"%" << std::endl;
1849 std::cout <<
"CountBadLeadingMuonTrack+CountNoRecoTracks+CountNoMuonTracks-"
1850 "CountBadLeadingMuonTrackButLeadingPlusSecondGood (=bad events after stitching) : "
1860 <<
"%" << std::endl;
1864 std::cout <<
"CountBadLeadingMuonTrackButLeadingPlusSecondGood: "
1868 <<
"%" << std::endl;
1870 std::cout <<
"CountBadLeadingMuonTrackAndOnlyOneMuonTrack: "
1874 <<
"%" << std::endl;
1876 std::cout <<
"CountBadLeadingMuonTrackAndLeadingPlusSecondBad: "
1880 <<
"%" << std::endl;
1886 <<
"%" << std::endl;
1892 <<
"%" << std::endl;
1896 std::cout <<
"CountBadLeadingMuonTrackAndOnlyOneMuonTrackCompleteness: "
1898 std::cout <<
"CountBadLeadingMuonTrackAndOnlyOneMuonTrackPurity: "
1900 std::cout <<
"CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooShort: "
1902 std::cout <<
"CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooLong: "
1907 std::cout <<
"CountBadLeadingMuonTrackAndLeadingPlusSecondBadCompleteness: "
1910 static_cast<double>(
1913 <<
"%" << std::endl;
1915 std::cout <<
"CountBadLeadingMuonTrackAndLeadingPlusSecondBadPurity: "
1919 <<
"%" << std::endl;
1921 std::cout <<
"CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooShort: "
1924 static_cast<double>(
1927 <<
"%" << std::endl;
1929 std::cout <<
"CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooLong: "
1932 static_cast<double>(
1935 <<
"%" << std::endl;
1950 art::ServiceHandle<art::TFileService const>
tfs;
TH2D * h_MuonTrackStitching_TrackRes_Completeness
TH2D * h_NoRecoTrackAtAll_ThetaXZ_SinThetaYZ
TH2D * h_NoMuonTrack_ThetaXZ_SinThetaYZ
TH2D * h_Completeness_ThetaXZ_SinThetaYZ
void beginRun(const art::Run &run) override
process_name opflash particleana ie ie ie z
process_name opflashCryo1 flashfilter analyze
int CountBadLeadingMuonTrackAndOnlyOneMuonTrackPurity
int CountBadLeadingMuonTrackButLeadingPlusSecondGood
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Utilities related to art service access.
int BadEvents4OrMoreMuonTrack
process_name opflash particleana ie x
TH2D * h_TrackTooLong_ThetaXZ_SinThetaYZ
void FuncDistanceAndAngleBetweenTruthAndRecoTrack(const simb::MCParticle *&MCparticle, art::Ptr< recob::Track > Track, double &TempDistanceBetweenTruthAndRecoTrack, double &TempAngleBeetweenTruthAndRecoTrack)
int CountBadLeadingMuonTrackAndLeadingPlusSecondBadPurity
std::vector< TrackID > TrackIDs
int GoodEvents4OrMoreMuonTrack
TH1D * h_Efficiency_ThetaXZ
TH2D * h_TrackTooShort_ThetaXZ_SinThetaYZ
TH2D * h_ThetaXZ_ThetaYZ_LeadingPlusSecondOk
int CountTrackLengthTooShort
TH2D * h_MuonTrackStitching_Distance_Angle
TH2D * h_MuonTrackStitching_FailedCriteria_CriteriaTwoTracks_Angle
Geometry information for a single TPC.
TH2D * h_NoMuonTrack_MaxTrackLength_PDGCode
TH2D * h_MuonTrackStitching_MatchedCriteria_TrackResLeading_TrackResSecond
TH2D * h_Efficiency_ThetaXZ_SinThetaYZ_LeadingPlusSecond
TH2D * h_Criteria_NRecoTrack_num
TH2D * h_MuonTrackStitching_FailedCriteria_Distance_Angle
TH2D * h_ThetaXZ_ThetaYZ_LeadingPlusSecondOk_num
TH2D * h_MuonTrackStitching_MatchedCriteria_TrackRes_Completeness
process_name use argoneut_mc_hitfinder track
TH1D * h_Efficiency_ThetaYZ
void truthMatcher(detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit >> AllHits, std::vector< art::Ptr< recob::Hit >> track_hits, const simb::MCParticle *&MCparticle, double &Purity, double &Completeness, double &TotalRecoEnergy)
int CountBadLeadingMuonTrackAndOnlyOneMuonTrack
TH2D * h_ThetaXZ_SinThetaYZ_LeadingPlusSecondOk
TH2D * h_MuonTrackStitching_MatchedCriteria_CriteriaTwoTracks_Angle
TH2D * h_MuonTrackStitching_FailedCriteria_CompletenessSecondMuon_Angle
TH2D * h_MuonTrackStitching_FailedCriteria_CompletenessLeading_CompletenessSecond
bool insideFV(double vertex[4])
TH2D * h_FailedReconstruction_ThetaXZ_SinThetaYZ
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
TH2D * h_MuonTrackStitching_FailedCriteria_TrackRes_Completeness
std::string fMCTruthModuleLabel
TH2D * h_MuonTrackStitching_TrackResLeading_TrackResSecond
TH2D * h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_TrackResLeading_TrackResSecond
process_name opflash particleana ie ie y
TH2D * h_Efficiency_ThetaXZ_ThetaYZ_DifferenceLeadingAndLeadingPlusSecond
double MCTruthMuonVertex[4]
int CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooShort
TH2D * h_Efficiency_ThetaXZ_ThetaYZ
TH2D * h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_TrackRes_Completeness
int CountBadLeadingMuonTrack
void processEff(const art::Event &evt, bool &isFiducial)
int CountGoodLeadingMuonTrack
int CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooLong
TH2D * h_Criteria_NMuonTrack_den
void FuncDistanceAndAngleBetweenTracks(art::Ptr< recob::Track > Track1, art::Ptr< recob::Track > Track2, double &TempDistanceBetweenTracks, double &TempAngleBetweenTracks, double &TempCriteriaTwoTracks)
The data type to uniquely identify a TPC.
TH1D * h_Efficiency_SinThetaYZ
Definition of data types for geometry description.
TH2D * h_ThetaXZ_SinThetaYZ_den
Provides recob::Track data product.
TH2D * h_MuonTrackStitching_FailedCriteria_TrackResSecondMuon_Angle
double MCTruthMuonThetaYZ
int CountBadLeadingMuonTrackAndLeadingPlusSecondBad
TH2D * h_Criteria_NMuonTrack
TH2D * h_Efficiency_ThetaXZ_ThetaYZ_LeadingPlusSecond
TH2D * h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_TrackResLeading_TrackResSecond
TH2D * h_ThetaXZ_SinThetaYZ_LeadingPlusSecondOk_num
int CountBadLeadingMuonTrackAndLeadingPlusSecondBadTrackTooLong
Contains all timing reference information for the detector.
TH2D * h_Criteria_NRecoTrack_den
TH2D * h_Purity_ThetaXZ_SinThetaYZ
TH2D * h_ThetaXZ_ThetaYZ_num
TH2D * h_MuonTrackStitching_FailedCriteriaAndLeadingPlusSecondBad_Distance_Angle
int CountTrackLengthTooLong
TH2D * h_ThetaXZ_ThetaYZ_den
TH2D * h_MuonTrackStitching_CompletenessSecondMuon_Angle
void analyze(const art::Event &evt) override
TH2D * h_Efficiency_ThetaXZ_SinThetaYZ
TH2D * h_Criteria_NRecoTrack
float Purity(const simb::MCParticle &particle, float totalE, const std::vector< std::pair< int, float >> &matches, const std::vector< simb::MCParticle > &particles)
TH2D * h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_TrackRes_Completeness
art::ServiceHandle< geo::Geometry const > geom
TH2D * h_FailedReconstruction_ThetaXZ_ThetaYZ
double truthLength(const simb::MCParticle *MCparticle)
art::ServiceHandle< art::TFileService > tfs
TH2D * h_MuonTrackStitching_FailedCriteria_TrackResLeading_TrackResSecond
int CountBadLeadingMuonTrackAndOnlyOneMuonTrackTrackTooShort
TH2D * h_MuonTrackStitching_CriteriaTwoTracks_Angle
double MCTruthMuonThetaXZ
TH2D * h_Criteria_NMuonTrack_num
TH2D * h_MuonTrackStitching_TrackResSecondMuon_Angle
int CountBadLeadingMuonTrackAndOnlyOneMuonTrackCompleteness
int CountBadLeadingMuonTrackAndLeadingPlusSecondBadCompleteness
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
double MCTruthMuonMomentum
TH2D * h_ThetaXZ_SinThetaYZ_num
art framework interface to geometry description
BEGIN_PROLOG could also be cout
TH2D * h_MuonTrackStitching_MatchedCriteria_Distance_Angle
Encapsulate the construction of a single detector plane.
TH2D * h_MuonTrackStitching_FailedCriteriaButLeadingPlusSecondGood_Distance_Angle
std::string fTrackModuleLabel