From fac70e254db1e9dc11f104c2f914eb4073bf4a3c Mon Sep 17 00:00:00 2001 From: ivana Date: Thu, 15 Mar 2007 13:59:50 +0000 Subject: [PATCH] - Added the possibility to disable the Branson and/or energy loss correction(s) in the method AliMUONTrackExtrap::ExtrapToVertex(...). - Added a method to get the total momentum energy loss in-between the vertex and a given track position. (Philippe P.) --- MUON/AliMUONRecoCheck.cxx | 2 +- MUON/AliMUONTrackExtrap.cxx | 113 +++++++++++++++++++++++++++--------- MUON/AliMUONTrackExtrap.h | 5 +- 3 files changed, 90 insertions(+), 30 deletions(-) diff --git a/MUON/AliMUONRecoCheck.cxx b/MUON/AliMUONRecoCheck.cxx index 17b36c263f9..cff1a74c4f8 100644 --- a/MUON/AliMUONRecoCheck.cxx +++ b/MUON/AliMUONRecoCheck.cxx @@ -123,8 +123,8 @@ AliMUONRecoCheck::~AliMUONRecoCheck() fRunLoader->UnloadTrackRefs(); fRunLoader->UnloadTracks(); delete fMUONData; + delete fRunLoader; } - delete fRunLoader; } //_____________________________________________________________________________ diff --git a/MUON/AliMUONTrackExtrap.cxx b/MUON/AliMUONTrackExtrap.cxx index 38b5ba02ebd..41a7b1833ff 100644 --- a/MUON/AliMUONTrackExtrap.cxx +++ b/MUON/AliMUONTrackExtrap.cxx @@ -351,12 +351,12 @@ void AliMUONTrackExtrap::ExtrapToVertexUncorrected(AliMUONTrackParam* trackParam // Check whether the geometry is available and get absorber boundaries if (!gGeoManager) { - cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: no TGeo"<GetVolume("ALIC")->GetNode("ABSM_1"); if (!absNode) { - cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: failed to get absorber node"<GetZ() == zVtx) return; // nothing to be done if already at vertex if (trackParam->GetZ() > zVtx) { // spectro. (z<0) - cout<<"W-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<GetZ() + cout<<"F-AliMUONTrackExtrap::ExtrapToVertex: Starting Z ("<GetZ() <<") upstream the vertex (zVtx = "<GetVolume("ALIC")->GetNode("ABSM_1"); if (!absNode) { - cout<<"E-AliMUONTrackExtrap::GetAbsorberCorrectionParam: failed to get absorber node"<0.) ? trackXYZIn[2] - f2/f1 : 0.; - - // Get track position in the Branson plane corrected for magnetic field effect - ExtrapToZ(trackParam,zVtx); - Double_t xB = trackParam->GetNonBendingCoor() + (zB - zVtx) * trackParam->GetNonBendingSlope(); - Double_t yB = trackParam->GetBendingCoor() + (zB - zVtx) * trackParam->GetBendingSlope(); + Double_t nonBendingSlope, bendingSlope; + if (CorrectForEnergyLoss) { + pTot += 0.5 * deltaP; + nonBendingSlope = trackParam->GetNonBendingSlope(); + bendingSlope = trackParam->GetBendingSlope(); + trackParam->SetInverseBendingMomentum(charge / pTot * + TMath::Sqrt(1.0 + nonBendingSlope*nonBendingSlope + bendingSlope*bendingSlope) / + TMath::Sqrt(1.0 + bendingSlope*bendingSlope)); + } - // Get track slopes corrected for multiple scattering (spectro. (z<0)) - Double_t nonBendingSlope = (zB<0.) ? (xB - xVtx) / (zB - zVtx) : trackParam->GetNonBendingSlope(); - Double_t bendingSlope = (zB<0.) ? (yB - yVtx) / (zB - zVtx) : trackParam->GetBendingSlope(); + if (CorrectForMCS) { + // Position of the Branson plane (spectro. (z<0)) + Double_t zB = (f1>0.) ? trackXYZIn[2] - f2/f1 : 0.; + + // Get track position in the Branson plane corrected for magnetic field effect + ExtrapToZ(trackParam,zVtx); + Double_t xB = trackParam->GetNonBendingCoor() + (zB - zVtx) * trackParam->GetNonBendingSlope(); + Double_t yB = trackParam->GetBendingCoor() + (zB - zVtx) * trackParam->GetBendingSlope(); + + // Get track slopes corrected for multiple scattering (spectro. (z<0)) + nonBendingSlope = (zB<0.) ? (xB - xVtx) / (zB - zVtx) : trackParam->GetNonBendingSlope(); + bendingSlope = (zB<0.) ? (yB - yVtx) / (zB - zVtx) : trackParam->GetBendingSlope(); + + // Set track parameters at vertex + trackParam->SetNonBendingCoor(xVtx); + trackParam->SetBendingCoor(yVtx); + trackParam->SetZ(zVtx); + trackParam->SetNonBendingSlope(nonBendingSlope); + trackParam->SetBendingSlope(bendingSlope); + } else { + ExtrapToZ(trackParam,zVtx); + nonBendingSlope = trackParam->GetNonBendingSlope(); + bendingSlope = trackParam->GetBendingSlope(); + } // Correct for second half of energy loss - pTot += 0.5 * deltaP; + if (CorrectForEnergyLoss) pTot += 0.5 * deltaP; // Set track parameters at vertex - trackParam->SetNonBendingCoor(xVtx); - trackParam->SetBendingCoor(yVtx); - trackParam->SetZ(zVtx); - trackParam->SetNonBendingSlope(nonBendingSlope); - trackParam->SetBendingSlope(bendingSlope); trackParam->SetInverseBendingMomentum(charge / pTot * - TMath::Sqrt(1.0 + nonBendingSlope*nonBendingSlope + bendingSlope*bendingSlope) / - TMath::Sqrt(1.0 + bendingSlope*bendingSlope)); + TMath::Sqrt(1.0 + nonBendingSlope*nonBendingSlope + bendingSlope*bendingSlope) / + TMath::Sqrt(1.0 + bendingSlope*bendingSlope)); + +} + + //__________________________________________________________________________ +Double_t AliMUONTrackExtrap::TotalMomentumEnergyLoss(AliMUONTrackParam* trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx) +{ + /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation + + if (trackParam->GetZ() == zVtx) return 0.; // nothing to be done if already at vertex + // Check whether the geometry is available + if (!gGeoManager) { + cout<<"E-AliMUONTrackExtrap::TotalMomentumEnergyLoss: no TGeo"<GetNonBendingCoor(); + trackXYZOut[1] = trackParam->GetBendingCoor(); + trackXYZOut[2] = trackParam->GetZ(); + Double_t trackXYZIn[3]; + trackXYZIn[0] = xVtx; + trackXYZIn[1] = yVtx; + trackXYZIn[2] = zVtx; + Double_t pathLength = 0.; + Double_t f0 = 0.; + Double_t f1 = 0.; + Double_t f2 = 0.; + Double_t meanRho = 0.; + GetAbsorberCorrectionParam(trackXYZIn,trackXYZOut,pathLength,f0,f1,f2,meanRho); + + // Calculate energy loss + Double_t pTot = trackParam->P(); + return TotalMomentumEnergyLoss(pTot,pathLength,meanRho); } //__________________________________________________________________________ Double_t AliMUONTrackExtrap::TotalMomentumEnergyLoss(Double_t pTotal, Double_t pathLength, Double_t rho) { /// Returns the total momentum energy loss in the front absorber - Double_t muMass = 0.10566; + Double_t muMass = 0.105658369; Double_t p2=pTotal*pTotal; Double_t beta2=p2/(p2 + muMass*muMass); Double_t dE=ApproximateBetheBloch(beta2)*pathLength*rho; diff --git a/MUON/AliMUONTrackExtrap.h b/MUON/AliMUONTrackExtrap.h index 7ffdc54e87f..7faf95dfe0b 100644 --- a/MUON/AliMUONTrackExtrap.h +++ b/MUON/AliMUONTrackExtrap.h @@ -37,7 +37,10 @@ class AliMUONTrackExtrap : public TObject static void ExtrapToZCov(AliMUONTrackParam* trackParam, Double_t zEnd); static void ExtrapToStation(AliMUONTrackParam *trackParamIn, Int_t station, AliMUONTrackParam *trackParamOut); static void ExtrapToVertexUncorrected(AliMUONTrackParam* trackParam, Double_t zVtx); - static void ExtrapToVertex(AliMUONTrackParam *trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx); + static void ExtrapToVertex(AliMUONTrackParam *trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx, + Bool_t CorrectForMCS = kTRUE, Bool_t CorrectForEnergyLoss = kTRUE); + + static Double_t TotalMomentumEnergyLoss(AliMUONTrackParam* trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx); static void AddMCSEffect(AliMUONTrackParam *param, Double_t dZ, Double_t x0); -- 2.43.5