Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
GenScaler.h
Go to the documentation of this file.
1#ifndef Podd_GenScaler_h_
2#define Podd_GenScaler_h_
3
5//
6// GenScaler
7// Generic scaler.
8//
10
11#include "VmeModule.h"
12#include <vector>
13
14namespace Decoder {
15
16 class GenScaler : public VmeModule {
17
18 public:
19
21 fIsDecoded(false), fFirstTime(true), fDeltaT(0.0),
23 fHasClock(false), fClockRate(0.0), fNormScaler(nullptr),
24 firsttime(true), firstwarn(true) {}
25 GenScaler( UInt_t crate, UInt_t slot );
26
28
29 virtual void Clear( Option_t* opt = "" );
30 virtual Int_t Decode( const UInt_t* evbuffer );
31 virtual UInt_t GetData( UInt_t chan ) const; // Raw scaler counts
32 virtual Bool_t IsSlot( UInt_t rdata );
33 virtual void DoPrint() const;
34
35 void GenInit();
36 Int_t SetClock( Double_t deltaT, UInt_t clockchan = 0, Double_t clockrate = 0 );
37 Double_t GetRate( UInt_t chan) const; // Scaler rate
38 Double_t GetTimeSincePrev() const; // returns deltaT since last reading
39 Bool_t IsDecoded() const { return fIsDecoded; };
40 void LoadNormScaler(GenScaler *scal); // loads pointer to norm. scaler
41 void DebugPrint(std::ofstream *file=nullptr) const;
42
43 // Loads sldat
44 virtual UInt_t LoadSlot( THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop );
45 // Load slot for bank structures
46 virtual UInt_t LoadSlot( THaSlotData *sldat, const UInt_t *evbuffer, UInt_t pos, UInt_t len);
47
48 virtual void SetBank(Int_t bank);
49
50
51 protected:
52
53 void LoadRates();
54 Bool_t checkchan( UInt_t chan ) const { return (chan < fWordsExpect); }
57 std::vector<UInt_t> fDataArray, fPrevData;
58 std::vector<Double_t> fRate;
64 static const UInt_t fgNumChanDefault=32;
65
66 ClassDef(GenScaler,0) // A generic scaler. Abstract class.
67
68 };
69
70}
71
72#endif
int Int_t
unsigned int UInt_t
uint32_t chan
bool Bool_t
double Double_t
const char Option_t
#define ClassDef(name, id)
Double_t GetRate(UInt_t chan) const
static const UInt_t fgNumChanDefault
Definition GenScaler.h:64
Bool_t checkchan(UInt_t chan) const
Definition GenScaler.h:54
Double_t GetTimeSincePrev() const
void DebugPrint(std::ofstream *file=nullptr) const
Double_t fClockRate
Definition GenScaler.h:61
virtual void DoPrint() const
virtual void Clear(Option_t *opt="")
Definition GenScaler.cxx:31
Int_t SetClock(Double_t deltaT, UInt_t clockchan=0, Double_t clockrate=0)
Definition GenScaler.cxx:65
std::vector< Double_t > fRate
Definition GenScaler.h:58
std::vector< UInt_t > fPrevData
Definition GenScaler.h:57
void LoadNormScaler(GenScaler *scal)
GenScaler * fNormScaler
Definition GenScaler.h:62
Bool_t IsDecoded() const
Definition GenScaler.h:39
virtual void SetBank(Int_t bank)
Definition GenScaler.cxx:56
virtual Bool_t IsSlot(UInt_t rdata)
virtual Int_t Decode(const UInt_t *evbuffer)
std::vector< UInt_t > fDataArray
Definition GenScaler.h:57
virtual UInt_t GetData(UInt_t chan) const
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop)
UInt_t fWordsExpect
Definition Module.h:145
virtual UInt_t GetData(UInt_t) const
Definition Module.h:51