]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSresponseSDD.cxx
Adding TDC channel delays to the calib object.
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.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 /* $Id$ */
17
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                                     //
23 //                                                  //
24 //                                                  //
25 //////////////////////////////////////////////////////
26
27 #include <TMath.h>
28
29 #include "AliITSresponseSDD.h"
30 #include <AliITSgeomTGeo.h>
31
32 const Float_t AliITSresponseSDD::fgkTimeOffsetDefault = 54.30;
33 const Float_t AliITSresponseSDD::fgkADC2keVDefault = 3.34;
34 const Float_t AliITSresponseSDD::fgkChargevsTimeDefault = 0.00355;
35 const Float_t AliITSresponseSDD::fgkCarlosRXClockPeriod = 25.;
36 ClassImp(AliITSresponseSDD)
37
38 //_________________________________________________________________________
39 AliITSresponseSDD::AliITSresponseSDD():
40 TObject(),
41   fTimeOffset(fgkTimeOffsetDefault),
42   fADC2keV(fgkADC2keVDefault),
43   fChargevsTime(fgkChargevsTimeDefault){
44   // default constructor
45   for(Int_t i=0; i<kNSDDmods;i++){
46     fTimeZero[i]=fgkTimeOffsetDefault;
47     fDeltaVDrift[i] = fDeltaVDrift[i+kNSDDmods] = 0.;
48     fADCtokeV[i]=fgkADC2keVDefault;
49   }  
50   SetVDCorr2Side(kTRUE); // default for new objects will be separate corrections for 2 sides (bwd compatible)
51 }
52 //_________________________________________________________________________
53 void AliITSresponseSDD::SetHalfLadderATimeZero(Int_t lay, Int_t lad, Float_t tzero){
54   // Sets time Zero for all modules of a ladder on side A (Z>0)
55   Int_t minMod,maxMod;
56   if(lay==3){
57     minMod=1; 
58     maxMod=3;
59     if(lad>kNLaddersLay3){
60       AliError(Form("Ladder number %d out of range",lad));
61       return;
62     }
63   }else if(lay==4){
64     minMod=1; 
65     maxMod=4;
66     if(lad>kNLaddersLay4){
67       AliError(Form("Ladder number %d out of range",lad));
68       return;
69     }
70   }else{
71     AliError(Form("Layer number %d out of range",lay));
72     return;
73   }
74   for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
75     Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
76     SetModuleTimeZero(modIndex,tzero);
77   }
78 }
79 //_________________________________________________________________________
80 void AliITSresponseSDD::SetHalfLadderCTimeZero(Int_t lay, Int_t lad, Float_t tzero){
81   // Sets time Zero for all modules of a ladder on side C (Z<0)
82   Int_t minMod,maxMod;
83   if(lay==3){
84     minMod=4; 
85     maxMod=6;
86     if(lad>kNLaddersLay3){
87       AliError(Form("Ladder number %d out of range",lad));
88       return;
89     }
90   }else if(lay==4){
91     minMod=5; 
92     maxMod=8;
93     if(lad>kNLaddersLay4){
94       AliError(Form("Ladder number %d out of range",lad));
95       return;
96     }
97   }else{
98     AliError(Form("Layer number %d out of range",lay));
99     return;
100   }
101   for(Int_t iMod=minMod; iMod<=maxMod; iMod++){
102     Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(lay,lad,iMod);
103     SetModuleTimeZero(modIndex,tzero);
104   }
105 }
106 //_________________________________________________________________________
107 void AliITSresponseSDD::PrintChargeCalibrationParams() const{
108   //
109   printf("ADC vs. drift time corr=%f\n",GetChargevsTime());
110   printf("-------------------------------------\n");
111   printf("Layer 3\n");
112   for(Int_t ilad=1; ilad<=14; ilad++){
113     for(Int_t idet=1; idet<=6;idet++){
114       Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(3,ilad,idet);
115       Float_t tz=GetADCtokeV(modIndex);
116       printf("%7.2f   ",tz);
117     }
118     printf("\n");
119   }
120   printf("\n");
121   printf("Layer 4\n");
122   for(Int_t ilad=1; ilad<=22; ilad++){
123     for(Int_t idet=1; idet<=8;idet++){
124       Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(4,ilad,idet);
125       Float_t tz=GetADCtokeV(modIndex);
126       printf("%7.2f   ",tz);
127     }
128     printf("\n");
129   }  
130 }
131 //_________________________________________________________________________
132 void AliITSresponseSDD::PrintTimeZeroes() const{
133   //
134   printf("Layer 3\n");
135   for(Int_t ilad=1; ilad<=14; ilad++){
136     for(Int_t idet=1; idet<=6;idet++){
137       Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(3,ilad,idet);
138       Float_t tz=GetTimeZero(modIndex);
139       printf("%7.2f   ",tz);
140     }
141     printf("\n");
142   }
143   printf("\n");
144   printf("Layer 4\n");
145   for(Int_t ilad=1; ilad<=22; ilad++){
146     for(Int_t idet=1; idet<=8;idet++){
147       Int_t modIndex=AliITSgeomTGeo::GetModuleIndex(4,ilad,idet);
148       Float_t tz=GetTimeZero(modIndex);
149       printf("%7.2f   ",tz);
150     }
151     printf("\n");
152   }
153   
154 }
155 //_________________________________________________________________________
156 void AliITSresponseSDD::PrintVdriftCorerctions() const{
157   //
158   for(Int_t iMod=240; iMod<500; iMod++){
159     printf("Module %d   dVleft=%f   dVright=%f\n",iMod,GetDeltaVDrift(iMod,0),GetDeltaVDrift(iMod,1));
160   }
161 }