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

Last change on this file since 6321 was 6304, checked in by gaug, 20 years ago
*** empty log message ***
File size: 5.8 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, kUseHists }; // 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 MExtractor *ReadCalibration() const;
72 Bool_t ReadPedestalCam();
73 Bool_t WriteResult();
74 //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
75
76 void DisplayResult(MParList &plist);
77 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
78 void DisplayOutliers(TH1D *hist) const;
79 void FixDataCheckHist(TH1D *hist) const;
80
81 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
82
83 Bool_t CheckEnvLocal();
84
85 const char* GetOutputFileName() const;
86
87 void ReadReferenceFile();
88
89public:
90 MJPedestal(const char *name=NULL, const char *title=NULL);
91 ~MJPedestal();
92
93 MPedestalCam &GetPedestalCam() { return fPedestalCamOut; }
94 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
95
96 const char* GetOutputFile() const;
97
98 MHPedestalCam &GetPedestalHist() { return fPedestalHist; }
99
100 const Bool_t IsUseData() const { return fExtractType == kUseData; }
101
102 Bool_t Process ();
103 Bool_t ProcessFile();
104
105 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
106 void SetPedestals(const MPedestalCam &ped) { ped.Copy(fPedestalCamIn); }
107 void SetExtractor(MExtractor* ext);
108 void SetUseData() { fExtractType = kUseData; }
109 void SetUseHists() { fExtractType = kUseHists; }
110 void SetUsePedRun() { fExtractType = kUsePedRun; }
111 void SetDataCheckDisplay() { fDisplayType = kDisplayDataCheck; }
112 void SetNormalDisplay() { fDisplayType = kDisplayNormal; }
113 void SetNoDisplay() { fDisplayType = kDisplayNone; }
114
115 void SetExtractionFundamental() { fExtractionType=kFundamental; /*fPedestalCamOut.SetName("MPedestalFundamental");*/ }
116 void SetExtractionWithExtractorRndm() { fExtractionType=kWithExtractorRndm; /*fPedestalCamOut.SetName("MPedestalExtractorRndm");*/ }
117 void SetExtractionWithExtractor() { fExtractionType=kWithExtractor; /*fPedestalCamOut.SetName("MPedestalExtractor");*/ }
118
119 void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
120 void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
121
122 MExtractor *GetExtractor() const { return fExtractor; }
123
124 // Storage
125 void SetNoStorage(const Bool_t b=kTRUE) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
126 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); }
127
128 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
129};
130
131#endif
Note: See TracBrowser for help on using the repository browser.