ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SubSample.h
Go to the documentation of this file.
1 #ifndef SUBSAMPLE_H
2 #define SUBSAMPLE_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <stdint.h>
7 
8 #include "TimeDelta.h"
9 #include "TriggerInfo.h"
10 
11 class SubSample{
12 
13  public:
14 
15  SubSample();
16 
18  __attribute__((deprecated))
19  SubSample(
20  std::vector<int> PMTid,
21  std::vector<TimeDelta::short_time_t> time,
22  std::vector<float> charge = std::vector<float>(),
23  TimeDelta timestamp = 0
24  );
25 
28 
32  bool Append(const SubSample& sub);
33 
37  bool Append(const std::vector<int> PMTid, const std::vector<TimeDelta::short_time_t> time, const std::vector<float> charge, const TimeDelta timestamp);
38 
40  std::vector<int> m_PMTid;
42  std::vector<TimeDelta::short_time_t> m_time;
44  std::vector<float> m_charge;
45 
46 
48  std::vector<std::vector<int> > m_trigger_readout_windows;
50  std::vector<bool> m_masked;
51 
53  unsigned int m_first_unique;
54 
56  TimeDelta AbsoluteDigitTime(int index) const;
57 
59  void SortByTime();
61  bool IsSortedByTime() const;
62 
67  std::vector<SubSample> Split(TimeDelta target_width, TimeDelta target_overlap) const;
68 
71  void TellMeAboutTheTriggers(const TriggerInfo & triggers, const int verbose);
72 
73  private:
74 
77 };
78 
79 #endif
unsigned int m_first_unique
Position of the first hit that isn&#39;t overlapping with the previous SubSample.
Definition: SubSample.h:53
void SortByTime()
Sort all digits in the SubSample by their time.
Definition: SubSample.cpp:31
std::vector< SubSample > Split(TimeDelta target_width, TimeDelta target_overlap) const
Definition: SubSample.cpp:72
bool Append(const SubSample &sub)
Definition: SubSample.cpp:154
std::vector< int > m_PMTid
Vector of PMT IDs for all hits in SubSample.
Definition: SubSample.h:40
int m_start_trigger
Which trigger are we starting from in TellMeAboutTheTriggers()?
Definition: SubSample.h:76
std::vector< float > m_charge
Vector of charges for all hits in SubSample. Unit: photoelectrons (MC), calibrated photoelectrons (da...
Definition: SubSample.h:44
TimeDelta m_timestamp
Timestamp of the whole SubSample.
Definition: SubSample.h:27
TimeDelta AbsoluteDigitTime(int index) const
Return the absolute time (timestamp + digit time) of a digit.
Definition: SubSample.cpp:150
std::vector< std::vector< int > > m_trigger_readout_windows
Stores the trigger readout windows each hit is associated with.
Definition: SubSample.h:48
bool IsSortedByTime() const
Check whether all hits are in time order.
Definition: SubSample.cpp:62
std::vector< TimeDelta::short_time_t > m_time
Vector of hit times relative to timestamp for all hits in SubSample. Unit: ns.
Definition: SubSample.h:42
std::vector< bool > m_masked
Is each hit masked from future trigger decisions?
Definition: SubSample.h:50
void TellMeAboutTheTriggers(const TriggerInfo &triggers, const int verbose)
Definition: SubSample.cpp:191