VDColdboxDataInterface.h
Go to the documentation of this file.
1 #ifndef VDColdboxDataInterface_H
2 #define VDColdboxDataInterface_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 
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  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 = "VDColdboxDataInterface";
66  hid_t fPrevStoredHandle = -1;
67  hid_t fHDFFile = -1;
68  bool fForceOpen;
70 
71  int fMaxChan = 1000000; // no maximum for now
72 
73 };
74 
75 #endif
std::vector< raw::RDTimeStamp > RDTimeStamps
std::vector< raw::RawDigit > RawDigits
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)
std::string string
Definition: nybbler.cc:12
std::vector< raw::RawDigit > RawDigits
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)
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
void _collectRDStatus(std::vector< raw::RDStatus > &rdstatuses)
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)
VDColdboxDataInterface(fhicl::ParameterSet const &ps)
std::vector< raw::RDTimeStamp > RDTimeStamps
std::vector< duneFragment > duneFragments
void getFragmentsForEvent(hid_t the_group, RawDigits &raw_digits, RDTimeStamps &timestamps, int apano, int maxchan)
dunedaq::daqdataformats::Fragment duneFragment
static constexpr double ps
Definition: Units.h:99
void getMedianSigma(const raw::RawDigit::ADCvector_t &v_adc, float &median, float &sigma)
void readFragmentsForEvent(art::Event &evt)
TCEvent evt
Definition: DataStructs.cxx:7
std::map< int, std::vector< std::string > > _input_labels_by_apa
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:26