Shadowed variables corrected.
[u/mrichter/AliRoot.git] / TOF / AliTOFGeometry.h
CommitLineData
0f4a7374 1#ifndef ALITOFGEOMETRY_H
2#define ALITOFGEOMETRY_H
0e46b9ae 3
0f4a7374 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9///////////////////////////////////////////////////////////////////////////////
10// //
11// TOF geometry class //
12// //
13///////////////////////////////////////////////////////////////////////////////
14
0e46b9ae 15#include "TGeoMatrix.h"
d076c8d5 16#include "TObject.h"
0f4a7374 17
5c7c93fa 18//class TGeoMatrix;
19
d076c8d5 20class AliTOFGeometry: public TObject{
0f4a7374 21
22 public:
23 AliTOFGeometry();
24 virtual ~AliTOFGeometry();
25
74ea065c 26 static Int_t NStripA() { return kNStripA;};
27 static Int_t NStripB() { return kNStripB;};
0ef21f59 28 static Int_t NStripC() { return kNStripC;};
4402e7cb 29 static Int_t NMaxNstrip() { return kMaxNstrip;};
74ea065c 30 static Int_t NpadX() { return kNpadX;};
31 static Int_t NpadZ() { return kNpadZ;};
7e6dce66 32 static Int_t NpadXStrip() { return kNpadX*kNpadZ;};
74ea065c 33 static Int_t NSectors() { return kNSectors;};
34 static Int_t NPlates() { return kNPlates;};
0ef21f59 35 static Int_t NStripXSector() { return (kNStripA + 2*kNStripB +
36 2*kNStripC);};
37 static Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
38 2*kNStripC)*kNpadX*kNpadZ;};
d3c7bfac 39
0ef21f59 40 static Float_t RinTOF() { return fgkxTOF;};
41 static Float_t Rmin() { return fgkRmin;};
42 static Float_t Rmax() { return fgkRmax;};
d3c7bfac 43
340693af 44 static Float_t XPad() { return fgkXPad;};
45 static Float_t ZPad() { return fgkZPad;};
d3c7bfac 46
4402e7cb 47 static Float_t StripLength() { return fgkStripLength;};
48
0f4a7374 49 static Int_t TimeDiff() { return fgkTimeDiff;};
74ea065c 50 static Int_t MaxTOFTree() { return kMaxTOFTree;};
0f4a7374 51
43f77f2d 52 static Int_t NDDL() { return kNDDL;};
53 static Int_t NTRM() { return kNTRM;}
54 static Int_t NTdc() { return kNTdc;};
d0eb8f39 55 static Int_t NChain() { return kNChain;};
43f77f2d 56 static Int_t NCh() { return kNCh;};
d0eb8f39 57 static Int_t NPadXTRM() { return kNCh*kNTdc*kNChain;};
43f77f2d 58
0ef21f59 59 static Float_t ZlenA() { return fgkZlenA;};
60 static Float_t ZlenB() { return fgkZlenB;};
61 static Float_t ZlenC() { return fgkZlenC;};
62 static Float_t MaxhZtof() { return fgkMaxhZtof;};
0f4a7374 63
64 static Float_t SigmaForTail1() { return fgkSigmaForTail1;};
65 static Float_t SigmaForTail2() { return fgkSigmaForTail2;};
0f4a7374 66
74ea065c 67 static Double_t GetAlpha() { return 2 * 3.14159265358979323846 / kNSectors; };
0f4a7374 68
43f77f2d 69 static Float_t TdcBinWidth() {return fgkTdcBin;};
48e6af28 70 static Float_t ToTBinWidth() {return fgkToTBin;};
0f4a7374 71
0ef21f59 72 virtual void ImportGeometry();
74ea065c 73 virtual void SetHoles(Bool_t holes) {fHoles = holes;};
74 virtual Bool_t GetHoles() const {return fHoles;};
0ef21f59 75 virtual Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0) const;
76 virtual Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos) const;
77 virtual Bool_t IsInsideThePad(TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0) const;
78 virtual void GetVolumePath(Int_t *ind, Char_t *path );
79 virtual void GetVolumePath(Int_t sector, Char_t *path );
80 virtual void GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path );
81 virtual void GetPos(Int_t *det,Float_t *pos);
7aeeaf38 82 virtual void GetPosPar(Int_t *det,Float_t *pos) const;
83 virtual void GetDetID(Float_t *pos,Int_t *det) const;
0ef21f59 84 virtual Int_t GetPlate(Float_t *pos) const;
85 virtual Int_t GetStrip(Float_t *pos) const;
86 virtual Int_t GetSector(Float_t *pos) const;
87 virtual Int_t GetPadX(Float_t *pos) const;
88 virtual Int_t GetPadZ(Float_t *pos) const;
89 virtual Float_t GetX(Int_t *det) const ;
90 virtual Float_t GetY(Int_t *det) const ;
91 virtual Float_t GetZ(Int_t *det) const ;
48e6af28 92 virtual void DetToStripRF(Int_t nPadX, Int_t nPadZ,
93 Float_t &x, Float_t &z) const;
0ef21f59 94 virtual void DetToSectorRF(Int_t vol[5], Double_t ** coord);
95 virtual Float_t GetPadDx(Float_t *pos);
96 virtual Float_t GetPadDy(Float_t *pos);
97 virtual Float_t GetPadDz(Float_t *pos);
98 virtual void Translation(Float_t *xyz, Float_t translationVector[3]) const;
99 virtual void Rotation(Float_t *xyz, Double_t rotationAngles[6]) const;
100 virtual void InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const;
d3c7bfac 101
0ef21f59 102 static Float_t GetAngles(Int_t iplate, Int_t istrip) {return fgkAngles[iplate][istrip];};
103 static Float_t GetHeights(Int_t iplate, Int_t istrip) {return fgkHeights[iplate][istrip];};
104 static Float_t GetDistances(Int_t iplate, Int_t istrip) {return fgkDistances[iplate][istrip];};
d3c7bfac 105
0ef21f59 106 static Int_t GetIndex(Int_t *detId); // Get channel index from det Id (for calibration mainly)
107
108 private:
0f4a7374 109
58eb5b61 110 enum {
74ea065c 111 kNStripA = 15, // number of strips in A type module
112 kNStripB = 19, // number of strips in B type module
0ef21f59 113 kNStripC = 19, // number of strips in C type module
74ea065c 114 kNpadX = 48, // Number of pads along X
115 kNpadZ = 2, // Number of pads along Z
116 kNSectors = 18, // Number of Sectors
117 kNPlates = 5, // Number of Plates
4402e7cb 118 kMaxTOFTree = 5, // numer of geom. levels:
119 kMaxNstrip = 20 // Max. number of strips
58eb5b61 120 };
121
43f77f2d 122 // DAQ characteristics
123 // cfr. TOF-TDR pag. 105 for Glossary
124 // TARODA : TOF-ALICE Read Out and Data Acquisition system
125 enum {
126 kNDDL = 4, // Number of DDL (Detector Data Link) per sector
d0eb8f39 127 kNTRM = 12, // Number of TRM ( Readout Module) per DDL
128 kNTdc = 15, // Number of Tdc (Time to Digital Converter) per TRM
129 kNChain = 2, // Number of chains per TRM
43f77f2d 130 kNCh = 8 // Number of channels per Tdc
131 };
132
7e6dce66 133 static const Int_t fgkTimeDiff; // Min signal separation (ps)
134
0ef21f59 135 static const Float_t fgkZlenA; // length (cm) of the A module
136 static const Float_t fgkZlenB; // length (cm) of the B module
137 static const Float_t fgkZlenC; // length (cm) of the C module
138 static const Float_t fgkMaxhZtof; // Max half z-size of TOF (cm)
d3c7bfac 139
0ef21f59 140 static const Float_t fgkRmin; // Inner radius of the TOF (cm)
141 static const Float_t fgkRmax; // Outer radius of the TOF (cm)
142 static const Float_t fgkxTOF; // Inner TOF Radius used in Reconstruction (cm)
d3c7bfac 143
4402e7cb 144 static const Float_t fgkStripLength; // Strip Length (rho X phi direction) (cm)
145
d3c7bfac 146 static const Float_t fgkXPad; // Pad size in the x direction (cm)
147 static const Float_t fgkZPad; // Pad size in the z direction (cm)
58eb5b61 148
149 static const Float_t fgkSigmaForTail1;//Sig1 for simulation of TDC tails
150 static const Float_t fgkSigmaForTail2;//Sig2 for simulation of TDC tails
d3c7bfac 151
0ef21f59 152 static const Float_t fgkPhiSec; //sector Phi width (deg)
153
d3c7bfac 154 Bool_t fHoles; //logical for geometry version (w/wo holes)
155
0ef21f59 156 static const Float_t fgkAngles[kNPlates][kMaxNstrip]; //Strip Tilt Angles
157 static const Float_t fgkHeights[kNPlates][kMaxNstrip]; //Strip heights
158 static const Float_t fgkDistances[kNPlates][kMaxNstrip];//Strip distances
d3c7bfac 159
0f4a7374 160
48e6af28 161 static const Float_t fgkTdcBin; // time-of-flight bin width [ps]
162 static const Float_t fgkToTBin; // time-over-threshold bin width [ps]
43f77f2d 163
0ef21f59 164 ClassDef(AliTOFGeometry,5) // TOF Geometry base class
0f4a7374 165};
166
167#endif