from Alex Kalweit:
[u/mrichter/AliRoot.git] / TPC / Calib / AliTPCcalibTimeGain.h
CommitLineData
489dce1b 1#ifndef ALITPCCALIBTIMEGAIN_H
2#define ALITPCCALIBTIMEGAIN_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7#include "AliTPCcalibBase.h"
8#include "TH2F.h"
9#include "TF1.h"
afa85729 10#include "THnSparse.h"
489dce1b 11#include "TArrayD.h"
12#include "TObjArray.h"
592a0c8f 13#include "AliSplineFit.h"
489dce1b 14
15class TH1F;
16class TH3F;
17class TH2F;
489dce1b 18class TList;
d0b31f57 19class TGraphErrors;
489dce1b 20class AliESDEvent;
21class AliESDtrack;
22class AliTPCcalibLaser;
592a0c8f 23class AliTPCseed;
489dce1b 24
25#include "TTreeStream.h"
26
d0b31f57 27
489dce1b 28class AliTPCcalibTimeGain:public AliTPCcalibBase {
29public:
30 AliTPCcalibTimeGain();
31 AliTPCcalibTimeGain(const Text_t *name, const Text_t *title, UInt_t StartTime, UInt_t EndTime, Int_t deltaIntegrationTimeGain);
32 virtual ~AliTPCcalibTimeGain();
33 //
34 virtual void Process(AliESDEvent *event);
35 virtual Long64_t Merge(TCollection *li);
592a0c8f 36 virtual void AnalyzeRun(Int_t minEntries);
489dce1b 37 //
d0b31f57 38 void ProcessCosmicEvent(AliESDEvent *event);
39 void ProcessBeamEvent(AliESDEvent *event);
40 //
489dce1b 41 void CalculateBetheAlephParams(TH2F *hist, Double_t * ini);
42 static void BinLogX(THnSparse *h, Int_t axisDim);
43 static void BinLogX(TH1 *h);
489dce1b 44 //
05c5cecd 45 THnSparse * GetHistGainTime() const {return (THnSparse*) fHistGainTime;};
46 TH2F * GetHistDeDxTotal() const {return (TH2F*) fHistDeDxTotal;};
489dce1b 47 //
592a0c8f 48 TGraphErrors * GetGraphGainVsTime(Int_t runNumber = 0, Int_t minEntries = 2000);
49 static AliSplineFit * MakeSplineFit(TGraphErrors * graph);
3af3fbc4 50 TGraphErrors * GetGraphAttachment(Int_t minEntries, Int_t nmaxBin, Float_t fracLow=0.1, Float_t fracUp=0.9);
d0b31f57 51 //
592a0c8f 52 void SetMIP(Float_t MIP){fMIP = MIP;};
53 void SetUseMax(Bool_t UseMax){fUseMax = UseMax;};
489dce1b 54 void SetLowerTrunc(Float_t LowerTrunc){fLowerTrunc = LowerTrunc;};
55 void SetUpperTrunc(Float_t UpperTrunc){fUpperTrunc = UpperTrunc;};
56 void SetUseShapeNorm(Bool_t UseShapeNorm){fUseShapeNorm = UseShapeNorm;};
57 void SetUsePosNorm(Bool_t UsePosNorm){fUsePosNorm = UsePosNorm;};
58 void SetUsePadNorm(Int_t UsePadNorm){fUsePadNorm = UsePadNorm;};
59 void SetIsCosmic(Bool_t IsCosmic){fIsCosmic = IsCosmic;};
d0b31f57 60 void SetLowMemoryConsumption(Bool_t LowMemoryConsumption){fLowMemoryConsumption = LowMemoryConsumption;};
592a0c8f 61 void SetUseCookAnalytical(Bool_t UseCookAnalytical){fUseCookAnalytical = UseCookAnalytical;};
f21b5f78 62 //
63 void SetCutMinCrossRows(Int_t crossRows){fCutCrossRows = crossRows;};
64 void SetCutMaxEta(Float_t maxEta){fCutEtaWindow = maxEta;};
65 void SetCutRequireITSrefit(Bool_t requireItsRefit = kFALSE){fCutRequireITSrefit = requireItsRefit;};
66 void SetCutMaxDcaXY(Float_t maxXY){fCutMaxDcaXY = maxXY;};
67 void SetCutMaxDcaZ(Float_t maxZ){fCutMaxDcaZ = maxZ;};
68 //
ed7b1997 69 void SetMinMomentumMIP(Float_t minMom = 0.4){fMinMomentumMIP = minMom;};
70 void SetMaxMomentumMIP(Float_t maxMom = 0.6){fMaxMomentumMIP = maxMom;};
71 void SetAlephParameters(Float_t * parameters){for(Int_t j=0;j<5;j++) fAlephParameters[j] = parameters[j];};
489dce1b 72
afa85729 73 static void SetMergeEntriesCut(Double_t entriesCut){fgMergeEntriesCut = entriesCut;}
74
75 Double_t GetEntries() const {return fHistGainTime->GetEntries();}
76
489dce1b 77private:
afa85729 78 static Double_t fgMergeEntriesCut; //maximal number of entries for merging -can be modified via setter
79
592a0c8f 80 Float_t GetTPCdEdx(AliTPCseed * seed); // wrapper for CookdEdxNorm or analytical
489dce1b 81 //
d0b31f57 82 THnSparse * fHistGainTime; // dEdx vs. time, type, Driftlength, momentum P
83 TGraphErrors * fGainVsTime; // multiplication factor vs. time
84 TH2F * fHistDeDxTotal; // dEdx vs. momentum for quality assurance
489dce1b 85 //
86 Float_t fIntegrationTimeDeDx; // required statistics for each dEdx time bin
87 //
d0b31f57 88 Float_t fMIP; // rough MIP position in order to have scaleable histograms
489dce1b 89 //
f21b5f78 90 // track cuts
91 //
92 Int_t fCutCrossRows; // minimum number of crossed rows
93 Float_t fCutEtaWindow; // maximum eta of tracks
94 Bool_t fCutRequireITSrefit; // if ITSrefit should be required (dangerous in cpass0)
95 Float_t fCutMaxDcaXY; // max dca_xy (only TPConly resolution is guaranteed!)
96 Float_t fCutMaxDcaZ; // max dca_z (dangerous if vDrift is not calibrated)
97 //
ed7b1997 98 // definition of MIP window
99 //
100 Float_t fMinMomentumMIP; // minimum momentum of MIP region, e.g. 400 MeV
101 Float_t fMaxMomentumMIP; // maximum momentum of MIP region, e.g. 600 MeV
102 Float_t fAlephParameters[5]; // parameters for equalization in MIP window, parameter set should be =1 at MIP
103 //
f21b5f78 104 //
592a0c8f 105 Bool_t fUseMax; // true: use max charge for dE/dx calculation, false: use total charge for dE/dx calculation
489dce1b 106 Float_t fLowerTrunc; // lower truncation of dE/dx ; at most 5%
107 Float_t fUpperTrunc; // upper truncation of dE/dx ; ca. 70%
108 Bool_t fUseShapeNorm; // use empirical correction of dependencies
109 Bool_t fUsePosNorm; // charge correction (analytical?)
110 Int_t fUsePadNorm; // normalization of pad geometries
592a0c8f 111 Bool_t fUseCookAnalytical; // true if CookdEdxAnalytical should be used
489dce1b 112 //
d0b31f57 113 Bool_t fIsCosmic; // kTRUE if the analyzed runs contain cosmic events
114 Bool_t fLowMemoryConsumption; // set this option kTRUE if the momenta information should not be stored in order to save memory
489dce1b 115 //
116 AliTPCcalibTimeGain(const AliTPCcalibTimeGain&);
117 AliTPCcalibTimeGain& operator=(const AliTPCcalibTimeGain&);
118 void Process(AliESDtrack *track, Int_t runNo=-1){AliTPCcalibBase::Process(track,runNo);};
119 void Process(AliTPCseed *track){return AliTPCcalibBase::Process(track);}
120
ed7b1997 121 ClassDef(AliTPCcalibTimeGain, 2);
489dce1b 122};
123
124#endif
125
126