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

Last change on this file since 2639 was 2636, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.6 KB
Line 
1#ifndef MARS_MRawRunHeader
2#define MARS_MRawRunHeader
3///////////////////////////////////////////////////////////////////////
4// //
5// MRunHeader //
6// //
7///////////////////////////////////////////////////////////////////////
8
9#ifndef MARS_MTime
10#include "MTime.h"
11#endif
12
13class TBuffer;
14class MArrayS;
15
16//
17// Magic number to detect the magic file type
18//
19const UShort_t kMagicNumber = 0xc0c0;
20
21//
22// enum for the Run Type. Monte Carlo Runs have
23// to have a value greater than 255 (>0xff)
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 Char_t fSourceEpochChar[2];
44 UShort_t fSourceEpochDate;
45 UShort_t fNumCrates;
46 UShort_t fNumPixInCrate;
47 UShort_t fNumSamplesLoGain;
48 UShort_t fNumSamplesHiGain;
49 UInt_t fNumEvents;
50 MTime fRunStart;
51 MTime fRunStop;
52 MArrayS *fPixAssignment;
53
54public:
55 MRawRunHeader(const char *name=NULL, const char *title=NULL);
56 ~MRawRunHeader();
57
58 // This is to be used in the MC chain only!
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 // This is to get the numbers...
74 UShort_t GetMagicNumber() const { return fMagicNumber; }
75 UShort_t GetFormatVersion() const { return fFormatVersion; }
76 UShort_t GetSoftVersion() const { return fSoftVersion; }
77 UShort_t GetRunType() const { return fRunType; }
78 UInt_t GetRunNumber() const { return fRunNumber; }
79 const Char_t *GetProjectName() const { return fProjectName; }
80 const Char_t *GetSourceName() const { return fSourceName; }
81 const Char_t *GetSourceEpocheChar() const { return fSourceEpochChar; }
82 UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
83 UShort_t GetNumCrates() const { return fNumCrates; }
84 UShort_t GetNumPixInCrate() const { return fNumPixInCrate; }
85 UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
86 UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
87 UInt_t GetNumEvents() const { return fNumEvents; }
88 const MTime &GetRunStart() const { return fRunStart; }
89 const MTime &GetRunEnd() const { return fRunStop; }
90 UShort_t GetPixAssignment(UShort_t i) const;
91 UShort_t GetNumConnectedPixels() const;
92
93 UInt_t GetNumSamplesPerCrate() const
94 {
95 return fNumPixInCrate*(fNumSamplesLoGain+fNumSamplesHiGain);
96 }
97
98 UShort_t GetNumPixel() const;
99 Int_t GetNumTotalBytes() const;
100
101 void Print(Option_t *t=NULL) const;
102
103 void ReadEvt(istream& fin);
104
105 ClassDef(MRawRunHeader, 2) // storage container for general info
106};
107#endif
Note: See TracBrowser for help on using the repository browser.