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 chip, 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 chip, 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::GetChipID(Int_t &layer,Int_t &stave,Int_t &sstave, Int_t &mod,Int_t &det) const
95 // Returns the layer stave and detector number lables for this
96 // ITS chip. Note: indices start from 0!
97 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
98 if (!gm) { AliFatal("NULL pointer to the geometry!"); return; }
99 gm->GetChipId(fModule,layer,stave,sstave,mod,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::GetStave() const
114 // Returns the stave of TS chip. Note: indices start from 0!
115 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
116 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
117 return gm->GetStave(fModule);
120 //______________________________________________________________________
121 Int_t AliITSUHit::GetHalfStave() const
123 // Returns the substave of the chip. 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->GetHalfStave(fModule);
129 //______________________________________________________________________
130 Int_t AliITSUHit::GetModule() const
132 // Returns the module of the chip. Note: indices start from 0!
133 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
134 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
135 return gm->GetModule(fModule);
138 //______________________________________________________________________
139 Int_t AliITSUHit::GetChipInModule() const // former GetDetector
141 // Returns the detector within the module(or stave). Note: indices start from 0!
142 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
143 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
144 return gm->GetChipIdInModule(fModule);
147 //______________________________________________________________________
148 void AliITSUHit::Print(Option_t */*option*/) const
151 printf("Mod%4d Tr:%5d DE:%.2e TOF: %.3e| P:%.3f %.3f %.3f |>%.4f %.4f %.4f >%.4f %.4f %.4f\n",
152 fModule,fTrack,fDestep,fTof,fPx,fPy,fPz, fx0,fy0,fz0,fX,fY,fZ);