CellHitSkimmer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: CellHitSkimmer
3 // Module Type: filter
4 // File: CellHitSkimmer_module.cc
5 //
6 // Generated at Mon Aug 3 10:52:56 2015 by Brian Rebel using artmod
7 // from cetpkgsupport v1_08_06.
8 ////////////////////////////////////////////////////////////////////////
9 
21 #include "fhiclcpp/ParameterSet.h"
23 
24 #include <memory>
25 #include <map>
26 
27 #include "TH1.h"
28 #include "TTree.h"
29 
30 #include "NovaDAQConventions/DAQConventions.h"
33 #include "Geometry/Geometry.h"
34 #include "Geometry/LiveGeometry.h"
37 #include "RecoBase/Cluster.h"
38 #include "RecoBase/Prong.h"
39 #include "RecoBase/Track.h"
40 #include "RecoBase/Shower.h"
41 #include "RecoBase/Vertex.h"
43 #include "SummaryData/SpillData.h"
44 #include "SummaryData/POTSum.h"
45 #include "Utilities/AssociationUtil.h"
53 
54 namespace skim {
56 
57  typedef std::map<std::string, skim::Evaluator* > EvaluatorMap;
58  typedef std::map<std::string, std::vector<std::pair<int,int> > > SelectedSlices;
59 }
60 
62 public:
63  explicit CellHitSkimmer(fhicl::ParameterSet const & p);
64  virtual ~CellHitSkimmer();
65 
66  // Plugins should not be copied or assigned.
67  CellHitSkimmer(CellHitSkimmer const &) = delete;
68  CellHitSkimmer(CellHitSkimmer &&) = delete;
69  CellHitSkimmer & operator = (CellHitSkimmer const &) = delete;
71 
72  // Required functions.
73  bool filter(art::Event & e) override;
74 
75  // Selected optional functions.
76  void reconfigure(fhicl::ParameterSet const & p);
77 
78  void beginJob() override;
79  bool beginSubRun(art::SubRun & sr) override;
80  bool endSubRun(art::SubRun & sr) override;
81  bool beginRun(art::Run & r) override;
82  bool endRun(art::Run &r) override;
83  void endJob() override;
84 
85  // void respondToCloseInputFile(art::FileBlock const & fb) override;
86  // void respondToCloseOutputFiles(art::FileBlock const & fb) override;
87  // void respondToOpenInputFile(art::FileBlock const &fb) override;
88  // void respondToOpenOutputFiles(art::FileBlock const & fb) override;
89 
90 private:
91 
92  bool CheckEvent(art::Event & e);
93  bool EvaluateSlices(art::Event & e,
94  bool const& goodEvent,
95  std::string const& label,
96  skim::Evaluator & evaluator);
97 
98  skim::EvaluatorMap fEvaluatorMap; ///< object that determines if we keep a slice or not
103  novadaq::cnv::DetId fDetId; ///< detector id for the current run
104  SelectedSlices fSlicesPerType; ///< map instance labels to the number of passing slices
105  skim::SpillEvaluator fSpillEval; ///< tool to check the quality of a spill
106  std::string fEventQualityLabel; ///< label of module creating event quality
107  std::string fSpillDataLabel; ///< label of module creating event quality
108  sumdata::POTSum fPOTSumSubRun; ///< total pot for the current subrun
109 
110  // spill quality cuts
111  float fMaxFracDCM3Hits; ///< maximum fraction of hits in DCM3
112  float fMinFracDCMEdgeMatch;///< minimum edge match fraction of DCMs
113  int fMaxMissingDCMS; ///< maximum number of DCMs allowed to be missing in the ND
114 
115  // Sanity check histograms
120  TH1F *fPOTInSpill;
122  TH1F *fBeamXPos;
123  TH1F *fBeamYPos;
124  TH1F *fBeamWidth;
125 
126  // hack here - need a way to propagate POT information
127  TTree *fPOTTree;
129  int fRun;
130  int fEpoch;
131 
132  // cheating list of good runs and events for numu or nue used for debugging
133  std::set<std::pair<int,int>> fNumuList;
134  std::set<std::pair<int,int>> fNueList;
135  bool fCherryPick; ///< set to true to grab a predefined list of events
136  bool fIsCosmic; ///< in order to look at cosmic events, don't evaluate the spill
137 };
138 
139 //------------------------------------------------------------------------------
141 : fSpillEval(p.get<fhicl::ParameterSet>("SpillEvaluation"))
142 {
143 
144  this->reconfigure(p);
145 
146  for(auto itr : fEvaluatorMap){
147  // create a new vector of rb::CellHits that are from the
148  // slices that we want to skim out of the full sample
149  produces< std::vector<rb::CellHit> >(itr.first);
150 
151  // make an art::PtrVector<rb::Cluster> that contains
152  // the slices we want to skim out of the sample. This
153  // collection will be used in the next module, AnalysisSkimmer,
154  // to enable looking at only the interesting slices without having
155  // to use the SliceEvaluator again.
156  produces< art::PtrVector<rb::Cluster> >(itr.first);
157  produces< std::vector<int> >(itr.first);
158  }
159 
160  produces< sumdata::POTSum, art::InSubRun>();
161 
162  return;
163 }
164 
165 //------------------------------------------------------------------------------
167 {
168  for(auto itr : fEvaluatorMap){
169  delete itr.second;
170  }
171  fEvaluatorMap.clear();
172 }
173 
174 //------------------------------------------------------------------------------
176 {
177  // make histograms for each selection criteria
179 
180  fFracDCM3Hits = tfs->make<TH1F>("fracDCM3Hits", ";Fraction DCM3 Hits;Spills", 100, 0., 1. );
181  fFracDCMEdgeMatch = tfs->make<TH1F>("fracDCMEdgeMatch", ";Fraction DCM3 Hits;Spills", 100, 0., 1. );
182  fMissingDCMS = tfs->make<TH1F>("missingDCMS", ";Number Missing DCMs;Spills", 100, 0., 100.);
183  fDeltaTToSpill = tfs->make<TH1F>("deltaTToSpill", ";#Delta T (#mus);Spills", 100, 0., 1.e4);
184  fPOTInSpill = tfs->make<TH1F>("potInSpill", ";POT (#times10^{12});Spills", 100, 0., 50. );
185  fHornCurrent = tfs->make<TH1F>("hornCurrent", ";Horn Current (A);Spills", 200, -250., -150.);
186  fBeamXPos = tfs->make<TH1F>("beamXPos", ";Beam X Position (mm);Spills", 500, -2.5, 2.5 );
187  fBeamYPos = tfs->make<TH1F>("beamYPos", ";Beam Y Position (mm);Spills", 500, -2.5, 2.5 );
188  fBeamWidth = tfs->make<TH1F>("beamWidth", ";Beam Width (mm);Spills", 200, 0., 2. );
189 
190  fPOTTree = tfs->make<TTree>("potTree", "POT Summary Information");
191  fPOTTree->Branch("totpot", &fPOTSum.totpot);
192  fPOTTree->Branch("totgoodpot", &fPOTSum.totgoodpot);
193  fPOTTree->Branch("totspills", &fPOTSum.totspills);
194  fPOTTree->Branch("goodspills", &fPOTSum.goodspills);
195  fPOTTree->Branch("epoch", &fEpoch);
196  fPOTTree->Branch("run", &fRun);
197 
198 // fNumuList.emplace(std::make_pair(14828, 192569));
199 // fNumuList.emplace(std::make_pair(15974, 88744));
200 // fNumuList.emplace(std::make_pair(16453, 178062));
201 // fNumuList.emplace(std::make_pair(16708, 234543));
202 // fNumuList.emplace(std::make_pair(16730, 101478));
203 // fNumuList.emplace(std::make_pair(16751, 45215));
204 // fNumuList.emplace(std::make_pair(16895, 88217));
205 // fNumuList.emplace(std::make_pair(17953, 256887));
206 // fNumuList.emplace(std::make_pair(18068, 379778));
207 // fNumuList.emplace(std::make_pair(18342, 609061));
208 // fNumuList.emplace(std::make_pair(18417, 582977));
209 // fNumuList.emplace(std::make_pair(18464, 546039));
210 // fNumuList.emplace(std::make_pair(18571, 50129));
211 // fNumuList.emplace(std::make_pair(18572, 255330));
212 // fNumuList.emplace(std::make_pair(18639, 141206));
213 // fNumuList.emplace(std::make_pair(18653, 219065));
214 // fNumuList.emplace(std::make_pair(18756, 597960));
215 // fNumuList.emplace(std::make_pair(18791, 765587));
216 // fNumuList.emplace(std::make_pair(18810, 469509));
217 // fNumuList.emplace(std::make_pair(18862, 820267));
218 // fNumuList.emplace(std::make_pair(18963, 229864));
219 // fNumuList.emplace(std::make_pair(19004, 318354));
220 // fNumuList.emplace(std::make_pair(19058, 568646));
221 // fNumuList.emplace(std::make_pair(19070, 260204));
222 // fNumuList.emplace(std::make_pair(19084, 908450));
223 // fNumuList.emplace(std::make_pair(19152, 789340));
224 // fNumuList.emplace(std::make_pair(19260, 359000));
225 // fNumuList.emplace(std::make_pair(19327, 248695));
226 // fNumuList.emplace(std::make_pair(19332, 221786));
227 // fNumuList.emplace(std::make_pair(19420, 561111));
228 // fNumuList.emplace(std::make_pair(19423, 20137));
229 // fNumuList.emplace(std::make_pair(19425, 903289));
230 // fNumuList.emplace(std::make_pair(19468, 512430));
231 // fNumuList.emplace(std::make_pair(19476, 110767));
232 
233 // fNumuList.emplace(std::make_pair(14828, 284245))
234 // fNumuList.emplace(std::make_pair(14825, 216705))
235 // fNumuList.emplace(std::make_pair(15014, 150279))
236 
237  fNueList.emplace(std::make_pair(14109, 271884));
238  fNueList.emplace(std::make_pair(15975, 27652));
239  fNueList.emplace(std::make_pair(18625, 89150));
240  fNueList.emplace(std::make_pair(19067, 358535));
241  fNueList.emplace(std::make_pair(19361, 142949));
242  fNueList.emplace(std::make_pair(15330, 11978));
243  fNueList.emplace(std::make_pair(17103, 27816));
244  fNueList.emplace(std::make_pair(19165, 920415));
245  fNueList.emplace(std::make_pair(19193, 188331));
246  fNueList.emplace(std::make_pair(19264, 369602));
247  fNueList.emplace(std::make_pair(19578, 98069));
248 
249 
250  return;
251 }
252 
253 //------------------------------------------------------------------------------
255 {
256 
257  fDetId = fDetService->DetId();
258 
259  fPOTSum.totpot = 0.;
260  fPOTSum.totgoodpot = 0.;
261  fPOTSum.totspills = 0;
262  fPOTSum.goodspills = 0;
263 
264  return true;
265 }
266 
267 //------------------------------------------------------------------------------
269 {
270 
271  fPOTSumSubRun.totpot = 0.;
275 
276  return true;
277 }
278 
279 //------------------------------------------------------------------------------
281 {
282  std::unique_ptr< sumdata::POTSum > potsum(new sumdata::POTSum(fPOTSumSubRun));
283  sr.put(std::move(potsum));
284 
285  return true;
286 }
287 
288 //------------------------------------------------------------------------------
290 {
291  // first get the epoch name and any letter associated with it
292  auto ep = fRH->GetDataEpoch().name;
293  size_t first = ep.find_first_of("abcdefghijklmnopqrstuvwxyz");
294  std::string alpha = ep.substr(first, first + 1);
295 
296  fEpoch = (std::atoi(ep.substr(0, first).c_str()) * 1000 +
297  static_cast<int>(*(alpha.c_str())) );
298  fRun = r.run();
299 
300  LOG_VERBATIM("CellHitSkimmer")
301  << "POT in Run "
302  << fRun
303  << "\ntotal: " << fPOTSum.totpot
304  << "\ngood:" << fPOTSum.totgoodpot
305  << "\nspills:" << fPOTSum.totspills
306  << "\ngood spills:" << fPOTSum.goodspills;
307 
308  fPOTTree->Fill();
309 
310  return true;
311 }
312 
313 //------------------------------------------------------------------------------
315 {
316 
317  // see if we can initialize the evaluator, if not there
318  // is a problem with the event (spill) and it should be
319  // filtered out
320  size_t okToUse = 0;
321 
322  bool goodEvent = this->CheckEvent(e);
323 
324  // check if the event (spill) is worth keeping
325  LOG_DEBUG("CellHitSkimmer")
326  << "check the event"
327  << " run = "
328  << e.run()
329  << " subrun = "
330  << e.subRun()
331  << " and event = "
332  << e.event();
333  for(auto itr : fEvaluatorMap){
334  if(this->EvaluateSlices(e, goodEvent, itr.first, *(itr.second))) ++okToUse;
335  }
336 
337  // if at least one of the evaluators found a good slice in the event, keep it
338  // and store the cycle information
339  if(okToUse > 0){
340  return true;
341  }
342 
343  // no good slices found, filter the event out
344  return false;
345 }
346 
347 //------------------------------------------------------------------------------
349 {
350  std::stringstream out;
351  for(auto itr : fSlicesPerType){
352  out << "\n" << itr.second.size()
353  << " events were selected by the "
354  << itr.first
355  << " evaluator to have at least one good slice:\n";
356  for(auto slitr : itr.second)
357  out
358  << "\n\t"
359  << slitr.first
360  << " "
361  << slitr.second;
362  }
363 
364  LOG_VERBATIM("CellHitSkimmer")
365  << out.str();
366 
367  return;
368 }
369 
370 
371 //------------------------------------------------------------------------------
373  bool const& goodEvent,
374  std::string const& label,
375  skim::Evaluator & evaluator)
376 {
377  // As long as we do a drop on output we will keep all the
378  // necessary provenance information on how each item was created. The
379  // information is left in the configuration DB intact, and we know what modules
380  // created which input data product by the module label configurations for this module.
381  std::unique_ptr< std::vector<rb::CellHit> > cellHitOut(new std::vector<rb::CellHit> );
382  std::unique_ptr< art::PtrVector<rb::Cluster> > sliceOut (new art::PtrVector<rb::Cluster> );
383  std::unique_ptr< std::vector<int> > sliceNum (new std::vector<int> );
384 
385  bool goodSlices = false;
386 
387  LOG_DEBUG("CellHitSkimmer")
388  << "initialize the evaluator: "
389  << label
390  << " this event is "
391  << goodEvent
392  << " run = "
393  << e.run()
394  << " subrun = "
395  << e.subRun()
396  << " and event = "
397  << e.event();
398 
399  // we checked the event quality before calling this method, but pass the
400  // results into this method so that we still place empty collections on the
401  // event record if nothing passes the selection
402  if(goodEvent){
403 
404  goodSlices = true;
405 
406  // see if we can initialize the evaluator, if not there
407  // is a problem with the event (spill) and it should be
408  // filtered out
409  if( !evaluator.Initialize(fDetId, e) ) goodSlices = false;
410  else{
411 
412  // check that there is at least 1 slice to keep
413  LOG_DEBUG("CellHitSkimmer")
414  << "check the slices";
415  if( evaluator.CheckSlices() < 1){
416  LOG_DEBUG("CellHitSkimmer")
417  << "No slices to keep in the spill";
418  goodSlices = false;
419  }
420  else{
421 
422  fSlicesPerType[label].push_back(std::make_pair(e.id().run(), e.event()));
423 
424  // loop over the slices and keep those that satisfy the
425  // selection criteria
426  auto slices = evaluator.SlicesToKeep();
427  for(auto slice : slices){
428 
429  sliceOut->push_back(slice.keptSlice);
430  sliceNum->push_back(slice.keptSliceNum);
431 
432  // make a copy of the cell hits
433  auto allCells = slice.keptSlice->AllCells();
434 
435  // add the cell to the full list
436  for(size_t ch = 0; ch < allCells.size(); ++ch)
437  cellHitOut->emplace_back( *(allCells[ch]) );
438 
439  } // end loop over slices
440 
441  LOG_DEBUG("CellHitSkimmer")
442  << "keeping "
443  << cellHitOut->size() << " cells and "
444  << sliceOut->size() << " slices";
445  } // end that we have a slice to keep
446  } // end that we were able to initialize
447  } // end if this was a good event
448 
449  e.put(std::move(cellHitOut), label);
450  e.put(std::move(sliceOut), label);
451  e.put(std::move(sliceNum), label);
452 
453  return goodSlices;
454 }
455 
456 //------------------------------------------------------------------------------
458 {
459 
460  if(fCherryPick){
461  auto runEvent = std::make_pair(e.run(), e.id().event());
462  if(fNumuList.count(runEvent) < 1 &&
463  fNueList .count(runEvent) < 1) return false;
464  else
465  LOG_DEBUG("CellHitSkimmer")
466  << "run: " << runEvent.first << " event: " << runEvent.second;
467  }
468 
469  bool goodQuality = true;
470  bool goodSpill = true;
471 
472  if(!fIsCosmic){
473  //Only check spill if it's not a cosmic file (cosmic files have no spill info)
474  LOG_DEBUG("CellHitSkimmer") << "Looking for valid handle for spill data";
476  if( spillData.failedToGet() ) goodSpill = false;
477  else{
478 
479  LOG_DEBUG("CellHitSkimmer") << "Found valid handle for spill data";
480 
481  fDeltaTToSpill->Fill(1.e-3*spillData->deltaspilltimensec);
482  fPOTInSpill ->Fill(spillData->spillpot);
483  fHornCurrent ->Fill(spillData->hornI);
484  fBeamXPos ->Fill(spillData->posx);
485  fBeamYPos ->Fill(spillData->posy);
486  fBeamWidth ->Fill(spillData->widthx);
487 
488  goodSpill = fSpillEval.EvaluateSpill(*spillData);
489 
490  fPOTSum.totpot += spillData->spillpot;
491  fPOTSum.totspills += 1;
492  fPOTSumSubRun.totpot += spillData->spillpot;
494  if(goodSpill){
495  fPOTSum.totgoodpot += spillData->spillpot;
496  fPOTSum.goodspills += 1;
497  fPOTSumSubRun.totgoodpot += spillData->spillpot;
499  }
500  }// end we found a SpillData object
501  }// end it's not a cosmic file
502 
503  // check the data quality for this event (spill)
505 
506  if( eventQual.failedToGet() ){
507  goodQuality = false;
508  LOG_DEBUG("CellHitSkimmer") << "Failed to get EventQuality object";
509  }
510  else {
511  fFracDCM3Hits ->Fill(eventQual->fracdcm3hits );
512  fFracDCMEdgeMatch->Fill(eventQual->dcmedgematchfrac);
513  fMissingDCMS ->Fill(eventQual->nmissingdcms );
514 
516  (eventQual->fracdcm3hits > fMaxFracDCM3Hits ||
517  eventQual->nmissingdcms > fMaxMissingDCMS)
518  ) ||
521  (e.isRealData() &&
522  eventQual->dcmedgematchfrac < fMinFracDCMEdgeMatch)
523  )
524  ) // if FD
525  ) goodQuality = false;
526  }
527 
528  LOG_DEBUG("CellHitSkimmer")
529  << "Event quality checks "
530  << eventQual->fracdcm3hits << "<" << fMaxFracDCM3Hits << "\n"
531  << eventQual->nmissingdcms << "<" << fMaxMissingDCMS << "\n"
532  << eventQual->dcmedgematchfrac << ">" << fMinFracDCMEdgeMatch << "(FD only)";
533 
534  // check the run is not in a list of runs to filter
535  if( ana::kFilteredRunList.count(e.run()) > 0 ) goodQuality = false;
536 
537  // some of the MC may have had the same incorrect masks applied as the data
538  // so check that here for both data and MC
540 
542  std::bitset<14> binary (rh->GoodDiBlockMask()&rh->GetConfiguration());
543 
544  LOG_DEBUG("CellHitSkimmer")
545  << "mask: "
546  << binary.to_string();
547 
548  int masksize = 0 ;
549  for (int i = 0; i < 14; ++i){
550  if (binary[i]) ++masksize;
551  else{
552  if (masksize > 3) break;
553  masksize = 0;
554  }
555  }
556  if (masksize < 4) goodQuality = false;
557 
558  // unsigned int dibfirst = 0;
559  // unsigned int diblast = 0;
560  //
561  // if (dibmask) {
562  // int iD;
563  // iD=0; while (!((dibmask>>iD)&1)) iD++; dibfirst=iD+1;
564  // iD=0; while (dibmask>>iD) iD++; diblast=iD;
565  // }
566 
567  // std::bitset<14> binary(dibmask);
568  // for (int i = 0; i < 14; ++i){
569  // unsigned int dbcount = i+1;
570  // if (dbcount >= dibfirst &&
571  // dbcount <= diblast &&
572  // binary[i] == 0) return false;
573  // }
574 
575  }// end if in the FD
576 
577  LOG_DEBUG("CellHitSkimmer")
578  << "Result of CheckEvent: "
579  << " spill: " << goodSpill
580  << " dq: " << goodQuality;
581 
582  if(!goodSpill || !goodQuality) return false;
583 
584  return true;
585 }
586 
587 //------------------------------------------------------------------------------
589 {
590  auto evaluatorConfigs = p.get< std::vector<fhicl::ParameterSet> >("EvaluatorParameters");
591 
592  for(auto config : evaluatorConfigs){
593  auto label = config.get<std::string>("EvaluatorLabel");
594  if(label.find("numu") != std::string::npos) fEvaluatorMap[label] = new skim::EvaluatorNumu(config);
595  else if(label.find("nue" ) != std::string::npos) fEvaluatorMap[label] = new skim::EvaluatorNue (config);
596  else if(label.find("ccpi") != std::string::npos) fEvaluatorMap[label] = new skim::EvaluatorNumu(config);
597  }
598 
599  fEventQualityLabel = p.get<std::string>("EventQualityLabel", "dqspillflags" );
600  fSpillDataLabel = p.get<std::string>("SpillDataLabel", "ifdbspillinfo");
601  fCherryPick = p.get<bool >("CherryPick", false );
602  fMaxFracDCM3Hits = p.get<float >("MaxFracDCM3Hits", 0.5 );
603  fMinFracDCMEdgeMatch = p.get<float >("MinFracDCMEdgeMatch", 0.5 );
604  fMaxMissingDCMS = p.get<int >("MaxMissingDCMS", 0 );
605  fIsCosmic = p.get<bool >("IsCosmic", false );
606 
607  if(fIsCosmic) LOG_VERBATIM("CellHitSkimmer") << "This is a cosmic file: don't check spill";
608 
609  return;
610 }
611 
612 // //------------------------------------------------------------------------------
613 // void skim::CellHitSkimmer::beginJob()
614 // {
615 // // Implementation of optional member function here.
616 // }
617 
618 // //------------------------------------------------------------------------------
619 // bool skim::CellHitSkimmer::beginSubRun(art::SubRun & sr)
620 // {
621 // // Implementation of optional member function here.
622 // }
623 
624 // //------------------------------------------------------------------------------
625 // bool skim::CellHitSkimmer::endRun(art::Run & r)
626 // {
627 // // Implementation of optional member function here.
628 // }
629 
630 // //------------------------------------------------------------------------------
631 // bool skim::CellHitSkimmer::endSubRun(art::SubRun & sr)
632 // {
633 // // Implementation of optional member function here.
634 // }
635 
636 // void skim::CellHitSkimmer::respondToCloseInputFile(art::FileBlock const & fb)
637 // {
638 // // Implementation of optional member function here.
639 // }
640 
641 // void skim::CellHitSkimmer::respondToCloseOutputFiles(art::FileBlock const & fb)
642 // {
643 // // Implementation of optional member function here.
644 // }
645 
646 // void skim::CellHitSkimmer::respondToOpenInputFile(art::FileBlock const &fb)
647 // {
648 // // Implementation of optional member function here.
649 // }
650 
651 // void skim::CellHitSkimmer::respondToOpenOutputFiles(art::FileBlock const & fb)
652 // {
653 // // Implementation of optional member function here.
654 // }
655 
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
art::ServiceHandle< geo::LiveGeometry > fLiveGeom
geometry service
SelectedSlices fSlicesPerType
map instance labels to the number of passing slices
novadaq::cnv::DetId DetId() const
What detector are we in?
SubRunNumber_t subRun() const
Definition: Event.h:72
sumdata::POTSum fPOTSumSubRun
total pot for the current subrun
TH2 * rh
Definition: drawXsec.C:5
bool fCherryPick
set to true to grab a predefined list of events
float fMinFracDCMEdgeMatch
minimum edge match fraction of DCMs
const char * p
Definition: xmltok.h:285
art::ServiceHandle< ds::DetectorService > fDetService
detector service
bool EvaluateSlices(art::Event &e, bool const &goodEvent, std::string const &label, skim::Evaluator &evaluator)
void reconfigure(fhicl::ParameterSet const &p)
Definition: config.py:1
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::set< std::pair< int, int > > fNumuList
bool beginSubRun(art::SubRun &sr) override
bool isRealData() const
Definition: Event.h:83
art::ServiceHandle< geo::Geometry > fGeom
geometry service
DEFINE_ART_MODULE(TestTMapFile)
RunNumber_t run() const
Definition: EventID.h:98
RunNumber_t run() const
Definition: Run.h:47
Module to create a summary of total POT seen in a job.
Definition: Evaluator.h:27
Definition: Run.h:31
const char * label
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool endRun(art::Run &r) override
Far Detector at Ash River, MN.
skim::SpillEvaluator fSpillEval
tool to check the quality of a spill
std::string fEventQualityLabel
label of module creating event quality
skim::EvaluatorMap fEvaluatorMap
object that determines if we keep a slice or not
std::map< std::string, skim::Evaluator * > EvaluatorMap
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fSpillDataLabel
label of module creating event quality
bool fIsCosmic
in order to look at cosmic events, don&#39;t evaluate the spill
Near Detector in the NuMI cavern.
std::set< std::pair< int, int > > fNueList
EventNumber_t event() const
Definition: Event.h:67
bool CheckEvent(art::Event &e)
Vertex location in position and time.
virtual bool Initialize(novadaq::cnv::DetId const &detId, art::Event const &e)=0
art::ServiceHandle< nova::dbi::RunHistoryService > fRH
RunHistory service.
const std::set< int > kFilteredRunList
std::string name
Definition: RunHistory.h:59
std::map< std::string, std::vector< std::pair< int, int > > > SelectedSlices
EventNumber_t event() const
Definition: EventID.h:116
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
T * make(ARGS...args) const
float fMaxFracDCM3Hits
maximum fraction of hits in DCM3
CellHitSkimmer(fhicl::ParameterSet const &p)
bool EvaluateSpill(sumdata::SpillData const &spillData)
std::vector< KeptSliceInfo > const & SlicesToKeep()
Definition: Evaluator.h:68
novadaq::cnv::DetId fDetId
detector id for the current run
int goodspills
Definition: POTSum.h:31
ProductID put(std::unique_ptr< PROD > &&)
int fMaxMissingDCMS
maximum number of DCMs allowed to be missing in the ND
bool filter(art::Event &e) override
TRandom3 r(0)
int totspills
Definition: POTSum.h:30
#define LOG_VERBATIM(category)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
DataEpoch GetDataEpoch()
Definition: RunHistory.h:484
int GoodDiBlockMask(int subrun=-1, bool reload=false)
double totgoodpot
normalized by 10^12 POT
Definition: POTSum.h:28
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.h:77
virtual size_t CheckSlices()=0
bool beginRun(art::Run &r) override
CellHitSkimmer & operator=(CellHitSkimmer const &)=delete
double totpot
normalized by 10^12 POT
Definition: POTSum.h:27
EventID id() const
Definition: Event.h:56
Encapsulate the geometry of one entire detector (near, far, ndos)
bool endSubRun(art::SubRun &sr) override
static constexpr Double_t sr
Definition: Munits.h:164