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);
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));
float tpc_NuNSpacePointsInSphere
void FillCRTVars(const std::vector< art::Ptr< anab::T0 > > &trackT0s, const std::vector< art::Ptr< anab::T0 > > &hitT0s)
BEGIN_PROLOG or score(default)}sbnd_crttrackmatchingalg_crID
std::string fFlashMatchModuleLabel
std::string fSliceModuleLabel
std::string fHitModuleLabel
void FillPandoraNuScoreVars(std::map< std::string, float > &propertiesMap)
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
float tpc_StoppingChi2CosmicRatio
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
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
TMVA::Reader fCCNuEMVAReader
std::string fCCNuEMVAName
float tpc_CRLongestTrackDeflection
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)
double matchedCompleteness
float tpc_NuNFinalStatePfos
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)
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)