source: trunk/Mars/msignal/MExtractor.h@ 17826

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