Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
skim::Evaluator Class Referenceabstract

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-17/AnalysisSkimmer/evaluators/Evaluator.h"

Inheritance diagram for skim::Evaluator:
skim::EvaluatorNue skim::EvaluatorNumu skim::EvaluatorNumuCCpi

Public Member Functions

 Evaluator ()
 
virtual ~Evaluator ()
 
 Evaluator (Evaluator const &)=delete
 
 Evaluator (Evaluator &&)=delete
 
Evaluatoroperator= (Evaluator const &)=delete
 
Evaluatoroperator= (Evaluator &&)=delete
 
virtual void reconfigure (fhicl::ParameterSet const &p)=0
 
virtual bool Initialize (novadaq::cnv::DetId const &detId, art::Event const &e)=0
 
virtual size_t CheckSlices ()=0
 
std::vector< KeptSliceInfo > const & SlicesToKeep ()
 

Protected Member Functions

bool CheckTiming (rb::Cluster const &slice)
 
bool CheckSliceQuality (rb::Cluster const &slice)
 

Protected Attributes

art::ServiceHandle< geo::LiveGeometryfLiveGeom
 the LiveGeometry service More...
 
novadaq::cnv::DetId fDetId
 the id of the detector we are looking at More...
 
std::string fSliceLabel
 label of module creating slices More...
 
std::string fRecordLabel
 label of module creating records More...
 
bool fIsData
 is this data or MC? More...
 
int fCurrentRun
 the current run number More...
 
int fCurrentSubRun
 the current run number More...
 
int fCurrentEvent
 the current run number More...
 
std::vector< KeptSliceInfofKeptSlices
 slices we keep More...
 
std::vector< art::Ptr< rb::Cluster > > fSlicePtrs
 all slices in the spill More...
 

Detailed Description

Definition at line 44 of file Evaluator.h.

Constructor & Destructor Documentation

skim::Evaluator::Evaluator ( )

Definition at line 10 of file Evaluator.cxx.

11 {
12 }
skim::Evaluator::~Evaluator ( )
virtual

Definition at line 15 of file Evaluator.cxx.

16 {
17 }
skim::Evaluator::Evaluator ( Evaluator const &  )
delete
skim::Evaluator::Evaluator ( Evaluator &&  )
delete

Member Function Documentation

bool skim::Evaluator::CheckSliceQuality ( rb::Cluster const &  slice)
protected

Definition at line 73 of file Evaluator.cxx.

References calcFirstLastLivePlane(), fDetId, nova::dbi::RunHistory::GetConfiguration(), nova::dbi::RunHistory::GoodDiBlockMask(), novadaq::cnv::kFARDET, LOG_DEBUG, rb::Cluster::MaxPlane(), rb::Cluster::MinPlane(), and rh.

Referenced by skim::EvaluatorNumuCCpi::CheckSlices(), skim::EvaluatorNue::CheckSlices(), and skim::EvaluatorNumu::CheckSlices().

74 {
75  if(fDetId != novadaq::cnv::kFARDET) return true;
76 
78  unsigned int dibmask = (rh->GoodDiBlockMask()&rh->GetConfiguration());
79  std::bitset<14> binary(dibmask);
80 
81  std::pair<int,int> planesA = calcFirstLastLivePlane(slice.MinPlane(), binary, fDetId);
82  std::pair<int,int> planesB = calcFirstLastLivePlane(slice.MaxPlane(), binary, fDetId);
83 
84  LOG_DEBUG("Evaluator")
85  << "min plane: " << slice.MinPlane() << " max plane: " << slice.MaxPlane()
86  << " " << planesA.first << " " << planesA.second
87  << " " << planesB.first << " " << planesB.second
88  << " " << (planesA.second - planesA.first + 1)/64 << " > 3";
89 
90  if ((planesA.first != planesB.first) || (planesA.second != planesB.second))
91  return false;
92 
93  // 1/64 = 0.015625
94  return ((planesA.second - planesA.first + 1) * 0.015625 > 3);
95 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
novadaq::cnv::DetId fDetId
the id of the detector we are looking at
Definition: Evaluator.h:84
TH2 * rh
Definition: drawXsec.C:5
std::pair< int, int > calcFirstLastLivePlane(int plane, std::bitset< 14 > binary, novadaq::cnv::DetId det)
Definition: Evaluator.cxx:51
Far Detector at Ash River, MN.
int GoodDiBlockMask(int subrun=-1, bool reload=false)
virtual size_t skim::Evaluator::CheckSlices ( )
pure virtual
bool skim::Evaluator::CheckTiming ( rb::Cluster const &  slice)
protected

Definition at line 20 of file Evaluator.cxx.

References fCurrentRun, LOG_DEBUG, and rb::Cluster::MeanTNS().

Referenced by skim::EvaluatorNumuCCpi::CheckSlices(), skim::EvaluatorNue::CheckSlices(), and skim::EvaluatorNumu::CheckSlices().

21 {
22  // look in CAFAna/TimingCuts.h for definitions of the timing constants
23 
24  const double BeamWindowMinMicroSec = 217;
25  const double BeamWindowMaxMicroSec = 229;
26  const double PeakShiftMicroSec = 64;
27  const int LastBadTimingRun = 17945;
28 
29  auto time = slice.MeanTNS();
30 
31  LOG_DEBUG("Evaluator")
32  << "the mean time is " << time
33  << "\ncurrent Run " << fCurrentRun << "/" << LastBadTimingRun
34  << "\nbeam window min " << 1000 * BeamWindowMinMicroSec
35  << "\nbeam window max " << 1000 * BeamWindowMaxMicroSec
36  << "\nbeam offset " << 1000 * PeakShiftMicroSec;
37 
38  if(fCurrentRun <= LastBadTimingRun &&
39  time > 1000 * (BeamWindowMinMicroSec + PeakShiftMicroSec) &&
40  time < 1000 * (BeamWindowMaxMicroSec + PeakShiftMicroSec)) return true;
41 
42  if(time > 1000 * BeamWindowMinMicroSec &&
43  time < 1000 * BeamWindowMaxMicroSec) return true;
44 
45  return false;
46 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
int fCurrentRun
the current run number
Definition: Evaluator.h:88
virtual bool skim::Evaluator::Initialize ( novadaq::cnv::DetId const &  detId,
art::Event const &  e 
)
pure virtual
Evaluator& skim::Evaluator::operator= ( Evaluator const &  )
delete
Evaluator& skim::Evaluator::operator= ( Evaluator &&  )
delete
virtual void skim::Evaluator::reconfigure ( fhicl::ParameterSet const &  p)
pure virtual
std::vector<KeptSliceInfo> const& skim::Evaluator::SlicesToKeep ( )
inline

Definition at line 68 of file Evaluator.h.

Referenced by skim::CellHitSkimmer::EvaluateSlices().

68 { return fKeptSlices; }
std::vector< KeptSliceInfo > fKeptSlices
slices we keep
Definition: Evaluator.h:91

Member Data Documentation

int skim::Evaluator::fCurrentEvent
protected

the current run number

Definition at line 90 of file Evaluator.h.

Referenced by skim::EvaluatorNue::Initialize().

int skim::Evaluator::fCurrentRun
protected
int skim::Evaluator::fCurrentSubRun
protected

the current run number

Definition at line 89 of file Evaluator.h.

Referenced by skim::EvaluatorNue::Initialize().

novadaq::cnv::DetId skim::Evaluator::fDetId
protected
bool skim::Evaluator::fIsData
protected
std::vector< KeptSliceInfo > skim::Evaluator::fKeptSlices
protected
art::ServiceHandle<geo::LiveGeometry> skim::Evaluator::fLiveGeom
protected

the LiveGeometry service

Definition at line 83 of file Evaluator.h.

std::string skim::Evaluator::fRecordLabel
protected

label of module creating records

Definition at line 86 of file Evaluator.h.

Referenced by skim::EvaluatorNumuCCpi::reconfigure(), and skim::EvaluatorNumu::reconfigure().

std::string skim::Evaluator::fSliceLabel
protected

label of module creating slices

Definition at line 85 of file Evaluator.h.

Referenced by skim::EvaluatorNue::Initialize(), and skim::EvaluatorNue::reconfigure().

std::vector< art::Ptr<rb::Cluster> > skim::Evaluator::fSlicePtrs
protected

The documentation for this class was generated from the following files: