BmnRoot
Loading...
Searching...
No Matches
BmnTrigWaveDigit.h
Go to the documentation of this file.
1#ifndef BMNTRIGWAVEDIGIT_H
2#define BMNTRIGWAVEDIGIT_H
3
4#include <iostream>
5using namespace std;
6
7#include <TNamed.h>
8//#include "BmnTrigDigit.h"
9
10class BmnTrigWaveDigit : public TNamed {
11public:
14 BmnTrigWaveDigit(UShort_t iMod, Short_t *iValue, UInt_t nVals, Double_t trigTimestamp, Double_t adcTimestamp, Double_t time = 0);
15
16 UShort_t GetMod() const {
17 return fMod;
18 }
19
20 UInt_t GetNSamples() const {
21 return fNsmpl;
22 }
23
24 int GetIntegral(UInt_t start = 0, UInt_t stop = 1e9) const {
25 stop = min(stop, fNsmpl);
26 start = min(start, stop);
27 int spectra = 0;
28 for (UInt_t i = start; i < stop; ++i)
29 spectra += fValueI[i];
30 return spectra;
31 }
32
33 int GetPeak(UInt_t start = 0, UInt_t stop = 1e9) const {
34 stop = min(stop, fNsmpl);
35 start = min(start, stop);
36 int peak = -100000;
37 for (UInt_t i = start; i < stop; ++i)
38 if (fValueI[i] > peak) peak = fValueI[i];
39 return peak;
40 }
41
42 Short_t *GetShortValue() const {
43 return (Short_t *) fValueI;
44 }
45
46 void SetShortValue(Short_t *iValue) const {
47 for (UInt_t i = 0; i < fNsmpl; ++i)
48 fValueI[i] = iValue[i];
49 }
50
51 Double_t GetAdcTimestamp() const {
52 return fAdcTimestamp;
53 }
54
55 Double_t GetTrigTimestamp() const {
56 return fTrigTimestamp;
57 }
58
59 Double_t GetTime() const {
60 return fTime;
61 }
62
63 vector<Double_t>& TdcVector(){
64 return fTdcTimes;
65 }
66
67 virtual ~BmnTrigWaveDigit();
68protected:
69 UShort_t fMod;
70 UInt_t fNsmpl;
71 Short_t* fValueI; //[fNsmpl]
73 Double_t fAdcTimestamp;
74 Double_t fTime;
75 vector<Double_t> fTdcTimes;
76
78};
79
80#endif /* BMNTRIGWAVEDIGIT_H */
81
int i
Definition P4_F32vec4.h:22
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
Short_t * GetShortValue() const
Double_t GetTrigTimestamp() const
int GetPeak(UInt_t start=0, UInt_t stop=1e9) const
UInt_t GetNSamples() const
Double_t GetTime() const
void SetShortValue(Short_t *iValue) const
Double_t GetAdcTimestamp() const
ClassDef(BmnTrigWaveDigit, 4)
UShort_t GetMod() const
vector< Double_t > & TdcVector()
int GetIntegral(UInt_t start=0, UInt_t stop=1e9) const
vector< Double_t > fTdcTimes
STL namespace.