26 #include "cetlib_except/exception.h" 47 #include "Utilities/AssociationUtil.h" 126 produces< std::vector<ncid::NCKeras> > ();
127 produces< art::Assns<ncid::NCKeras, rb::Cluster> > ();
140 fTree = tfs->
make<TTree>(
"Testtree",
"Testtree");
191 bool isMCTruthListEmpty =
false;
195 if(mclist->empty()) { isMCTruthListEmpty =
true; }
197 catch(...) { isMCTruthListEmpty =
true; }
198 if(isMCTruthListEmpty){
206 std::unique_ptr< std::vector<ncid::NCKeras> >
207 ncCosKeras(
new std::vector<ncid::NCKeras>);
208 std::unique_ptr< art::Assns<ncid::NCKeras, rb::Cluster> >
214 std::vector<art::Ptr<rb::Cluster> > slices;
221 const int nslices = slices.size();
222 for(
int isli = 0; isli < nslices; ++isli){
224 std::vector<cheat::NeutrinoEffPur> SlicePurr = bt->
SliceToMCTruth(slices[isli]->AllCells(), slices[isli]->AllCells());
226 if(SlicePurr.size() == 0)
continue;
233 if(thisSlice->
IsNoise())
continue;
234 if(!prongAssn.isValid())
continue;
236 int intCurrent = nu.
CCNC();
241 std::vector< art::Ptr<rb::Prong> > prongs = prongAssn.at(isli);
242 if(prongs.empty())
continue;
247 if(!fmCVN.isValid())
continue;
248 std::vector< art::Ptr<cvn::Result> > cvns = fmCVN.at(isli);
250 if(!cvns.empty())
cosmicid = cvns[0]->fOutput[14];
262 if(!showerLidAssn.isValid())
continue;
264 std::vector<const slid::ShowerLID*> shwlids = showerLidAssn.at(isli);
265 if(shwlids.empty())
continue;
273 std::vector< art::Ptr<rb::Shower> > showers;
274 showers.push_back(shower);
276 if(!foShLID.isValid())
continue;
280 shwGap = showerLID->Gap();
283 shwcalE = showerLID->ShowerEnergy();
287 shwlen = shower->TotalLength();
311 std::vector<float>
v (myfloats, myfloats +
sizeof(myfloats) /
sizeof(
float));
318 ncCosKeras->push_back(nckeras);
323 evt.
put(std::move(sliceAssn));
324 evt.
put(std::move(ncCosKeras));
330 if(prongs.empty())
return 0.;
334 if(!prong->Is3D())
continue;
335 const double w = prong->CalorimetricEnergy();
336 ret += w*prong->Dir();
343 const double beamProj = ret.Dot(beamDir);
345 return (ret-beamProj*beamDir).Mag();
back track the reconstruction to the simulation
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
const simb::MCNeutrino & GetNeutrino() const
std::string fCosmicTrackLabel
std::string fMCTruthModuleLabel
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
void produce(art::Event &e) override
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
double ProngTransMom() const
Transverse component of the energy-weighted average of prong directions.
DEFINE_ART_MODULE(TestTMapFile)
std::vector< float > compute_output(keras::DataChunk *dc)
bool CompareByEnergy(const slid::ShowerLID *a, const slid::ShowerLID *b)
std::string fProngInstance
std::string fShowerLIDLabel
double TransMomFraction(const std::vector< art::Ptr< rb::Prong > > &prongs) const
Return transverse momentum fraction of the event. Calculation based on reconstructed prongs...
ProductID put(std::unique_ptr< PROD > &&product)
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
bool CompareByCalEnergy(const art::Ptr< rb::Prong > a, const art::Ptr< rb::Prong > b)
NCNNKeras(fhicl::ParameterSet const &p)
T get(std::string const &key) const
Vertex location in position and time.
keras::KerasModel * keras_5nn
TVector3 NuMIBeamDirection() const
Direction of neutrinos from the NuMI beam (unit vector)
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void reconfigure(const fhicl::ParameterSet &pset)
void SetProngTransMom(double input)
bool file_exists(std::string const &qualified_filename)
bool IsNoise() const
Is the noise flag set?
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void beginRun(art::Run &evt) override
Event generator information.
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)