source: trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h@ 8296

Last change on this file since 8296 was 8250, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.2 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_MArrayB
14#include "MArrayB.h"
15#endif
16
17class MPedestalSubtractedEvt : public MParContainer, public MCamEvent
18{
19private:
20 MArrayF fSamples; // list of all samples with pedestal subtracted
21 MArrayB fSamplesRaw; // list of all samples (raw)
22
23 UInt_t fNumSamples; // number of samples per pixel
24 UInt_t fNumPixels; // number of pixels
25
26public:
27 MPedestalSubtractedEvt(const char *name=NULL, const char *title=NULL)
28 : fNumSamples(0), fNumPixels(0)
29 {
30 }
31
32 void InitSize(const UInt_t i) { fNumPixels=i; }
33 void InitSamples(UInt_t samples, UInt_t pixels=0);
34
35 Float_t *GetSamples(UInt_t pixel) const;
36 Byte_t *GetSamplesRaw(UInt_t pixel) const;
37
38 UInt_t GetNumSamples() const { return fNumSamples; }
39 UShort_t GetNumPixels() const { return fNumPixels; }
40
41 Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
42 //void InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
43 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Int_t &val) const;
44 Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const
45 {
46 Int_t val;
47 return GetMax(pixidx, first, last, val);
48 }
49 Int_t GetMax(const Int_t pixidx, Int_t &val) const
50 {
51 return GetMax(pixidx, 0, fNumSamples, val);
52 }
53
54 Int_t GetMax(const Int_t pixidx) const
55 {
56 Int_t val;
57 return GetMax(pixidx, 0, fNumSamples, val);
58 }
59
60 Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
61 {
62 Byte_t *ptr = GetSamplesRaw(idx);
63
64 const Byte_t *end = ptr + last - first + 1;
65
66 Int_t sum = 0;
67 while (ptr<end)
68 sum += *ptr++;
69
70 return sum;
71 }
72
73 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
74 void DrawPixelContent(Int_t num) const { }
75
76 ClassDef(MPedestalSubtractedEvt, 6) //Container to store the raw Event Data
77};
78
79#endif
Note: See TracBrowser for help on using the repository browser.