HighADCFilter_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: HighADCFilter
3 // Module Type: producer
4 // File: HighADCFilter_module.cc
5 //
6 ////////////////////////////////////////////////////////////////////////
7 
13 
18 
19 #include <string>
20 #include <algorithm>
21 
22 namespace novaddt {
23  class HighADCFilter;
24 }
25 
27 public:
28  explicit HighADCFilter(fhicl::ParameterSet const & p);
29  virtual ~HighADCFilter();
31  virtual bool filter(art::Event & e);
32 
33 private:
36 
38  // Declare member data here.
39 
40 };
41 
42 
44 :
45 _hitslabel (p.get< std::string >("hits_label")),
46 _instance (p.get< std::string >("instance" )),
47 _ADCmin (p.get< int >("ADC_min" )),
48 _ADCmax (p.get< int >("ADC_max" ))
49 // Initialize member data here.
50 {
51  // Call appropriate Produces<>() functions here.
52  produces<HitList>("HEHits");
53 }
54 
56 {
57  // Clean up dynamic memory and other resources here.
58 }
59 
61 {
64  HitList hl;
65 
66  for (auto hit: *hits) {
67  // std::cout<<hit.ADC().val<<std::endl;
68  if (hit.ADC().val>_ADCmin && hit.ADC().val<_ADCmax)
69  hl.emplace_back(hit);
70  }
71 
72  std::unique_ptr<HitList> product(new HitList(hl));
73  e.put(std::move(product),"HEHits");
74  return true;
75 }
76 
77 
HighADCFilter(fhicl::ParameterSet const &p)
std::vector< DAQHit > HitList
Definition: HitList.h:15
const char * p
Definition: xmltok.h:285
DEFINE_ART_MODULE(TestTMapFile)
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void hits()
Definition: readHits.C:15
GroupedHitList< TDC > MakeSlice(HitList hits)
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
T product(std::vector< T > dims)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: event.h:1
virtual bool filter(art::Event &e)
Float_t e
Definition: plot.C:35