| 1 | #ifndef MRAWEVTPIXELITER_H
|
|---|
| 2 | #define MRAWEVTPIXELITER_H
|
|---|
| 3 | ///////////////////////////////////////////////////////////////////////////////
|
|---|
| 4 | //
|
|---|
| 5 | // MRawEvtPixelIter
|
|---|
| 6 | //
|
|---|
| 7 | // class to iterate over all pixels of one event.
|
|---|
| 8 | //
|
|---|
| 9 | ///////////////////////////////////////////////////////////////////////////////
|
|---|
| 10 | #ifndef MAGIC_H
|
|---|
| 11 | #include "MAGIC.h"
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 | class MRawEvtData;
|
|---|
| 15 |
|
|---|
| 16 | class MRawEvtPixelIter
|
|---|
| 17 | {
|
|---|
| 18 | private:
|
|---|
| 19 | UShort_t fNumHiGainEntry; //! actual number of entry in fHiGainPixId
|
|---|
| 20 | UShort_t fNumLoGainEntry; //! actual number of entry in fLoGainPixId
|
|---|
| 21 |
|
|---|
| 22 | UShort_t *fHiGainId; //! actual entry of fHiGainPixId
|
|---|
| 23 | UShort_t *fLoGainId; //! actual entry of fLoGainPixId
|
|---|
| 24 |
|
|---|
| 25 | Byte_t *fHiGainPos; //! pointer to hi-gain samples of actual pixel
|
|---|
| 26 | Byte_t *fLoGainPos; //! pointer to lo-gain samples of actual pixel
|
|---|
| 27 |
|
|---|
| 28 | UShort_t fNumEntry;
|
|---|
| 29 |
|
|---|
| 30 | MRawEvtData *fData; //! pointer to object which we are iterating
|
|---|
| 31 |
|
|---|
| 32 | public:
|
|---|
| 33 | MRawEvtPixelIter(MRawEvtData *dat) : fData(dat)
|
|---|
| 34 | {
|
|---|
| 35 | Reset();
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | MRawEvtData *Next();
|
|---|
| 39 |
|
|---|
| 40 | UShort_t GetPixelId() const
|
|---|
| 41 | {
|
|---|
| 42 | //
|
|---|
| 43 | // return Id of actual pixel
|
|---|
| 44 | //
|
|---|
| 45 | return *fHiGainId;
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | UShort_t GetNumEntry() const
|
|---|
| 49 | {
|
|---|
| 50 | return fNumHiGainEntry;
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | Byte_t GetNumPixels() const;
|
|---|
| 54 |
|
|---|
| 55 | Byte_t *GetHiGainFadcSamples() const
|
|---|
| 56 | {
|
|---|
| 57 | //
|
|---|
| 58 | // return a pointer to the fadc samples of the hi gains
|
|---|
| 59 | // WARNING: Don't forget to get the number of valid entries
|
|---|
| 60 | // (GetNumSamples) to know how many entries of the array
|
|---|
| 61 | // belong to the actual pixel
|
|---|
| 62 | //
|
|---|
| 63 | return fHiGainPos;
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | ULong_t GetSumHiGainFadcSamples() const;
|
|---|
| 67 |
|
|---|
| 68 | Bool_t HasLoGain() const
|
|---|
| 69 | {
|
|---|
| 70 | //
|
|---|
| 71 | // return kTRUE the lo gains exist for the actual pixel, else return kFALSE
|
|---|
| 72 | //
|
|---|
| 73 | return *fHiGainId==*fLoGainId;
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 | Byte_t *GetLoGainFadcSamples() const
|
|---|
| 77 | {
|
|---|
| 78 | //
|
|---|
| 79 | // return a pointer to the fadc samples of the lo gains if they exist
|
|---|
| 80 | // for the actual pixel, else return zero
|
|---|
| 81 | //
|
|---|
| 82 | return HasLoGain() ? fLoGainPos : NULL;
|
|---|
| 83 | }
|
|---|
| 84 |
|
|---|
| 85 | ULong_t GetSumLoGainFadcSamples() const;
|
|---|
| 86 |
|
|---|
| 87 | void Reset();
|
|---|
| 88 |
|
|---|
| 89 | void Draw(Option_t *t="GRAPH");
|
|---|
| 90 |
|
|---|
| 91 | ClassDef(MRawEvtPixelIter, 0) // iterates over all pixels of one MRawEvtData object
|
|---|
| 92 | };
|
|---|
| 93 |
|
|---|
| 94 | #endif
|
|---|