source: branches/MarsMoreSimulationTruth/mraw/MRawEvtHeader.h@ 20115

Last change on this file since 20115 was 17148, checked in by ftemme, 11 years ago
Merging changes from the MC branch in the trunk
File size: 3.4 KB
Line 
1#ifndef MARS_MRawEvtHeader
2#define MARS_MRawEvtHeader
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8#ifndef MARS_MCalibrationCam
9#include "MCalibrationCam.h"
10#endif
11
12// gcc 3.2
13//class ifstream;
14#include <iosfwd>
15
16class MTime;
17class MArrayB;
18class MRawRunHeader;
19
20class MRawEvtHeader : public MParContainer
21{
22public:
23 //
24 // Trigger Type (TT)
25 /*
26 enum {
27 kTTEvent = 0,
28 kTTPedestal = 1,
29 kTTCalibration = 2,
30 kTTPinDiode = 3
31 };
32 */
33 enum CLColor_t
34 {
35 kCLUV = BIT(0),
36 kCLGreen = BIT(1),
37 kCLAmber = BIT(2),
38 kCLRed = BIT(3),
39 kCLRedAmber = kCLRed & kCLAmber,
40 kCLRedGreen = kCLRed & kCLGreen,
41 kCLRedUV = kCLRed & kCLUV ,
42 kCLAmberGreen = kCLAmber & kCLGreen,
43 kCLAmberUV = kCLAmber & kCLUV ,
44 kCLGreenUV = kCLGreen & kCLUV ,
45 kCLRedAmberGreen = kCLRedAmber & kCLGreen,
46 kCLRedGreenUV = kCLRedGreen & kCLUV,
47 kCLAmberGreenUV = kCLAmberGreen & kCLUV,
48 kCLAll = kCLRedAmberGreen & kCLUV
49 };
50
51
52private:
53 MTime *fTime; //! object to store the time in (ReadEvt)
54
55 UInt_t fDAQEvtNumber; // Number of Event {fits: name=EventNum ; unit=uint32}
56
57 UInt_t fNumTrigLvl1; // Number of 1st level tiggers between 2 events
58 // Used in MSimTrigger for the index of the trigger channel
59 UInt_t fNumTrigLvl2; // Number of 2nd level tiggers between 2 events
60 UInt_t fTrigPattern[2]; // Trigger configuration
61
62 UShort_t fNumLoGainOn; // Indicating if no pixel has a neglegible
63 // low gain signal (0), else it is the number
64 // of pixels with lo gain on
65
66 //
67 // Informations only needed to read the raw file correctly
68 //
69 UShort_t fTrigType; //! Trigger Type of this event
70 MArrayB *fPixLoGainOn; //! Array which tell you which pixels have lo gain on
71
72 Bool_t DecodeTime(const UInt_t abstime[2], UShort_t ver) const;
73
74 Int_t GetNumBytes() const;
75
76 Int_t ReadEvtOld(std::istream& fin, UShort_t ver);
77
78public:
79 MRawEvtHeader(const char *name=NULL, const char *title=NULL);
80 ~MRawEvtHeader();
81
82 // MRawEvtHeader
83 void InitRead(MRawRunHeader *rh, MTime *t);
84
85 // Getter
86 UShort_t GetTrigType() const { return fTrigType; }
87 UInt_t GetNumTrigLvl1() const { return fNumTrigLvl1; }
88 UInt_t GetNumTrigLvl2() const { return fNumTrigLvl2; }
89 UInt_t GetDAQEvtNumber() const { return fDAQEvtNumber; }
90
91 UInt_t GetTriggerID() const;
92 UInt_t GetCalibrationPattern() const;
93 UInt_t GetPulserSlotPattern() const;
94
95 // Setter (ONLY for Monte Carlo purpose)
96 void FillHeader(UInt_t, Float_t=0);
97
98 void SetTriggerPattern( const UInt_t pattern ) { fTrigPattern[0] = pattern; }
99 void SetCalibrationPattern( const UInt_t pattern ) { fTrigPattern[1] = pattern; }
100 void SetDAQEvtNumber(const UInt_t n) { fDAQEvtNumber = n; }
101 void SetNumTrigLvl1(UInt_t num) { fNumTrigLvl1 = num; }
102
103 // TObject
104 void Clear(Option_t * = NULL);
105 void Print(Option_t * = NULL) const;
106
107 // I/O
108 Int_t ReadEvt(std::istream& fin, UShort_t ver, UInt_t size);
109 void SkipEvt(std::istream& fin, UShort_t ver);
110
111 ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER
112};
113
114#endif
Note: See TracBrowser for help on using the repository browser.