]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/src/AliL3Transform.h
Adding protected copy constructor and assignment operator
[u/mrichter/AliRoot.git] / HLT / src / AliL3Transform.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
108615fc 3#ifndef ALIL3TRANSFORM_H
4#define ALIL3TRANSFORM_H
5
44b24f7c 6#ifdef use_aliroot
7 class AliRunLoader;
8#endif
9
108615fc 10#include "AliL3RootTypes.h"
108615fc 11
12class AliL3Transform {
494fad94 13
3e87ef69 14 public:
b1ed0288 15 enum VersionType { kVdefault=0, kVdeprecated=1, kValiroot=10, kVcosmics=100};
3e87ef69 16
108615fc 17 private:
b1ed0288 18 static const Double_t fgkBFACT; //bfield
19 static const Double_t fgkPi; //pi
20 static const Double_t fgkPi2; //2pi
21 static const Double_t fgk2Pi; //pi/2
22 static const Double_t fgkAnodeWireSpacing; //anode wire spacing
23 static const Double_t fgkToDeg; //rad to deg
3e87ef69 24
b1ed0288 25 static Int_t fgNPatches; //6 (dont change this)
26 static Int_t fgRows[6][2]; //rows per patch
27 static Int_t fgNRows[6]; //rows per patch
3e87ef69 28
b1ed0288 29 static Double_t fgBField; //field
30 static Double_t fgBFieldFactor; //field
31 static Double_t fgSolenoidBField; //field
32 static Int_t fgNTimeBins; //ntimebins
33 static Int_t fgNRowLow; //nrows
34 static Int_t fgNRowUp; //nrows
35 static Int_t fgNRowUp1; //nrows
36 static Int_t fgNRowUp2; //nrows
37 static Int_t fgNSectorLow; //nsector
38 static Int_t fgNSectorUp; //nsector
39 static Int_t fgSlice2Sector[36][2]; //nslice
40 static Int_t fgSector2Slice[72]; //nslice
41 static Int_t fgSectorLow[72]; //nsector
42 static Double_t fgPadPitchWidthLow; //pad pitch
43 static Double_t fgPadPitchWidthUp; //pad pitch
44 static Double_t fgZWidth; //width
45 static Double_t fgZSigma; //sigma
46 static Double_t fgZLength; //length
47 static Double_t fgZOffset; //offset
48 static Int_t fgNSector; //72 (dont change this)
49 static Int_t fgNSlice; //36 (dont change this)
50 static Int_t fgNRow; //159 (dont change this)
51 static Double_t fgNRotShift; //Rotation shift (eg. 0.5 for 10 degrees)
52 static Int_t fgNPads[159]; //fill this following Init and fVersion
53 static Double_t fgX[159]; //X position in local coordinates
54 static Int_t fgVersion; //flags the version
55 static Double_t fgDiffT; //Transversal diffusion constant
56 static Double_t fgDiffL; //Longitudinal diffusion constant
57 static Double_t fgOmegaTau; //ExB effects
58 static Double_t fgInnerPadLength; //innner pad length
59 static Double_t fgOuter1PadLength; //outer pad length
60 static Double_t fgOuter2PadLength; //outer pad length
61 static Double_t fgInnerPRFSigma; //inner pad response function
62 static Double_t fgOuter1PRFSigma; //outer pad response function
63 static Double_t fgOuter2PRFSigma; //outer pad response function
64 static Double_t fgTimeSigma; //Minimal longitudinal width
65 static Int_t fgADCSat; //ADC Saturation (1024 = 10 bit)
66 static Int_t fgZeroSup; //Zero suppression threshold
67 static Double_t fgCos[36]; //stores the cos value for local to global rotations
68 static Double_t fgSin[36]; //stores the sin value for local to global rotations
af99f571 69
3e87ef69 70 public:
5929c18d 71 virtual ~AliL3Transform() {}
cefeb80d 72#ifdef use_aliroot
73 static Bool_t Init(AliRunLoader *runLoader); //init transformer params using a run loader
74#endif
3e87ef69 75 static Bool_t Init(Char_t* path,Bool_t UseAliTPCParam=kFALSE); //init transformer settings (versions)
02f030e3 76 static Bool_t MakeInitFile(Char_t *rootfilename,Char_t *filename); //create the init file from rootfile
77 static Bool_t ReadInit(Char_t *path); //read init (possibly from root file)
78 static Bool_t ReadInitFile(Char_t *path); //read init from text file
79 static Bool_t SaveInitFile(Char_t *filename); //save parameters in init file
2220326f 80
3e87ef69 81 //setters
b1ed0288 82 static void SetNPatches(Int_t i){fgNPatches = i;}
83 static void SetNRows(Int_t s[6]){for(Int_t i=0;i<fgNPatches;i++) fgNRows[i] = s[i];}
3e87ef69 84 static void SetRows(Int_t s[6][2]){
b1ed0288 85 for(Int_t i=0;i<fgNPatches;i++){
86 fgRows[i][0] = s[i][0];
87 fgRows[i][1] = s[i][1];
3e87ef69 88 }
89 }
b1ed0288 90 static void SetBField(Double_t f) {fgBField = f;} //careful, these 3 are not independent!
91 static void SetBFieldFactor(Double_t f) {
92 fgBFieldFactor = f;
93 fgBField=fgBFieldFactor*fgSolenoidBField*0.1;
94 }
95 static void SetSolenoidBField(Double_t f){
96 fgSolenoidBField = f;
97 fgBField=fgBFieldFactor*fgSolenoidBField*0.1;
98 }
99 static void SetNTimeBins(Int_t i){fgNTimeBins = i;}
100 static void SetNRowLow(Int_t i){fgNRowLow = i;}
101 static void SetNRowUp(Int_t i){fgNRowUp = i;}
102 static void SetNRowUp1(Int_t i){fgNRowUp1 = i;}
103 static void SetNRowUp2(Int_t i){fgNRowUp2 = i;}
3e87ef69 104 static void SetSlice2Sector(Int_t s[36][2]){
b1ed0288 105 for(Int_t i=0;i<fgNSlice;i++){
106 fgSlice2Sector[i][0] = s[i][0];
107 fgSlice2Sector[i][1] = s[i][1];
3e87ef69 108 }
109 }
b1ed0288 110 static void SetSector2Slice(Int_t s[72]){
111 for(Int_t i=0;i<fgNSector;i++) fgSector2Slice[i] = s[i];}
112 static void SetSectorLow(Int_t s[72]){
113 for(Int_t i=0;i<fgNSector;i++) fgSectorLow[i] = s[i];}
114 static void SetNSectorLow(Int_t i){fgNSectorLow = i;}
115 static void SetNSectorUp(Int_t i){fgNSectorUp = i;}
116 static void SetPadPitchWidthLow(Double_t f){fgPadPitchWidthLow = f;}
117 static void SetPadPitchWidthUp(Double_t f){fgPadPitchWidthUp = f;}
118 static void SetZWidth(Double_t f){fgZWidth = f;}
119 static void SetZSigma(Double_t f){fgZSigma = f;}
120 static void SetZLength(Double_t f){fgZLength = f;}
121 static void SetZOffset(Double_t f){fgZOffset = f;}
122 static void SetNSector(Int_t i){fgNSector = i;}
123 static void SetNSlice(Int_t i){fgNSlice = i;}
124 static void SetNRow(Int_t i){fgNRow = i;}
125 static void SetNRotShift(Double_t f){fgNRotShift = f;}
126 static void SetNPads(Int_t pads[159]){
127 for(Int_t i=0;i<fgNRow;i++) fgNPads[i] = pads[i];}
128 static void SetX(Double_t xs[159]){
129 for(Int_t i=0;i<fgNRow;i++) fgX[i] = xs[i];}
130 static void SetVersion(Int_t i){fgVersion = i;}
131 static void SetDiffT(Double_t f){fgDiffT = f;}
132 static void SetDiffL(Double_t f){fgDiffL = f;}
133 static void SetOmegaTau(Double_t f){fgOmegaTau = f;}
134 static void SetInnerPadLength(Double_t f){fgInnerPadLength = f;}
135 static void SetOuter1PadLength(Double_t f){fgOuter1PadLength = f;}
136 static void SetOuter2PadLength(Double_t f){fgOuter2PadLength = f;}
137 static void SetInnerPRFSigma(Double_t f){fgInnerPRFSigma = f;}
138 static void SetOuter1PRFSigma(Double_t f){fgOuter1PRFSigma = f;}
139 static void SetOuter2PRFSigma(Double_t f){fgOuter2PRFSigma = f;}
140 static void SetTimeSigma(Double_t f){fgTimeSigma = f;}
141 static void SetADCSat(Int_t i) {fgADCSat = i;}
142 static void SetZeroSup(Int_t i) {fgZeroSup = i;}
af99f571 143
3e87ef69 144 //getters
5e0f9911 145 static const Char_t* GetParamName() {return "75x40_100x60_150x60";}
17323043 146 static Double_t Pi() {return fgkPi;}
147 static Double_t PiHalf() {return fgkPi2;}
148 static Double_t TwoPi() {return fgk2Pi;}
149 static Double_t GetAnodeWireSpacing() {return fgkAnodeWireSpacing;}
150 static Double_t GetBFact() {return fgkBFACT;}
151 static Double_t ToRad() {return 1./fgkToDeg;}
152 static Double_t ToDeg() {return fgkToDeg;}
5e0f9911 153
e376e129 154 static Int_t GetFirstRow(Int_t patch);
155 static Int_t GetLastRow(Int_t patch);
a8ffd46b 156 static Int_t GetFirstRowOnDDL(Int_t patch);
157 static Int_t GetLastRowOnDDL(Int_t patch);
e376e129 158 static Int_t GetNRows(Int_t patch);
3e87ef69 159 static Int_t GetPatch(Int_t padrow);
b1ed0288 160 static Int_t GetNRows() {return fgNRow;}
161 static Int_t GetNRowLow() {return fgNRowLow;}
162 static Int_t GetNRowUp1() {return fgNRowUp1;}
163 static Int_t GetNRowUp2() {return fgNRowUp2;}
3e87ef69 164 static Int_t GetPadRow(Float_t x);
b1ed0288 165 static Int_t GetNPatches() {return fgNPatches;}
3e87ef69 166 static Int_t GetNPads(Int_t row);
b1ed0288 167 static Int_t GetNTimeBins(){return fgNTimeBins;}
168 static Double_t GetBField() {return fgBField;}
169 static Double_t GetSolenoidField() {return fgSolenoidBField;}
170 static Double_t GetBFactFactor() {return fgBFieldFactor;}
171 static Double_t GetBFieldValue() {return (fgBField*fgkBFACT);}
172 static Float_t Deg2Rad(Float_t angle) {return angle/fgkToDeg;}
173 static Float_t Rad2Deg(Float_t angle) {return angle*fgkToDeg;}
174 static Int_t GetVersion(){return fgVersion;}
175 static Double_t GetPadPitchWidthLow() {return fgPadPitchWidthLow;}
176 static Double_t GetPadPitchWidthUp() {return fgPadPitchWidthUp;}
3e87ef69 177 static Double_t GetPadPitchWidth(Int_t patch);
b1ed0288 178 static Double_t GetZWidth() {return fgZWidth;}
179 static Double_t GetZLength() {return fgZLength;}
180 static Double_t GetZOffset() {return fgZOffset;}
181 static Double_t GetDiffT() {return fgDiffT;}
182 static Double_t GetDiffL() {return fgDiffL;}
3e87ef69 183 static Double_t GetParSigmaY2(Int_t padrow,Float_t z,Float_t angle);
184 static Double_t GetParSigmaZ2(Int_t padrow,Float_t z,Float_t tgl);
b1ed0288 185 static Double_t GetOmegaTau() {return fgOmegaTau;}
5923e698 186 static Double_t GetPadLength(Int_t padrow);
187 static Double_t GetPRFSigma(Int_t padrow);
b1ed0288 188 static Double_t GetTimeSigma() {return fgTimeSigma;}
189 static Double_t GetZSigma() {return fgZSigma;}
190 static Int_t GetADCSat() {return fgADCSat;}
191 static Int_t GetZeroSup() {return fgZeroSup;}
192 static Int_t GetNSlice() {return fgNSlice;}
193 static Int_t GetNSector() {return fgNSector;}
194 static Int_t GetNSectorLow() {return fgNSectorLow;}
195 static Int_t GetNSectorUp() {return fgNSectorUp;}
95a00d93 196
494fad94 197 static Bool_t Slice2Sector(Int_t slice, Int_t slicerow, Int_t &sector, Int_t &row);
198 static Bool_t Sector2Slice(Int_t &slice, Int_t sector);
199 static Bool_t Sector2Slice(Int_t &slice, Int_t &slicerow, Int_t sector, Int_t row);
1727f1c9 200
494fad94 201 static Double_t Row2X(Int_t slicerow);
202 static Double_t GetMaxY(Int_t slicerow);
203 static Double_t GetEta(Float_t *xyz);
3ac82106 204 static Double_t GetEta(Int_t slice,Int_t padrow, Int_t pad, Int_t time);
494fad94 205 static Double_t GetPhi(Float_t *xyz);
5a31e9df 206 static Double_t GetZFast(Int_t slice, Int_t time, Float_t vertex=0.);
1727f1c9 207
494fad94 208 static void XYZtoRPhiEta(Float_t *rpe, Float_t *xyz);
209 static void Local2Global(Float_t *xyz, Int_t slice);
210 static void Local2GlobalAngle(Float_t *angle, Int_t slice);
211 static void Global2LocalAngle(Float_t *angle, Int_t slice);
108615fc 212
5a31e9df 213 //we have 3 different system: Raw : row, pad, time
214 // Local : x,y and global z
215 // Global: global x,y and global z
216 //the methods with HLT in the name differ from the other
217 //as you specify slice and slicerow, instead of sector
218 //and sector row. In that way we safe "a few ifs"
494fad94 219 static void Raw2Local(Float_t *xyz, Int_t sector, Int_t row, Float_t pad, Float_t time);
5a31e9df 220 static void RawHLT2Local(Float_t *xyz,Int_t slice,Int_t slicerow,Float_t pad,Float_t time);
221 static void Raw2Local(Float_t *xyz, Int_t sector, Int_t row, Int_t pad, Int_t time);
222 static void RawHLT2Local(Float_t *xyz,Int_t slice,Int_t slicerow,Int_t pad,Int_t time);
494fad94 223 static void Local2Global(Float_t *xyz, Int_t sector, Int_t row);
5a31e9df 224 static void LocHLT2Global(Float_t *xyz, Int_t slice, Int_t slicerow);
225 static void Global2Local(Float_t *xyz, Int_t sector);
226 static void Global2LocHLT(Float_t *xyz, Int_t slice);
494fad94 227 static void Raw2Global(Float_t *xyz, Int_t sector, Int_t row, Float_t pad, Float_t time);
5a31e9df 228 static void RawHLT2Global(Float_t *xyz, Int_t slice,
229 Int_t slicerow, Float_t pad, Float_t time);
230 static void Raw2Global(Float_t *xyz, Int_t sector, Int_t row, Int_t pad, Int_t time);
231 static void RawHLT2Global(Float_t *xyz, Int_t slice,
232 Int_t slicerow, Int_t pad, Int_t time);
494fad94 233 static void Local2Raw(Float_t *xyz, Int_t sector, Int_t row);
5a31e9df 234 static void LocHLT2Raw(Float_t *xyz, Int_t slice, Int_t slicerow);
494fad94 235 static void Global2Raw(Float_t *xyz, Int_t sector, Int_t row);
5a31e9df 236 static void Global2HLT(Float_t *xyz, Int_t slice, Int_t slicerow);
3e87ef69 237
238 static void PrintCompileOptions();
108615fc 239
4499ed26 240 ClassDef(AliL3Transform,1)
108615fc 241};
108615fc 242#endif