10 #include "art/Framework/Core/EDAnalyzer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/SubRun.h"
14 #include "art/Framework/Principal/Handle.h"
15 #include "art/Framework/Principal/View.h"
16 #include "canvas/Persistency/Common/Ptr.h"
17 #include "canvas/Persistency/Common/PtrVector.h"
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
19 #include "art_root_io/TFileService.h"
20 #include "art_root_io/TFileDirectory.h"
21 #include "canvas/Persistency/Common/FindMany.h"
22 #include "canvas/Persistency/Common/FindManyP.h"
23 #include "canvas/Persistency/Common/FindOneP.h"
24 #include "fhiclcpp/ParameterSet.h"
25 #include "messagefacility/MessageLogger/MessageLogger.h"
31 #include "nusimdata/SimulationBase/GTruth.h"
32 #include "nusimdata/SimulationBase/MCTruth.h"
33 #include "nusimdata/SimulationBase/MCFlux.h"
79 #include "TDirectory.h"
87 #include "TGraphErrors.h"
90 #include "TTimeStamp.h"
96 #include "TTimeStamp.h"
100 #include "TPaveStats.h"
122 void beginJob()
override;
124 bool HitCompare(
const art::Ptr<CRTHit>& h1,
const art::Ptr<CRTHit>& h2);
126 double length(
const simb::MCParticle& part, TVector3& start, TVector3&
end);
129 const double LAR_PROP_DELAY = 1.0/1.35e1;
333 ToFAnalyzer::ToFAnalyzer(fhicl::ParameterSet
const& pset):
335 fGenLabel(pset.get<art::InputTag>(
"GenLabel")),
336 fSimLabel(pset.get<art::InputTag>(
"SimLabel")),
337 fOpHitModuleLabel(pset.get<art::InputTag>(
"OpHitModuleLabel")),
338 fOpFlashModuleLabel0(pset.get<art::InputTag>(
"OpFlashModuleLabel0")),
339 fOpFlashModuleLabel1(pset.get<art::InputTag>(
"OpFlashModuleLabel1")),
340 fCrtHitModuleLabel(pset.get<art::InputTag>(
"CrtHitModuleLabel")),
341 fCrtTrackModuleLabel(pset.get<art::InputTag>(
"CrtTrackModuleLabel")),
342 fCoinWindow(pset.get<
double>(
"CoincidenceWindow")),
343 fOpDelay(pset.get<
double>(
"OpDelay")),
344 fCRThitThresh(pset.get<
double>(
"CRThitThresh")),
345 fFlashPeThresh(pset.get<
int>(
"FlashPeThresh")),
346 fHitPeThresh(pset.get<
int>(
"HitPeThresh")),
347 fBeamLow(pset.get<
double>(
"BeamLow")),
348 fBeamUp(pset.get<
double>(
"BeamUp")),
349 fLFlash(pset.get<
bool>(
"LFlash")),
350 fLFlash_hit(pset.get<
bool>(
"LFlash_hit")),
351 fCFlash(pset.get<
bool>(
"CFlash")),
352 fCFlash_hit(pset.get<
bool>(
"CFlash_hit")),
353 fLhit(pset.get<
bool>(
"Lhit")),
354 fChit(pset.get<
bool>(
"Chit")),
355 fSaveNuInfo(pset.get<
bool>(
"SaveNuInfo")),
356 fSaveG4Info(pset.get<
bool>(
"SaveG4Info")),
357 fG4timeUp(pset.get<
double>(
"G4timeUp")),
358 fG4timeLow(pset.get<
double>(
"G4timeLow")),
359 fkeeponlytracks(pset.get<
bool>(
"keeponlytracks")),
360 fSaveTrueToFInfo(pset.get<
bool>(
"SaveTrueToFInfo")),
361 bt(
new CRTBackTracker(pset.get<fhicl::ParameterSet>(
"CRTBackTrack")))
363 fFlashLabels[0] = fOpFlashModuleLabel0;
364 fFlashLabels[1] = fOpFlashModuleLabel1;
373 art::ServiceHandle<art::TFileService>
tfs;
374 fMatchTree = tfs->make<TTree>(
"matchTree",
"CRTHit - OpHit/Flash matching analysis");
563 art::Handle< std::vector<simb::MCTruth> > MCTruthListHandle;
564 std::vector< art::Ptr<simb::MCTruth> > MCTruthkList;
565 if( evt.getByLabel(
fGenLabel,MCTruthListHandle))
566 art::fill_ptr_vector(MCTruthkList, MCTruthListHandle);
568 for(
auto const& mctruth : MCTruthkList){
569 if (!mctruth->NeutrinoSet())
continue;
570 auto const&
nu = mctruth->GetNeutrino();
571 const TLorentzVector xyzt =
nu.Nu().Position(0);
579 fnu_T.push_back(xyzt.T());
593 art::Handle< std::vector<simb::MCParticle> > SimPartListHandle;
594 std::vector< art::Ptr<simb::MCParticle> > SimPartList;
595 if( evt.getByLabel(
fSimLabel,SimPartListHandle))
596 art::fill_ptr_vector(SimPartList, SimPartListHandle);
598 for(
auto const& part : SimPartList){
602 if(!(TMath::Abs(part->PdgCode())==13 || TMath::Abs(part->PdgCode())==211 || TMath::Abs(part->PdgCode())==2212 || TMath::Abs(part->PdgCode())==321))
continue;
605 fg4_pdg.push_back(part->PdgCode());
607 if(part->Process()==
"primary")
fg4is_prim.push_back(
true);
609 fg4_T0.push_back(part->T());
611 fg4_org.push_back(truth->NeutrinoSet());
613 const TLorentzVector st_xyzt = part->Position(0);
614 double st_point[3] = {st_xyzt.X(), st_xyzt.Y(), st_xyzt.Z()};
615 fg4_stX.push_back(st_point[0]);
616 fg4_stY.push_back(st_point[1]);
617 fg4_stZ.push_back(st_point[2]);
622 const TLorentzVector en_xyzt = part->EndPosition();
623 double en_point[3] = {en_xyzt.X(), en_xyzt.Y(), en_xyzt.Z()};
624 fg4_enX.push_back(en_point[0]);
625 fg4_enY.push_back(en_point[1]);
626 fg4_enZ.push_back(en_point[2]);
631 fg4_E.push_back(part->E());
632 TVector3 mcstart, mcend;
634 bool is_in_TPC=
false;
635 bool is_in_CRYO=
false;
636 bool is_filled=
false;
639 for(
size_t i=0; i<part->NumberTrajectoryPoints(); i++){
640 const TLorentzVector& pos = part->Position(i);
641 double point[3] = {pos.X(),pos.Y(),pos.Z()};
662 art::Handle< std::vector<sbn::crt::CRTTrack> > crtTrackListHandle;
663 std::vector< art::Ptr<sbn::crt::CRTTrack> > crtTrackList;
665 art::fill_ptr_vector(crtTrackList, crtTrackListHandle);
668 std::vector<std::vector<art::Ptr<CRTHit>>> trackhits;
672 for(
size_t itrk=0; itrk<crtTrackList.size(); itrk++){
673 std::vector<art::Ptr<CRTHit>> trkhits = findManyHits.at(itrk);
674 std::sort(trkhits.begin(),trkhits.end(),
675 [](
const art::Ptr<CRTHit>&
a,
const art::Ptr<CRTHit>& b)->
bool
677 return a->ts1_ns < b->ts1_ns;
679 trackhits.push_back(trkhits);
684 art::Handle< std::vector<sbn::crt::CRTHit> > crtHitListHandle;
685 std::vector< art::Ptr<sbn::crt::CRTHit> > crtHitList;
687 art::fill_ptr_vector(crtHitList, crtHitListHandle);
689 map<int, std::vector<art::Ptr<CRTHit>> > Lhit_tof_crt_hits;
690 map<int, std::vector<art::Ptr<recob::OpHit>> > Lhit_tof_op_hits;
692 map<int, std::vector<art::Ptr<CRTHit>> > Chit_tof_crt_hits;
693 map<int, std::vector<art::Ptr<recob::OpHit>> > Chit_tof_op_hits;
695 map<int, std::vector<art::Ptr<CRTHit>> > Lflsh_tof_crt_hits;
696 map<int, std::vector<art::Ptr<recob::OpFlash>> > Lflsh_tof_op_flashes;
697 map<int, std::vector<int>> Lflsh_tof_op_tpc;
699 map<int, std::vector<art::Ptr<CRTHit>> > Cflsh_tof_crt_hits;
700 map<int, std::vector<art::Ptr<recob::OpFlash>> > Cflsh_tof_op_flashes;
701 map<int, std::vector<int>> Cflsh_tof_op_tpc;
703 map<int, std::vector<art::Ptr<CRTHit>> > Lflshhit_tof_crt_hits;
704 map<int, std::vector<art::Ptr<recob::OpHit>> > Lflshhit_tof_op_hits;
705 map<int, std::vector<art::Ptr<recob::OpFlash>> > Lflshhit_tof_op_flashes;
706 map<int, std::vector<int>> Lflshhit_tof_op_tpc;
708 map<int, std::vector<art::Ptr<CRTHit>> > Cflshhit_tof_crt_hits;
709 map<int, std::vector<art::Ptr<recob::OpHit>> > Cflshhit_tof_op_hits;
710 map<int, std::vector<art::Ptr<recob::OpFlash>> > Cflshhit_tof_op_flashes;
711 map<int, std::vector<int>> Cflshhit_tof_op_tpc;
713 map<int, std::vector<art::Ptr<CRTHit>> > True_tof_crt_hits;
714 map<int,std::vector<const simb::MCParticle*>> True_tof_sim_particles;
716 for(
auto const&
crt : crtHitList){
723 for(
auto const& trkhits: trackhits){
724 for(
size_t ihit=0; ihit<trkhits.size(); ihit++){
739 auto const& simparticles = *evt.getValidHandle<vector<simb::MCParticle>>(
fSimLabel);
740 map<int,const simb::MCParticle*> particleMap;
741 for(
auto const& particle : simparticles) particleMap[particle.TrackId()] = &particle;
743 if(particleMap.find(
abs(trackID))!=particleMap.end()){
745 True_tof_crt_hits[index].push_back(
crt);
746 True_tof_sim_particles[index].push_back(particleMap[
abs(trackID)]);
749 auto const& particle=particleMap[
abs(trackID)];
750 bool found_tpc_traj_point=
false;
751 for(
size_t i=0; i<particle->NumberTrajectoryPoints(); i++){
752 const TLorentzVector& pos = particle->Position(i);
753 double point[3] = {pos.X(),pos.Y(),pos.Z()};
757 double dprop=sqrt(pow(opDetPos[0]-pos[0],2) + pow(opDetPos[1]-pos[1],2) + pow(opDetPos[2]-pos[2],2));
765 art::Ptr<simb::MCTruth> truth=inventory_service->
TrackIdToMCTruth_P(particle->TrackId());
772 found_tpc_traj_point=
true;
777 if(!found_tpc_traj_point){
778 for(
size_t i=0; i<particle->NumberTrajectoryPoints(); i++){
779 const TLorentzVector& pos = particle->Position(i);
780 double point[3] = {pos.X(),pos.Y(),pos.Z()};
784 double dprop=sqrt(pow(opDetPos[0]-pos[0],2) + pow(opDetPos[1]-pos[1],2) + pow(opDetPos[2]-pos[2],2));
792 art::Ptr<simb::MCTruth> truth=inventory_service->
TrackIdToMCTruth_P(particle->TrackId());
815 bool found_tof =
false;
816 int ophit_index = -1;
818 art::Handle< std::vector<recob::OpHit> > opHitListHandle;
819 std::vector< art::Ptr<recob::OpHit> > opHitList;
821 art::fill_ptr_vector(opHitList, opHitListHandle);
823 for(
auto const&
hit : opHitList){
828 pehit_max =
hit->PE();
829 ophit_index =
hit.key();
836 Lhit_tof_crt_hits[index].push_back(
crt);
837 Lhit_tof_op_hits[index].push_back(opHitList[ophit_index]);
871 double ophit_minTOF = DBL_MAX;
872 bool found_tof =
false;
873 int ophit_index = -1;
875 art::Handle< std::vector<recob::OpHit> > opHitListHandle;
876 std::vector< art::Ptr<recob::OpHit> > opHitList;
878 art::fill_ptr_vector(opHitList, opHitListHandle);
880 for(
auto const&
hit : opHitList){
885 ophit_minTOF =
abs(
crt->ts1_ns-thit);
886 ophit_index =
hit.key();
893 Chit_tof_crt_hits[index].push_back(
crt);
894 Chit_tof_op_hits[index].push_back(opHitList[ophit_index]);
927 double peflash_max=0;
928 bool found_tof =
false;
929 int opflash_index = -1;
932 std::map<int, art::Handle< std::vector<recob::OpFlash> > > flashHandles;
933 std::map<int,std::vector< art::Ptr<recob::OpFlash> >> opFlashLists;
935 for(
int i=0; i<2; i++) {
937 art::fill_ptr_vector(opFlashLists[i], flashHandles[i]);
940 for(
auto const& flashList : opFlashLists){
941 for(
size_t iflash=0; iflash<flashList.second.size(); iflash++){
942 auto const& flash = flashList.second[iflash];
944 double tflash = flash->AbsTime()*1e3-
fOpDelay;
946 peflash_max=flash->TotalPE();
947 opflash_index = flash.key();
949 flash_tpc = flashList.first;
956 Lflsh_tof_crt_hits[index].push_back(
crt);
957 Lflsh_tof_op_flashes[index].push_back(opFlashLists[flash_tpc][opflash_index]);
958 Lflsh_tof_op_tpc[index].push_back(flash_tpc);
988 double flash_minTOF = DBL_MAX;
989 bool found_tof =
false;
990 int opflash_index = -1;
993 std::map<int, art::Handle< std::vector<recob::OpFlash> > > flashHandles;
994 std::map<int,std::vector< art::Ptr<recob::OpFlash> >> opFlashLists;
996 for(
int i=0; i<2; i++) {
998 art::fill_ptr_vector(opFlashLists[i], flashHandles[i]);
1001 for(
auto const& flashList : opFlashLists){
1002 for(
size_t iflash=0; iflash<flashList.second.size(); iflash++){
1003 auto const& flash = flashList.second[iflash];
1005 double tflash = flash->Time()*1e3-
fOpDelay;
1007 flash_minTOF=
abs(
crt->ts1_ns-tflash);
1008 opflash_index = flash.key();
1010 flash_tpc = flashList.first;
1017 Cflsh_tof_crt_hits[index].push_back(
crt);
1018 Cflsh_tof_op_flashes[index].push_back(opFlashLists[flash_tpc][opflash_index]);
1019 Cflsh_tof_op_tpc[index].push_back(flash_tpc);
1049 double peflash_max=0;
1050 bool found_tof =
false;
1051 int opflash_index = -1;
1053 int ophit_index = -1;
1055 std::map<int, art::Handle< std::vector<recob::OpFlash> > > flashHandles;
1056 std::map<int,std::vector< art::Ptr<recob::OpFlash> >> opFlashLists;
1058 for(
int i=0; i<2; i++) {
1060 art::fill_ptr_vector(opFlashLists[i], flashHandles[i]);
1063 art::Handle< std::vector<recob::OpHit> > opHitListHandle;
1064 std::vector< art::Ptr<recob::OpHit> > opHitList;
1066 art::fill_ptr_vector(opHitList, opHitListHandle);
1068 for(
auto const& flashList : opFlashLists){
1069 art::FindManyP<recob::OpHit> findManyOpHits(flashHandles[flashList.first], evt,
fFlashLabels[flashList.first]);
1070 for(
size_t iflash=0; iflash<flashList.second.size(); iflash++){
1071 auto const& flash = flashList.second[iflash];
1073 double tflash = flash->AbsTime()*1e3-
fOpDelay;
1075 peflash_max=flash->TotalPE();
1076 opflash_index = flash.key();
1078 flash_tpc = flashList.first;
1079 vector<art::Ptr<recob::OpHit>> hits = findManyOpHits.at(flash.key());
1080 double flashMinHitT = DBL_MAX;
1081 for(
auto const&
hit : hits){
1083 if(tPmt < flashMinHitT){
1084 flashMinHitT = tPmt;
1085 ophit_index =
hit.key();
1094 Lflshhit_tof_crt_hits[index].push_back(
crt);
1095 Lflshhit_tof_op_flashes[index].push_back(opFlashLists[flash_tpc][opflash_index]);
1096 Lflshhit_tof_op_tpc[index].push_back(flash_tpc);
1097 Lflshhit_tof_op_hits[index].push_back(opHitList[ophit_index]);
1132 double flash_minTOF = DBL_MAX;
1133 bool found_tof =
false;
1134 int opflash_index = -1;
1136 int ophit_index = -1;
1138 std::map<int, art::Handle< std::vector<recob::OpFlash> > > flashHandles;
1139 std::map<int,std::vector< art::Ptr<recob::OpFlash> >> opFlashLists;
1141 for(
int i=0; i<2; i++) {
1143 art::fill_ptr_vector(opFlashLists[i], flashHandles[i]);
1146 art::Handle< std::vector<recob::OpHit> > opHitListHandle;
1147 std::vector< art::Ptr<recob::OpHit> > opHitList;
1149 art::fill_ptr_vector(opHitList, opHitListHandle);
1151 for(
auto const& flashList : opFlashLists){
1152 art::FindManyP<recob::OpHit> findManyOpHits(flashHandles[flashList.first], evt,
fFlashLabels[flashList.first]);
1153 for(
size_t iflash=0; iflash<flashList.second.size(); iflash++){
1154 auto const& flash = flashList.second[iflash];
1156 double tflash = flash->AbsTime()*1e3-
fOpDelay;
1158 flash_minTOF=
abs(
crt->ts1_ns-tflash);
1159 opflash_index = flash.key();
1161 flash_tpc = flashList.first;
1162 vector<art::Ptr<recob::OpHit>> hits = findManyOpHits.at(flash.key());
1163 double flashMinHitT = DBL_MAX;
1164 for(
auto const&
hit : hits){
1166 if(tPmt < flashMinHitT){
1167 flashMinHitT = tPmt;
1168 ophit_index =
hit.key();
1177 Cflshhit_tof_crt_hits[index].push_back(
crt);
1178 Cflshhit_tof_op_flashes[index].push_back(opFlashLists[flash_tpc][opflash_index]);
1179 Cflshhit_tof_op_tpc[index].push_back(flash_tpc);
1180 Cflshhit_tof_op_hits[index].push_back(opHitList[ophit_index]);
1218 if(!Lhit_tof_crt_hits.empty()){
1219 for (
auto& ele: Lhit_tof_crt_hits){
1220 double min_time = DBL_MAX;
1223 for (
auto const&
hit: ele.second){
1224 if(
hit->ts1_ns < min_time){
1225 min_time =
hit->ts1_ns;
1226 min_index = all_index;
1231 fLhit_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Lhit_tof_op_hits[ele.first][min_index]->PeakTime()*1e3-
fOpDelay));
1260 if(!Chit_tof_crt_hits.empty()){
1261 for (
auto& ele: Chit_tof_crt_hits){
1262 double min_time = DBL_MAX;
1265 for (
auto const&
hit: ele.second){
1266 if(
hit->ts1_ns < min_time){
1267 min_time =
hit->ts1_ns;
1268 min_index = all_index;
1273 fChit_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Chit_tof_op_hits[ele.first][min_index]->PeakTime()*1e3-
fOpDelay));
1302 if(!Lflsh_tof_crt_hits.empty()){
1303 for (
auto& ele: Lflsh_tof_crt_hits){
1304 double min_time = DBL_MAX;
1307 for (
auto const&
hit: ele.second){
1308 if(
hit->ts1_ns < min_time){
1309 min_time =
hit->ts1_ns;
1310 min_index = all_index;
1315 fLflsh_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Lflsh_tof_op_flashes[ele.first][min_index]->Time()*1e3-
fOpDelay));
1342 if(!Cflsh_tof_crt_hits.empty()){
1343 for (
auto& ele: Cflsh_tof_crt_hits){
1344 double min_time = DBL_MAX;
1347 for (
auto const&
hit: ele.second){
1348 if(
hit->ts1_ns < min_time){
1349 min_time =
hit->ts1_ns;
1350 min_index = all_index;
1355 fCflsh_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Cflsh_tof_op_flashes[ele.first][min_index]->Time()*1e3-
fOpDelay));
1382 if(!Lflshhit_tof_crt_hits.empty()){
1383 for (
auto& ele: Lflshhit_tof_crt_hits){
1384 double min_time = DBL_MAX;
1387 for (
auto const&
hit: ele.second){
1388 if(
hit->ts1_ns < min_time){
1389 min_time =
hit->ts1_ns;
1390 min_index = all_index;
1395 fLflshhit_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Lflshhit_tof_op_hits[ele.first][min_index]->PeakTime()*1e3-
fOpDelay));
1426 if(!Cflshhit_tof_crt_hits.empty()){
1427 for (
auto& ele: Cflshhit_tof_crt_hits){
1428 double min_time = DBL_MAX;
1431 for (
auto const&
hit: ele.second){
1432 if(
hit->ts1_ns < min_time){
1433 min_time =
hit->ts1_ns;
1434 min_index = all_index;
1439 fCflshhit_tof_vec.push_back(trackhits[ele.first].front()->ts1_ns - (Cflshhit_tof_op_hits[ele.first][min_index]->PeakTime()*1e3-
fOpDelay));
1470 if(!True_tof_crt_hits.empty()){
1472 for (
auto& ele: True_tof_crt_hits){
1473 double min_time = DBL_MAX;
1476 for (
auto const&
hit: ele.second){
1477 if(
hit->ts1_ns < min_time){
1478 min_time =
hit->ts1_ns;
1479 min_index = all_index;
1484 bool found_tpc_traj_point=
false;
1485 for(
size_t i=0; i<True_tof_sim_particles[ele.first][min_index]->NumberTrajectoryPoints(); i++){
1486 const TLorentzVector& pos = True_tof_sim_particles[ele.first][min_index]->Position(i);
1487 double point[3] = {pos.X(),pos.Y(),pos.Z()};
1491 double dprop=sqrt(pow(opDetPos[0]-pos[0],2) + pow(opDetPos[1]-pos[1],2) + pow(opDetPos[2]-pos[2],2));
1493 fTrue_TOF.push_back(trackhits[ele.first].front()->ts1_ns-tprop);
1495 fTrue_TOF_pdg.push_back(True_tof_sim_particles[ele.first][min_index]->PdgCode());
1496 fTrue_TOF_part_ID.push_back(True_tof_sim_particles[ele.first][min_index]->TrackId());
1497 if(True_tof_sim_particles[ele.first][min_index]->Process()==
"primary")
fTrue_TOF_part_prim.push_back(
true);
1499 art::Ptr<simb::MCTruth> truth=inventory_service->
TrackIdToMCTruth_P(True_tof_sim_particles[ele.first][min_index]->TrackId());
1506 found_tpc_traj_point=
true;
1511 if(!found_tpc_traj_point){
1512 for(
size_t i=0; i<True_tof_sim_particles[ele.first][min_index]->NumberTrajectoryPoints(); i++){
1513 const TLorentzVector& pos = True_tof_sim_particles[ele.first][min_index]->Position(i);
1514 double point[3] = {pos.X(),pos.Y(),pos.Z()};
1518 double dprop=sqrt(pow(opDetPos[0]-pos[0],2) + pow(opDetPos[1]-pos[1],2) + pow(opDetPos[2]-pos[2],2));
1520 fTrue_TOF.push_back(trackhits[ele.first].front()->ts1_ns-tprop);
1522 fTrue_TOF_pdg.push_back(True_tof_sim_particles[ele.first][min_index]->PdgCode());
1523 fTrue_TOF_part_ID.push_back(True_tof_sim_particles[ele.first][min_index]->TrackId());
1524 if(True_tof_sim_particles[ele.first][min_index]->Process()==
"primary")
fTrue_TOF_part_prim.push_back(
true);
1526 art::Ptr<simb::MCTruth> truth=inventory_service->
TrackIdToMCTruth_P(True_tof_sim_particles[ele.first][min_index]->TrackId());
1548 if(hit1->ts1_ns != hit2->ts1_ns)
return false;
1549 if(hit1->plane != hit2->plane)
return false;
1550 if(hit1->x_pos != hit2->x_pos)
return false;
1551 if(hit1->y_pos != hit2->y_pos)
return false;
1552 if(hit1->z_pos != hit2->z_pos)
return false;
1553 if(hit1->x_err != hit2->x_err)
return false;
1554 if(hit1->y_err != hit2->y_err)
return false;
1555 if(hit1->z_err != hit2->z_err)
return false;
1556 if(hit1->tagger != hit2->tagger)
return false;
1564 art::ServiceHandle<geo::Geometry> geom;
1565 double xmin = -2.0 * geom->DetHalfWidth();
1566 double xmax = 2.0 * geom->DetHalfWidth();
1567 double ymin = -geom->DetHalfHeight();
1568 double ymax = geom->DetHalfHeight();
1570 double zmax = geom->DetLength();
1574 int n = part.NumberTrajectoryPoints();
1577 for(
int i = 0; i <
n; ++i) {
1578 double mypos[3] = {part.Vx(i), part.Vy(i), part.Vz(i)};
1579 if(mypos[0] >= xmin && mypos[0] <= xmax && mypos[1] >= ymin && mypos[1] <= ymax && mypos[2] >= zmin && mypos[2] <= zmax){
1580 double xGen = part.Vx(i);
1583 TVector3 pos(newX,part.Vy(i),part.Vz(i));
1589 result += disp.Mag();
vector< double > fChit_pmthitZ_vec
vector< int > fTrue_TOF_part_ID
unsigned int GetClosestOpDet(geo::Point_t const &point) const
vector< double > fg4_tlen
process_name opflashCryo1 flashfilter analyze
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
vector< bool > fLhit_frmhit_vec
vector< double > fCflsh_crtpe_vec
vector< double > fg4_T0_CRYO
vector< double > fChit_crtpos_Y_vec
vector< double > fChit_crttime_t1_vec
vector< double > fLflshhit_crttime_t1_vec
vector< int > fCflsh_pmtflshkey_vec
Implementation of the Projection Matching Algorithm.
vector< double > fTrue_TOF_traj_Y
vector< bool > fg4en_CRYO
vector< double > fLhit_pmthitY_vec
vector< bool > fLflsh_frmhit_vec
vector< double > fLflsh_crtpos_Y_vec
vector< double > fnu_posY
vector< double > fLflsh_crttime_t1_vec
vector< double > fCflsh_crtpos_Z_vec
vector< double > fChit_pmthitX_vec
vector< double > fCflshhit_pmtflshZ_vec
Declaration of signal hit object.
vector< double > fChit_crtpe_vec
vector< double > fCflsh_crttime_t0_vec
vector< bool > fTrue_TOF_traj_in_TPC
vector< bool > fCflsh_frmhit_vec
Geometry information for a single TPC.
vector< double > fLflshhit_crtpos_Z_vec
vector< double > fCflsh_tof_vec
vector< double > fLhit_crtpe_vec
vector< int > fLflsh_pmtflshtpcID_vec
vector< int > fChit_pmthitkey_vec
vector< double > fLhit_pmthitpe_vec
Definition of basic raw digits.
vector< double > fLflshhit_pmtflshpe_vec
art::InputTag fOpHitModuleLabel
vector< double > fCflsh_crttime_t1_vec
map< int, art::InputTag > fFlashLabels
void GetCenter(double *xyz, double localz=0.0) const
vector< double > fLhit_tof_vec
vector< double > fLflshhit_crtpos_Y_vec
vector< int > fTrue_TOF_pdg
vector< int > fCflshhit_crttrkkey_vec
Geometry information for a single cryostat.
vector< double > fChit_tof_vec
vector< double > fLflshhit_pmtflshT_vec
vector< double > fTrue_TOF_traj_X
vector< double > fLflsh_crttime_t0_vec
vector< double > fCflshhit_pmtflshX_vec
vector< double > fLhit_pmthitZ_vec
const double LAR_PROP_DELAY
vector< double > fChit_pmthitT_vec
vector< double > fLflshhit_pmtflshY_vec
int TrueIdFromTotalEnergy(const art::Event &event, const sbnd::crt::CRTData &data)
vector< int > fCflsh_crthitkey_vec
vector< double > fLflshhit_crtpe_vec
art::InputTag fCrtHitModuleLabel
vector< double > fLhit_pmthitT_vec
vector< double > fLflsh_pmtflshT_vec
vector< bool > fTrue_TOF_hit
vector< double > fChit_pmthitY_vec
vector< double > fChit_crttime_t0_vec
vector< int > fChit_crttrkkey_vec
vector< bool > fChit_frmhit_vec
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
vector< int > fLflsh_pmtflshkey_vec
vector< bool > fLflshhit_frmhit_vec
vector< double > fLflsh_tof_vec
vector< bool > fLhit_frmtrk_vec
vector< bool > fg4is_prim
object containing MC truth information necessary for making RawDigits and doing back tracking ...
vector< double > fCflsh_crtpos_Y_vec
vector< std::string > fChit_crttgr_vec
vector< double > fCflshhit_crttime_t0_vec
const OpDetGeo & OpDet(unsigned int iopdet) const
Return the iopdet'th optical detector in the cryostat.
vector< bool > fLflshhit_frmtrk_vec
bool HitCompare(const art::Ptr< CRTHit > &h1, const art::Ptr< CRTHit > &h2)
vector< double > fLflsh_pmtflshpe_vec
vector< double > fLhit_pmthitX_vec
vector< int > fLhit_pmthitkey_vec
vector< bool > fChit_frmtrk_vec
vector< double > fLflshhit_pmtflshZ_vec
vector< int > fLflsh_crttrkkey_vec
vector< int > fLflshhit_crthitkey_vec
double length(const simb::MCParticle &part, TVector3 &start, TVector3 &end)
vector< double > fLhit_crtpos_Z_vec
vector< double > fChit_crtpos_Z_vec
auto end(FixedBins< T, C > const &) noexcept
vector< double > fLhit_crttime_t1_vec
vector< double > fCflsh_pmtflshY_vec
vector< int > fCflsh_crttrkkey_vec
vector< double > fLflshhit_tof_vec
vector< double > fLflsh_crtpe_vec
vector< double > fChit_pmthitpe_vec
vector< bool > fg4_is_in_CRYO
vector< double > fLhit_crtpos_Y_vec
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::GeometryCore const * fGeometryService
vector< double > fnu_posX
void analyze(art::Event const &evt) override
vector< std::string > fCflshhit_crttgr_vec
vector< double > fCflsh_pmtflshT_vec
vector< bool > fCflsh_frmtrk_vec
Description of geometry of one entire detector.
Declaration of cluster object.
vector< double > fLflshhit_crttime_t0_vec
Definition of data types for geometry description.
vector< double > fCflsh_crtpos_X_vec
vector< bool > fTrue_TOF_part_prim
vector< double > fCflshhit_crtpos_Z_vec
vector< int > fCflshhit_pmtflshkey_vec
Provides recob::Track data product.
vector< double > fTrue_TOF
vector< bool > fg4_is_in_TPC
vector< std::string > fLhit_crttgr_vec
vector< int > fCflsh_pmtflshtpcID_vec
vector< double > fCflshhit_crtpos_Y_vec
vector< int > fLhit_crthitkey_vec
vector< double > fCflshhit_crtpos_X_vec
vector< double > fCflshhit_crttime_t1_vec
vector< double > fLflsh_crtpos_Z_vec
art::InputTag fOpFlashModuleLabel0
vector< int > fLflsh_crthitkey_vec
vector< double > fLflsh_crtpos_X_vec
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
vector< int > fLflshhit_crttrkkey_vec
vector< double > fLflshhit_pmtflshX_vec
vector< int > fCflshhit_crthitkey_vec
art::InputTag fOpFlashModuleLabel1
vector< double > fCflshhit_pmtflshpe_vec
vector< double > fLhit_crttime_t0_vec
vector< double > fTrue_TOF_traj_T
object containing MC truth information necessary for making RawDigits and doing back tracking ...
Class def header for MCShower data container.
vector< bool > fTrue_TOF_part_org
vector< int > fChit_crthitkey_vec
vector< bool > fLflsh_frmtrk_vec
vector< double > fCflshhit_tof_vec
vector< double > fChit_crtpos_X_vec
stream1 can override from command line with o or output services user sbnd
vector< int > fLflshhit_pmtflshtpcID_vec
vector< int > fLflshhit_pmtkey_vec
vector< double > fLhit_crtpos_X_vec
vector< double > fLflsh_pmtflshZ_vec
art::ServiceHandle< art::TFileService > tfs
vector< int > fCflshhit_pmtkey_vec
vector< int > fLhit_crttrkkey_vec
vector< double > fg4_T0_TPC
vector< double > fCflshhit_pmtflshY_vec
vector< double > fnu_posZ
vector< int > fCflshhit_pmtflshtpcID_vec
vector< double > fLflsh_pmtflshY_vec
vector< double > fLflshhit_crtpos_X_vec
vector< bool > fCflshhit_frmhit_vec
helper function for LArPandoraInterface producer module
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int const &id) const
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int OpChannel) const
Returns the geo::OpDetGeo object for the given channel number.
vector< double > fCflsh_pmtflshZ_vec
vector< int > fLflshhit_pmtflshkey_vec
bool ContainsPosition(geo::Point_t const &point, double wiggle=1.0) const
Returns whether this volume contains the specified point.
art framework interface to geometry description
BEGIN_PROLOG could also be cout
vector< double > fCflsh_pmtflshpe_vec
art::InputTag fCrtTrackModuleLabel
vector< double > fCflshhit_crtpe_vec
vector< double > fTrue_TOF_traj_Z
vector< std::string > fCflsh_crttgr_vec
vector< std::string > fLflsh_crttgr_vec
vector< bool > fg4st_CRYO
vector< bool > fCflshhit_frmtrk_vec
vector< std::string > fLflshhit_crttgr_vec
vector< double > fCflshhit_pmtflshT_vec