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

Last change on this file since 2357 was 2316, checked in by rwagner, 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 void SetMJD(Float_t a) {fMJD=a; }
76
77 UShort_t GetMagicNumber() const { return fMagicNumber; }
78 UShort_t GetFormatversion() const { return fFormatVersion; }
79 UShort_t GetSoftVersion() const { return fSoftVersion; }
80 UShort_t GetRunType() const { return fRunType; }
81 UInt_t GetRunNumber() const { return fRunNumber; }
82 const Char_t *GetProjectName() const { return fProjectName; }
83 const Char_t *GetSourceName() const { return fSourceName; }
84 //Float_t GetSourceRa() const { return fSourceRA; }
85 //Float_t GetSourceDec() const { return fSourceDEC; }
86 const Char_t *GetSourceEpocheChar() const { return fSourceEpochChar; }
87 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
88 Float_t GetMJD() const { return fMJD; }
89 UShort_t GetDateYear() const { return fDateYear; }
90 Byte_t GetDateMonth() const { return fDateMonth; }
91 Byte_t GetDateDay() const { return fDateDay; }
92 UShort_t GetNumCrates() const { return fNumCrates; }
93 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; }
94 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
95 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
96 UInt_t GetNumEvents() const { return fNumEvents; }
97 UShort_t GetPixAssignment(UShort_t i) const;
98 UShort_t GetNumConnectedPixels() const;
99
100 UInt_t GetNumSamplesPerCrate() const
101 {
102 return fNumPixInCrate*(fNumSamplesLoGain+fNumSamplesHiGain);
103 }
104
105 UShort_t GetNumPixel() const;
106
107 void Print(Option_t *t=NULL) const;
108
109 void ReadEvt(istream& fin);
110
111 ClassDef(MRawRunHeader, 1) // storage container for general info
112};
113#endif
Note: See TracBrowser for help on using the repository browser.