source: trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h@ 5732

Last change on this file since 5732 was 5678, checked in by gaug, 20 years ago
*** empty log message ***
File size: 4.3 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 enum PulserColorCode_t
52 {
53 kSlot1Green = BIT(0),
54 kSlot2Green = BIT(1),
55 kSlot3Blue = BIT(2),
56 kSlot4UV = BIT(3),
57 kSlot5UV = BIT(4),
58 kSlot6Blue = BIT(5),
59 kSlot7Blue = BIT(6),
60 kSlot8Blue = BIT(7),
61 kSlot9AttBlue = BIT(8),
62 kSlot10Blue = BIT(9),
63 kSlot11Blue = BIT(10),
64 kSlot12UV = BIT(11),
65 kSlot13UV = BIT(12),
66 kSlot14Blue = BIT(13),
67 kSlot15Green = BIT(14),
68 kSlot16AttGreen = BIT(15),
69 kCT1Pulser = BIT(16),
70 kAnyGreen = kSlot1Green | kSlot2Green | kSlot15Green | kSlot16AttGreen,
71 kAnyUV = kSlot4UV | kSlot5UV | kSlot12UV | kSlot13UV,
72 kAnyBlue = kSlot3Blue | kSlot6Blue | kSlot7Blue | kSlot8Blue
73 | kSlot9AttBlue| kSlot10Blue | kSlot11Blue | kSlot14Blue,
74 kGreenAndBlue = kAnyGreen & kAnyBlue,
75 kBlueAndUV = kAnyBlue & kAnyUV,
76 kGreenAndUV = kAnyGreen & kAnyUV,
77 kIFAEPulser = kAnyGreen | kAnyBlue | kAnyUV,
78 kAny = kAnyGreen | kAnyBlue | kAnyUV | kCT1Pulser
79 };
80
81private:
82 MTime *fTime; //! object to store the time in (ReadEvt)
83
84 UInt_t fDAQEvtNumber; // Number of Event
85
86 UInt_t fNumTrigLvl1; // Number of 1st level tiggers between 2 events
87 UInt_t fNumTrigLvl2; // Number of 2nd level tiggers between 2 events
88 UInt_t fTrigPattern[2]; // Trigger configuration
89
90 UShort_t fNumLoGainOn; // Indicating if no pixel has a neglegible
91 // low gain signal (0), else it is the number
92 // of pixels with lo gain on
93
94 //
95 // Informations only needed to read the raw file correctly
96 //
97 UShort_t fTrigType; //! Trigger Type of this event
98 MArrayB *fPixLoGainOn; //! Array which tell you which pixels have lo gain on
99
100 Bool_t DecodeTime(UInt_t abstime[2], UShort_t ver) const;
101
102 Int_t GetNumBytes() const;
103
104public:
105 MRawEvtHeader(const char *name=NULL, const char *title=NULL);
106 ~MRawEvtHeader();
107
108 void InitRead(MRawRunHeader *rh, MTime *t);
109
110 void Clear(Option_t * = NULL);
111 void Print(Option_t * = NULL) const;
112
113 void FillHeader(UInt_t, Float_t=0);
114
115 UShort_t GetTrigType() const { return fTrigType; }
116 UInt_t GetNumTrigLvl1() const { return fNumTrigLvl1; }
117 UInt_t GetNumTrigLvl2() const { return fNumTrigLvl2; }
118 UInt_t GetDAQEvtNumber() const { return fDAQEvtNumber; }
119
120 UInt_t GetTriggerID() const;
121 UInt_t GetCalibrationPattern() const;
122
123 void SetCalibrationPattern(UInt_t pat) { fTrigPattern[1] += (pat << 16); } // USE THIS FUNCTION WITH EXTREME CARE -- IT IS A WORKAROUND!
124
125 UShort_t GetPowerOfContLight() const;
126 UInt_t GetPulserSlotPattern() const;
127 const MCalibrationCam::PulserColor_t GetPulserColor() const;
128 Float_t GetPulserStrength() const;
129
130 CLColor_t GetContLightColor() const;
131
132 Int_t ReadEvt(istream& fin, UShort_t ver);
133 void SkipEvt(istream& fin, UShort_t ver);
134
135 ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER
136};
137
138#endif
Note: See TracBrowser for help on using the repository browser.