source: trunk/MagicSoft/Mars/mraw/MRawEvtData.h@ 8776

Last change on this file since 8776 was 8571, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1#ifndef MARS_MRawEvtData
2#define MARS_MRawEvtData
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_MCamEvent
8#include "MCamEvent.h"
9#endif
10
11// gcc 3.2
12//class ifstream;
13#include <iosfwd>
14
15class MRawRunHeader;
16class MRawCrateArray;
17
18class TArrayC;
19class MArrayS;
20class MArrayB;
21
22class MRawEvtData : public MParContainer, public MCamEvent
23{
24 friend class MRawEvtPixelIter;
25private:
26 MRawRunHeader *fRunHeader; //! provides information about numbers
27
28 // FIXME: COMMENT ABOUT ORDERING
29
30 MArrayS *fHiGainPixId; //-> list of pixel IDs of hi gain channel
31 MArrayB *fHiGainFadcSamples; //-> list of hi gain samples of all pixels (ordering: see fHiGainPixId)
32
33 MArrayS *fLoGainPixId; //-> list of pixel IDs of lo gain channel
34 MArrayB *fLoGainFadcSamples; //-> list of lo gain samples of all pixels (ordering: see fLoGainPixId)
35
36 MArrayB *fABFlags; //-> A information about the exact trigger position
37
38 UShort_t fNumBytesPerSample;
39
40 Int_t fConnectedPixels; //!
41
42 void InitArrays(UShort_t numconnected=0, UShort_t maxid=0);
43 void DeleteArrays();
44
45 Int_t GetNumBytes() const;
46
47 UInt_t GetSample(const void *ptr, Int_t n) // Helper for Draw
48 {
49 switch (n)
50 {
51 case 1: return *(Byte_t*)ptr;
52 case 2: return *(UShort_t*)ptr;
53 case 3: return *(Int_t*)ptr;
54 }
55 return 0;
56 }
57
58public:
59 MRawEvtData(const char *name=NULL, const char *title=NULL);
60 ~MRawEvtData();
61
62 void InitRead(MRawRunHeader *rh)
63 {
64 //
65 // you have to set this before you can read information
66 // from a magic binary file
67 //
68 fRunHeader = rh;
69 }
70
71 void Clear(Option_t * = NULL);
72 void Print(Option_t * = NULL) const;
73 void Draw (Option_t * = NULL);
74
75 void ResetPixels(UShort_t npix, UShort_t maxid);
76 void AddPixel(UShort_t nOfPixel, TArrayC *data);
77
78 UShort_t GetNumHiGainSamples() const;
79 UShort_t GetNumLoGainSamples() const;
80 UInt_t GetNumSamples() const { return GetNumHiGainSamples()+GetNumLoGainSamples(); }
81 UShort_t GetNumPixels() const;
82
83 UShort_t GetNumBytesPerSample() const { return fNumBytesPerSample; }
84 UInt_t GetScale() const { return 1<<((fNumBytesPerSample-1)*8); }
85
86 void ReadPixel(istream &fin, Int_t npix);
87 void SetABFlag(Int_t npix, Bool_t ab);
88 void SkipEvt(istream &fin);
89
90 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
91 void DrawPixelContent(Int_t num) const
92 {
93 TString s("HIST");
94 s += num;
95 const_cast<MRawEvtData*>(this)->Draw(s);
96 }
97
98 void Copy(TObject &named)
99#if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
100 const
101#endif
102 ;
103
104 ClassDef(MRawEvtData, 7) //Container to store the raw Event Data
105};
106
107#endif
Note: See TracBrowser for help on using the repository browser.