Instead just bit-flag marking used clusters store ID's of ESDtracks for
[u/mrichter/AliRoot.git] / ITS / AliITSMultReconstructor.h
CommitLineData
ac903f1b 1#ifndef ALIITSMULTRECONSTRUCTOR_H
2#define ALIITSMULTRECONSTRUCTOR_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
fa9ed8e9 6//_________________________________________________________________________
ac903f1b 7//
fa9ed8e9 8// Implementation of the ITS-SPD trackleter class
ac903f1b 9//
fa9ed8e9 10// It retrieves clusters in the pixels (theta and phi) and finds tracklets.
11// These can be used to extract charged particle multiplicity from the ITS.
ac903f1b 12//
fa9ed8e9 13// A tracklet consists of two ITS clusters, one in the first pixel layer and
14// one in the second. The clusters are associated if the differences in
15// Phi (azimuth) and Theta (polar angle) are within fiducial windows.
16// In case of multiple candidates the candidate with minimum
17// distance is selected.
18//_________________________________________________________________________
1f9831ab 19#include "AliTrackleter.h"
ac903f1b 20
1f9831ab 21class TBits;
ac903f1b 22class TTree;
23class TH1F;
3ef75756 24class TH2F;
1f9831ab 25class AliITSDetTypeRec;
ac903f1b 26class AliITSgeom;
1f9831ab 27class AliESDEvent;
28class AliESDtrack;
29class AliVertex;
6de485aa 30class AliESDVertex;
1f9831ab 31class AliMultiplicity;
ac903f1b 32
1f9831ab 33class AliITSMultReconstructor : public AliTrackleter
ac903f1b 34{
35public:
1f9831ab 36 //
37 enum {kClTh,kClPh,kClZ,kClMC0,kClMC1,kClMC2,kClNPar};
38 enum {kTrTheta,kTrPhi,kTrDPhi,kTrDTheta,kTrLab1,kTrLab2,kClID1,kClID2,kTrNPar};
d7c5c1e4 39 enum {kSCTh,kSCPh,kSCLab,kSCID,kSCNPar};
1f9831ab 40 enum {kITSTPC,kITSSAP,kITSTPCBit=BIT(kITSTPC),kITSSAPBit=BIT(kITSSAP)}; // RS
ac903f1b 41 AliITSMultReconstructor();
ddced3c8 42 virtual ~AliITSMultReconstructor();
ac903f1b 43
1f9831ab 44 void Reconstruct(AliESDEvent* esd, TTree* treeRP);
45 void Reconstruct(TTree* tree, Float_t* vtx, Float_t* vtxRes); // old reconstructor invocation
46 void FindTracklets(const Float_t* vtx);
9b373e9a 47 void LoadClusterFiredChips(TTree* tree);
7b116aa1 48 void FlagClustersInOverlapRegions(Int_t ic1,Int_t ic2);
34581d1e 49 void FlagTrackClusters(Int_t id);
6de485aa 50 void FlagIfSecondary(AliESDtrack* track, const AliVertex* vtx);
51 void FlagV0s(const AliESDVertex *vtx);
1f9831ab 52 void ProcessESDTracks();
6de485aa 53 Bool_t CanBeElectron(const AliESDtrack* trc) const;
1f9831ab 54
55 void CreateMultiplicityObject();
56 //
7b116aa1 57 // Following members are set via AliITSRecoParam
ac903f1b 58 void SetPhiWindow(Float_t w=0.08) {fPhiWindow=w;}
7284b2b2 59 void SetThetaWindow(Float_t w=0.025) {fThetaWindow=w;}
fa9ed8e9 60 void SetPhiShift(Float_t w=0.0045) {fPhiShift=w;}
7b116aa1 61 void SetRemoveClustersFromOverlaps(Bool_t b = kFALSE) {fRemoveClustersFromOverlaps = b;}
62 void SetPhiOverlapCut(Float_t w=0.005) {fPhiOverlapCut=w;}
63 void SetZetaOverlapCut(Float_t w=0.05) {fZetaOverlapCut=w;}
64
ac903f1b 65 Int_t GetNClustersLayer1() const {return fNClustersLay1;}
66 Int_t GetNClustersLayer2() const {return fNClustersLay2;}
67 Int_t GetNTracklets() const {return fNTracklets;}
968e8539 68 Int_t GetNSingleClusters() const {return fNSingleCluster;}
9b373e9a 69 Short_t GetNFiredChips(Int_t layer) const {return fNFiredChips[layer];}
ac903f1b 70
1f9831ab 71 Float_t* GetClusterLayer1(Int_t n) {return &fClustersLay1[n*kClNPar];}
72 Float_t* GetClusterLayer2(Int_t n) {return &fClustersLay2[n*kClNPar];}
73
ac903f1b 74 Float_t* GetTracklet(Int_t n) {return fTracklets[n];}
968e8539 75 Float_t* GetCluster(Int_t n) {return fSClusters[n];}
ac903f1b 76
77 void SetHistOn(Bool_t b=kFALSE) {fHistOn=b;}
78 void SaveHists();
3ef75756 79
1f9831ab 80 AliITSDetTypeRec *GetDetTypeRec() const {return fDetTypeRec;}
81 void SetDetTypeRec(AliITSDetTypeRec *ptr){fDetTypeRec = ptr;}
6de485aa 82 //
83 void SetCutPxDrSPDin(Float_t v=0.1) { fCutPxDrSPDin = v;}
84 void SetCutPxDrSPDout(Float_t v=0.15) { fCutPxDrSPDout = v;}
85 void SetCutPxDz(Float_t v=0.2) { fCutPxDz = v;}
86 void SetCutDCArz(Float_t v=0.5) { fCutDCArz = v;}
87 void SetCutMinElectronProbTPC(Float_t v=0.5) { fCutMinElectronProbTPC = v;}
88 void SetCutMinElectronProbESD(Float_t v=0.1) { fCutMinElectronProbESD = v;}
89 void SetCutMinP(Float_t v=0.05) { fCutMinP = v;}
90 void SetCutMinRGamma(Float_t v=2.) { fCutMinRGamma = v;}
91 void SetCutMinRK0(Float_t v=1.) { fCutMinRK0 = v;}
92 void SetCutMinPointAngle(Float_t v=0.98) { fCutMinPointAngle = v;}
93 void SetCutMaxDCADauther(Float_t v=0.5) { fCutMaxDCADauther = v;}
94 void SetCutMassGamma(Float_t v=0.03) { fCutMassGamma = v;}
95 void SetCutMassGammaNSigma(Float_t v=5.) { fCutMassGammaNSigma = v;}
96 void SetCutMassK0(Float_t v=0.03) { fCutMassK0 = v;}
97 void SetCutMassK0NSigma(Float_t v=5.) { fCutMassK0NSigma = v;}
98 void SetCutChi2cGamma(Float_t v=2.) { fCutChi2cGamma = v;}
99 void SetCutChi2cK0(Float_t v=2.) { fCutChi2cK0 = v;}
100 void SetCutGammaSFromDecay(Float_t v=-10.) { fCutGammaSFromDecay = v;}
101 void SetCutK0SFromDecay(Float_t v=-10.) { fCutK0SFromDecay = v;}
102 void SetCutMaxDCA(Float_t v=1.) { fCutMaxDCA = v;}
103 //
104 Float_t GetCutPxDrSPDin() const {return fCutPxDrSPDin;}
105 Float_t GetCutPxDrSPDout() const {return fCutPxDrSPDout;}
106 Float_t GetCutPxDz() const {return fCutPxDz;}
107 Float_t GetCutDCArz() const {return fCutDCArz;}
108 Float_t GetCutMinElectronProbTPC() const {return fCutMinElectronProbTPC;}
109 Float_t GetCutMinElectronProbESD() const {return fCutMinElectronProbESD;}
110 Float_t GetCutMinP() const {return fCutMinP;}
111 Float_t GetCutMinRGamma() const {return fCutMinRGamma;}
112 Float_t GetCutMinRK0() const {return fCutMinRK0;}
113 Float_t GetCutMinPointAngle() const {return fCutMinPointAngle;}
114 Float_t GetCutMaxDCADauther() const {return fCutMaxDCADauther;}
115 Float_t GetCutMassGamma() const {return fCutMassGamma;}
116 Float_t GetCutMassGammaNSigma() const {return fCutMassGammaNSigma;}
117 Float_t GetCutMassK0() const {return fCutMassK0;}
118 Float_t GetCutMassK0NSigma() const {return fCutMassK0NSigma;}
119 Float_t GetCutChi2cGamma() const {return fCutChi2cGamma;}
120 Float_t GetCutChi2cK0() const {return fCutChi2cK0;}
121 Float_t GetCutGammaSFromDecay() const {return fCutGammaSFromDecay;}
122 Float_t GetCutK0SFromDecay() const {return fCutK0SFromDecay;}
123 Float_t GetCutMaxDCA() const {return fCutMaxDCA;}
124 //
ac903f1b 125protected:
3ef75756 126 AliITSMultReconstructor(const AliITSMultReconstructor& mr);
7537d03c 127 AliITSMultReconstructor& operator=(const AliITSMultReconstructor& mr);
1f9831ab 128 AliITSDetTypeRec* fDetTypeRec; //! pointer to DetTypeRec
129 AliESDEvent* fESDEvent; //! pointer to ESD event
130 TTree* fTreeRP; //! ITS recpoints
ac903f1b 131
34581d1e 132 UInt_t* fUsedClusLay1; // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 in word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
133 UInt_t* fUsedClusLay2; // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
1f9831ab 134
135 Float_t* fClustersLay1; // clusters in the 1st layer of ITS
136 Float_t* fClustersLay2; // clusters in the 2nd layer of ITS
7b116aa1 137 Int_t* fDetectorIndexClustersLay1; // module index for clusters 1st ITS layer
138 Int_t* fDetectorIndexClustersLay2; // module index for clusters 2nd ITS layer
139 Bool_t* fOverlapFlagClustersLay1; // flag for clusters in the overlap regions 1st ITS layer
140 Bool_t* fOverlapFlagClustersLay2; // flag for clusters in the overlap regions 2nd ITS layer
141
9b373e9a 142 Float_t** fTracklets; // tracklets
143 Float_t** fSClusters; // single clusters (unassociated)
ac903f1b 144
9b373e9a 145 Int_t fNClustersLay1; // Number of clusters (Layer1)
146 Int_t fNClustersLay2; // Number of clusters (Layer2)
147 Int_t fNTracklets; // Number of tracklets
148 Int_t fNSingleCluster; // Number of unassociated clusters
149 Short_t fNFiredChips[2]; // Number of fired chips in the two SPD layers
6de485aa 150 //
7b116aa1 151 // Following members are set via AliITSRecoParam
6de485aa 152 //
7b116aa1 153 Float_t fPhiWindow; // Search window in phi
fa9ed8e9 154 Float_t fThetaWindow; // Search window in theta
155 Float_t fPhiShift; // Phi shift reference value (at 0.5 T)
7b116aa1 156 Bool_t fRemoveClustersFromOverlaps; // Option to skip clusters in the overlaps
157 Float_t fPhiOverlapCut; // Fiducial window in phi for overlap cut
158 Float_t fZetaOverlapCut; // Fiducial window in eta for overlap cut
ac903f1b 159
6de485aa 160 // cuts for secondaries identification
161 Float_t fCutPxDrSPDin; // max P*DR for primaries involving at least 1 SPD
162 Float_t fCutPxDrSPDout; // max P*DR for primaries not involving any SPD
163 Float_t fCutPxDz; // max P*DZ for primaries
164 Float_t fCutDCArz; // max DR or DZ for primares
165 //
166 // cuts for flagging tracks in V0s
167 Float_t fCutMinElectronProbTPC; // min probability for e+/e- PID involving TPC
168 Float_t fCutMinElectronProbESD; // min probability for e+/e- PID not involving TPC
169 //
170 Float_t fCutMinP; // min P of V0
171 Float_t fCutMinRGamma; // min transv. distance from ESDVertex to V0 for gammas
172 Float_t fCutMinRK0; // min transv. distance from ESDVertex to V0 for K0s
173 Float_t fCutMinPointAngle; // min pointing angle cosine
174 Float_t fCutMaxDCADauther; // max DCA of daughters at V0
175 Float_t fCutMassGamma; // max gamma mass
176 Float_t fCutMassGammaNSigma; // max standard deviations from 0 for gamma
177 Float_t fCutMassK0; // max K0 mass difference from PGD value
178 Float_t fCutMassK0NSigma; // max standard deviations for K0 mass from PDG value
179 Float_t fCutChi2cGamma; // max constrained chi2 cut for gammas
180 Float_t fCutChi2cK0; // max constrained chi2 cut for K0s
181 Float_t fCutGammaSFromDecay; // min path*P for gammas
182 Float_t fCutK0SFromDecay; // min path*P for K0s
183 Float_t fCutMaxDCA; // max DCA for V0 at ESD vertex
184
9b373e9a 185 Bool_t fHistOn; // Option to define and fill the histograms
ddced3c8 186
9b373e9a 187 TH1F* fhClustersDPhiAcc; // Phi2 - Phi1 for tracklets
188 TH1F* fhClustersDThetaAcc; // Theta2 - Theta1 for tracklets
9b373e9a 189 TH1F* fhClustersDPhiAll; // Phi2 - Phi1 all the combinations
190 TH1F* fhClustersDThetaAll; // Theta2 - Theta1 all the combinations
3ef75756 191
9b373e9a 192 TH2F* fhDPhiVsDThetaAll; // 2D plot for all the combinations
193 TH2F* fhDPhiVsDThetaAcc; // same plot for tracklets
9b373e9a 194
195 TH1F* fhetaTracklets; // Pseudorapidity distr. for tracklets
196 TH1F* fhphiTracklets; // Azimuthal (Phi) distr. for tracklets
197 TH1F* fhetaClustersLay1; // Pseudorapidity distr. for Clusters L. 1
198 TH1F* fhphiClustersLay1; // Azimuthal (Phi) distr. for Clusters L. 1
199
ac903f1b 200
201 void LoadClusterArrays(TTree* tree);
202
34581d1e 203 ClassDef(AliITSMultReconstructor,8)
ac903f1b 204};
205
206#endif