5 #include "CAFAna/Core/Var.h" Cuts and Vars for the 2020 FD DiF Study.
double EMScore(unsigned int ProngIdx, const caf::SRProxy *sr)
Proxy for caf::StandardRecord.
const MultiVar kNumuCCPionIndices([](const caf::SRProxy *sr){std::vector< double > indices;if(sr->vtx.elastic.IsValid){for(unsigned int png_idx=0;png_idx< sr->vtx.elastic.fuzzyk.png.size();png_idx++){if(IsNumuCCPionByCVN(png_idx, sr)) indices.push_back((double) png_idx);}}return indices;})
: Returns a vector of indices for prongs selected as pions
double HadScoreWithMuon(unsigned int ProngIdx, const caf::SRProxy *sr)
const Var kCVNMuonIdx([](const caf::SRProxy *sr){float longest_idx=-5.0;float longest_len=-5.0;if(sr->vtx.elastic.IsValid){for(unsigned int png_idx=0;png_idx< sr->vtx.elastic.fuzzyk.png.size();png_idx++){auto &png=sr->vtx.elastic.fuzzyk.png[png_idx];if(png.len > longest_len){longest_len=png.len;longest_idx=png_idx;}}} if(longest_len > 500.0) return longest_idx;float best_idx=-5.0;float best_score=-5.0;if(sr->vtx.elastic.IsValid){for(unsigned int png_idx=0;png_idx< sr->vtx.elastic.fuzzyk.png.size();png_idx++){auto &png=sr->vtx.elastic.fuzzyk.png[png_idx];if(png.cvnpart.muonid > best_score){best_score=png.cvnpart.muonid;best_idx=png_idx;}}}return best_idx;})
: Prong index of best muon prong by CVN score & length
bool IsNumuCCPionByCVN(unsigned int ProngIdx, const caf::SRProxy *sr)
: Returns a bool if prong passes NumuCC event pion selection criteria
const MultiVar kNumuCCEMShowerIndices([](const caf::SRProxy *sr){std::vector< double > indices;if(sr->vtx.elastic.IsValid){for(unsigned int png_idx=0;png_idx< sr->vtx.elastic.fuzzyk.png.size();png_idx++){if(IsNumuCCEMShowerByCVN(png_idx, sr)) indices.push_back((double) png_idx);}}return indices;})
: Returns a vector of indices for prongs selected as EM showers
bool IsNumuCCEMShowerByCVN(unsigned int ProngIdx, const caf::SRProxy *sr)
: Returns a bool if prong passes NumuCC event EM selection criteria
const MultiVar kNumuCCProtonIndices([](const caf::SRProxy *sr){std::vector< double > indices;if(sr->vtx.elastic.IsValid){for(unsigned int png_idx=0;png_idx< sr->vtx.elastic.fuzzyk.png.size();png_idx++){if(IsNumuCCProtonByCVN(png_idx, sr)) indices.push_back((double) png_idx);}}return indices;})
: Returns a vector of indices for prongs selected as protons
double HadScore(unsigned int ProngIdx, const caf::SRProxy *sr)
double GetCVNProngMuonScore(unsigned int ProngIdx, caf::SRProxy *sr)
Function to return "adjusted" CVN-prong muon score:
const Var kCVNBestMuonRawScore([](const caf::SRProxy *sr){float muonScore=-5.0;if(kCVNMuonIdx(sr)< 0.0) return muonScore;if(!sr->vtx.elastic.IsValid) return muonScore;muonScore=sr->vtx.elastic.fuzzyk.png[(unsigned int) kCVNMuonIdx(sr)].cvnpart.muonid;return muonScore;})
: Raw muon score for best muon prong by CVN score & length
const Var kCVNBestMuonScore([](const caf::SRProxy *sr){float muonScore=-5.0;if(kCVNMuonIdx(sr)< 0.0) return muonScore;if(!sr->vtx.elastic.IsValid) return muonScore;muonScore=sr->vtx.elastic.fuzzyk.png[(unsigned int) kCVNMuonIdx(sr)].cvnpart.muonid;if(sr->vtx.elastic.fuzzyk.png[(unsigned int) kCVNMuonIdx(sr)].len > 500.0) muonScore=1.0;return muonScore;})
: Muon score for best muon prong by CVN score & length
bool IsNumuCCProtonByCVN(unsigned int ProngIdx, const caf::SRProxy *sr)
: Returns a bool if prong passes NumuCC event proton selection criteria