| 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 |
|
|---|
| 17 | typedef UShort_t USample_t;
|
|---|
| 18 |
|
|---|
| 19 | class MPedestalSubtractedEvt : public MParContainer, public MCamEvent
|
|---|
| 20 | {
|
|---|
| 21 | private:
|
|---|
| 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 |
|
|---|
| 28 | public:
|
|---|
| 29 | MPedestalSubtractedEvt(const char *name=NULL, const char *title=NULL)
|
|---|
| 30 | : fNumSamples(0), fNumPixels(0)
|
|---|
| 31 | {
|
|---|
| 32 | fName = name ? name : "MPedestalSubtractedEvt";
|
|---|
| 33 | fTitle = title ? title : "";
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | void InitSize(const UInt_t i) { fNumPixels=i; }
|
|---|
| 37 | void InitSamples(UInt_t samples, UInt_t pixels=0);
|
|---|
| 38 |
|
|---|
| 39 | Float_t *GetSamples(UInt_t pixel=0) const;
|
|---|
| 40 | USample_t *GetSamplesRaw(UInt_t pixel=0) const;
|
|---|
| 41 |
|
|---|
| 42 | UInt_t GetNumSamples() const { return fNumSamples; }
|
|---|
| 43 | UShort_t GetNumPixels() const { return fNumPixels; }
|
|---|
| 44 |
|
|---|
| 45 | Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
|
|---|
| 46 | //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
|
|---|
| 47 |
|
|---|
| 48 | Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Float_t &val) const;
|
|---|
| 49 | Int_t GetMax(const Int_t pixidx, Float_t &val) const
|
|---|
| 50 | {
|
|---|
| 51 | return GetMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 52 | }
|
|---|
| 53 | Int_t GetMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
|
|---|
| 54 | {
|
|---|
| 55 | Float_t val;
|
|---|
| 56 | return GetMax(pixidx, first, last, val);
|
|---|
| 57 | }
|
|---|
| 58 | Int_t GetMaxPos(const Int_t pixidx, Float_t &val) const
|
|---|
| 59 | {
|
|---|
| 60 | return GetMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | Int_t GetMaxPos(const Int_t pixidx) const
|
|---|
| 64 | {
|
|---|
| 65 | Float_t val;
|
|---|
| 66 | return GetMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | Int_t GetRawMax(const Int_t idx, const Int_t first, const Int_t last, UInt_t &val) const;
|
|---|
| 70 | Int_t GetRawMax(const Int_t pixidx, UInt_t &val) const
|
|---|
| 71 | {
|
|---|
| 72 | return GetRawMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 73 | }
|
|---|
| 74 | Int_t GetRawMaxPos(const Int_t pixidx, const Int_t first, const Int_t last) const
|
|---|
| 75 | {
|
|---|
| 76 | UInt_t val;
|
|---|
| 77 | return GetRawMax(pixidx, first, last, val);
|
|---|
| 78 | }
|
|---|
| 79 | Int_t GetRawMaxPos(const Int_t pixidx, UInt_t &val) const
|
|---|
| 80 | {
|
|---|
| 81 | return GetRawMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | Int_t GetRawMaxPos(const Int_t pixidx) const
|
|---|
| 85 | {
|
|---|
| 86 | UInt_t val;
|
|---|
| 87 | return GetRawMax(pixidx, 0, fNumSamples-1, val);
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | UInt_t GetRawMaxVal(const Int_t idx, const Int_t first, const Int_t last) const
|
|---|
| 91 | {
|
|---|
| 92 | UInt_t val;
|
|---|
| 93 | GetRawMax(idx, first, last, val);
|
|---|
| 94 | return val;
|
|---|
| 95 | }
|
|---|
| 96 |
|
|---|
| 97 | void GetStat(const Int_t idx, Float_t &mean, Float_t &rms) const;
|
|---|
| 98 |
|
|---|
| 99 | Int_t GetSaturation(const Int_t pixidx, Int_t limit) const
|
|---|
| 100 | {
|
|---|
| 101 | Int_t first=0;
|
|---|
| 102 | Int_t last=fNumSamples-1;
|
|---|
| 103 | return GetSaturation(pixidx, limit, first, last);
|
|---|
| 104 | }
|
|---|
| 105 |
|
|---|
| 106 | Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
|
|---|
| 107 | {
|
|---|
| 108 | USample_t *ptr = GetSamplesRaw(idx);
|
|---|
| 109 |
|
|---|
| 110 | const USample_t *end = ptr + last - first + 1;
|
|---|
| 111 |
|
|---|
| 112 | Int_t sum = 0;
|
|---|
| 113 | while (ptr<end)
|
|---|
| 114 | sum += *ptr++;
|
|---|
| 115 |
|
|---|
| 116 | return sum;
|
|---|
| 117 | }
|
|---|
| 118 |
|
|---|
| 119 | void Print(Option_t *o="") const;
|
|---|
| 120 |
|
|---|
| 121 | Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
|
|---|
| 122 | void DrawPixelContent(Int_t) const { }
|
|---|
| 123 |
|
|---|
| 124 | ClassDef(MPedestalSubtractedEvt, 6) //Container to store the raw Event Data
|
|---|
| 125 | };
|
|---|
| 126 |
|
|---|
| 127 | #endif
|
|---|