7 #include "NovaDAQConventions/DAQConventions.h" 15 #include "Utilities/func/MathUtil.h" 52 "x",
"y",
"z",
"edge",
"is_inside_fiducial_volume",
54 "nslice",
"slicenxhit",
"slicenyhit",
"vertex_in_fiducial",
"nFLShit"};
101 const std::pair<int, std::string>&
b)
103 return a.second.size() < b.second.size();
118 if(expr ==
"") expr =
"1";
122 std::vector<std::pair<int, std::string> > sortedPars;
130 expr.ReplaceAll(sortedPars[
n].
second,
135 fFormula =
new TFormula(
"form", expr);
167 vars[
kNEvts] = mcTruths->size();
169 if(mcTruths->empty())
return;
181 vars[
kEnu] = nupart.
E();
184 const double x = lept.
Vx();
185 const double y = lept.
Vy();
186 const double z = lept.
Vz();
187 vars[
kX] =
x; vars[
kY] =
y; vars[
kZ] =
z;
194 vars[
kEdge] = (dx < 0.0 || dy <0.0 || dz<0.0) ? -kEdge_mod : kEdge_mod;
209 const unsigned int nhit = digitcol->size();
210 for(
unsigned int i = 0;
i <
nhit; ++
i){
228 const unsigned int nhit = FLScol->size();
239 const unsigned int sliceMax = slices->size();
243 unsigned int most = 0;
244 for(
unsigned int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
247 if(slice.
NCell() > most){
248 most = slice.
NCell();
262 unsigned int trkMax = trk->size();
264 for(
unsigned int trkIdx = 0; trkIdx < trkMax; ++trkIdx){
267 const TVector3
dir(track.
Dir());
269 if(coscosmic < 0.7)
return;
280 const TVector3 v1 = trk.
Start();
281 const TVector3 v2 = trk.
Stop();
283 const TVector3
start = (v1.Y() > v2.Y()) ? v1 : v2;
286 const double x = start.X();
287 const double y = start.Y();
288 const double z = start.Z();
293 switch(geom->
DetId()){
296 if(
fabs(x) > 115)
return false;
297 if(
fabs(y) > 150)
return false;
298 if(z < 50 || z > 770)
return false;
300 if(v1.X()==v2.X()||v1.Y()==v2.Y())
return false;
303 if(
fabs(x) > 730 ||
fabs(y) > 730)
return false;
304 if(z < 50 || z > 6300)
return false;
306 if(v1.X()==v2.X()||v1.Y()==v2.Y())
return false;
309 assert(0 &&
"Unknown detector");
void FillTrackVariables(const art::Event &evt, double *vars) const
double E(const int i=0) const
Filter events based on simple expressions.
back track the reconstruction to the simulation
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
const simb::MCNeutrino & GetNeutrino() const
Is event inside fiducial volume? (fiducial volume is defined in Geometry.fcl)
fvar< T > fabs(const fvar< T > &x)
void reconfigure(const fhicl::ParameterSet &pset)
Number of true neutrino interactions.
True neutrino energy (GeV)
Total number of hits in the event.
const simb::MCParticle & Nu() const
Filter(const fhicl::ParameterSet &pset)
A collection of associated CellHits.
Total number of slices in the event (including noise slice)
std::string fSlicerLabel
Default "slicer".
A rb::Prong with full reconstructed trajectory.
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
Distance to detector edge (cm)
Module that kips a configurable number of events between each that it allows through. Note that this module really skips (N-1) events, it uses a simple modular division as its critera. This module will cut down the data sample to 1/N of its original size.
bool filter(art::Event &evt)
void FillSliceVariables(const art::Event &evt, double *vars) const
Track finder for cosmic rays.
std::string fTrackLabel
Default "kalmantrack".
int InteractionType() const
std::string fGenLabel
Default "generator".
Far Detector at Ash River, MN.
const simb::MCParticle & Lepton() const
void FillDigitVariables(const art::Event &evt, double *vars) const
bool compareBySecondLength(const std::pair< int, std::string > &a, const std::pair< int, std::string > &b)
std::string fG4GenLabel
Default "geantgen".
Prototype Near Detector on the surface at FNAL.
std::string fCellHitLabel
Default "daq".
T get(std::string const &key) const
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
virtual TVector3 Dir() const
Unit vector describing prong direction.
Number of hits in X view of the biggest physics slice.
Near Detector in the NuMI cavern.
const TString kParNames[kNumPars]
True vertex y position (cm)
double DetHalfHeight() const
void FillG4GenVariables(const art::Event &evt, double *vars) const
Value of Nu().InteractionType()
unsigned int NYCell() const
Number of cells in the y-view.
double Vx(const int i=0) const
True vertex x position (cm)
double DetHalfWidth() const
int16_t ADC(uint32_t i) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
double pythag(double x, double y)
2D Euclidean distance
unsigned int NXCell() const
Number of cells in the x-view.
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
double Vz(const int i=0) const
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
void FillTruthVariables(const art::Event &evt, double *vars) const
Event generator information.
T min(const caf::Proxy< T > &a, T b)
bool IsNoise() const
Is the noise flag set?
TVector3 Stop() const
Position of the final trajectory point.
True vertex z position (cm)
bool isVertexInFiducial(const rb::Track &trk) const
Event generator information.
double Vy(const int i=0) const
PDG code of the neutrino.
Encapsulate the geometry of one entire detector (near, far, ndos)
bool isInsideFiducialVolume(const double x_cm, const double y_cm, const double z_cm) const
Is the particle inside the detector Fiducial Volume?
Is track vertex (start position) inside the fiducial volume defined in filter.
Number of hits in X view of the biggest physics slice.