AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMFTTrackFinder.h
Go to the documentation of this file.
1 /* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice */
3 
4 //====================================================================================================================================================
5 //
6 // Class for finding Tracks from Cluster of the ALICE Muon Forward Tracker
7 //
8 // Contact author: raphael.tieulent@cern.ch
9 //
10 //====================================================================================================================================================
11 
12 #ifndef AliMFTTrackFinder_H
13 #define AliMFTTrackFinder_H
14 
15 #include "TObject.h"
16 #include "TClonesArray.h"
17 #include "TList.h"
18 #include "TH1.h"
19 #include "TH2.h"
20 
21 #include "AliMFTConstants.h"
22 #include "AliLog.h"
23 
24 class AliMFTCATrack;
25 class AliMFTCACell;
26 class AliMFTCAHit;
27 class AliMFTCALayer;
28 class AliMFTCARoad;
29 class TF1;
30 
31 //============================================================================================
32 
33 class AliMFTTrackFinder : public TObject {
34 
35 private:
36  static const Int_t fNDetMax = 10;
37 public:
38 
41 
42  void Init(Char_t *parfile);
43  void ReadParam(Char_t *parfile = "param.txt");
44  void SetDebug(Int_t debug) { fDebug = debug; }
45 
46  virtual void Clear(Option_t *);
47 
48  AliMFTCATrack *AddTrack(Int_t gid);
49  AliMFTCATrack *AddTrack(Int_t gid, const AliMFTCATrack& track);
50 
51  const Int_t GetNlayers() { return fNlayers; }
52  const Int_t GetNtracks() { return fNtracks; }
53  const Int_t GetNcells() { return fCellGID; }
54 
55  void CreateCellsOld(Bool_t calcVertex = kFALSE);
56  void CreateCells(Bool_t calcVertex = kFALSE);
57  void CreateGapCells();
58  void ClearCells();
59  void ResetCells();
60 
61  AliMFTCACell *GetCellByGID(Int_t gid);
62 
63  void RunForward();
64  void RunBackward();
65  void LoadClusters( TClonesArray *clusterArrayFront[AliMFTConstants::fNMaxPlanes], TClonesArray *clusterArrayBack[AliMFTConstants::fNMaxPlanes] );
66 
67  Bool_t RuleSelect(AliMFTCACell *cellL, AliMFTCACell *cellR);
68  Bool_t RuleSelectCell(AliMFTCACell *cell);
69  Bool_t RuleSelectCell(Double_t *h1, Double_t *h2, Int_t iL1, TF1 *f = 0, Bool_t acalc = kFALSE);
70  Bool_t RuleSelect2LayersGap(Int_t iL1, Int_t iL2, Double_t *hit1, Double_t *hit2);
71 
72  AliMFTCALayer *GetLayer(Int_t nl) { return fLayers[nl]; }
73  AliMFTCATrack *GetTrack(Int_t nt) { return (AliMFTCATrack*)fTracks->At(nt); }
74 
75  TList * GetHistograms(){return fHistList;};
76 
77  void UpdateCellStatus();
78 
79  void PrintAll();
80  void DrawHisto();
81  void DrawTracks(Double_t *pTot, Double_t *Theta);
82  void FilterTracks();
83  void PrintTrack(Int_t id);
84 
85  void CalculateVertex();
86  Double_t GetZVertCalc() { return fZVertCalc; }
87  void SetZVertRange(Double_t *zvr, Double_t zvd) {
88  fZVertRange[0] = zvr[0]; fZVertRange[1] = zvr[1];
89  fZVertDet = zvd;
90  }
91 
92  // parameters
93  const Double_t GetThick() { return fThick; }
94  const Double_t GetPixelNoise() { return fPixelNoise; }
95  const Double_t GetPlaneDetEff(Int_t i) { return fPlaneDetEff[i]; }
96  const Double_t GetMBRate() { return fMBRate; }
97  const Double_t GetCMOSIntTime() { return fCMOSIntTime; }
98  const Bool_t AddNoise() { return fAddNoise; }
99  const Bool_t UseTF() { return fUseTF; }
100  const Bool_t AddQED() { return fAddQED; }
101  const Bool_t CalcVertex() { return fCalcVertex; }
102  const Bool_t ReadGeom() { return fReadGeom; }
103  const Char_t *GetGeomName() { return (fGeomName.Append(".root")).Data(); }
104 
105  void PrintParam();
106 
107  void SetCAtime(Double_t cpu, Double_t real) { fCPUTime += cpu; fRealTime += real; }
108 
109  const Double_t GetCPUTime() { return fCPUTime; }
110  const Double_t GetRealTime() { return fRealTime; }
111 
112  const Int_t GetNDet() { return fNlayers; }
113 
114  void FindTracks(); // simple track finding
115 
117  AliInfo("Removing Last Track");
118  fTracks->RemoveAt(fTracks->GetLast());
119  fNtracks--;
120  }
121 
122  void AnalyzeCells();
123  const Int_t GetNDifTracks() { return fNDifTracks; }
124 
125  void SetPlanesZ(Double_t *z, Int_t n) {
126  for (Int_t i = 0; i < n; i++) fPlanesZ[i] = z[i];
127  }
128 
129  void BuildRoads();
131  AliMFTCARoad *GetRoad(Int_t nr) { return (AliMFTCARoad*)fRoads->At(nr); }
132  const Int_t GetNRoads() { return fNRoads; }
133 
134  // CA using roads
135  void CreateCellsR(AliMFTCARoad *road);
136  void RunForwardR(AliMFTCARoad *road, Int_t &trackGID);
137  void RunBackwardR(AliMFTCARoad *road, Int_t &trackGID);
138  void UpdateCellStatusR();
139  Bool_t LinFit(Int_t nDet, Double_t *xcl,
140  Double_t *ycl, Double_t *yerr,
141  Double_t &a, Double_t &ae, Double_t &b, Double_t &be,
142  Int_t skip = -1);
143  Double_t GetErrX() { return fErrX; }
144  Double_t GetErrY() { return fErrY; }
145 
146 private:
147 
148  Float_t fXCut;
149  Float_t fYCut;
150  Float_t fACutV[fNDetMax];
151  Float_t fACutN[fNDetMax];
152  Float_t fMaxSegAngle;
153 
154  Int_t fCellGID;
156  Int_t fNlayers;
157  Int_t fNtracks;
158 
160 
161  TClonesArray *fTracks;
162  TList * fHistList;
163 
164  TH1F *hDA[fNDetMax];
165  TH1F *hDAv[fNDetMax];
166  TH2F *hDXY[fNDetMax];
167  TH1F *hNGoodCell;
168  TH1F *hTrackType;
169  TH1F *hAngleCells;
170  TH1F *hThetaCells;
171 
172  Bool_t fCalcVertex; // Calculate vertex z from cells
173  Double_t fZVertCalc;
174  Double_t fZVertDet;
175  Double_t fZVertRange[2];
176  Int_t fMinTrackLength; // Minimum requested track length in hits
177  Double_t fPlaneDetEff[fNDetMax]; // Single plane efficiency
178  Bool_t fAddNoise; // Add pixel noise
179  Double_t fPixelNoise; // Probability of pixel noise
180  Bool_t fAddQED; // Add hits for QED processes
181  Double_t fMBRate; // Hadronic MB rate [kHz]
182  Double_t fCMOSIntTime; // CMOS Integration Time [micro seconds]
183  Double_t fThick; // Single plane thickness in X0
184  Bool_t fReadGeom; // Read geometry from ROOT file
185  TString fGeomName; // Geometry file name
186  Bool_t fUseTF; // Use the TrackFinder
187 
188  Int_t fDebug; // Debugging level
189 
190  Double_t fCPUTime; // CA CPU time
191  Double_t fRealTime; // CA real time
192 
193  Double_t GetCellAngleDif(AliMFTCACell *cell1, AliMFTCACell *cell2);
194  Double_t GetCellInterceptX(AliMFTCACell *cell, Double_t z);
195  Double_t GetCellInterceptY(AliMFTCACell *cell, Double_t z);
196 
197  TH2F *hHitDifXY;
198  TH1F *hAngDifAll;
199  TH1F *hAngDifDup;
200  TH2F *hIntDifXYAll;
201  TH2F *hIntDifXYDup;
202  TH1F * hVertZ;
203  TH1F * hVertZa;
204 
205  Int_t fNDifTracks;
206 
207  Double_t fPlanesZ[fNDetMax]; // median z values of the two faces
208  Double_t fZGap; // distance between the two faces
209 
210  Int_t fNRoads;
211 
212  TClonesArray *fRoads;
213 
214  Double_t fErrX;
215  Double_t fErrY;
216 
218 
219 };
220 
221 
222 
223 #endif
void CreateCells(Bool_t calcVertex=kFALSE)
TBrowser b
Definition: RunAnaESD.C:12
Double_t fPlanesZ[fNDetMax]
void CreateCellsOld(Bool_t calcVertex=kFALSE)
const Bool_t UseTF()
const Double_t GetPlaneDetEff(Int_t i)
void RunBackwardR(AliMFTCARoad *road, Int_t &trackGID)
virtual void Clear(Option_t *)
void DrawTracks(Double_t *pTot, Double_t *Theta)
const Int_t GetNtracks()
Double_t fZVertCalc
! Calculated vertez z
AliMFTCACell * GetCellByGID(Int_t gid)
void SetZVertRange(Double_t *zvr, Double_t zvd)
const Double_t GetThick()
Int_t fCellGID
! Cell global identifier
Float_t fXCut
Cut in x difference; RuleSelect.
TFile f("CalibObjects.root")
const Int_t GetNDet()
Double_t fErrX
! Error in X
Double_t fErrY
! Error in Y
TClonesArray * fRoads
! Array of roads
void SetDebug(Int_t debug)
AliMFTCALayer * fLayers[fNDetMax]
! Array of layers
AliMFTCALayer * GetLayer(Int_t nl)
Double_t fZVertRange[2]
! Limits of vertex z accepted range
static const Int_t fNMaxPlanes
TH1F * hAngleCells
! Angle between adjacent cells
Double_t GetCellInterceptY(AliMFTCACell *cell, Double_t z)
Double_t fZVertDet
! Vertex z given by ext detector
const Double_t GetRealTime()
void ReadParam(Char_t *parfile="param.txt")
static const Int_t fNDetMax
AliTPCfastTrack * track
const Int_t GetNDifTracks()
TH2F * hDXY[fNDetMax]
! Histogram with X,Y distance between end of cells
void PrintTrack(Int_t id)
AliMFTCATrack * GetTrack(Int_t nt)
const Char_t * GetGeomName()
TH1F * hTrackType
! Histogram track Type: 0 = good track ; 1 = hits from other track ; 2 = hits from noisy pixels ...
Int_t fNRoads
! number of built roads
void CreateCellsR(AliMFTCARoad *road)
void SetPlanesZ(Double_t *z, Int_t n)
const Double_t GetMBRate()
Float_t fACutV[fNDetMax]
Cut in angle difference: for cell vertex compatibility.
Float_t fYCut
Cut in y difference; RuleSelect.
void SetCAtime(Double_t cpu, Double_t real)
const Bool_t ReadGeom()
const Double_t GetCPUTime()
void LoadClusters(TClonesArray *clusterArrayFront[AliMFTConstants::fNMaxPlanes], TClonesArray *clusterArrayBack[AliMFTConstants::fNMaxPlanes])
Double_t GetCellInterceptX(AliMFTCACell *cell, Double_t z)
AliMFTCATrack * AddTrack(Int_t gid)
AliMFTCARoad * AddRoad()
const Bool_t AddNoise()
Bool_t LinFit(Int_t nDet, Double_t *xcl, Double_t *ycl, Double_t *yerr, Double_t &a, Double_t &ae, Double_t &b, Double_t &be, Int_t skip=-1)
Int_t fNlayers
Number of detection planes.
Float_t fACutN[fNDetMax]
Cut in angle difference: for neighbor cells compatibility.
const Double_t GetCMOSIntTime()
Int_t fNtracks
! Number of tracks
Bool_t RuleSelectCell(AliMFTCACell *cell)
Float_t fMaxSegAngle
Max cut of the Theta angle of segments [deg].
Double_t GetCellAngleDif(AliMFTCACell *cell1, AliMFTCACell *cell2)
TH1F * hThetaCells
! Theta of the cells
ClassDef(AliMFTTrackFinder, 2)
TList * fHistList
! List of histograms
const Int_t GetNcells()
TClonesArray * fTracks
! Array of tracks
void Init(Char_t *parfile)
const Bool_t AddQED()
TH1F * hNGoodCell
! Histogram showing numbers of good cells in the track
Double_t fPlaneDetEff[fNDetMax]
TH1F * hDAv[fNDetMax]
! Histogram with angle with respect to the vertex
Int_t fMaxCellStatus
! Maximum value of a cell status after RunForward
void RunForwardR(AliMFTCARoad *road, Int_t &trackGID)
const Bool_t CalcVertex()
const Int_t GetNRoads()
Bool_t RuleSelect2LayersGap(Int_t iL1, Int_t iL2, Double_t *hit1, Double_t *hit2)
AliMFTCARoad * GetRoad(Int_t nr)
Int_t debug
TH1F * hDA[fNDetMax]
! Histogram with angle between cells
const Int_t GetNlayers()
const Double_t GetPixelNoise()
Bool_t RuleSelect(AliMFTCACell *cellL, AliMFTCACell *cellR)