]>
Commit | Line | Data |
---|---|---|
979b5a5f | 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 | **************************************************************************/ | |
e56160b8 | 15 | |
20f3f947 | 16 | /* $Id$ */ |
5a9fd7dd | 17 | |
979b5a5f | 18 | /////////////////////////////////////////////////////////////////// |
19 | // // | |
20 | // Implementation of the class for SDD preprocessing // | |
27199d86 | 21 | // Run Types treated: // |
22 | // PULSER, INJECTOR -> Store OCDB parameters // | |
23 | // ALL RUNS -> Store DCS reference data // | |
979b5a5f | 24 | // Origin: E.Crescio, Torino, crescio@to.infn.it // |
25 | // F.Prino, Torino, prino@to.infn.it // | |
26 | // // | |
27 | /////////////////////////////////////////////////////////////////// | |
28 | ||
27199d86 | 29 | #include "AliITSDDLModuleMapSDD.h" |
e56160b8 | 30 | #include "AliITSPreprocessorSDD.h" |
31 | #include "AliITSCalibrationSDD.h" | |
b34fed4e | 32 | #include "AliITSDriftSpeedSDD.h" |
18da6e54 | 33 | #include "AliITSDriftSpeedArraySDD.h" |
cfaccd71 | 34 | #include "AliITSDCSAnalyzerSDD.h" |
e56160b8 | 35 | #include "AliShuttleInterface.h" |
979b5a5f | 36 | #include "AliCDBEntry.h" |
e56160b8 | 37 | #include "AliCDBMetaData.h" |
38 | #include "TObjArray.h" | |
e56160b8 | 39 | #include "AliLog.h" |
dfb8947f | 40 | #include <TObjString.h> |
41 | #include <TSystem.h> | |
42 | #include <TList.h> | |
7960eafe | 43 | #include <TF1.h> |
44 | #include <TH1D.h> | |
e56160b8 | 45 | |
7537d03c | 46 | const TString AliITSPreprocessorSDD::fgkNameHistoPedestals = "hpedestal"; |
47 | const TString AliITSPreprocessorSDD::fgkNameHistoNoise = "hnoise"; | |
e56160b8 | 48 | ClassImp(AliITSPreprocessorSDD) |
49 | ||
15b67cdc | 50 | //______________________________________________________________________ |
51 | AliITSPreprocessorSDD::AliITSPreprocessorSDD( AliShuttleInterface* shuttle): | |
52 | AliPreprocessor("SDD", shuttle) | |
53 | { | |
54 | // constructor | |
55 | AddRunType("PULSER"); | |
56 | AddRunType("INJECTOR"); | |
57 | AddRunType("PHYSICS"); | |
58 | } | |
e56160b8 | 59 | |
317e638f | 60 | //______________________________________________________________________ |
cfaccd71 | 61 | UInt_t AliITSPreprocessorSDD::Process(TMap* dcsAliasMap){ |
e56160b8 | 62 | |
7d21c0a9 | 63 | |
979b5a5f | 64 | // Get DDL map from OCDB |
65 | AliCDBEntry* entry = GetFromOCDB("Calib", "DDLMapSDD"); | |
66 | if(!entry){ | |
67 | Log("DDL map file not found in OCDB."); | |
68 | return 2; | |
69 | } | |
70 | AliITSDDLModuleMapSDD* ddlmap = (AliITSDDLModuleMapSDD*)entry->GetObject(); | |
71 | if(!ddlmap){ | |
72 | Log("AliITSDDLModuleMapSDD object not in file."); | |
73 | return 2; | |
74 | } | |
b478db1a | 75 | ddlmap->PrintDDLMap(); |
e56160b8 | 76 | |
979b5a5f | 77 | //preprocessing |
18da6e54 | 78 | TString runType = GetRunType(); |
461c9263 | 79 | Int_t retcode=0; |
c2bd28b6 | 80 | |
ad2585ed | 81 | if (runType == "PULSER"){ |
b478db1a | 82 | Log("Process FXS files from PULSER RUN"); |
317e638f | 83 | retcode=ProcessPulser(ddlmap); |
84 | }else if(runType== "INJECTOR"){ | |
b478db1a | 85 | Log("Process FXS files from INJECTOR RUN"); |
317e638f | 86 | retcode=ProcessInjector(ddlmap); |
317e638f | 87 | } |
461c9263 | 88 | if(retcode!=0) return retcode; |
89 | ||
b478db1a | 90 | Log("Process DCS data"); |
461c9263 | 91 | Bool_t retcodedcs =ProcessDCSDataPoints(dcsAliasMap); |
92 | if(retcodedcs) return 0; | |
93 | else return 1; | |
94 | ||
317e638f | 95 | } |
96 | //______________________________________________________________________ | |
461c9263 | 97 | UInt_t AliITSPreprocessorSDD::ProcessPulser(AliITSDDLModuleMapSDD* ddlmap){ |
317e638f | 98 | // Process FXS files from PULSER run (baseline, noise, gain) |
461c9263 | 99 | // returns 0 in case of success, |
100 | // 1 in case of storage error, | |
101 | // 2 in case of error with input files | |
317e638f | 102 | TObjArray calSDD(kNumberOfSDD); |
103 | calSDD.SetOwner(kFALSE); | |
7d21c0a9 | 104 | |
317e638f | 105 | Float_t baseline,rawnoise,cmn,corn,gain; |
106 | Int_t isgoodan,i,im,is,isgoodmod,basmin,basoff; | |
e7610d19 | 107 | Int_t th,tl; |
317e638f | 108 | Int_t numOfBadChannels[kNumberOfSDD]; |
18da6e54 | 109 | |
317e638f | 110 | TList* sourceList = GetFileSources(kDAQ, "SDD_Calib"); |
111 | if (!sourceList){ | |
112 | Log("Error: no sources found for SDD_Calib"); | |
113 | return 2; | |
114 | } | |
dfb8947f | 115 | |
317e638f | 116 | Int_t ind = 0; |
117 | while (sourceList->At(ind)!=NULL) { | |
118 | TObjString* tarId = (TObjString*) sourceList->At(ind); | |
119 | TString tarName = GetFile(kDAQ, "SDD_Calib", tarId->GetString().Data()); | |
120 | if(tarName.Length()==0){ | |
121 | Log(Form("Baseline tar file from source %d not found.",ind)); | |
122 | return 2; | |
18da6e54 | 123 | } |
7d21c0a9 | 124 | TString command; |
125 | command.Form("tar -xf %s",tarName.Data()); | |
317e638f | 126 | gSystem->Exec(command); |
127 | ind++; | |
128 | } | |
129 | delete sourceList; | |
27416b0d | 130 | // Read ADC sampling frequency from fee.conf |
131 | Int_t amSamplFreq=40; | |
296ee458 | 132 | Int_t retfscf; |
27416b0d | 133 | FILE* feefil=fopen("fee.conf","r"); |
134 | if(feefil){ | |
296ee458 | 135 | retfscf=fscanf(feefil,"%d \n",&amSamplFreq); |
27416b0d | 136 | fclose(feefil); |
137 | Log(Form("AM sampling frequency = %d MHz",amSamplFreq)); | |
138 | }else{ | |
139 | Log("File fee.conf not found. AM sampling set at 40 MHz by default"); | |
140 | } | |
317e638f | 141 | |
142 | for(Int_t iddl=0;iddl<kNumberOfDDL;iddl++){ | |
143 | for(Int_t imod=0;imod<kModulesPerDDL;imod++){ | |
144 | Int_t modID=ddlmap->GetModuleNumber(iddl,imod); | |
145 | if(modID==-1) continue; | |
146 | modID-=240; // to have SDD modules numbering from 0 to 260 | |
147 | AliITSCalibrationSDD *cal = new AliITSCalibrationSDD("simulated"); | |
27416b0d | 148 | if(amSamplFreq!=40) cal->SetAMAt20MHz(); |
317e638f | 149 | numOfBadChannels[modID]=0; |
150 | Int_t badch[kNumberOfChannels]; | |
296ee458 | 151 | Bool_t sid0ok=kTRUE; |
152 | Bool_t sid1ok=kTRUE; | |
317e638f | 153 | for(Int_t isid=0;isid<=1;isid++){ |
7d21c0a9 | 154 | TString inpFileName; |
155 | inpFileName.Form("./SDDbase_ddl%02dc%02d_sid%d.data",iddl,imod,isid); | |
156 | ||
317e638f | 157 | FILE* basFil = fopen(inpFileName,"read"); |
158 | if (basFil == 0) { | |
7d21c0a9 | 159 | Log(Form("File %s not found.",inpFileName.Data())); |
296ee458 | 160 | if(isid==0){ |
161 | sid0ok=kFALSE; | |
162 | for(Int_t iChip=0; iChip<4; iChip++) cal->SetChipBad(iChip); | |
163 | cal->SetDeadChannels(cal->GetDeadChannels()+256); | |
164 | for(Int_t iAnode=0; iAnode<256; iAnode++) cal->SetBadChannel(iAnode,iAnode); | |
165 | }else{ | |
166 | sid1ok=kFALSE; | |
167 | for(Int_t iChip=4; iChip<8; iChip++) cal->SetChipBad(iChip); | |
168 | cal->SetDeadChannels(cal->GetDeadChannels()+256); | |
169 | for(Int_t iAnode=0; iAnode<256; iAnode++) cal->SetBadChannel(iAnode,iAnode+256); | |
170 | } | |
317e638f | 171 | continue; |
172 | } | |
296ee458 | 173 | |
174 | retfscf=fscanf(basFil,"%d %d %d\n",&im,&is,&isgoodmod); | |
175 | if(!isgoodmod){ | |
176 | if(isid==0){ | |
177 | sid0ok=kFALSE; | |
178 | for(Int_t iChip=0; iChip<4; iChip++) cal->SetChipBad(iChip); | |
179 | }else{ | |
180 | sid1ok=kFALSE; | |
181 | for(Int_t iChip=4; iChip<8; iChip++) cal->SetChipBad(iChip); | |
182 | } | |
183 | } | |
184 | retfscf=fscanf(basFil,"%d\n",&th); | |
185 | retfscf=fscanf(basFil,"%d\n",&tl); | |
20f3f947 | 186 | cal->SetZSLowThreshold(isid,tl); |
187 | cal->SetZSHighThreshold(isid,th); | |
317e638f | 188 | for(Int_t ian=0;ian<(kNumberOfChannels/2);ian++){ |
296ee458 | 189 | retfscf=fscanf(basFil,"%d %d %f %d %d %f %f %f %f\n",&i,&isgoodan,&baseline,&basmin,&basoff,&rawnoise,&cmn,&corn,&gain); |
317e638f | 190 | Int_t ich=ian; |
191 | if(isid==1) ich+=256; | |
192 | if(!isgoodan){ | |
193 | Int_t ibad=numOfBadChannels[modID]; | |
194 | badch[ibad]=ich; | |
195 | numOfBadChannels[modID]++; | |
979b5a5f | 196 | } |
20f3f947 | 197 | cal->SetBaseline(ich,baseline-basoff); |
317e638f | 198 | cal->SetNoiseAfterElectronics(ich,rawnoise); |
199 | cal->SetGain(ich,gain); | |
979b5a5f | 200 | } |
317e638f | 201 | cal->SetDeadChannels(numOfBadChannels[modID]); |
202 | for(Int_t ibad=0;ibad<numOfBadChannels[modID];ibad++){ | |
203 | cal->SetBadChannel(ibad,badch[ibad]); | |
204 | } | |
205 | fclose(basFil); | |
c2bd28b6 | 206 | } |
296ee458 | 207 | if(!sid0ok && !sid1ok) cal->SetBad(); |
b478db1a | 208 | Log(Form("Put calib obj for module %d (DDL %d Carlos %d)",modID,iddl,imod)); |
317e638f | 209 | calSDD.AddAt(cal,modID); |
e56160b8 | 210 | } |
317e638f | 211 | } |
212 | AliCDBMetaData *md= new AliCDBMetaData(); | |
213 | md->SetResponsible("Francesco Prino"); | |
214 | md->SetBeamPeriod(0); | |
215 | md->SetComment("AliITSCalibrationSDD from PEDESTAL+PULSER runs"); | |
216 | Bool_t retCode = Store("Calib","CalibSDD",&calSDD,md, 0, kTRUE); | |
461c9263 | 217 | if(retCode) return 0; |
218 | else return 1; | |
317e638f | 219 | } |
220 | //______________________________________________________________________ | |
461c9263 | 221 | UInt_t AliITSPreprocessorSDD::ProcessInjector(AliITSDDLModuleMapSDD* ddlmap){ |
317e638f | 222 | // Process FXS files from injector events (INJECTOR or PHYSICS runs) |
461c9263 | 223 | // returns 0 in case of success, |
224 | // 1 in case of storage error, | |
225 | // 2 in case of error with input files | |
317e638f | 226 | TObjArray vdrift(2*kNumberOfSDD); |
227 | vdrift.SetOwner(kFALSE); | |
317e638f | 228 | Int_t evNumb,polDeg; |
50d25e98 | 229 | UInt_t timeStamp,statusInj; |
9f963593 | 230 | Bool_t modSet[2*kNumberOfSDD]; // flag modules with good inj. |
5eb2b05e | 231 | for(Int_t ihyb=0; ihyb<2*kNumberOfSDD; ihyb++) modSet[ihyb]=0; |
50d25e98 | 232 | Double_t nPtLay3 = 0; |
233 | Double_t nPtLay4 = 0; | |
9f963593 | 234 | |
235 | Double_t param[4]; // parameters of poly fit | |
915c0469 | 236 | Double_t minValP0=5.; // min value for param[0] |
237 | Double_t maxValP0=8.; // max value for param[0] | |
9f963593 | 238 | Double_t minValP1=0.; // min value for param[1] |
50d25e98 | 239 | Double_t aveCoefLay3[4]={0.,0.,0.,0.}; // average param for good mod. |
240 | Double_t aveCoefLay4[4]={0.,0.,0.,0.}; // average param for good mod. | |
9f963593 | 241 | Double_t defCoef[4]={6.53227,0.00128941,-5.14493e-06,0}; // default values for param |
242 | Float_t auxP; | |
e56160b8 | 243 | |
317e638f | 244 | TList* sourceList = GetFileSources(kDAQ, "SDD_Injec"); |
245 | if (!sourceList){ | |
246 | Log("Error: no sources found for SDD_Injec"); | |
247 | return 2; | |
248 | } | |
249 | Int_t ind = 0; | |
250 | while (sourceList->At(ind)!=NULL) { | |
251 | TObjString* tarId = (TObjString*) sourceList->At(ind); | |
252 | TString tarName = GetFile(kDAQ, "SDD_Injec", tarId->GetString().Data()); | |
253 | if(tarName.Length()==0){ | |
254 | Log(Form("Injector tar file from source %d not found.",ind)); | |
18da6e54 | 255 | return 2; |
256 | } | |
7d21c0a9 | 257 | TString command; |
258 | command.Form("tar -xf %s",tarName.Data()); | |
317e638f | 259 | gSystem->Exec(command); |
260 | ind++; | |
261 | } | |
262 | delete sourceList; | |
296ee458 | 263 | Int_t retfscf; |
7960eafe | 264 | |
9f963593 | 265 | |
317e638f | 266 | for(Int_t iddl=0;iddl<kNumberOfDDL;iddl++){ |
267 | for(Int_t imod=0;imod<kModulesPerDDL;imod++){ | |
268 | Int_t modID=ddlmap->GetModuleNumber(iddl,imod); | |
269 | if(modID==-1) continue; | |
270 | modID-=240; // to have SDD modules numbering from 0 to 260 | |
271 | for(Int_t isid=0;isid<=1;isid++){ | |
272 | AliITSDriftSpeedArraySDD *arr=new AliITSDriftSpeedArraySDD(); | |
7d21c0a9 | 273 | TString inpFileName; |
274 | inpFileName.Form("./SDDinj_ddl%02dc%02d_sid%d.data",iddl,imod,isid); | |
317e638f | 275 | FILE* injFil = fopen(inpFileName,"read"); |
276 | if (injFil == 0) { | |
7d21c0a9 | 277 | Log(Form("File %s not found.",inpFileName.Data())); |
317e638f | 278 | continue; |
279 | } | |
296ee458 | 280 | retfscf=fscanf(injFil,"%d",&polDeg); |
317e638f | 281 | while (!feof(injFil)){ |
296ee458 | 282 | retfscf=fscanf(injFil,"%d %u ",&evNumb,&timeStamp); |
50d25e98 | 283 | if(evNumb==-99){ |
284 | statusInj=timeStamp; | |
285 | arr->SetInjectorStatus(statusInj); | |
286 | }else{ | |
287 | if(feof(injFil)) break; | |
288 | for(Int_t ic=0;ic<4;ic++){ | |
289 | retfscf=fscanf(injFil,"%f ",&auxP); | |
290 | param[ic]=auxP; | |
291 | } | |
9f963593 | 292 | |
7a8c5708 | 293 | if(polDeg>=0 && polDeg<=AliITSDriftSpeedSDD::GetMaxPolDeg() && |
294 | param[0]>minValP0 && param[0]<maxValP0 && param[1]>minValP1){ | |
915c0469 | 295 | if(polDeg==3){ |
296 | if(modID<kNumberOfSDDLay3){ | |
297 | for(Int_t ic=0;ic<4;ic++) aveCoefLay3[ic]+=param[ic]; | |
298 | nPtLay3++; | |
299 | }else{ | |
300 | for(Int_t ic=0;ic<4;ic++) aveCoefLay4[ic]+=param[ic]; | |
301 | nPtLay4++; | |
302 | } | |
50d25e98 | 303 | } |
304 | AliITSDriftSpeedSDD *dsp=new AliITSDriftSpeedSDD(evNumb,timeStamp,polDeg,param); | |
305 | arr->AddDriftSpeed(dsp); | |
306 | modSet[2*modID+isid]=1; | |
915c0469 | 307 | }else{ |
308 | Log(Form("Module %d side %d not accepted, degree=%d, params=%g %g %g %g",modID+240,isid,polDeg,param[0],param[1],param[2],param[3])); | |
50d25e98 | 309 | } |
9f963593 | 310 | } |
18da6e54 | 311 | } |
9ebc7917 | 312 | fclose(injFil); |
b478db1a | 313 | Log(Form("Put calib obj for hybrid %d (DDL %d Carlos %d)",2*modID+isid,iddl,imod)); |
9f963593 | 314 | if(modSet[2*modID+isid]) vdrift.AddAt(arr,2*modID+isid); |
18da6e54 | 315 | } |
316 | } | |
cfaccd71 | 317 | } |
9f963593 | 318 | |
319 | // set drift speed for modules with bad injectors | |
320 | for(Int_t ic=0;ic<4;ic++){ | |
50d25e98 | 321 | if(nPtLay3>0) aveCoefLay3[ic]/=nPtLay3; // mean parameters |
322 | else aveCoefLay3[ic]=defCoef[ic]; // default parameters | |
323 | if(nPtLay4>0) aveCoefLay4[ic]/=nPtLay4; // mean parameters | |
324 | else aveCoefLay4[ic]=defCoef[ic]; // default parameters | |
9f963593 | 325 | } |
2c4e6a6a | 326 | AliITSDriftSpeedSDD *avdsp3=new AliITSDriftSpeedSDD(evNumb,timeStamp,3,aveCoefLay3); |
327 | AliITSDriftSpeedSDD *avdsp4=new AliITSDriftSpeedSDD(evNumb,timeStamp,3,aveCoefLay4); | |
9f963593 | 328 | |
7960eafe | 329 | // Check status of golden modules |
330 | Int_t idGoldenMod=-1, idGoldenSide=-1; | |
331 | Int_t idGoldenModList[5]={319,319,321,243,243}; | |
332 | Int_t idGoldenSideList[5]={0,1,0,0,1}; | |
333 | AliITSDriftSpeedSDD* refSpeed=0x0; | |
334 | for(Int_t iGold=0; iGold<5; iGold++){ | |
335 | Int_t indexG=2*(idGoldenModList[iGold]-240)+idGoldenSideList[iGold]; | |
336 | if(modSet[indexG]){ | |
337 | idGoldenMod=idGoldenModList[iGold]; | |
338 | idGoldenSide=idGoldenSideList[iGold]; | |
339 | AliITSDriftSpeedArraySDD* arrRef=(AliITSDriftSpeedArraySDD*)vdrift.At(indexG); | |
340 | refSpeed=arrRef->GetDriftSpeedObject(0); | |
341 | break; | |
342 | } | |
343 | } | |
344 | TList* correctionList=0x0; | |
345 | if(idGoldenMod>=240 && idGoldenSide>=0){ | |
346 | // Get rescaling corrections from OCDB | |
347 | AliCDBEntry* entry = GetFromOCDB("Calib", "RescaleDriftSpeedSDD"); | |
348 | if(!entry){ | |
349 | Log("RescaleDriftSpeedSDD file not found in OCDB."); | |
350 | } | |
351 | TList* fullList=(TList*)entry->GetObject(); | |
352 | if(!fullList){ | |
353 | Log("TList object not found in file."); | |
354 | } | |
355 | TString listName=Form("RefMod%d_Side%d",idGoldenMod,idGoldenSide); | |
356 | correctionList=(TList*)fullList->FindObject(listName.Data()); | |
357 | if(!correctionList){ | |
358 | Log(Form("TList for requested module %d side %d not found",idGoldenMod,idGoldenSide)); | |
359 | }else{ | |
360 | Log(Form("Use module %d side %d as reference module",idGoldenMod,idGoldenSide)); | |
361 | if(refSpeed){ | |
362 | Log(Form("Drift speed params for golden module = %g %g %g %g",refSpeed->GetDriftSpeedParameter(0),refSpeed->GetDriftSpeedParameter(1),refSpeed->GetDriftSpeedParameter(2),refSpeed->GetDriftSpeedParameter(3))); | |
363 | }else{ | |
364 | AliError("No drift speed object for golden module"); | |
365 | } | |
366 | } | |
367 | } | |
368 | ||
50d25e98 | 369 | for(Int_t ihyb=0; ihyb<2*kNumberOfSDDLay3; ihyb++){ |
7960eafe | 370 | AliITSDriftSpeedArraySDD *arr=new AliITSDriftSpeedArraySDD(); |
9f963593 | 371 | if(modSet[ihyb]==0){ |
7960eafe | 372 | Int_t iBadMod=ihyb/2+240; |
373 | Int_t iBadSide=ihyb%2; | |
374 | Bool_t goldenUsed=kFALSE; | |
375 | if(correctionList && refSpeed){ | |
376 | Double_t *params=RescaleDriftSpeedModule(correctionList,iBadMod,iBadSide,refSpeed); | |
377 | if(params){ | |
378 | AliWarning(Form("No good injector events for mod. %d side %d --> use rescaled values from golden module",iBadMod,iBadSide)); | |
379 | AliITSDriftSpeedSDD* dspres=new AliITSDriftSpeedSDD(0,refSpeed->GetEventTimestamp(),3,params); | |
380 | arr->AddDriftSpeed(dspres); | |
381 | arr->SetInjectorStatus(1); | |
382 | goldenUsed=kTRUE; | |
383 | } | |
384 | } | |
385 | if(!goldenUsed){ | |
386 | AliWarning(Form("No good injector events for mod. %d side %d --> use average values for layer 3",iBadMod,iBadSide)); | |
387 | arr->AddDriftSpeed(avdsp3); | |
388 | arr->SetInjectorStatus(0); | |
389 | } | |
9f963593 | 390 | vdrift.AddAt(arr,ihyb); |
391 | } | |
392 | } | |
393 | ||
50d25e98 | 394 | for(Int_t ihyb=2*kNumberOfSDDLay3; ihyb<2*kNumberOfSDD; ihyb++){ |
395 | if(modSet[ihyb]==0){ | |
396 | AliWarning(Form("No good injector events for mod. %d side %d --> use average values for layer 4",ihyb/2,ihyb%2)); | |
397 | AliITSDriftSpeedArraySDD *arr=new AliITSDriftSpeedArraySDD(); | |
398 | arr->AddDriftSpeed(avdsp4); | |
399 | arr->SetInjectorStatus(0); | |
400 | vdrift.AddAt(arr,ihyb); | |
401 | } | |
402 | } | |
9f963593 | 403 | |
317e638f | 404 | AliCDBMetaData *md= new AliCDBMetaData(); |
405 | md->SetResponsible("Francesco Prino"); | |
406 | md->SetBeamPeriod(0); | |
407 | md->SetComment("AliITSDriftSpeedSDD from injector events"); | |
408 | Bool_t retCode = Store("Calib","DriftSpeedSDD",&vdrift,md,0, kTRUE); | |
461c9263 | 409 | if(retCode) return 0; |
410 | else return 1; | |
317e638f | 411 | } |
7960eafe | 412 | |
413 | //______________________________________________________________________ | |
27199d86 | 414 | Double_t* AliITSPreprocessorSDD::RescaleDriftSpeedModule(const TList* theList, |
7960eafe | 415 | Int_t iBadMod, |
416 | Int_t iBadSide, | |
b34fed4e | 417 | const AliITSDriftSpeedSDD* refSpeed) |
7960eafe | 418 | const |
419 | { | |
420 | // Rescale driftSpeed for a drift region starting from values of golden module | |
421 | ||
422 | if(!refSpeed) return 0x0; | |
423 | TString hisName=Form("hRatioMod%d_Side%d",iBadMod,iBadSide); | |
424 | TH1D* h=(TH1D*)theList->FindObject(hisName.Data()); | |
425 | if(!h) return 0x0; | |
426 | ||
427 | TF1* fpoly=new TF1("fpoly","pol3",0.,255.); | |
428 | for(Int_t iAnode=0; iAnode<256; iAnode++){ | |
429 | Double_t vref=refSpeed->GetDriftSpeedAtAnode((Double_t)iAnode); | |
430 | Double_t vcorr=h->GetBinContent(iAnode+1)*vref; | |
431 | h->SetBinContent(iAnode+1,vcorr); | |
432 | } | |
433 | h->Fit(fpoly,"RNQ"); | |
434 | Double_t *params=new Double_t[4]; | |
435 | for(Int_t iPar=0; iPar<4; iPar++) params[iPar]=fpoly->GetParameter(iPar); | |
436 | delete fpoly; | |
437 | return params; | |
438 | } | |
439 | ||
317e638f | 440 | //______________________________________________________________________ |
441 | Bool_t AliITSPreprocessorSDD::ProcessDCSDataPoints(TMap* dcsAliasMap){ | |
442 | // Process DCS data | |
443 | AliITSDCSAnalyzerSDD *dcs=new AliITSDCSAnalyzerSDD(); | |
444 | dcs->AnalyzeData(dcsAliasMap); | |
445 | TObjArray refDCS(kNumberOfSDD); | |
446 | refDCS.SetOwner(kFALSE); | |
447 | for(Int_t imod=0;imod<kNumberOfSDD;imod++){ | |
448 | AliITSDCSDataSDD *dcsdata=dcs->GetDCSData(imod); | |
449 | refDCS.Add(dcsdata); | |
450 | } | |
451 | AliCDBMetaData *md= new AliCDBMetaData(); | |
452 | md->SetResponsible("Francesco Prino"); | |
453 | md->SetBeamPeriod(0); | |
454 | md->SetComment("AliITSDCSDataSDD objects from DCS DB"); | |
455 | Bool_t retCode = StoreReferenceData("DCS","DataSDD",&refDCS,md); | |
456 | return retCode; | |
e56160b8 | 457 | } |
5eb2b05e | 458 |