BeamlineRecoDump_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file BeamlineRecoDump_module.cc
3 /// \module analyzer
4 /// \brief Dumper module to analyze a reconstructed beamline file.
5 /// Part of beamline reconstruction for NOvA test beam.
6 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
7 /// \date December 2018
8 ////////////////////////////////////////////////////////////////////////////
9 
10 // framework
14 #include "fhiclcpp/ParameterSet.h"
22 
23 // nova
24 #include "RawData/RawBeamline.h"
28 #include "BeamlineRecoBase/ToF.h"
30 
31 // stl
32 #include <iostream>
33 
34 // root
35 
36 // -----------------------------------------------------------------------
37 namespace beamlinereco {
38 
40 
41  public:
42 
44 
45  void reconfigure(const fhicl::ParameterSet& pset);
46  void analyze(const art::Event& evt);
47 
48  private:
49 
55 
56  };
57 
58 }
59 
60 // -----------------------------------------------------------------------
62  //produces<>();
63  this->reconfigure(pset);
64 }
65 
66 // -----------------------------------------------------------------------
68  fRecoCkovDigitLabel = pset.get<art::InputTag>("RecoCkovDigitLabel");
69  fRecoCkovLabel = pset.get<art::InputTag>("RecoCkovLabel");
70  fRecoToFDigitLabel = pset.get<art::InputTag>("RecoToFDigitLabel");
71  fRecoToFLabel = pset.get<art::InputTag>("RecoToFLabel");
72  fRecoWCTrackLabel = pset.get<art::InputTag>("RecoWCTrackLabel");
73 }
74 
75 // -----------------------------------------------------------------------
77 
78  std::cout << std::endl << "----------------------------- Event " << evt.event()
79  << "-----------------------------" << std::endl;
80 
81  // ToF
82  std::cout << "---------------- ToF Reconstruction ----------------" << std::endl;
83 
85  std::vector<art::Ptr<brb::BeamlineDigit> > tofDigits;
86  if (evt.getByLabel(fRecoToFDigitLabel, tofDigitHandle))
87  art::fill_ptr_vector(tofDigits, tofDigitHandle);
88 
90  std::vector<art::Ptr<brb::ToF> > tof;
91  if (evt.getByLabel(fRecoToFLabel, tofHandle))
92  art::fill_ptr_vector(tof, tofHandle);
93 
96 
97  std::cout << "There are " << tofDigits.size() << " reconstructed ToF digits and "
98  << tof.size() << " reconstructed ToF objects." << std::endl;
99  for (size_t digitIt = 0; digitIt < tofDigits.size(); ++digitIt) {
100  std::cout << " Digit " << digitIt << " has start time " << tofDigits[digitIt]->StartTimeInNanoSec()
101  << ", peak time " << tofDigits[digitIt]->PeakTimeInNanoSec()
102  << ", end time " << tofDigits[digitIt]->EndTimeInNanoSec()
103  << " and peak ADC " << tofDigits[digitIt]->PeakADC() << std::endl;
104  const std::vector<art::Ptr<rawdata::RawBeamlineDigit> > rawDigits = fmrd.at(tofDigits[digitIt].key());
105  std::cout << " There are " << rawDigits.size() << " associated raw digits." << std::endl;
106  }
107  if (tof.size())
108  std::cout << "Reconstructed ToF object: time " << tof[0]->Time() << std::endl;
109 
110  // WC
111  // ToF
112  std::cout << "---------------- WC Reconstruction ----------------" << std::endl;
113 
115  std::vector<art::Ptr<brb::WCTrack> > wcTracks;
116  if (evt.getByLabel(fRecoWCTrackLabel, wcTrackHandle))
117  art::fill_ptr_vector(wcTracks, wcTrackHandle);
118 
120 
121  std::cout << "There are " << wcTracks.size() << " reconstructed WC tracks." << std::endl;
122  for (size_t trackIt = 0; trackIt < wcTracks.size(); ++trackIt) {
123  std::cout << " Digit " << trackIt << " has momentum " << wcTracks[trackIt]->Momentum()
124  << " and " << wcTracks[trackIt]->NHits() << " hits." << std::endl;
125  const std::vector<art::Ptr<rawdata::RawBeamlineWC> > rawWCs = fmwc.at(wcTracks[trackIt].key());
126  std::cout << " There are " << rawWCs.size() << " associated raw digits." << std::endl;
127  }
128 
129  return;
130 
131 }
132 
134 
DEFINE_ART_MODULE(TestTMapFile)
void analyze(const art::Event &evt)
Encapsulation of reconstructed digitizer &#39;hits&#39;. Used for ToF PMTs and SiPMs, and Cherenkov and Muon ...
T get(std::string const &key) const
Definition: ParameterSet.h:231
Encapsulation of reconstructed Time-of-Flight (ToF) information. Part of beamline reconstruction for ...
int evt
Encapsulation of reconstructed Wire Chamber track. Part of beamline reconstruction for NOvA test beam...
EventNumber_t event() const
Definition: Event.h:67
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
BeamlineRecoDump(const fhicl::ParameterSet &pset)
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void reconfigure(const fhicl::ParameterSet &pset)
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
Encapsulation of reconstructed PID information from detectors in the beamline (ToF, WCs, Cherenkov). Part of beamline reconstruction for NOvA test beam.
Encapsulation of reconstructed track in the muon stack downstream of test beam detector. Part of beamline reconstruction for NOvA test beam.