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

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