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

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