All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
filter::FilterNumberTPCHits Class Reference
Inheritance diagram for filter::FilterNumberTPCHits:

Public Member Functions

 FilterNumberTPCHits (fhicl::ParameterSet const &)
 
bool filter (art::Event &evt) override
 

Private Attributes

std::vector< art::InputTag > fHitDataLabelVec
 
unsigned int fMaximumHits
 

Detailed Description

Definition at line 21 of file FilterNumberTPCHits_module.cc.

Constructor & Destructor Documentation

filter::FilterNumberTPCHits::FilterNumberTPCHits ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 38 of file FilterNumberTPCHits_module.cc.

39  : EDFilter{pset}
40 {
41  fHitDataLabelVec = pset.get<std::vector<art::InputTag>>("HitDataLabelVec", {""});
42  fMaximumHits = pset.get<unsigned int >("MaximumHits", 800000u);
43 
44  return;
45 }
std::vector< art::InputTag > fHitDataLabelVec

Member Function Documentation

bool filter::FilterNumberTPCHits::filter ( art::Event &  evt)
override

Definition at line 47 of file FilterNumberTPCHits_module.cc.

48 {
49  bool filterPass = true;
50 
51  for(auto const& hitDataLabel : fHitDataLabelVec)
52  {
53  auto const& hitData = event.getProduct<std::vector<recob::Hit>>(hitDataLabel);
54 
55 // std::cout << "FilterNumberTPCHits: label: " << hitDataLabel << " has " << hitData.size() << " hits (rejection is " << fMaximumHits << ")" << std::endl;
56 
57  if (hitData.size() > fMaximumHits)
58  {
59  mf::LogInfo log("FilterNumberTPCHits");
60  log << "******************************************************\n" << "Rejecting event for "
61  << "***** " << hitDataLabel << " with " << hitData.size() << " hits ******\n"
62  << "******************************************************";
63 
64  filterPass = false;
65  break;
66  }
67  }
68 
69  return filterPass;
70 }
std::vector< art::InputTag > fHitDataLabelVec

Member Data Documentation

std::vector<art::InputTag> filter::FilterNumberTPCHits::fHitDataLabelVec
private

Definition at line 30 of file FilterNumberTPCHits_module.cc.

unsigned int filter::FilterNumberTPCHits::fMaximumHits
private

Definition at line 31 of file FilterNumberTPCHits_module.cc.


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