]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/AliTrackComparison.h
Fix for #86401 port to Release code for Pass0
[u/mrichter/AliRoot.git] / PWG1 / AliTrackComparison.h
1 #ifndef ALITRACKCOMPARISON_H
2 #define ALITRACKCOMPARISON_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6 //-------------------------------------------------------------------
7 // Base class to test the extrapolation performance from TPC to outer 
8 // detectors. Several member functions AddTracks() with different
9 // arguments can be called to execute extrapolation and several 
10 // THnSparse are filled with residuls and basic track information
11 //
12 // Anthor: R.Ma, M.Ivanov 02/04/2011
13 //--------------------------------------------------------------------
14
15 #include "TNamed.h"
16 #include "TMatrixDfwd.h"
17 class THnSparse;
18 class TCollection;
19 class AliExternalTrackParam;
20 class AliTrackPointArray;
21 class AliTrackPoint;
22 class TParticle;
23 class AliTrackReference;
24 class TObjArray;
25 class TTreeSRedirector;
26  
27 class AliTrackComparison:public TNamed {
28 public:
29   AliTrackComparison();
30   AliTrackComparison(const Text_t *name, const Text_t *title);
31   AliTrackComparison(const AliTrackComparison& comp);
32   AliTrackComparison& operator=(const AliTrackComparison& comp);
33   virtual ~AliTrackComparison();
34   //Make histograms
35   void Init();
36
37   //Main process functions  
38   Int_t AddTracks(AliExternalTrackParam *param0,  AliExternalTrackParam *param1, Double_t mass);
39   Int_t AddTracks(AliTrackReference *ref0,  AliTrackReference *ref1, Double_t mass, Int_t charge);
40   Int_t AddTracks(AliExternalTrackParam *param0,  AliTrackPoint *point1, Double_t mass, Double_t energy, Double_t *vxyz);
41   AliExternalTrackParam *MakeTrack(const AliTrackReference *ref, Int_t charge);
42   Bool_t PropagateToPoint(AliExternalTrackParam *param0,AliExternalTrackParam *param1, Double_t mass);
43   
44   //Set the step used in extrapolatoin
45   void SetStep(Double_t step){fStep=step;}
46
47   //Set the range of the first bins of the THnSparse
48   void SetRangeDY(Double_t lowBinDY, Double_t upBinDY) {fLowBinDY=lowBinDY,fUpBinDY=upBinDY;}
49   void SetRangeDZ(Double_t lowBinDZ, Double_t upBinDZ) {fLowBinDZ=lowBinDZ,fUpBinDZ=upBinDZ;}
50   void SetRangeDSnp(Double_t lowBinDSnp, Double_t upBinDSnp){fLowBinDSnp=lowBinDSnp;fUpBinDSnp=upBinDSnp;}
51   void SetRangeDTheta(Double_t lowBinDTheta, Double_t upBinDTheta) {fLowBinDTheta=lowBinDTheta;fUpBinDTheta=upBinDTheta;}
52   void SetRange1Pt(Double_t lowBin1Pt, Double_t upBin1Pt) {fLowBin1Pt=lowBin1Pt;fUpBin1Pt=upBin1Pt;}
53   void SetRange1PtLoss(Double_t lowBin1PtLoss, Double_t upBin1PtLoss) {fLowBin1PtLoss=lowBin1PtLoss;fUpBin1PtLoss=upBin1PtLoss;}
54
55
56   //Set number of bins 
57   void SetNBins(Int_t nBinsDY, Int_t nBinsDZ, Int_t nBinsDSnp, Int_t nBinsDTheta, Int_t nBins1Pt, Int_t nBins1PtLoss)
58   {
59     fNBinsDY=nBinsDY;
60     fNBinsDZ=nBinsDZ;
61     fNBinsDSnp=nBinsDSnp;
62     fNBinsDTheta=nBinsDTheta;
63     fNBins1Pt=nBins1Pt;
64     fNBins1PtLoss=nBins1PtLoss;
65   }
66
67
68   //Set the layer ID of the detectors. Refer to AliGeomManager.h
69   void SetLayerID(Double_t layerID) {fLayerID=layerID;}
70
71   //Set the flag to fill all the THnSparse's. By default it is kTURE
72   void SetFillAll(Bool_t fillAll) {fFillAll=fillAll;}
73   
74   //Fill the THnSparse
75   void FillHistos(AliExternalTrackParam *param0, AliExternalTrackParam *param1, Double_t tr1Pt);
76
77   //Getter
78   THnSparse *GetHnSparse(Int_t index) {return fResolHisto[index];}
79
80   //Used to redirect the output THnSparse into TTreeSRedirector
81   void MakeDistortionMap(Double_t refX, Int_t type);
82
83   //Set number of bins used to combine statistics
84   void SetNCombineBin(Int_t nCombineBin) {fNCombineBin=nCombineBin;}
85
86   virtual Long64_t       Merge(TCollection *const li);
87   virtual void           Add(AliTrackComparison *const comp);
88   void Analyze(); //Not implemented
89
90 protected:
91   void    MakeHistos();     //Initialize all the THnSparse
92   Double_t fStep;           //Step used in extrapolation
93   Double_t fLowBinDY;       //First bin of residual in Y
94   Double_t fUpBinDY;        //Last bin of residual in Y
95   Double_t fLowBinDZ;       //First bin of residual in Z
96   Double_t fUpBinDZ;        //Last bin of residual in Z
97   Double_t fLowBinDSnp;     //First bin of residual in sin(phi)
98   Double_t fUpBinDSnp;      //Last bin of residual in sin(phi) 
99   Double_t fLowBinDTheta;   //First bin of residual in Theta
100   Double_t fUpBinDTheta;    //Last bin of residual in Theta
101   Double_t fLowBin1Pt;      //First bin of residual in 1/pT
102   Double_t fUpBin1Pt;       //Last bin of residual in 1/pT
103   Double_t fLowBin1PtLoss;  //First bin of corrected energy loss
104   Double_t fUpBin1PtLoss;   //Last bin of corrected energy loss
105   Int_t fNBinsDY;           //NBins of residual in Y
106   Int_t fNBinsDZ;           //NBins of residual in Z
107   Int_t fNBinsDSnp;         //NBins of residual in sin(phi)
108   Int_t fNBinsDTheta;       //NBins of residual in Theta
109   Int_t fNBins1Pt;          //NBins of residual in 1/pT
110   Int_t fNBins1PtLoss;      //NBins of corrected energy loss
111   Double_t fLayerID;        //Detector layer ID
112   Bool_t fFillAll;          //Flag to fill all the THnSparse
113   Int_t fNCombineBin;       //Number of bins used to combine statistics in MakeDistortionMap()
114
115   THnSparse *fResolHisto[6];//Output THnSparse
116
117   ClassDef(AliTrackComparison, 4); 
118 };
119
120 #endif
121
122