]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONHit.cxx
In AliMUONTriggerQADataMakerRec:
[u/mrichter/AliRoot.git] / MUON / AliMUONHit.cxx
index e1050cd1332031df8769380d131d71e8a1b01922..a396b37a32775592931b7cb3bf27d5102cd70b67 100644 (file)
@@ -15,6 +15,7 @@
 
 /* $Id$ */
 
+//-----------------------------------------------------------------------------
 // MUON class for MonteCarlo Hits, inherited from AliHit for the 
 // In addition to the ALiHit data member fX, fY, fZ and fTrack, AliMUONHit contains some info about the particle crossing the chamber:
 // Impulsion: fPtot, fPx, fPy and fPz
 // Cumulated path along the active volume fTlength for spliting of hits for very inclined tracks 
 // Energy loss of the particle inside the gas active volume.
 // Incident fTheta and fPhi angle with respect of the wire plane of the chamber.
-//
-#include "Riostream.h"
+//-----------------------------------------------------------------------------
 
-#include <TMath.h>
-#include <TString.h>
+#include "AliMUONHit.h"
+#include "AliMpDEManager.h"
 
 #include "AliLog.h"
-#include "AliMUONHit.h"
-#include "AliMUONGeometryStore.h"
 
+#include <Riostream.h>
+#include <TMath.h>
+#include <TString.h>
 
 /// \cond CLASSIMP
 ClassImp(AliMUONHit)
@@ -40,7 +41,6 @@ ClassImp(AliMUONHit)
 //___________________________________________
 AliMUONHit::AliMUONHit()
   : AliHit(), 
-    fIsDetElemId(kTRUE),
     fDetElemId(0),
     fParticle(0),
     fTheta(0),
@@ -64,37 +64,6 @@ AliMUONHit::AliMUONHit()
 //___________________________________________
 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
   : AliHit(shunt, track),
-    fIsDetElemId(kFALSE),
-    fDetElemId(vol[0]),
-    fParticle(hits[0]),
-    fTheta(hits[4]),
-    fPhi(hits[5]),
-    fTlength(hits[6]),
-    fEloss(hits[7]),
-    fAge(hits[14]),
-    fPHfirst((Int_t)hits[8]),
-    fPHlast((Int_t)hits[9]),
-    fPTot(hits[10]),
-    fPx(hits[11]),
-    fPy(hits[12]),
-    fPz(hits[13]),
-    fXref(0),
-    fYref(0),
-    fZref(0)
-{
-/// Constructor
-/// \deprecated TBR
-
-    fX         = hits[1];
-    fY         = hits[2];
-    fZ         = hits[3];
-}
-
-//___________________________________________
-AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits, 
-                       Bool_t /*isDetElemId*/)
-  : AliHit(shunt, track),
-    fIsDetElemId(kTRUE),
     fDetElemId(vol[0]),
     fParticle(hits[0]),
     fTheta(hits[4]),
@@ -119,44 +88,11 @@ AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
     fZ         = hits[3];
 }
 
-//___________________________________________
-AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart, 
-                      Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum, 
-                      Float_t theta, Float_t phi, Float_t length, Float_t destep)
-  : AliHit(shunt, track),
-    fIsDetElemId(kFALSE),
-    fDetElemId(iChamber),
-    fParticle(idpart),
-    fTheta(theta),
-    fPhi(phi),
-    fTlength(length),
-    fEloss(destep),
-    fAge(tof),
-    fPHfirst(0),
-    fPHlast(0),
-    fPTot(momentum),
-    fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
-    fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
-    fPz(momentum * TMath::Cos(theta)),
-    fXref(0),
-    fYref(0),
-    fZref(0)
-{
-/// Constructor
-/// \deprecated TBR
-
-    fX         = X;
-    fY         = Y;
-    fZ         = Z;
-}
-
 //___________________________________________
 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart, 
-                      Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum, 
-                      Float_t theta, Float_t phi, Float_t length, Float_t destep,
-                      Bool_t /*isDetElemId*/)
+                      Float_t x, Float_t y, Float_t z, Float_t tof, Float_t momentum, 
+                      Float_t theta, Float_t phi, Float_t length, Float_t destep)
   : AliHit(shunt, track),
-    fIsDetElemId(kTRUE),
     fDetElemId(detElemId),
     fParticle(idpart),
     fTheta(theta),
@@ -175,50 +111,17 @@ AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
     fZref(0)
 {
 /// Constructor
-    fX         = X;
-    fY         = Y;
-    fZ         = Z;
+    fX         = x;
+    fY         = y;
+    fZ         = z;
 }
 
-//-----------------------------------------------------------------------------------------------
-AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t iChamber, Int_t idpart, 
-                      Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum, 
-                      Float_t theta, Float_t phi, Float_t length, Float_t destep,
-                      Float_t Xref,Float_t Yref,Float_t Zref)
-  : AliHit(shunt, track),
-    fIsDetElemId(kFALSE),
-    fDetElemId(iChamber),
-    fParticle(idpart),
-    fTheta(theta),
-    fPhi(phi),
-    fTlength(length),
-    fEloss(destep),
-    fAge(tof),
-    fPHfirst(0),
-    fPHlast(0),
-    fPTot(momentum),
-    fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
-    fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
-    fPz(momentum * TMath::Cos(theta)),
-    fXref(Xref),
-    fYref(Yref),
-    fZref(Zref)
-{
-/// Constructor
-/// \deprecated TBR
-
-    fX         = X;
-    fY         = Y;
-    fZ         = Z;
-}
 //-----------------------------------------------------------------------------------------------
 AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart, 
-                      Float_t X, Float_t Y, Float_t Z, Float_t tof, Float_t momentum, 
+                      Float_t x, Float_t y, Float_t z, Float_t tof, Float_t momentum, 
                       Float_t theta, Float_t phi, Float_t length, Float_t destep,
-                      Float_t Xref,Float_t Yref,Float_t Zref,
-                      Bool_t /*isDetElemId*/)
+                      Float_t xref,Float_t yref,Float_t zref)
   : AliHit(shunt, track),
-    fIsDetElemId(kTRUE),
     fDetElemId(detElemId),
     fParticle(idpart),
     fTheta(theta),
@@ -232,15 +135,15 @@ AliMUONHit::AliMUONHit(Int_t shunt, Int_t track, Int_t detElemId, Int_t idpart,
     fPx(momentum * TMath::Sin(theta) * TMath::Cos(phi)),
     fPy(momentum * TMath::Sin(theta) * TMath::Sin(phi)),
     fPz(momentum * TMath::Cos(theta)),
-    fXref(Xref),
-    fYref(Yref),
-    fZref(Zref)
+    fXref(xref),
+    fYref(yref),
+    fZref(zref)
 {
 /// Constructor
 
-    fX         = X;
-    fY         = Y;
-    fZ         = Z;
+    fX         = x;
+    fY         = y;
+    fZ         = z;
 }
 
 //-----------------------------------------------------------------------------------------------
@@ -249,36 +152,29 @@ AliMUONHit::~AliMUONHit()
 /// Dectructor
 }
 
-//-----------------------------------------------------------------------------------------------
-Int_t AliMUONHit::DetElemId()const
-{
-/// Return detection element ID
-
-  if (!fIsDetElemId) {
-    AliWarning("Detection element Id is not defined.");
-    return 0;
-  }  
-  
-  return fDetElemId;
-}
-
 //-----------------------------------------------------------------------------------------------
 Int_t  AliMUONHit::Chamber()  const
 {  
 /// Return chamber ID
 
-  if (!fIsDetElemId) 
-    return fDetElemId;
-  else  
-    return AliMUONGeometryStore::GetModuleId(fDetElemId)+1;  
+  return AliMpDEManager::GetChamberId(fDetElemId) + 1;  
+}
+
+//-----------------------------------------------------------------------------
+const char*
+AliMUONHit::GetName() const
+{
+/// Generate hit name
+
+  return Form("%s-DE%04d",ClassName(),DetElemId());
 }
 
+//-----------------------------------------------------------------------------------------------
 void AliMUONHit::Print(Option_t* opt) const
 {
-  //
-  // Printing hit information 
-  // "full" option for printing all the information about the hit
-  //
+/// Printing hit information 
+/// "full" option for printing all the information about the hit
+
   TString sopt(opt);
   sopt.ToUpper();