10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/ParameterSet.h"
19 #include "messagefacility/MessageLogger/MessageLogger.h"
21 #include "canvas/Persistency/Common/FindManyP.h"
22 #include "canvas/Persistency/Common/FindOneP.h"
23 #include "art_root_io/TFileService.h"
25 #include "nusimdata/SimulationBase/MCTruth.h"
26 #include "nusimdata/SimulationBase/MCParticle.h"
46 #include "TMVA/Reader.h"
51 class CRUMBS :
public art::EDProducer {
53 explicit CRUMBS(fhicl::ParameterSet
const&
p);
64 void produce(art::Event&
e)
override;
66 void InitialiseMVAReader(TMVA::Reader &mvaReader, std::string &mvaName, std::string &mvaFileName);
70 void GetMaps(art::Event
const& e, std::map<int, int> &trackIDToGenMap, std::map<int, std::string> &genTypeMap,
71 std::map<int, int> &genCCNCMap, std::map<int, int> &genNuTypeMap);
74 const art::Ptr<recob::Slice> &slice,
75 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices);
77 std::vector<art::Ptr<anab::T0> >
GetCRTTrackT0s(art::Event
const& e,
const art::Ptr<recob::Slice> &slice,
78 const art::ValidHandle<std::vector<recob::PFParticle> > &handlePFPs,
79 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices);
81 std::vector<art::Ptr<anab::T0> >
GetCRTHitT0s(art::Event
const& e,
const art::Ptr<recob::Slice> &slice,
82 const art::ValidHandle<std::vector<recob::PFParticle> > &handlePFPs,
83 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices);
86 const art::ValidHandle<std::vector<recob::PFParticle> > &handlePFPs,
87 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices);
94 const art::Ptr<recob::Slice> &slice,
95 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices);
98 std::map<int, int> &trackIDToGenMap,
int &matchedID,
double &purity,
double &completeness);
170 fTrainingMode (
p.get<
bool>(
"TrainingMode",
false)),
171 fEvaluateResultInTrainingMode (
p.get<
bool>(
"EvaluateResultInTrainingMode",
false)),
172 fProcessNeutrinos (
p.get<
bool>(
"ProcessNeutrinos",
true)),
173 fProcessCosmics (
p.get<
bool>(
"ProcessCosmics",
true)),
174 fMCParticleModuleLabel (
p.get<std::string>(
"MCParticleModuleLabel",
"")),
175 fGeneratorModuleLabel (
p.get<std::string>(
"GeneratorModuleLabel",
"")),
176 fCosmicModuleLabel (
p.get<std::string>(
"CosmicModuleLabel",
"")),
177 fPFParticleModuleLabel (
p.get<std::string>(
"PFParticleModuleLabel")),
178 fHitModuleLabel (
p.get<std::string>(
"HitModuleLabel")),
179 fTrackModuleLabel (
p.get<std::string>(
"TrackModuleLabel")),
180 fSliceModuleLabel (
p.get<std::string>(
"SliceModuleLabel")),
181 fFlashMatchModuleLabel (
p.get<std::string>(
"FlashMatchModuleLabel")),
182 fCRTTrackMatchModuleLabel (
p.get<std::string>(
"CRTTrackMatchModuleLabel")),
183 fCRTHitMatchModuleLabel (
p.get<std::string>(
"CRTHitMatchModuleLabel")),
184 fCalorimetryModuleLabel (
p.get<std::string>(
"CalorimetryModuleLabel")),
185 fMVAName (
p.get<std::string>(
"MVAName")),
186 fMVAFileName (
p.get<std::string>(
"MVAFileName")),
187 fCCNuMuMVAName (
p.get<std::string>(
"CCNuMuMVAName")),
188 fCCNuMuMVAFileName (
p.get<std::string>(
"CCNuMuMVAFileName")),
189 fCCNuEMVAName (
p.get<std::string>(
"CCNuEMVAName")),
190 fCCNuEMVAFileName (
p.get<std::string>(
"CCNuEMVAFileName")),
191 fNCMVAName (
p.get<std::string>(
"NCMVAName")),
192 fNCMVAFileName (
p.get<std::string>(
"NCMVAFileName")),
193 fChi2FitParams (
p.get<fhicl::ParameterSet>(
"Chi2FitParams")),
194 fTrackStoppingChi2Alg(fChi2FitParams)
196 if(!fTrainingMode || fEvaluateResultInTrainingMode)
198 produces<std::vector<CRUMBSResult>>();
199 produces<art::Assns<recob::Slice, CRUMBSResult>>();
201 InitialiseMVAReader(fMVAReader, fMVAName, fMVAFileName);
202 InitialiseMVAReader(fCCNuMuMVAReader, fCCNuMuMVAName, fCCNuMuMVAFileName);
203 InitialiseMVAReader(fCCNuEMVAReader, fCCNuEMVAName, fCCNuEMVAFileName);
204 InitialiseMVAReader(fNCMVAReader, fNCMVAName, fNCMVAFileName);
207 art::ServiceHandle<art::TFileService>
tfs;
210 fSliceTree = tfs->make<TTree>(
"SliceTree",
"Slice data TTree");
212 fSliceTree->Branch(
"tpc_NuScore",&tpc_NuScore);
213 fSliceTree->Branch(
"tpc_CRFracHitsInLongestTrack",&tpc_CRFracHitsInLongestTrack);
214 fSliceTree->Branch(
"tpc_CRLongestTrackDeflection",&tpc_CRLongestTrackDeflection);
215 fSliceTree->Branch(
"tpc_CRLongestTrackDirY",&tpc_CRLongestTrackDirY);
216 fSliceTree->Branch(
"tpc_CRNHitsMax",&tpc_CRNHitsMax);
217 fSliceTree->Branch(
"tpc_NuEigenRatioInSphere",&tpc_NuEigenRatioInSphere);
218 fSliceTree->Branch(
"tpc_NuNFinalStatePfos",&tpc_NuNFinalStatePfos);
219 fSliceTree->Branch(
"tpc_NuNHitsTotal",&tpc_NuNHitsTotal);
220 fSliceTree->Branch(
"tpc_NuNSpacePointsInSphere",&tpc_NuNSpacePointsInSphere);
221 fSliceTree->Branch(
"tpc_NuVertexY",&tpc_NuVertexY);
222 fSliceTree->Branch(
"tpc_NuWeightedDirZ",&tpc_NuWeightedDirZ);
223 fSliceTree->Branch(
"tpc_StoppingChi2CosmicRatio",&tpc_StoppingChi2CosmicRatio);
225 fSliceTree->Branch(
"pds_FMTotalScore",&pds_FMTotalScore);
226 fSliceTree->Branch(
"pds_FMPE",&pds_FMPE);
227 fSliceTree->Branch(
"pds_FMTime",&pds_FMTime);
229 fSliceTree->Branch(
"crt_TrackScore",&crt_TrackScore);
230 fSliceTree->Branch(
"crt_HitScore",&crt_HitScore);
231 fSliceTree->Branch(
"crt_TrackTime",&crt_TrackTime);
232 fSliceTree->Branch(
"crt_HitTime",&crt_HitTime);
234 fSliceTree->Branch(
"eventID",&eventID);
235 fSliceTree->Branch(
"subRunID",&subRunID);
236 fSliceTree->Branch(
"runID",&runID);
237 fSliceTree->Branch(
"slicePDG",&slicePDG);
238 fSliceTree->Branch(
"matchedType",&matchedType);
239 fSliceTree->Branch(
"matchedPurity",&matchedPurity);
240 fSliceTree->Branch(
"matchedCompleteness",&matchedCompleteness);
241 fSliceTree->Branch(
"ccnc",&ccnc);
242 fSliceTree->Branch(
"nutype",&nutype);
261 mvaReader.AddVariable(
"pds_FMPE",&
pds_FMPE);
262 mvaReader.AddVariable(
"pds_FMTime",&
pds_FMTime);
269 cet::search_path searchPath(
"FW_SEARCH_PATH");
270 std::string weightFileFullPath;
271 if (!searchPath.find_file(mvaFileName, weightFileFullPath))
272 throw cet::exception(
"CRUMBS") <<
"Unable to find weight file: " << mvaFileName <<
" in FW_SEARCH_PATH: " << searchPath.to_string();
274 mvaReader.BookMVA(mvaName, weightFileFullPath);
293 void CRUMBS::GetMaps(art::Event
const&
e, std::map<int, int> &trackIDToGenMap, std::map<int, std::string> &genTypeMap,
294 std::map<int, int> &genCCNCMap, std::map<int, int> &genNuTypeMap)
297 unsigned nNu(0), nCos(0);
301 art::Handle<std::vector<simb::MCTruth> > handleMCTruthNu;
305 for (
unsigned int i = 0; i < handleMCTruthNu->size(); ++i){
306 const art::Ptr<simb::MCTruth> mcTruth(handleMCTruthNu, i);
307 const simb::MCParticle
nu = mcTruth->GetNeutrino().Nu();
310 genTypeMap[i] =
"DirtNu";
312 genTypeMap[i] =
"Nu";
314 const std::vector<art::Ptr<simb::MCParticle> > particles = truthNuMCPAssn.at(mcTruth.key());
316 for (
auto const& particle : particles)
318 trackIDToGenMap[particle->TrackId()] = i;
322 genCCNCMap[i] = mcTruth->GetNeutrino().CCNC();
323 genNuTypeMap[i] = mcTruth->GetNeutrino().Nu().PdgCode();
329 art::Handle<std::vector<simb::MCTruth> > handleMCTruthCosmic;
334 for (
unsigned int i = 0; i < handleMCTruthCosmic->size(); ++i){
335 const art::Ptr<simb::MCTruth> mcTruth(handleMCTruthCosmic, i);
337 genTypeMap[i + nNu] =
"Cosmic";
339 const std::vector<art::Ptr<simb::MCParticle> > particles = truthCosmicMCPAssn.at(mcTruth.key());
341 for (
auto const& particle : particles)
343 trackIDToGenMap[particle->TrackId()] = i + nNu;
347 genCCNCMap[i + nNu] = -1;
348 genNuTypeMap[i + nNu] = -1;
359 std::map<int, int> trackIDToGenMap;
360 std::map<int, std::string> genTypeMap;
361 std::map<int, int> genCCNCMap;
362 std::map<int, int> genNuTypeMap;
365 this->
GetMaps(e, trackIDToGenMap, genTypeMap, genCCNCMap, genNuTypeMap);
367 auto resultsVec = std::make_unique<std::vector<CRUMBSResult>>();
368 auto sliceAssns = std::make_unique<art::Assns<recob::Slice, CRUMBSResult>>();
370 auto const handleSlices(e.getValidHandle<std::vector<recob::Slice>>(
fSliceModuleLabel));
371 std::vector<art::Ptr<recob::Slice>>
slices;
372 art::fill_ptr_vector(slices, handleSlices);
375 std::vector<art::Ptr<recob::PFParticle>> pfps;
376 art::fill_ptr_vector(pfps, handlePFPs);
378 auto const handleHits(e.getValidHandle<std::vector<recob::Hit>>(
fHitModuleLabel));
379 std::vector<art::Ptr<recob::Hit>> allHits;
380 art::fill_ptr_vector(allHits, handleHits);
382 art::FindManyP<larpandoraobj::PFParticleMetadata> pfpMetadataAssoc(handlePFPs, e,
fPFParticleModuleLabel);
385 for(
auto const &slice : slices)
394 if(primary->PdgCode() == 13 || primary->PdgCode() == 11)
397 const std::vector<art::Ptr<larpandoraobj::PFParticleMetadata> > pfpMetaVec = pfpMetadataAssoc.at(primary.key());
398 const std::vector<art::Ptr<sbn::SimpleFlashMatch> > pfpFMVec = pfpFMAssoc.at(primary.key());
399 const std::vector<art::Ptr<anab::T0> > sliceCRTTrackT0s = this->
GetCRTTrackT0s(e, slice, handlePFPs, handleSlices);
400 const std::vector<art::Ptr<anab::T0> > sliceCRTHitT0s = this->
GetCRTHitT0s(e, slice, handlePFPs, handleSlices);
402 this->
FillCRTVars(sliceCRTTrackT0s, sliceCRTHitT0s);
404 const art::Ptr<larpandoraobj::PFParticleMetadata> pfpMeta = pfpMetaVec.front();
405 std::map<std::string, float> propertiesMap = pfpMeta->GetPropertiesMap();
411 const art::Ptr<sbn::SimpleFlashMatch> flashmatch = pfpFMVec.front();
414 pds_FMTime = std::max(flashmatch->time, -100.);
423 const float bestscore = (ccnumuscore > ccnuescore && ccnumuscore > ncscore) ? ccnumuscore : (ccnuescore > ncscore) ? ccnuescore : ncscore;
424 const int bestid = (ccnumuscore > ccnuescore && ccnumuscore > ncscore) ? 14 : (ccnuescore > ncscore) ? 12 : 1;
437 std::vector<art::Ptr<recob::Hit> > sliceHits = this->
GetAllSliceHits(e, slice, handleSlices);
445 ccnc = genCCNCMap[matchedID];
446 nutype = genNuTypeMap[matchedID];
454 e.put(std::move(resultsVec));
455 e.put(std::move(sliceAssns));
461 if (!trackT0s.empty()){
463 for(
auto const crttrackmatcht0 : trackT0s)
473 if (!hitT0s.empty()){
475 for(
auto const crthitmatcht0 : hitT0s)
488 auto propertiesMapIter = propertiesMap.find(
"NuScore");
489 if (propertiesMapIter == propertiesMap.end()){
490 std::cout <<
"CRUMBS_module: Error finding variable -- NuScore" << std::endl;
495 propertiesMapIter = propertiesMap.find(
"CRFracHitsInLongestTrack");
496 if (propertiesMapIter == propertiesMap.end()){
497 std::cout <<
"CRUMBS_module: Error finding variable -- CRFracHitsInLongestTrack" << std::endl;
502 propertiesMapIter = propertiesMap.find(
"CRLongestTrackDeflection");
503 if (propertiesMapIter == propertiesMap.end()){
504 std::cout <<
"CRUMBS_module: Error finding variable -- CRLongestTrackDeflection" << std::endl;
509 propertiesMapIter = propertiesMap.find(
"CRLongestTrackDirY");
510 if (propertiesMapIter == propertiesMap.end()){
511 std::cout <<
"CRUMBS_module: Error finding variable -- CRLongestTrackDirY" << std::endl;
516 propertiesMapIter = propertiesMap.find(
"CRNHitsMax");
517 if (propertiesMapIter == propertiesMap.end()){
518 std::cout <<
"CRUMBS_module: Error finding variable -- CRNHitsMax" << std::endl;
523 propertiesMapIter = propertiesMap.find(
"NuEigenRatioInSphere");
524 if (propertiesMapIter == propertiesMap.end()){
525 std::cout <<
"CRUMBS_module: Error finding variable -- NuEigenRatioInSphere" << std::endl;
530 propertiesMapIter = propertiesMap.find(
"NuNFinalStatePfos");
531 if (propertiesMapIter == propertiesMap.end()){
532 std::cout <<
"CRUMBS_module: Error finding variable -- NuNFinalStatePfos" << std::endl;
537 propertiesMapIter = propertiesMap.find(
"NuNHitsTotal");
538 if (propertiesMapIter == propertiesMap.end()){
539 std::cout <<
"CRUMBS_module: Error finding variable -- NuNHitsTotal" << std::endl;
544 propertiesMapIter = propertiesMap.find(
"NuNSpacePointsInSphere");
545 if (propertiesMapIter == propertiesMap.end()){
546 std::cout <<
"CRUMBS_module: Error finding variable -- NuNSpacePointsInSphere" << std::endl;
551 propertiesMapIter = propertiesMap.find(
"NuVertexY");
552 if (propertiesMapIter == propertiesMap.end()){
553 std::cout <<
"CRUMBS_module: Error finding variable -- NuVertexY" << std::endl;
558 propertiesMapIter = propertiesMap.find(
"NuWeightedDirZ");
559 if (propertiesMapIter == propertiesMap.end()){
560 std::cout <<
"CRUMBS_module: Error finding variable -- NuWeightedDirZ" << std::endl;
566 std::vector<art::Ptr<recob::Hit> >
CRUMBS::GetAllSliceHits(art::Event
const&
e,
const art::Ptr<recob::Slice> &slice,
const art::ValidHandle<std::vector<recob::Slice> > &handleSlices)
569 return sliceHitAssn.at(slice.key());
572 art::Ptr<recob::PFParticle>
CRUMBS::GetSlicePrimary(art::Event
const&
e,
const art::Ptr<recob::Slice> &slice,
const art::ValidHandle<std::vector<recob::Slice> > &handleSlices)
574 art::FindManyP<recob::PFParticle> slicePfpAssn(handleSlices,e,
fSliceModuleLabel);
575 std::vector<art::Ptr<recob::PFParticle> > pfps = slicePfpAssn.at(slice.key());
577 for(
auto const &pfp : pfps)
583 art::Ptr<recob::PFParticle> nullReturn;
588 std::map<int, int> &trackIDToGenMap,
int &matchedID,
double &purity,
double &completeness)
590 std::map<int, int> sliceHitMap;
591 std::map<int, float> slicePurityMap;
593 auto clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(e);
595 for (
auto const&
hit : sliceHits)
600 for (
auto const& [
id, nHits] : sliceHitMap)
602 slicePurityMap[id] = (float) nHits / (
float) sliceHits.size();
605 for (
auto const& [
id, pur] : slicePurityMap)
614 int totalTrueHits(0);
616 for (
auto const&
hit : allHits)
622 if(totalTrueHits == 0)
625 completeness = sliceHitMap[matchedID] / (float) totalTrueHits;
628 std::vector<art::Ptr<anab::T0> >
CRUMBS::GetCRTTrackT0s(art::Event
const&
e,
const art::Ptr<recob::Slice> &slice,
const art::ValidHandle<std::vector<recob::PFParticle> > &handlePFPs,
629 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices)
631 std::vector<art::Ptr<anab::T0> > t0Vec;
633 art::Handle<std::vector<recob::Track> > handleTracks;
636 art::FindManyP<recob::PFParticle> slicePFPAssn(handleSlices,e,
fSliceModuleLabel);
640 const std::vector<art::Ptr<recob::PFParticle> > pfps = slicePFPAssn.at(slice.key());
642 for(
auto const& pfp : pfps)
644 if(pfp->PdgCode() != 13)
647 const std::vector<art::Ptr<recob::Track> >
tracks = pfpTrackAssn.at(pfp.key());
649 if(tracks.size() != 1)
652 const art::Ptr<recob::Track>
track = tracks.front();
654 const std::vector<art::Ptr<anab::T0> > t0s = trackT0Assn.at(track.key());
655 t0Vec.insert(t0Vec.end(), t0s.begin(), t0s.end());
661 std::vector<art::Ptr<anab::T0> >
CRUMBS::GetCRTHitT0s(art::Event
const&
e,
const art::Ptr<recob::Slice> &slice,
const art::ValidHandle<std::vector<recob::PFParticle> > &handlePFPs,
662 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices)
664 std::vector<art::Ptr<anab::T0> > t0Vec;
666 art::Handle<std::vector<recob::Track> > handleTracks;
669 art::FindManyP<recob::PFParticle> slicePFPAssn(handleSlices,e,
fSliceModuleLabel);
673 const std::vector<art::Ptr<recob::PFParticle> > pfps = slicePFPAssn.at(slice.key());
675 for(
auto const& pfp : pfps)
677 if(pfp->PdgCode() != 13)
680 const std::vector<art::Ptr<recob::Track> >
tracks = pfpTrackAssn.at(pfp.key());
682 if(tracks.size() != 1)
685 const art::Ptr<recob::Track>
track = tracks.front();
687 const std::vector<art::Ptr<anab::T0> > t0s = trackT0Assn.at(track.key());
688 t0Vec.insert(t0Vec.end(), t0s.begin(), t0s.end());
695 const art::ValidHandle<std::vector<recob::Slice> > &handleSlices)
697 art::Ptr<anab::Calorimetry> longestTrackCalo;
698 float maxLength = -std::numeric_limits<float>::max();
700 art::Handle<std::vector<recob::Track> > handleTracks;
703 art::FindManyP<recob::PFParticle> slicePFPAssn(handleSlices,e,
fSliceModuleLabel);
707 const std::vector<art::Ptr<recob::PFParticle> > pfps = slicePFPAssn.at(slice.key());
709 for(
auto const& pfp : pfps)
711 if(pfp->PdgCode() != 13)
714 const art::Ptr<recob::Track>
track = pfpTrackAssn.at(pfp.key());
719 const std::vector<art::Ptr<anab::Calorimetry> > calos = trackCaloAssn.at(track.key());
721 const unsigned int maxHits(std::max({ calos[0]->dEdx().size(), calos[1]->dEdx().size(), calos[2]->dEdx().size() }));
722 const int bestPlane((calos[2]->
dEdx().
size() == maxHits) ? 2 : (calos[0]->
dEdx().
size() == maxHits) ? 0 : (calos[1]->
dEdx().
size() == maxHits) ? 1 : -1);
727 const art::Ptr<anab::Calorimetry>
calo = calos.at(bestPlane);
729 if(track->Length() > maxLength)
731 maxLength = track->Length();
732 longestTrackCalo =
calo;
ClusterModuleLabel join with tracks
std::string fNCMVAFileName
std::string fTrackModuleLabel
float tpc_NuNSpacePointsInSphere
void FillCRTVars(const std::vector< art::Ptr< anab::T0 > > &trackT0s, const std::vector< art::Ptr< anab::T0 > > &hitT0s)
Declaration of signal hit object.
void InitialiseMVAReader(TMVA::Reader &mvaReader, std::string &mvaName, std::string &mvaFileName)
BEGIN_PROLOG or score(default)}sbnd_crttrackmatchingalg_crID
std::string fFlashMatchModuleLabel
G4ID TrueParticleID(detinfo::DetectorClocksData const &clockData, const art::Ptr< recob::Hit > &pHit, const bool rollupUnsavedIDs)
The G4 ID of the true particle which deposits the most energy in the recob::Hit.
std::size_t size(FixedBins< T, C > const &) noexcept
std::string fSliceModuleLabel
process_name use argoneut_mc_hitfinder track
std::string fHitModuleLabel
void FillPandoraNuScoreVars(std::map< std::string, float > &propertiesMap)
std::string fCosmicModuleLabel
std::string fPFParticleModuleLabel
bool fEvaluateResultInTrainingMode
void GetTruthMatching(art::Event const &e, const std::vector< art::Ptr< recob::Hit > > &sliceHits, const std::vector< art::Ptr< recob::Hit > > &allHits, std::map< int, int > &trackIDToGenMap, int &matchedID, double &purity, double &completeness)
TMVA::Reader fNCMVAReader
process_name can override from command line with o or output calo
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
sbn::TrackStoppingChi2Alg fTrackStoppingChi2Alg
std::string fCCNuMuMVAFileName
Utilities for matching a recob::Hit or vector of recob::Hit to the ID of the most significantly contr...
float tpc_StoppingChi2CosmicRatio
std::string fCRTTrackMatchModuleLabel
float tpc_CRFracHitsInLongestTrack
art::Ptr< recob::PFParticle > GetSlicePrimary(art::Event const &e, const art::Ptr< recob::Slice > &slice, const art::ValidHandle< std::vector< recob::Slice > > &handleSlices)
float tpc_CRLongestTrackDirY
fhicl::ParameterSet fChi2FitParams
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Provides recob::Track data product.
std::vector< TCSlice > slices
std::vector< art::Ptr< anab::T0 > > GetCRTHitT0s(art::Event const &e, const art::Ptr< recob::Slice > &slice, const art::ValidHandle< std::vector< recob::PFParticle > > &handlePFPs, const art::ValidHandle< std::vector< recob::Slice > > &handleSlices)
float GetLongestTrackStoppingChi2Ratio(art::Event const &e, const art::Ptr< recob::Slice > &slice, const art::ValidHandle< std::vector< recob::PFParticle > > &handlePFPs, const art::ValidHandle< std::vector< recob::Slice > > &handleSlices)
float tpc_NuEigenRatioInSphere
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
std::string fCCNuMuMVAName
int SliceTruthId(std::map< int, float > &purities)
TMVA::Reader fCCNuEMVAReader
std::string fCCNuEMVAName
StoppingChi2Fit RunFitForCosmicID(const anab::Calorimetry &calo) const
float tpc_CRLongestTrackDeflection
std::string fCalorimetryModuleLabel
std::string fCRTHitMatchModuleLabel
std::string fMCParticleModuleLabel
art::ServiceHandle< art::TFileService > tfs
void GetMaps(art::Event const &e, std::map< int, int > &trackIDToGenMap, std::map< int, std::string > &genTypeMap, std::map< int, int > &genCCNCMap, std::map< int, int > &genNuTypeMap)
CRUMBS(fhicl::ParameterSet const &p)
double matchedCompleteness
float tpc_NuNFinalStatePfos
std::string fCCNuEMVAFileName
std::string fGeneratorModuleLabel
TMVA::Reader fCCNuMuMVAReader
std::vector< art::Ptr< anab::T0 > > GetCRTTrackT0s(art::Event const &e, const art::Ptr< recob::Slice > &slice, const art::ValidHandle< std::vector< recob::PFParticle > > &handlePFPs, const art::ValidHandle< std::vector< recob::Slice > > &handleSlices)
void produce(art::Event &e) override
BEGIN_PROLOG could also be cout
bool InVolume(const simb::MCParticle &particle)
std::vector< art::Ptr< recob::Hit > > GetAllSliceHits(art::Event const &e, const art::Ptr< recob::Slice > &slice, const art::ValidHandle< std::vector< recob::Slice > > &handleSlices)
CRUMBS & operator=(CRUMBS const &)=delete