]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALRawUtils.h
Allow track matching to be redone at analysis level
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRawUtils.h
CommitLineData
168c7b3c 1// -*- mode: c++ -*-
ee299369 2#ifndef ALIEMCALRAWUTILS_H
3#define ALIEMCALRAWUTILS_H
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
e5bbbc4e 8
92d9f317 9
ee299369 10//_________________________________________________________________________
11// Utility Class for handling Raw data
12// Does all transitions from Digits to Raw and vice versa,
13// for simu and reconstruction
14//
15// Note: the current version is still simplified. Only
16// one raw signal per digit is generated; either high-gain or low-gain
17// Need to add concurrent high and low-gain info in the future
18// No pedestal is added to the raw signal.
19//
20//*-- Author: Marco van Leeuwen (LBL)
21//
22#include "TObject.h" // for ROOT types
feedcab9 23#include <TString.h>
168c7b3c 24
25
92d9f317 26class AliAnalysisManager;
32cd4c24 27class AliCaloRawStreamV3;
e5bbbc4e 28class AliAltroMapping;
ee299369 29class TGraph;
ee299369 30class AliRawReader;
65bdc82f 31class AliEMCALGeometry;
5e3106bc 32class AliCaloCalibPedestal;
16605c06 33class AliCaloRawAnalyzer;
92d9f317 34class AliCaloRawAnalyzerLMSOffline;
de39a0ff 35class AliEMCALTriggerRawDigitMaker;
36class AliEMCALTriggerData;
92d9f317 37
168c7b3c 38#include "AliCaloConstants.h"
ee299369 39
92d9f317 40
ee299369 41class AliEMCALRawUtils : public TObject {
42 public:
168c7b3c 43 AliEMCALRawUtils(Algo::fitAlgorithm fitAlgo = Algo::kStandard);
44 AliEMCALRawUtils(AliEMCALGeometry *pGeometry, Algo::fitAlgorithm fitAlgo = Algo::kStandard);
16605c06 45 virtual ~AliEMCALRawUtils();
92d9f317 46
47 // void FitRaw(const Int_t firstTimeBin, const Int_t lastTimeBin, Float_t & amp, Float_t & time, Float_t & chi2, Bool_t & fitDone) const ;
48 // void FitParabola(const TGraph *gSig, Float_t & amp) const ;
49
65bdc82f 50 void Digits2Raw();
916f1e76 51 void Raw2Digits(AliRawReader *reader, TClonesArray *digitsArr, const AliCaloCalibPedestal* pedbadmap,
de39a0ff 52 TClonesArray *digitsTRG=0x0, AliEMCALTriggerData* trgData = 0x0);
92d9f317 53 static Double_t RawResponseFunctionLog(Double_t *x, Double_t *par);
2cd0ffda 54 void AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain, Float_t amp, Float_t time, Float_t chi2, Int_t ndf);
f4a4dc82 55 void TrimDigits(TClonesArray *digitsArr);
829ba234 56 Int_t GetNoiseThreshold() const { return fNoiseThreshold; }
57 Int_t GetNPedSamples() const { return fNPedSamples; }
829ba234 58 Int_t GetPedestalValue() const {return fgPedestalValue;}
59 Double_t GetFEENoise() const {return fgFEENoise;}
829ba234 60 Bool_t GetRemoveBadChannels() const {return fRemoveBadChannels;}
61 Int_t GetFittingAlgorithm() const {return fFittingAlgorithm; }
f4a4dc82 62 Float_t GetTimeMax() const {return fTimeMax ;}
63 Float_t GetTimeMin() const {return fTimeMin ;}
829ba234 64 Bool_t UseFALTRO() const {return fUseFALTRO; }
b4133f05 65 void SetNoiseThreshold(Int_t val) {fNoiseThreshold=val; }
66 void SetNPedSamples(Int_t val) {fNPedSamples=val; }
9f467289 67 void SetRemoveBadChannels(Bool_t val) {fRemoveBadChannels=val; }
4fe71e02 68 void SetFittingAlgorithm(Int_t val) ;
f4a4dc82 69 void SetTimeMin(Float_t t) {fTimeMin = t ;}
70 void SetTimeMax(Float_t t) {fTimeMax = t ;}
46f1d25f 71 void SetFALTROUsage(Bool_t val) {fUseFALTRO=val; }
e2c2134b 72 void SetFEENoise(Double_t val) {fgFEENoise = val;}
829ba234 73 void SetPedestalValue(Int_t val) {fgPedestalValue = val;}
829ba234 74 Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
75 Int_t GetRawFormatThreshold() const { return fgThreshold ; }
829ba234 76 AliCaloRawAnalyzer *GetRawAnalyzer() const { return fRawAnalyzer;}
feedcab9 77 virtual Option_t* GetOption() const { return fOption.Data(); }
16605c06 78 void SetOption(const Option_t* opt) { fOption = opt; }
ee299369 79 static Double_t RawResponseFunction(Double_t *x, Double_t *par);
6751f762 80 Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL, const Int_t keyErr=0) const;
92d9f317 81
82private:
83 AliEMCALRawUtils(const AliEMCALRawUtils& rawUtils); //copy ctor
84 AliEMCALRawUtils& operator =(const AliEMCALRawUtils& rawUtils);
b4133f05 85 Int_t fNoiseThreshold; // threshold to consider signal or noise
86 Int_t fNPedSamples; // number of samples to use in pedestal calculation
b4133f05 87 static Double_t fgTimeTrigger ; // time of the trigger for the RO signal
ee299369 88 static Int_t fgThreshold; // threshold
fe93d365 89 static Int_t fgPedestalValue; // pedestal value for Digits2Raw
90 static Double_t fgFEENoise; // electronics noise in ADC units
f4a4dc82 91 AliEMCALGeometry* fGeom; // geometry
92 AliAltroMapping* fMapping[4]; // only two for now
92d9f317 93 TString fOption; // option passed from Reconstructor
f4a4dc82 94 Bool_t fRemoveBadChannels; // select if bad channels are removed before fitting
95 Int_t fFittingAlgorithm; // select the fitting algorithm
96 Float_t fTimeMin; // minimum threshold for the time of the signal
97 Float_t fTimeMax; // maximum threshold for the time of the signal
98 Bool_t fUseFALTRO; // use FALTRO and pass it to the digits
16605c06 99 AliCaloRawAnalyzer *fRawAnalyzer; // e.g. for sample selection for fits
de39a0ff 100 AliEMCALTriggerRawDigitMaker* fTriggerRawDigitMaker;
92d9f317 101
f4a4dc82 102 ClassDef(AliEMCALRawUtils,7) // utilities for raw signal fitting
92d9f317 103
ee299369 104};
105
106#endif