-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTigEvent.h
84 lines (72 loc) · 2.34 KB
/
TigEvent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// part of TigSortGUI
// author: Ulrike Hager
#ifndef TIGEVENT_H
#define TIGEVENT_H
#include <stdint.h>
#include <vector>
#include <string>
const int LIN_EQ_DIM=3;
struct lin_eq_type
{
long double matrix[LIN_EQ_DIM][LIN_EQ_DIM];
long double vector[LIN_EQ_DIM];
long double solution[LIN_EQ_DIM];
int dim;
double freq;
};
class TigEvent
{
public: //----- public ---------------------
TigEvent(void);
~TigEvent(void);
int Address(){return mAddress;}
void AddWfSample(int pSample);
double CalcCFDTimeDiff();
double CalcWfBase(std::vector<double> pParameters);
double CalcWfEnergy(std::vector<double> pParameters);
int CalcWfMaxBin();
int CalcWfMinBin();
double CalcWfPeak(std::vector<double> pParameters);
double CalcWfSinePhase(std::vector<double> pParameters);
int CFD(){return mCFD;}
int Charge(){return mCharge;}
int EventID(){return mEventID;}
int Lifetime(){return mLifetime;}
int LED(){return mLED;}
void SetAddress(int pAddress){mAddress=pAddress;}
void SetCFD(int pCFD){mCFD=pCFD;}
void SetCharge(long pCharge){mCharge=pCharge;}
void SetEventID(int pEventID){mEventID = pEventID;}
void SetLED(int pLED){mLED=pLED;}
void SetLifetime(int pLifetime){mLifetime = pLifetime;}
void SetTimestamp(int pTimestamp){mTimestamp = pTimestamp;}
void SetTimestampUp(int pTimestampUp){mTimestampUp = pTimestampUp;}
void SetTriggersAccepted(int pTriggers){mTriggersAccepted = pTriggers;}
void SetTriggersRequested(int pTriggers){mTriggersRequested = pTriggers;}
int SolveLinEq(lin_eq_type *lin_eq);
long double SolveLinEqDet(int m, lin_eq_type *lin_eq);
void SolveLinEqIni(int NWf, double freq);
int Timestamp(){return mTimestamp;}
int TimestampUp(){return mTimestampUp;}
int TriggersAccepted(){return mTriggersAccepted;}
int TriggersRequested(){return mTriggersRequested;}
double Value(int pDataType, std::vector<double> pParameters);
std::vector<short> Waveform(){return mWaveform;}
protected: //----- protected ------------------
int mAddress;
double mCharge;
int mCFD;
int mEventID;
int mLED;
int mLifetime;
lin_eq_type mLinEq;
int mTimestamp;
int mTimestampUp;
int mTriggersAccepted;
int mTriggersRequested;
std::vector<short> mWaveform;
private: //----- private --------------------
TigEvent(const TigEvent& );
TigEvent& operator = (const TigEvent&);
};
#endif /* TIGEVENT_H */