source: trunk/MagicSoft/Mars/msignal/MExtractor.h@ 8339

Last change on this file since 8339 was 8304, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 5.9 KB
Line 
1#ifndef MARS_MExtractor
2#define MARS_MExtractor
3
4/////////////////////////////////////////////////////////////////////////////
5// //
6// MExtractor //
7// //
8// Base class for the signal extractors //
9// //
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef MARS_MTask
13#include "MTask.h"
14#endif
15
16class MRawEvtData;
17class MRawRunHeader;
18
19class MPedestalCam;
20class MPedestalSubtractedEvt;
21class MExtractedSignalCam;
22
23class MExtractor : public MTask
24{
25private:
26 static const Float_t fgOffsetLoGain; //! Default for fOffsetLoGain (now set to 1.51 (= 5ns)
27
28 Bool_t fNoiseCalculation; //! Flag if extractor determines noise contribution from pedestal file.
29
30 Float_t fResolutionPerPheHiGain; // Extractor-dependent charge resolution per phe for high-gain (see TDAS-0502).
31 Float_t fResolutionPerPheLoGain; // Extractor-dependent charge resolution per phe for low-gain (see TDAS-0502).
32
33protected:
34 static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254)
35 static const TString fgNamePedestalCam; //! "MPedestalCam"
36 static const TString fgNameSignalCam; //! "MExtractedSignalCam"
37
38 Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices
39
40 MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
41 MExtractedSignalCam *fSignals; //! Extracted signal of all pixels in the camera
42
43 MRawEvtData *fRawEvt; //! Raw event data (time slices)
44 MRawRunHeader *fRunHeader; //! RunHeader information
45
46 MPedestalSubtractedEvt *fSignal; //!
47
48 Byte_t fHiGainFirst; // First FADC slice nr. to extract the High Gain signal
49 Byte_t fHiGainLast; // Last FADC slice nr. to extract the High Gain signal
50 Int_t fLoGainFirst; // First FADC slice nr. to extract the Low Gain signal
51 Byte_t fLoGainLast; // Last FADC slice nr. to extract the Low Gain signal
52
53// Byte_t fHiLoLast; // Number of slices in fLoGainSamples counted for the High-Gain signal
54
55 Float_t fNumHiGainSamples; // Number High Gain FADC slices used to extract the signal
56 Float_t fNumLoGainSamples; // Number Low Gain FADC slices used to extract the signal
57
58 Float_t fSqrtHiGainSamples; // Sqrt. nr. High Gain FADC slices used to extract the signal
59 Float_t fSqrtLoGainSamples; // Sqrt. nr. Low Gain FADC slices used to extract the signal
60
61 Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated
62
63 TString fNamePedestalCam; // Name of the 'MPedestalCam' container
64 TString fNameSignalCam; // Name of the 'MExtractedSignalCam' container
65
66 // MExtractor
67 virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { }
68 virtual void FindSignalLoGain(Byte_t *firstused, Float_t &sum, Byte_t &sat) const { }
69
70 void SetResolutionPerPheHiGain(Float_t f) { fResolutionPerPheHiGain=f; }
71 void SetResolutionPerPheLoGain(Float_t f) { fResolutionPerPheLoGain=f; }
72
73 Int_t PreProcessStd(MParList *pList);
74
75 // MTask
76 Int_t PreProcess( MParList *pList );
77 Bool_t ReInit ( MParList *pList );
78 Int_t Process ();
79 void StreamPrimitive(ostream &out) const;
80 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
81
82
83public:
84 MExtractor(const char *name=NULL, const char *title=NULL);
85
86 // getter
87 Byte_t GetHiGainFirst() const { return fHiGainFirst; }
88 Byte_t GetHiGainLast () const { return fHiGainLast ; }
89 Int_t GetLoGainFirst() const { return fLoGainFirst; }
90 Byte_t GetLoGainLast () const { return fLoGainLast ; }
91 Float_t GetNumHiGainSamples() const { return fNumHiGainSamples; }
92 Float_t GetNumLoGainSamples() const { return fNumLoGainSamples; }
93 Float_t GetOffsetLoGain() const { return fOffsetLoGain; }
94 Float_t GetResolutionPerPheHiGain() const { return fResolutionPerPheHiGain; }
95 Float_t GetResolutionPerPheLoGain() const { return fResolutionPerPheLoGain; }
96 Byte_t GetSaturationLimit() const { return fSaturationLimit; }
97
98 Bool_t IsNoiseCalculation () const { return fNoiseCalculation; }
99
100 // Setter
101 Float_t SetResolutionPerPheHiGain() const { return fResolutionPerPheHiGain; }
102 Float_t SetResolutionPerPheLoGain() const { return fResolutionPerPheLoGain; }
103
104 virtual void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Int_t lofirst=0, Byte_t lolast=0);
105
106 void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain ) { fOffsetLoGain = f; }
107 void SetSaturationLimit ( const Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; }
108 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }
109 void SetNameSignalCam ( const char *name=fgNameSignalCam.Data() ) { fNameSignalCam = name; }
110 void SetNoiseCalculation( const Bool_t b=kTRUE ) { fNoiseCalculation = b; }
111
112 void SetPedestals (MPedestalCam *pedcam) { fPedestals = pedcam; }
113 MPedestalCam *GetPedestals() { return fPedestals; }
114
115 // TObject
116 void Clear(Option_t *o="")
117 {
118 fHiGainFirst = fHiGainLast = fLoGainFirst = fLoGainLast = /*fHiLoLast =*/ 0;
119 }
120
121 void Print(Option_t *o="") const; //*MENU*
122
123 ClassDef(MExtractor, 7) // Signal Extractor Base Class
124};
125
126#endif
Note: See TracBrowser for help on using the repository browser.