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

Last change on this file since 5427 was 5387, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 4.9 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 MEvtLoop;
21
22class MJPedestal : public MJob
23{
24private:
25
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 fPedestalCam; // Created pedestal results
47 MBadPixelsCam fBadPixels; // Bad Pixels
48
49 enum Display_t {kDataCheckDisplay, kNormalDisplay}; // Possible Display types
50 Display_t fDisplayType; // Chosen Display type
51
52 enum Storage_t { kNoStorage }; // Possible flags for the storage of results
53 Byte_t fStorage; // Bit-field for chosen storage type
54
55 Bool_t fDataCheck; // Flag if the data check is run on raw data
56
57 enum Extract_t {kUseData, kUsePedRun, kUseExtractor}; // Possible flags for the extraction of the pedestal
58 Extract_t fExtractType; // Chosen extractor type
59
60 MExtractor *ReadCalibration() const;
61 Bool_t ReadPedestalCam();
62 Bool_t WriteResult();
63 //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
64
65 void DisplayResult(MParList &plist);
66 void DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
67 void DisplayOutliers(TH1D *hist) const;
68 void FixDataCheckHist(TH1D *hist) const;
69
70 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
71
72 Bool_t CheckEnvLocal();
73
74public:
75
76 MJPedestal(const char *name=NULL, const char *title=NULL);
77
78 MPedestalCam &GetPedestalCam() { return fPedestalCam; }
79 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
80
81 const char* GetOutputFile() const;
82 const Bool_t IsDataCheck() const { return fDataCheck; }
83 const Bool_t IsUseData() const { return fExtractType == kUseData; }
84 const Bool_t IsUseExtractor() const { return fExtractType == kUseExtractor; }
85 const Bool_t IsUsePedRun() const { return fExtractType == kUsePedRun; }
86
87 Bool_t Process ();
88 Bool_t ProcessFile();
89
90 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
91 void SetExtractor(MExtractor* ext) { fExtractor = ext; }
92 void SetInput(MRunIter *iter) { fRuns = iter; }
93 void SetUseData() { fExtractType = kUseData; }
94 void SetUseExtractor() { fExtractType = kUseExtractor; }
95 void SetUsePedRun() { fExtractType = kUsePedRun; }
96 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
97 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
98 void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
99
100 void SetPedContainerName(const char *name) { fPedestalCam.SetName(name); }
101
102 // Storage
103 void SetNoStorage(const Bool_t b) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
104 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); }
105
106 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
107};
108
109#endif
Note: See TracBrowser for help on using the repository browser.