EvTimeAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: EvTimeAna
3 // Module Type: analyzer
4 // File: EvTimeAna_module.cc
5 //
6 // Generated at Thu Feb 23 14:44:41 2017 by Andrey Sheshukov using artmod
7 // from cetpkgsupport v1_10_02.
8 ////////////////////////////////////////////////////////////////////////
9 
17 #include "fhiclcpp/ParameterSet.h"
21 #include <limits>
22 #include <iomanip>
23 
24 namespace novaddt {
25  class EvTimeAna;
26 }
27 
29 public:
30  explicit EvTimeAna(fhicl::ParameterSet const & p);
31  // The destructor generated by the compiler is fine for classes
32  // without bare pointers or other resource use.
33 
34  // Plugins should not be copied or assigned.
35  EvTimeAna(EvTimeAna const &) = delete;
36  EvTimeAna(EvTimeAna &&) = delete;
37  EvTimeAna & operator = (EvTimeAna const &) = delete;
38  EvTimeAna & operator = (EvTimeAna &&) = delete;
39 
40  void analyze(art::Event const & e) override;
41 
42 private:
43 
44  // Declare member data here.
47 };
48 
49 
51  :
52  EDAnalyzer(p),
53  fHeaderTag (p.get< std::string >("header_tag" )),
54  fHitsTag(p.get<std::string>("hits_tag"))
55 {}
56 
58 {
59  const double msec=64000;
61  double hdr_time = header->timeStart/msec;
62 
64  auto hits_size = Hits->size();
65  double hits_time_0 = hits_size?Hits->front().TDC().val/msec-hdr_time:0;
66  double hits_time_1 = hits_size?Hits->back().TDC().val/msec-hdr_time:0;
67  std::cout.setf(std::ios::fixed);
68  std::cout.precision(2);
69 
70  std::cout
71  <<header->eventNumber<<"\t "
72  <<header->missingData<<"\t "
73  <<header->datablockCount<<"\t "
74  <<header->timeStart<<"\t "
75  <<hdr_time<<"\t "<<hits_size<<"\t "
76  <<hits_time_0<<"\t "
77  <<hits_time_1<<std::endl;
78 
79  // Implementation of required member function here.
80 }
81 
std::vector< DAQHit > HitList
Definition: HitList.h:15
const char * p
Definition: xmltok.h:285
art::InputTag fHeaderTag
DEFINE_ART_MODULE(TestTMapFile)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
art::InputTag fHitsTag
OStream cout
Definition: OStream.cxx:6
EvTimeAna & operator=(EvTimeAna const &)=delete
void analyze(art::Event const &e) override
EvTimeAna(fhicl::ParameterSet const &p)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Float_t e
Definition: plot.C:35
enum BeamMode string