-
Notifications
You must be signed in to change notification settings - Fork 3
/
ORJAMFADCDecoder.hh
57 lines (44 loc) · 1.93 KB
/
ORJAMFADCDecoder.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
57
// ORJAMFADCDecoder.hh
#ifndef _ORJAMFADCDecoder_hh_
#define _ORJAMFADCDecoder_hh_
#include "ORVBasicRDTreeDecoder.hh"
#include "ORVHistDecoder.hh"
class ORJAMFADCDecoder : public ORVHistDecoder, public ORVBasicRDTreeDecoder
{
public:
enum EJAMFADCConsts { kNCards = 32 };
ORJAMFADCDecoder() {}
virtual ~ORJAMFADCDecoder() {}
virtual void Swap(UInt_t* dataRecord);
virtual double ReferenceDateOf(UInt_t* record)
{ return (double) record[2]; }
virtual inline size_t GetNChannels(UInt_t* record)
{ return LengthOf(record) - 3; }
virtual inline UInt_t IthChannelOf(UInt_t* record, size_t iChannel)
{ return (record[3+iChannel] & 0xf0000) >> 16; }
virtual inline UInt_t IthADCValueOf(UInt_t* record, size_t iChannel)
{ return record[3+iChannel] & 0xffff; }
// for histograms
virtual std::string GetHistName(int iHist);
virtual std::string GetHistTitle(int iHist);
virtual std::string GetXTitle() { return "ADC Value"; }
virtual std::string GetYTitle() { return "Channel"; }
virtual inline size_t GetNDim() { return 2; }
virtual size_t GetNbinsX() { return 0xffff+1; }
virtual size_t GetNbinsY() { return 0xf+1; }
virtual inline int GetHistIndex(UInt_t* record)
{ return CardOf(record) + kNCards*CrateOf(record); }
virtual inline size_t GetNEntries(UInt_t* record)
{ return GetNChannels(record); }
virtual inline double GetX(UInt_t* record, size_t i)
{ return double(IthADCValueOf(record, i)); }
virtual inline double GetY(UInt_t* record, size_t i)
{ return double(IthChannelOf(record, i)); }
// for basic trees
virtual size_t GetNPars() { return 4; }
virtual std::string GetParName(size_t iPar);
virtual size_t GetNRows(UInt_t* record) { return GetNChannels(record); }
virtual UInt_t GetPar(UInt_t* record, size_t iPar, size_t iRow);
virtual std::string GetDataObjectPath() { return "JAMF:JAMFADC"; }
};
#endif