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