25 #include "cetlib_except/exception.h" 49 #include "Utilities/AssociationUtil.h" 155 fTree = tfs->
make<TTree>(
"Testtree",
"Testtree");
193 bool isMCTruthListEmpty =
false;
197 if(mclist->empty()) isMCTruthListEmpty =
true;
199 catch(...) { isMCTruthListEmpty =
true; }
200 if(isMCTruthListEmpty){
209 std::vector<art::Ptr<rb::Cluster> > slices;
216 for(
unsigned int m = 0;
m < htHandle->size(); ++
m){
224 const int nslices = slices.size();
238 for(
int isli = 0; isli < nslices; ++isli){
240 if(thisSlice->
IsNoise())
continue;
241 if(!prongAssn.isValid())
continue;
243 std::vector<cheat::NeutrinoEffPur> SlicePurr = bt->
SliceToMCTruth(slices[isli]->AllCells(), slices[isli]->AllCells());
245 if(SlicePurr.size() == 0)
continue;
251 std::vector< art::Ptr<rb::Prong> > prongs = prongAssn.at(isli);
252 if(prongs.empty())
continue;
256 if(!fmCVN.isValid())
continue;
258 std::vector< art::Ptr<cosrej::NueCosRej> > cosrejs = fmcr.at(isli);
259 if(cosrejs.empty())
continue;
261 std::vector< art::Ptr<cvn::Result> > cvns = fmCVN.at(isli);
263 if(!showerLidAssn.isValid())
continue;
265 std::vector<const slid::ShowerLID*> shwlids = showerLidAssn.at(isli);
266 if(shwlids.empty())
continue;
273 std::vector< art::Ptr<rb::Shower> > showers;
274 showers.push_back(shower);
278 if(!foShLID.isValid())
continue;
284 if(cosrejs[0]->HitsPerPlane() >= 8)
continue;
285 if(showers.size() == 0)
continue;
286 if(showerLID->Gap() >= 100.)
continue;
289 if(cosrejs[0]->StartDistToFront() < 10)
continue;
290 if(cosrejs[0]->StopDistToFront() < 10)
continue;
291 if(cosrejs[0]->StartDistToBack() < 10)
continue;
292 if(cosrejs[0]->StopDistToBack() < 10)
continue;
293 if(cosrejs[0]->StartDistToTop() < 10)
continue;
294 if(cosrejs[0]->StopDistToTop() < 10)
continue;
295 if(cosrejs[0]->StartDistToWest() < 10)
continue;
296 if(cosrejs[0]->StopDistToWest() < 10)
continue;
297 if(cosrejs[0]->StartDistToEast() < 10)
continue;
298 if(cosrejs[0]->StopDistToEast() < 10)
continue;
301 for(
size_t hitIdx = 0; hitIdx < slices[isli]->NCell(); ++hitIdx){
305 if((Reco.
PECorr() > 100.0) && (Reco.
PECorr() < 245.0)) nMipHitt++;
308 if(!cvns.empty())
cosmicid = cvns[0]->fOutput[14];
309 shwGap = showerLID->Gap();
312 shwcalE = showerLID->ShowerEnergy();
316 shwlen = shower->TotalLength();
321 partptp = cosrejs[0]->ParticleShowerTransMom();
341 std::vector<float>
v (myfloats, myfloats +
sizeof(myfloats) /
sizeof(
float) );
back track the reconstruction to the simulation
NCNNKerasVal(fhicl::ParameterSet const &p)
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
void SetCosPIDKeras(double input)
virtual void set_data(std::vector< std::vector< std::vector< float > > > const &)
::xsd::cxx::tree::exception< char > exception
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
fhicl::ParameterSet fParticleIDAlgPSet
std::vector< float > compute_output(keras::DataChunk *dc)
bool CompareByEnergy(const slid::ShowerLID *a, const slid::ShowerLID *b)
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
void beginRun(art::Run const &run)
unsigned short Cell() const
std::string fShowerLIDLabel
keras::KerasModel * keras_5nn
void push_back(Ptr< U > const &p)
bool CompareByCalEnergy(const art::Ptr< rb::Prong > a, const art::Ptr< rb::Prong > b)
T get(std::string const &key) const
std::string fCellHitLabel
void reconfigure(fhicl::ParameterSet const &p)
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
EDAnalyzer(Table< Config > const &config)
Vertex location in position and time.
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
int MostContiguousPlanes(geo::View_t view) const
Longest run of adjacent planes with hits.
std::string fProngInstance
std::string fMCTruthModuleLabel
bool file_exists(std::string const &qualified_filename)
std::string fNCCosRejPIDFile
bool IsNoise() const
Is the noise flag set?
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::string fCosmicTrackLabel
std::vector< NeutrinoEffPur > SliceToMCTruth(const std::vector< const rb::CellHit * > &sliceHits, const std::vector< const rb::CellHit * > &allHits, bool sortPur=false) const
Given a collection of hits (often a slice), returns vector of structures of MCTruth, efficiency, and purity of that neutrino interaction relative to the slice. Efficiency is defined as FLS energy from neutrino interaction in slice / total FLS energy from neutrino interaction in event. This vector is sorted from the highest efficiency interaction to lowest. This function returns all MCTruth, including those without neutrino interactions, i.e. cosmics.
Encapsulate the geometry of one entire detector (near, far, ndos)
void analyze(const art::Event &evt)