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

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