Public Types | Public Member Functions | Static 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::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::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)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

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

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

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

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

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

Definition at line 38 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  {
53  this->reconfigure(p);
54  }
virtual void reconfigure(fhicl::ParameterSet const &p)
const char * p
Definition: xmltok.h:285
comi::CanaFilter::~CanaFilter ( )
virtual

Definition at line 88 of file CanaFilter_module.cc.

88 { }

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
bool comi::CanaFilter::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 92 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.

93  {
95  evt.getByLabel(fCanaLabel, nth);
96 
97  bool isgoodtrk = false;
98  bool isgoodevt = false;
99 
100  for (unsigned int i=0; i<nth->size(); ++i) {
101  const CanaNt& nt = (*nth)[i];
102  //
103  // Check if this is a good track. Good events will have at least
104  // one good track in them
105  //
106  isgoodtrk = true;
107 
108  //
109  // Apply correct timing cuts for this trigger source. The magic
110  // numbers are 0 for NuMI, 1 for BNB and 2 for calibration
111  // triggers
112  // Eventually try to use TRIGBITs from TriggerDefines.h
113  // but the numbers don't match??
114  //
115  if (nt.trgsrc==0) {
116  if (nt.tave<fT1CutNuMI) isgoodtrk = false;
117  if (nt.tave>fT2CutNuMI) isgoodtrk = false;
118  }
119  else if (nt.trgsrc==1) {
120  if (nt.tave<fT1CutBNB) isgoodtrk = false;
121  if (nt.tave>fT2CutBNB) isgoodtrk = false;
122  }
123  else if (nt.trgsrc==2) {
124  if (nt.tave<fT1CutCAL) isgoodtrk = false;
125  if (nt.tave>fT2CutCAL) isgoodtrk = false;
126  }
127  else {
128  std::cerr << __FILE__ << ":" << __LINE__
129  << " Unknown trigger source id=" << nt.trgsrc
130  << std::endl;
131  return false;
132  }
133 
134  //
135  // Ask for required number of hits in each view
136  //
137  if (nt.nhitx<fNhitXcut) isgoodtrk = false;
138  if (nt.nhity<fNhitYcut) isgoodtrk = false;
139 
140  //
141  // Ask for required number of planes crossed in each view
142  //
143  if ((abs(nt.plane2x-nt.plane1x))<fNplaneX) isgoodtrk = false;
144  if ((abs(nt.plane2y-nt.plane1y))<fNplaneY) isgoodtrk = false;
145 
146  //
147  // Require track start point (assumed down-going) to be inside the
148  // defined fiducial volume
149  //
150  if (nt.x1<fXlo) isgoodtrk = false;
151  if (nt.x1>fXhi) isgoodtrk = false;
152  if (nt.y1>fYhi) isgoodtrk = false;
153  if (nt.z1<fZlo) isgoodtrk = false;
154  if (nt.z1>fZhi) isgoodtrk = false;
155 
156  isgoodevt |= isgoodtrk;
157  }
158  return isgoodevt;
159  }
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
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void comi::CanaFilter::reconfigure ( fhicl::ParameterSet const &  p)
virtual

Definition at line 58 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().

59  {
60  fT1CutNuMI = p.get<float>("T1CutNuMI");
61  fT2CutNuMI = p.get<float>("T2CutNuMI");
62 
63  fT1CutBNB = p.get<float>("T1CutBNB");
64  fT2CutBNB = p.get<float>("T2CutBNB");
65 
66  fT1CutCAL = p.get<float>("T1CutCAL");
67  fT2CutCAL = p.get<float>("T2CutCAL");
68 
69  fNhitXcut = p.get<int>("NhitXcut");
70  fNhitYcut = p.get<int>("NhitYcut");
71 
72  fNplaneX = p.get<int>("NplaneX");
73  fNplaneY = p.get<int>("NplaneY");
74 
75  fXlo = p.get<float>("Xlo");
76  fXhi = p.get<float>("Xhi");
77 
78  fYhi = p.get<float>("Yhi");
79 
80  fZlo = p.get<float>("Zlo");
81  fZhi = p.get<float>("Zhi");
82 
83  fCanaLabel = p.get<std::string>("CanaLabel", "cana");
84  }
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::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.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::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

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


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