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

Last change on this file since 9384 was 9308, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 3.2 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
56
57 UInt_t fNumTrigLvl1; // Number of 1st level tiggers between 2 events
58 UInt_t fNumTrigLvl2; // Number of 2nd level tiggers between 2 events
59 UInt_t fTrigPattern[2]; // Trigger configuration
60
61 UShort_t fNumLoGainOn; // Indicating if no pixel has a neglegible
62 // low gain signal (0), else it is the number
63 // of pixels with lo gain on
64
65 //
66 // Informations only needed to read the raw file correctly
67 //
68 UShort_t fTrigType; //! Trigger Type of this event
69 MArrayB *fPixLoGainOn; //! Array which tell you which pixels have lo gain on
70
71 Bool_t DecodeTime(const UInt_t abstime[2], UShort_t ver) const;
72
73 Int_t GetNumBytes() const;
74
75 Int_t ReadEvtOld(istream& fin, UShort_t ver);
76
77public:
78 MRawEvtHeader(const char *name=NULL, const char *title=NULL);
79 ~MRawEvtHeader();
80
81 // MRawEvtHeader
82 void InitRead(MRawRunHeader *rh, MTime *t);
83
84 // Getter
85 UShort_t GetTrigType() const { return fTrigType; }
86 UInt_t GetNumTrigLvl1() const { return fNumTrigLvl1; }
87 UInt_t GetNumTrigLvl2() const { return fNumTrigLvl2; }
88 UInt_t GetDAQEvtNumber() const { return fDAQEvtNumber; }
89
90 UInt_t GetTriggerID() const;
91 UInt_t GetCalibrationPattern() const;
92 UInt_t GetPulserSlotPattern() const;
93
94 // Setter (ONLY for Monte Carlo purpose)
95 void FillHeader(UInt_t, Float_t=0);
96
97 void SetTriggerPattern( const UInt_t pattern ) { fTrigPattern[0] = pattern; }
98 void SetCalibrationPattern( const UInt_t pattern ) { fTrigPattern[1] = pattern; }
99 void SetDAQEvtNumber(const UInt_t n) { fDAQEvtNumber = n; }
100
101 // TObject
102 void Clear(Option_t * = NULL);
103 void Print(Option_t * = NULL) const;
104
105 // I/O
106 Int_t ReadEvt(istream& fin, UShort_t ver, UInt_t size);
107 void SkipEvt(istream& fin, UShort_t ver);
108
109 ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER
110};
111
112#endif
Note: See TracBrowser for help on using the repository browser.