source: branches/Mars_use_drstimefiles/mjobs/MJPedestal.h@ 20051

Last change on this file since 20051 was 9317, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 6.6 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 static const TString fgReferenceFile; //! default for fReferenceFile ("pedestalref.rc")
29 static const TString fgBadPixelsFile; //! default for fBadPixelsFile ("badpixels_0_559.rc")
30
31 static const Float_t fgExtractWinLeft; //! default for fExtractWinLeft (now set to: 2.5)
32 static const Float_t fgExtractWinRight; //! default for fExtractWinRight (now set to: 6.0)
33
34 Axis_t fPedestalMin; //! Minimum Axis value for pedestal datacheck display
35 Axis_t fPedestalMax; //! Maximum Axis value for pedestal datacheck display
36 Axis_t fPedRmsMin; //! Minimum Axis value for ped. RMS datacheck display
37 Axis_t fPedRmsMax; //! Maximum Axis value for ped. RMS datacheck display
38
39 Float_t fRefPedClosedLids; //! Reference line pedestal for closed lids run
40 Float_t fRefPedExtraGalactic; //! Reference line pedestal for extragalactic source
41 Float_t fRefPedGalactic; //! Reference line pedestal for galactic source
42
43 Float_t fRefPedRmsClosedLidsInner; //! Ref. line ped. RMS for closed lids run - inner pixels
44 Float_t fRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
45 Float_t fRefPedRmsGalacticInner; //! Ref. line ped. RMS for galactic source - inner pixels
46
47 Float_t fRefPedRmsClosedLidsOuter; //! Ref. line ped. RMS for closed lids run - outer pixels
48 Float_t fRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
49 Float_t fRefPedRmsGalacticOuter; //! Ref. line ped. RMS for galactic source - outer pixels
50
51 Float_t fExtractWinLeft; // Number of FADC slices to extract leftward from mean pulse pos.
52 Float_t fExtractWinRight; // Number of FADC slices to extract rightward from mean pulse pos.
53
54 TString fReferenceFile; // File name containing the reference values
55 TString fBadPixelsFile; // File name containing the bad pixels excluded beforehand
56
57 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices
58
59 MPedestalCam fPedestalCamIn; // Handed over pedestal results
60 MPedestalCam fPedestalCamOut; // Created pedestal results
61 MBadPixelsCam fBadPixels; // Bad Pixels
62 // MHPedestalCam fPedestalHist; // Histogramming pedestal Camera
63
64 enum Display_t { kDisplayNone, kDisplayNormal, kDisplayDataCheck }; // Possible Display types
65 Display_t fDisplayType; // Chosen Display type
66
67 enum Extract_t { kUseData, kUsePedRun }; // Possible flags for the extraction of the pedestal
68 Extract_t fExtractType; // Chosen extractor type
69
70 enum Extraction { kFundamental, kWithExtractorRndm, kWithExtractor };
71 Int_t fExtractionType; // Flag if the extractor is used to calculate the pedestals
72
73// Bool_t fIsUseHists; // Switch on histogramming or not
74 Bool_t fDeadPixelCheck; // Should the dead pixel check be done?
75
76 UInt_t fMinEvents; // Minimum number of events
77 UInt_t fMinPedestals; // Minimum number of events
78 UInt_t fMaxPedestals; // Maximum number of events for pedestal extraction
79 UInt_t fMinCosmics; // Minimum number of events
80 UInt_t fMaxCosmics; // Maximum number of events for pulse extraction
81
82 MExtractor *ReadCalibration();
83 Bool_t ReadPedestalCam();
84 //Bool_t WriteResult();
85 Bool_t WritePulsePos(TObject *obj) const;
86 //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
87
88 void DisplayResult(const MParList &plist);
89 void DisplayReferenceLines(const MHCamera &hist, const Int_t what) const;
90 //void DisplayOutliers(TH1D *hist) const;
91 void FixDataCheckHist(TH1D *hist) const;
92 Int_t PulsePosCheck(const MParList &plist) const;
93
94 Bool_t CheckEnvLocal();
95
96 const char* GetOutputFileName() const;
97
98 void ReadReferenceFile();
99
100 Bool_t WriteExtractor() const;
101
102public:
103 MJPedestal(const char *name=NULL, const char *title=NULL);
104 ~MJPedestal();
105
106 MPedestalCam &GetPedestalCam() { return fPedestalCamOut; }
107 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
108
109 // const MHPedestalCam &GetPedestalHist() const { return fPedestalHist; }
110
111 const Bool_t IsUseData() const { return fExtractType == kUseData; }
112
113 Int_t Process();
114
115 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
116 void SetPedestals(const MPedestalCam &ped) { ped.Copy(fPedestalCamIn); }
117 void SetExtractor(MExtractor* ext);
118 void SetUseData() { fExtractType = kUseData; }
119// void SetUseHists( const Bool_t b=kTRUE) { fIsUseHists = b; }
120 void SetDeadPixelCheck(const Bool_t b=kTRUE) { fDeadPixelCheck = b; }
121 void SetUsePedRun() { fExtractType = kUsePedRun; }
122 void SetDataCheckDisplay() { fDisplayType = kDisplayDataCheck; }
123 void SetNormalDisplay() { fDisplayType = kDisplayNormal; }
124 void SetNoDisplay() { fDisplayType = kDisplayNone; }
125
126 void SetExtractionFundamental() { fExtractionType=kFundamental; /*fPedestalCamOut.SetName("MPedestalFundamental");*/ }
127 void SetExtractionWithExtractorRndm() { fExtractionType=kWithExtractorRndm; /*fPedestalCamOut.SetName("MPedestalExtractorRndm");*/ }
128 void SetExtractionWithExtractor() { fExtractionType=kWithExtractor; /*fPedestalCamOut.SetName("MPedestalExtractor");*/ }
129
130 void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
131 void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
132
133 void SetExtractWinLeft ( const Float_t f=fgExtractWinLeft ) { fExtractWinLeft = f; }
134 void SetExtractWinRight( const Float_t f=fgExtractWinRight ) { fExtractWinRight = f; }
135
136 MExtractor *GetExtractor() const { return fExtractor; }
137
138 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
139};
140
141#endif
Note: See TracBrowser for help on using the repository browser.