source: trunk/Mars/mpedestal/MPedestalSubtractedEvt.h@ 12726

Last change on this file since 12726 was 12625, checked in by tbretz, 13 years ago
Added possibility to return mean and rms in GetPixelContant
File size: 3.5 KB
Line 
1#ifndef MARS_MPedestalSubtractedEvt
2#define MARS_MPedestalSubtractedEvt
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_MCamEvent
8#include "MCamEvent.h"
9#endif
10#ifndef MARS_MArrayF
11#include "MArrayF.h"
12#endif
13#ifndef MARS_MArrayS
14#include "MArrayS.h"
15#endif
16
17typedef UShort_t USample_t;
18
19class MPedestalSubtractedEvt : public MParContainer, public MCamEvent
20{
21private:
22 MArrayF fSamples; // list of all samples with pedestal subtracted
23 MArrayS fSamplesRaw; // list of all samples (raw)
24
25 UInt_t fNumSamples; // number of samples per pixel
26 UInt_t fNumPixels; // number of pixels
27
28public:
29 MPedestalSubtractedEvt(const char *name=NULL, const char *title=NULL)
30 : fNumSamples(0), fNumPixels(0)
31 {
32 }
33
34 void InitSize(const UInt_t i) { fNumPixels=i; }
35 void InitSamples(UInt_t samples, UInt_t pixels=0);
36
37 Float_t *GetSamples(UInt_t pixel) const;
38 USample_t *GetSamplesRaw(UInt_t pixel) const;
39
40 UInt_t GetNumSamples() const { return fNumSamples; }
41 UShort_t GetNumPixels() const { return fNumPixels; }
42
43 Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
44 //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
45
46 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Float_t &val) const;
47 Int_t GetMax(const Int_t pixidx, Float_t &val) const
48 {
49 return GetMax(pixidx, 0, fNumSamples-1, val);
50 }
51 Int_t GetMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
52 {
53 Float_t val;
54 return GetMax(pixidx, first, last, val);
55 }
56 Int_t GetMaxPos(const Int_t pixidx, Float_t &val) const
57 {
58 return GetMax(pixidx, 0, fNumSamples-1, val);
59 }
60
61 Int_t GetMaxPos(const Int_t pixidx) const
62 {
63 Float_t val;
64 return GetMax(pixidx, 0, fNumSamples-1, val);
65 }
66
67 Int_t GetRawMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const;
68 Int_t GetRawMax(const Int_t pixidx, UInt_t &val) const
69 {
70 return GetRawMax(pixidx, 0, fNumSamples-1, val);
71 }
72 Int_t GetRawMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
73 {
74 UInt_t val;
75 return GetRawMax(pixidx, first, last, val);
76 }
77 Int_t GetRawMaxPos(const Int_t pixidx, UInt_t &val) const
78 {
79 return GetRawMax(pixidx, 0, fNumSamples-1, val);
80 }
81
82 Int_t GetRawMaxPos(const Int_t pixidx) const
83 {
84 UInt_t val;
85 return GetRawMax(pixidx, 0, fNumSamples-1, val);
86 }
87
88 UInt_t GetRawMaxVal(const Int_t idx, const Int_t first, const Int_t last) const
89 {
90 UInt_t val;
91 GetRawMax(idx, first, last, val);
92 return val;
93 }
94
95 void GetStat(const Int_t idx, Float_t &mean, Float_t &rms) const;
96
97 Int_t GetSaturation(const Int_t pixidx, Int_t limit) const
98 {
99 Int_t first=0;
100 Int_t last=fNumSamples-1;
101 return GetSaturation(pixidx, limit, first, last);
102 }
103
104 Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
105 {
106 USample_t *ptr = GetSamplesRaw(idx);
107
108 const USample_t *end = ptr + last - first + 1;
109
110 Int_t sum = 0;
111 while (ptr<end)
112 sum += *ptr++;
113
114 return sum;
115 }
116
117 void Print(Option_t *o="") const;
118
119 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
120 void DrawPixelContent(Int_t num) const { }
121
122 ClassDef(MPedestalSubtractedEvt, 6) //Container to store the raw Event Data
123};
124
125#endif
Note: See TracBrowser for help on using the repository browser.