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

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