-
Notifications
You must be signed in to change notification settings - Fork 37
/
SBSSimADC.h
70 lines (55 loc) · 2.15 KB
/
SBSSimADC.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
#ifndef SBSSimADC_
#define SBSSimADC_
/////////////////////////////////////////////////////////////////////
//
// SBSSimADC
// G4SBS Simplified Simulated ADC Module
//
// Right now, all it supports is an ADC sum and individual ADC samples
//
/////////////////////////////////////////////////////////////////////
#include "PipeliningModule.h"
#include "stdint.h"
#include <vector>
#include "SBSSimDataDecoder.h"
namespace Decoder {
class SBSSimADC : public PipeliningModule { // Inheritance
public:
SBSSimADC(); // Default constructor
SBSSimADC(Int_t crate, Int_t slot); // Constructor
virtual ~SBSSimADC(); // Virtual constructor
// Use parent class functions
using PipeliningModule::Init;
virtual void Clear(const Option_t *opt="");
virtual void Init();
virtual void CheckDecoderStatus() const;
virtual void ClearDataVectors();
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t* evbuffer, const UInt_t *pstop);
virtual UInt_t LoadSlot( THaSlotData *sldat, const UInt_t* evbuffer, UInt_t pos, UInt_t len);
// We don't need these functions for simulated data, but must be defined
// so that this won't be an abstract class
UInt_t LoadNextEvBuffer(THaSlotData*) {return 0;};// needs return something for compilation
UInt_t LoadThisBlock(THaSlotData*, const std::vector<UInt_t >&) {return 0;};// needs return something for compilation
Int_t Decode(const UInt_t *) { return 0; }; // use DecodeOneWord instead
/*
struct fadc_data_struct {
std::vector<uint32_t> samples;
std::vector<uint32_t> integrals;
void clear() {
samples.clear();
integrals.clear();
}
}; // fadc_data_struct
*/
private:
static const size_t NADCCHAN = 2048; // Max ADC channels
static TypeIter_t fgThisType;
static TypeIter_t fgType1;
static TypeIter_t fgType2;
static TypeIter_t fgType3;
//static std::vector<TypeIter_t> fgTypeVec;//Let's try something...
std::vector<SimEncoder::sadc_data> sadc_data;
ClassDef(SBSSimADC,0) // Generic SimADC module
}; // SBSSimADC class
} // Decoder namespace
#endif