]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 2007-2009, 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 | #include <Riostream.h> | |
19 | #include <TRandom.h> | |
20 | #include "AliITSCalibrationSDD.h" | |
21 | #include "AliLog.h" | |
22 | ||
23 | ////////////////////////////////////////////////////// | |
24 | // Calibration class for set:ITS // | |
25 | // Specific subdetector implementation // | |
26 | // for silicon drift detectors // | |
27 | // // | |
28 | // // | |
29 | ////////////////////////////////////////////////////// | |
30 | ||
31 | const Float_t AliITSCalibrationSDD::fgkTemperatureDefault = 296.; | |
32 | const Float_t AliITSCalibrationSDD::fgkNoiseDefault = 2.38; | |
33 | const Float_t AliITSCalibrationSDD::fgkGainDefault = 1.; | |
34 | const Float_t AliITSCalibrationSDD::fgkBaselineDefault = 20.; | |
35 | //______________________________________________________________________ | |
36 | ClassImp(AliITSCalibrationSDD) | |
37 | ||
38 | AliITSCalibrationSDD::AliITSCalibrationSDD(): | |
39 | AliITSCalibration(), | |
40 | fZeroSupp(kTRUE), | |
41 | fAMAt20MHz(kFALSE), | |
42 | fDeadChips(0), | |
43 | fDeadChannels(0), | |
44 | fIsBad(kFALSE), | |
45 | fBadChannels(), | |
46 | fMapAW0(0), | |
47 | fMapAW1(0), | |
48 | fMapTW0(0), | |
49 | fMapTW1(0), | |
50 | fDrSpeed0(0), | |
51 | fDrSpeed1(0) | |
52 | { | |
53 | // default constructor | |
54 | ||
55 | SetDeadChannels(); | |
56 | for(Int_t ian=0;ian<fgkWings*fgkChannels*fgkChips;ian++){ | |
57 | fBaseline[ian]=fgkBaselineDefault; | |
58 | fNoise[ian]=fgkNoiseDefault; | |
59 | fGain[ian]=1.; | |
60 | SetNoiseAfterElectronics(ian); | |
61 | } | |
62 | for(Int_t iw=0;iw<fgkWings;iw++){ | |
63 | SetZSLowThreshold(iw); | |
64 | SetZSHighThreshold(iw); | |
65 | for(Int_t icp=0;icp<fgkChips;icp++){ | |
66 | Int_t chipindex=iw*fgkChips+icp; | |
67 | fIsChipBad[chipindex]=kFALSE; | |
68 | } | |
69 | } | |
70 | SetTemperature(fgkTemperatureDefault); | |
71 | SetDataType(); | |
72 | } | |
73 | //______________________________________________________________________ | |
74 | AliITSCalibrationSDD::AliITSCalibrationSDD(const char *dataType): | |
75 | AliITSCalibration(), | |
76 | fZeroSupp(kTRUE), | |
77 | fAMAt20MHz(kFALSE), | |
78 | fDeadChips(0), | |
79 | fDeadChannels(0), | |
80 | fIsBad(kFALSE), | |
81 | fBadChannels(), | |
82 | fMapAW0(0), | |
83 | fMapAW1(0), | |
84 | fMapTW0(0), | |
85 | fMapTW1(0), | |
86 | fDrSpeed0(0), | |
87 | fDrSpeed1(0) | |
88 | { | |
89 | // constructor | |
90 | ||
91 | SetDeadChannels(); | |
92 | for(Int_t ian=0;ian<fgkWings*fgkChannels*fgkChips;ian++){ | |
93 | fBaseline[ian]=fgkBaselineDefault; | |
94 | fNoise[ian]=fgkNoiseDefault; | |
95 | fGain[ian]=1.; | |
96 | SetNoiseAfterElectronics(ian); | |
97 | } | |
98 | for(Int_t iw=0;iw<fgkWings;iw++){ | |
99 | SetZSLowThreshold(iw); | |
100 | SetZSHighThreshold(iw); | |
101 | for(Int_t icp=0;icp<fgkChips;icp++){ | |
102 | Int_t chipindex=iw*fgkChips+icp; | |
103 | fIsChipBad[chipindex]=kFALSE; | |
104 | } | |
105 | } | |
106 | ||
107 | SetTemperature(fgkTemperatureDefault); | |
108 | SetDataType(dataType); | |
109 | } | |
110 | //_____________________________________________________________________ | |
111 | AliITSCalibrationSDD::~AliITSCalibrationSDD(){ | |
112 | ||
113 | //destructor | |
114 | if(fMapAW0) delete fMapAW0; | |
115 | if(fMapAW1) delete fMapAW1; | |
116 | if(fMapTW0) delete fMapTW0; | |
117 | if(fMapTW1) delete fMapTW1; | |
118 | if(fDrSpeed0) delete fDrSpeed0; | |
119 | if(fDrSpeed1) delete fDrSpeed1; | |
120 | } | |
121 | ||
122 | //______________________________________________________________________ | |
123 | void AliITSCalibrationSDD::GiveCompressParam(Int_t cp[4]) const { | |
124 | // give compression param | |
125 | cp[0]=fZSTH[0]; | |
126 | cp[1]=fZSTL[0]; | |
127 | cp[2]=fZSTH[1]; | |
128 | cp[3]=fZSTL[1]; | |
129 | } | |
130 | //_____________________________________________________________________ | |
131 | void AliITSCalibrationSDD::SetBadChannel(Int_t i,Int_t anode){ | |
132 | //Set bad anode (set gain=0 for these channels); | |
133 | ||
134 | if(anode<0 || anode >fgkChannels*fgkChips*fgkWings-1){ | |
135 | AliError("Wrong anode number"); | |
136 | return; | |
137 | } | |
138 | fBadChannels[i]=anode; | |
139 | fGain[anode]=0; | |
140 | } | |
141 | //______________________________________________________________________ | |
142 | void AliITSCalibrationSDD::GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg){ | |
143 | //correction of coordinates using the maps stored in the DB | |
144 | Int_t nSide=seg->GetSideFromLocalX(x); | |
145 | devz=0; | |
146 | // if(nSide==0) devz=fMapAW0->GetCorrection(z,x,seg); | |
147 | // else devz=fMapAW1->GetCorrection(z,x,seg); | |
148 | devx=0; | |
149 | if(nSide==0) devx=fMapTW0->GetCorrection(z,x,seg); | |
150 | else devx=fMapTW1->GetCorrection(z,x,seg); | |
151 | return; | |
152 | } | |
153 | //______________________________________________________________________ | |
154 | void AliITSCalibrationSDD::GetShiftsForSimulation(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg){ | |
155 | //correction of coordinates using the maps stored in the DB | |
156 | Int_t nSide=seg->GetSideFromLocalX(x); | |
157 | devz=0; | |
158 | // if(nSide==0) devz=fMapAW0->GetCorrection(z,x,seg); | |
159 | // else devz=fMapAW1->GetCorrection(z,x,seg); | |
160 | devx=0; | |
161 | if(nSide==0) devx=fMapTW0->GetShiftForSimulation(z,x,seg); | |
162 | else devx=fMapTW1->GetShiftForSimulation(z,x,seg); | |
163 | return; | |
164 | } | |
165 | //______________________________________________________________________ | |
166 | void AliITSCalibrationSDD::PrintGains() const{ | |
167 | // Print Gains | |
168 | ||
169 | if( GetDeadChips() == 0 && | |
170 | GetDeadChannels() == 0 ) | |
171 | return; | |
172 | ||
173 | // Print Electronics Gains | |
174 | cout << "**************************************************" << endl; | |
175 | cout << " Print Electronics Gains " << endl; | |
176 | cout << "**************************************************" << endl; | |
177 | ||
178 | // Print SDD electronic gains | |
179 | for(Int_t ian=0; ian<fgkWings*fgkChips*fgkChannels;ian++){ | |
180 | printf("Gain for channel %d = %f\n",ian,fGain[ian]); | |
181 | } | |
182 | } | |
183 | ||
184 | //______________________________________________________________________ | |
185 | void AliITSCalibrationSDD::Print(){ | |
186 | // Print SDD response Parameters | |
187 | ||
188 | cout << "**************************************************" << endl; | |
189 | cout << " Silicon Drift Detector Response Parameters " << endl; | |
190 | cout << "**************************************************" << endl; | |
191 | cout << "Hardware compression parameters: " << endl; | |
192 | cout << "Noise before electronics (arbitrary units): " << fNoise[0] << endl; | |
193 | cout << "Baseline (ADC units): " << fBaseline[0] << endl; | |
194 | cout << "Noise after electronics (ADC units): " << fNoiseAfterEl[0] << endl; | |
195 | cout << "Temperature: " << Temperature() << " K " << endl; | |
196 | PrintGains(); | |
197 | ||
198 | } |