ShowerEnergyFilterMC_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 // \file NeutronFluxFilter_module.cc
3 // \brief Module to filter events for neuton flux study.
4 // \author Fernanda Psihas - psihas@fnal.gov
5 ///////////////////////////////////////////////////////////////////////////
6 
7 // Framework includes
16 #include "fhiclcpp/ParameterSet.h"
20 
21 // C/C++ includes
22 #include <cmath>
23 #include <iostream>
24 #include <ostream>
25 #include <fstream>
26 #include <sstream>
27 #include <string>
28 #include <cstdlib>
29 #include <vector>
30 #include <memory>
31 
32 // NOvASoft includes
34 #include "Geometry/Geometry.h"
35 #include "GeometryObjects/Geo.h"
36 #include "MCCheater/BackTracker.h"
37 #include "RecoBase/Cluster.h"
38 #include "RecoBase/FilterList.h"
39 #include "RecoBase/RecoHit.h"
40 #include "Simulation/Particle.h"
42 #include "Utilities/func/MathUtil.h"
43 
44 // ROOT includes
45 #include "TDatabasePDG.h"
46 #include "TFile.h"
47 #include "TTree.h"
48 
49 
50 namespace showere
51 {
53  {
54  public:
55  explicit ShowerEnergyFilterMC(const fhicl::ParameterSet& pset);
57 
58  bool filter(art::Event & evt);
59 
60  void reconfigure(const fhicl::ParameterSet& pset);
61 
62  // virtual void CutOnOne(bool* passed);
63 
64  void beginJob();
65 
66  void endJob();
67 
68  protected:
69 
72  bool fSkipNuMu;
76  bool fDoBBCcut;
77 
78  double fMinEfrac;
79  double fMaxEfrac;
80  double fMinE;
81  double fMaxE;
82  int fValCCNC;
83  double fMinXFid;
84  double fMinYFid;
85  double fMinZ;
86  double fMaxZ;
87  double fMaxXFid;
88  double fMaxYFid;
89 
90  private:
91 
95  int InteractionCurrent; // 0 for CC, 1 for NC
96  int InteractionNuPDG; // Incoming nu PDG
97  int InteractionLepPDG; // Outgoing lepton PDG
98  int InteractionNhits; // CellHits in interaction slice
99  int InteractionNCalHits; // Calibrated RecoHits
100 
101  // Arrays for info from each CellHit in the int. slice
102 
103  int HitsNfls[1000]; // nFLS hits contributing to this CellHit
104  double HitsIsEve[1000]; // Fraction of Hit E deposited by primary
105  double HitsIsEve_e[1000]; // Fraction of Hit E deposited by primary e
106  double HitsIsEve_mu[1000]; // Fraction of Hit E deposited by primary mu
107  double HitsIsEve_tau[1000]; // Fraction of Hit E deposited by primary tau
108  double HitsIsEM[1000]; // Fraction of Hit E from EM deposition
109  double HitsEveIsEM[1000]; // Fraction of Hit E from particle with
110  // EM primary ancestor i.e. part of EM shower
111  double HitsIsMu[1000]; // Fraction of Hit E from a muon
112  double HitsEveIsMu[1000]; // Fraction of Hit E from particle with
113  // muon primary ancestor
114  double HitsADC[1000]; // CellHit ADC
115  double HitsPECorr[1000]; // RecoHit PECorr
116  double HitsTrueE[1000]; // Summed FLSHit energy
117  double HitsRecoE[1000]; // Calibrated RecoHit Energy
118 
119  };// class ShowerEnergyFilterMC
120  //......................................................................
122  {
123  }
124 
125  //......................................................................
127  {
128  produces< rb::FilterList<rb::Cluster> >();
129  reconfigure(pset);
130  }
131 
132  //......................................................................
134  {
135  fSlicerLabel = pset.get<std::string >("SlicerLabel");
136  fTrackLabel = pset.get<std::string >("TrackLabel");
137  fSkipNuMu = pset.get<bool >("SkipNuMu");
138  fDoEMfracCut = pset.get<bool >("DoEMfracCut");
139  fDoCurrentCut = pset.get<bool >("DoCurrentCut");
140  fDoEnergyCut = pset.get<bool >("DoEnergyCut");
141  fDoBBCcut = pset.get<bool >("DoBBCcut");
142 
143  // Further selection
144  fMinEfrac = pset.get<double >("MinEfrac");
145  fMaxEfrac = pset.get<double >("MaxEfrac");
146  fMinE = pset.get<double >("MinE");
147  fMaxE = pset.get<double >("MaxE");
148  fValCCNC = pset.get<int >("ValCCNC");
149  fMinXFid = pset.get< float >("MinXFid");
150  fMaxXFid = pset.get< float >("MaxXFid");
151  fMinYFid = pset.get< float >("MinYFid");
152  fMaxYFid = pset.get< float >("MaxYFid");
153  fMinZ = pset.get< float >("MinZ");
154  fMaxZ = pset.get< float >("MaxZ");
155  }
156 
157  //......................................................................
159  {
160  bool passedfilter = false;
161 
163 
165  const sim::ParticleNavigator& pnav = bt->ParticleNavigator();
166 
167  std::unique_ptr< rb::FilterList<rb::Cluster> > filtcol(new rb::FilterList<rb::Cluster>);
168 
169  // Get event slices
171  evt.getByLabel(fSlicerLabel, sliceHandle);
172  const unsigned int sliceMax = sliceHandle->size();
173 
174  // Loop over slices
175  for(unsigned int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
176  if(rb::IsFiltered(evt, sliceHandle, sliceIdx)) continue;
177  art::Ptr<rb::Cluster> slice(sliceHandle, sliceIdx);
178 
179  // Skip already filtered
180  if ( slice->IsNoise() ){
181  filtcol->Add(sliceHandle, sliceIdx);
182  continue;
183  }
184 
185  // Get nu info
186  std::vector<cheat::NeutrinoEffPur> SlicePurr = bt->SliceToMCTruth(slice->AllCells(),slice->AllCells());
187  if(SlicePurr.size()==0){
188  filtcol->Add(sliceHandle, sliceIdx);
189  continue;
190  }
191 
192  const art::Ptr<simb::MCTruth> &SliceTruth = SlicePurr[0].neutrinoInt;
193  if(!SliceTruth->NeutrinoSet()){
194  filtcol->Add(sliceHandle, sliceIdx);
195  continue;
196  }
197 
198  // get nu energy
199  const simb::MCNeutrino& nu = SliceTruth->GetNeutrino();
200  double E = nu.Nu().E();
201  int nuPDG = nu.Nu().PdgCode();
202  int lepPDG = nu.Lepton().PdgCode();
203  // int intType = nu.InteractionType();
204  int intCurrent = nu.CCNC();
205 
206  // Skip muons if option is provided
207  if ( fSkipNuMu && nuPDG != 12 && nuPDG != -12 ) return passedfilter;
208 
209  // E should be measurable. Substract outgoing nu energy (or outgoing muon energy)
210  if ( lepPDG == 12 || lepPDG == 14 || lepPDG == 16 || lepPDG == 13 || lepPDG == -13 )
211  E -= nu.Lepton().E();
212 
213  std::vector<int> hitsNfls;
214  std::vector<double> hitsIsEve;
215  std::vector<double> hitsIsEve_e;
216  std::vector<double> hitsIsEve_mu;
217  std::vector<double> hitsIsEve_tau;
218  std::vector<double> hitsIsEM;
219  std::vector<double> hitsEveIsEM;
220  std::vector<double> hitsIsMu;
221  std::vector<double> hitsEveIsMu;
222  std::vector<double> hitsADC;
223  std::vector<double> hitsPECorr;
224  std::vector<double> hitsTrueE;
225  std::vector<double> hitsRecoE;
226 
227  // Further slice selection
228  float xmin[2] = { 9999, 9999};
229  float ymin[2] = { 9999, 9999};
230  float zmin[2] = { 9999, 9999};
231  float xmax[2] = {-9999,-9999};
232  float ymax[2] = {-9999,-9999};
233  float zmax[2] = {-9999,-9999};
234 
235 
236  const int interactionNhits = slice->NCell();
237  //Loop over CellHits
238  for(int view = geo::kX; view <= geo::kY; ++view) {
239  const geo::View_t geoview = geo::View_t(view);
240  for(unsigned int j = 0; j < slice->NCell(geoview); ++j) {
241  const rb::CellHit* ch = slice->Cell(geoview,j).get();
242  art::Ptr< rb::CellHit > chptr = slice->Cell(geoview,j);
243 
244  rb::RecoHit rh = slice->RecoHit (chptr);
245  if ( ! rh.IsCalibrated() ) continue;
246 
247  float hitRecoE = rh.GeV();
248  float hitPECorr = rh.PECorr();
249  double hitADC = ch->ADC();
250 
251  const std::vector< sim::FLSHit > CellFLSs = bt->HitToFLSHit(chptr);
252  int nFLSs = CellFLSs.size();
253 
254  // Calculate total TrueE for this CellHit
255  // Calculate total TrueE for this CellHit
256  float hitTrueE = 0;
257  if ( nFLSs == 0 ) continue;
258  if ( nFLSs == 1 ) hitTrueE = CellFLSs[0].GetEdep();
259  if ( nFLSs > 1 ){
260  for ( int FlsIdx = 0; FlsIdx < nFLSs; ++FlsIdx)
261  hitTrueE += CellFLSs[FlsIdx].GetEdep();
262  }// fls
263 
264  // Now calculate %E from diferent components on this CellHit
265  double hitIsEve = 0; // fraction coming from Eve particles
266  double hitIsEve_e = 0; // fraction coming from Eve electron
267  double hitIsEve_mu = 0; // fraction coming from Eve muon
268  double hitIsEve_tau = 0; // fraction coming from Eve tau
269  double hitIsEM = 0; // fraction from EM 0 (Had) to 1 (EM)
270  double hitEveIsEM = 0; // fraction from EM shower
271  double hitIsMu = 0; // fraction from muon 0 (other) to 1 (Muon)
272  double hitEveIsMu = 0; // fraction from primary muon
273 
274  for ( int flsIdx = 0; flsIdx < nFLSs; ++flsIdx){
275  sim::FLSHit fls = CellFLSs[flsIdx];
276  int trkID = fls.GetTrackID();
277  const sim::Particle * fls_p = bt->TrackIDToParticle(trkID);
278  int EveID = pnav.EveId(trkID);
279  const sim::Particle * Eve_p = bt->TrackIDToParticle(EveID);
280 
281  double thisIsEve;
282  double thisIsEve_e;
283  double thisIsEve_mu;
284  double thisIsEve_tau;
285  double thisIsEM, thisEveIsEM;
286  double thisIsMu, thisEveIsMu;
287 
288  // Determine the source of this cell hit for the categories we care about
289  if ( trkID == EveID ) thisIsEve = 1;
290  else thisIsEve = 0;
291  if ( trkID == EveID && (Eve_p->PdgCode() == 11 || Eve_p->PdgCode() == -11) ) thisIsEve_e = 1;
292  else thisIsEve_e = 0;
293  if ( trkID == EveID && (Eve_p->PdgCode() == 13 || Eve_p->PdgCode() == -13) ) thisIsEve_mu = 1;
294  else thisIsEve_mu = 0;
295  if ( trkID == EveID && (Eve_p->PdgCode() == 15 || Eve_p->PdgCode() == -15) ) thisIsEve_tau = 1;
296  else thisIsEve_tau = 0;
297 
298  if ( Eve_p->PdgCode() == 11 || Eve_p->PdgCode() == -11 ||
299  Eve_p->PdgCode() == 22 || Eve_p->PdgCode() == 111 ) thisEveIsEM = 1;
300  else thisEveIsEM = 0;
301  if ( fls_p->PdgCode() == 11 || fls_p->PdgCode() == -11 ||
302  fls_p->PdgCode() == 22 || fls_p->PdgCode() == 111 ) thisIsEM = 1;
303  else thisIsEM = 0;
304 
305  if ( Eve_p->PdgCode() == 13 || Eve_p->PdgCode() == -13 ) thisEveIsMu = 1;
306  else thisEveIsMu = 0;
307  if ( fls_p->PdgCode() == 13 || fls_p->PdgCode() == -13 ) thisIsMu = 1;
308  else thisIsMu = 0;
309 
310 
311  float thisflsE = fls.GetEdep();
312  // Add % of FLSHits Edep in CellHit coming from each source
313  hitIsEve += (thisflsE/hitTrueE)*thisIsEve;
314  hitIsEve_e += (thisflsE/hitTrueE)*thisIsEve_e;
315  hitIsEve_mu += (thisflsE/hitTrueE)*thisIsEve_mu;
316  hitIsEve_tau += (thisflsE/hitTrueE)*thisIsEve_tau;
317  hitIsEM += (thisflsE/hitTrueE)*thisIsEM;
318  hitEveIsEM += (thisflsE/hitTrueE)*thisEveIsEM;
319  hitIsMu += (thisflsE/hitTrueE)*thisIsMu;
320  hitEveIsMu += (thisflsE/hitTrueE)*thisEveIsMu;
321 
322  }// fls
323 
324  hitsADC.push_back(hitADC);
325  hitsPECorr.push_back((double)hitPECorr);
326  hitsNfls.push_back(nFLSs);
327  hitsTrueE.push_back(hitTrueE);
328  hitsRecoE.push_back((double)hitRecoE);
329  hitsIsEve.push_back(hitIsEve);
330  hitsIsEve_e.push_back(hitIsEve_e);
331  hitsIsEve_mu.push_back(hitIsEve_mu);
332  hitsIsEve_tau.push_back(hitIsEve_tau);
333  hitsIsEM.push_back(hitIsEM);
334  hitsEveIsEM.push_back(hitEveIsEM);
335  hitsIsMu.push_back(hitIsMu);
336  hitsEveIsMu.push_back(hitEveIsMu);
337 
338  // Get Hit position
339  double xyz[3];
340  geom->Plane(ch->Plane())->Cell(ch->Cell())->GetCenter(xyz);
341  const double x = xyz[0];
342  const double y = xyz[1];
343  const double z = xyz[2];
344 
345  if ( ch->View()==geo::kX ){
346  if ( x < xmin[0] ) { xmin[1] = xmin[0]; xmin[0] = x;}
347  else if ( x < xmin[1] ) xmin[1] = x;
348  if ( z < zmin[0] ) { zmin[1] = zmin[0]; zmin[0] = z;}
349  else if ( z < zmin[1] ) zmin[1] = z;
350  if ( x > xmax[0] ) { xmax[1] = xmax[0]; xmax[0] = x;}
351  else if ( x > xmax[1] ) xmax[1] = x;
352  if ( z > zmax[0] ) { zmax[1] = zmax[0]; zmax[0] = z;}
353  else if ( z > zmax[1] ) zmax[1] = zmax[0];
354  }
355  if ( ch->View()==geo::kY ){
356  if ( y < ymin[0] ) { ymin[1] = ymin[0]; ymin[0] = y;}
357  else if ( y < ymin[1] ) ymin[1] = y;
358  if ( z < zmin[0] ) { zmin[1] = zmin[0]; zmin[0] = z;}
359  else if ( z < zmin[1] ) zmin[1] = z;
360  if ( y > ymax[0] ) { ymax[1] = ymax[0]; ymax[0] = y;}
361  else if ( y > ymax[1] ) ymax[1] = y;
362  if ( z > zmax[0] ) { zmax[1] = zmax[0]; zmax[0] = z;}
363  else if ( z > zmax[1] ) zmax[1] = zmax[0];
364  }
365 
366  }// cellhit
367  }//views
368  InteractionNCalHits = hitsADC.size();
369 
370  // ------------- Get Interaction info -------------
371  InteractionNhits = (int)interactionNhits;
373  InteractionCurrent = intCurrent;
374  InteractionNuPDG = nuPDG;
375  InteractionLepPDG = lepPDG;
376 
377  double TotalRecoE =0;
378  double TotalRecoE_EM =0;
379 
380  for(int h = 0; h < InteractionNCalHits; ++h){
381  HitsNfls[h] = hitsNfls[h];
382  HitsIsEve[h] = hitsIsEve[h];
383  HitsIsEve_e[h] = hitsIsEve_e[h];
384  HitsIsEve_mu[h] = hitsIsEve_mu[h];
385  HitsIsEve_tau[h] = hitsIsEve_tau[h];
386  HitsIsEM[h] = hitsIsEM[h];
387  HitsEveIsEM[h] = hitsEveIsEM[h];
388  HitsIsMu[h] = hitsIsMu[h];
389  HitsEveIsMu[h] = hitsEveIsMu[h];
390  HitsADC[h] = hitsADC[h];
391  HitsPECorr[h] = hitsPECorr[h];
392  HitsTrueE[h] = hitsTrueE[h];
393  HitsRecoE[h] = hitsRecoE[h];
394 
395  double EveMuness = HitsIsEve_mu[h];
396  // double Muness = HitsIsMu[h];
397  double EMness = HitsIsEM[h];
398  // double HADness = 1.0 - (EMness + EveMuness);
399 
400  TotalRecoE += (1.0 -EveMuness)*(HitsRecoE[h]);
401  TotalRecoE_EM += EMness *(HitsRecoE[h]);
402  }
403  double InteractionHitRecoE = TotalRecoE;
404  // Ratio of EM fraction/Total hits Reco E
405  double R_emRE_HitsRE = TotalRecoE_EM/InteractionHitRecoE;
406 
407 
408  // -------------------- Do All Cuts -----------------------
409 
410  bool selected = true;
411 
412  if ( fDoEMfracCut ){
413  if ( R_emRE_HitsRE < fMinEfrac || R_emRE_HitsRE > fMaxEfrac ) selected = false;
414  }
415  if ( fDoCurrentCut ){
416  if ( InteractionCurrent != fValCCNC ) selected = false;
417  }
418  if ( fDoEnergyCut ){
419  if ( InteractionTrueE > fMaxE || InteractionTrueE < fMinE ) selected = false;
420  }
421  if ( fDoBBCcut ){
422  // Allow 0 hits outside containment
423  if (xmin[0] < fMinXFid || ymin[0] < fMinYFid || zmin[0] < fMinZ ||
424  xmax[0] > fMaxXFid || ymax[0] > fMaxYFid || zmax[0] > fMaxZ )
425  selected = false;
426  }
427 
428  // ------------------ Filter if not selected --------------
429  if(selected == true){
430  std::cout << "Event: " << evt.id().event() << ", slice: "<<sliceIdx<<"\n";
431  fInteractionTree->Fill();
432  passedfilter = selected;
433  }
434 
435  if(selected == false){
436  filtcol->Add(sliceHandle, sliceIdx);
437  }
438 
439  }//slices
440 
441  evt.put(std::move(filtcol));
442 
443  return passedfilter;
444  } // end filter
445 
446  //......................................................................
448  {
450 
451  fInteractionTree = tfs->make<TTree>("InteractionTree","InteractionTree");
452  fInteractionTree->Branch("InteractionNuPDG",&InteractionNuPDG,"InteractionNuPDG/I");
453  fInteractionTree->Branch("InteractionLepPDG",&InteractionLepPDG,"InteractionLepPDG/I");
454  fInteractionTree->Branch("InteractionCurrent",&InteractionCurrent,"InteractionCurrent/I");
455  fInteractionTree->Branch("InteractionNhits",&InteractionNhits,"InteractionNhits/I");
456  fInteractionTree->Branch("InteractionNCalHits",&InteractionNCalHits,"InteractionNCalHits/I");
457  fInteractionTree->Branch("InteractionTrueE",&InteractionTrueE,"InteractionTrueE/D");
458  fInteractionTree->Branch("InteractionRecoE",&InteractionRecoE,"InteractionRecoE/D");
459  // Vector Branches
460  fInteractionTree->Branch("HitsNfls",&HitsNfls,"HitsNfls[InteractionNCalHits]/I");
461  fInteractionTree->Branch("HitsIsEM",&HitsIsEM,"HitsIsEM[InteractionNCalHits]/D");
462  fInteractionTree->Branch("HitsEveIsEM",&HitsEveIsEM,"HitsEveIsEM[InteractionNCalHits]/D");
463  fInteractionTree->Branch("HitsIsMu",&HitsIsMu,"HitsIsMu[InteractionNCalHits]/D");
464  fInteractionTree->Branch("HitsEveIsMu",&HitsEveIsMu,"HitsEveIsMu[InteractionNCalHits]/D");
465  fInteractionTree->Branch("HitsADC",&HitsADC,"HitsADC[InteractionNCalHits]/D");
466  fInteractionTree->Branch("HitsPECorr",&HitsPECorr,"HitsPECorr[InteractionNCalHits]/D");
467  fInteractionTree->Branch("HitsTrueE",&HitsTrueE,"HitsTrueE[InteractionNCalHits]/D");
468  fInteractionTree->Branch("HitsRecoE",&HitsRecoE,"HitsRecoE[InteractionNCalHits]/D");
469  fInteractionTree->Branch("HitsIsEve",&HitsIsEve,"HitsIsEve[InteractionNCalHits]/D");
470  fInteractionTree->Branch("HitsIsEve_e",&HitsIsEve_e,"HitsIsEve_e[InteractionNCalHits]/D");
471  fInteractionTree->Branch("HitsIsEve_mu",&HitsIsEve_mu,"HitsIsEve_mu[InteractionNCalHits]/D");
472  fInteractionTree->Branch("HitsIsEve_tau",&HitsIsEve_tau,"HitsIsEve_tau[InteractionNCalHits]/D");
473 
474  } // end beginJob
475 
476  //......................................................................
478  {
479  // Implementation of optional member function here.
480  } //end endJob
481 
482 
483 } // end namespace showere
double E(const int i=0) const
Definition: MCParticle.h:232
A simple list of products that have been marked "filtered out".
Definition: FilterList.h:74
back track the reconstruction to the simulation
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:76
std::map< std::string, double > xmax
TH2 * rh
Definition: drawXsec.C:5
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
Vertical planes which measure X.
Definition: PlaneGeo.h:28
ShowerEnergyFilterMC(const fhicl::ParameterSet &pset)
A single unit of energy deposition in the liquid scintillator.
Definition: FLSHit.h:19
const PlaneGeo * Plane(unsigned int i) const
DEFINE_ART_MODULE(TestTMapFile)
void Add(simb::MCParticle &part)
Definition: MCTruth.h:79
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
Double_t ymax
Definition: plot.C:25
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
unsigned short Cell() const
Definition: CellHit.h:40
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
Float_t E
Definition: plot.C:20
std::vector< sim::FLSHit > HitToFLSHit(const rb::CellHit &hit) const
All the FLSHits that contributed to this hit, sorted from most to least light.
T get(std::string const &key) const
Definition: ParameterSet.h:231
rb::RecoHit RecoHit(const art::Ptr< rb::CellHit > &chit) const
Return calibrated hit based on assumed W coordinate.
Definition: Cluster.cxx:259
Collect Geo headers and supply basic geometry functions.
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
const double j
Definition: BetheBloch.cxx:29
z
Definition: test.py:28
const sim::Particle * TrackIDToParticle(int const &id) const
Returns a pointer to the sim::Particle object corresponding to the given TrackID. ...
OStream cout
Definition: OStream.cxx:6
EventNumber_t event() const
Definition: EventID.h:116
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
T * make(ARGS...args) const
float GeV() const
Definition: RecoHit.cxx:69
int GetTrackID() const
Track ID.
Definition: FLSHit.h:45
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
T const * get() const
Definition: Ptr.h:321
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void geom(int which=0)
Definition: geom.C:163
Double_t ymin
Definition: plot.C:24
bool NeutrinoSet() const
Definition: MCTruth.h:77
float GetEdep() const
Get total Energy deposited into the cell for the whole FLSHit.
Definition: FLSHit.h:31
float PECorr() const
Definition: RecoHit.cxx:47
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
Event generator information.
Definition: MCNeutrino.h:18
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.
EventID id() const
Definition: Event.h:56
void reconfigure(const fhicl::ParameterSet &pset)
Encapsulate the geometry of one entire detector (near, far, ndos)
int EveId(const int trackID) const