AliRoot Core  edcc906 (edcc906)
AliCaloRawAnalyzer.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 #ifndef ALICALORAWANALYZER_H
3 #define ALICALORAWANALYZER_H
4 
5 /* Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice */
7 
8 //_________________________________________________________________________
21 //_________________________________________________________________________
22 
23 // standard library
24 #include "Rtypes.h"
25 #include <vector>
26 
27 // ROOT system
28 #include "TObject.h"
29 #include "TObjArray.h"
30 
31 // Calo system
32 #include "AliCaloFitResults.h"
33 #include "AliCaloConstants.h"
34 using namespace ALTRO;
35 using namespace CALO;
36 
37 class AliCaloBunchInfo;
38 
39 class AliCaloRawAnalyzer : public TObject
40 {
41 
42 public:
43 
44  AliCaloRawAnalyzer(const char *name="AliCaloRawAnalyzer", const char *nameshort="RawAna");
45  virtual ~AliCaloRawAnalyzer() { ; }
46 
47  virtual AliCaloFitResults Evaluate( const std::vector<AliCaloBunchInfo> &/*bunchvector*/,
48  UInt_t /*altrocfg1*/, UInt_t /*altrocfg2*/ ) = 0;
49 
50  static void PrintBunches( const std::vector<AliCaloBunchInfo> &bunchvector );
51  static void PrintBunch ( const AliCaloBunchInfo &bunch );
52 
53  int PreFitEvaluateSamples( const std::vector<AliCaloBunchInfo> &bunchvector,
54  UInt_t altrocfg1, UInt_t altrocfg2, Int_t & index,
55  Float_t & maxf, short & maxamp, short & maxampindex,
56  Float_t & ped, int & first, int & last, int acut);
57 
58  void SetTimeConstraint (int min, int max );
59  void SetVerbose (bool verbose = true){ fVerbose = verbose ; }
60  void SetIsZeroSuppressed(bool iszs = true) { fIsZerosupressed = iszs ; }
61 
62  void SetAmpCut (Float_t cut) { fAmpCut = cut ; }
63  void SetFitArrayCut(Int_t cut) { fFitArrayCut = cut ; }
64  void SetNsampleCut (Int_t cut) { fNsampleCut = cut ; }
65  void SetOverflowCut(Int_t cut) { fOverflowCut = cut ; }
66  void SetNsamplePed (Int_t i) { fNsamplePed = i ; }
67  void SetL1Phase (Double_t phase) { fL1Phase = phase ; }
68 
69  bool GetIsZeroSuppressed() const { return fIsZerosupressed ; }
70  Float_t GetAmpCut() const { return fAmpCut ; }
71  Int_t GetFitArrayCut() const { return fFitArrayCut ; }
72  Int_t GetNsampleCut() const { return fNsampleCut ; }
73  Int_t GetOverflowCut() const { return fOverflowCut ; }
74  Int_t GetNsamplePed() const { return fNsamplePed ; }
75 
76  // access to array info
77  Double_t GetReversed(const int i) const { return fReversed[i] ; }
78  const char * GetAlgoName() const { return fName ; }
79  const char * GetAlgoAbbr() const { return fNameShort ; }
80  Algo::fitAlgorithm GetAlgo() const { return fAlgo ; }
81 
82  // Used in AliCaloRawAnalyzerFitter
83  //
84  Float_t GetTau() const { return fTau ; }
85  void SetTau (Float_t tau) { fTau = tau ; }
86  Bool_t GetFixTau() const { return fFixTau ; }
87  void SetFixTau(Bool_t b) { fFixTau = b ; }
88  //
89 
90  Double_t CalculateChi2(const Double_t amp, const Double_t time,
91  const Int_t first, const Int_t last,
92  const Double_t adcErr=1,
93  const Double_t tau=2.35) const;
94 
95  void CalculateMeanAndRMS(const Int_t first, const Int_t last,
96  Double_t & mean, Double_t & rms);
97 
98  short Max( const AliCaloBunchInfo *const bunch, int * maxindex ) const;
99 
100  UShort_t Max( const UShort_t *data, const int length ) const;
101 
102  bool CheckBunchEdgesForMax( const AliCaloBunchInfo *const bunch ) const;
103 
104  bool IsInTimeRange( const int maxindex, const int maxtime, const int mintime ) const;
105 
106  Float_t ReverseAndSubtractPed( const AliCaloBunchInfo *bunch,
107  UInt_t altrocfg1, UInt_t altrocfg2,
108  double * outarray ) const;
109 
110  int SelectBunch( const std::vector<AliCaloBunchInfo> &bunchvector,
111  short * maxampbin, short * maxamplitude );
112 
113  void SelectSubarray( const Double_t *date, int length, short maxindex,
114  int * first, int * last, int cut ) const;
115 
116  Float_t EvaluatePedestal( const UShort_t * const data, const int length ) const;
117 
118 protected:
119 
120  Double_t fReversed[ALTROMAXSAMPLES];
121 
124 
126 
127  Float_t fAmpCut;
128 
131 
133 
135 
136  bool fVerbose;
137 
138  char fName[256];
139  char fNameShort[256];
140 
142 
143  Double_t fL1Phase;
144 
145  Double_t fAmp;
146 
147  Double_t fTof;
148 
149  Float_t fTau;
150 
151  Bool_t fFixTau;
152 
154  ClassDef(AliCaloRawAnalyzer, 3) ;
156 
157 };
158 
159 #endif //ALICALORAWANALYZER_H
TBrowser b
Definition: RunAnaESD.C:12
int fFitArrayCut
Cut on ADC value (after ped. subtraction) for signals used for fit.
int fMaxTimeIndex
The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex.
Algo::fitAlgorithm GetAlgo() const
void SetNsamplePed(Int_t i)
Int_t GetNsampleCut() const
bool GetIsZeroSuppressed() const
Float_t GetAmpCut() const
Base class for extraction of signal amplitude and peak position.
Float_t fAmpCut
Max ADC - pedestal must be higher than this befor attemting to extract the amplitude.
Double_t fTof
The amplitude in entities of ADC counts.
int fOverflowCut
Value when ADC starts to saturate.
void SetNsampleCut(Int_t cut)
int fNsampleCut
Minimum number of sample require before attemting to extract signal parameters.
Int_t GetOverflowCut() const
Int_t GetNsamplePed() const
void SetOverflowCut(Int_t cut)
void SetAmpCut(Float_t cut)
Container class to hold results from fitting.
Container of ALTRO information.
Double_t fAmp
The amplitude in entities of ADC counts.
Float_t GetTau() const
void SetFixTau(Bool_t b)
Float_t fTau
Rise time of the signal (peak position = t0 +tau), by defauly it is 235 ns.
const char * GetAlgoAbbr() const
void SetL1Phase(Double_t phase)
bool fIsZerosupressed
Wether or not the data is zeros supressed, by default its assumed that the baseline is also subtracte...
const Double_t fTau
Algo::fitAlgorithm fAlgo
Which algorithm to use.
void SetFitArrayCut(Int_t cut)
Double_t GetReversed(const int i) const
int fNsamplePed
Number of samples used for pedestal calculation (first in bunch)
const int ALTROMAXSAMPLES
The maximum number of samples of the ALTRO.
const char * GetAlgoName() const
void SetVerbose(bool verbose=true)
bool fVerbose
Print debug information to std out if set to true.
int fMinTimeIndex
The timebin of the max signal value must be between fMinTimeIndex and fMaxTimeIndex.
Bool_t GetFixTau() const
Double_t fL1Phase
Phase of the ADC sampling clock relative to the LHC clock.
Int_t GetFitArrayCut() const
TCut cut
Definition: MakeGlobalFit.C:75
void SetTau(Float_t tau)
Bool_t fFixTau
Fixed fit parameter or not, used in AliCaloRawAnalyzerFitter.
static void Evaluate(const Double_t *h, Double_t t, Double_t r[3], Double_t g[3], Double_t gg[3])
void SetIsZeroSuppressed(bool iszs=true)
fitAlgorithm
< fitting alorithms tag numbers