source: trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.h@ 7388

Last change on this file since 7388 was 7366, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 4.2 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(const char *text, Int_t in, Int_t out) const;
68 void PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
69
70 // Query checks
71 Bool_t IsCheckDeviatingBehavior() const { return TESTBIT(fCheckFlags,kCheckDeviatingBehavior); }
72 Bool_t IsCheckHistOverflow () const { return TESTBIT(fCheckFlags,kCheckHistOverflow); }
73 Bool_t IsCheckOscillations () const { return TESTBIT(fCheckFlags,kCheckOscillations); }
74 Bool_t IsCheckFitResults () const { return TESTBIT(fCheckFlags,kCheckFitResults); }
75
76 // MTask
77 Bool_t ReInit (MParList *pList);
78 Int_t Process () { return kTRUE; }
79 Int_t PostProcess();
80
81 // MParContainer
82 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
83
84public:
85 MCalibrationRelTimeCalc(const char *name=NULL, const char *title=NULL);
86
87 // TObject
88 void Clear(const Option_t *o="");
89
90 // MCalibrationRelTimeCalc
91 Int_t Finalize();
92
93 // Getter
94 Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); }
95
96 // Setter
97 void SetOutputPath ( TString path="." );
98 void SetOutputFile ( TString file="TimeCalibStat.txt" ) { fOutputFile = file; }
99 void SetRelTimeResolutionLimit( const Float_t f=fgRelTimeResolutionLimit ) { fRelTimeResolutionLimit = f; }
100
101 // Checks
102 void SetCheckFitResults(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckFitResults) : CLRBIT(fCheckFlags,kCheckFitResults); }
103 void SetCheckDeviatingBehavior(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeviatingBehavior) : CLRBIT(fCheckFlags,kCheckDeviatingBehavior); }
104 void SetCheckHistOverflow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckHistOverflow) : CLRBIT(fCheckFlags,kCheckHistOverflow); }
105 void SetCheckOscillations(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckOscillations) : CLRBIT(fCheckFlags,kCheckOscillations); }
106 void SetDebug(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kDebug) : CLRBIT(fFlags, kDebug); }
107
108 ClassDef(MCalibrationRelTimeCalc, 2) // Task finalizing the relative time Calibration
109};
110
111#endif
Note: See TracBrowser for help on using the repository browser.