]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITShit.cxx
- fixing warnings/coverity
[u/mrichter/AliRoot.git] / ITS / AliITShit.cxx
index 121b3333181f32695e8a904d5d5c4d153a241923..e6352ed3ed64394256cfb6863543f1d619342075 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.21  2002/12/03 09:03:06  hristov
-Changes needed on Itanium (F.Carminati)
-
-Revision 1.20  2002/10/22 14:45:42  alibrary
-Introducing Riostream.h
-
-Revision 1.19  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.13.6.3  2002/08/28 15:06:50  alibrary
-Updating to v3-09-01
-
-Revision 1.18  2002/08/07 18:37:53  nilsen
-Removed endl from print function. should be supplied by user as wanted.
-
-Revision 1.17  2002/06/20 09:10:14  hristov
-Data member ft0 initialized
-
-Revision 1.16  2002/06/19 21:12:37  nilsen
-Fixed bug with non-zero-ed new data members in constructors. Thanks Jiri
-for finding it and pointing it out.
-
-Revision 1.15  2002/06/12 18:59:47  nilsen
-Added Starting track location to hit class and related changes to modules.
-This is at present still fully backwards compatible since starting hits
-are still written to the file. When aliroot v4.0 will be released, this
-backwards compatiblity will be broken by removing the enterence hit, and making
-the nessesary changes to module at that time.
-
-Revision 1.14  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.13  2002/03/09 18:35:35  nilsen
-Added functions to print out Hit data members.
-
-Revision 1.12  2002/03/08 16:05:05  nilsen
-Standeard io streamers added to make debugging et al. easier.
-
-Revision 1.11  2001/01/30 09:23:13  hristov
-Streamers removed (R.Brun)
-
-Revision 1.10  2001/01/26 20:01:19  hristov
-Major upgrade of AliRoot code
-
-Revision 1.9  2000/10/02 16:32:51  barbera
-Automatic streamer used and forward declarations added
-
-Revision 1.3.4.7  2000/10/02 15:54:49  barbera
-Automatic streamer used and forward declarations added
-
-Revision 1.8  2000/09/22 12:35:21  nilsen
-Traps placed incase it is used without a properly initilized AliITSgeom class.
-
-Revision 1.7  2000/07/10 16:07:18  fca
-Release version of ITS code
-
-Revision 1.3.4.2  2000/03/04 23:43:57  nilsen
-Fixed up the comments/documentation.
-
-Revision 1.3.4.1  2000/01/12 19:03:32  nilsen
-This is the version of the files after the merging done in December 1999.
-See the ReadMe110100.txt file for details
-
-Revision 1.3  1999/09/29 09:24:20  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 #include <Riostream.h>
 
-#include <TMath.h>
-#include <TRandom.h>
-#include <TVector.h>
-#include <TGeometry.h>
-#include <TNode.h>
-#include <TTUBE.h>
-#include "TParticle.h"
+#include <TLorentzVector.h>
+#include <TParticle.h>
 
 #include "AliRun.h"
 #include "AliITS.h"
 #include "AliITSgeom.h"
 #include "AliITShit.h"
+#include "AliMC.h"
+#include "AliStack.h"
 
 
 ClassImp(AliITShit)
@@ -262,7 +191,20 @@ ClassImp(AliITShit)
 //
 ////////////////////////////////////////////////////////////////////////
 //_____________________________________________________________________________
-AliITShit::AliITShit():AliHit(){
+AliITShit::AliITShit():AliHit(),
+fStatus(0), // Track Status
+fModule(0),  // Module number 
+fPx(0.0),     // PX of particle at the point of the hit
+fPy(0.0),     // PY of particle at the point of the hit
+fPz(0.0),     // PZ of particle at the point of the hit
+fDestep(0.0), // Energy deposited in the current step
+fTof(0.0),    // Time of flight at the point of the hit
+fStatus0(0),// Track Status of Starting point
+fx0(0.0),     // Starting point of this step
+fy0(0.0),     // Starting point of this step
+fz0(0.0),     // Starting point of this step
+ft0(0.0)     // Starting point of this step
+{
     // Default Constructor
     // Zero data member just to be safe.
     // Intputs:
@@ -272,83 +214,86 @@ AliITShit::AliITShit():AliHit(){
     // Return:
     //    A default created AliITShit class.
 
-    fStatus = 0; // Track Status
-    fLayer  = 0;  // Layer number
-    fLadder = 0; // Ladder number
-    fDet    = 0;    // Detector number  
-    fPx     = 0.0;     // PX of particle at the point of the hit
-    fPy     = 0.0;     // PY of particle at the point of the hit
-    fPz     = 0.0;     // PZ of particle at the point of the hit
-    fDestep = 0.0; // Energy deposited in the current step
-    fTof    = 0.0;    // Time of flight at the point of the hit
-    fStatus0 = 0; // zero status bit by default.
-    fx0     = 0.0;     // Starting point of this step
-    fy0     = 0.0;     // Starting point of this step
-    fz0     = 0.0;     // Starting point of this step
-    ft0     = 0.0;     // Starting point of this step
 }
+//----------------------------------------------------------------------
 AliITShit::AliITShit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,
-                    Float_t tof,TLorentzVector &x,TLorentzVector &x0,
-                    TLorentzVector &p) : AliHit(shunt, track){
-////////////////////////////////////////////////////////////////////////
-// Create ITS hit
-//     The creator of the AliITShit class. The variables shunt and
-// track are passed to the creator of the AliHit class. See the AliHit
-// class for a full description. In the units of the Monte Carlo
-////////////////////////////////////////////////////////////////////////
-    // Intputs:
+                     Float_t tof,TLorentzVector &x,TLorentzVector &x0,
+                     TLorentzVector &p) :
+AliHit(shunt, track), // AliHit
+fStatus(vol[3]), // Track Status
+fModule(vol[0]),  // Module number 
+fPx(p.Px()),     // PX of particle at the point of the hit
+fPy(p.Py()),     // PY of particle at the point of the hit
+fPz(p.Pz()),     // PZ of particle at the point of the hit
+fDestep(edep), // Energy deposited in the current step
+fTof(tof),    // Time of flight at the point of the hit
+fStatus0(vol[4]),// Track Status of Starting point
+fx0(x0.X()),     // Starting point of this step
+fy0(x0.Y()),     // Starting point of this step
+fz0(x0.Z()),     // Starting point of this step
+ft0(x0.T())     // Starting point of this step
+{
+    // Create ITS hit
+    //     The creator of the AliITShit class. The variables shunt and
+    // track are passed to the creator of the AliHit class. See the AliHit
+    // class for a full description. In the units of the Monte Carlo
+    // Inputs:
     //    Int_t shunt   See AliHit
     //    Int_t track   Track number, see AliHit
     //    Int_t *vol     Array of integer hit data,
-    //                     vol[0] Layer where the hit is, 1-6 typicaly
-    //                     vol[1] Ladder where the hit is.
-    //                     vol[2] Detector number where the hit is
+    //                     vol[0] module
+    //                     vol[1] not used
+    //                     vol[2] not used
     //                     vol[3] Set of status bits
     //                     vol[4] Set of status bits at start
+    //    Float_t edep       The energy deposited GeV during the transport
+    //                       of this step
+    //    Float_t tof        The time of flight of this particle at this step
+    //    TLorenzVector &x   The Global position of this step [cm]
+    //    TLorenzVector &x0  The Global position of where this step 
+    //                       started from [cm]
+    //    TLorenzVector &p   The Global momentum of the particle at this
+    //                       step [GeV/c]
     // Outputs:
     //    none.
     // Return:
     //    A default created AliITShit class.
 
-    fLayer      = vol[0];  // Layer number
-    fLadder     = vol[2];  // Ladder number
-    fDet        = vol[1];  // Detector number
-    fStatus     = vol[3];  // Track status flags
-    fStatus0    = vol[4];  // Track status flag for start position.
-    fX          = x.X();   // Track X global position
-    fY          = x.Y();   // Track Y global position
-    fZ          = x.Z();   // Track Z global position
-    fPx         = p.Px();  // Track X Momentum
-    fPy         = p.Py();  // Track Y Momentum
-    fPz         = p.Pz();  // Track Z Momentum
-    fDestep     = edep;    // Track dE/dx for this step
-    fTof        = tof   ;  // Track Time of Flight for this step
-    fx0         = x0.X();  // Track X global position
-    fy0         = x0.Y();  // Track Y global position
-    fz0         = x0.Z();  // Track Z global position
-    ft0         = x0.T();     // Starting point of this step
+    SetPosition(x);
 }
 //______________________________________________________________________
 AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
-    AliHit(shunt, track){
-////////////////////////////////////////////////////////////////////////
-// Create ITS hit
-//     The creator of the AliITShit class. The variables shunt and
-// track are passed to the creator of the AliHit class. See the AliHit
-// class for a full description. the integer array *vol contains, in order,
-// fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
-// The array *hits contains, in order, fX = hits[0], fY = hits[1],
-// fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
-// fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
-////////////////////////////////////////////////////////////////////////
+    AliHit(shunt, track), // AliHit
+fStatus(vol[3]), // Track Status
+fModule(vol[0]),  // Module number 
+fPx(hits[3]),     // PX of particle at the point of the hit
+fPy(hits[4]),     // PY of particle at the point of the hit
+fPz(hits[5]),     // PZ of particle at the point of the hit
+fDestep(hits[6]), // Energy deposited in the current step
+fTof(hits[7]),    // Time of flight at the point of the hit
+fStatus0(vol[4]),// Track Status of Starting point
+fx0(hits[8]),     // Starting point of this step
+fy0(hits[9]),     // Starting point of this step
+fz0(hits[10]),     // Starting point of this step
+ft0(hits[11])     // Starting point of this step
+{
+    // Create ITS hit
+    //     The creator of the AliITShit class. The variables shunt and
+    // track are passed to the creator of the AliHit class. See the AliHit
+    // class for a full description. the integer array *vol contains, in order,
+    // fLayer = vol[0], fDet = vol[1], fLadder = vol[2], fStatus = vol[3].
+    // The array *hits contains, in order, fX = hits[0], fY = hits[1],
+    // fZ = hits[2], fPx = hits[3], fPy = hits[4], fPz = hits[5],
+    // fDestep = hits[6], and fTof = hits[7]. In the units of the Monte Carlo
     // Intputs:
     //    Int_t shunt   See AliHit
     //    Int_t track   Track number, see AliHit
     //    Int_t *vol     Array of integer hit data,
-    //                     vol[0] Layer where the hit is, 1-6 typicaly
-    //                     vol[1] Ladder where the hit is.
-    //                     vol[2] Detector number where the hit is
+    //                     vol[0] module number
+    //                     vol[1] not used
+    //                     vol[2] not used
     //                     vol[3] Set of status bits
+    //                     vol[4] Set of status bits at start
     //    Float_t *hits   Array of hit information
     //                     hits[0] X global position of this hit
     //                     hits[1] Y global position of this hit
@@ -358,60 +303,123 @@ AliITShit::AliITShit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
     //                     hits[5] Pz global position of this hit
     //                     hits[6] Energy deposited by this step
     //                     hits[7] Time of flight of this particle at this step
+    //                     hits[8] X0 global position of start of step
+    //                     hits[9] Y0 global position of start of step
+    //                     hits[10] Z0 global position of start of step
+    //                     hits[11] Time of flight of this particle before step
     // Outputs:
     //    none.
     // Return:
     //    A standard created AliITShit class.
-  fLayer      = vol[0];   // Layer number
-  fLadder     = vol[2];   // Ladder number
-  fDet        = vol[1];   // Detector number
-  fStatus     = vol[3];   // Track status flags
-  fX          = hits[0];  // Track X global position
-  fY          = hits[1];  // Track Y global position
-  fZ          = hits[2];  // Track Z global position
-  fPx         = hits[3];  // Track X Momentum
-  fPy         = hits[4];  // Track Y Momentum
-  fPz         = hits[5];  // Track Z Momentum
-  fDestep     = hits[6];  // Track dE/dx for this step
-  fTof        = hits[7];  // Track Time of Flight for this step
-  fStatus0 = 0;// Track Status of Starting point
-  fx0 = 0.0;     // Starting point of this step
-  fy0 = 0.0;     // Starting point of this step
-  fz0 = 0.0;     // Starting point of this step
-  ft0 = 0.0;     // Starting point of this step
+
+    fX          = hits[0];  // Track X global position
+    fY          = hits[1];  // Track Y global position
+    fZ          = hits[2];  // Track Z global position
 }
 //______________________________________________________________________
-void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z){
-////////////////////////////////////////////////////////////////////////
-//     Returns the position of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
+AliITShit::AliITShit(const AliITShit &h):
+AliHit(h), // AliHit
+fStatus(h.fStatus), // Track Status
+fModule(h.fModule),  // Module number 
+fPx(h.fPx),     // PX of particle at the point of the hit
+fPy(h.fPy),     // PY of particle at the point of the hit
+fPz(h.fPz),     // PZ of particle at the point of the hit
+fDestep(h.fDestep), // Energy deposited in the current step
+fTof(h.fTof),    // Time of flight at the point of the hit
+fStatus0(h.fStatus0),// Track Status of Starting point
+fx0(h.fx0),     // Starting point of this step
+fy0(h.fy0),     // Starting point of this step
+fz0(h.fz0),     // Starting point of this step
+ft0(h.ft0)     // Starting point of this step
+{
+    // The standard copy constructor
+    // Inputs:
+    //   AliITShit   &h the sourse of this copy
+    // Outputs:
+    //   none.
+    // Return:
+    //  A copy of the sourse hit h
 
-    g[0] = fX;
-    g[1] = fY;
-    g[2] = fZ;
-    if(gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      x = l[0];
-      y = l[1];
-      z = l[2];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      // AliITSv7 - SDD case
-      x=fX;
-      y=fY;
-      z=fZ;
-    }
+    //Info("CopyConstructor","Coping hit");
+
+    if(this == &h) return;
     return;
 }
 //______________________________________________________________________
+AliITShit& AliITShit::operator=(const AliITShit &h){
+    // The standard = operator
+    // Inputs:
+    //   AliITShit   &h the sourse of this copy
+    // Outputs:
+    //   none.
+    // Return:
+    //  A copy of the sourse hit h
+
+    if(this == &h) return *this;
+    this->fStatus  = h.fStatus;
+    this->fModule  = h.fModule;
+    this->fPx      = h.fPx;
+    this->fPy      = h.fPy;
+    this->fPz      = h.fPz;
+    this->fDestep  = h.fDestep;
+    this->fTof     = h.fTof;
+    this->fStatus0 = h.fStatus0;
+    this->fx0      = h.fx0;
+    this->fy0      = h.fy0;
+    this->fz0      = h.fz0;
+    this->ft0      = h.ft0;
+    return *this;
+}
+//______________________________________________________________________
+void AliITShit::SetShunt(Int_t shunt){
+    // Sets track flag based on shunt value. Code copied from
+    // AliHit standar constructor.
+    // Inputs:
+    //   Int_t shunt    A flag to indecate what to do with track numbers
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Int_t primary,track,current,parent;
+    TParticle *part;
+
+    track = fTrack;
+    if(shunt == 1) {
+        primary = gAlice->GetMCApp()->GetPrimary(track);
+        gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
+        fTrack=primary;
+    }else if (shunt == 2) {
+        // the "primary" particle associated to the hit is
+        // the last track that has been flagged in the StepManager
+        // used by PHOS to associate the hit with the decay gamma
+        // rather than with the original pi0
+        parent=track;
+        while (1) {
+            current=parent;
+            part = gAlice->GetMCApp()->Particle(current);
+            parent=part->GetFirstMother();
+            if(parent<0 || part->TestBit(kKeepBit))
+                break;
+        }
+        fTrack=current;
+    }else {
+        fTrack=track;
+        gAlice->GetMCApp()->FlagTrack(fTrack);
+    } // end if shunt
+}
+//______________________________________________________________________
 void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
-////////////////////////////////////////////////////////////////////////
-//     Returns the position and time of flight of this hit in the local
-// coordinates of this module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
+    //     Returns the position and time of flight of this hit in the local
+    // coordinates of this module, and in the units of the Monte Carlo.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   Float_t x   Global position of this hit [cm]
+    //   Float_t y   Global position of this hit [cm]
+    //   Float_t z   Global poistion of this hit [cm]
+    //   Float_t tof Time of flight of particle at this hit
+    // Return:
+    //   none.
     AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
     Float_t g[3],l[3];
 
@@ -419,27 +427,35 @@ void AliITShit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof){
     g[1] = fY;
     g[2] = fZ;
     if(gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      x = l[0];
-      y = l[1];
-      z = l[2];
+        gm->GtoL(fModule,g,l);
+        x = l[0];
+        y = l[1];
+        z = l[2];
     } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      // AliITSv7 - SDD case
-      x=fX;
-      y=fY;
-      z=fZ;
-    }
+        Error("AliITShit","NULL pointer to the geometry! return smth else");
+        // AliITSv7 - SDD case
+        x=fX;
+        y=fY;
+        z=fZ;
+    } // end if
     tof = fTof;
     return;
 }
 //______________________________________________________________________
 void AliITShit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z,
-                             Double_t &tof){
-////////////////////////////////////////////////////////////////////////
-//     Returns the initial position and time of flight of this hit in the local
-// coordinates of this module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
+                              Double_t &tof){
+    //     Returns the initial position and time of flight of this hit 
+    // in the local coordinates of this module, and in the units of the 
+    // Monte Carlo.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   Double_t x   Global position of this hit [cm]
+    //   Double_t y   Global position of this hit [cm]
+    //   Double_t z   Global poistion of this hit [cm]
+    //   Double_t tof Time of flight of particle at this hit
+    // Return:
+    //   none.
     AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
     Float_t g[3],l[3];
 
@@ -447,86 +463,31 @@ void AliITShit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z,
     g[1] = fy0;
     g[2] = fz0;
     if(gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      x = l[0];
-      y = l[1];
-      z = l[2];
+        gm->GtoL(fModule,g,l);
+        x = l[0];
+        y = l[1];
+        z = l[2];
     } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      // AliITSv7 - SDD case
-      x=fx0;
-      y=fy0;
-      z=fz0;
+        Error("AliITShit","NULL pointer to the geometry! return smth else");
+        x=fx0;
+        y=fy0;
+        z=fz0;
     }
     tof = ft0;
     return;
 }
 //______________________________________________________________________
-Float_t AliITShit::GetXL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the x position of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fX;
-    g[1] = fY;
-    g[2] = fZ;
-    if(gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      return l[0];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fX;
-    }
-}
-//______________________________________________________________________
-Float_t AliITShit::GetYL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the y position of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fX;
-    g[1] = fY;
-    g[2] = fZ;
-    if (gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      return l[1];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fZ;
-    }
-}
-//______________________________________________________________________
-Float_t AliITShit::GetZL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the z position of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fX;
-    g[1] = fY;
-    g[2] = fZ;
-    if(gm) {
-      gm->GtoL(fLayer,fLadder,fDet,g,l);
-      return l[2];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fY;
-    }
-}
-//______________________________________________________________________
 void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
-////////////////////////////////////////////////////////////////////////
-//     Returns the momentum of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
+    //     Returns the momentum of this hit in the local coordinates of this
+    // module, and in the units of the Monte Carlo.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   Float_t px   Track x momentum at this hit [GeV/c]
+    //   Float_t py   Track y momentum at this hit [GeV/c]
+    //   Float_t pz   Track z momentum at this hit [GeV/c]
+    // Return:
+    //   none.
     AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
     Float_t g[3],l[3];
 
@@ -534,107 +495,60 @@ void AliITShit::GetMomentumL(Float_t &px,Float_t &py,Float_t &pz){
     g[1] = fPy;
     g[2] = fPz;
     if (gm) {
-      gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
-      px = l[0];
-      py = l[1];
-      pz = l[2];
+        gm->GtoLMomentum(fModule,g,l);
+        px = l[0];
+        py = l[1];
+        pz = l[2];
     } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      px=fPx;
-      py=fPy;
-      pz=fPz;
-    }
+        Error("AliITShit","NULL pointer to the geometry! return smth else");
+        px=fPx;
+        py=fPy;
+        pz=fPz;
+    } // end if
     return;
 }
 //______________________________________________________________________
-Float_t AliITShit::GetPXL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the X momentum of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fPx;
-    g[1] = fPy;
-    g[2] = fPz;
-    if (gm) {
-      gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
-      return l[0];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fPx;
-    }
-}
-//______________________________________________________________________
-Float_t AliITShit::GetPYL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the Y momentum of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fPx;
-    g[1] = fPy;
-    g[2] = fPz;
-    if (gm) {
-      gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
-      return l[1];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fPy;
-    }
-
-}
-//______________________________________________________________________
-Float_t AliITShit::GetPZL(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the Z momentum of this hit in the local coordinates of this
-// module, and in the units of the Monte Carlo.
-////////////////////////////////////////////////////////////////////////
-    AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
-    Float_t g[3],l[3];
-
-    g[0] = fPx;
-    g[1] = fPy;
-    g[2] = fPz;
-    if (gm) {
-      gm->GtoLMomentum(fLayer,fLadder,fDet,g,l);
-      return l[2];
-    } else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return fPz;
-    }
+TParticle * AliITShit::GetParticle() const {
+    //     Returns the pointer to the TParticle for the particle that created
+    // this hit. From the TParticle all kinds of information about this 
+    // particle can be found. See the TParticle class.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return:
+    //   The TParticle of the track that created this hit.
 
+    return gAlice->GetMCApp()->Particle(GetTrack());
 }
-//___________________________________________________________________________;
-Int_t AliITShit::GetModule(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the module index number of the module where this hit was in.
-////////////////////////////////////////////////////////////////////////
+//----------------------------------------------------------------------
+void AliITShit::GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det)const{
+    // Returns the layer ladder and detector number lables for this
+    // ITS module. The use of layer, ladder and detector number for
+    // discribing the ITS is obsoleate.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   Int_t   &layer   Layer lable
+    //   Int_t   &ladder  Ladder lable
+    //   Int_t   &det     Detector lable
+    // Return:
+    //    none.
     AliITSgeom *gm = ((AliITS*)gAlice->GetDetector("ITS"))->GetITSgeom();
 
-    if (gm) return gm->GetModuleIndex(fLayer,fLadder,fDet);
-    else {
-      Error("AliITShit","NULL pointer to the geometry! return smth else",gm);
-      return 0;
-    }
-}
-//______________________________________________________________________
-TParticle * AliITShit::GetParticle(){
-////////////////////////////////////////////////////////////////////////
-//     Returns the pointer to the TParticle for the particle that created
-// this hit. From the TParticle all kinds of information about this 
-// particle can be found. See the TParticle class.
-////////////////////////////////////////////////////////////////////////
-    return gAlice->Particle(GetTrack());
+    gm->GetModuleId(fModule,layer,ladder,det);
+    return;
 }  
 //----------------------------------------------------------------------
-void AliITShit::Print(ostream *os){
-////////////////////////////////////////////////////////////////////////
-// Standard output format for this class.
-////////////////////////////////////////////////////////////////////////
+void AliITShit::Print(ostream *os) const {
+    // Standard output format for this class.
+    // Inputs:
+    //   ostream *os   The output stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+
 #if defined __GNUC__
 #if __GNUC__ > 2
     ios::fmtflags fmt;
@@ -642,7 +556,7 @@ void AliITShit::Print(ostream *os){
     Int_t fmt;
 #endif
 #else
-#if defined __ICC || defined __ECC
+#if defined __ICC || defined __ECC || defined __xlC__
     ios::fmtflags fmt;
 #else
     Int_t fmt;
@@ -654,7 +568,7 @@ void AliITShit::Print(ostream *os){
     fmt = os->setf(ios::hex); // set hex for fStatus only.
     *os << fStatus << " ";
     fmt = os->setf(ios::dec); // every thing else decimel.
-    *os << fLayer << " " << fLadder << " " << fDet << " ";;
+    *os << fModule << " ";
     *os << fPx << " " << fPy << " " << fPz << " ";
     *os << fDestep << " " << fTof;
     *os << " " << fx0 << " " << fy0 << " " << fz0;
@@ -663,33 +577,45 @@ void AliITShit::Print(ostream *os){
     return;
 }
 //----------------------------------------------------------------------
-void AliITShit::Read(istream *is){
-////////////////////////////////////////////////////////////////////////
-// Standard input format for this class.
-////////////////////////////////////////////////////////////////////////
+void AliITShit::Read(istream *is) {
+    // Standard input format for this class.
+    // Inputs:
+    //   istream *is  the input stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
 
     *is >> fTrack >> fX >> fY >> fZ;
-    *is >> fStatus >> fLayer >> fLadder >> fDet >> fPx >> fPy >> fPz >>
-          fDestep >> fTof;
+    *is >> fStatus >> fModule >> fPx >> fPy >> fPz >> fDestep >> fTof;
     *is >> fx0 >> fy0 >> fz0;
     return;
 }
 //----------------------------------------------------------------------
 ostream &operator<<(ostream &os,AliITShit &p){
-////////////////////////////////////////////////////////////////////////
-// Standard output streaming function.
-////////////////////////////////////////////////////////////////////////
+    // Standard output streaming function.
+    // Inputs:
+    //   ostream os  The output stream
+    //   AliITShit p The his to be printed out
+    // Outputs:
+    //   none.
+    // Return:
+    //   The input stream
+
     p.Print(&os);
     return os;
 }
 //----------------------------------------------------------------------
 istream &operator>>(istream &is,AliITShit &r){
-////////////////////////////////////////////////////////////////////////
-// Standard input streaming function.
-////////////////////////////////////////////////////////////////////////
+    // Standard input streaming function.
+    // Inputs:
+    //   istream is  The input stream
+    //   AliITShit p The AliITShit class to be filled from this input stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   The input stream
+
     r.Read(&is);
     return is;
 }