source: trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.h@ 5379

Last change on this file since 5379 was 5378, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.1 KB
Line 
1#ifndef MARS_MPedCalcFromLoGain
2#define MARS_MPedCalcFromLoGain
3
4#ifndef MARS_MExtractor
5#include "MExtractor.h"
6#endif
7
8#ifndef ROOT_TArrayD
9#include <TArrayD.h>
10#endif
11
12#ifndef ROOT_TArrayI
13#include <TArrayI.h>
14#endif
15
16class MGeomCam;
17class MBadPixelsCam;
18class MRawEvtPixelIter;
19
20class MPedCalcFromLoGain : public MExtractor
21{
22 static const UShort_t fgCheckWinFirst; // First FADC slice to check for signal (currently set to: 0)
23 static const UShort_t fgCheckWinLast; // Last FADC slice to check for signal (currently set to: 29)
24 static const UShort_t fgExtractWinFirst; // First FADC slice to use for pedestal calculation (currently set to: 15)
25 static const UShort_t fgExtractWinSize; // number of successive slices used to calculate pedestal (currently set to: 6)
26 static const UShort_t fgMaxSignalVar; // The maximum difference between the highest and lowest slice
27
28 MGeomCam *fGeom; // Camera geometry
29
30 UInt_t fNumEventsDump; // Number of event after which MPedestalCam gets updated
31
32 UShort_t fMaxSignalVar;
33 UShort_t fCheckWinFirst;
34 UShort_t fCheckWinLast;
35 UShort_t fExtractWinSize; // Number of slices to calculate the pedestal from
36 UShort_t fExtractWinFirst;
37 UShort_t fExtractWinLast;
38
39 Bool_t fPedestalUpdate;
40
41 TString fNamePedestalCam; // name of the 'MPedestalCam' container
42
43 TArrayI fNumEventsUsed; // Number of events used for pedestal calc for each pixel
44 TArrayI fTotalCounter; // Counter for dumping values to Pedestal Container
45 TArrayD fSumx; // sum of values
46 TArrayD fSumx2; // sum of squared values
47 TArrayD fSumAB0; // sum of ABFlag=0 slices
48 TArrayD fSumAB1; // sum of ABFlag=1 slices
49
50 // MParContainer
51 Int_t PreProcess (MParList *pList);
52 Bool_t ReInit (MParList *pList);
53 Int_t Process ();
54 Int_t PostProcess();
55 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
56
57 // Calculation
58 void Calc(ULong_t n, UInt_t idx);
59
60 //Helper function to extract slice values by slice number
61 UShort_t GetSlice(MRawEvtPixelIter *pixel, UInt_t slice);
62 void ResetArrays();
63
64public:
65 MPedCalcFromLoGain(const char *name=NULL, const char *title=NULL);
66
67 // TObject
68 void Clear(const Option_t *o="");
69 void Print(Option_t *o="") const;
70
71 // Setter
72 Bool_t SetCheckRange(UShort_t checkfirst=fgCheckWinFirst, UShort_t checklast=fgCheckWinLast);
73 Bool_t SetExtractWindow(UShort_t extractfirst=fgExtractWinFirst, UShort_t windowsize=fgExtractWinSize);
74
75 void SetMaxSignalVar(UShort_t maxvar=40) { fMaxSignalVar = maxvar; }
76 void SetNumEventsDump(UInt_t dumpevents = 500) { fNumEventsDump = dumpevents;}
77 void SetPedestalUpdate(Bool_t pedupdate) {fPedestalUpdate = pedupdate;}
78
79 void SetNamePedestalCam(const char *name) { fNamePedestalCam = name; }
80
81 // Getter
82 TArrayI *GetNumEventsUsed() { return &fNumEventsUsed; }
83
84 ClassDef(MPedCalcFromLoGain, 0) // Task to calculate pedestals from pedestal runs raw data
85};
86
87#endif
Note: See TracBrowser for help on using the repository browser.