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

Last change on this file since 5817 was 5760, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 5.4 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 static const Double_t fgPedestalMin; //! Minimum Axis value for pedestal datacheck display
27 static const Double_t fgPedestalMax; //! Maximum Axis value for pedestal datacheck display
28 static const Double_t fgPedRmsMin; //! Minimum Axis value for ped. RMS datacheck display
29 static const Double_t fgPedRmsMax; //! Maximum Axis value for ped. RMS datacheck display
30
31 static const Float_t fgRefPedClosedLids; //! Reference line pedestal for closed lids run
32 static const Float_t fgRefPedExtraGalactic; //! Reference line pedestal for extragalactic source
33 static const Float_t fgRefPedGalactic; //! Reference line pedestal for galactic source
34
35 static const Float_t fgRefPedRmsClosedLidsInner; //! Ref. line ped. RMS for closed lids run - inner pixels
36 static const Float_t fgRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
37 static const Float_t fgRefPedRmsGalacticInner; //! Ref. line ped. RMS for galactic source - inner pixels
38
39 static const Float_t fgRefPedRmsClosedLidsOuter; //! Ref. line ped. RMS for closed lids run - outer pixels
40 static const Float_t fgRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
41 static const Float_t fgRefPedRmsGalacticOuter; //! Ref. line ped. RMS for galactic source - outer pixels
42
43 MRunIter *fRuns; // Used pedestal runs
44 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices
45
46 MPedestalCam fPedestalCamIn; // Handed over pedestal results
47 MPedestalCam fPedestalCamOut; // Created pedestal results
48 MBadPixelsCam fBadPixels; // Bad Pixels
49
50 enum Display_t {kDataCheckDisplay, kNormalDisplay}; // Possible Display types
51 Display_t fDisplayType; // Chosen Display type
52
53 enum Storage_t { kNoStorage }; // Possible flags for the storage of results
54 Byte_t fStorage; // Bit-field for chosen storage type
55
56 Bool_t fDataCheck; // Flag if the data check is run on raw data
57
58 enum Extract_t {kUseData, kUsePedRun, kUseHists }; // Possible flags for the extraction of the pedestal
59 Extract_t fExtractType; // Chosen extractor type
60
61 enum Extraction { kFundamental, kWithExtractorRndm, kWithExtractor };
62 Int_t fExtractionType; // Flag if the extractor is used to calculate the pedestals
63
64 MExtractor *ReadCalibration() const;
65 Bool_t ReadPedestalCam();
66 Bool_t WriteResult();
67 //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
68
69 Bool_t SetupExtractor(MParList &plist, MExtractPedestal &extped);
70
71 void DisplayResult(MParList &plist);
72 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
73 void DisplayOutliers(TH1D *hist) const;
74 void FixDataCheckHist(TH1D *hist) const;
75
76 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
77
78 Bool_t CheckEnvLocal();
79
80public:
81 MJPedestal(const char *name=NULL, const char *title=NULL);
82 ~MJPedestal();
83
84 MPedestalCam &GetPedestalCam() { return fPedestalCamOut; }
85 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
86
87 const char* GetOutputFile() const;
88
89 const Bool_t IsDataCheck() const { return fDataCheck; }
90 const Bool_t IsUseData() const { return fExtractType == kUseData; }
91
92 Bool_t Process ();
93 Bool_t ProcessFile();
94
95 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
96 void SetPedestals(const MPedestalCam &ped) { ped.Copy(fPedestalCamIn); }
97 void SetExtractor(MExtractor* ext);
98 void SetInput(MRunIter *iter) { fRuns = iter; }
99 void SetUseData() { fExtractType = kUseData; }
100 void SetUseHists() { fExtractType = kUseHists; }
101 void SetUsePedRun() { fExtractType = kUsePedRun; }
102 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
103 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
104 void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
105
106 void SetExtractionFundamental() { fExtractionType=kFundamental; }
107 void SetExtractionWithExtractorRndm() { fExtractionType=kWithExtractorRndm; }
108 void SetExtractionWithExtractor() { fExtractionType=kWithExtractor; }
109
110 MExtractor *GetExtractor() const { return fExtractor; }
111
112 // Storage
113 void SetNoStorage(const Bool_t b=kTRUE) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
114 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); }
115
116 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
117};
118
119#endif
Note: See TracBrowser for help on using the repository browser.