EvTimeFilter_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: EvTimeFilter
3 // Module Type: filter
4 // File: EvTimeFilter_module.cc
5 //
6 // Generated at Fri Mar 24 21:33:17 2017 by Andrey Sheshukov using artmod
7 // from cetpkgsupport v1_10_02.
8 ////////////////////////////////////////////////////////////////////////
9 
17 #include "fhiclcpp/ParameterSet.h"
19 
22 #include <memory>
23 
24 class EvTimeFilter;
25 
26 class EvTimeFilter : public art::EDFilter {
27 public:
28  explicit EvTimeFilter(fhicl::ParameterSet const & p);
29  // The destructor generated by the compiler is fine for classes
30  // without bare pointers or other resource use.
31 
32  // Plugins should not be copied or assigned.
33  EvTimeFilter(EvTimeFilter const &) = delete;
34  EvTimeFilter(EvTimeFilter &&) = delete;
35  EvTimeFilter & operator = (EvTimeFilter const &) = delete;
36  EvTimeFilter & operator = (EvTimeFilter &&) = delete;
37 
38  // Required functions.
39  bool filter(art::Event & e) override;
40 
41 
42 private:
43 
44  // Declare member data here.
45 
48 };
49 
50 
52  fHeaderTag (p.get< std::string >("header_tag" )),
53  fHitsTag(p.get<std::string>("hits_tag"))
54 { }
55 
57 {
58  const double msec=64000;
60  double hdr_time = header->timeStart/msec;
61 
63  auto hits_size = Hits->size();
64  double hits_time_0 = hits_size?Hits->front().TDC().val/msec-hdr_time:0;
65  double hits_time_1 = hits_size?Hits->back().TDC().val/msec-hdr_time:0;
66  std::cout.setf(std::ios::fixed);
67  std::cout.precision(2);
68 
69  std::cout
70  <<header->eventNumber<<"\t "
71  <<header->missingData<<"\t "
72  <<header->datablockCount<<"\t "
73  <<header->timeStart<<"\t "
74  <<hdr_time<<"\t "<<hits_size<<"\t "
75  <<hits_time_0<<"\t "
76  <<hits_time_1<<std::endl;
77  /// Check that the hits time span is not less than 4.9 ms
78  return (hits_time_0+4.9<hits_time_1);
79 }
80 
EvTimeFilter(fhicl::ParameterSet const &p)
bool filter(art::Event &e) override
std::vector< DAQHit > HitList
Definition: HitList.h:15
art::InputTag fHitsTag
const char * p
Definition: xmltok.h:285
DEFINE_ART_MODULE(TestTMapFile)
art::InputTag fHeaderTag
EvTimeFilter & operator=(EvTimeFilter const &)=delete
OStream cout
Definition: OStream.cxx:6
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Float_t e
Definition: plot.C:35
enum BeamMode string