1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 ///////////////////////////////////////////////////
25 ///////////////////////////////////////////////////
27 #include "AliPWG3TrackExtrapInterface.h"
28 #include "AliMUONTrackExtrap.h"
29 #include "AliESDMuonTrack.h"
30 #include "AliMUONTrackParam.h"
33 #include <Riostream.h>
34 #include <TGeoManager.h>
37 ClassImp(AliPWG3TrackExtrapInterface) // Class implementation in ROOT context
40 //__________________________________________________________________________
41 void AliPWG3TrackExtrapInterface::SetMagField(const AliMagF* magField)
43 /// Set the magnetic field (required for track extrapolation)
45 AliMUONTrackExtrap::SetField(magField);
49 //__________________________________________________________________________
50 Bool_t AliPWG3TrackExtrapInterface::SetGeometry(const char* fileName)
52 /// Set the geometry (required for absorber correction)
55 TGeoManager::Import(fileName);
57 cout<<"E-AliPWG3TrackExtrapInterface::ImportGeo: getting geometry from file "<<fileName<<" failed"<<endl;
65 //__________________________________________________________________________
66 void AliPWG3TrackExtrapInterface::ExtrapToVertexUncorrected(AliESDMuonTrack* muonTrack, Double_t zVtx)
68 /// Extrapolation to the vertex (at the z position "zVtx") without Branson and energy loss corrections.
69 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
71 AliMUONTrackParam trackParam;
72 trackParam.GetParamFromUncorrected(*muonTrack);
73 // dummy vertex transverse position (not used anyway)
76 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kFALSE);
77 trackParam.SetParamFor(*muonTrack);
81 //__________________________________________________________________________
82 void AliPWG3TrackExtrapInterface::ExtrapToVertexWithELoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
84 /// Extrapolation to the vertex (at the z position "zVtx") with energy loss correction only.
85 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
87 AliMUONTrackParam trackParam;
88 trackParam.GetParamFromUncorrected(*muonTrack);
89 // compute energy loss correction assuming linear propagation
90 Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
91 Double_t yVtx = trackParam.GetBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
92 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kTRUE);
93 trackParam.SetParamFor(*muonTrack);
97 //__________________________________________________________________________
98 void AliPWG3TrackExtrapInterface::ExtrapToVertexWithBranson(AliESDMuonTrack* muonTrack, Double_t vtx[3])
100 /// Extrapolation to the vertex (at the z position "zVtx") with Branson correction only.
101 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
103 AliMUONTrackParam trackParam;
104 trackParam.GetParamFromUncorrected(*muonTrack);
105 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kFALSE);
106 trackParam.SetParamFor(*muonTrack);
110 //__________________________________________________________________________
111 void AliPWG3TrackExtrapInterface::ExtrapToVertex(AliESDMuonTrack* muonTrack, Double_t vtx[3])
113 /// Extrapolation to the vertex (at the z position "zVtx") with Branson and energy loss corrections.
114 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
116 AliMUONTrackParam trackParam;
117 trackParam.GetParamFromUncorrected(*muonTrack);
118 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kTRUE);
119 trackParam.SetParamFor(*muonTrack);
123 //__________________________________________________________________________
124 Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
126 /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
127 AliMUONTrackParam trackParam;
128 trackParam.GetParamFromUncorrected(*muonTrack);
129 Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
130 Double_t yVtx = trackParam.GetBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
131 return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, xVtx, yVtx, zVtx);
134 //__________________________________________________________________________
135 Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t vtx[3])
137 /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
138 AliMUONTrackParam trackParam;
139 trackParam.GetParamFromUncorrected(*muonTrack);
140 return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, vtx[0], vtx[1], vtx[2]);