AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMuonForwardTrackFinder.h
Go to the documentation of this file.
1 #ifndef AliMuonForwardTrackFinder_H
2 #define AliMuonForwardTrackFinder_H
3 
4 // ROOT includes
5 #include "TObject.h"
6 #include "TClonesArray.h"
7 #include "TH2D.h"
8 #include "TH1D.h"
9 #include "TFile.h"
10 #include "TGeoManager.h"
11 #include "TMatrixD.h"
12 #include "TParticle.h"
13 #include "TMath.h"
14 #include "TGraph.h"
15 #include "TEllipse.h"
16 #include "TCanvas.h"
17 #include "TString.h"
18 #include "TLatex.h"
19 #include "TMarker.h"
20 #include "TNtuple.h"
21 #include "TRandom.h"
22 #include "TIterator.h"
23 
24 // STEER includes
25 #include "AliLog.h"
26 #include "AliRun.h"
27 #include "AliRunLoader.h"
28 #include "AliLoader.h"
29 #include "AliHeader.h"
30 #include "AliMC.h"
31 #include "AliStack.h"
32 #include "AliMagF.h"
33 #include "AliTracker.h"
34 #include "AliGRPObject.h"
35 #include "AliRunInfo.h"
36 
37 // MUON includes
38 #include "AliMUONConstants.h"
39 #include "AliMUONTrack.h"
40 #include "AliMUONRecoCheck.h"
41 #include "AliMUONTrackParam.h"
42 #include "AliMUONTrackExtrap.h"
43 #include "AliMUONVTrackStore.h"
44 #include "AliMUONVCluster.h"
45 
46 // MFT includes
47 #include "AliMuonForwardTrack.h"
48 #include "AliMFTCluster.h"
49 #include "AliMFT.h"
50 #include "AliMFTSegmentation.h"
51 #include "AliMFTConstants.h"
52 
53 //====================================================================================================================================================
54 //
55 // Class for the creation of the "global muon tracks" built from the clusters in the
56 // muon spectrometer and the clusters of the Muon Forward Tracker. QA histograms are also created
57 //
58 // Contact author: antonio.uras@cern.ch
59 //
60 //====================================================================================================================================================
61 
62 class AliMuonForwardTrackFinder : public TObject {
63 
64 public:
65 
68 
70 
72 
74 
75  void Init(Int_t nRun, Char_t *readDir, Char_t *outDir, Int_t nEventsToAnalyze = -1);
76  Bool_t LoadNextEvent();
77  Int_t LoadNextTrack();
78  Int_t GetNDF(Int_t nClusters);
79  void PDGNameConverter(const Char_t *nameIn, Char_t *nameOut);
80  void DrawPlanes();
81  void Terminate();
82  void WriteHistos();
83 
84  void SetRun(Int_t nRun) { fRun = nRun; }
85  void SetNEventsToAnalyze(Int_t nEventsToAnalyze) { fNEventsToAnalyze = nEventsToAnalyze; }
86  void SetSigmaSpectrometerCut(Double_t sigmaSpectrometerCut) { fSigmaSpectrometerCut = sigmaSpectrometerCut; }
87  void SetSigmaClusterCut(Double_t sigmaClusterCut) { fSigmaClusterCut = sigmaClusterCut; }
88  void SetChi2GlobalCut(Double_t chi2GlobalCut) { fChi2GlobalCut = chi2GlobalCut; }
89  void SetReadDir(Char_t *dirName) { fReadDir = dirName; }
90  void SetOutDir(Char_t *dirName) { fOutDir = dirName; }
91  void SetDraw(Bool_t drawOption);
92  void SetRAbsorberCut(Double_t rAbsorberCut) { fRAbsorberCut = rAbsorberCut; }
93  void SetLowPtCut(Double_t lowPtCut) { fLowPtCut = lowPtCut; }
94  void SetNFinalCandidatesCut(Int_t nFinalCandidatesCut) { fNFinalCandidatesCut = nFinalCandidatesCut; }
95  void SetVertexError(Double_t xErr, Double_t yErr, Double_t zErr) { fVertexErrorX=xErr; fVertexErrorY=yErr; fVertexErrorZ=zErr; }
96 
97  Int_t GetRun() { return fRun; }
98  Int_t GetNEvents() { return fNEventsToAnalyze; }
100  Double_t GetSigmaClusterCut() { return fSigmaClusterCut; }
101  Double_t GetChi2GlobalCut() { return fChi2GlobalCut; }
102  Double_t GetRAbsorberCut() { return fRAbsorberCut; }
103  Double_t GetLowPtCut() { return fLowPtCut; }
104  Int_t GetNPlanesMFT() { return fNPlanesMFT; }
106  Int_t GetCurrentEvent() { return fEv; }
107 
114 
115  void SetNPlanesMFT(Int_t nPlanesMFT) { fNPlanesMFT = nPlanesMFT; }
117  void SetNMaxMissingMFTClusters(Int_t nMaxMissingMFTClusters) { fNMaxMissingMFTClusters = nMaxMissingMFTClusters; }
118  void SetMandatoryPlane(Int_t iPlane) { if (0<=iPlane && iPlane<AliMFTConstants::fNMaxPlanes) fIsPlaneMandatory[iPlane] = kTRUE; }
119 
120  Int_t FindClusterInPlane(Int_t planeId);
121  void AttachGoodClusterInPlane(Int_t planeId);
123  Double_t TryOneCluster(const AliMUONTrackParam &trackParam, AliMFTCluster *cluster);
124  void BookHistos();
125  void SetTitleHistos();
126  void BookPlanes();
127  void ResetPlanes();
128  void PrintParticleHistory();
129 
130  Bool_t IsCorrectMatch(AliMFTCluster *cluster);
132  Bool_t IsMother(const Char_t *nameMother);
133 
134  void SetMatchingMode(Int_t matchingMode) { fMatchingMode = matchingMode; }
135  void SetMinResearchRadiusAtPlane(Int_t plane, Double_t radius) { if (plane>=0 && plane<fNMaxPlanes) fMinResearchRadiusAtPlane[plane] = radius; }
136 
137  void FillOutputTree();
138  void WriteOutputTree();
139 
140  Bool_t InitGRP();
141  Bool_t SetRunNumber();
142 
143  void SetMaxNTracksToBeAnalyzed(Int_t nTracks) { fMaxNTracksToBeAnalyzed = nTracks; }
144  void SetBransonCorrection(Bool_t correction) { fBransonCorrection = correction; }
145 
146 private:
147 
150 
151 protected:
152 
153  static const Int_t fNMaxPlanes = AliMFTConstants::fNMaxPlanes; // max number of MFT planes
154  static const Double_t fRadLengthSi;
155  static const Int_t fMaxNCandidates = 1000;
156 
157  Int_t fRun;
158  Int_t fNEventsToAnalyze; // events to analyze
159  Double_t fSigmaClusterCut; // to select the clusters in the MFT planes which are compatible with the extrapolated muon track
160  Double_t fScaleSigmaClusterCut; // to tune the cut on the compatible clusters in case of too many candidates
161  Bool_t fGlobalTrackingDiverged; // to keep memory of a possible divergence in the global tracking finding
162  Double_t fChi2GlobalCut; // cut on the final chi2 of the global muon track
163  Double_t fSigmaSpectrometerCut; // for the selection of the tracks in the muon spectrometer
164  Double_t fVertexErrorX; // uncertainty on the x position of the muon's origin
165  Double_t fVertexErrorY; // uncertainty on the y position of the muon's origin
166  Double_t fVertexErrorZ; // uncertainty on the z position of the muon's origin
167  Int_t fNFinalCandidatesCut; // cut on the number of the final candidates for the muon track
168  TString fReadDir;
169  TString fOutDir;
170  Bool_t fDrawOption;
171 
174 
175  TClonesArray *fMFTClusterArray[fNMaxPlanes];
178 
179  Double_t fRAbsorberCut; // in cm, corresponds to the radial position of a 3 degrees track at the end of the absorber (-503 cm)
180  Double_t fLowPtCut; // in GeV/c, the lower limit for the pt of a track in the muon spectrometer
181  Int_t fNPlanesMFT; // number of planes of the Vertex Telescope (Muon Internal Tracker) -> This should be taken from the new version of AliVZERO2
183  Int_t fNMaxMissingMFTClusters; // max. number of MFT clusters which can be missed in the global fit procedure
184  Bool_t fIsPlaneMandatory[fNMaxPlanes]; // specifies which MFT planes cannot be missed in the global fit procedure
185 
186  Int_t fEv; // current event being analyzed
187  Int_t fLabelMC; // MC label of the muon track reconstructed in the spectrometer
188 
189  Bool_t fIsClusterCompatible[10]; // here the clusters in the Muon Spectrometer are concerned
190 
191  Double_t fZPlane[fNMaxPlanes]; // z-position of the MFT planes (center of the support)
192  Double_t fRPlaneMax[fNMaxPlanes]; // max radius of the MFT planes (the support)
193  Double_t fRPlaneMin[fNMaxPlanes]; // min radius of the MFT planes (the support)
194 
202 
205 
206  TGraph *fGrMFTPlane[4][20];
208  TCanvas *fCanvas;
209 
214 
223 
224  TFile *fFileCluster;
225  TFile *fFileESD;
226  TFile *fFile_gAlice;
227 
228  AliRunLoader *fRunLoader;
229  AliLoader *fMFTLoader;
231 
233 
239 
240  TClonesArray *fCandidateTracks;
241 
244 
245  TIterator *fNextTrack;
246 
247  AliStack *fStack;
248 
251 
254 
255  TClonesArray *fMuonForwardTracks;
256 
259 
260  AliGRPObject *fGRPData;
261  AliRunInfo *fRunInfo;
262 
263  Bool_t fBransonCorrection; // if TRUE, Branson Correction is applied when extrapolating the MUON tracks to the vertex region
264 
266 
267 };
268 
269 //====================================================================================================================================================
270 
271 #endif
272 
273 
Base class of a track container.
AliMuonForwardTrack * fFinalBestCandidate
muon extrapolated track being tested
void SetVertexError(Double_t xErr, Double_t yErr, Double_t zErr)
Bool_t fIsGoodClusterInPlane[fNMaxPlanes]
ClassDef(AliMuonForwardTrackFinder, 1)
TH1D * fHistChi2Cluster_GoodCluster[fNMaxPlanes]
TH1D * fHistGlobalChi2AtPlaneFor_BAD_CandidatesOfTrackableMuons[fNMaxPlanes]
void SetSigmaSpectrometerCut(Double_t sigmaSpectrometerCut)
Definition: AliMFT.h:41
Bool_t IsCorrectMatch(AliMFTCluster *cluster)
TH1D * fHistChi2Cluster_BadCluster[fNMaxPlanes]
AliMuonForwardTrackFinder & operator=(const AliMuonForwardTrackFinder &other)
static const Int_t fNMaxPlanes
Bool_t IsMother(const Char_t *nameMother)
void SetNPlanesMFT(Int_t nPlanesMFT)
void SetBransonCorrection(Bool_t correction)
Track parameters in ALICE dimuon spectrometer.
TEllipse * fCircleExt[fNMaxPlanes]
TH1D * fHistNTracksAfterExtrapolation[fNMaxPlanes]
TH1D * fHistDistanceGoodClusterFromTrackMinusDistanceBestClusterFromTrackAtLastPlane
void PDGNameConverter(const Char_t *nameIn, Char_t *nameOut)
void SetNFinalCandidatesCut(Int_t nFinalCandidatesCut)
Utility class to check reconstruction.
Bool_t fIsCurrentMuonTrackable
best final candidate (if any)
TClonesArray * fMFTClusterArrayFront[fNMaxPlanes]
array of clusters for the planes of the MFT
AliMUONVTrackStore * fTrackStore
array of track we are going to build (starting from fMuonTrackReco)
AliStack * fStack
Iterator for reading the MUON tracks.
void SetChi2GlobalCut(Double_t chi2GlobalCut)
Int_t fMatchingMode
array of AliMuonForwardTrack
TClonesArray * fMFTClusterArray[fNMaxPlanes]
TH1D * fHistGlobalChi2AtPlaneFor_GOOD_CandidatesOfTrackableMuons[fNMaxPlanes]
Double_t fRAbsorberCut
array of back clusters for the planes of the MFT
void SetNMaxMissingMFTClusters(Int_t nMaxMissingMFTClusters)
Int_t GetNRealTracksWithRefMC_andTrigger_andGoodPt_andGoodTheta() const
Double_t TryOneCluster(const AliMUONTrackParam &trackParam, AliMFTCluster *cluster)
void SetMatchingMode(Int_t matchingMode)
void SetRAbsorberCut(Double_t rAbsorberCut)
AliRunInfo * fRunInfo
Data from the GRP/GRP/Data CDB folder.
void SetNEventsToAnalyze(Int_t nEventsToAnalyze)
Class for the virtual segmentation of the ALICE Muon Forward Tracker.
AliMUONVTrackStore * fTrackRefStore
list of reconstructed MUON tracks
void SetSigmaClusterCut(Double_t sigmaClusterCut)
void SetLowPtCut(Double_t lowPtCut)
TIterator * fNextTrack
list of reconstructible MUON tracks
AliMuonForwardTrack * fCurrentTrack
muon track being analyzed
void SetMaxNTracksToBeAnalyzed(Int_t nTracks)
TClonesArray * fMFTClusterArrayBack[fNMaxPlanes]
array of front clusters for the planes of the MFT
TEllipse * fCircleInt[fNMaxPlanes]
Reconstructed track in ALICE dimuon spectrometer.
Definition: AliMUONTrack.h:24
Int_t GetNRealTracksWithRefMC_andTrigger_andGoodPt() const
void Init(Int_t nRun, Char_t *readDir, Char_t *outDir, Int_t nEventsToAnalyze=-1)
Double_t fMinResearchRadiusAtPlane[fNMaxPlanes]
void SetMinResearchRadiusAtPlane(Int_t plane, Double_t radius)
ALICE muon forward track, combining the information of the Muon Spectrometer and the Muon Forward Tra...