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