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