HDColdboxDataInterface.h
Go to the documentation of this file.
1 #ifndef HDColdboxDataInterface_H
2 #define HDColdboxDataInterface_H
3 
11 #include "artdaq-core/Data/Fragment.hh"
13 #include "daqdataformats/Fragment.hpp"
14 #include <hdf5.h>
15 
16 typedef dunedaq::daqdataformats::Fragment duneFragment;
17 typedef std::vector<duneFragment> duneFragments;
18 
19 typedef std::vector<raw::RawDigit> RawDigits;
20 typedef std::vector<raw::RDTimeStamp> RDTimeStamps;
21 
23 
24  public:
25 
28  if (fForceOpen) {
29  H5Fclose(fHDFFile);
30  }
31  };
32  int retrieveData(art::Event &evt, std::string inputlabel,
33  std::vector<raw::RawDigit> &raw_digits,
34  std::vector<raw::RDTimeStamp> &rd_timestamps,
35  std::vector<raw::RDStatus> &rdstatuses );
36 
37  //void readFragmentsForEvent (art::Event &evt);
38 
40  art::Event &evt, std::string inputlabel,
41  std::vector<raw::RawDigit> &raw_digits,
42  std::vector<raw::RDTimeStamp> &rd_timestamps,
43  std::vector<raw::RDStatus> &rdstatuses,
44  std::vector<int> &apalist);
45 
47  art::Event &evt, std::vector<raw::RawDigit> &raw_digits,
48  std::vector<raw::RDTimeStamp> &rd_timestamps,
49  std::vector<raw::RDStatus> &rdstatuses,
50  std::vector<int> &apalist);
51 
52 
53 
54  private:
55 
56  std::map<int,std::vector<std::string>> _input_labels_by_apa;
57  void _collectRDStatus(std::vector<raw::RDStatus> &rdstatuses){};
58  void getFragmentsForEvent(hid_t the_group, RawDigits& raw_digits,
59  RDTimeStamps &timestamps, int apano,
60  unsigned int maxchan);
61  void getMedianSigma(const raw::RawDigit::ADCvector_t &v_adc, float &median,
62  float &sigma);
63 
64  //For nicer log syntax
65  std::string logname = "HDColdboxDataInterface";
66  hid_t fPrevStoredHandle = -1;
67  hid_t fHDFFile = -1;
68  bool fForceOpen;
70 
71  unsigned int fMaxChan = 1000000; // no maximum for now
72  unsigned int fDefaultCrate = 3;
73  int fDebugLevel = 0; // switch to turn on debugging printout
74 
75 };
76 
77 #endif
std::vector< raw::RDTimeStamp > RDTimeStamps
std::vector< raw::RawDigit > RawDigits
std::vector< duneFragment > duneFragments
int retrieveDataForSpecifiedAPAs(art::Event &evt, std::vector< raw::RawDigit > &raw_digits, std::vector< raw::RDTimeStamp > &rd_timestamps, std::vector< raw::RDStatus > &rdstatuses, std::vector< int > &apalist)
std::map< int, std::vector< std::string > > _input_labels_by_apa
std::string string
Definition: nybbler.cc:12
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
HDColdboxDataInterface(fhicl::ParameterSet const &ps)
void getMedianSigma(const raw::RawDigit::ADCvector_t &v_adc, float &median, float &sigma)
int retrieveData(art::Event &evt, std::string inputlabel, std::vector< raw::RawDigit > &raw_digits, std::vector< raw::RDTimeStamp > &rd_timestamps, std::vector< raw::RDStatus > &rdstatuses)
void getFragmentsForEvent(hid_t the_group, RawDigits &raw_digits, RDTimeStamps &timestamps, int apano, unsigned int maxchan)
static constexpr double ps
Definition: Units.h:99
void _collectRDStatus(std::vector< raw::RDStatus > &rdstatuses)
TCEvent evt
Definition: DataStructs.cxx:7
dunedaq::daqdataformats::Fragment duneFragment
int retrieveDataAPAListWithLabels(art::Event &evt, std::string inputlabel, std::vector< raw::RawDigit > &raw_digits, std::vector< raw::RDTimeStamp > &rd_timestamps, std::vector< raw::RDStatus > &rdstatuses, std::vector< int > &apalist)
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:26