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

Last change on this file since 812 was 782, checked in by blanch, 24 years ago
Some Set function members has been introduced and implemented.
File size: 3.4 KB
Line 
1#ifndef MRAWRUNHEADER_H
2#define MRAWRUNHEADER_H
3///////////////////////////////////////////////////////////////////////
4// //
5// MRunHeader //
6// //
7///////////////////////////////////////////////////////////////////////
8
9#ifndef MPARCONTAINER_H
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
22class MRawRunHeader : public MParContainer
23{
24private:
25 /* ---- Run Header Informations ---- */
26 UShort_t fMagicNumber;
27 UShort_t fFormatVersion;
28 UShort_t fSoftVersion;
29 UShort_t fRunType;
30 UInt_t fRunNumber;
31 Char_t fProjectName[22];
32 Char_t fSourceName[12];
33 //Float_t fSourceRA;
34 //Float_t fSourceDEC;
35 Char_t fSourceEpochChar[2];
36 UShort_t fSourceEpochDate;
37 Float_t fMJD;
38 UShort_t fDateYear;
39 UShort_t fDateMonth;
40 UShort_t fDateDay;
41 UShort_t fNumCrates;
42 UShort_t fNumPixInCrate;
43 UShort_t fNumSamplesLoGain;
44 UShort_t fNumSamplesHiGain;
45 UInt_t fNumEvents;
46 MArrayS *fPixAssignment;
47
48public:
49 MRawRunHeader(const char *name=NULL, const char *title=NULL);
50 ~MRawRunHeader();
51
52 void SetMagicNumber(UShort_t a){fMagicNumber=a;}
53 void SetFormatVersion(UShort_t a){fFormatVersion=a;}
54 void SetSoftVersion(UShort_t a){fSoftVersion=a;}
55 void SetRunType(UShort_t a){ fRunType=a;}
56 void SetRunNumber(UInt_t a){fRunNumber=a;}
57 void SetNumSamples(UShort_t low, UShort_t high)
58 {fNumSamplesLoGain=low;fNumSamplesHiGain=high;}
59 void SetNumEvents(UInt_t a){fNumEvents=a;}
60
61 UShort_t GetMagicNumber() const { return fMagicNumber; }
62 UShort_t GetFormatversion() const { return fFormatVersion; }
63 UShort_t GetSoftVersion() const { return fSoftVersion; }
64 UShort_t GetRunType() const { return fRunType; }
65 UInt_t GetRunNumber() const { return fRunNumber; }
66 const Char_t *GetProjectName() const { return fProjectName; }
67 const Char_t *GetSourceName() const { return fSourceName; }
68 //Float_t GetSourceRa() const { return fSourceRA; }
69 //Float_t GetSourceDec() const { return fSourceDEC; }
70 const Char_t *GetSourceEpocheChar() const { return fSourceEpochChar; }
71 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
72 Float_t GetMJD() const { return fMJD; }
73 UShort_t GetDateYear() const { return fDateYear; }
74 Byte_t GetDateMonth() const { return fDateMonth; }
75 Byte_t GetDateDay() const { return fDateDay; }
76 UShort_t GetNumCrates() const { return fNumCrates; }
77 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; }
78 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
79 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
80 UShort_t GetNumEvents() const { return fNumEvents; }
81 UShort_t GetPixAssignment(UShort_t i) const;
82
83 UInt_t GetNumSamplesPerCrate() const
84 {
85 return fNumPixInCrate*(fNumSamplesLoGain+fNumSamplesHiGain);
86 }
87
88 UShort_t GetNumPixel() const;
89
90 void Print(Option_t *t=NULL);
91
92 void ReadEvt(istream& fin);
93
94 ClassDef(MRawRunHeader, 1) // storage container for general info
95};
96#endif
Note: See TracBrowser for help on using the repository browser.