1 | #ifndef MARS_MJPedestal
|
---|
2 | #define MARS_MJPedestal
|
---|
3 |
|
---|
4 | #ifndef MARS_MJCalib
|
---|
5 | #include "MJCalib.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MPedestalCam
|
---|
8 | #include "MPedestalCam.h"
|
---|
9 | #endif
|
---|
10 | #ifndef MARS_MHPedestalCam
|
---|
11 | #include "MHPedestalCam.h"
|
---|
12 | #endif
|
---|
13 | #ifndef MARS_MBadPixelsCam
|
---|
14 | #include "MBadPixelsCam.h"
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | class TCanvas;
|
---|
18 | class MParList;
|
---|
19 | class MHCamera;
|
---|
20 | class TH1D;
|
---|
21 | class MExtractor;
|
---|
22 | class MExtractPedestal;
|
---|
23 | class MEvtLoop;
|
---|
24 |
|
---|
25 | class MJPedestal : public MJCalib
|
---|
26 | {
|
---|
27 | private:
|
---|
28 |
|
---|
29 | static const TString fgReferenceFile; //! default for fReferenceFile ("pedestalref.rc")
|
---|
30 | static const TString fgBadPixelsFile; //! default for fBadPixelsFile ("badpixels_0_559.rc")
|
---|
31 |
|
---|
32 | static const Float_t fgExtractWinLeft; //! default for fExtractWinLeft (now set to: 2.5)
|
---|
33 | static const Float_t fgExtractWinRight; //! default for fExtractWinRight (now set to: 6.0)
|
---|
34 |
|
---|
35 | Axis_t fPedestalMin; //! Minimum Axis value for pedestal datacheck display
|
---|
36 | Axis_t fPedestalMax; //! Maximum Axis value for pedestal datacheck display
|
---|
37 | Axis_t fPedRmsMin; //! Minimum Axis value for ped. RMS datacheck display
|
---|
38 | Axis_t fPedRmsMax; //! Maximum Axis value for ped. RMS datacheck display
|
---|
39 |
|
---|
40 | Float_t fRefPedClosedLids; //! Reference line pedestal for closed lids run
|
---|
41 | Float_t fRefPedExtraGalactic; //! Reference line pedestal for extragalactic source
|
---|
42 | Float_t fRefPedGalactic; //! Reference line pedestal for galactic source
|
---|
43 |
|
---|
44 | Float_t fRefPedRmsClosedLidsInner; //! Ref. line ped. RMS for closed lids run - inner pixels
|
---|
45 | Float_t fRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
|
---|
46 | Float_t fRefPedRmsGalacticInner; //! Ref. line ped. RMS for galactic source - inner pixels
|
---|
47 |
|
---|
48 | Float_t fRefPedRmsClosedLidsOuter; //! Ref. line ped. RMS for closed lids run - outer pixels
|
---|
49 | Float_t fRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
|
---|
50 | Float_t fRefPedRmsGalacticOuter; //! Ref. line ped. RMS for galactic source - outer pixels
|
---|
51 |
|
---|
52 | Float_t fExtractWinLeft; // Number of FADC slices to extract leftward from mean pulse pos.
|
---|
53 | Float_t fExtractWinRight; // Number of FADC slices to extract rightward from mean pulse pos.
|
---|
54 |
|
---|
55 | TString fReferenceFile; // File name containing the reference values
|
---|
56 | TString fBadPixelsFile; // File name containing the bad pixels excluded beforehand
|
---|
57 |
|
---|
58 | MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices
|
---|
59 |
|
---|
60 | MPedestalCam fPedestalCamIn; // Handed over pedestal results
|
---|
61 | MPedestalCam fPedestalCamOut; // Created pedestal results
|
---|
62 | MBadPixelsCam fBadPixels; // Bad Pixels
|
---|
63 | // MHPedestalCam fPedestalHist; // Histogramming pedestal Camera
|
---|
64 |
|
---|
65 | enum Display_t { kDisplayNone, kDisplayNormal, kDisplayDataCheck }; // Possible Display types
|
---|
66 | Display_t fDisplayType; // Chosen Display type
|
---|
67 |
|
---|
68 | enum Extract_t { kUseData, kUsePedRun }; // Possible flags for the extraction of the pedestal
|
---|
69 | Extract_t fExtractType; // Chosen extractor type
|
---|
70 |
|
---|
71 | enum Extraction { kFundamental, kWithExtractorRndm, kWithExtractor };
|
---|
72 | Int_t fExtractionType; // Flag if the extractor is used to calculate the pedestals
|
---|
73 |
|
---|
74 | Bool_t fIsUseHists; // Switch on histogramming or not
|
---|
75 |
|
---|
76 | MExtractor *ReadCalibration() const;
|
---|
77 | Bool_t ReadPedestalCam();
|
---|
78 | Bool_t WriteResult();
|
---|
79 | //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
|
---|
80 |
|
---|
81 | void DisplayResult(MParList &plist);
|
---|
82 | void DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
|
---|
83 | void DisplayOutliers(TH1D *hist) const;
|
---|
84 | void FixDataCheckHist(TH1D *hist) const;
|
---|
85 |
|
---|
86 | Bool_t CheckEnvLocal();
|
---|
87 |
|
---|
88 | const char* GetOutputFileName() const;
|
---|
89 |
|
---|
90 | void ReadReferenceFile();
|
---|
91 |
|
---|
92 | Bool_t WriteExtractor() const;
|
---|
93 |
|
---|
94 | public:
|
---|
95 | MJPedestal(const char *name=NULL, const char *title=NULL);
|
---|
96 | ~MJPedestal();
|
---|
97 |
|
---|
98 | MPedestalCam &GetPedestalCam() { return fPedestalCamOut; }
|
---|
99 | const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
|
---|
100 |
|
---|
101 | const char* GetOutputFile() const;
|
---|
102 |
|
---|
103 | // const MHPedestalCam &GetPedestalHist() const { return fPedestalHist; }
|
---|
104 |
|
---|
105 | const Bool_t IsUseData() const { return fExtractType == kUseData; }
|
---|
106 |
|
---|
107 | Bool_t Process ();
|
---|
108 | Bool_t ProcessFile();
|
---|
109 |
|
---|
110 | void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
111 | void SetPedestals(const MPedestalCam &ped) { ped.Copy(fPedestalCamIn); }
|
---|
112 | void SetExtractor(MExtractor* ext);
|
---|
113 | void SetUseData() { fExtractType = kUseData; }
|
---|
114 | void SetUseHists( const Bool_t b=kTRUE) { fIsUseHists = b; }
|
---|
115 | void SetUsePedRun() { fExtractType = kUsePedRun; }
|
---|
116 | void SetDataCheckDisplay() { fDisplayType = kDisplayDataCheck; }
|
---|
117 | void SetNormalDisplay() { fDisplayType = kDisplayNormal; }
|
---|
118 | void SetNoDisplay() { fDisplayType = kDisplayNone; }
|
---|
119 |
|
---|
120 | void SetExtractionFundamental() { fExtractionType=kFundamental; /*fPedestalCamOut.SetName("MPedestalFundamental");*/ }
|
---|
121 | void SetExtractionWithExtractorRndm() { fExtractionType=kWithExtractorRndm; /*fPedestalCamOut.SetName("MPedestalExtractorRndm");*/ }
|
---|
122 | void SetExtractionWithExtractor() { fExtractionType=kWithExtractor; /*fPedestalCamOut.SetName("MPedestalExtractor");*/ }
|
---|
123 |
|
---|
124 | void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
|
---|
125 | void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
|
---|
126 |
|
---|
127 | void SetExtractWinLeft ( const Float_t f=fgExtractWinLeft ) { fExtractWinLeft = f; }
|
---|
128 | void SetExtractWinRight( const Float_t f=fgExtractWinRight ) { fExtractWinRight = f; }
|
---|
129 |
|
---|
130 | MExtractor *GetExtractor() const { return fExtractor; }
|
---|
131 |
|
---|
132 | ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
|
---|
133 | };
|
---|
134 |
|
---|
135 | #endif
|
---|