-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathORCaen5720Decoder.hh
executable file
·73 lines (47 loc) · 2.46 KB
/
ORCaen5720Decoder.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// ORCaen5720Decoder.hh
// Basic information taken from ORCaen1720Decoder.hh provided by Jarek Kaspar.
// Updated by Laura Bodine
// Zpack2.5 and zerolengthencoding are not currently handled here...
// if your data is formatted that way then you must add functionality to this decoder
#ifndef _ORCaen5720Decoder_hh_
#define _ORCaen5720Decoder_hh_
#include "ORVDataDecoder.hh"
class ORCaen5720Decoder : public ORVDataDecoder
{
public:
ORCaen5720Decoder() {}
virtual ~ORCaen5720Decoder() {}
enum ECaen5720Consts { kEventDataLen = 1024, kEventHeaderLen = 4, kWFLen = 2018 };
virtual inline UInt_t CardOf(UInt_t* /*record*/)
{ return 0; }
virtual inline UInt_t UnitNumberOf(UInt_t* record)
{ return record[1]>>16&0xf;}
virtual inline UInt_t EventSize(UInt_t* record) //number of 32-bit words in an event
{ return record[2] & 0x0fffffff; }
virtual inline UInt_t ChannelMask(UInt_t* record)
{ return record[3] & 0xff; }
virtual inline UInt_t Pattern(UInt_t* record)
{ return (record[3] >> 8) & 0xffff; }
virtual inline UInt_t GetNEventsOf(UInt_t* record)
{ return (LengthOf(record)-2)/EventSize(record); }
virtual inline UInt_t EventCount(UInt_t* record)
{ UInt_t * test = GetEventPointer(record);
return test[2] & 0xffffff; }
virtual inline UInt_t Clock(UInt_t* record)
{ UInt_t * test = (GetEventPointer(record));
return test[3];}
virtual inline bool Packed(UInt_t* record)
{ return (record[1]>>0 & 0x1);}
virtual UInt_t TraceLength(UInt_t* record);
/**************************************************************************
// Copy waveforms iteratively because hte packed2.5 data requires it
*************************************************************************/
virtual void CopyTrace(UInt_t* record, UInt_t *Waveform, UInt_t numSamples); //trace of first active channel
virtual void CopyTraces(UInt_t* record, UInt_t *Waveform0, UInt_t *Waveform1,UInt_t *Waveform2,UInt_t *Waveform3, UInt_t numSamples); //trace of all channels (inactive read 0);
virtual inline UInt_t* GetEventPointer(UInt_t* record) {return (record + 2);};
virtual std::string GetDataObjectPath()
{ return "ORDT5720Model:waveform"; }
virtual inline std::string GetDictionaryObjectPath()
{ return "ORDT5720Model"; }
};
#endif