-
Notifications
You must be signed in to change notification settings - Fork 3
/
ORCaenV830Decoder.hh
56 lines (45 loc) · 2.18 KB
/
ORCaenV830Decoder.hh
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
// ORCaenV830Decoder.hh
#ifndef _ORCaenV830Decoder_hh_
#define _ORCaenV830Decoder_hh_
#include "ORVBasicTreeDecoder.hh"
#include "ORVEventCounterDecoder.hh"
#include <cstdio>
class ORCaenV830Decoder : public virtual ORVBasicTreeDecoder, public virtual ORVEventCounterDecoder
{
public:
ORCaenV830Decoder() {}
virtual ~ORCaenV830Decoder() {}
// You always should treat the counter and overflow values as unsigned. A 'bad read' will just be 0xffffffff
// in BOTH the overflow and counter values. You should never have to treat them as signed values.
virtual inline size_t NScalersOf(UInt_t* record) // sets the total number of channels (should be 1 for MJD)
{ return LengthOf(record) - 5; }
virtual UInt_t IthChannelOf(UInt_t* record, size_t iRow);
virtual inline UInt_t CallAsInt(UInt_t* record, int i)
{ return record[i]; }
virtual inline UInt_t GetEnabledMask(UInt_t* record)
{ return record[3]; }
virtual inline UInt_t GetChan0RollOver(UInt_t* record)
{ return record[2]; }
virtual inline UInt_t GetHeader(UInt_t* record)
{ return record[4]; }
virtual inline UInt_t GetCounter(UInt_t* record, size_t iRow)
{ return record[5 + iRow]; }
virtual inline ULong_t GetCounter0Long(UInt_t* record)
{ return ((ULong_t)GetChan0RollOver(record) << 32) | GetCounter(record, 0); }
virtual inline size_t GetEventCount(UInt_t* record)
{ return GetHeader(record) & 0xFFFF; }
// Event branch
virtual inline std::string GetLabel() { return "ORCV830DecoderForEvent"; }
virtual inline std::string GetDataObjectPath()
{ return "ORCV830Model:Event"; }
// Polled Read branch (not needed by MJD as of 2/15/15)
//virtual inline std::string GetLabel() { return "ORCV830DecoderForPolledRead"; }
//virtual inline std::string GetDataObjectPath()
// { return "ORCV830Model:PolledRead"; }
// for basic trees
virtual size_t GetNPars() { return 7; } // # of variables of interest
virtual std::string GetParName(size_t iPar);
virtual size_t GetNRows(UInt_t* record) { return NScalersOf(record); }
virtual UInt_t GetPar(UInt_t* record, size_t iPar, size_t iRow);
};
#endif