CRVFilter_module.cc
Go to the documentation of this file.
7 
8 #include "RecoBase/Cluster.h"
9 
10 namespace evgen
11 {
12  class CRVFilter: public art::EDFilter
13  {
14  public:
15  explicit CRVFilter(const fhicl::ParameterSet& pset);
16  ~CRVFilter();
17 
18  bool filter(art::Event& evt);
19 
20  void reconfigure(const fhicl::ParameterSet& pset);
21 
22  private:
25  };
26 }
27 
28 
29 ////////////////////////////////////////////////////////////////////////
30 
31 namespace evgen
32 {
33  //......................................................................
35  fCheckSlice(0)
36  {
37  reconfigure(pset);
38  }
39 
40  //......................................................................
42  {
43  }
44 
45  //......................................................................
47  {
48  fSliceLabel = pset.get<std::string>("SliceLabel");
49  fCheckSlice = pset.get< bool >("CheckSlice");
50  }
51  //......................................................................
53  {
54  const class rb::Cluster slice;
55  if(fCheckSlice){
57  evt.getByLabel(fSliceLabel,slices);
58 
59  //slice = *slices.at(0);
60  // Filter if no rawdata info
61  if(slices.failedToGet()) {
62  mf::LogError("CRVFilter") << "No Cluster object. \n";
63  return false;
64  }
65  // Filter if rawdata info is empty
66  if(slices->empty()) {
67  mf::LogError("CRVFilter") << "Empty Cluster object. \n";
68  return false;
69  }
70  }
71  // Pass if there are Truth particles of course
72  // after all subsequent checks
73  return true;
74  }
75 } // namespace
76 
77 ////////////////////////////////////////////////////////////////////////
78 namespace evgen
79 {
81 }
void reconfigure(const fhicl::ParameterSet &pset)
A collection of associated CellHits.
Definition: Cluster.h:47
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
T get(std::string const &key) const
Definition: ParameterSet.h:231
int evt
CRVFilter(const fhicl::ParameterSet &pset)
std::string fSliceLabel
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
bool filter(art::Event &evt)
Module to generate only pions from cosmic rays.
bool failedToGet() const
Definition: Handle.h:196
enum BeamMode string