Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
filter::Filter Class Reference

Filter events based on simple expressions. More...

Inheritance diagram for filter::Filter:
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

 Filter (const fhicl::ParameterSet &pset)
 
 ~Filter ()
 
bool filter (art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
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

void FillTruthVariables (const art::Event &evt, double *vars) const
 
void FillDigitVariables (const art::Event &evt, double *vars) const
 
void FillG4GenVariables (const art::Event &evt, double *vars) const
 
void FillSliceVariables (const art::Event &evt, double *vars) const
 
void FillTrackVariables (const art::Event &evt, double *vars) const
 
bool isVertexInFiducial (const rb::Track &trk) const
 
CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

TFormula * fFormula
 
std::string fGenLabel
 Default "generator". More...
 
std::string fG4GenLabel
 Default "geantgen". More...
 
std::string fCellHitLabel
 Default "daq". More...
 
std::string fSlicerLabel
 Default "slicer". More...
 
std::string fTrackLabel
 Default "kalmantrack". More...
 

Detailed Description

Filter events based on simple expressions.

Definition at line 57 of file Filter_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

filter::Filter::Filter ( const fhicl::ParameterSet pset)
explicit

Definition at line 88 of file Filter_module.cc.

References reconfigure().

89  : fFormula(0)
90  {
91  reconfigure(pset);
92  }
void reconfigure(const fhicl::ParameterSet &pset)
TFormula * fFormula
filter::Filter::~Filter ( )

Definition at line 95 of file Filter_module.cc.

References fFormula.

96  {
97  delete fFormula;
98  }
TFormula * fFormula

Member Function Documentation

void filter::Filter::beginJob ( )
virtual

Reimplemented from art::EDFilter.

Definition at line 139 of file Filter_module.cc.

140  {
141  }
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
void filter::Filter::FillDigitVariables ( const art::Event evt,
double *  vars 
) const
protected

Definition at line 201 of file Filter_module.cc.

References rawdata::RawDigit::ADC(), art::Handle< T >::failedToGet(), fCellHitLabel, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, filter::kNhit, filter::kTotAdc, and demo1::nhit.

Referenced by filter().

202  {
203  double totadc = 0;
204  // get the RawDigit list
206  evt.getByLabel(fCellHitLabel, digitcol);
207  if(digitcol.failedToGet()) return;
208 
209  const unsigned int nhit = digitcol->size();
210  for(unsigned int i = 0; i < nhit; ++i){
211  art::Ptr<rb::CellHit> ch(digitcol, i);
212  totadc += ch->ADC();
213  }
214 
215  vars[kNhit] = nhit;
216  vars[kTotAdc] = totadc;
217  }
Total ADC in the event.
Total number of hits in the event.
nhit
Definition: demo1.py:25
std::string fCellHitLabel
Default "daq".
const std::map< std::pair< std::string, std::string >, Variable > vars
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool failedToGet() const
Definition: Handle.h:196
void filter::Filter::FillG4GenVariables ( const art::Event evt,
double *  vars 
) const
protected

Definition at line 221 of file Filter_module.cc.

References art::Handle< T >::failedToGet(), fG4GenLabel, art::DataViewImpl::getByLabel(), filter::kNFLShit, and demo1::nhit.

Referenced by filter().

222  {
223  // get the FLSHit list
225  evt.getByLabel(fG4GenLabel, FLScol);
226  if (FLScol.failedToGet()) return;
227 
228  const unsigned int nhit = FLScol->size();
229  vars[kNFLShit] = nhit;
230  }
nhit
Definition: demo1.py:25
std::string fG4GenLabel
Default "geantgen".
const std::map< std::pair< std::string, std::string >, Variable > vars
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool failedToGet() const
Definition: Handle.h:196
void filter::Filter::FillSliceVariables ( const art::Event evt,
double *  vars 
) const
protected

Definition at line 233 of file Filter_module.cc.

References art::Handle< T >::failedToGet(), fSlicerLabel, art::DataViewImpl::getByLabel(), rb::Cluster::IsNoise(), filter::kNSlice, filter::kSliceNXHit, filter::kSliceNYHit, rb::Cluster::NCell(), rb::Cluster::NXCell(), and rb::Cluster::NYCell().

Referenced by filter().

234  {
236  evt.getByLabel(fSlicerLabel, slices);
237  if(slices.failedToGet()) return;
238 
239  const unsigned int sliceMax = slices->size();
240  vars[kNSlice] = sliceMax;
241 
242  // Record the properties of the biggest non-noise slice
243  unsigned int most = 0;
244  for(unsigned int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
245  const rb::Cluster& slice = (*slices)[sliceIdx];
246  if(slice.IsNoise()) continue;
247  if(slice.NCell() > most){
248  most = slice.NCell();
249  vars[kSliceNXHit] = slice.NXCell();
250  vars[kSliceNYHit] = slice.NYCell();
251  }
252  } // end for sliceIdx
253  }
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
A collection of associated CellHits.
Definition: Cluster.h:47
Total number of slices in the event (including noise slice)
std::string fSlicerLabel
Default "slicer".
Number of hits in X view of the biggest physics slice.
const std::map< std::pair< std::string, std::string >, Variable > vars
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
bool failedToGet() const
Definition: Handle.h:196
Number of hits in X view of the biggest physics slice.
void filter::Filter::FillTrackVariables ( const art::Event evt,
double *  vars 
) const
protected

Definition at line 256 of file Filter_module.cc.

References dir, rb::Prong::Dir(), art::Handle< T >::failedToGet(), fTrackLabel, art::DataViewImpl::getByLabel(), isVertexInFiducial(), filter::kVertexInFiducial, and util::pythag().

Referenced by filter().

257  {
259  evt.getByLabel(fTrackLabel, trk);
260  if(trk.failedToGet()) return;
261 
262  unsigned int trkMax = trk->size();
263  // Record the properties of tracks inside a defined fiducial volume
264  for(unsigned int trkIdx = 0; trkIdx < trkMax; ++trkIdx){
265  const rb::Track& track = (*trk)[trkIdx];
266  //if(track.ExtentPlane() > 10) return;
267  const TVector3 dir(track.Dir());
268  const double coscosmic = TMath::Abs(-dir.Y()/util::pythag(dir.X(),dir.Y(),dir.Z()));
269  if(coscosmic < 0.7) return;
270  //if(track.TotalLength() > 70) return;
271  const bool check = isVertexInFiducial(track);
272  vars[kVertexInFiducial] = check;
273  } // end for trkIdx
274  }
Definition: event.h:19
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
Track finder for cosmic rays.
std::string fTrackLabel
Default "kalmantrack".
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
const std::map< std::pair< std::string, std::string >, Variable > vars
TDirectory * dir
Definition: macro.C:5
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
bool isVertexInFiducial(const rb::Track &trk) const
bool failedToGet() const
Definition: Handle.h:196
Is track vertex (start position) inside the fiducial volume defined in filter.
void filter::Filter::FillTruthVariables ( const art::Event evt,
double *  vars 
) const
protected

Fill whether the point is inside fiducial volume

Definition at line 158 of file Filter_module.cc.

References simb::MCNeutrino::CCNC(), geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), dx, dy, dz, simb::MCParticle::E(), stan::math::fabs(), art::Handle< T >::failedToGet(), fGenLabel, geom(), art::DataViewImpl::getByLabel(), simb::MCTruth::GetNeutrino(), cheat::BackTracker::HaveTruthInfo(), simb::MCNeutrino::InteractionType(), geo::GeometryBase::isInsideFiducialVolume(), filter::kCcNc, filter::kEdge, filter::kEnu, filter::kIact, filter::kInsideFiducialVolume, filter::kNEvts, filter::kPdg, filter::kX, filter::kY, filter::kZ, simb::MCNeutrino::Lepton(), std::min(), simb::MCTruth::NeutrinoSet(), simb::MCNeutrino::Nu(), simb::MCParticle::PdgCode(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), simb::MCParticle::Vz(), submit_syst::x, submit_syst::y, and test::z.

Referenced by filter().

159  {
161  if( !bt->HaveTruthInfo() ) return;
162 
164  evt.getByLabel(fGenLabel, mcTruths);
165  if(mcTruths.failedToGet()) return;
166 
167  vars[kNEvts] = mcTruths->size();
168  // Abort if no truth info (data?)
169  if(mcTruths->empty()) return;
170  // If there are two events, take the first one...
171  simb::MCTruth mcTruth = (*mcTruths)[0];
172  // Abort if not a neutrino-induced event (cosmics?)
173  if(!mcTruth.NeutrinoSet()) return;
174 
175  const simb::MCNeutrino& nu = mcTruth.GetNeutrino();
176  vars[kCcNc] = nu.CCNC();
177  vars[kIact] = nu.InteractionType();
178 
179  const simb::MCParticle& nupart = nu.Nu();
180  vars[kPdg] = nupart.PdgCode();
181  vars[kEnu] = nupart.E();
182 
183  const simb::MCParticle& lept = nu.Lepton();
184  const double x = lept.Vx();
185  const double y = lept.Vy();
186  const double z = lept.Vz();
187  vars[kX] = x; vars[kY] = y; vars[kZ] = z;
188 
190  const double dx = geom->DetHalfWidth()-fabs(x); // If outside, then dx is negative
191  const double dy = geom->DetHalfHeight()-fabs(y); // If outside, then dy is negative
192  const double dz = 0.5*geom->DetLength() - fabs(z + 0.5*geom->DetLength());// If outside, then dz is negative
193  const double kEdge_mod = std::min(std::min(fabs(dx), fabs(dy)), fabs(dz));// minimum of the absolute values
194  vars[kEdge] = (dx < 0.0 || dy <0.0 || dz<0.0) ? -kEdge_mod : kEdge_mod; // If outside, then kEdge is negative
195 
196  /// Fill whether the point is inside fiducial volume
197  vars[kInsideFiducialVolume] = geom->isInsideFiducialVolume(x, y, z) ? 1.0 : 0.0;
198  }
double E(const int i=0) const
Definition: MCParticle.h:232
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:76
Is event inside fiducial volume? (fiducial volume is defined in Geometry.fcl)
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
Number of true neutrino interactions.
Value of Nu().CCNC()
True neutrino energy (GeV)
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
double DetLength() const
Distance to detector edge (cm)
int InteractionType() const
Definition: MCNeutrino.h:150
std::string fGenLabel
Default "generator".
double dy[NP][NC]
double dx[NP][NC]
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
double dz[NP][NC]
True vertex y position (cm)
const std::map< std::pair< std::string, std::string >, Variable > vars
double DetHalfHeight() const
Value of Nu().InteractionType()
z
Definition: test.py:28
double Vx(const int i=0) const
Definition: MCParticle.h:220
True vertex x position (cm)
double DetHalfWidth() const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void geom(int which=0)
Definition: geom.C:163
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
Definition: BackTracker.h:133
double Vz(const int i=0) const
Definition: MCParticle.h:222
bool NeutrinoSet() const
Definition: MCTruth.h:77
Event generator information.
Definition: MCTruth.h:32
T min(const caf::Proxy< T > &a, T b)
True vertex z position (cm)
Event generator information.
Definition: MCNeutrino.h:18
double Vy(const int i=0) const
Definition: MCParticle.h:221
PDG code of the neutrino.
bool isInsideFiducialVolume(const double x_cm, const double y_cm, const double z_cm) const
Is the particle inside the detector Fiducial Volume?
bool failedToGet() const
Definition: Handle.h:196
bool filter::Filter::filter ( art::Event evt)
virtual

Implements art::EDFilter.

Definition at line 144 of file Filter_module.cc.

References fFormula, FillDigitVariables(), FillG4GenVariables(), FillSliceVariables(), FillTrackVariables(), FillTruthVariables(), filter::kNumPars, and vars.

145  {
146  double vars[kNumPars] = {0};
147 
148  FillTruthVariables(evt, vars);
149  FillG4GenVariables(evt, vars);
150  FillDigitVariables(evt, vars);
151  FillSliceVariables(evt, vars);
152  FillTrackVariables(evt, vars);
153 
154  return fFormula->EvalPar(0, vars);
155  }
void FillTrackVariables(const art::Event &evt, double *vars) const
TFormula * fFormula
void FillSliceVariables(const art::Event &evt, double *vars) const
void FillDigitVariables(const art::Event &evt, double *vars) const
const std::map< std::pair< std::string, std::string >, Variable > vars
void FillG4GenVariables(const art::Event &evt, double *vars) const
void FillTruthVariables(const art::Event &evt, double *vars) const
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  }
bool filter::Filter::isVertexInFiducial ( const rb::Track trk) const
protected

Definition at line 276 of file Filter_module.cc.

References ana::assert(), DEFINE_ART_MODULE(), geo::GeometryBase::DetId(), stan::math::fabs(), geom(), novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, febshutoff_auto::start, rb::Prong::Start(), rb::Track::Stop(), submit_syst::x, submit_syst::y, and test::z.

Referenced by FillTrackVariables().

277  {
278  // Start and end don't mean much, pick whichever is highest in y.
279 
280  const TVector3 v1 = trk.Start();
281  const TVector3 v2 = trk.Stop();
282  // assume down-going in order to reject cosmics
283  const TVector3 start = (v1.Y() > v2.Y()) ? v1 : v2;
284  //const TVector3 start = v1;
285 
286  const double x = start.X();
287  const double y = start.Y();
288  const double z = start.Z();
289 
291 
292 
293  switch(geom->DetId()){
294  case novadaq::cnv::kNDOS:
296  if(fabs(x) > 115) return false; // Fiducial X
297  if(fabs(y) > 150) return false; // Fiducial Y
298  if(z < 50 || z > 770) return false; // Fiducial Z
299 
300  if(v1.X()==v2.X()||v1.Y()==v2.Y()) return false; // dx or dy = 0 means bad fit
301  break;
303  if(fabs(x) > 730 || fabs(y) > 730) return false;
304  if(z < 50 || z > 6300) return false;
305 
306  if(v1.X()==v2.X()||v1.Y()==v2.Y()) return false;
307  break;
308  default:
309  assert(0 && "Unknown detector");
310  }
311 
312  return true;
313  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
virtual TVector3 Start() const
Definition: Prong.h:73
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
Near Detector in the NuMI cavern.
z
Definition: test.py:28
void geom(int which=0)
Definition: geom.C:163
assert(nhit_max >=nhit_nbins)
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
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 filter::Filter::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 107 of file Filter_module.cc.

References filter::compareBySecondLength(), fCellHitLabel, fFormula, fG4GenLabel, fGenLabel, genie::utils::style::Format(), fSlicerLabel, fTrackLabel, fhicl::ParameterSet::get(), filter::kNumPars, getGoodRuns4SAM::n, moon_position_table_new3::second, and string.

Referenced by Filter().

108  {
109  fGenLabel = pset.get<std::string>("GeneratorModuleLabel", "generator");
110  fG4GenLabel = pset.get<std::string>("G4GenModuleLabel", "geantgen");
111  fCellHitLabel = pset.get<std::string>("CalHitModuleLabel", "calhit");
112  fSlicerLabel = pset.get<std::string>("SlicerModuleLabel", "slicer");
113  fTrackLabel = pset.get<std::string>("TrackModuleLabel", "kalmantrack");
114 
115  TString expr = pset.get<std::string>("Expression");
116 
117  // Empty string evaluates true
118  if(expr == "") expr = "1";
119 
120  // Need to sort the parameters from longest to shortest string, doing the
121  // replacements in any other order causes everything to go wrong...
122  std::vector<std::pair<int, std::string> > sortedPars;
123  for(int n = 0; n < kNumPars; ++n){
124  sortedPars.emplace_back(n, std::string(kParNames[n]));
125  }
126  std::sort(sortedPars.rbegin(), sortedPars.rend(), compareBySecondLength);
127 
128  // Rewrite the expression with numeric indices in place of variable names
129  for(int n = 0; n < kNumPars; ++n){
130  expr.ReplaceAll(sortedPars[n].second,
131  TString::Format("[%d]", sortedPars[n].first));
132  }
133 
134  delete fFormula;
135  fFormula = new TFormula("form", expr);
136  }
std::string fSlicerLabel
Default "slicer".
TFormula * fFormula
std::string fTrackLabel
Default "kalmantrack".
std::string fGenLabel
Default "generator".
bool compareBySecondLength(const std::pair< int, std::string > &a, const std::pair< int, std::string > &b)
std::string fG4GenLabel
Default "geantgen".
std::string fCellHitLabel
Default "daq".
T get(std::string const &key) const
Definition: ParameterSet.h:231
const TString kParNames[kNumPars]
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
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 filter::Filter::fCellHitLabel
protected

Default "daq".

Definition at line 82 of file Filter_module.cc.

Referenced by FillDigitVariables(), and reconfigure().

TFormula* filter::Filter::fFormula
protected

Definition at line 78 of file Filter_module.cc.

Referenced by filter(), reconfigure(), and ~Filter().

std::string filter::Filter::fG4GenLabel
protected

Default "geantgen".

Definition at line 81 of file Filter_module.cc.

Referenced by FillG4GenVariables(), and reconfigure().

std::string filter::Filter::fGenLabel
protected

Default "generator".

Definition at line 80 of file Filter_module.cc.

Referenced by FillTruthVariables(), and reconfigure().

std::string filter::Filter::fSlicerLabel
protected

Default "slicer".

Definition at line 83 of file Filter_module.cc.

Referenced by FillSliceVariables(), and reconfigure().

std::string filter::Filter::fTrackLabel
protected

Default "kalmantrack".

Definition at line 84 of file Filter_module.cc.

Referenced by FillTrackVariables(), 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: