]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFGeometry.cxx
Coding conventions (Annalisa)
[u/mrichter/AliRoot.git] / TOF / AliTOFGeometry.cxx
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 /*
17 $Log$
18 Revision 1.14  2006/04/05 08:35:38  hristov
19 Coding conventions (S.Arcelli, C.Zampolli)
20
21 Revision 1.13  2006/03/12 14:37:54  arcelli
22  Changes for TOF Reconstruction using TGeo
23
24 Revision 1.12  2006/02/28 10:38:00  decaro
25 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location
26
27 Revision 1.11  2005/12/15 14:17:29  decaro
28 Correction of some parameter values
29
30 Revision 1.10  2005/12/15 08:55:32  decaro
31 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
32
33 Revision 1.9.1  2005/07/19 A. De Caro
34         Created daughter-classes AliTOFGeometryV4 and AliTOFGeometryV5
35         => moved global methods IsInsideThePad, DistanceToPad,
36         GetPlate, GetSector, GetStrip, GetPadX, GetPadZ,
37         GetX, GetY, GetZ, GetPadDx, GetPadDy and GetPadDz
38         in daughter-classes
39
40 Revision 1.9  2005/10/20 12:41:35  hristov
41 Implementation of parallel tracking. It is not the default version, one can use it passing option MI from AliReconstruction to TOF (M.Ivanov)
42
43 Revision 1.8  2004/11/29 08:28:01  decaro
44 Introduction of a new TOF constant (i.e. TDC bin width)
45
46 Revision 1.7  2004/11/05 07:20:08  decaro
47 TOF library splitting and conversion of some printout messages in AliLog schema (T.Kuhr)
48
49 Revision 1.6  2004/06/15 15:27:59  decaro
50 TOF raw data: preliminary implementation and style changes
51
52 Revision 1.5  2004/04/20 14:37:22  hristov
53 Using TMath::Abs instead of fabs, arrays of variable size created/deleted correctly (HP,Sun)
54
55 Revision 1.4  2004/04/13 09:42:51  decaro
56 Track reconstruction code for TOF: updating
57
58 Revision 1.3  2003/12/29 18:40:39  hristov
59 Copy/paste error corrected
60
61 Revision 1.2  2003/12/29 17:26:01  hristov
62 Using enum to initaialize static ints in the header file, the initialization of static floats moved to the implementation file
63
64 Revision 1.1  2003/12/29 15:18:03  decaro
65 TOF geometry updating (addition of AliTOFGeometry)
66
67 Revision 0.05  2004/6/11 A.De Caro
68         Implement Global method NpadXStrip
69         Insert four float constants (originally  in AliTOF class)
70 Revision 0.04  2004/4/05 S.Arcelli
71         Implement Global methods IsInsideThePad 
72                                   DistanceToPad 
73 Revision 0.03  2003/12/14 S.Arcelli
74         Set Phi range [-180,180]->[0,360] 
75 Revision 0.02  2003/12/10 S.Arcelli:
76         Implement Global methods GetPos & GetDetID 
77 Revision 0.01  2003/12/04 S.Arcelli
78 */
79
80 #include <stdlib.h>
81 #include <Riostream.h>
82 ///////////////////////////////////////////////////////////////////////////////
83 //                                                                           //
84 //  TOF Geometry class                                                       //
85 //                                                                           //
86 ///////////////////////////////////////////////////////////////////////////////
87
88 #include "AliLog.h"
89 #include "AliConst.h"
90 #include "AliTOFGeometry.h"
91
92 ClassImp(AliTOFGeometry)
93
94 const Int_t AliTOFGeometry::fgkTimeDiff   = 25000;  // Min signal separation (ps)
95
96 const Float_t AliTOFGeometry::fgkXPad     = 2.5;    // Pad size in the x direction (cm)
97 const Float_t AliTOFGeometry::fgkZPad     = 3.5;    // Pad size in the z direction (cm)
98
99 const Float_t AliTOFGeometry::fgkStripLength = 122.;// Strip Length (rho X phi direction) (cm)
100
101 const Float_t AliTOFGeometry::fgkSigmaForTail1= 2.; //Sig1 for simulation of TDC tails 
102 const Float_t AliTOFGeometry::fgkSigmaForTail2= 0.5;//Sig2 for simulation of TDC tails
103
104 const Float_t AliTOFGeometry::fgkTdcBin = 24.4;     // time-window for the TDC bins [ps]
105
106 //_____________________________________________________________________________
107 AliTOFGeometry::AliTOFGeometry()
108 {
109   //
110   // AliTOFGeometry default constructor
111   //
112
113   fNStripC     = 19;  // number of strips in C type module 
114   fZlenA    = 106.0;  // length (cm) of the A module
115   fZlenB    = 141.0;  // length (cm) of the B module
116   fZlenC    = 177.5;  // length (cm) of the C module
117   fMaxhZtof = 371.5;  // Max half z-size of TOF (cm)
118
119   fxTOF     = 371.; // Inner radius of the TOF for Reconstruction (cm)
120   fRmin     = 370.; // Inner radius of the TOF (cm)
121   fRmax     = 399.; // Outer radius of the TOF (cm)
122
123   Init();
124
125 }
126
127 //_____________________________________________________________________________
128 AliTOFGeometry::~AliTOFGeometry()
129 {
130   //
131   // AliTOFGeometry destructor
132   //
133
134 }
135 //_____________________________________________________________________________
136 void AliTOFGeometry::Init()
137 {
138   //
139   // Initialize strip Tilt Angles and Heights
140   //
141  
142   fPhiSec   = 360./kNSectors;
143
144   Float_t const kangles[kNPlates][kMaxNstrip] ={
145
146  {44.494, 43.725, 42.946, 42.156, 41.357, 40.548, 39.729, 38.899, 
147   38.060, 37.211, 36.353, 35.484, 34.606, 33.719, 32.822, 31.916, 
148   31.001, 30.077, 29.144, 28.202 },
149
150  {26.884, 25.922, 24.952, 23.975, 22.989, 22.320, 21.016, 20.309,
151   19.015, 18.270, 16.989, 16.205, 14.941, 14.117, 12.871, 12.008,
152   10.784, 9.8807, 8.681, 0.0 },
153
154  { 7.5835, 6.4124, 5.4058, 4.2809, 3.2448,  2.1424, 1.078, -0., -1.078, 
155   -2.1424, -3.2448, -4.2809, -5.4058, -6.4124, -7.5835, 0.0, 0.0, 0.0,
156   0.0, 0.0 },
157   
158  {-8.681, -9.8807, -10.784, -12.008, -12.871, -14.117, -14.941, -16.205,
159   -16.989, -18.27, -19.015, -20.309, -21.016, -22.32, -22.989,
160    -23.975, -24.952, -25.922, -26.884, 0. },
161   
162  {-28.202, -29.144, -30.077, -31.001, -31.916, -32.822, -33.719, -34.606,
163   -35.484, -36.353, -37.211, -38.06, -38.899, -39.729, -40.548,
164    -41.357, -42.156, -42.946, -43.725, -44.494 }};
165
166
167   //Strips Heights
168
169    Float_t const kheights[kNPlates][kMaxNstrip]= {
170
171   {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5,
172    -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 },
173   
174   {-6.3, -7.1, -7.9, -8.7, -9.5, -3, -9.5,   -3, -9.5,   -3, 
175    -9.5, -3.0, -9.5, -3.0, -9.5, -3, -9.5,   -3,   -9 , 0.},
176   
177   {  -3,   -9, -4.5,   -9, -4.5,     -9, -4.5,   -9, -4.5,   -9, 
178      -4.5,   -9, -4.5,   -9,   -3,   0.0, 0.0, 0.0, 0.0, 0.0 },
179   
180   {  -9,   -3, -9.5,   -3, -9.5, -3, -9.5,   -3, -9.5,   -3, -9.5,
181      -3, -9.5,   -3, -9.5,  -8.7, -7.9, -7.1, -6.3, 0. },
182   
183   {-5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5,
184    -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5, -5.5 }};
185
186    for (Int_t iplate = 0; iplate < kNPlates; iplate++) {
187      for (Int_t istrip = 0; istrip < kMaxNstrip; istrip++) {
188        fAngles[iplate][istrip]   = kangles[iplate][istrip];
189        fHeights[iplate][istrip]  = kheights[iplate][istrip];
190      }
191    }
192
193 }
194
195 //_____________________________________________________________________________
196 void AliTOFGeometry::GetPosPar(Int_t *det, Float_t *pos) const
197 {
198 //
199 // Returns space point coor (x,y,z) (cm)  for Detector 
200 // Indices  (iSect,iPlate,iStrip,iPadX,iPadZ) 
201 //
202
203   pos[0]=GetX(det);  
204   pos[1]=GetY(det);  
205   pos[2]=GetZ(det);
206   
207 }
208 //_____________________________________________________________________________
209 void AliTOFGeometry::GetDetID( Float_t *pos, Int_t *det) const
210 {
211  //
212  // Returns Detector Indices (iSect,iPlate,iStrip,iPadX,iPadZ) 
213  // space point coor (x,y,z) (cm)  
214
215
216   det[0]=GetSector(pos);  
217   det[1]=GetPlate(pos);  
218   det[2]=GetStrip(pos);
219   det[3]=GetPadZ(pos);
220   det[4]=GetPadX(pos);
221   
222 }
223 //_____________________________________________________________________________