]>
Commit | Line | Data |
---|---|---|
57839add | 1 | #ifndef ALICALORAWANALYZER_H |
2 | #define ALICALORAWANALYZER_H | |
d655d7dd | 3 | /************************************************************************** |
4 | * This file is property of and copyright by * | |
e37e3c84 | 5 | * the Relatvistic Heavy Ion Group (RHIG), Yale University, US, 2009 * |
d655d7dd | 6 | * * |
7 | * Primary Author: Per Thomas Hille <p.t.hille@fys.uio.no> * | |
8 | * * | |
9 | * Contributors are mentioned in the code where appropriate. * | |
10 | * Please report bugs to p.t.hille@fys.uio.no * | |
11 | * * | |
12 | * Permission to use, copy, modify and distribute this software and its * | |
13 | * documentation strictly for non-commercial purposes is hereby granted * | |
14 | * without fee, provided that the above copyright notice appears in all * | |
15 | * copies and that both the copyright notice and this permission notice * | |
16 | * appear in the supporting documentation. The authors make no claims * | |
17 | * about the suitability of this software for any purpose. It is * | |
18 | * provided "as is" without express or implied warranty. * | |
19 | **************************************************************************/ | |
20 | ||
57839add | 21 | |
d655d7dd | 22 | //Base class for extraction |
23 | //of signal amplitude and peak position | |
57839add | 24 | //From CALO Calorimeter RAW data |
d655d7dd | 25 | |
26 | ||
27 | #include "Rtypes.h" | |
28 | #include "TObject.h" | |
d655d7dd | 29 | |
30 | #define MAXSAMPLES 1008 //CRAP PTH | |
e37e3c84 | 31 | |
32 | //#include "AliCaloRawAnalyzer.h" | |
33 | ||
34 | //class AliCaloBunchInfo; | |
35 | ||
36 | //#include "AliCaloBunchInfo.h" | |
37 | ||
38 | ||
39 | #include <vector> | |
40 | using namespace std; | |
d655d7dd | 41 | |
57839add | 42 | class AliCaloBunchInfo; |
43 | class AliCaloFitResults; | |
d655d7dd | 44 | |
e37e3c84 | 45 | //class vector<AliCaloBunchInfo> ; |
46 | ||
47 | //class vector; | |
d655d7dd | 48 | |
57839add | 49 | class AliCaloRawAnalyzer : public TObject |
d655d7dd | 50 | { |
51 | public: | |
48a2e3eb | 52 | AliCaloRawAnalyzer(const char *name="AliCaloRawAnalyzer", const char *nameshort="RawAna"); |
57839add | 53 | virtual ~AliCaloRawAnalyzer(); |
e37e3c84 | 54 | virtual AliCaloFitResults Evaluate( const vector<AliCaloBunchInfo> &bunchvector, |
55 | const UInt_t altrocfg1, const UInt_t altrocfg2 ); | |
d655d7dd | 56 | |
57839add | 57 | void PrintBunches( const vector<AliCaloBunchInfo> &bunchvector ) const; |
58 | void PrintBunch( const AliCaloBunchInfo &bunch ) const ; | |
d655d7dd | 59 | |
e37e3c84 | 60 | virtual int PreFitEvaluateSamples( const vector<AliCaloBunchInfo> &bunchvector, |
61 | const UInt_t altrocfg1, const UInt_t altrocfg2, Int_t & index, | |
62 | Float_t & maxf, short & maxamp, short & maxampindex, Float_t & ped, int & first, int & last); | |
d655d7dd | 63 | void SetTimeConstraint(const int min, const int max ); |
64 | void SetVerbose(bool verbose = true){ fVerbose = verbose; }; | |
65 | void SetIsZeroSuppressed(const bool iszs = true) { fIsZerosupressed = iszs; } ; | |
66 | void SetAmpCut(const Float_t cut) { fAmpCut = cut ; } ; | |
57839add | 67 | void SetFitArrayCut(const Int_t cut) { fFitArrayCut = cut ; } ; |
68 | void SetNsampleCut(const Int_t cut) { fNsampleCut = cut ; } ; | |
69 | ||
70 | // access to array info | |
71 | Double_t GetReversed(const int i) const { return fReversed[i]; } | |
e37e3c84 | 72 | const char * GetAlgoName() const { return fName; }; |
48a2e3eb | 73 | const char * GetAlgoAbbr() const { return fNameShort; }; |
74 | bool GetIsZeroSuppressed() const { return fIsZerosupressed;} ; | |
d655d7dd | 75 | |
76 | protected: | |
57839add | 77 | short Max( const AliCaloBunchInfo *const bunch, int *const maxindex) const; |
d655d7dd | 78 | UShort_t Max(const UShort_t *data, const int length ) const; |
79 | bool IsInTimeRange( const int maxindex ) const; | |
57839add | 80 | Float_t ReverseAndSubtractPed( const AliCaloBunchInfo *bunch, const UInt_t altrocfg1, const UInt_t altrocfg2, double *outarray ) const; |
81 | int SelectBunch( const vector<AliCaloBunchInfo> &bunchvector, short *const maxampbin, short *const maxamplitude ) const; | |
e37e3c84 | 82 | virtual void SelectSubarray( const Double_t *fData, const int length, const short maxindex, int *const first, int *const last ) const; |
57839add | 83 | Float_t EvaluatePedestal(const UShort_t * const data, const int length ) const; |
d655d7dd | 84 | |
85 | Double_t fReversed[MAXSAMPLES]; //Reversed sequence of samples (pedestalsubtracted) | |
86 | ||
87 | // private: | |
88 | int fMinTimeIndex; //The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex | |
89 | int fMaxTimeIndex; //The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex | |
90 | int fFitArrayCut; //Cut on ADC value (after ped. subtraction) for signals used for fit | |
91 | Float_t fAmpCut; //Max ADC - pedestal must be higher than this befor attemting to extract the amplitude | |
92 | int fNsampleCut; //Minimum number of sample require before attemting to extract signal parameters | |
93 | bool fIsZerosupressed; //Wether or not the data is zeros supressed, by default its assumed that the baseline is also subtracted if set to true | |
94 | bool fVerbose; //Print debug information to std out if set to true | |
57839add | 95 | |
e37e3c84 | 96 | char fName[256]; // Name of the algorithm |
48a2e3eb | 97 | char fNameShort[256]; // Abbrevation for the name |
e37e3c84 | 98 | |
99 | ClassDef(AliCaloRawAnalyzer, 1) | |
100 | ||
d655d7dd | 101 | }; |
102 | ||
103 | #endif |