source: trunk/MagicSoft/Mars/msignal/MSignalPix.h@ 7829

Last change on this file since 7829 was 7829, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1#ifndef MARS_MSignalPix
2#define MARS_MSignalPix
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_MMath
8#include "MMath.h"
9#endif
10
11class MSignalPix : public MParContainer
12{
13private:
14 Bool_t fIsCore; //! the pixel is a Core pixel -> kTRUE
15 Short_t fRing; // NT: number of analyzed rings around the core pixels, fRing>0 means: used, fRing= 0 means: unused, fRing= -1 means: unmapped (no possible to use in the calculation of the image parameters)
16 Short_t fIdxIsland; //! the pixel is a Core pixel -> kTRUE
17
18 Float_t fPhot; // The number of Cerenkov photons
19 Float_t fErrPhot; // the error of fPhot
20 Float_t fArrivalTime; // Calibrated Arrival Time
21
22 Bool_t fLoGainUsed; //! Is lo gain used
23
24public:
25 MSignalPix(Float_t phot=0, Float_t errphot=0);
26
27 void Clear(Option_t *o=0);
28 void Copy(TObject &obj) const
29 {
30 MSignalPix &pix = (MSignalPix&)obj;
31 pix.fIsCore = fIsCore;
32 pix.fRing = fRing;
33 pix.fIdxIsland = fIdxIsland;
34 pix.fPhot = fPhot;
35 pix.fErrPhot = fErrPhot;
36 pix.fLoGainUsed = fLoGainUsed;
37 }
38
39 Float_t GetNumPhotons() const { return fPhot; }
40 Float_t GetErrorPhot() const { return fErrPhot; }
41 Float_t GetArrivalTime() const { return fArrivalTime; }
42
43 Bool_t IsPixelUsed() const { return fRing>0; }
44 Bool_t IsPixelUnmapped() const { return fRing==-1; }
45 void SetPixelUnused() { fRing=0; }
46 void SetPixelUsed() { fRing=1; }
47 void SetPixelUnmapped() { fRing=-1; }
48 void SetIdxIsland(Short_t num) { fIdxIsland=num; }
49 Short_t GetIdxIsland() const { return fIdxIsland; }
50
51 void SetRing(UShort_t r) { fRing = r; }
52 Short_t GetRing() const { return fRing;}
53
54 void SetPixelCore(Bool_t b=kTRUE) { fIsCore = b; }
55 Bool_t IsPixelCore() const { return fIsCore; }
56
57 void SetNumPhotons(Float_t f) { MMath::ReducePrecision(f); fPhot = f; }
58 void SetErrorPhot(Float_t f) { MMath::ReducePrecision(f); fErrPhot = f; }
59 void Set(Float_t np, Float_t ep) { MMath::ReducePrecision(np); MMath::ReducePrecision(ep); fPhot = np; fErrPhot = ep; }
60 void SetArrivalTime(Float_t tm) { MMath::ReducePrecision(tm); fArrivalTime = tm; }
61
62 void SetLoGainUsed(Bool_t b=kTRUE) { fLoGainUsed=b; }
63 Bool_t IsLoGainUsed() const { return fLoGainUsed; }
64
65 void AddNumPhotons(Float_t f) { fPhot += f; }
66 void Scale(Float_t f) { fPhot /= f; }
67
68 void Print(Option_t *opt = NULL) const;
69
70 ClassDef(MSignalPix, 7) // class containing information about the Cerenkov Photons in a pixel
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.