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

Last change on this file since 15510 was 14204, checked in by tbretz, 12 years ago
Added default argument to GetSamples.
File size: 3.6 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 fName = name ? name : "MPedestalSubtractedEvt";
33 }
34
35 void InitSize(const UInt_t i) { fNumPixels=i; }
36 void InitSamples(UInt_t samples, UInt_t pixels=0);
37
38 Float_t *GetSamples(UInt_t pixel=0) const;
39 USample_t *GetSamplesRaw(UInt_t pixel=0) const;
40
41 UInt_t GetNumSamples() const { return fNumSamples; }
42 UShort_t GetNumPixels() const { return fNumPixels; }
43
44 Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
45 //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
46
47 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Float_t &val) const;
48 Int_t GetMax(const Int_t pixidx, Float_t &val) const
49 {
50 return GetMax(pixidx, 0, fNumSamples-1, val);
51 }
52 Int_t GetMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
53 {
54 Float_t val;
55 return GetMax(pixidx, first, last, val);
56 }
57 Int_t GetMaxPos(const Int_t pixidx, Float_t &val) const
58 {
59 return GetMax(pixidx, 0, fNumSamples-1, val);
60 }
61
62 Int_t GetMaxPos(const Int_t pixidx) const
63 {
64 Float_t val;
65 return GetMax(pixidx, 0, fNumSamples-1, val);
66 }
67
68 Int_t GetRawMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const;
69 Int_t GetRawMax(const Int_t pixidx, UInt_t &val) const
70 {
71 return GetRawMax(pixidx, 0, fNumSamples-1, val);
72 }
73 Int_t GetRawMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
74 {
75 UInt_t val;
76 return GetRawMax(pixidx, first, last, val);
77 }
78 Int_t GetRawMaxPos(const Int_t pixidx, UInt_t &val) const
79 {
80 return GetRawMax(pixidx, 0, fNumSamples-1, val);
81 }
82
83 Int_t GetRawMaxPos(const Int_t pixidx) const
84 {
85 UInt_t val;
86 return GetRawMax(pixidx, 0, fNumSamples-1, val);
87 }
88
89 UInt_t GetRawMaxVal(const Int_t idx, const Int_t first, const Int_t last) const
90 {
91 UInt_t val;
92 GetRawMax(idx, first, last, val);
93 return val;
94 }
95
96 void GetStat(const Int_t idx, Float_t &mean, Float_t &rms) const;
97
98 Int_t GetSaturation(const Int_t pixidx, Int_t limit) const
99 {
100 Int_t first=0;
101 Int_t last=fNumSamples-1;
102 return GetSaturation(pixidx, limit, first, last);
103 }
104
105 Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
106 {
107 USample_t *ptr = GetSamplesRaw(idx);
108
109 const USample_t *end = ptr + last - first + 1;
110
111 Int_t sum = 0;
112 while (ptr<end)
113 sum += *ptr++;
114
115 return sum;
116 }
117
118 void Print(Option_t *o="") const;
119
120 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
121 void DrawPixelContent(Int_t num) const { }
122
123 ClassDef(MPedestalSubtractedEvt, 6) //Container to store the raw Event Data
124};
125
126#endif
Note: See TracBrowser for help on using the repository browser.