source: trunk/MagicSoft/Mars/mraw/MRawRunHeader.h@ 1846

Last change on this file since 1846 was 1059, checked in by blanch, 23 years ago
Two member functions have been introduced (SetNumCrates, SetNumPixInCrate) since these informations had to be filled in the MC programs.
File size: 3.7 KB
Line 
1#ifndef MARS_MRawRunHeader
2#define MARS_MRawRunHeader
3///////////////////////////////////////////////////////////////////////
4// //
5// MRunHeader //
6// //
7///////////////////////////////////////////////////////////////////////
8
9#ifndef MARS_MParContainer
10#include "MParContainer.h"
11#endif
12
13class TBuffer;
14class ifstream;
15class MArrayS;
16
17//
18// Magic number to detect the magic file type
19//
20const UShort_t kMagicNumber = 0xc0c0;
21
22enum {
23 kRTData = 0,
24 kRTPedestal = 1,
25 kRTCalibration = 2,
26 kRTMonteCarlo = 256
27};
28
29class MRawRunHeader : public MParContainer
30{
31private:
32 /* ---- Run Header Informations ---- */
33 UShort_t fMagicNumber;
34 UShort_t fFormatVersion;
35 UShort_t fSoftVersion;
36 UShort_t fRunType;
37 UInt_t fRunNumber;
38 Char_t fProjectName[22];
39 Char_t fSourceName[12];
40 //Float_t fSourceRA;
41 //Float_t fSourceDEC;
42 Char_t fSourceEpochChar[2];
43 UShort_t fSourceEpochDate;
44 Float_t fMJD;
45 UShort_t fDateYear;
46 UShort_t fDateMonth;
47 UShort_t fDateDay;
48 UShort_t fNumCrates;
49 UShort_t fNumPixInCrate;
50 UShort_t fNumSamplesLoGain;
51 UShort_t fNumSamplesHiGain;
52 UInt_t fNumEvents;
53 MArrayS *fPixAssignment;
54
55public:
56 MRawRunHeader(const char *name=NULL, const char *title=NULL);
57 ~MRawRunHeader();
58
59 void SetMagicNumber(UShort_t a) { fMagicNumber=a; }
60 void SetFormatVersion(UShort_t a){ fFormatVersion=a; }
61 void SetSoftVersion(UShort_t a) { fSoftVersion=a; }
62 void SetRunType(UShort_t a) { fRunType=a; }
63 void SetRunNumber(UInt_t a) { fRunNumber=a; }
64 void SetNumEvents(UInt_t a) { fNumEvents=a; }
65 void SetNumSamples(UShort_t low, UShort_t high)
66 {
67 fNumSamplesLoGain=low;
68 fNumSamplesHiGain=high;
69 }
70 void SetNumCrates(UShort_t a) {fNumCrates=a; }
71 void SetNumPixInCrate(UShort_t a){fNumPixInCrate=a; }
72
73 UShort_t GetMagicNumber() const { return fMagicNumber; }
74 UShort_t GetFormatversion() const { return fFormatVersion; }
75 UShort_t GetSoftVersion() const { return fSoftVersion; }
76 UShort_t GetRunType() const { return fRunType; }
77 UInt_t GetRunNumber() const { return fRunNumber; }
78 const Char_t *GetProjectName() const { return fProjectName; }
79 const Char_t *GetSourceName() const { return fSourceName; }
80 //Float_t GetSourceRa() const { return fSourceRA; }
81 //Float_t GetSourceDec() const { return fSourceDEC; }
82 const Char_t *GetSourceEpocheChar() const { return fSourceEpochChar; }
83 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
84 Float_t GetMJD() const { return fMJD; }
85 UShort_t GetDateYear() const { return fDateYear; }
86 Byte_t GetDateMonth() const { return fDateMonth; }
87 Byte_t GetDateDay() const { return fDateDay; }
88 UShort_t GetNumCrates() const { return fNumCrates; }
89 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; }
90 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
91 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
92 UInt_t GetNumEvents() const { return fNumEvents; }
93 UShort_t GetPixAssignment(UShort_t i) const;
94
95 UInt_t GetNumSamplesPerCrate() const
96 {
97 return fNumPixInCrate*(fNumSamplesLoGain+fNumSamplesHiGain);
98 }
99
100 UShort_t GetNumPixel() const;
101
102 void Print(Option_t *t=NULL) const;
103
104 void ReadEvt(istream& fin);
105
106 ClassDef(MRawRunHeader, 1) // storage container for general info
107};
108#endif
Note: See TracBrowser for help on using the repository browser.