]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/ITSUpgradeSim/AliITSUHit.cxx
TOF + macros to each detector folder
[u/mrichter/AliRoot.git] / ITS / UPGRADE / ITSUpgradeSim / 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
852af72e 64 // coordinates of this chip, and in the units of the Monte Carlo.
451f5018 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;
74 //
75}
76
77//______________________________________________________________________
78void AliITSUHit::GetPositionL0(Double_t &x,Double_t &y,Double_t &z,Double_t &tof)
79{
80 // Returns the initial position and time of flight of this hit
852af72e 81 // in the local coordinates of this chip, and in the units of the
451f5018 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);
86 x = l[0];
87 y = l[1];
88 z = l[2];
89 tof = ft0;
90}
91
02d6eccc 92//______________________________________________________________________
852af72e 93void AliITSUHit::GetChipID(Int_t &layer,Int_t &stave,Int_t &sstave, Int_t &mod,Int_t &det) const
451f5018 94{
852af72e 95 // Returns the layer stave and detector number lables for this
96 // ITS chip. Note: indices start from 0!
451f5018 97 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
af0b44a7 98 if (!gm) { AliFatal("NULL pointer to the geometry!"); return; }
852af72e 99 gm->GetChipId(fModule,layer,stave,sstave,mod,det);
451f5018 100}
02d6eccc 101
102//______________________________________________________________________
103Int_t AliITSUHit::GetLayer() const
104{
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);
109}
110
111//______________________________________________________________________
852af72e 112Int_t AliITSUHit::GetStave() const
02d6eccc 113{
852af72e 114 // Returns the stave of TS chip. Note: indices start from 0!
02d6eccc 115 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
af0b44a7 116 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
852af72e 117 return gm->GetStave(fModule);
02d6eccc 118}
119
120//______________________________________________________________________
68b7631d 121Int_t AliITSUHit::GetHalfStave() const
02d6eccc 122{
852af72e 123 // Returns the substave of the chip. Note: indices start from 0!
02d6eccc 124 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
125 if (!gm) AliFatal("NULL pointer to the geometry!");
68b7631d 126 return gm->GetHalfStave(fModule);
852af72e 127}
128
129//______________________________________________________________________
130Int_t AliITSUHit::GetModule() const
131{
132 // Returns the module of the chip. Note: indices start from 0!
133 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
af0b44a7 134 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
852af72e 135 return gm->GetModule(fModule);
136}
137
138//______________________________________________________________________
139Int_t AliITSUHit::GetChipInModule() const // former GetDetector
140{
141 // Returns the detector within the module(or stave). Note: indices start from 0!
142 AliITSUGeomTGeo *gm = ((AliITSU*)gAlice->GetDetector("ITS"))->GetITSGeomTGeo();
af0b44a7 143 if (!gm) { AliFatal("NULL pointer to the geometry!"); return -1; }
852af72e 144 return gm->GetChipIdInModule(fModule);
02d6eccc 145}
ee58ce21 146
147//______________________________________________________________________
d8e94def 148void AliITSUHit::Print(Option_t */*option*/) const
ee58ce21 149{
150 // print itself
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);
153
154}