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

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