source: trunk/MagicSoft/Mars/mjobs/MJPedestal.h@ 6463

Last change on this file since 6463 was 6331, checked in by gaug, 20 years ago
*** empty log message ***
File size: 5.9 KB
Line 
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
17class TCanvas;
18class MParList;
19class MHCamera;
20class TH1D;
21class MExtractor;
22class MExtractPedestal;
23class MEvtLoop;
24
25class MJPedestal : public MJCalib
26{
27private:
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 Axis_t fPedestalMin; //! Minimum Axis value for pedestal datacheck display
33 Axis_t fPedestalMax; //! Maximum Axis value for pedestal datacheck display
34 Axis_t fPedRmsMin; //! Minimum Axis value for ped. RMS datacheck display
35 Axis_t fPedRmsMax; //! Maximum Axis value for ped. RMS datacheck display
36
37 Float_t fRefPedClosedLids; //! Reference line pedestal for closed lids run
38 Float_t fRefPedExtraGalactic; //! Reference line pedestal for extragalactic source
39 Float_t fRefPedGalactic; //! Reference line pedestal for galactic source
40
41 Float_t fRefPedRmsClosedLidsInner; //! Ref. line ped. RMS for closed lids run - inner pixels
42 Float_t fRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
43 Float_t fRefPedRmsGalacticInner; //! Ref. line ped. RMS for galactic source - inner pixels
44
45 Float_t fRefPedRmsClosedLidsOuter; //! Ref. line ped. RMS for closed lids run - outer pixels
46 Float_t fRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
47 Float_t fRefPedRmsGalacticOuter; //! Ref. line ped. RMS for galactic source - outer pixels
48
49 TString fReferenceFile; // File name containing the reference values
50 TString fBadPixelsFile; // File name containing the bad pixels excluded beforehand
51
52 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices
53
54 MPedestalCam fPedestalCamIn; // Handed over pedestal results
55 MPedestalCam fPedestalCamOut; // Created pedestal results
56 MBadPixelsCam fBadPixels; // Bad Pixels
57 // MHPedestalCam fPedestalHist; // Histogramming pedestal Camera
58
59 enum Display_t { kDisplayNone, kDisplayNormal, kDisplayDataCheck }; // Possible Display types
60 Display_t fDisplayType; // Chosen Display type
61
62 enum Storage_t { kNoStorage }; // Possible flags for the storage of results
63 Byte_t fStorage; // Bit-field for chosen storage type
64
65 enum Extract_t { kUseData, kUsePedRun }; // Possible flags for the extraction of the pedestal
66 Extract_t fExtractType; // Chosen extractor type
67
68 enum Extraction { kFundamental, kWithExtractorRndm, kWithExtractor };
69 Int_t fExtractionType; // Flag if the extractor is used to calculate the pedestals
70
71 Bool_t fIsUseHists; // Switch on histogramming or not
72
73 MExtractor *ReadCalibration() const;
74 Bool_t ReadPedestalCam();
75 Bool_t WriteResult();
76 //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
77
78 void DisplayResult(MParList &plist);
79 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
80 void DisplayOutliers(TH1D *hist) const;
81 void FixDataCheckHist(TH1D *hist) const;
82
83 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
84
85 Bool_t CheckEnvLocal();
86
87 const char* GetOutputFileName() const;
88
89 void ReadReferenceFile();
90
91public:
92 MJPedestal(const char *name=NULL, const char *title=NULL);
93 ~MJPedestal();
94
95 MPedestalCam &GetPedestalCam() { return fPedestalCamOut; }
96 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
97
98 const char* GetOutputFile() const;
99
100 // const MHPedestalCam &GetPedestalHist() const { return fPedestalHist; }
101
102 const Bool_t IsUseData() const { return fExtractType == kUseData; }
103
104 Bool_t Process ();
105 Bool_t ProcessFile();
106
107 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
108 void SetPedestals(const MPedestalCam &ped) { ped.Copy(fPedestalCamIn); }
109 void SetExtractor(MExtractor* ext);
110 void SetUseData() { fExtractType = kUseData; }
111 void SetUseHists() { fIsUseHists = kTRUE; }
112 void SetUsePedRun() { fExtractType = kUsePedRun; }
113 void SetDataCheckDisplay() { fDisplayType = kDisplayDataCheck; }
114 void SetNormalDisplay() { fDisplayType = kDisplayNormal; }
115 void SetNoDisplay() { fDisplayType = kDisplayNone; }
116
117 void SetExtractionFundamental() { fExtractionType=kFundamental; /*fPedestalCamOut.SetName("MPedestalFundamental");*/ }
118 void SetExtractionWithExtractorRndm() { fExtractionType=kWithExtractorRndm; /*fPedestalCamOut.SetName("MPedestalExtractorRndm");*/ }
119 void SetExtractionWithExtractor() { fExtractionType=kWithExtractor; /*fPedestalCamOut.SetName("MPedestalExtractor");*/ }
120
121 void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
122 void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
123
124 MExtractor *GetExtractor() const { return fExtractor; }
125
126 // Storage
127 void SetNoStorage(const Bool_t b=kTRUE) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
128 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); }
129
130 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
131};
132
133#endif
Note: See TracBrowser for help on using the repository browser.