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

Last change on this file since 6937 was 6820, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 5.0 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 MExtractedSignalCam;
21
22class MExtractor : public MTask
23{
24private:
25
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
30protected:
31
32 static const Byte_t fgSaturationLimit; //! Default for fSaturationLimit (now set to: 254)
33 static const TString fgNamePedestalCam; //! "MPedestalCam"
34 static const TString fgNameSignalCam; //! "MExtractedSignalCam"
35
36 Float_t fOffsetLoGain; // Offset of the low-gain signal w.r.t. the High-Gain slices
37
38 MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
39 MExtractedSignalCam *fSignals; //! Extracted signal of all pixels in the camera
40
41 MRawEvtData *fRawEvt; //! Raw event data (time slices)
42 MRawRunHeader *fRunHeader; //! RunHeader information
43
44 Byte_t fHiGainFirst; // First FADC slice nr. to extract the High Gain signal
45 Byte_t fHiGainLast; // Last FADC slice nr. to extract the High Gain signal
46 Byte_t fLoGainFirst; // First FADC slice nr. to extract the Low Gain signal
47 Byte_t fLoGainLast; // Last FADC slice nr. to extract the Low Gain signal
48
49 Byte_t fHiLoLast; // Number of slices in fLoGainSamples counted for the High-Gain signal
50
51 Float_t fNumHiGainSamples; // Number High Gain FADC slices used to extract the signal
52 Float_t fNumLoGainSamples; // Number Low Gain FADC slices used to extract the signal
53
54 Float_t fSqrtHiGainSamples; // Sqrt. nr. High Gain FADC slices used to extract the signal
55 Float_t fSqrtLoGainSamples; // Sqrt. nr. Low Gain FADC slices used to extract the signal
56
57 Byte_t fSaturationLimit; // Highest FADC slice value until being declared saturated
58 TString fNamePedestalCam; // Name of the 'MPedestalCam' container
59 TString fNameSignalCam; // Name of the 'MExtractedSignalCam' container
60
61 virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { }
62 virtual void FindSignalLoGain(Byte_t *firstused, Float_t &sum, Byte_t &sat) const { }
63
64 Int_t PreProcessStd(MParList *pList);
65 Int_t PreProcess( MParList *pList );
66 Bool_t ReInit ( MParList *pList );
67 Int_t Process ();
68 void StreamPrimitive(ofstream &out) const;
69 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
70
71public:
72 MExtractor(const char *name=NULL, const char *title=NULL);
73
74 void Clear(Option_t *o="")
75 {
76 fHiGainFirst = fHiGainLast = fLoGainFirst = fLoGainLast = fHiLoLast = 0;
77 }
78
79 Byte_t GetHiGainFirst() const { return fHiGainFirst; }
80 Byte_t GetHiGainLast () const { return fHiGainLast ; }
81 Byte_t GetLoGainFirst() const { return fLoGainFirst; }
82 Byte_t GetLoGainLast () const { return fLoGainLast ; }
83 Float_t GetNumHiGainSamples() const { return fNumHiGainSamples; }
84 Float_t GetNumLoGainSamples() const { return fNumLoGainSamples; }
85 Float_t GetOffsetLoGain() const { return fOffsetLoGain; }
86
87 Bool_t IsNoiseCalculation () const { return fNoiseCalculation; }
88
89 virtual void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0);
90
91 void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain ) { fOffsetLoGain = f; }
92 void SetSaturationLimit ( const Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim; }
93 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }
94 void SetNameSignalCam ( const char *name=fgNameSignalCam.Data() ) { fNameSignalCam = name; }
95 void SetNoiseCalculation( const Bool_t b=kTRUE ) { fNoiseCalculation = b; }
96
97 void SetPedestals (MPedestalCam *pedcam) { fPedestals = pedcam; }
98
99 void Print(Option_t *o="") const;
100
101 ClassDef(MExtractor, 5) // Signal Extractor Base Class
102};
103
104#endif
Note: See TracBrowser for help on using the repository browser.