RawData311InputDriver.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 // \file RawData311InputDriver.h
3 // brief Source to convert raw binary file from 311 to root file useful to LArSoft
4 // Adapted from LarRawInputDriverShortBo.h
5 //
6 // Created: April 20th 2017, Last Modified:
7 // Author: Kevin Fusshoeller, kevin.fusshoeller@cern.ch
8 ////////////////////////////////////////////////////////////////////////////
9 
10 
11 #include "fhiclcpp/ParameterSet.h"
20 
21 #include "dlardaq.h"
22 #include "EventDecoder.h"
23 
24 #include <fstream>
25 #include <string>
26 #include <vector>
27 
28 // Conversion of binary data to root files
29 namespace lris
30 {
31 
33 {
34  // Class to fill constraints on a template argument to the class FileReaderSource
35  public:
36  // Required constructor
39  art::SourceHelper const &pm);
40 
41  // Functions required by FileReaderSource
42  void closeCurrentFile();
43  void readFile(std::string const &name,
44  art::FileBlock* &fb);
45  bool readNext(art::RunPrincipal* const &inR,
46  art::SubRunPrincipal* const &inSR,
47  art::RunPrincipal* &outR,
48  art::SubRunPrincipal* &outSR,
49  art::EventPrincipal* &outE);
50 
51  private:
54  //std::ifstream infile;
55  uint16_t fEventCounter;
56  uint16_t fNEvents;
58 
59  short nchannels = 1280;
60  short nsamples = 1667;
62 
65 
66  std::vector< std::pair<double, double> > fPedMap;
68 
69  void process_Event311(std::vector<raw::RawDigit>& digitList,
70  dlardaq::evheader_t &event_head,
71  uint16_t evt_num);
72 
73  double GetPedMean(size_t LAr_chan, std::vector< std::pair<double, double> > *fPedMap){ return fPedMap->at(LAr_chan).first; }
74 
75  double GetPedRMS(size_t LAr_chan, std::vector< std::pair<double, double> > *fPedMap){ return fPedMap->at(LAr_chan).second; }
76 
77 
78 }; //RawData311InputDriver
79 
80 } //namespace lris
static QCString name
Definition: declinfo.cpp:673
RawData311InputDriver(fhicl::ParameterSet const &pset, art::ProductRegistryHelper &helper, art::SourceHelper const &pm)
void readFile(std::string const &name, art::FileBlock *&fb)
std::string string
Definition: nybbler.cc:12
double GetPedRMS(size_t LAr_chan, std::vector< std::pair< double, double > > *fPedMap)
struct vector vector
dlardaq::EventDecoder DataDecode
std::vector< std::pair< double, double > > fPedMap
art::SourceHelper const & fSourceHelper
double GetPedMean(size_t LAr_chan, std::vector< std::pair< double, double > > *fPedMap)
void process_Event311(std::vector< raw::RawDigit > &digitList, dlardaq::evheader_t &event_head, uint16_t evt_num)
Conversion of binary data to root files.
bool readNext(art::RunPrincipal *const &inR, art::SubRunPrincipal *const &inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)