SDD ADC vs. drift time correction parameters for MC
[u/mrichter/AliRoot.git] / ITS / ITSbase / AliITSresponseSDD.cxx
CommitLineData
b0f5e3fc 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2aea926d 3 * *
b0f5e3fc 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 **************************************************************************/
b9d0a01d 15
090026bf 16/* $Id$ */
17
fcf95fc7 18//////////////////////////////////////////////////////
19// Base response class forITS //
20// It is used to set static data members //
21// connected to parameters equal for all //
22// the modules //
703a4e51 23// //
24// //
25//////////////////////////////////////////////////////
50d05d7b 26
090026bf 27#include <TMath.h>
28
29#include "AliITSresponseSDD.h"
3176641e 30#include <AliITSgeomTGeo.h>
fcf95fc7 31
10add0d4 32const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.30;
d644eb2d 33const Float_t AliITSresponseSDD::fgkADC2keVDefault = 3.34;
34const Float_t AliITSresponseSDD::fgkChargevsTimeDefault = 0.00355;
374200ee 35const Float_t AliITSresponseSDD::fgkADCvsDrTimeDefault = 0.0101;
de075dae 36const Float_t AliITSresponseSDD::fgkCarlosRXClockPeriod = 25.;
48058160 37ClassImp(AliITSresponseSDD)
50d05d7b 38
fcf95fc7 39//_________________________________________________________________________
4bfbde86 40AliITSresponseSDD::AliITSresponseSDD():
253e68a0 41TObject(),
e71a6286 42 fTimeOffset(fgkTimeOffsetDefault),
43 fADC2keV(fgkADC2keVDefault),
374200ee 44 fChargevsTime(fgkChargevsTimeDefault)
45{
50d05d7b 46 // default constructor
3176641e 47 for(Int_t i=0; i<kNSDDmods;i++){
48 fTimeZero[i]=fgkTimeOffsetDefault;
e71a6286 49 fDeltaVDrift[i] = fDeltaVDrift[i+kNSDDmods] = 0.;
57019696 50 fADCtokeV[i]=fgkADC2keVDefault;
374200ee 51 fADCvsDriftTime[i]=fgkADCvsDrTimeDefault;
7bba0484 52 fADCvsDriftTimeMC[i]=fgkADCvsDrTimeDefault;
3176641e 53 }
7bba0484 54 SetMCDefaults();
e71a6286 55 SetVDCorr2Side(kTRUE); // default for new objects will be separate corrections for 2 sides (bwd compatible)
ef24eb3b 56 // SetVDCorrMult(kTRUE); // default for new objects will have multiplicative correction v'=(1+corr)*v (bwd compatible)
3176641e 57}
58//_________________________________________________________________________
7bba0484 59void AliITSresponseSDD::SetMCDefaults(){
60 // SetMC defaults -> calibrated on LHC14jd4 (R. Russo, 16-Jan-15)
61 fADCvsDriftTimeMC[1]=0.008384;
62 fADCvsDriftTimeMC[2]=0.008747;
63 fADCvsDriftTimeMC[3]=0.007127;
64 fADCvsDriftTimeMC[4]=0.008040;
65 fADCvsDriftTimeMC[5]=0.007344;
66 fADCvsDriftTimeMC[6]=0.010241;
67 fADCvsDriftTimeMC[7]=0.007235;
68 fADCvsDriftTimeMC[8]=0.006573;
69 fADCvsDriftTimeMC[9]=0.005941;
70 fADCvsDriftTimeMC[10]=0.007528;
71 fADCvsDriftTimeMC[11]=0.008039;
72 fADCvsDriftTimeMC[12]=0.007193;
73 fADCvsDriftTimeMC[13]=0.008126;
74 fADCvsDriftTimeMC[14]=0.010100;
75 fADCvsDriftTimeMC[15]=0.008038;
76 fADCvsDriftTimeMC[16]=0.008456;
77 fADCvsDriftTimeMC[17]=0.007424;
78 fADCvsDriftTimeMC[18]=0.010100;
79 fADCvsDriftTimeMC[19]=0.010100;
80 fADCvsDriftTimeMC[20]=0.010100;
81 fADCvsDriftTimeMC[21]=0.007915;
82 fADCvsDriftTimeMC[22]=0.007949;
83 fADCvsDriftTimeMC[23]=0.006127;
84 fADCvsDriftTimeMC[24]=0.007887;
85 fADCvsDriftTimeMC[25]=0.008140;
86 fADCvsDriftTimeMC[26]=0.006520;
87 fADCvsDriftTimeMC[27]=0.007024;
88 fADCvsDriftTimeMC[28]=0.007271;
89 fADCvsDriftTimeMC[29]=0.007348;
90 fADCvsDriftTimeMC[30]=0.007820;
91 fADCvsDriftTimeMC[31]=0.007544;
92 fADCvsDriftTimeMC[32]=0.004143;
93 fADCvsDriftTimeMC[33]=0.007644;
94 fADCvsDriftTimeMC[34]=0.007170;
95 fADCvsDriftTimeMC[35]=0.006653;
96 fADCvsDriftTimeMC[36]=0.008632;
97 fADCvsDriftTimeMC[37]=0.007728;
98 fADCvsDriftTimeMC[38]=0.008096;
99 fADCvsDriftTimeMC[39]=0.010100;
100 fADCvsDriftTimeMC[40]=0.010100;
101 fADCvsDriftTimeMC[41]=0.010100;
102 fADCvsDriftTimeMC[42]=0.007480;
103 fADCvsDriftTimeMC[43]=0.007949;
104 fADCvsDriftTimeMC[44]=0.007662;
105 fADCvsDriftTimeMC[45]=0.007848;
106 fADCvsDriftTimeMC[46]=0.006875;
107 fADCvsDriftTimeMC[47]=0.007592;
108 fADCvsDriftTimeMC[48]=0.007716;
109 fADCvsDriftTimeMC[49]=0.007461;
110 fADCvsDriftTimeMC[50]=0.007555;
111 fADCvsDriftTimeMC[51]=0.007551;
112 fADCvsDriftTimeMC[52]=0.008068;
113 fADCvsDriftTimeMC[53]=0.008595;
114 fADCvsDriftTimeMC[54]=0.006893;
115 fADCvsDriftTimeMC[55]=0.007608;
116 fADCvsDriftTimeMC[56]=0.007715;
117 fADCvsDriftTimeMC[57]=0.007554;
118 fADCvsDriftTimeMC[58]=0.007716;
119 fADCvsDriftTimeMC[59]=0.006613;
120 fADCvsDriftTimeMC[60]=0.008064;
121 fADCvsDriftTimeMC[61]=0.006857;
122 fADCvsDriftTimeMC[62]=0.007170;
123 fADCvsDriftTimeMC[63]=0.006693;
124 fADCvsDriftTimeMC[64]=0.006828;
125 fADCvsDriftTimeMC[65]=0.006384;
126 fADCvsDriftTimeMC[66]=0.006835;
127 fADCvsDriftTimeMC[67]=0.007131;
128 fADCvsDriftTimeMC[68]=0.008520;
129 fADCvsDriftTimeMC[69]=0.007338;
130 fADCvsDriftTimeMC[70]=0.008039;
131 fADCvsDriftTimeMC[71]=0.005399;
132 fADCvsDriftTimeMC[72]=0.007444;
133 fADCvsDriftTimeMC[73]=0.007333;
134 fADCvsDriftTimeMC[74]=0.007522;
135 fADCvsDriftTimeMC[75]=0.007645;
136 fADCvsDriftTimeMC[76]=0.008382;
137 fADCvsDriftTimeMC[77]=0.010100;
138 fADCvsDriftTimeMC[78]=0.005804;
139 fADCvsDriftTimeMC[79]=0.007902;
140 fADCvsDriftTimeMC[80]=0.007034;
141 fADCvsDriftTimeMC[81]=0.008094;
142 fADCvsDriftTimeMC[82]=0.007014;
143 fADCvsDriftTimeMC[83]=0.007301;
144 fADCvsDriftTimeMC[84]=0.010100;
145 fADCvsDriftTimeMC[85]=0.007371;
146 fADCvsDriftTimeMC[86]=0.005768;
147 fADCvsDriftTimeMC[87]=0.007079;
148 fADCvsDriftTimeMC[88]=0.009297;
149 fADCvsDriftTimeMC[89]=0.008228;
150 fADCvsDriftTimeMC[90]=0.007923;
151 fADCvsDriftTimeMC[91]=0.005789;
152 fADCvsDriftTimeMC[92]=0.005612;
153 fADCvsDriftTimeMC[93]=0.007189;
154 fADCvsDriftTimeMC[94]=0.007237;
155 fADCvsDriftTimeMC[95]=0.007478;
156 fADCvsDriftTimeMC[96]=0.006879;
157 fADCvsDriftTimeMC[97]=0.007035;
158 fADCvsDriftTimeMC[98]=0.006412;
159 fADCvsDriftTimeMC[99]=0.006723;
160 fADCvsDriftTimeMC[100]=0.006292;
161 fADCvsDriftTimeMC[101]=0.007809;
162 fADCvsDriftTimeMC[102]=0.008281;
163 fADCvsDriftTimeMC[103]=0.010100;
164 fADCvsDriftTimeMC[104]=0.007527;
165 fADCvsDriftTimeMC[105]=0.010100;
166 fADCvsDriftTimeMC[106]=0.007810;
167 fADCvsDriftTimeMC[107]=0.007578;
168 fADCvsDriftTimeMC[108]=0.010100;
169 fADCvsDriftTimeMC[109]=0.009124;
170 fADCvsDriftTimeMC[110]=0.006268;
171 fADCvsDriftTimeMC[111]=0.005359;
172 fADCvsDriftTimeMC[112]=0.007384;
173 fADCvsDriftTimeMC[113]=0.007310;
174 fADCvsDriftTimeMC[114]=0.008525;
175 fADCvsDriftTimeMC[115]=0.010100;
176 fADCvsDriftTimeMC[116]=0.006898;
177 fADCvsDriftTimeMC[117]=0.007718;
178 fADCvsDriftTimeMC[118]=0.007631;
179 fADCvsDriftTimeMC[119]=0.006599;
180 fADCvsDriftTimeMC[120]=0.006054;
181 fADCvsDriftTimeMC[121]=0.007661;
182 fADCvsDriftTimeMC[122]=0.008095;
183 fADCvsDriftTimeMC[123]=0.007686;
184 fADCvsDriftTimeMC[124]=0.007319;
185 fADCvsDriftTimeMC[125]=0.008086;
186 fADCvsDriftTimeMC[126]=0.004947;
187 fADCvsDriftTimeMC[127]=0.008500;
188 fADCvsDriftTimeMC[128]=0.007279;
189 fADCvsDriftTimeMC[129]=0.007272;
190 fADCvsDriftTimeMC[130]=0.007216;
191 fADCvsDriftTimeMC[131]=0.005968;
192 fADCvsDriftTimeMC[132]=0.005603;
193 fADCvsDriftTimeMC[133]=0.007193;
194 fADCvsDriftTimeMC[134]=0.007272;
195 fADCvsDriftTimeMC[135]=0.007144;
196 fADCvsDriftTimeMC[136]=0.005582;
197 fADCvsDriftTimeMC[137]=0.007927;
198 fADCvsDriftTimeMC[138]=0.007598;
199 fADCvsDriftTimeMC[139]=0.006109;
200 fADCvsDriftTimeMC[140]=0.005826;
201 fADCvsDriftTimeMC[141]=0.007517;
202 fADCvsDriftTimeMC[142]=0.007181;
203 fADCvsDriftTimeMC[143]=0.006917;
204 fADCvsDriftTimeMC[144]=0.006550;
205 fADCvsDriftTimeMC[145]=0.008342;
206 fADCvsDriftTimeMC[146]=0.007485;
207 fADCvsDriftTimeMC[147]=0.008732;
208 fADCvsDriftTimeMC[148]=0.007370;
209 fADCvsDriftTimeMC[149]=0.006544;
210 fADCvsDriftTimeMC[150]=0.007054;
211 fADCvsDriftTimeMC[151]=0.010100;
212 fADCvsDriftTimeMC[152]=0.007192;
213 fADCvsDriftTimeMC[153]=0.007222;
214 fADCvsDriftTimeMC[154]=0.006940;
215 fADCvsDriftTimeMC[155]=0.007468;
216 fADCvsDriftTimeMC[156]=0.007776;
217 fADCvsDriftTimeMC[157]=0.007824;
218 fADCvsDriftTimeMC[158]=0.008047;
219 fADCvsDriftTimeMC[159]=0.006877;
220 fADCvsDriftTimeMC[160]=0.006306;
221 fADCvsDriftTimeMC[161]=0.006674;
222 fADCvsDriftTimeMC[162]=0.007904;
223 fADCvsDriftTimeMC[163]=0.005996;
224 fADCvsDriftTimeMC[164]=0.009781;
225 fADCvsDriftTimeMC[165]=0.006822;
226 fADCvsDriftTimeMC[166]=0.010100;
227 fADCvsDriftTimeMC[167]=0.006567;
228 fADCvsDriftTimeMC[168]=0.007594;
229 fADCvsDriftTimeMC[169]=0.006436;
230 fADCvsDriftTimeMC[170]=0.010100;
231 fADCvsDriftTimeMC[171]=0.006541;
232 fADCvsDriftTimeMC[172]=0.010100;
233 fADCvsDriftTimeMC[173]=0.005869;
234 fADCvsDriftTimeMC[174]=0.006169;
235 fADCvsDriftTimeMC[175]=0.007122;
236 fADCvsDriftTimeMC[176]=0.005458;
237 fADCvsDriftTimeMC[177]=0.006642;
238 fADCvsDriftTimeMC[178]=0.008467;
239 fADCvsDriftTimeMC[179]=0.007741;
240 fADCvsDriftTimeMC[180]=0.008877;
241 fADCvsDriftTimeMC[181]=0.007502;
242 fADCvsDriftTimeMC[182]=0.007330;
243 fADCvsDriftTimeMC[183]=0.006217;
244 fADCvsDriftTimeMC[184]=0.007978;
245 fADCvsDriftTimeMC[185]=0.007441;
246 fADCvsDriftTimeMC[186]=0.007820;
247 fADCvsDriftTimeMC[187]=0.007762;
248 fADCvsDriftTimeMC[188]=0.007411;
249 fADCvsDriftTimeMC[189]=0.007028;
250 fADCvsDriftTimeMC[190]=0.008228;
251 fADCvsDriftTimeMC[191]=0.006653;
252 fADCvsDriftTimeMC[192]=0.007009;
253 fADCvsDriftTimeMC[193]=0.005980;
254 fADCvsDriftTimeMC[194]=0.006573;
255 fADCvsDriftTimeMC[195]=0.010100;
256 fADCvsDriftTimeMC[196]=0.007062;
257 fADCvsDriftTimeMC[197]=0.007691;
258 fADCvsDriftTimeMC[198]=0.008381;
259 fADCvsDriftTimeMC[199]=0.007031;
260 fADCvsDriftTimeMC[200]=0.007874;
261 fADCvsDriftTimeMC[201]=0.011088;
262 fADCvsDriftTimeMC[202]=0.007996;
263 fADCvsDriftTimeMC[203]=0.007077;
264 fADCvsDriftTimeMC[204]=0.008236;
265 fADCvsDriftTimeMC[205]=0.008347;
266 fADCvsDriftTimeMC[206]=0.008797;
267 fADCvsDriftTimeMC[207]=0.005973;
268 fADCvsDriftTimeMC[208]=0.007560;
269 fADCvsDriftTimeMC[209]=0.007505;
270 fADCvsDriftTimeMC[210]=0.007965;
271 fADCvsDriftTimeMC[211]=0.007379;
272 fADCvsDriftTimeMC[212]=0.007974;
273 fADCvsDriftTimeMC[213]=0.006762;
274 fADCvsDriftTimeMC[214]=0.010100;
275 fADCvsDriftTimeMC[215]=0.007151;
276 fADCvsDriftTimeMC[216]=0.005802;
277 fADCvsDriftTimeMC[217]=0.006873;
278 fADCvsDriftTimeMC[218]=0.007286;
279 fADCvsDriftTimeMC[219]=0.006774;
280 fADCvsDriftTimeMC[220]=0.007708;
281 fADCvsDriftTimeMC[221]=0.007048;
282 fADCvsDriftTimeMC[222]=0.004330;
283 fADCvsDriftTimeMC[223]=0.010100;
284 fADCvsDriftTimeMC[224]=0.007970;
285 fADCvsDriftTimeMC[225]=0.010100;
286 fADCvsDriftTimeMC[226]=0.008034;
287 fADCvsDriftTimeMC[227]=0.006442;
288 fADCvsDriftTimeMC[228]=0.007122;
289 fADCvsDriftTimeMC[229]=0.007737;
290 fADCvsDriftTimeMC[230]=0.007755;
291 fADCvsDriftTimeMC[231]=0.007995;
292 fADCvsDriftTimeMC[232]=0.006997;
293 fADCvsDriftTimeMC[233]=0.008777;
294 fADCvsDriftTimeMC[234]=0.010994;
295 fADCvsDriftTimeMC[235]=0.005986;
296 fADCvsDriftTimeMC[236]=0.007349;
297 fADCvsDriftTimeMC[237]=0.008129;
298 fADCvsDriftTimeMC[238]=0.005306;
299 fADCvsDriftTimeMC[239]=0.008648;
300 fADCvsDriftTimeMC[240]=0.007879;
301 fADCvsDriftTimeMC[241]=0.007558;
302 fADCvsDriftTimeMC[242]=0.007368;
303 fADCvsDriftTimeMC[243]=0.010837;
304 fADCvsDriftTimeMC[244]=0.006780;
305 fADCvsDriftTimeMC[245]=0.005178;
306 fADCvsDriftTimeMC[246]=0.010100;
307 fADCvsDriftTimeMC[247]=0.007705;
308 fADCvsDriftTimeMC[248]=0.008350;
309 fADCvsDriftTimeMC[249]=0.008654;
310 fADCvsDriftTimeMC[250]=0.007147;
311 fADCvsDriftTimeMC[251]=0.008399;
312 fADCvsDriftTimeMC[252]=0.010100;
313 fADCvsDriftTimeMC[253]=0.007036;
314 fADCvsDriftTimeMC[254]=0.007749;
315 fADCvsDriftTimeMC[255]=0.009103;
316 fADCvsDriftTimeMC[256]=0.007138;
317 fADCvsDriftTimeMC[257]=0.006691;
318 fADCvsDriftTimeMC[258]=0.006366;
319 fADCvsDriftTimeMC[259]=0.006701;
320}
321//_________________________________________________________________________
3176641e 322void AliITSresponseSDD::SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero){
323 // Sets time Zero for all modules of a ladder on side A (Z>0)
324 Int_t minMod,maxMod;
325 if(lay==3){
326 minMod=1;
327 maxMod=3;
328 if(lad>kNLaddersLay3){
329 AliError(Form("Ladder number %d out of range",lad));
330 return;
331 }
332 }else if(lay==4){
333 minMod=1;
334 maxMod=4;
335 if(lad>kNLaddersLay4){
336 AliError(Form("Ladder number %d out of range",lad));
337 return;
338 }
339 }else{
340 AliError(Form("Layer number %d out of range",lay));
341 return;
342 }
343 for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
344 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
345 SetModuleTimeZero(modIndex,tzero);
346 }
347}
348//_________________________________________________________________________
349void AliITSresponseSDD::SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero){
350 // Sets time Zero for all modules of a ladder on side C (Z<0)
351 Int_t minMod,maxMod;
352 if(lay==3){
353 minMod=4;
354 maxMod=6;
355 if(lad>kNLaddersLay3){
356 AliError(Form("Ladder number %d out of range",lad));
357 return;
358 }
359 }else if(lay==4){
360 minMod=5;
361 maxMod=8;
362 if(lad>kNLaddersLay4){
363 AliError(Form("Ladder number %d out of range",lad));
364 return;
365 }
366 }else{
367 AliError(Form("Layer number %d out of range",lay));
368 return;
369 }
370 for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
371 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
372 SetModuleTimeZero(modIndex,tzero);
373 }
9de0700b 374}
dfb09666 375//_________________________________________________________________________
376void AliITSresponseSDD::PrintChargeCalibrationParams() const{
374200ee 377 // Dump charge calibration parameters
378
dfb09666 379 printf("ADC vs. drift time corr=%f\n",GetChargevsTime());
380 printf("-------------------------------------\n");
381 printf("Layer 3\n");
382 for(Int_t ilad=1; ilad<=14; ilad++){
383 for(Int_t idet=1; idet<=6;idet++){
384 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(3,ilad,idet);
385 Float_t tz=GetADCtokeV(modIndex);
386 printf("%7.2f ",tz);
387 }
388 printf("\n");
389 }
390 printf("\n");
391 printf("Layer 4\n");
392 for(Int_t ilad=1; ilad<=22; ilad++){
393 for(Int_t idet=1; idet<=8;idet++){
394 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(4,ilad,idet);
395 Float_t tz=GetADCtokeV(modIndex);
396 printf("%7.2f ",tz);
397 }
398 printf("\n");
399 }
400}
401//_________________________________________________________________________
402void AliITSresponseSDD::PrintTimeZeroes() const{
374200ee 403 // Dump time zero values
404
dfb09666 405 printf("Layer 3\n");
406 for(Int_t ilad=1; ilad<=14; ilad++){
407 for(Int_t idet=1; idet<=6;idet++){
408 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(3,ilad,idet);
409 Float_t tz=GetTimeZero(modIndex);
410 printf("%7.2f ",tz);
411 }
412 printf("\n");
413 }
414 printf("\n");
415 printf("Layer 4\n");
416 for(Int_t ilad=1; ilad<=22; ilad++){
417 for(Int_t idet=1; idet<=8;idet++){
418 Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(4,ilad,idet);
419 Float_t tz=GetTimeZero(modIndex);
420 printf("%7.2f ",tz);
421 }
422 printf("\n");
423 }
424
425}
426//_________________________________________________________________________
427void AliITSresponseSDD::PrintVdriftCorerctions() const{
374200ee 428 // Dump corrections to vdrift
429
dfb09666 430 for(Int_t iMod=240; iMod<500; iMod++){
431 printf("Module %d dVleft=%f dVright=%f\n",iMod,GetDeltaVDrift(iMod,0),GetDeltaVDrift(iMod,1));
432 }
433}