]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDHit.cxx
Export some headers for AMORE
[u/mrichter/AliRoot.git] / FMD / AliFMDHit.cxx
index 41bfc7b1c06a2c83aeab01e2fb53d1d7798831f5..76ec41a85ef1358556e49127870acab2435c5303 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
 /* $Id$ */
-
+/** @file    AliFMDHit.cxx
+    @author  Christian Holm Christensen <cholm@nbi.dk>
+    @date    Mon Mar 27 12:41:58 2006
+    @brief   Hit in the FMD
+    @ingroup FMD_sim
+*/
 //____________________________________________________________________
 //
 //  Hits in the FMD 
+//  Contains information on:
+//     Position of hit
+//     Momentum of track
+//     PID of track
+//     Energy loss of track
+//     Track #
+//     Track path length
+//     Track stopping status. 
+//  Latest changes by Christian Holm Christensen
 //
-// Latest changes by Christian Holm Christensen
-//
-#include "AliFMDHit.h"         // ALIFMDHIT_H
-#include "AliLog.h"            // ALILOG_H
+
 #include "Riostream.h"         // ROOT_Riostream
 #include <TDatabasePDG.h>
 #include <TMath.h>
 #include <TString.h>
 
+#include "AliFMDHit.h"         // ALIFMDHIT_H
+// #include "AliFMDDebug.h"            // ALIFMDDEBUG_H ALILOG_H
+
 //____________________________________________________________________
 ClassImp(AliFMDHit)
 #if 0
@@ -46,8 +59,11 @@ AliFMDHit::AliFMDHit()
     fPz(0),
     fPdg(0),
     fEdep(0), 
-    fTime(0)
+    fTime(0), 
+    fLength(0), 
+    fStop(0)
 {
+  // Default CTOR
   fX = fY = fZ = 0;
 }
   
@@ -67,7 +83,9 @@ AliFMDHit::AliFMDHit(Int_t    shunt,
                     Float_t  pz,
                     Float_t  edep,
                     Int_t    pdg,
-                    Float_t  t)
+                    Float_t  t, 
+                    Float_t  l, 
+                    Bool_t   stop)
   : AliHit(shunt, track),
     fDetector(detector), 
     fRing(ring), 
@@ -78,7 +96,9 @@ AliFMDHit::AliFMDHit(Int_t    shunt,
     fPz(pz),
     fPdg(pdg),
     fEdep(edep), 
-    fTime(t)
+    fTime(t), 
+    fLength(l), 
+    fStop(stop)
 {
   // Normal FMD hit ctor
   // 
@@ -105,6 +125,29 @@ AliFMDHit::AliFMDHit(Int_t    shunt,
   fZ = z;
 }
 
+//____________________________________________________________________
+const char*
+AliFMDHit::GetName() const 
+{ 
+  // Get the name 
+  static TString n;
+  n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
+  return n.Data();
+}
+
+//____________________________________________________________________
+const char*
+AliFMDHit::GetTitle() const 
+{ 
+  // Get the title 
+  static TString t;
+  TDatabasePDG* pdgDB = TDatabasePDG::Instance();
+  TParticlePDG* pdg   = pdgDB->GetParticle(fPdg);
+  t = Form("%s (%d): %f MeV / %f cm", (pdg ? pdg->GetName() : "?"), 
+          fTrack, fEdep, fLength);
+  return t.Data();
+}
+
 //____________________________________________________________________
 Float_t
 AliFMDHit::P() const 
@@ -152,7 +195,8 @@ AliFMDHit::Print(Option_t* option) const
     cout << "\tPDG:\t" << fPdg << " " << (pdg ? pdg->GetName() : "?") << "\n"
         << "\tP:\t(" << fPx << "," << fPy << "," << fPz << ") "<<P() << "\n" 
         << "\tX:\t" << fX << "," << fY << "," << fZ << "\n" 
-        << "\tTrack #:\t" << fTrack << std::endl;
+        << "\tTrack #:\t" << fTrack << "\tLength:\t" 
+        << fLength << "cm\t" << (IsStop() ? "stopped" : "") << std::endl;
   }
 }