-
Notifications
You must be signed in to change notification settings - Fork 3
/
ORIP320ADCDecoder.hh
56 lines (47 loc) · 1.63 KB
/
ORIP320ADCDecoder.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
// ORIP320ADCDecoder.hh
/*
*/
#ifndef _ORIP320ADCDecoder_hh_
#define _ORIP320ADCDecoder_hh_
#include "ORVBasicTreeDecoder.hh"
#include "ORVIndustryPakDecoder.hh"
class ORIP320ADCDecoder: public ORVBasicTreeDecoder, public ORVIndustryPakDecoder
{
public:
ORIP320ADCDecoder() {}
virtual ~ORIP320ADCDecoder() {}
enum EORIP320ADCConsts { kBufferHeaderLength = 3,
kMaxADCRecordsChannels = 40 };
virtual inline size_t TotalADCValuesOf( UInt_t* record )
{ return ( LengthOf( record ) - kBufferHeaderLength <= 0 )
? 0 : (size_t) ( LengthOf( record ) - kBufferHeaderLength ); }
//! Returns channel number at the offset.
/*!
\param offset ranges from 0 to TotalADCValuesOf() - 1
*/
virtual UInt_t ChannelOf( UInt_t* record, size_t offset )
{ return ( record[kBufferHeaderLength + offset] & 0xFF0000 ) >> 16; }
//! Returns adc value at the offset.
/*!
\param offset ranges from 0 to TotalADCValuesOf() - 1
*/
virtual UInt_t ADCValueOf( UInt_t* record, size_t offset )
{ return ( record[kBufferHeaderLength + offset] & 0xFFF ); }
/*!
Parameters are as follows:
- Crate
- Card
- IP Slot
- Time
- Channel
- ADC Value
*/
virtual size_t GetNPars() { return 6; }
virtual std::string GetParName( size_t iPar );
virtual inline size_t GetNRows( UInt_t* record )
{ return TotalADCValuesOf( record ); }
virtual UInt_t GetPar(UInt_t* record, size_t iPar, size_t iRow);
virtual std::string GetDataObjectPath()
{ return "IP320:IP320ADC"; }
};
#endif