23 #include "cetlib_except/exception.h" 31 #include "TMVA/Reader.h" 48 #include "Utilities/AssociationUtil.h" 110 produces< std::vector<ncid::NCCosRej> > ();
111 produces< art::Assns<ncid::NCCosRej, rb::Cluster> > ();
194 std::unique_ptr< std::vector<ncid::NCCosRej> >
195 ncCosRejjies(
new std::vector< ncid::NCCosRej >);
196 std::unique_ptr< art::Assns<ncid::NCCosRej, rb::Cluster> >
202 std::vector< art::Ptr<rb::Cluster> > slices;
210 for(
unsigned int m = 0;
m < htHandle->size(); ++
m){
218 const int nslices = slices.size();
219 for(
int isli = 0; isli < nslices; ++isli){
223 if(thisSlice->
IsNoise())
continue;
224 if(!prongAssn.isValid())
continue;
227 std::vector< art::Ptr<rb::Prong> > prongs = prongAssn.at(isli);
229 if(prongs.empty())
continue;
232 std::vector< art::Ptr<cosrej::NueCosRej> > cosrejs = fmcr.at(isli);
234 if(cosrejs.empty())
continue;
239 if(!fmCVN.isValid())
continue;
241 std::vector< art::Ptr<cvn::Result> > cvns = fmCVN.at(isli);
244 if(!cvns.empty()) cosmicid = cvns[0]->fOutput[14];
251 float shwwwidth = -5.;
258 if(!showerLidAssn.isValid())
continue;
260 std::vector<const slid::ShowerLID*> shwlids = showerLidAssn.at(isli);
261 if(shwlids.empty())
continue;
265 float nshwlid = shwlids.size();
267 if(!foSh.isValid())
continue;
271 std::vector< art::Ptr<rb::Shower> > showers;
272 showers.push_back(shower);
275 if(!foShLID.isValid())
continue;
281 for(
size_t hitIdx = 0; hitIdx < slices[isli]->NCell(); ++hitIdx){
285 if((rhit.
PECorr() > 100.0) && (rhit.
PECorr() < 245.0)) nMipHit++;
288 shwGap = showerLID->Gap();
289 shwnhit = shower->NCell();
290 shwwwidth = showerLID->Radius();
291 shwcalE = showerLID->ShowerEnergy();
292 shwnhitx = shower->NXCell();
293 shwdirY = (
float)shower->Dir().Y();
294 shwnhity = shower->NYCell();
295 shwlen = shower->TotalLength();
296 partptp = cosrejs[0]->ParticleShowerTransMom();
320 ncCosRejjies->push_back(nccosrej);
324 evt.
put(std::move(sliceAssn));
325 evt.
put(std::move(ncCosRejjies));
331 if(prongs.empty())
return 0;
335 if(!prong->Is3D())
continue;
336 const double w = prong->CalorimetricEnergy();
337 ret += w*prong->Dir();
344 const double beamProj = ret.Dot(beamDir);
346 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.
MakeNCCosRej(fhicl::ParameterSet const &p)
std::string fCellHitLabel
void beginRun(art::Run &evt) override
std::string fProngInstance
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
::xsd::cxx::tree::exception< char > exception
void reconfigure(const fhicl::ParameterSet &p)
void SetProngTransMom(double input)
DEFINE_ART_MODULE(TestTMapFile)
std::string fCosmicTrackLabel
bool CompareByEnergy(const slid::ShowerLID *a, const slid::ShowerLID *b)
void produce(art::Event &e) override
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
ProductID put(std::unique_ptr< PROD > &&product)
unsigned short Cell() const
double TransMomFraction(const std::vector< art::Ptr< rb::Prong > > &prongs) const
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
void push_back(Ptr< U > const &p)
TMVA::Reader * fReaderGBDT
bool CompareByCalEnergy(const art::Ptr< rb::Prong > a, const art::Ptr< rb::Prong > b)
T get(std::string const &key) const
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
void SetCosPIDDTG(double input)
std::string fNCCosRejPIDGFile
TVector3 NuMIBeamDirection() const
Direction of neutrinos from the NuMI beam (unit vector)
Calculate dE/dx and log likelihoods for different particle hypotheses. This information will be of us...
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void SetCosPIDDT(double input)
std::string fShowerLIDLabel
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)
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
std::string fNCCosRejPIDFile
Encapsulate the geometry of one entire detector (near, far, ndos)