1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 #include "AliITSUGeomTGeo.h"
18 #include "AliITSUHit.h"
22 ////////////////////////////////////////////////////////////////////////
24 // At the moment the same functionality/data-members as parent AliITShit
25 // except the geometry transformation uses AliITSgeomTGeoUp
27 ////////////////////////////////////////////////////////////////////////
29 //----------------------------------------------------------------------
30 AliITSUHit::AliITSUHit(Int_t shunt,Int_t track,Int_t *vol,Float_t edep,Float_t tof,
31 TLorentzVector &x,TLorentzVector &x0,TLorentzVector &p)
32 : AliITShit(shunt,track,vol,edep,tof,x,x0,p)
37 //______________________________________________________________________
38 AliITSUHit::AliITSUHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
39 : AliITShit(shunt, track, vol, hits)
44 //______________________________________________________________________
45 AliITSUHit::AliITSUHit(const AliITSUHit &h)
51 //______________________________________________________________________
52 AliITSUHit& AliITSUHit::operator=(const AliITSUHit &h)
54 // The standard = operator
55 if(this == &h) return *this;
56 AliITShit::operator=(h);
60 //______________________________________________________________________
61 void AliITSUHit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
63 // Returns the position and time of flight of this hit in the local
64 // coordinates of this module, and in the units of the Monte Carlo.
66 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
67 if (!gm) AliFatal("NULL pointer to the geometry!");
68 double g[3]={fX,fY,fZ},l[3];
69 gm->GetMatrixSens(fModule)->MasterToLocal(g,l);
77 //______________________________________________________________________
78 void AliITSUHit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
80 // Returns the initial position and time of flight of this hit
81 // in the local coordinates of this module, and in the units of the
82 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
83 if (!gm) AliFatal("NULL pointer to the geometry!");
84 double g[3]={fx0,fy0,fz0},l[3];
85 gm->GetMatrixSens(fModule)->MasterToLocal(g,l);
92 //______________________________________________________________________
93 void AliITSUHit::GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det) const
95 // Returns the layer ladder and detector number lables for this
96 // ITS module. Note: indices start from 0!
97 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
98 if (!gm) AliFatal("NULL pointer to the geometry!");
99 gm->GetModuleId(fModule,layer,ladder,det);
102 //______________________________________________________________________
103 Int_t AliITSUHit::GetLayer() const
105 // Returns the layer. Note: indices start from 0!
106 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
107 if (!gm) AliFatal("NULL pointer to the geometry!");
108 return gm->GetLayer(fModule);
111 //______________________________________________________________________
112 Int_t AliITSUHit::GetLadder() const
114 // Returns the ladder of TS module. Note: indices start from 0!
115 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
116 if (!gm) AliFatal("NULL pointer to the geometry!");
117 return gm->GetLadder(fModule);
120 //______________________________________________________________________
121 Int_t AliITSUHit::GetDetector() const
123 // Returns the detector within the ladder. Note: indices start from 0!
124 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
125 if (!gm) AliFatal("NULL pointer to the geometry!");
126 return gm->GetModIdInLadder(fModule);
129 //______________________________________________________________________
130 void AliITSUHit::Print(Option_t *option) const
133 printf("Mod%4d Tr:%5d DE:%.2e TOF: %.3e| P:%.3f %.3f %.3f |>%.4f %.4f %.4f >%.4f %.4f %.4f\n",
134 fModule,fTrack,fDestep,fTof,fPx,fPy,fPz, fx0,fy0,fz0,fX,fY,fZ);