source: tags/Mars-V0.9.4/mcalib/MCalibrationRelTimeCalc.h

Last change on this file was 7188, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 4.1 KB
Line 
1#ifndef MARS_MCalibrationRelTimeCalc
2#define MARS_MCalibrationRelTimeCalc
3
4/////////////////////////////////////////////////////////////////////////////
5//
6// MCalibrationRelTimeCalc
7//
8// Integrates the time slices of the all pixels of a calibration event
9// and substract the pedestal value
10//
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef MARS_MTask
14#include "MTask.h"
15#endif
16
17#ifndef MARS_MBadPixelsPix
18#include "MBadPixelsPix.h"
19#endif
20
21class MCalibrationIntensityRelTimeCam;
22class MCalibrationRelTimeCam;
23class MGeomCam;
24class MBadPixelsIntensityCam;
25class MBadPixelsCam;
26
27class MCalibrationRelTimeCalc : public MTask
28{
29private:
30
31 static const Float_t fgRelTimeResolutionLimit; //! Default for fRelTimeResolutionLimit (now set to: 0.75)
32
33 // Variables
34 Float_t fRelTimeResolutionLimit; // Limit acceptance rel. time resolution (in FADC slices)
35 TString fOutputPath; // Path to the output file
36 TString fOutputFile; // Name of the output file
37
38 // Pointers
39 MBadPixelsIntensityCam *fIntensBad; // Bad Pixels Intensity Cam
40 MBadPixelsCam *fBadPixels; // Bad Pixels
41 MCalibrationIntensityRelTimeCam *fIntensCam; // Calibrated RelTimes for different intensities
42 MCalibrationRelTimeCam *fCam; // Calibrated RelTimes of all pixels
43 MGeomCam *fGeom; //! Camera geometry
44
45 // enums
46 enum Check_t
47 {
48 kCheckHistOverflow,
49 kCheckDeviatingBehavior,
50 kCheckOscillations,
51 kCheckFitResults
52 }; // Possible Checks
53
54 Byte_t fCheckFlags; // Bit-field to hold the possible check flags
55
56 enum { kDebug }; // Possible flags
57
58 Byte_t fFlags; // Bit-field for the general flags
59
60 // functions
61 const char* GetOutputFile ();
62 void FinalizeAverageResolution();
63 void FinalizeRelTimes ();
64 void FinalizeBadPixels ();
65 void FinalizeUnsuitablePixels ();
66
67 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
68
69 // Query checks
70 Bool_t IsCheckDeviatingBehavior() const { return TESTBIT(fCheckFlags,kCheckDeviatingBehavior); }
71 Bool_t IsCheckHistOverflow () const { return TESTBIT(fCheckFlags,kCheckHistOverflow); }
72 Bool_t IsCheckOscillations () const { return TESTBIT(fCheckFlags,kCheckOscillations); }
73 Bool_t IsCheckFitResults () const { return TESTBIT(fCheckFlags,kCheckFitResults); }
74
75 // MTask
76 Bool_t ReInit (MParList *pList);
77 Int_t Process () { return kTRUE; }
78 Int_t PostProcess();
79
80 // MParContainer
81 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
82
83public:
84 MCalibrationRelTimeCalc(const char *name=NULL, const char *title=NULL);
85
86 // TObject
87 void Clear(const Option_t *o="");
88
89 // MCalibrationRelTimeCalc
90 Int_t Finalize();
91
92 // Getter
93 Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); }
94
95 // Setter
96 void SetOutputPath ( TString path="." );
97 void SetOutputFile ( TString file="TimeCalibStat.txt" ) { fOutputFile = file; }
98 void SetRelTimeResolutionLimit( const Float_t f=fgRelTimeResolutionLimit ) { fRelTimeResolutionLimit = f; }
99
100 // Checks
101 void SetCheckFitResults(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckFitResults) : CLRBIT(fCheckFlags,kCheckFitResults); }
102 void SetCheckDeviatingBehavior(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeviatingBehavior) : CLRBIT(fCheckFlags,kCheckDeviatingBehavior); }
103 void SetCheckHistOverflow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckHistOverflow) : CLRBIT(fCheckFlags,kCheckHistOverflow); }
104 void SetCheckOscillations(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckOscillations) : CLRBIT(fCheckFlags,kCheckOscillations); }
105 void SetDebug(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kDebug) : CLRBIT(fFlags, kDebug); }
106
107 ClassDef(MCalibrationRelTimeCalc, 2) // Task finalizing the relative time Calibration
108};
109
110#endif
Note: See TracBrowser for help on using the repository browser.