]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Interface with MUONTrackExtrap in MUON (Philippe P.)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Apr 2007 14:03:24 +0000 (14:03 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Apr 2007 14:03:24 +0000 (14:03 +0000)
PWG3/AliPWG3TrackExtrapInterface.cxx [new file with mode: 0644]
PWG3/AliPWG3TrackExtrapInterface.h [new file with mode: 0644]
PWG3/PWG3baseLinkDef.h
PWG3/libPWG3base.pkg

diff --git a/PWG3/AliPWG3TrackExtrapInterface.cxx b/PWG3/AliPWG3TrackExtrapInterface.cxx
new file mode 100644 (file)
index 0000000..064f464
--- /dev/null
@@ -0,0 +1,142 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+///////////////////////////////////////////////////
+//
+// Interface
+// for
+// MUON
+// track
+// extrapolation
+//
+///////////////////////////////////////////////////
+
+#include "AliPWG3TrackExtrapInterface.h"
+#include "AliMUONTrackExtrap.h"
+#include "AliESDMuonTrack.h"
+#include "AliMUONTrackParam.h"
+#include "AliMagF.h" 
+
+#include <Riostream.h>
+#include <TGeoManager.h>
+
+/// \cond CLASSIMP
+ClassImp(AliPWG3TrackExtrapInterface) // Class implementation in ROOT context
+/// \endcond
+
+  //__________________________________________________________________________
+void AliPWG3TrackExtrapInterface::SetMagField(const AliMagF* magField)
+{
+  /// Set the magnetic field (required for track extrapolation)
+  
+  AliMUONTrackExtrap::SetField(magField);
+  
+}
+
+  //__________________________________________________________________________
+Bool_t AliPWG3TrackExtrapInterface::SetGeometry(const char* fileName)
+{
+  /// Set the geometry (required for absorber correction)
+  
+  if (!gGeoManager) {
+    TGeoManager::Import(fileName);
+    if (!gGeoManager) {
+      cout<<"E-AliPWG3TrackExtrapInterface::ImportGeo: getting geometry from file "<<fileName<<" failed"<<endl;
+      return kFALSE;
+    }
+  }
+  return kTRUE;
+  
+}
+
+  //__________________________________________________________________________
+void AliPWG3TrackExtrapInterface::ExtrapToVertexUncorrected(AliESDMuonTrack* muonTrack, Double_t zVtx)
+{
+  /// Extrapolation to the vertex (at the z position "zVtx") without Branson and energy loss corrections.
+  /// Returns the extrapolated track parameters in the current ESDMuonTrack.
+  
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  // dummy vertex transverse position (not used anyway)
+  Double_t xVtx = 0.;
+  Double_t yVtx = 0.;
+  AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kFALSE);
+  trackParam.SetParamFor(*muonTrack);
+  
+}
+
+  //__________________________________________________________________________
+void AliPWG3TrackExtrapInterface::ExtrapToVertexWithELoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
+{
+  /// Extrapolation to the vertex (at the z position "zVtx") with energy loss correction only.
+  /// Returns the extrapolated track parameters in the current ESDMuonTrack.
+  
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  // compute energy loss correction assuming linear propagation
+  Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
+  Double_t yVtx = trackParam.GetBendingCoor()    + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
+  AliMUONTrackExtrap::ExtrapToVertex(&trackParam, xVtx, yVtx, zVtx, kFALSE, kTRUE);
+  trackParam.SetParamFor(*muonTrack);
+  
+}
+
+  //__________________________________________________________________________
+void AliPWG3TrackExtrapInterface::ExtrapToVertexWithBranson(AliESDMuonTrack* muonTrack, Double_t vtx[3])
+{
+  /// Extrapolation to the vertex (at the z position "zVtx") with Branson correction only.
+  /// Returns the extrapolated track parameters in the current ESDMuonTrack.
+  
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kFALSE);
+  trackParam.SetParamFor(*muonTrack);
+  
+}
+
+  //__________________________________________________________________________
+void AliPWG3TrackExtrapInterface::ExtrapToVertex(AliESDMuonTrack* muonTrack, Double_t vtx[3])
+{
+  /// Extrapolation to the vertex (at the z position "zVtx") with Branson and energy loss corrections.
+  /// Returns the extrapolated track parameters in the current ESDMuonTrack.
+  
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  AliMUONTrackExtrap::ExtrapToVertex(&trackParam, vtx[0], vtx[1], vtx[2], kTRUE, kTRUE);
+  trackParam.SetParamFor(*muonTrack);
+  
+}
+
+  //__________________________________________________________________________
+Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t zVtx)
+{
+  /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  Double_t xVtx = trackParam.GetNonBendingCoor() + (zVtx - trackParam.GetZ()) * trackParam.GetNonBendingSlope();
+  Double_t yVtx = trackParam.GetBendingCoor()    + (zVtx - trackParam.GetZ()) * trackParam.GetBendingSlope();
+  return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, xVtx, yVtx, zVtx);
+}
+
+  //__________________________________________________________________________
+Double_t AliPWG3TrackExtrapInterface::TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t vtx[3])
+{
+  /// Calculate the total momentum energy loss in-between the track position and the vertex assuming a linear propagation
+  AliMUONTrackParam trackParam;
+  trackParam.GetParamFromUncorrected(*muonTrack);
+  return AliMUONTrackExtrap::TotalMomentumEnergyLoss(&trackParam, vtx[0], vtx[1], vtx[2]);
+}
+
diff --git a/PWG3/AliPWG3TrackExtrapInterface.h b/PWG3/AliPWG3TrackExtrapInterface.h
new file mode 100644 (file)
index 0000000..673eb86
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef AliPWG3TRACKEXTRAPINTERFACE_H
+#define AliPWG3TRACKEXTRAPINTERFACE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/// \ingroup rec
+/// \class AliPWG3TrackExtrapInterface
+/// \brief Interface to MUON classes
+///
+//////////////////////////////////////////
+/// Interface for MUON track extrapolation
+//////////////////////////////////////////
+
+#include <TObject.h>
+
+class AliMagF;
+class AliESDMuonTrack;
+
+class AliPWG3TrackExtrapInterface : public TObject 
+{
+ public:
+       /// Constructor
+  AliPWG3TrackExtrapInterface() : TObject(){};
+       /// Destructor
+  virtual ~AliPWG3TrackExtrapInterface(){};
+  
+  static void  SetMagField(const AliMagF* magField);
+  static Bool_t SetGeometry(const char* fileName = "geometry.root");
+  
+  // extrapolation without any absorber correction
+  static void ExtrapToVertexUncorrected(AliESDMuonTrack* muonTrack, Double_t zVtx);
+  // extrapolation corrected for energy loss in absorber only
+  static void ExtrapToVertexWithELoss(AliESDMuonTrack* muonTrack, Double_t zVtx);
+  // extrapolation corrected for multiple scattering in absorber only
+  static void ExtrapToVertexWithBranson(AliESDMuonTrack* muonTrack, Double_t vtx[3]);
+  // extrapolation corrected for all absorber effect (multiple scattering and energy loss)
+  static void ExtrapToVertex(AliESDMuonTrack* muonTrack, Double_t vtx[3]);
+  
+  static Double_t TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t zVtx);
+  static Double_t TotalMomentumEnergyLoss(AliESDMuonTrack* muonTrack, Double_t vtx[3]);
+  
+ private:
+  // Functions
+  AliPWG3TrackExtrapInterface(const AliPWG3TrackExtrapInterface& muonInterface);
+  AliPWG3TrackExtrapInterface& operator=(const AliPWG3TrackExtrapInterface& muonInterface);
+  
+  
+  ClassDef(AliPWG3TrackExtrapInterface, 0) // Tools for track extrapolation in ALICE dimuon spectrometer
+};
+       
+#endif
index 055513e8b8be2dd3221d7c6949aca44e36675f3b..442895990de47eb75a71f7cb8bc65a408382860e 100644 (file)
@@ -5,6 +5,7 @@
 
 #pragma link C++ class AliQuarkoniaAcceptance+; 
 #pragma link C++ class AliQuarkoniaEfficiency+; 
+#pragma link C++ class AliPWG3TrackExtrapInterface+; 
 #endif
 
 
index db32d8dfe575d4484228de17a904fe542cae07b5..6be9c73c379ac0a8488decc91b686519c7642dc7 100644 (file)
@@ -1,11 +1,13 @@
 # $Id$
 
-SRCS:=  AliQuarkoniaAcceptance.cxx   AliQuarkoniaEfficiency.cxx        
+SRCS:= AliQuarkoniaAcceptance.cxx \
+       AliQuarkoniaEfficiency.cxx \
+       AliPWG3TrackExtrapInterface.cxx
      
      
 HDRS:= $(SRCS:.cxx=.h)
 
 DHDR:= PWG3baseLinkDef.h
 
-EINCLUDE:= 
+EINCLUDE:= MUON