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 **************************************************************************/
18 ///////////////////////////////////////////////////
26 ///////////////////////////////////////////////////
28 #include "AliPWG3TrackExtrapInterface.h"
29 #include "AliMUONTrackExtrap.h"
30 #include "AliESDMuonTrack.h"
31 #include "AliMUONTrackParam.h"
34 #include <Riostream.h>
35 #include <TGeoManager.h>
38 ClassImp(AliPWG3TrackExtrapInterface) // Class implementation in ROOT context
41 //__________________________________________________________________________
42 void AliPWG3TrackExtrapInterface::SetMagField(const AliMagF* magField)
44 /// Set the magnetic field (required for track extrapolation)
46 AliMUONTrackExtrap::SetField(magField);
50 //__________________________________________________________________________
51 Bool_t AliPWG3TrackExtrapInterface::SetGeometry(const char* fileName)
53 /// Set the geometry (required for absorber correction)
56 TGeoManager::Import(fileName);
58 cout<<"E-AliPWG3TrackExtrapInterface::ImportGeo: getting geometry from file "<<fileName<<" failed"<<endl;
66 //__________________________________________________________________________
67 void AliPWG3TrackExtrapInterface::ExtrapToVertexUncorrected(AliESDMuonTrack* muonTrack, Double_t zVtx)
69 /// Extrapolation to the vertex (at the z position "zVtx") without Branson and energy loss corrections.
70 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
72 AliMUONTrackParam trackParam;
73 trackParam.GetParamFromUncorrected(*muonTrack);
74 // dummy vertex transverse position (not used anyway)
77 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kFALSE);
78 trackParam.SetParamFor(*muonTrack);
82 //__________________________________________________________________________
83 void AliPWG3TrackExtrapInterface::ExtrapToVertexWithELoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
85 /// Extrapolation to the vertex (at the z position "zVtx") with energy loss correction only.
86 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
88 AliMUONTrackParam trackParam;
89 trackParam.GetParamFromUncorrected(*muonTrack);
90 // compute energy loss correction assuming linear propagation
91 Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
92 Double_t yVtx = trackParam.GetBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
93 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kTRUE);
94 trackParam.SetParamFor(*muonTrack);
98 //__________________________________________________________________________
99 void AliPWG3TrackExtrapInterface::ExtrapToVertexWithBranson(AliESDMuonTrack* muonTrack, Double_t vtx[3])
101 /// Extrapolation to the vertex (at the z position "zVtx") with Branson correction only.
102 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
104 AliMUONTrackParam trackParam;
105 trackParam.GetParamFromUncorrected(*muonTrack);
106 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kFALSE);
107 trackParam.SetParamFor(*muonTrack);
111 //__________________________________________________________________________
112 void AliPWG3TrackExtrapInterface::ExtrapToVertex(AliESDMuonTrack* muonTrack, Double_t vtx[3])
114 /// Extrapolation to the vertex (at the z position "zVtx") with Branson and energy loss corrections.
115 /// Returns the extrapolated track parameters in the current ESDMuonTrack.
117 AliMUONTrackParam trackParam;
118 trackParam.GetParamFromUncorrected(*muonTrack);
119 AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kTRUE);
120 trackParam.SetParamFor(*muonTrack);
124 //__________________________________________________________________________
125 Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
127 /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
128 AliMUONTrackParam trackParam;
129 trackParam.GetParamFromUncorrected(*muonTrack);
130 Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
131 Double_t yVtx = trackParam.GetBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
132 return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, xVtx, yVtx, zVtx);
135 //__________________________________________________________________________
136 Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t vtx[3])
138 /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
139 AliMUONTrackParam trackParam;
140 trackParam.GetParamFromUncorrected(*muonTrack);
141 return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, vtx[0], vtx[1], vtx[2]);