]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSUHit.cxx
fixes in simulation classes
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUHit.cxx
CommitLineData
451f5018 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16#include "AliITSU.h"
17#include "AliITSUGeomTGeo.h"
18#include "AliITSUHit.h"
19
20ClassImp(AliITSUHit)
21
22////////////////////////////////////////////////////////////////////////
23//
24// At the moment the same functionality/data-members as parent AliITShit
25// except the geometry transformation uses AliITSgeomTGeoUp
26//
27////////////////////////////////////////////////////////////////////////
28
29//----------------------------------------------------------------------
30AliITSUHit::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)
33{
34 // ct-r
35}
36
37//______________________________________________________________________
38AliITSUHit::AliITSUHit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
39 : AliITShit(shunt, track, vol, hits)
40{
41 // c-tor
42}
43
44//______________________________________________________________________
45AliITSUHit::AliITSUHit(const AliITSUHit &h)
46: AliITShit(h)
47{
48 // cp c-tor
49}
50
51//______________________________________________________________________
52AliITSUHit& AliITSUHit::operator=(const AliITSUHit &h)
53{
54 // The standard = operator
55 if(this == &h) return *this;
56 AliITShit::operator=(h);
57 return *this;
58}
59
60//______________________________________________________________________
61void AliITSUHit::GetPositionL(Float_t &x,Float_t &y,Float_t &z,Float_t &tof)
62{
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.
65 //
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);
70 x = l[0];
71 y = l[1];
72 z = l[2];
73 tof = fTof;
4fa9d550 74 /*
75 RSS
76 printf("\nMod#%4d: Glo:%+7.2f %+7.2f %+7.2f | Loc: %+7.2f %+7.2f %+7.2f\n",
77 fModule,g[0],g[1],g[2],l[0],l[1],l[2]);
78 */
79 gm->GetMatrixSens(fModule)->Print();
451f5018 80 //
81}
82
83//______________________________________________________________________
84void AliITSUHit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
85{
86 // Returns the initial position and time of flight of this hit
87 // in the local coordinates of this module, and in the units of the
88 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
89 if (!gm) AliFatal("NULL pointer to the geometry!");
90 double g[3]={fx0,fy0,fz0},l[3];
91 gm->GetMatrixSens(fModule)->MasterToLocal(g,l);
92 x = l[0];
93 y = l[1];
94 z = l[2];
95 tof = ft0;
96}
97
02d6eccc 98//______________________________________________________________________
451f5018 99void AliITSUHit::GetDetectorID(Int_t &layer,Int_t &ladder,Int_t &det) const
100{
101 // Returns the layer ladder and detector number lables for this
102 // ITS module. Note: indices start from 0!
103 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
104 if (!gm) AliFatal("NULL pointer to the geometry!");
105 gm->GetModuleId(fModule,layer,ladder,det);
106}
02d6eccc 107
108//______________________________________________________________________
109Int_t AliITSUHit::GetLayer() const
110{
111 // Returns the layer. Note: indices start from 0!
112 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
113 if (!gm) AliFatal("NULL pointer to the geometry!");
114 return gm->GetLayer(fModule);
115}
116
117//______________________________________________________________________
118Int_t AliITSUHit::GetLadder() const
119{
120 // Returns the ladder of TS module. Note: indices start from 0!
121 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
122 if (!gm) AliFatal("NULL pointer to the geometry!");
123 return gm->GetLadder(fModule);
124}
125
126//______________________________________________________________________
127Int_t AliITSUHit::GetDetector() const
128{
129 // Returns the detector within the ladder. Note: indices start from 0!
130 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
131 if (!gm) AliFatal("NULL pointer to the geometry!");
132 return gm->GetModIdInLadder(fModule);
133}