]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMultReconstructor.h
Reverting the previous mods as they cause a segmentation violation
[u/mrichter/AliRoot.git] / ITS / AliITSMultReconstructor.h
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
6 //_________________________________________________________________________
7 // 
8 //        Implementation of the ITS-SPD trackleter class
9 //
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.
12 //
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 //_________________________________________________________________________
19 #include "AliTrackleter.h"
20
21 class TBits;
22 class TTree;
23 class TH1F;
24 class TH2F; 
25 class AliITSDetTypeRec;
26 class AliITSgeom;
27 class AliESDEvent;
28 class AliESDtrack;
29 class AliVertex;
30 class AliESDVertex;
31 class AliMultiplicity;
32
33 class AliITSMultReconstructor : public AliTrackleter
34 {
35 public:
36   //
37   enum {kClTh,kClPh,kClZ,kClMC0,kClMC1,kClMC2,kClNPar};
38   enum {kTrTheta,kTrPhi,kTrDPhi,kTrDTheta,kTrLab1,kTrLab2,kClID1,kClID2,kTrNPar};
39   enum {kSCTh,kSCPh,kSCLab,kSCID,kSCNPar};   
40   enum {kITSTPC,kITSSAP,kITSTPCBit=BIT(kITSTPC),kITSSAPBit=BIT(kITSSAP)}; // RS
41   AliITSMultReconstructor();
42   virtual ~AliITSMultReconstructor();
43
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); 
47   void LoadClusterFiredChips(TTree* tree);
48   void FlagClustersInOverlapRegions(Int_t ic1,Int_t ic2);
49   void FlagTrackClusters(Int_t id);
50   void FlagIfSecondary(AliESDtrack* track, const AliVertex* vtx);
51   void FlagV0s(const AliESDVertex *vtx);
52   void ProcessESDTracks();
53   Bool_t  CanBeElectron(const AliESDtrack* trc) const;
54   
55   void CreateMultiplicityObject();
56   //
57   // Following members are set via AliITSRecoParam
58   void SetPhiWindow(Float_t w=0.08) {fPhiWindow=w;}
59   void SetThetaWindow(Float_t w=0.025) {fThetaWindow=w;}
60   void SetPhiShift(Float_t w=0.0045) {fPhiShift=w;}
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   void SetPhiRotationAngle(Float_t w=0.0) {fPhiRotationAngle=w;}
65
66   Int_t GetNClustersLayer1() const {return fNClustersLay1;}
67   Int_t GetNClustersLayer2() const {return fNClustersLay2;}
68   Int_t GetNTracklets() const {return fNTracklets;}
69   Int_t GetNSingleClusters() const {return fNSingleCluster;}
70   Short_t GetNFiredChips(Int_t layer) const {return fNFiredChips[layer];}
71
72   Float_t* GetClusterLayer1(Int_t n) {return &fClustersLay1[n*kClNPar];}
73   Float_t* GetClusterLayer2(Int_t n) {return &fClustersLay2[n*kClNPar];}
74
75   Float_t* GetTracklet(Int_t n) {return fTracklets[n];}
76   Float_t* GetCluster(Int_t n) {return fSClusters[n];}
77
78   void SetHistOn(Bool_t b=kFALSE) {fHistOn=b;}
79   void SaveHists();
80
81   AliITSDetTypeRec *GetDetTypeRec() const {return fDetTypeRec;}
82   void SetDetTypeRec(AliITSDetTypeRec *ptr){fDetTypeRec = ptr;}
83   //
84   void    SetCutPxDrSPDin(Float_t v=0.1)             { fCutPxDrSPDin = v;}
85   void    SetCutPxDrSPDout(Float_t v=0.15)           { fCutPxDrSPDout = v;}
86   void    SetCutPxDz(Float_t v=0.2)                  { fCutPxDz = v;}
87   void    SetCutDCArz(Float_t v=0.5)                 { fCutDCArz = v;}
88   void    SetCutMinElectronProbTPC(Float_t v=0.5)    { fCutMinElectronProbTPC = v;}
89   void    SetCutMinElectronProbESD(Float_t v=0.1)    { fCutMinElectronProbESD = v;}
90   void    SetCutMinP(Float_t v=0.05)                 { fCutMinP = v;}
91   void    SetCutMinRGamma(Float_t v=2.)              { fCutMinRGamma = v;}
92   void    SetCutMinRK0(Float_t v=1.)                 { fCutMinRK0 = v;}
93   void    SetCutMinPointAngle(Float_t v=0.98)        { fCutMinPointAngle = v;}
94   void    SetCutMaxDCADauther(Float_t v=0.5)         { fCutMaxDCADauther = v;}
95   void    SetCutMassGamma(Float_t v=0.03)            { fCutMassGamma = v;}
96   void    SetCutMassGammaNSigma(Float_t v=5.)        { fCutMassGammaNSigma = v;}
97   void    SetCutMassK0(Float_t v=0.03)               { fCutMassK0 = v;}
98   void    SetCutMassK0NSigma(Float_t v=5.)           { fCutMassK0NSigma = v;}
99   void    SetCutChi2cGamma(Float_t v=2.)             { fCutChi2cGamma = v;}
100   void    SetCutChi2cK0(Float_t v=2.)                { fCutChi2cK0 = v;}
101   void    SetCutGammaSFromDecay(Float_t v=-10.)      { fCutGammaSFromDecay = v;}
102   void    SetCutK0SFromDecay(Float_t v=-10.)         { fCutK0SFromDecay = v;}
103   void    SetCutMaxDCA(Float_t v=1.)                 { fCutMaxDCA = v;}
104   //
105   Float_t GetCutPxDrSPDin()                    const {return fCutPxDrSPDin;}
106   Float_t GetCutPxDrSPDout()                   const {return fCutPxDrSPDout;}
107   Float_t GetCutPxDz()                         const {return fCutPxDz;}
108   Float_t GetCutDCArz()                        const {return fCutDCArz;}
109   Float_t GetCutMinElectronProbTPC()           const {return fCutMinElectronProbTPC;}
110   Float_t GetCutMinElectronProbESD()           const {return fCutMinElectronProbESD;}
111   Float_t GetCutMinP()                         const {return fCutMinP;}
112   Float_t GetCutMinRGamma()                    const {return fCutMinRGamma;}
113   Float_t GetCutMinRK0()                       const {return fCutMinRK0;}
114   Float_t GetCutMinPointAngle()                const {return fCutMinPointAngle;}
115   Float_t GetCutMaxDCADauther()                const {return fCutMaxDCADauther;}
116   Float_t GetCutMassGamma()                    const {return fCutMassGamma;}
117   Float_t GetCutMassGammaNSigma()              const {return fCutMassGammaNSigma;}
118   Float_t GetCutMassK0()                       const {return fCutMassK0;}
119   Float_t GetCutMassK0NSigma()                 const {return fCutMassK0NSigma;}
120   Float_t GetCutChi2cGamma()                   const {return fCutChi2cGamma;}
121   Float_t GetCutChi2cK0()                      const {return fCutChi2cK0;}
122   Float_t GetCutGammaSFromDecay()              const {return fCutGammaSFromDecay;}
123   Float_t GetCutK0SFromDecay()                 const {return fCutK0SFromDecay;}
124   Float_t GetCutMaxDCA()                       const {return fCutMaxDCA;}
125   //
126 protected:
127   AliITSMultReconstructor(const AliITSMultReconstructor& mr);
128   AliITSMultReconstructor& operator=(const AliITSMultReconstructor& mr);
129   AliITSDetTypeRec* fDetTypeRec;            //! pointer to DetTypeRec
130   AliESDEvent*      fESDEvent;              //! pointer to ESD event
131   TTree*            fTreeRP;                //! ITS recpoints
132
133   UInt_t*       fUsedClusLay1;               // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 in word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
134   UInt_t*       fUsedClusLay2;               // RS: flag of clusters usage in ESD tracks: 0=unused, else ID+1 word0=TPC/ITS+ITSSA, word1=ITSSA_Pure
135
136   Float_t*      fClustersLay1;               // clusters in the 1st layer of ITS 
137   Float_t*      fClustersLay2;               // clusters in the 2nd layer of ITS 
138   Int_t*        fDetectorIndexClustersLay1;  // module index for clusters 1st ITS layer
139   Int_t*        fDetectorIndexClustersLay2;  // module index for clusters 2nd ITS layer
140   Bool_t*       fOverlapFlagClustersLay1;    // flag for clusters in the overlap regions 1st ITS layer
141   Bool_t*       fOverlapFlagClustersLay2;    // flag for clusters in the overlap regions 2nd ITS layer 
142
143   Float_t**     fTracklets;            // tracklets 
144   Float_t**     fSClusters;            // single clusters (unassociated)
145   
146   Int_t         fNClustersLay1;        // Number of clusters (Layer1)
147   Int_t         fNClustersLay2;        // Number of clusters (Layer2)
148   Int_t         fNTracklets;           // Number of tracklets
149   Int_t         fNSingleCluster;       // Number of unassociated clusters
150   Short_t       fNFiredChips[2];       // Number of fired chips in the two SPD layers
151   //
152   // Following members are set via AliITSRecoParam
153   //
154   Float_t       fPhiWindow;                    // Search window in phi
155   Float_t       fThetaWindow;                  // Search window in theta
156   Float_t       fPhiShift;                     // Phi shift reference value (at 0.5 T) 
157   Bool_t        fRemoveClustersFromOverlaps;   // Option to skip clusters in the overlaps
158   Float_t       fPhiOverlapCut;                // Fiducial window in phi for overlap cut
159   Float_t       fZetaOverlapCut;               // Fiducial window in eta for overlap cut
160   Float_t       fPhiRotationAngle;             // Angle to rotate the inner layer cluster for combinatorial reco only 
161
162   // cuts for secondaries identification
163   Float_t       fCutPxDrSPDin;                 // max P*DR for primaries involving at least 1 SPD
164   Float_t       fCutPxDrSPDout;                // max P*DR for primaries not involving any SPD
165   Float_t       fCutPxDz;                      // max P*DZ for primaries
166   Float_t       fCutDCArz;                     // max DR or DZ for primares
167   //
168   // cuts for flagging tracks in V0s
169   Float_t       fCutMinElectronProbTPC;     // min probability for e+/e- PID involving TPC
170   Float_t       fCutMinElectronProbESD;     // min probability for e+/e- PID not involving TPC
171   //
172   Float_t       fCutMinP;                   // min P of V0
173   Float_t       fCutMinRGamma;              // min transv. distance from ESDVertex to V0 for gammas
174   Float_t       fCutMinRK0;                 // min transv. distance from ESDVertex to V0 for K0s
175   Float_t       fCutMinPointAngle;          // min pointing angle cosine
176   Float_t       fCutMaxDCADauther;          // max DCA of daughters at V0
177   Float_t       fCutMassGamma;              // max gamma mass
178   Float_t       fCutMassGammaNSigma;        // max standard deviations from 0 for gamma
179   Float_t       fCutMassK0;                 // max K0 mass difference from PGD value
180   Float_t       fCutMassK0NSigma;           // max standard deviations for K0 mass from PDG value
181   Float_t       fCutChi2cGamma;             // max constrained chi2 cut for gammas
182   Float_t       fCutChi2cK0;                // max constrained chi2 cut for K0s
183   Float_t       fCutGammaSFromDecay;        // min path*P for gammas
184   Float_t       fCutK0SFromDecay;           // min path*P for K0s
185   Float_t       fCutMaxDCA;                 // max DCA for V0 at ESD vertex  
186
187   Bool_t        fHistOn;               // Option to define and fill the histograms 
188
189   TH1F*         fhClustersDPhiAcc;     // Phi2 - Phi1 for tracklets 
190   TH1F*         fhClustersDThetaAcc;   // Theta2 - Theta1 for tracklets 
191   TH1F*         fhClustersDPhiAll;     // Phi2 - Phi1 all the combinations 
192   TH1F*         fhClustersDThetaAll;   // Theta2 - Theta1 all the combinations
193  
194   TH2F*         fhDPhiVsDThetaAll;     // 2D plot for all the combinations  
195   TH2F*         fhDPhiVsDThetaAcc;     // same plot for tracklets 
196
197   TH1F*         fhetaTracklets;        // Pseudorapidity distr. for tracklets 
198   TH1F*         fhphiTracklets;        // Azimuthal (Phi) distr. for tracklets  
199   TH1F*         fhetaClustersLay1;     // Pseudorapidity distr. for Clusters L. 1
200   TH1F*         fhphiClustersLay1;     // Azimuthal (Phi) distr. for Clusters L. 1 
201
202
203   void LoadClusterArrays(TTree* tree);
204
205   ClassDef(AliITSMultReconstructor,9)
206 };
207
208 #endif