RawFileDumper_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file RawFileDumper_module.cc
3 /// \module analyzer
4 /// \brief Simple analyzer to dump contents of raw data files.
5 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
6 /// \date April 2020
7 ////////////////////////////////////////////////////////////////////////////
8 
9 // framework
13 #include "fhiclcpp/ParameterSet.h"
19 
20 // nova
21 #include "RawData/RawBeamline.h"
22 
23 // -----------------------------------------------------------------------
24 namespace tbana {
25 
26  class RawFileDumper : public art::EDAnalyzer {
27 
28  public:
29 
31 
32  void reconfigure(const fhicl::ParameterSet& pset);
33  void analyze(const art::Event& evt);
34 
35  private:
36 
37  // config
39 
40  };
41 
43 
44 }
45 
46 // -----------------------------------------------------------------------
48  this->reconfigure(pset);
49 }
50 
51 // -----------------------------------------------------------------------
53  fRawTriggerLabel = pset.get<std::string>("RawTriggerLabel");
54 }
55 
56 // -----------------------------------------------------------------------
58 
59  std::cout << std::endl << "Run " << evt.run()
60  << ", subrun " << evt.subRun()
61  << ", event " << evt.event() << std::endl;
62 
63  // Get data from art::Event
64 
65  // Raw trigger objects
67  std::vector<art::Ptr<rawdata::RawBeamlineTrigger> > triggers;
68  if (evt.getByLabel(fRawTriggerLabel, triggerHandle))
69  art::fill_ptr_vector(triggers, triggerHandle);
70 
71  std::cout << triggers.size() << " trigger(s):" << std::endl;
72  for (std::vector<art::Ptr<rawdata::RawBeamlineTrigger> >::const_iterator triggerIt = triggers.begin();
73  triggerIt != triggers.end(); ++triggerIt) {
74  std::cout << " Trigger " << (*triggerIt)->TriggerNumber() << " has "
75  << "timestamp " << (*triggerIt)->Timestamp() << ", "
76  << "pattern " << std::bitset<16>((*triggerIt)->Pattern()) << ", "
77  << "TDU time " << (*triggerIt)->TDUTime() << " and "
78  << "conditions " << (*triggerIt)->TriggerCondition()
79  << std::endl;
80  }
81 
82  return;
83 
84 }
SubRunNumber_t subRun() const
Definition: Event.h:72
DEFINE_ART_MODULE(TestTMapFile)
T get(std::string const &key) const
Definition: ParameterSet.h:231
int evt
RawFileDumper(const fhicl::ParameterSet &pset)
EventNumber_t event() const
Definition: Event.h:67
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
OStream cout
Definition: OStream.cxx:6
void reconfigure(const fhicl::ParameterSet &pset)
void analyze(const art::Event &evt)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Raw data definitions for beamline data used in NOvA test beam experiment.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
RunNumber_t run() const
Definition: Event.h:77
Definition: fwd.h:28
enum BeamMode string