Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
comi::CanaFilter Class Reference
Inheritance diagram for comi::CanaFilter:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 

Public Member Functions

 CanaFilter (fhicl::ParameterSet const &p)
 
virtual ~CanaFilter ()
 
virtual void reconfigure (fhicl::ParameterSet const &p)
 
virtual bool filter (art::Event &e)
 
std::string workerType () const
 
void doBeginJob ()
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< TconsumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< TmayConsumeView (InputTag const &tag)
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

std::string fCanaLabel
 Label of the Cana module instance. More...
 
float fT1CutNuMI
 [usec] Low edge of NuMI time window More...
 
float fT2CutNuMI
 [usec] High edge of NuMI time window More...
 
float fT1CutBNB
 [usec] Low edge of BNB time window More...
 
float fT2CutBNB
 [usec] High edge of BNB time window More...
 
float fT1CutCAL
 [usec] Accept events inside calibration time window More...
 
float fT2CutCAL
 [usec] Accept events inside calibration time window More...
 
int fNhitXcut
 Require at least this many hits in the window. More...
 
int fNhitYcut
 Require at least this many hits in the window. More...
 
int fNplaneX
 Require size of event to be at least this long. More...
 
int fNplaneY
 Require size of event to be at least this long. More...
 
float fXlo
 Low edge of "fiducial volume" to select. More...
 
float fXhi
 High edge of "fiducial volume" to select. More...
 
float fYhi
 High edge of "fiducial volume" to select. More...
 
float fZlo
 Low edge of "fiducial volume" to select. More...
 
float fZhi
 High edge of "fiducial volume" to select. More...
 

Detailed Description

Definition at line 20 of file CanaFilter_module.cc.

Member Typedef Documentation

Definition at line 19 of file EDFilter.h.

template<typename UserConfig >
using art::detail::Filter::Table = Modifier::Table<UserConfig>
inherited

Definition at line 29 of file Filter.h.

using art::EDFilter::WorkerType = WorkerT<EDFilter>
inherited

Definition at line 20 of file EDFilter.h.

Constructor & Destructor Documentation

comi::CanaFilter::CanaFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 51 of file CanaFilter_module.cc.

References reconfigure().

52  : EDFilter(p)
53  {
54  this->reconfigure(p);
55  }
virtual void reconfigure(fhicl::ParameterSet const &p)
const char * p
Definition: xmltok.h:285
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:22
comi::CanaFilter::~CanaFilter ( )
virtual

Definition at line 89 of file CanaFilter_module.cc.

89 { }

Member Function Documentation

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 55 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumes(), T, and getGoodRuns4SAM::tag.

56  {
57  return collector_.consumes<T, BT>(tag);
58  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ProductToken< T > consumes(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ConsumesCollector& art::ModuleBase::consumesCollector ( )
protectedinherited
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 69 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumesMany(), and T.

70  {
71  collector_.consumesMany<T, BT>();
72  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 62 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumesView(), T, and getGoodRuns4SAM::tag.

63  {
64  return collector_.consumesView<T, BT>(tag);
65  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > consumesView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
void art::detail::Filter::doBeginJob ( )
inherited
bool art::detail::Filter::doBeginRun ( RunPrincipal rp,
ModuleContext const &   
)
inherited
bool art::detail::Filter::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
void art::detail::Filter::doEndJob ( )
inherited
bool art::detail::Filter::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Filter::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Filter::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited
void art::detail::Filter::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited
void art::detail::Filter::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited
bool comi::CanaFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 93 of file CanaFilter_module.cc.

References abs(), om::cerr, DEFINE_ART_MODULE(), allTimeWatchdog::endl, fCanaLabel, fNhitXcut, fNhitYcut, fNplaneX, fNplaneY, fT1CutBNB, fT1CutCAL, fT1CutNuMI, fT2CutBNB, fT2CutCAL, fT2CutNuMI, fXhi, fXlo, fYhi, fZhi, fZlo, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, comi::CanaNt::nhitx, comi::CanaNt::nhity, nt, comi::CanaNt::plane1x, comi::CanaNt::plane1y, comi::CanaNt::plane2x, comi::CanaNt::plane2y, comi::CanaNt::tave, comi::CanaNt::trgsrc, comi::CanaNt::x1, comi::CanaNt::y1, and comi::CanaNt::z1.

94  {
96  evt.getByLabel(fCanaLabel, nth);
97 
98  bool isgoodtrk = false;
99  bool isgoodevt = false;
100 
101  for (unsigned int i=0; i<nth->size(); ++i) {
102  const CanaNt& nt = (*nth)[i];
103  //
104  // Check if this is a good track. Good events will have at least
105  // one good track in them
106  //
107  isgoodtrk = true;
108 
109  //
110  // Apply correct timing cuts for this trigger source. The magic
111  // numbers are 0 for NuMI, 1 for BNB and 2 for calibration
112  // triggers
113  // Eventually try to use TRIGBITs from TriggerDefines.h
114  // but the numbers don't match??
115  //
116  if (nt.trgsrc==0) {
117  if (nt.tave<fT1CutNuMI) isgoodtrk = false;
118  if (nt.tave>fT2CutNuMI) isgoodtrk = false;
119  }
120  else if (nt.trgsrc==1) {
121  if (nt.tave<fT1CutBNB) isgoodtrk = false;
122  if (nt.tave>fT2CutBNB) isgoodtrk = false;
123  }
124  else if (nt.trgsrc==2) {
125  if (nt.tave<fT1CutCAL) isgoodtrk = false;
126  if (nt.tave>fT2CutCAL) isgoodtrk = false;
127  }
128  else {
129  std::cerr << __FILE__ << ":" << __LINE__
130  << " Unknown trigger source id=" << nt.trgsrc
131  << std::endl;
132  return false;
133  }
134 
135  //
136  // Ask for required number of hits in each view
137  //
138  if (nt.nhitx<fNhitXcut) isgoodtrk = false;
139  if (nt.nhity<fNhitYcut) isgoodtrk = false;
140 
141  //
142  // Ask for required number of planes crossed in each view
143  //
144  if ((abs(nt.plane2x-nt.plane1x))<fNplaneX) isgoodtrk = false;
145  if ((abs(nt.plane2y-nt.plane1y))<fNplaneY) isgoodtrk = false;
146 
147  //
148  // Require track start point (assumed down-going) to be inside the
149  // defined fiducial volume
150  //
151  if (nt.x1<fXlo) isgoodtrk = false;
152  if (nt.x1>fXhi) isgoodtrk = false;
153  if (nt.y1>fYhi) isgoodtrk = false;
154  if (nt.z1<fZlo) isgoodtrk = false;
155  if (nt.z1>fZhi) isgoodtrk = false;
156 
157  isgoodevt |= isgoodtrk;
158  }
159  return isgoodevt;
160  }
int fNhitYcut
Require at least this many hits in the window.
float fZhi
High edge of "fiducial volume" to select.
float fXhi
High edge of "fiducial volume" to select.
OStream cerr
Definition: OStream.cxx:7
void abs(TH1 *hist)
float fT1CutCAL
[usec] Accept events inside calibration time window
int fNhitXcut
Require at least this many hits in the window.
int fNplaneY
Require size of event to be at least this long.
float fT2CutCAL
[usec] Accept events inside calibration time window
int evt
std::string fCanaLabel
Label of the Cana module instance.
float fXlo
Low edge of "fiducial volume" to select.
float fT2CutNuMI
[usec] High edge of NuMI time window
int fNplaneX
Require size of event to be at least this long.
float fT1CutNuMI
[usec] Low edge of NuMI time window
float fYhi
High edge of "fiducial volume" to select.
float fZlo
Low edge of "fiducial volume" to select.
TNtuple * nt
Definition: drawXsec.C:2
float fT1CutBNB
[usec] Low edge of BNB time window
float fT2CutBNB
[usec] High edge of BNB time window
std::array<std::vector<ProductInfo>, NumBranchTypes> const& art::ModuleBase::getConsumables ( ) const
inherited
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 76 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsume(), T, and getGoodRuns4SAM::tag.

77  {
78  return collector_.mayConsume<T, BT>(tag);
79  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 90 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsumeMany(), and T.

91  {
93  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 83 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsumeView(), T, and getGoodRuns4SAM::tag.

84  {
85  return collector_.mayConsumeView<T, BT>(tag);
86  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > mayConsumeView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ModuleDescription const& art::ModuleBase::moduleDescription ( ) const
inherited
void comi::CanaFilter::reconfigure ( fhicl::ParameterSet const &  p)
virtual

Definition at line 59 of file CanaFilter_module.cc.

References fCanaLabel, fNhitXcut, fNhitYcut, fNplaneX, fNplaneY, fT1CutBNB, fT1CutCAL, fT1CutNuMI, fT2CutBNB, fT2CutCAL, fT2CutNuMI, fXhi, fXlo, fYhi, fZhi, fZlo, fhicl::ParameterSet::get(), and string.

Referenced by CanaFilter().

60  {
61  fT1CutNuMI = p.get<float>("T1CutNuMI");
62  fT2CutNuMI = p.get<float>("T2CutNuMI");
63 
64  fT1CutBNB = p.get<float>("T1CutBNB");
65  fT2CutBNB = p.get<float>("T2CutBNB");
66 
67  fT1CutCAL = p.get<float>("T1CutCAL");
68  fT2CutCAL = p.get<float>("T2CutCAL");
69 
70  fNhitXcut = p.get<int>("NhitXcut");
71  fNhitYcut = p.get<int>("NhitYcut");
72 
73  fNplaneX = p.get<int>("NplaneX");
74  fNplaneY = p.get<int>("NplaneY");
75 
76  fXlo = p.get<float>("Xlo");
77  fXhi = p.get<float>("Xhi");
78 
79  fYhi = p.get<float>("Yhi");
80 
81  fZlo = p.get<float>("Zlo");
82  fZhi = p.get<float>("Zhi");
83 
84  fCanaLabel = p.get<std::string>("CanaLabel", "cana");
85  }
int fNhitYcut
Require at least this many hits in the window.
float fZhi
High edge of "fiducial volume" to select.
float fXhi
High edge of "fiducial volume" to select.
const char * p
Definition: xmltok.h:285
float fT1CutCAL
[usec] Accept events inside calibration time window
int fNhitXcut
Require at least this many hits in the window.
int fNplaneY
Require size of event to be at least this long.
float fT2CutCAL
[usec] Accept events inside calibration time window
std::string fCanaLabel
Label of the Cana module instance.
float fXlo
Low edge of "fiducial volume" to select.
float fT2CutNuMI
[usec] High edge of NuMI time window
int fNplaneX
Require size of event to be at least this long.
float fT1CutNuMI
[usec] Low edge of NuMI time window
float fYhi
High edge of "fiducial volume" to select.
float fZlo
Low edge of "fiducial volume" to select.
float fT1CutBNB
[usec] Low edge of BNB time window
float fT2CutBNB
[usec] High edge of BNB time window
enum BeamMode string
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  )
inherited
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited
std::string art::EDFilter::workerType ( ) const
inherited

Referenced by art::EDFilter::EDFilter().

Member Data Documentation

constexpr bool art::detail::Filter::Fail {false}
staticinherited

Definition at line 26 of file Filter.h.

Referenced by evgen::GENIEFilter::filter().

std::string comi::CanaFilter::fCanaLabel
private

Label of the Cana module instance.

Definition at line 31 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

int comi::CanaFilter::fNhitXcut
private

Require at least this many hits in the window.

Definition at line 38 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

int comi::CanaFilter::fNhitYcut
private

Require at least this many hits in the window.

Definition at line 39 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

int comi::CanaFilter::fNplaneX
private

Require size of event to be at least this long.

Definition at line 40 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

int comi::CanaFilter::fNplaneY
private

Require size of event to be at least this long.

Definition at line 41 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT1CutBNB
private

[usec] Low edge of BNB time window

Definition at line 34 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT1CutCAL
private

[usec] Accept events inside calibration time window

Definition at line 36 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT1CutNuMI
private

[usec] Low edge of NuMI time window

Definition at line 32 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT2CutBNB
private

[usec] High edge of BNB time window

Definition at line 35 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT2CutCAL
private

[usec] Accept events inside calibration time window

Definition at line 37 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fT2CutNuMI
private

[usec] High edge of NuMI time window

Definition at line 33 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fXhi
private

High edge of "fiducial volume" to select.

Definition at line 43 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fXlo
private

Low edge of "fiducial volume" to select.

Definition at line 42 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fYhi
private

High edge of "fiducial volume" to select.

Definition at line 44 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fZhi
private

High edge of "fiducial volume" to select.

Definition at line 46 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

float comi::CanaFilter::fZlo
private

Low edge of "fiducial volume" to select.

Definition at line 45 of file CanaFilter_module.cc.

Referenced by filter(), and reconfigure().

constexpr bool art::detail::Filter::Pass {true}
staticinherited

Definition at line 25 of file Filter.h.

Referenced by evgen::GENIEFilter::filter().


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