]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFGeometry.h
software update to include time corrections during reconstruction.
[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;};
731afc39 29 static Int_t NStrip(Int_t nPlate);
4402e7cb 30 static Int_t NMaxNstrip() { return kMaxNstrip;};
74ea065c 31 static Int_t NpadX() { return kNpadX;};
32 static Int_t NpadZ() { return kNpadZ;};
7e6dce66 33 static Int_t NpadXStrip() { return kNpadX*kNpadZ;};
74ea065c 34 static Int_t NSectors() { return kNSectors;};
35 static Int_t NPlates() { return kNPlates;};
731afc39 36 static Int_t NStripXSector() { return (kNStripA + 2*kNStripB +
0ef21f59 37 2*kNStripC);};
731afc39 38 static Int_t NPadXSector() { return (kNStripA + 2*kNStripB +
0ef21f59 39 2*kNStripC)*kNpadX*kNpadZ;};
d3c7bfac 40
731afc39 41 static Float_t RinTOF() { return fgkxTOF;};
42 static Float_t Rmin() { return fgkRmin;};
43 static Float_t Rmax() { return fgkRmax;};
d3c7bfac 44
340693af 45 static Float_t XPad() { return fgkXPad;};
46 static Float_t ZPad() { return fgkZPad;};
d3c7bfac 47
4402e7cb 48 static Float_t StripLength() { return fgkStripLength;};
49
5ab3605a 50 static Float_t DeadTime() { return fgkDeadTime;};
51 static Float_t MatchingWindow() { return fgkMatchingWindow;};
52
74ea065c 53 static Int_t MaxTOFTree() { return kMaxTOFTree;};
0f4a7374 54
43f77f2d 55 static Int_t NDDL() { return kNDDL;};
56 static Int_t NTRM() { return kNTRM;}
57 static Int_t NTdc() { return kNTdc;};
d0eb8f39 58 static Int_t NChain() { return kNChain;};
43f77f2d 59 static Int_t NCh() { return kNCh;};
d0eb8f39 60 static Int_t NPadXTRM() { return kNCh*kNTdc*kNChain;};
43f77f2d 61
0ef21f59 62 static Float_t ZlenA() { return fgkZlenA;};
63 static Float_t ZlenB() { return fgkZlenB;};
64 static Float_t ZlenC() { return fgkZlenC;};
65 static Float_t MaxhZtof() { return fgkMaxhZtof;};
0f4a7374 66
67 static Float_t SigmaForTail1() { return fgkSigmaForTail1;};
68 static Float_t SigmaForTail2() { return fgkSigmaForTail2;};
0f4a7374 69
74ea065c 70 static Double_t GetAlpha() { return 2 * 3.14159265358979323846 / kNSectors; };
0f4a7374 71
43f77f2d 72 static Float_t TdcBinWidth() {return fgkTdcBin;};
48e6af28 73 static Float_t ToTBinWidth() {return fgkToTBin;};
2bf4d9d6 74 static Float_t BunchCrossingBinWidth() {return fgkBunchCrossingBin;};
0f4a7374 75
0ef21f59 76 virtual void ImportGeometry();
74ea065c 77 virtual void SetHoles(Bool_t holes) {fHoles = holes;};
78 virtual Bool_t GetHoles() const {return fHoles;};
baf89633 79 virtual Float_t DistanceToPadPar(Int_t *det, const Float_t * const pos, Float_t *dist3d=0) const;
80 virtual Bool_t IsInsideThePadPar(Int_t *det, const Float_t * const pos) const;
81 virtual Bool_t IsInsideThePad(TGeoHMatrix mat, const Float_t * const pos, Float_t *dist3d=0) const;
82 virtual void GetVolumePath(const Int_t * const ind, Char_t *path );
0ef21f59 83 virtual void GetVolumePath(Int_t sector, Char_t *path );
84 virtual void GetVolumePath(Int_t sector, Int_t plate, Int_t strip, Char_t *path );
85 virtual void GetPos(Int_t *det,Float_t *pos);
7aeeaf38 86 virtual void GetPosPar(Int_t *det,Float_t *pos) const;
87 virtual void GetDetID(Float_t *pos,Int_t *det) const;
baf89633 88 virtual Int_t GetPlate(const Float_t * const pos) const;
89 virtual Int_t GetStrip(const Float_t * const pos) const;
90 virtual Int_t GetSector(const Float_t * const pos) const;
91 virtual Int_t GetPadX(const Float_t * const pos) const;
92 virtual Int_t GetPadZ(const Float_t * const pos) const;
93 virtual Float_t GetX(const Int_t * const det) const ;
94 virtual Float_t GetY(const Int_t * const det) const ;
95 virtual Float_t GetZ(const Int_t * const det) const ;
48e6af28 96 virtual void DetToStripRF(Int_t nPadX, Int_t nPadZ,
97 Float_t &x, Float_t &z) const;
0ef21f59 98 virtual void DetToSectorRF(Int_t vol[5], Double_t ** coord);
baf89633 99 virtual Float_t GetPadDx(const Float_t * const pos);
100 virtual Float_t GetPadDy(const Float_t * const pos);
101 virtual Float_t GetPadDz(const Float_t * const pos);
0ef21f59 102 virtual void Translation(Float_t *xyz, Float_t translationVector[3]) const;
103 virtual void Rotation(Float_t *xyz, Double_t rotationAngles[6]) const;
104 virtual void InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const;
d3c7bfac 105
0ef21f59 106 static Float_t GetAngles(Int_t iplate, Int_t istrip) {return fgkAngles[iplate][istrip];};
107 static Float_t GetHeights(Int_t iplate, Int_t istrip) {return fgkHeights[iplate][istrip];};
108 static Float_t GetDistances(Int_t iplate, Int_t istrip) {return fgkDistances[iplate][istrip];};
d3c7bfac 109
baf89633 110 static Int_t GetIndex(const Int_t * const detId); // Get channel index from det Id (for calibration mainly)
731afc39 111 static void GetVolumeIndices(Int_t index, Int_t *detId); // Get volume index from channel index
0ef21f59 112
ff826920 113 UShort_t GetAliSensVolIndex(Int_t sec, Int_t pla, Int_t str) const; // Get the index of the TOF alignable volume in the AliGeomManager order
114 static Int_t GetStripNumber(Int_t isector, Int_t iplate, Int_t istrip); // Get the serial number of the TOF alignable volume, i.e. the TOF strip
115 static Int_t GetStripNumberPerSM(Int_t iplate, Int_t istrip); // Get the serial number of the TOF strip in a TOF SM
6819758a 116 void PadRF2TrackingRF(Float_t *ctrackPos, Float_t *differenceT);
ff826920 117
118
0ef21f59 119 private:
0f4a7374 120
58eb5b61 121 enum {
74ea065c 122 kNStripA = 15, // number of strips in A type module
123 kNStripB = 19, // number of strips in B type module
0ef21f59 124 kNStripC = 19, // number of strips in C type module
74ea065c 125 kNpadX = 48, // Number of pads along X
126 kNpadZ = 2, // Number of pads along Z
127 kNSectors = 18, // Number of Sectors
128 kNPlates = 5, // Number of Plates
4402e7cb 129 kMaxTOFTree = 5, // numer of geom. levels:
130 kMaxNstrip = 20 // Max. number of strips
58eb5b61 131 };
132
43f77f2d 133 // DAQ characteristics
134 // cfr. TOF-TDR pag. 105 for Glossary
135 // TARODA : TOF-ALICE Read Out and Data Acquisition system
136 enum {
137 kNDDL = 4, // Number of DDL (Detector Data Link) per sector
d0eb8f39 138 kNTRM = 12, // Number of TRM ( Readout Module) per DDL
139 kNTdc = 15, // Number of Tdc (Time to Digital Converter) per TRM
140 kNChain = 2, // Number of chains per TRM
43f77f2d 141 kNCh = 8 // Number of channels per Tdc
142 };
143
5ab3605a 144 static const Float_t fgkDeadTime; // Single channel dead time (ps)
145 static const Float_t fgkMatchingWindow; // Matching window (ps)
7e6dce66 146
0ef21f59 147 static const Float_t fgkZlenA; // length (cm) of the A module
148 static const Float_t fgkZlenB; // length (cm) of the B module
149 static const Float_t fgkZlenC; // length (cm) of the C module
150 static const Float_t fgkMaxhZtof; // Max half z-size of TOF (cm)
d3c7bfac 151
0ef21f59 152 static const Float_t fgkRmin; // Inner radius of the TOF (cm)
153 static const Float_t fgkRmax; // Outer radius of the TOF (cm)
154 static const Float_t fgkxTOF; // Inner TOF Radius used in Reconstruction (cm)
d3c7bfac 155
4402e7cb 156 static const Float_t fgkStripLength; // Strip Length (rho X phi direction) (cm)
157
d3c7bfac 158 static const Float_t fgkXPad; // Pad size in the x direction (cm)
159 static const Float_t fgkZPad; // Pad size in the z direction (cm)
58eb5b61 160
161 static const Float_t fgkSigmaForTail1;//Sig1 for simulation of TDC tails
162 static const Float_t fgkSigmaForTail2;//Sig2 for simulation of TDC tails
d3c7bfac 163
0ef21f59 164 static const Float_t fgkPhiSec; //sector Phi width (deg)
165
d3c7bfac 166 Bool_t fHoles; //logical for geometry version (w/wo holes)
167
0ef21f59 168 static const Float_t fgkAngles[kNPlates][kMaxNstrip]; //Strip Tilt Angles
169 static const Float_t fgkHeights[kNPlates][kMaxNstrip]; //Strip heights
170 static const Float_t fgkDistances[kNPlates][kMaxNstrip];//Strip distances
d3c7bfac 171
0f4a7374 172
48e6af28 173 static const Float_t fgkTdcBin; // time-of-flight bin width [ps]
174 static const Float_t fgkToTBin; // time-over-threshold bin width [ps]
2bf4d9d6 175 static const Float_t fgkBunchCrossingBin; // bunch-crossing bin width [ps]
43f77f2d 176
6819758a 177 ClassDef(AliTOFGeometry,8) // TOF Geometry base class
0f4a7374 178};
179
180#endif