EvaluatorNue.cxx
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////
2 // Class: EvaluatorNue
3 // File: EvaluatorNue.cxx
4 ////////////////////////////////////////////////////////////////////////
5 #include <algorithm>
6 
8 
18 
21 
22 
23 //------------------------------------------------------------------------------
25 {
26  return s1->ShowerEnergy() > s2->ShowerEnergy();
27 }
28 
29 //------------------------------------------------------------------------------
31 {
32  return p1->TotalLength() > p2->TotalLength();
33 }
34 
35 //------------------------------------------------------------------------------
37 {
38  this->reconfigure(p);
39 
40  // Selection Type added to Histogram Names to avoid memory leaks since root desn't like two named objects with the same name.
41  auto selPSet = p.get<fhicl::ParameterSet>("Selection");
42  std::string selType = selPSet.get<std::string>("SelectionType", "NueSA");
43 
44  // make histograms for each selection criteria
46 
47  // first the FD histograms
48  fFDSliceNHitsPerPlane = tfs->make<TH1F>((selType+"_fdSliceHitsPerPlane").c_str(), ";Slice Hits/Plane;Slices", 100, 0., 50.);
49  fFDShowerHitsXView = tfs->make<TH1F>((selType+"_fdShowerHitsXView").c_str(), ";Shower Hits (X view);Showers", 100, 0., 100.);
50  fFDShowerHitsYView = tfs->make<TH1F>((selType+"_fdShowerHitsYView").c_str(), ";Shower Hits (Y view);Showers", 100, 0., 100.);
51  fFDShowerHitsViewAsym = tfs->make<TH1F>((selType+"_fdShowerHitsViewAsym").c_str(), ";Shower Hits View Asymmetry;Showers", 200, -10., 10.);
52  fFDSliceCosAngleShw = tfs->make<TH1F>((selType+"_fdSliceCosAngleShw").c_str(), ";cos(#theta_{showers});Slices", 100, -1., 1.);
53  fFDSliceDistShwVtx = tfs->make<TH1F>((selType+"_fdSliceDistShwVtx").c_str(), ";#DeltaL_{shower,vertex};Slices", 100, 0., 400.);
54  fFDSliceFracShwHits = tfs->make<TH1F>((selType+"_fdSliceFracShwHits").c_str(), ";Hits_{shower}/Hits_{slice};Slices", 50, 0., 2.);
55  fFDVtxDistToEastWall = tfs->make<TH1F>((selType+"_fdVtxDistToEastWall").c_str(), ";Distance to East Wall;Showers", 100, 0., 100.);
56  fFDVtxDistToWestWall = tfs->make<TH1F>((selType+"_fdVtxDistToWestWall").c_str(), ";Distance to West Wall;Showers", 100, 0., 100.);
57  fFDVtxDistToTop = tfs->make<TH1F>((selType+"_fdVtxDistToTop").c_str(), ";Distance to Top;Showers", 100, 0., 400.);
58  fFDVtxDistToBottom = tfs->make<TH1F>((selType+"_fdVtxDistToBottom").c_str(), ";Distance to Bottom;Showers", 100, 0., 400.);
59  fFDVtxDistToFront = tfs->make<TH1F>((selType+"_fdVtxDistToFront").c_str(), ";Distance to Front;Showers", 100, 0., 100.);
60  fFDVtxDistToBack = tfs->make<TH1F>((selType+"_fdVtxDistToBack").c_str(), ";Distance to Back;Showers", 100, 0., 400.);
61  fFDPt = tfs->make<TH1F>((selType+"_fdPt").c_str(), ";p_{t};Showers", 50, 0., 2.);
62 
63  // now the ND histograms
64  fNDlem = tfs->make<TH1F>((selType+"_ndlem").c_str(), ";LEM;Slices", 100, 0., 1.);
65  fNDcvn = tfs->make<TH1F>((selType+"_ndcvn").c_str(), ";CVN;Slices", 100, 0., 1.);
66  fNDlid = tfs->make<TH1F>((selType+"_ndlid").c_str(), ";LID;Slices", 240, -0.1, 1.1);
67  fNDNShowers = tfs->make<TH1F>((selType+"_ndNshowers").c_str(), ";Nnumber of Showers;Slices", 10, 0., 10.);
68  fNDShowerCalE = tfs->make<TH1F>((selType+"_ndshowercale").c_str(), ";Shower E_{calorimetric};Slices", 120, 0., 6.);
69  fNDShowerCalEfraction = tfs->make<TH1F>((selType+"_ndshowercalefrac").c_str(), ";Fraction of Slice E in Shower;Slices", 110, 0., 1.1);
70  fNDSliceNoShowerCalE = tfs->make<TH1F>((selType+"_ndnoshowercale").c_str(), ";(Slice -Shower) E_{calorimetric};Slices",120, 0., 6.);
71  fNDShowerDistToVtx = tfs->make<TH1F>((selType+"_ndNshowergap").c_str(), ";Shower Distance to Vertex;Slices", 25, 0., 200.);
72  fNDVtxX = tfs->make<TH1F>((selType+"_ndVtxX").c_str(), ";x_{vertex} (cm);Showers", 200, -200., 200.);
73  fNDVtxY = tfs->make<TH1F>((selType+"_ndVtxY").c_str(), ";y_{vertex} (cm);Showers", 200, -200., 200.);
74  fNDVtxZ = tfs->make<TH1F>((selType+"_ndVtxZ").c_str(), ";z_{vertex} (cm);Showers", 700, 0., 1400.);
75  fNDShwVtxX = tfs->make<TH1F>((selType+"_ndShwVtxX").c_str(), ";x_{vertex} (cm);Showers", 200, -200., 200.);
76  fNDShwVtxY = tfs->make<TH1F>((selType+"_ndShwVtxY").c_str(), ";y_{vertex} (cm);Showers", 200, -200., 200.);
77  fNDShwVtxZ = tfs->make<TH1F>((selType+"_ndShwVtxZ").c_str(), ";z_{vertex} (cm);Showers", 700, 0., 1400.);
78  fNDShwEndX = tfs->make<TH1F>((selType+"_ndShwEndX").c_str(), ";x_{vertex} (cm);Showers", 200, -200., 200.);
79  fNDShwEndY = tfs->make<TH1F>((selType+"_ndShwEndY").c_str(), ";y_{vertex} (cm);Showers", 200, -200., 200.);
80  fNDShwEndZ = tfs->make<TH1F>((selType+"_ndShwEndZ").c_str(), ";z_{vertex} (cm);Showers", 700, 0., 1400.);
81  fNDSliceHits = tfs->make<TH1F>((selType+"_ndSliceHits").c_str(), ";Hits in Slice;Slices", 500, 0., 500.);
82  fNDCalorimetricE = tfs->make<TH1F>((selType+"_ndCalorimetricE").c_str(), ";E_{calorimetric} (GeV);Showers", 120, 0., 6.);
83  fNDCalEperHit = tfs->make<TH1F>((selType+"_ndCalEperHit").c_str(), ";E_{calorimetric}/ hit ;Slices", 100, 0., 0.1);
84  fNDProngLength = tfs->make<TH1F>((selType+"_ndProngLength").c_str(), ";L_{shower} (cm);Showers", 700, 0., 1400.);
85  fNDSliceNHitsPerPlane = tfs->make<TH1F>((selType+"_ndSliceHitsPerPlane").c_str(), ";Slice Hits/Plane;Slices", 100, 0., 50.);
86  fNDPlanesToFront = tfs->make<TH1F>((selType+"_ndPlanesToFront").c_str(), ";Planes to Front;Events", 600, 0., 600.);
87 
88  return;
89 }
90 
91 //------------------------------------------------------------------------------
93 {
94  fSliceLabel = p.get<std::string>("SliceLabel", "slicer" );
95  fVertexLabel = p.get<std::string>("VertexLabel", "elasticarmshs");
96  fShowerLabel = p.get<std::string>("ShowerLabel", "recluster" );
97  fLIDLabel = p.get<std::string>("LIDLabel", "slid" );
98  fCVNLabel = p.get<std::string>("CVNLabel", "cvneval" );
99  fCosRejLabel = p.get<std::string>("CosRejLabel", "nuecosrej" );
100  fNueVetoLabel = p.get<std::string>("NueVetoLabel", "veto" );
101  //Set default value to empty string because in 2017 Trees lem info is not available.
102  //Only set it int the fcl file if it is needed and available.
103  // fLEMLabel is used to check whether to look for lem values or not
104  // fLEMLabel = p.get<std::string>("LEMLabel", "lem" );
105  fLEMLabel = p.get<std::string>("LEMLabel", "" );
106 
107 
108  auto prongTag = p.get<std::string>("ProngTag", "fuzzykvertex:Prong3D");
109  auto pos = prongTag.find(":");
110  fProngTag = art::InputTag(prongTag.substr(0, pos),
111  prongTag.substr(pos+1, prongTag.size()));
112 
113  auto selPSet = p.get<fhicl::ParameterSet>("Selection");
114 
115  auto selType = selPSet.get<std::string>("SelectionType", "NueSA");
116  if(selType.compare("NueSA") == 0) fSel = std::make_unique<skim::SelectionNueSA >();
117  else if(selType.compare("Nue2017Peripheral") == 0) fSel = std::make_unique<skim::SelectionNue2017Peripheral>();
118  else if(selType.compare("Nue2017") == 0) fSel = std::make_unique<skim::SelectionNue2017>();
119  else if(selType.compare("Nue2018PeripheralFHC") == 0) fSel = std::make_unique<skim::SelectionNue2018PeripheralFHC>();
120  else if(selType.compare("Nue2018PeripheralRHC") == 0) fSel = std::make_unique<skim::SelectionNue2018PeripheralRHC>();
121  else if(selType.compare("Nue2018FHC") == 0) fSel = std::make_unique<skim::SelectionNue2018FHC>();
122  else if(selType.compare("Nue2018RHC") == 0) fSel = std::make_unique<skim::SelectionNue2018RHC>();
123  else
124  throw cet::exception("EvaluatorNue")
125  << "Requested unknown selection type: "
126  << selType;
127 
128  fSel->reconfigure(selPSet);
129 
130  return;
131 }
132 
133 //------------------------------------------------------------------------------
135  art::Event const& e)
136 {
137  fSlicePtrs .clear();
138  fKeptSlices .clear();
139  fShowers .clear();
140  fProngs .clear();
141  fSLIDs .clear();
142  fVertices .clear();
143  fCosRejs .clear();
144  fLEMs .clear();
145  fELIDs .clear();
146  fCVNs .clear();
147  fNueVetos .clear();
148 
149  fIsData = e.isRealData();
150  fDetId = detId;
151  fCurrentRun = e.run();
152  fCurrentSubRun = e.subRun();
153  fCurrentEvent = e.event();
154 
155  // fill the vectors of vector<art::Ptr<>> for the reco objects related
156  // to each slice in the spill
157  // get the slices out of the event
159  e.getByLabel(fSliceLabel, slices);
160 
161  if( slices.failedToGet() ){
162  LOG_WARNING("EvaluatorNue") << "No slices in this event";
163  return false;
164  }
165 
166 
167  LOG_DEBUG("EvaluatorNue")
168  << "there are "
169  << slices->size()
170  << " slices in this event "
171  << e.id().event();
172 
173 
174  // get the FindMany for the slices to shower & vertex associations.
175  art::FindMany<slid::ShowerLID> fmslid (slices, e, fLIDLabel );
176  art::FindMany<rb::Vertex> fmv (slices, e, fVertexLabel );
177  art::FindMany<rb::Prong> fmp (slices, e, fProngTag );
179  art::FindMany<slid::EventLID> fmlid (slices, e, fLIDLabel );
180  art::FindMany<lem::PIDDetails> fmlem (slices, e, fLEMLabel );
181  art::FindMany<cvn::Result> fmcvn (slices, e, fCVNLabel );
182  art::FindMany<presel::Veto> fmnueveto(slices, e, fNueVetoLabel);
183 
185 
186  for(size_t s = 0; s < slices->size(); ++s){
187 
188  fSlicePtrs.emplace_back(slices, s);
189 
190  su.FillSliceMap(s, fmv, fVertices);
191  su.FillSliceMap(s, fmp, fProngs);
192  su.FillSliceMap(s, fmc, fCosRejs);
193  su.FillSliceMap(s, fmslid, fSLIDs);
194  if(fLEMLabel != "") su.FillSliceMap(s, fmlem, fLEMs);
195  su.FillSliceMap(s, fmlid, fELIDs);
196  su.FillSliceMap(s, fmcvn, fCVNs);
197  su.FillSliceMap(s, fmnueveto, fNueVetos);
198 
199  // sort the showerLIDs vector in order of decreasing energy
200  // sorting now ensures that the showers and slids are in the
201  // proper order for later use
202  std::sort(fSLIDs[s].begin(), fSLIDs[s].end(), showerByEnergyNue);
203 
204  // now get the shower associated with each ShowerLID
206 
207  // sort the prongs by decreasing length
208  std::sort(fProngs[s].begin(), fProngs[s].end(), prongByLengthNue);
209 
210  } // end the loop over the slices
211 
212  return true;
213 }
214 
215 //------------------------------------------------------------------------------
217 {
218  // fKeptSlicePtrs was cleared in the initialize call
219  // only non-noise slices were put into fSlicePtrs in the initialize call
220  for(size_t s = 0; s < fSlicePtrs.size(); ++s){
221  LOG_DEBUG("EvaluatorNue")
222  << "on slice " << s;
223  if(this->KeepSlice(s) &&
224  this->CheckTiming( *(fSlicePtrs[s]) ) &&
225  this->CheckSliceQuality( *(fSlicePtrs[s]) )
226  ){
227  LOG_DEBUG("EvaluatorNue")
228  << "keeping slice " << s;
229  fKeptSlices.emplace_back(fSlicePtrs[s], s);
230  }
231  }
232 
233  return fKeptSlices.size();
234 }
235 
236 //------------------------------------------------------------------------------
238 {
239  // if this is a noise slice, we don't want it
240  if(fSlicePtrs.back()->IsNoise()){
241  LOG_DEBUG("EvaluatorNue::KeepSlice")
242  << "Noise Slice.";
243  return false;
244  }
245  // get the vectors of showers and vertices for this slice
246  std::vector<rb::Shower const*> showers;
247  if( fShowers.count(s) > 0 ){
248  showers = fShowers.find(s)->second;
249  }
250 
251  std::vector<slid::ShowerLID const*> slids;
252  if( fSLIDs.count(s) > 0) slids = fSLIDs.find(s)->second;
253 
254  std::vector<rb::Vertex const*> vertices;
255  if( fVertices.count(s) > 0 ) vertices = fVertices.find(s)->second;
256 
257  std::vector<rb::Prong const*> prongs;
258  if( fProngs.count(s) > 0 ) prongs = fProngs.find(s)->second;
259 
260  std::vector<cosrej::NueCosRej const*> cosrejs;
261  if( fCosRejs.count(s) > 0 ) cosrejs = fCosRejs.find(s)->second;
262 
263  std::vector<lem::PIDDetails const*> lems;
264  if( fLEMs.count(s) > 0) lems = fLEMs.find(s)->second;
265 
266  std::vector<slid::EventLID const*> elids;
267  if( fELIDs.count(s) > 0) elids = fELIDs.find(s)->second;
268 
269  std::vector<cvn::Result const*> cvns;
270  if( fCVNs.count(s) > 0) cvns = fCVNs.find(s)->second;
271 
272  std::vector<presel::Veto const*> nuevetos;
273  if( fNueVetos.count(s) > 0) nuevetos = fNueVetos.find(s)->second;
274 
275  // don't bother if there aren't any showers or vertices
276  // there should only be one vertex per slice according to the
277  // module creating the rb::Vertex objects and only one cosrej::NueCosRej
278  // per slice.
279  if(showers.size() < 1 ||
280  prongs.size() < 1 ||
281  slids.size() < 1 ||
282  vertices.size() != 1 ||
283  cosrejs.size() != 1 ||
284  elids.size() != 1 ||
285  // lems.size() != 1 ||
286  cvns.size() != 1 ||
287  nuevetos.size() != 1
288  ){
289  LOG_DEBUG("EvaluatorNue")
290  << "not enough showers (" << showers .size()
291  << ") or prongs(" << prongs .size()
292  << ") or slids(" << slids .size()
293  << ") or vertices(" << vertices.size()
294  << ") or cosrejs(" << cosrejs .size()
295  << ") or elids(" << elids .size()
296  << ") or lems(" << lems .size()
297  << ") or cvns(" << cvns .size()
298  << ") or nuevetos(" << nuevetos.size()
299  << ")";
300  return false;
301  }
302 
303  // check that all the necessary ptrs are legit
304  // return false if they are not
305  if(vertices[0] == nullptr ||
306  cosrejs[0] == nullptr ||
307  elids[0] == nullptr ||
308  // lems[0] == nullptr ||
309  cvns[0] == nullptr ||
310  nuevetos[0] == nullptr ||
311  showers[0] == nullptr ||
312  slids[0] == nullptr){
313  LOG_DEBUG("EvaluatorNue")
314  << "All the necessary ptrs are NOT legit";
315  return false;
316  }
317  LOG_DEBUG("EvaluatorNue")
318  << "passed - All the necessary ptrs are legit";
319  ////////////////////// Check nearest Slice //////////////////////////
320 
321  const rb::Cluster& slice = (*fSlicePtrs[s]);
322 
323  // find the slice with minimum mean time distance from this slice
324  float mintimediff = 1e7; // initialize to a big number
325  signed int mintimejsli = -1;
326 
327  for(size_t js = 0; js < fSlicePtrs.size(); ++js){
328  if( js == s ) continue;
329  const rb::Cluster& slicej = (*fSlicePtrs[js]);
330  if( slicej.IsNoise() ) continue;
331  float diff = fabs(slicej.MeanTNS() - slice.MeanTNS());
332  if (diff<mintimediff) {mintimejsli = js;}
333  mintimediff = std::min( mintimediff, diff);
334  }
335 
336 
338  float closestsliceminfromtop = std::numeric_limits<float>::max();
340 
341  if (mintimejsli != -1 ){
342  const rb::Cluster& slicejmin = (*fSlicePtrs[mintimejsli]);
343 
344  closestslicetime = slicejmin.MeanTNS()-slice.MeanTNS();
345  TVector3 maxp = slicejmin.MaxXYZ();
346  closestsliceminfromtop = fLiveGeom->DistToTop(maxp);
347 
348  float mincelldistX = std::numeric_limits<float>::max();
349  float mincelldistY = std::numeric_limits<float>::max();
350 
351  float cellD = 2.*fGeom->Plane(0)->Cell(0)->HalfD();
352  float cellW = 2.*fGeom->Plane(0)->Cell(0)->HalfW();
353 
354  // look for minimum distance
355  for(unsigned int hitIdxX = 0; hitIdxX < slice.NXCell(); ++hitIdxX)
356  {
357  const art::Ptr<rb::CellHit>& chitX = slice.XCell(hitIdxX);
358  for(unsigned int minhitIdxX = 0; minhitIdxX < slicejmin.NXCell(); ++minhitIdxX)
359  {
360  const art::Ptr<rb::CellHit>& minchitX = slicejmin.XCell(minhitIdxX);
361  float dPlaneX = (float)chitX->Plane()-(float)minchitX->Plane();
362  float dCellX = (float)chitX->Cell()-(float)minchitX->Cell();
363  float distX = sqrt((dPlaneX*cellD)*(dPlaneX*cellD)+(dCellX*cellW)*(dCellX*cellW));
364  if(distX<mincelldistX) mincelldistX = distX;
365  }
366  }
367  for(unsigned int hitIdxY = 0; hitIdxY < slice.NYCell(); ++hitIdxY)
368  {
369  const art::Ptr<rb::CellHit>& chitY = slice.YCell(hitIdxY);
370  for(unsigned int minhitIdxY = 0; minhitIdxY < slicejmin.NYCell(); ++minhitIdxY)
371  {
372  const art::Ptr<rb::CellHit>& minchitY = slicejmin.YCell(minhitIdxY);
373  float dPlaneY = (float)chitY->Plane()-(float)minchitY->Plane();
374  float dCellY = (float)chitY->Cell()-(float)minchitY->Cell();
375  float distY = sqrt((dPlaneY*cellD)*(dPlaneY*cellD)+(dCellY*cellW)*(dCellY*cellW));
376  if(distY<mincelldistY) mincelldistY = distY;
377  }
378  }
379  closestslicemindist = std::min(mincelldistX, mincelldistY);
380  }
381 
382  LOG_DEBUG("EvaluatorNue") << "Nearest Slice Info: "
383  << closestslicetime << " "
384  << closestsliceminfromtop << " "
385  << closestslicemindist << " " ;
386 
387  // Fill Closes Slice Info Map
388  std::map<std::string, float> closestsliceinfo;
389  closestsliceinfo["Time"] = closestslicetime;
390  closestsliceinfo["DistFromTop"] = closestsliceminfromtop;
391  closestsliceinfo["MinDist"] = closestslicemindist;
392 
393 
394  if(fLEMLabel != "" ){ // Must be SA expect lem info and no nearest slice info
395  auto params = std::make_unique<skim::ParametersNue>(*(fSlicePtrs[s]),
396  *(vertices[0]),
397  *(cosrejs[0]),
398  showers,
399  prongs,
400  slids,
401  *(elids[0]),
402  *(lems[0]),
403  *(cvns[0]),
404  *(nuevetos[0]));
405 
406  LOG_DEBUG("EvaluatorNue") << *params;
407 
408  this->FillHistograms(*params);
409 
410  return fSel->PassesSelection(params.get(), fDetId);
411  } else { // Must be 2017 Analysis expects no lem info but uses nearest slice info
412 
413  auto params = std::make_unique<skim::ParametersNue>(*(fSlicePtrs[s]),
414  *(vertices[0]),
415  *(cosrejs[0]),
416  showers,
417  prongs,
418  slids,
419  closestsliceinfo,
420  *(elids[0]),
421  *(cvns[0]),
422  *(nuevetos[0]));
423 
424  LOG_DEBUG("EvaluatorNue") << *params;
425 
426  this->FillHistograms(*params);
427 
428  return fSel->PassesSelection(params.get(), fDetId);
429 
430  }
431 }
432 
433 //------------------------------------------------------------------------------
435 {
436 
438  fFDSliceNHitsPerPlane->Fill(params.CellsPerPlane());
439  fFDShowerHitsXView ->Fill(params.ShowerNumXCell());
440  fFDShowerHitsYView ->Fill(params.ShowerNumYCell());
441  fFDShowerHitsViewAsym->Fill(params.HitAsymmetry());
442  fFDSliceCosAngleShw ->Fill(params.CosShowers());
443  fFDSliceDistShwVtx ->Fill(params.ShowerVtxDist());
444  fFDSliceFracShwHits ->Fill(params.FracShowerHits());
445  fFDVtxDistToEastWall ->Fill(params.MinEastDist());
446  fFDVtxDistToWestWall ->Fill(params.MinWestDist());
447  fFDVtxDistToTop ->Fill(params.MinTopDist());
448  fFDVtxDistToBottom ->Fill(params.MinBotDist());
449  fFDVtxDistToFront ->Fill(params.MinFrontDist());
450  fFDVtxDistToBack ->Fill(params.MinBackDist());
451  fFDPt ->Fill(params.ShowerPt());
452  }
453  else if(fDetId == novadaq::cnv::kNEARDET){
454  fNDVtxX ->Fill(params.Vertex().X());
455  fNDVtxY ->Fill(params.Vertex().Y());
456  fNDVtxZ ->Fill(params.Vertex().Z());
457  fNDShwVtxX ->Fill(params.ShowerVertex().X());
458  fNDShwVtxY ->Fill(params.ShowerVertex().Y());
459  fNDShwVtxZ ->Fill(params.ShowerVertex().Z());
460  fNDShwEndX ->Fill(params.ShowerEnd().X());
461  fNDShwEndY ->Fill(params.ShowerEnd().Y());
462  fNDShwEndZ ->Fill(params.ShowerEnd().Z());
463  fNDSliceHits ->Fill(params.SliceHits());
464  fNDCalorimetricE ->Fill(params.CalorimetricE());
465  fNDPlanesToFront ->Fill(params.PlanesToFront());
466  fNDProngLength ->Fill(params.ProngLength());
467  fNDSliceNHitsPerPlane->Fill(params.CellsPerPlane());
468  fNDPlanesToFront ->Fill(params.PlanesToFront());
469  fNDNShowers ->Fill(params.NumShowers());
470  fNDShowerDistToVtx ->Fill(params.ShowerVtxDist());
471  fNDShowerCalE ->Fill(params.ShowerCalE());
472  fNDShowerCalEfraction->Fill(params.ShowerCalE()/params.CalorimetricE());
473  fNDSliceNoShowerCalE ->Fill(params.CalorimetricE()-params.ShowerCalE());
474  fNDCalEperHit ->Fill(params.CalorimetricE()/params.SliceHits());
475  fNDlem ->Fill(params.LEMVal());
476  fNDlid ->Fill(params.LIDVal());
477  fNDcvn ->Fill(params.CVNVal());
478  }
479 
480  return;
481 }
std::vector< art::Ptr< rb::Cluster > > fSlicePtrs
all slices in the spill
Definition: Evaluator.h:92
TH1F * fFDVtxDistToEastWall
Definition: EvaluatorNue.h:113
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
float const & PlanesToFront() const
Definition: ParametersNue.h:70
std::string fNueVetoLabel
label of module creating nue vetos
Definition: EvaluatorNue.h:102
bool Initialize(novadaq::cnv::DetId const &detId, art::Event const &e)
float const & CalorimetricE() const
float const & ShowerNumYCell() const
Definition: ParametersNue.h:78
SubRunNumber_t subRun() const
Definition: Event.h:72
TH1F * fFDShowerHitsViewAsym
Definition: EvaluatorNue.h:109
novadaq::cnv::DetId fDetId
the id of the detector we are looking at
Definition: Evaluator.h:84
TH1F * fNDShowerCalEfraction
Definition: EvaluatorNue.h:135
double HalfD() const
Definition: CellGeo.cxx:205
art::InputTag fProngTag
input tag for prongs used in preselection
Definition: EvaluatorNue.h:103
std::string fVertexLabel
label of module creating vertex
Definition: EvaluatorNue.h:95
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
float const & ShowerPt() const
Definition: ParametersNue.h:88
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
float const & CVNVal() const
unsigned short Plane() const
Definition: CellHit.h:39
void FillSliceMap(size_t const &s, art::FindMany< T > &fmp, std::map< size_t, std::vector< T const * > > &ptrMap)
float const & ProngLength() const
Definition: ParametersNue.h:80
TVector3 const & ShowerEnd() const
Definition: ParametersNue.h:85
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
double HalfW() const
Definition: CellGeo.cxx:191
A collection of associated CellHits.
Definition: Cluster.h:47
bool CheckTiming(rb::Cluster const &slice)
Definition: Evaluator.cxx:20
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
TFile * fmc
Definition: bdt_com.C:14
float const & MinEastDist() const
const PlaneGeo * Plane(unsigned int i) const
bool isRealData() const
Definition: Event.h:83
int fCurrentSubRun
the current run number
Definition: Evaluator.h:89
bool fIsData
is this data or MC?
Definition: Evaluator.h:87
std::string fSliceLabel
label of module creating slices
Definition: Evaluator.h:85
float const & CellsPerPlane() const
Definition: ParametersNue.h:71
void FillSliceVector(size_t const &s, art::FindMany< T > &fmp, std::vector< T const * > &ptrMap)
TVector3 MaxXYZ() const
Definition: Cluster.cxx:492
TVector3 const & Vertex() const
Definition: ParametersNue.h:98
std::vector< KeptSliceInfo > fKeptSlices
slices we keep
Definition: Evaluator.h:91
float const & ShowerCalE() const
Definition: ParametersNue.h:81
unsigned short Cell() const
Definition: CellHit.h:40
const XML_Char * s
Definition: expat.h:262
std::map< size_t, std::vector< cosrej::NueCosRej const * > > fCosRejs
slice index to cosrej ptrs
Definition: EvaluatorNue.h:88
double DistToTop(TVector3 vertex)
std::unique_ptr< skim::SelectionBase > fSel
determine which type of selection to use at run time
Definition: EvaluatorNue.h:83
virtual double TotalLength() const
Distance along prong to reach last cell hit.
Definition: Prong.cxx:186
Far Detector at Ash River, MN.
float const & MinTopDist() const
float const & HitAsymmetry() const
Definition: ParametersNue.h:75
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
Definition: Cluster.cxx:165
std::map< size_t, std::vector< slid::EventLID const * > > fELIDs
slice index to evtlid ptrs
Definition: EvaluatorNue.h:91
std::map< size_t, std::vector< lem::PIDDetails const * > > fLEMs
slice index to lem ptrs
Definition: EvaluatorNue.h:90
T get(std::string const &key) const
Definition: ParameterSet.h:231
TVector3 const & ShowerVertex() const
Definition: ParametersNue.h:86
float closestslicetime
std::map< size_t, std::vector< rb::Shower const * > > fShowers
slice index to shower ptrs
Definition: EvaluatorNue.h:85
Near Detector in the NuMI cavern.
int fCurrentEvent
the current run number
Definition: Evaluator.h:90
EvaluatorNue(fhicl::ParameterSet const &p)
float const & MinBackDist() const
EventNumber_t event() const
Definition: Event.h:67
void reconfigure(fhicl::ParameterSet const &p)
float const & LIDVal() const
std::map< size_t, std::vector< rb::Vertex const * > > fVertices
slice index to vertex ptrs
Definition: EvaluatorNue.h:87
#define LOG_WARNING(category)
bool showerByEnergyNue(slid::ShowerLID const *s1, slid::ShowerLID const *s2)
bool prongByLengthNue(rb::Prong const *p1, rb::Prong const *p2)
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
EventNumber_t event() const
Definition: EventID.h:116
float const & CosShowers() const
Definition: ParametersNue.h:79
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
A Cluster with defined start position and direction.
Definition: Prong.h:19
std::map< size_t, std::vector< slid::ShowerLID const * > > fSLIDs
slice index to slid ptrs
Definition: EvaluatorNue.h:89
std::map< size_t, std::vector< cvn::Result const * > > fCVNs
slice index to cvn ptrs
Definition: EvaluatorNue.h:92
float ShowerEnergy() const
Definition: ShowerLID.h:157
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool KeepSlice(size_t s)
TH1F * fFDSliceCosAngleShw
Definition: EvaluatorNue.h:110
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
std::string fCVNLabel
label of module creating cvn pids
Definition: EvaluatorNue.h:101
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
Definition: Cluster.cxx:554
float const & ShowerNumXCell() const
Definition: ParametersNue.h:77
std::string fCosRejLabel
label of module creating cosrejs
Definition: EvaluatorNue.h:98
std::string fLIDLabel
label of module creating shower and event lids
Definition: EvaluatorNue.h:99
float const & MinBotDist() const
art::ServiceHandle< geo::LiveGeometry > fLiveGeom
the LiveGeometry service
Definition: EvaluatorNue.h:80
TH1F * fFDSliceNHitsPerPlane
Definition: EvaluatorNue.h:106
std::map< size_t, std::vector< presel::Veto const * > > fNueVetos
slice index to nue vetos ptrs
Definition: EvaluatorNue.h:93
int fCurrentRun
the current run number
Definition: Evaluator.h:88
float const & SliceHits() const
Definition: ParametersNue.h:74
float const & FracShowerHits() const
Definition: ParametersNue.h:83
T min(const caf::Proxy< T > &a, T b)
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
float closestslicemindist
std::string fLEMLabel
label of module creating lem pids
Definition: EvaluatorNue.h:100
float const & LEMVal() const
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.h:77
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
TH1F * fNDSliceNHitsPerPlane
Definition: EvaluatorNue.h:142
float const & MinFrontDist() const
TH1F * fNDSliceNoShowerCalE
Definition: EvaluatorNue.h:143
float const & NumShowers() const
Definition: ParametersNue.h:76
void FillHistograms(skim::ParametersNue const &params)
bool CheckSliceQuality(rb::Cluster const &slice)
Definition: Evaluator.cxx:73
std::string fShowerLabel
label of module creating showers
Definition: EvaluatorNue.h:97
std::map< size_t, std::vector< rb::Prong const * > > fProngs
slice index to prong ptrs
Definition: EvaluatorNue.h:86
EventID id() const
Definition: Event.h:56
float const & ShowerVtxDist() const
Definition: ParametersNue.h:87
art::ServiceHandle< geo::Geometry > fGeom
the Geometry service
Definition: EvaluatorNue.h:81
bool failedToGet() const
Definition: Handle.h:196
TH1F * fFDSliceFracShwHits
Definition: EvaluatorNue.h:112
float const & MinWestDist() const
TH1F * fFDVtxDistToWestWall
Definition: EvaluatorNue.h:114