]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 2007, 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 | ||
17 | #include "AliTPCPreprocessor.h" | |
18 | #include "AliShuttleInterface.h" | |
19 | ||
20 | #include "AliCDBMetaData.h" | |
21 | #include "AliDCSValue.h" | |
22 | #include "AliLog.h" | |
23 | #include "AliTPCSensorTempArray.h" | |
24 | #include "AliTPCROC.h" | |
25 | #include "AliTPCCalROC.h" | |
26 | #include "AliTPCCalPad.h" | |
27 | #include "AliTPCCalibPedestal.h" | |
28 | #include "AliTPCCalibPulser.h" | |
29 | #include "AliTPCCalibCE.h" | |
30 | #include "AliTPCCalibRaw.h" | |
31 | #include "AliTPCdataQA.h" | |
32 | #include "ARVersion.h" | |
33 | #include "TFile.h" | |
34 | #include "TTree.h" | |
35 | #include "TGraph.h" | |
36 | #include "TEnv.h" | |
37 | #include "TParameter.h" | |
38 | ||
39 | #include <TTimeStamp.h> | |
40 | ||
41 | const Int_t kValCutTemp = 100; // discard temperatures > 100 degrees | |
42 | const Int_t kDiffCutTemp = 5; // discard temperature differences > 5 degrees | |
43 | const Double_t kHighVoltageDifference = 1e-4; // don't record High Voltage points | |
44 | // differing by less than 1e-4 from | |
45 | // previous point. | |
46 | const TString kPedestalRunType = "PEDESTAL"; // pedestal run identifier | |
47 | const TString kPulserRunType = "PULSER"; // pulser run identifier | |
48 | const TString kPhysicsRunType = "PHYSICS"; // physics run identifier | |
49 | const TString kCosmicRunType = "COSMIC"; // cosmic run identifier | |
50 | const TString kLaserRunType = "LASER"; // laser run identifier | |
51 | const TString kDaqRunType = "DAQ"; // DAQ run identifier | |
52 | const TString kAmandaTemp = "TPC_PT_%d_TEMPERATURE"; // Amanda string for temperature entries | |
53 | const TString kAmandaDDL = "DDL%d"; // Amanda string for list of active DDLs | |
54 | const Int_t kNumDDL = 216; // number of TPC DDLs | |
55 | const Int_t kFirstDDL = 768; // identifier of first DDL | |
56 | //const Double_t kFitFraction = 0.7; // Fraction of DCS sensor fits required | |
57 | const Double_t kFitFraction = -1.0; // Don't require minimum number of fits in commissioning run | |
58 | const Int_t kNumPressureSensors = 3; // number of pressure sensors | |
59 | const char* kPressureSensorNames[kNumPressureSensors] = { | |
60 | "CavernAtmosPressure", | |
61 | "CavernAtmosPressure2", | |
62 | "SurfaceAtmosPressure" }; | |
63 | const Int_t kMinCESectors = 32; // minimum number of sectors (per side) | |
64 | // to accept CE calibration | |
65 | ||
66 | ||
67 | // | |
68 | // This class is the SHUTTLE preprocessor for the TPC detector. | |
69 | // | |
70 | ||
71 | ClassImp(AliTPCPreprocessor) | |
72 | ||
73 | //______________________________________________________________________________________________ | |
74 | AliTPCPreprocessor::AliTPCPreprocessor(AliShuttleInterface* shuttle) : | |
75 | AliPreprocessor("TPC",shuttle), | |
76 | fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), | |
77 | fPressure(0), fConfigOK(kTRUE), fROC(0) | |
78 | { | |
79 | // constructor | |
80 | fROC = AliTPCROC::Instance(); | |
81 | ||
82 | // define run types to be processed | |
83 | ||
84 | AddRunType(kPedestalRunType); | |
85 | AddRunType(kPulserRunType); | |
86 | AddRunType(kPhysicsRunType); | |
87 | AddRunType(kCosmicRunType); | |
88 | AddRunType(kLaserRunType); | |
89 | AddRunType(kDaqRunType); | |
90 | ||
91 | } | |
92 | //______________________________________________________________________________________________ | |
93 | AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor& ) : | |
94 | AliPreprocessor("TPC",0), | |
95 | fConfEnv(0), fTemp(0), fHighVoltage(0), fHighVoltageStat(0), fGoofie(0), | |
96 | fPressure(0), fConfigOK(kTRUE), fROC(0) | |
97 | { | |
98 | ||
99 | Fatal("AliTPCPreprocessor", "copy constructor not implemented"); | |
100 | // | |
101 | // // fTemp = new AliTPCSensorTempArray(*(org.fTemp)); | |
102 | } | |
103 | ||
104 | //______________________________________________________________________________________________ | |
105 | AliTPCPreprocessor::~AliTPCPreprocessor() | |
106 | { | |
107 | // destructor | |
108 | ||
109 | delete fTemp; | |
110 | delete fHighVoltage; | |
111 | delete fHighVoltageStat; | |
112 | delete fGoofie; | |
113 | delete fPressure; | |
114 | } | |
115 | //______________________________________________________________________________________________ | |
116 | AliTPCPreprocessor& AliTPCPreprocessor::operator = (const AliTPCPreprocessor& ) | |
117 | { | |
118 | Fatal("operator =", "assignment operator not implemented"); | |
119 | return *this; | |
120 | } | |
121 | ||
122 | ||
123 | //______________________________________________________________________________________________ | |
124 | void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime, | |
125 | UInt_t endTime) | |
126 | { | |
127 | ||
128 | AliPreprocessor::Initialize(run, startTime, endTime); | |
129 | ||
130 | AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, | |
131 | TTimeStamp((time_t)startTime,0).AsString(), | |
132 | TTimeStamp((time_t)endTime,0).AsString())); | |
133 | ||
134 | // Preprocessor configuration | |
135 | ||
136 | AliCDBEntry* entry = GetFromOCDB("Config", "Preprocessor"); | |
137 | if (entry) fConfEnv = (TEnv*) entry->GetObject(); | |
138 | if ( fConfEnv==0 ) { | |
139 | Log("AliTPCPreprocsessor: Preprocessor Config OCDB entry missing.\n"); | |
140 | fConfigOK = kFALSE; | |
141 | return; | |
142 | } | |
143 | ||
144 | // Temperature sensors | |
145 | ||
146 | TTree *confTree = 0; | |
147 | ||
148 | TString tempConf = fConfEnv->GetValue("Temperature","ON"); | |
149 | tempConf.ToUpper(); | |
150 | if (tempConf != "OFF" ) { | |
151 | entry = GetFromOCDB("Config", "Temperature"); | |
152 | if (entry) confTree = (TTree*) entry->GetObject(); | |
153 | if ( confTree==0 ) { | |
154 | Log("AliTPCPreprocsessor: Temperature Config OCDB entry missing.\n"); | |
155 | fConfigOK = kFALSE; | |
156 | return; | |
157 | } | |
158 | fTemp = new AliTPCSensorTempArray(startTime, endTime, confTree, kAmandaTemp); | |
159 | fTemp->SetValCut(kValCutTemp); | |
160 | fTemp->SetDiffCut(kDiffCutTemp); | |
161 | } | |
162 | ||
163 | // High voltage measurements | |
164 | ||
165 | TString hvConf = fConfEnv->GetValue("HighVoltage","ON"); | |
166 | hvConf.ToUpper(); | |
167 | if (hvConf != "OFF" ) { | |
168 | confTree=0; | |
169 | entry=0; | |
170 | entry = GetFromOCDB("Config", "HighVoltage"); | |
171 | if (entry) confTree = (TTree*) entry->GetObject(); | |
172 | if ( confTree==0 ) { | |
173 | Log("AliTPCPreprocsessor: High Voltage Config OCDB entry missing.\n"); | |
174 | fConfigOK = kFALSE; | |
175 | return; | |
176 | } | |
177 | time_t timeStart = (time_t)(((TString)GetRunParameter("DAQ_time_start")).Atoi()); | |
178 | time_t timeEnd = (time_t)(((TString)GetRunParameter("DAQ_time_end")).Atoi()); | |
179 | fHighVoltage = new AliDCSSensorArray (UInt_t(timeStart), | |
180 | UInt_t(timeEnd), confTree); | |
181 | } | |
182 | ||
183 | // High voltage status values | |
184 | ||
185 | TString hvStatConf = fConfEnv->GetValue("HighVoltageStat","ON"); | |
186 | hvStatConf.ToUpper(); | |
187 | if (hvStatConf != "OFF" ) { | |
188 | confTree=0; | |
189 | entry=0; | |
190 | entry = GetFromOCDB("Config", "HighVoltageStat"); | |
191 | if (entry) confTree = (TTree*) entry->GetObject(); | |
192 | if ( confTree==0 ) { | |
193 | Log("AliTPCPreprocsessor: High Voltage Status Config OCDB entry missing.\n"); | |
194 | fConfigOK = kFALSE; | |
195 | return; | |
196 | } | |
197 | fHighVoltageStat = new AliDCSSensorArray(startTime, endTime, confTree); | |
198 | } | |
199 | ||
200 | // Goofie values | |
201 | ||
202 | TString goofieConf = fConfEnv->GetValue("Goofie","ON"); | |
203 | goofieConf.ToUpper(); | |
204 | if (goofieConf != "OFF" ) { | |
205 | confTree=0; | |
206 | entry=0; | |
207 | entry = GetFromOCDB("Config", "Goofie"); | |
208 | if (entry) confTree = (TTree*) entry->GetObject(); | |
209 | if ( confTree==0 ) { | |
210 | Log("AliTPCPreprocsessor: Goofie Config OCDB entry missing.\n"); | |
211 | fConfigOK = kFALSE; | |
212 | return; | |
213 | } | |
214 | fGoofie = new AliDCSSensorArray(startTime, endTime, confTree); | |
215 | } | |
216 | ||
217 | // Pressure values | |
218 | ||
219 | TString runType = GetRunType(); | |
220 | ||
221 | if( runType == kPhysicsRunType || | |
222 | runType == kLaserRunType ) { | |
223 | TString pressureConf = fConfEnv->GetValue("Pressure","ON"); | |
224 | pressureConf.ToUpper(); | |
225 | if (pressureConf != "OFF" ) { | |
226 | TClonesArray * array = new TClonesArray("AliDCSSensor",kNumPressureSensors); | |
227 | for(Int_t j = 0; j < kNumPressureSensors; j++) { | |
228 | AliDCSSensor * sens = new ((*array)[j])AliDCSSensor; | |
229 | sens->SetStringID(kPressureSensorNames[j]); | |
230 | } | |
231 | fPressure = new AliDCSSensorArray(startTime, endTime, array); | |
232 | } | |
233 | } | |
234 | } | |
235 | ||
236 | //______________________________________________________________________________________________ | |
237 | UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap) | |
238 | { | |
239 | // Fills data into TPC calibrations objects | |
240 | ||
241 | // Amanda servers provide information directly through dcsAliasMap | |
242 | ||
243 | ||
244 | if (!fConfigOK) return 9; | |
245 | UInt_t result = 0; | |
246 | TObjArray *resultArray = new TObjArray(); | |
247 | TString errorHandling = fConfEnv->GetValue("ErrorHandling","ON"); | |
248 | errorHandling.ToUpper(); | |
249 | TObject * status; | |
250 | ||
251 | UInt_t dcsResult=0; | |
252 | if (!dcsAliasMap) { | |
253 | dcsResult=1; | |
254 | } else { | |
255 | if (dcsAliasMap->GetEntries() == 0 ) dcsResult=1; | |
256 | } | |
257 | status = new TParameter<int>("dcsResult",dcsResult); | |
258 | resultArray->Add(status); | |
259 | ||
260 | ||
261 | TString runType = GetRunType(); | |
262 | ||
263 | if ( dcsResult == 0 ) { | |
264 | ||
265 | // Temperature sensors are processed by AliTPCCalTemp | |
266 | ||
267 | TString tempConf = fConfEnv->GetValue("Temperature","ON"); | |
268 | tempConf.ToUpper(); | |
269 | if (tempConf != "OFF" ) { | |
270 | UInt_t tempResult = MapTemperature(dcsAliasMap); | |
271 | if ( tempConf != "TRY") result+=tempResult; | |
272 | status = new TParameter<int>("tempResult",tempResult); | |
273 | resultArray->Add(status); | |
274 | } | |
275 | ||
276 | // High Voltage recordings | |
277 | ||
278 | ||
279 | TString hvConf = fConfEnv->GetValue("HighVoltage","ON"); | |
280 | hvConf.ToUpper(); | |
281 | if (hvConf != "OFF" ) { | |
282 | UInt_t hvResult = MapHighVoltage(dcsAliasMap); | |
283 | if (hvConf != "TRY") result+=hvResult; | |
284 | status = new TParameter<int>("hvResult",hvResult); | |
285 | resultArray->Add(status); | |
286 | } | |
287 | ||
288 | // Goofie values | |
289 | ||
290 | ||
291 | TString goofieConf = fConfEnv->GetValue("Goofie","ON"); | |
292 | goofieConf.ToUpper(); | |
293 | if (goofieConf != "OFF" ) { | |
294 | UInt_t goofieResult = MapGoofie(dcsAliasMap); | |
295 | if (goofieConf != "TRY") result+=goofieResult; | |
296 | status = new TParameter<int>("goofieResult",goofieResult); | |
297 | resultArray->Add(status); | |
298 | } | |
299 | ||
300 | // Pressure values | |
301 | ||
302 | if( runType == kPhysicsRunType || | |
303 | runType == kLaserRunType ) { | |
304 | ||
305 | TString pressureConf = fConfEnv->GetValue("Pressure","ON"); | |
306 | pressureConf.ToUpper(); | |
307 | if (pressureConf != "OFF" ) { | |
308 | UInt_t pressureResult = MapPressure(dcsAliasMap); | |
309 | status = new TParameter<int>("pressureResult",pressureResult); | |
310 | resultArray->Add(status); | |
311 | } | |
312 | } | |
313 | } | |
314 | // Other calibration information will be retrieved through FXS files | |
315 | // examples: | |
316 | // TList* fileSourcesDAQ = GetFile(AliShuttleInterface::kDAQ, "pedestals"); | |
317 | // const char* fileNamePed = GetFile(AliShuttleInterface::kDAQ, "pedestals", "LDC1"); | |
318 | // | |
319 | // TList* fileSourcesHLT = GetFile(AliShuttleInterface::kHLT, "calib"); | |
320 | // const char* fileNameHLT = GetFile(AliShuttleInterface::kHLT, "calib", "LDC1"); | |
321 | ||
322 | // pedestal entries | |
323 | ||
324 | if(runType == kPedestalRunType) { | |
325 | Int_t numSources = 1; | |
326 | Int_t pedestalSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ; | |
327 | TString source = fConfEnv->GetValue("Pedestal","DAQ"); | |
328 | source.ToUpper(); | |
329 | if (source != "OFF" ) { | |
330 | if ( source == "HLT") pedestalSource[0] = AliShuttleInterface::kHLT; | |
331 | if (!GetHLTStatus()) pedestalSource[0] = AliShuttleInterface::kDAQ; | |
332 | if (source == "HLTDAQ" ) { | |
333 | numSources=2; | |
334 | pedestalSource[0] = AliShuttleInterface::kHLT; | |
335 | pedestalSource[1] = AliShuttleInterface::kDAQ; | |
336 | } | |
337 | if (source == "DAQHLT" ) numSources=2; | |
338 | UInt_t pedestalResult=0; | |
339 | for (Int_t i=0; i<numSources; i++ ) { | |
340 | pedestalResult = ExtractPedestals(pedestalSource[i]); | |
341 | if ( pedestalResult == 0 ) break; | |
342 | } | |
343 | result += pedestalResult; | |
344 | status = new TParameter<int>("pedestalResult",pedestalResult); | |
345 | resultArray->Add(status); | |
346 | } | |
347 | } | |
348 | ||
349 | // pulser trigger processing | |
350 | ||
351 | if(runType == kPulserRunType) { | |
352 | Int_t numSources = 1; | |
353 | Int_t pulserSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ; | |
354 | TString source = fConfEnv->GetValue("Pulser","DAQ"); | |
355 | source.ToUpper(); | |
356 | if ( source != "OFF") { | |
357 | if ( source == "HLT") pulserSource[0] = AliShuttleInterface::kHLT; | |
358 | if (!GetHLTStatus()) pulserSource[0] = AliShuttleInterface::kDAQ; | |
359 | if (source == "HLTDAQ" ) { | |
360 | numSources=2; | |
361 | pulserSource[0] = AliShuttleInterface::kHLT; | |
362 | pulserSource[1] = AliShuttleInterface::kDAQ; | |
363 | } | |
364 | if (source == "DAQHLT" ) numSources=2; | |
365 | if (source == "TRY" ) numSources=2; | |
366 | UInt_t pulserResult=0; | |
367 | for (Int_t i=0; i<numSources; i++ ) { | |
368 | pulserResult = ExtractPulser(pulserSource[i]); | |
369 | if ( pulserResult == 0 ) break; | |
370 | } | |
371 | if (source != "TRY") result += pulserResult; | |
372 | status = new TParameter<int>("pulserResult",pulserResult); | |
373 | resultArray->Add(status); | |
374 | } | |
375 | } | |
376 | ||
377 | ||
378 | // raw calibration processing | |
379 | ||
380 | if(runType == kPhysicsRunType) { | |
381 | Int_t numSources = 1; | |
382 | Int_t rawSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ; | |
383 | TString source = fConfEnv->GetValue("Raw","DAQ"); | |
384 | source.ToUpper(); | |
385 | if ( source != "OFF") { | |
386 | if ( source == "HLT") rawSource[0] = AliShuttleInterface::kHLT; | |
387 | if (!GetHLTStatus()) rawSource[0] = AliShuttleInterface::kDAQ; | |
388 | if (source == "HLTDAQ" ) { | |
389 | numSources=2; | |
390 | rawSource[0] = AliShuttleInterface::kHLT; | |
391 | rawSource[1] = AliShuttleInterface::kDAQ; | |
392 | } | |
393 | if (source == "DAQHLT" ) numSources=2; | |
394 | if (source == "TRY" ) numSources=2; | |
395 | UInt_t rawResult=0; | |
396 | for (Int_t i=0; i<numSources; i++ ) { | |
397 | rawResult = ExtractRaw(rawSource[i]); | |
398 | if ( rawResult == 0 ) break; | |
399 | } | |
400 | if (source != "TRY" )result += rawResult; | |
401 | status = new TParameter<int>("rawResult",rawResult); | |
402 | resultArray->Add(status); | |
403 | } | |
404 | } | |
405 | ||
406 | ||
407 | // Altro configuration | |
408 | ||
409 | ||
410 | TString altroConf = fConfEnv->GetValue("AltroConf","ON"); | |
411 | altroConf.ToUpper(); | |
412 | if (altroConf != "OFF" ) { | |
413 | UInt_t altroResult = ExtractAltro(AliShuttleInterface::kDCS,dcsAliasMap); | |
414 | if (altroConf != "TRY" ) result+=altroResult; | |
415 | status = new TParameter<int>("altroResult",altroResult); | |
416 | resultArray->Add(status); | |
417 | } | |
418 | ||
419 | ||
420 | // Central Electrode processing | |
421 | ||
422 | if( runType == kPhysicsRunType || | |
423 | runType == kLaserRunType ) { | |
424 | ||
425 | Int_t numSources = 1; | |
426 | Int_t ceSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ; | |
427 | TString source = fConfEnv->GetValue("CE","DAQ"); | |
428 | source.ToUpper(); | |
429 | if ( source != "OFF" ) { | |
430 | if ( source == "HLT") ceSource[0] = AliShuttleInterface::kHLT; | |
431 | if (!GetHLTStatus()) ceSource[0] = AliShuttleInterface::kDAQ; | |
432 | if (source == "HLTDAQ" ) { | |
433 | numSources=2; | |
434 | ceSource[0] = AliShuttleInterface::kHLT; | |
435 | ceSource[1] = AliShuttleInterface::kDAQ; | |
436 | } | |
437 | if (source == "DAQHLT" ) numSources=2; | |
438 | if (source == "TRY" ) numSources=2; | |
439 | UInt_t ceResult=0; | |
440 | for (Int_t i=0; i<numSources; i++ ) { | |
441 | ceResult = ExtractCE(ceSource[i]); | |
442 | if ( ceResult == 0 ) break; | |
443 | } | |
444 | ||
445 | // only flag error if CE result is missing from LASER runs | |
446 | // -- for PHYSICS run do CE processing if data available | |
447 | ||
448 | if ( runType == kLaserRunType && source != "TRY" && ceResult<10 ) result += ceResult; | |
449 | status = new TParameter<int>("ceResult",ceResult); | |
450 | resultArray->Add(status); | |
451 | ||
452 | numSources = 1; | |
453 | Int_t qaSource[2] = {AliShuttleInterface::kDAQ,AliShuttleInterface::kHLT} ; | |
454 | source = fConfEnv->GetValue("QA","DAQ"); | |
455 | source.ToUpper(); | |
456 | if ( source != "OFF" ) { | |
457 | if ( source == "HLT") qaSource[0] = AliShuttleInterface::kHLT; | |
458 | if (!GetHLTStatus()) qaSource[0] = AliShuttleInterface::kDAQ; | |
459 | if (source == "HLTDAQ" ) { | |
460 | numSources=2; | |
461 | qaSource[0] = AliShuttleInterface::kHLT; | |
462 | qaSource[1] = AliShuttleInterface::kDAQ; | |
463 | } | |
464 | if (source == "DAQHLT" ) numSources=2; | |
465 | if (source == "TRY" ) numSources=2; | |
466 | UInt_t qaResult=0; | |
467 | for (Int_t i=0; i<numSources; i++ ) { | |
468 | qaResult = ExtractQA(qaSource[i]); | |
469 | if ( qaResult == 0 ) break; | |
470 | } | |
471 | // result += qaResult; | |
472 | if ( qaResult !=0 ) Log ("ExtractQA failed, no QA entry available."); | |
473 | status = new TParameter<int>("qaResult",qaResult); | |
474 | resultArray->Add(status); | |
475 | } | |
476 | } | |
477 | } | |
478 | ||
479 | // Store component status to OCDB | |
480 | ||
481 | AliCDBMetaData metaData; | |
482 | metaData.SetBeamPeriod(0); | |
483 | metaData.SetResponsible("Haavard Helstrup"); | |
484 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
485 | metaData.SetComment("Preprocessor AliTPC status."); | |
486 | Bool_t storeOK = Store("Calib", "PreprocStatus", resultArray, &metaData, 0, kFALSE); | |
487 | if (!storeOK) Log ("Unable to store preprocessor status entry"); | |
488 | ||
489 | resultArray->Delete(); | |
490 | delete resultArray; | |
491 | ||
492 | if (errorHandling == "OFF" ) return 0; | |
493 | return result; | |
494 | ||
495 | } | |
496 | //______________________________________________________________________________________________ | |
497 | UInt_t AliTPCPreprocessor::MapTemperature(TMap* dcsAliasMap) | |
498 | { | |
499 | ||
500 | // extract DCS temperature maps. Perform fits to save space | |
501 | ||
502 | UInt_t result=0; | |
503 | TMap *map = fTemp->ExtractDCS(dcsAliasMap); | |
504 | if (map) { | |
505 | fTemp->MakeSplineFit(map); | |
506 | Double_t fitFraction = 1.0*fTemp->NumFits()/fTemp->NumSensors(); | |
507 | if (fitFraction > kFitFraction ) { | |
508 | AliInfo(Form("Temperature values extracted, fits performed.\n")); | |
509 | } else { | |
510 | Log ("Too few temperature maps fitted. \n"); | |
511 | result = 9; | |
512 | } | |
513 | } else { | |
514 | Log("No temperature map extracted. \n"); | |
515 | result=9; | |
516 | } | |
517 | delete map; | |
518 | // Now store the final CDB file | |
519 | ||
520 | if ( result == 0 ) { | |
521 | AliCDBMetaData metaData; | |
522 | metaData.SetBeamPeriod(0); | |
523 | metaData.SetResponsible("Haavard Helstrup"); | |
524 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
525 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
526 | ||
527 | Bool_t storeOK = Store("Calib", "Temperature", fTemp, &metaData, 0, kFALSE); | |
528 | if ( !storeOK ) result=1; | |
529 | ||
530 | } | |
531 | ||
532 | return result; | |
533 | ||
534 | } | |
535 | //______________________________________________________________________________________________ | |
536 | UInt_t AliTPCPreprocessor::MapPressure(TMap* dcsAliasMap) | |
537 | { | |
538 | ||
539 | // extract DCS pressure maps. Perform fits to save space | |
540 | ||
541 | UInt_t result=0; | |
542 | TMap *map = fPressure->ExtractDCS(dcsAliasMap); | |
543 | if (map) { | |
544 | fPressure->MakeSplineFit(map); | |
545 | Double_t fitFraction = 1.0*fPressure->NumFits()/fPressure->NumSensors(); | |
546 | if (fitFraction > kFitFraction ) { | |
547 | AliInfo(Form("Pressure values extracted, fits performed.\n")); | |
548 | } else { | |
549 | Log ("Too few pressure maps fitted. \n"); | |
550 | result = 9; | |
551 | } | |
552 | } else { | |
553 | Log("No pressure map extracted. \n"); | |
554 | result=9; | |
555 | } | |
556 | delete map; | |
557 | return result; | |
558 | } | |
559 | ||
560 | //______________________________________________________________________________________________ | |
561 | UInt_t AliTPCPreprocessor::MapHighVoltage(TMap* dcsAliasMap) | |
562 | { | |
563 | ||
564 | // extract DCS HV maps. Perform fits to save space | |
565 | ||
566 | UInt_t result=0; | |
567 | TMap *map = fHighVoltage->ExtractDCS(dcsAliasMap); | |
568 | if (map) { | |
569 | fHighVoltage->ClearFit(); | |
570 | fHighVoltage->RemoveGraphDuplicates(kHighVoltageDifference); | |
571 | // don't keep new point if too similar to previous one | |
572 | fHighVoltage->SetGraph(map); | |
573 | } else { | |
574 | Log("No high voltage recordings extracted. \n"); | |
575 | result=9; | |
576 | } | |
577 | delete map; | |
578 | ||
579 | TString hvStatConf = fConfEnv->GetValue("HighVoltageStat","ON"); | |
580 | hvStatConf.ToUpper(); | |
581 | if (hvStatConf != "OFF" ) { | |
582 | TMap *map2 = fHighVoltageStat->ExtractDCS(dcsAliasMap); | |
583 | if (map2) { | |
584 | fHighVoltageStat->ClearFit(); | |
585 | fHighVoltageStat->SetGraph(map2); | |
586 | } else { | |
587 | Log("No high voltage status recordings extracted. \n"); | |
588 | result=9; | |
589 | } | |
590 | delete map2; | |
591 | ||
592 | // add status maps to high voltage sensor array | |
593 | ||
594 | fHighVoltage->AddSensors(fHighVoltageStat); | |
595 | } | |
596 | // Now store the final CDB file | |
597 | ||
598 | if ( result == 0 ) { | |
599 | AliCDBMetaData metaData; | |
600 | metaData.SetBeamPeriod(0); | |
601 | metaData.SetResponsible("Haavard Helstrup"); | |
602 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
603 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
604 | ||
605 | Bool_t storeOK = Store("Calib", "HighVoltage", fHighVoltage, &metaData, 0, kFALSE); | |
606 | if ( !storeOK ) result=1; | |
607 | ||
608 | } | |
609 | ||
610 | return result; | |
611 | ||
612 | } | |
613 | ||
614 | //______________________________________________________________________________________________ | |
615 | UInt_t AliTPCPreprocessor::MapGoofie(TMap* dcsAliasMap) | |
616 | { | |
617 | ||
618 | // extract DCS Goofie maps. Do not perform fits (low update rate) | |
619 | ||
620 | UInt_t result=0; | |
621 | ||
622 | TMap *map = fGoofie->ExtractDCS(dcsAliasMap); | |
623 | if (map) { | |
624 | fGoofie->ClearFit(); | |
625 | fGoofie->SetGraph(map); | |
626 | } else { | |
627 | Log("No Goofie recordings extracted. \n"); | |
628 | result=9; | |
629 | } | |
630 | delete map; | |
631 | ||
632 | // Now store the final CDB file | |
633 | ||
634 | if ( result == 0 ) { | |
635 | AliCDBMetaData metaData; | |
636 | metaData.SetBeamPeriod(0); | |
637 | metaData.SetResponsible("Haavard Helstrup"); | |
638 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
639 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
640 | ||
641 | Bool_t storeOK = Store("Calib", "Goofie", fGoofie, &metaData, 0, kFALSE); | |
642 | if ( !storeOK ) result=1; | |
643 | ||
644 | } | |
645 | ||
646 | return result; | |
647 | ||
648 | } | |
649 | ||
650 | ||
651 | //______________________________________________________________________________________________ | |
652 | ||
653 | UInt_t AliTPCPreprocessor::ExtractPedestals(Int_t sourceFXS) | |
654 | { | |
655 | // | |
656 | // Read pedestal file from file exchage server | |
657 | // Keep original entry from OCDB in case no new pedestals are available | |
658 | // | |
659 | AliTPCCalPad *calPadPedOCDB=0; | |
660 | AliCDBEntry* entry = GetFromOCDB("Calib", "Pedestals"); | |
661 | if (entry) calPadPedOCDB = (AliTPCCalPad*)entry->GetObject(); | |
662 | if ( calPadPedOCDB==NULL ) { | |
663 | Log("AliTPCPreprocsessor: No previous TPC pedestal entry available.\n"); | |
664 | } | |
665 | ||
666 | AliTPCCalPad *calPadRMSOCDB=0; | |
667 | entry = GetFromOCDB("Calib", "PadNoise"); | |
668 | if (entry) calPadRMSOCDB = (AliTPCCalPad*)entry->GetObject(); | |
669 | if ( calPadRMSOCDB==NULL ) { | |
670 | Log("AliTPCPreprocsessor: No previous TPC noise entry available.\n"); | |
671 | } | |
672 | ||
673 | AliTPCCalPad* calPadPed = new AliTPCCalPad("PedestalsMean","PedestalsMean"); | |
674 | AliTPCCalPad* calPadRMS = new AliTPCCalPad("PedestalsRMS","PedestalsRMS"); | |
675 | ||
676 | ||
677 | UInt_t result=0; | |
678 | ||
679 | Int_t nSectors = fROC->GetNSectors(); | |
680 | TVectorD foundSectorsPed(nSectors); | |
681 | foundSectorsPed=0; | |
682 | TVectorD foundSectorsRMS(nSectors); | |
683 | foundSectorsRMS=0; | |
684 | ||
685 | TList* list = GetFileSources(sourceFXS,"pedestals"); | |
686 | ||
687 | if (list && list->GetEntries()>0) { | |
688 | ||
689 | // loop through all files from LDCs | |
690 | ||
691 | Bool_t changed=false; | |
692 | UInt_t index = 0; | |
693 | while (list->At(index)!=NULL) { | |
694 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
695 | if (fileNameEntry!=NULL) { | |
696 | TString fileName = GetFile(sourceFXS, "pedestals", | |
697 | fileNameEntry->GetString().Data()); | |
698 | TFile *f = TFile::Open(fileName); | |
699 | if (!f) { | |
700 | Log ("Error opening pedestal file."); | |
701 | result =2; | |
702 | break; | |
703 | } | |
704 | AliTPCCalibPedestal *calPed; | |
705 | f->GetObject("tpcCalibPedestal",calPed); | |
706 | if ( !calPed ) { | |
707 | Log ("No pedestal calibration object in file."); | |
708 | result = 2; | |
709 | break; | |
710 | } | |
711 | ||
712 | // replace entries for the sectors available in the present file | |
713 | ||
714 | changed=true; | |
715 | for (Int_t sector=0; sector<nSectors; sector++) { | |
716 | AliTPCCalROC *rocPed=calPed->GetCalRocPedestal(sector, kFALSE); | |
717 | if ( rocPed ) { | |
718 | AliTPCCalROC* roc=calPadPed->GetCalROC(sector); | |
719 | roc->Add(rocPed,1); | |
720 | foundSectorsPed[sector]++; | |
721 | } | |
722 | AliTPCCalROC *rocRMS=calPed->GetCalRocRMS(sector, kFALSE); | |
723 | if ( rocRMS ) { | |
724 | AliTPCCalROC* roc=calPadRMS->GetCalROC(sector); | |
725 | roc->Add(rocRMS,1); | |
726 | foundSectorsRMS[sector]++; | |
727 | } | |
728 | } | |
729 | delete calPed; | |
730 | f->Close(); | |
731 | } | |
732 | ++index; | |
733 | } // while(list) | |
734 | ||
735 | // | |
736 | // Check if calibration is complete -- otherwise take from old OCDB entry | |
737 | ||
738 | // inner sectors | |
739 | for (Int_t sector=0; sector<nSectors/2; sector++) { | |
740 | if (foundSectorsPed[sector] < 1 ) { | |
741 | AliTPCCalROC *rocOCDB=calPadPedOCDB->GetCalROC(sector); | |
742 | calPadPed->SetCalROC(rocOCDB,sector); | |
743 | } | |
744 | if (foundSectorsRMS[sector] < 1 ) { | |
745 | AliTPCCalROC *rocOCDB=calPadRMSOCDB->GetCalROC(sector); | |
746 | calPadRMS->SetCalROC(rocOCDB,sector); | |
747 | } | |
748 | } | |
749 | // outer sectors -- two updates needed | |
750 | for (Int_t sector=nSectors/2; sector<nSectors; sector++) { | |
751 | if (foundSectorsPed[sector] < 2 ) { | |
752 | AliTPCCalROC *rocOCDB=calPadPedOCDB->GetCalROC(sector); | |
753 | calPadPed->SetCalROC(rocOCDB,sector); | |
754 | } | |
755 | if (foundSectorsRMS[sector] < 2 ) { | |
756 | AliTPCCalROC *rocOCDB=calPadRMSOCDB->GetCalROC(sector); | |
757 | calPadRMS->SetCalROC(rocOCDB,sector); | |
758 | } | |
759 | } | |
760 | ||
761 | ||
762 | // | |
763 | // Store updated pedestal entry to OCDB | |
764 | // | |
765 | if (changed) { | |
766 | AliCDBMetaData metaData; | |
767 | metaData.SetBeamPeriod(0); | |
768 | metaData.SetResponsible("Haavard Helstrup"); | |
769 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
770 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
771 | ||
772 | Bool_t storeOK = Store("Calib", "Pedestals", calPadPed, &metaData, 0, kTRUE); | |
773 | if ( !storeOK ) ++result; | |
774 | storeOK = Store("Calib", "PadNoise", calPadRMS, &metaData, 0, kTRUE); | |
775 | if ( !storeOK ) ++result; | |
776 | } | |
777 | } else { | |
778 | Log ("Error: no entries in pedestal file list!"); | |
779 | result = 1; | |
780 | } | |
781 | ||
782 | delete calPadPed; | |
783 | delete calPadRMS; | |
784 | delete calPadPedOCDB; | |
785 | delete calPadRMSOCDB; | |
786 | ||
787 | return result; | |
788 | } | |
789 | ||
790 | //______________________________________________________________________________________________ | |
791 | ||
792 | ||
793 | UInt_t AliTPCPreprocessor::ExtractPulser(Int_t sourceFXS) | |
794 | { | |
795 | // | |
796 | // Read pulser calibration file from file exchage server | |
797 | // Keep original entry from OCDB in case no new pulser calibration is available | |
798 | // | |
799 | ||
800 | TObjArray *pulserObjects = new TObjArray; | |
801 | TObjArray *pulserObjectsOCDB=0; | |
802 | ||
803 | AliCDBEntry* entry = GetFromOCDB("Calib", "Pulser"); | |
804 | if (entry) pulserObjectsOCDB = (TObjArray*)entry->GetObject(); | |
805 | if ( pulserObjectsOCDB==NULL ) { | |
806 | Log("AliTPCPreprocsessor: No previous TPC pulser entry available.\n"); | |
807 | } | |
808 | ||
809 | AliTPCCalPad *pulserTmean = new AliTPCCalPad("PulserTmean","PulserTmean"); | |
810 | pulserObjects->Add(pulserTmean); | |
811 | ||
812 | AliTPCCalPad *pulserTrms = new AliTPCCalPad("PulserTrms","PulserTrms"); | |
813 | pulserObjects->Add(pulserTrms); | |
814 | ||
815 | AliTPCCalPad *pulserQmean = new AliTPCCalPad("PulserQmean","PulserQmean"); | |
816 | pulserObjects->Add(pulserQmean); | |
817 | ||
818 | ||
819 | ||
820 | UInt_t result=0; | |
821 | ||
822 | Int_t nSectors = fROC->GetNSectors(); | |
823 | TVectorD foundTmean(nSectors); | |
824 | foundTmean=0; | |
825 | TVectorD foundTrms(nSectors); | |
826 | foundTrms=0; | |
827 | TVectorD foundQmean(nSectors); | |
828 | foundQmean=0; | |
829 | ||
830 | ||
831 | TList* list = GetFileSources(sourceFXS,"pulser"); | |
832 | ||
833 | if (list && list->GetEntries()>0) { | |
834 | ||
835 | // loop through all files from LDCs | |
836 | ||
837 | Bool_t changed=false; | |
838 | UInt_t index = 0; | |
839 | while (list->At(index)!=NULL) { | |
840 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
841 | if (fileNameEntry!=NULL) { | |
842 | TString fileName = GetFile(sourceFXS, "pulser", | |
843 | fileNameEntry->GetString().Data()); | |
844 | TFile *f = TFile::Open(fileName); | |
845 | if (!f) { | |
846 | Log ("Error opening pulser file."); | |
847 | result =2; | |
848 | break; | |
849 | } | |
850 | AliTPCCalibPulser *calPulser; | |
851 | f->GetObject("tpcCalibPulser",calPulser); | |
852 | if ( !calPulser ) { | |
853 | Log ("No pulser calibration object in file."); | |
854 | result = 2; | |
855 | break; | |
856 | } | |
857 | ||
858 | // replace entries for the sectors available in the present file | |
859 | ||
860 | changed=true; | |
861 | for (Int_t sector=0; sector<nSectors; sector++) { | |
862 | AliTPCCalROC *rocTmean=calPulser->GetCalRocT0(sector); | |
863 | if ( rocTmean ) { | |
864 | AliTPCCalROC* roc=pulserTmean->GetCalROC(sector); | |
865 | roc->Add(rocTmean,1); | |
866 | foundTmean[sector]++; | |
867 | } | |
868 | AliTPCCalROC *rocTrms=calPulser->GetCalRocRMS(sector); | |
869 | if ( rocTrms ) { | |
870 | AliTPCCalROC* roc=pulserTrms->GetCalROC(sector); | |
871 | roc->Add(rocTrms,1); | |
872 | foundTrms[sector]++; | |
873 | } | |
874 | AliTPCCalROC *rocQmean=calPulser->GetCalRocQ(sector); | |
875 | if ( rocQmean ) { | |
876 | AliTPCCalROC* roc=pulserQmean->GetCalROC(sector); | |
877 | roc->Add(rocQmean,1); | |
878 | foundQmean[sector]++; | |
879 | } | |
880 | } | |
881 | delete calPulser; | |
882 | f->Close(); | |
883 | } | |
884 | ++index; | |
885 | } // while(list) | |
886 | ||
887 | ||
888 | ||
889 | ||
890 | if (pulserObjectsOCDB) { | |
891 | AliTPCCalPad* pulserTmeanOCDB = (AliTPCCalPad*)pulserObjectsOCDB->FindObject("PulserTmean"); | |
892 | AliTPCCalPad* pulserTrmsOCDB = (AliTPCCalPad*)pulserObjectsOCDB->FindObject("PulserTrms"); | |
893 | AliTPCCalPad* pulserQmeanOCDB = (AliTPCCalPad*)pulserObjectsOCDB->FindObject("PulserQmean"); | |
894 | ||
895 | // | |
896 | // Check if calibration is complete -- otherwise take from old OCDB entry | |
897 | ||
898 | // inner sectors | |
899 | for (Int_t sector=0; sector<nSectors/2; sector++) { | |
900 | if (foundTmean[sector] < 1 ) { | |
901 | if (pulserTmeanOCDB) { | |
902 | AliTPCCalROC* rocOCDB = pulserTmeanOCDB->GetCalROC(sector); | |
903 | if ( rocOCDB ) pulserTmean->SetCalROC(rocOCDB,sector); | |
904 | } | |
905 | } | |
906 | if (foundTrms[sector] < 1 ) { | |
907 | if (pulserTrmsOCDB) { | |
908 | AliTPCCalROC* rocOCDB = pulserTrmsOCDB->GetCalROC(sector); | |
909 | if ( rocOCDB ) pulserTrms->SetCalROC(rocOCDB,sector); | |
910 | } | |
911 | } | |
912 | if (foundQmean[sector] < 1 ) { | |
913 | if (pulserQmeanOCDB) { | |
914 | AliTPCCalROC* rocOCDB = pulserQmeanOCDB->GetCalROC(sector); | |
915 | if ( rocOCDB ) pulserQmean->SetCalROC(rocOCDB,sector); | |
916 | } | |
917 | } | |
918 | } | |
919 | ||
920 | // outer sectors -- two updates needed | |
921 | ||
922 | for (Int_t sector=0; sector<nSectors/2; sector++) { | |
923 | if (foundTmean[sector] < 2 ) { | |
924 | if (pulserTmeanOCDB) { | |
925 | AliTPCCalROC* rocOCDB = pulserTmeanOCDB->GetCalROC(sector); | |
926 | if ( rocOCDB ) pulserTmean->SetCalROC(rocOCDB,sector); | |
927 | } | |
928 | } | |
929 | if (foundTrms[sector] < 2 ) { | |
930 | if (pulserTrmsOCDB) { | |
931 | AliTPCCalROC* rocOCDB = pulserTrmsOCDB->GetCalROC(sector); | |
932 | if ( rocOCDB ) pulserTrms->SetCalROC(rocOCDB,sector); | |
933 | } | |
934 | } | |
935 | if (foundQmean[sector] < 2 ) { | |
936 | if (pulserQmeanOCDB) { | |
937 | AliTPCCalROC* rocOCDB = pulserQmeanOCDB->GetCalROC(sector); | |
938 | if ( rocOCDB ) pulserQmean->SetCalROC(rocOCDB,sector); | |
939 | } | |
940 | } | |
941 | ||
942 | } | |
943 | } | |
944 | ||
945 | // | |
946 | // Store updated pedestal entry to OCDB | |
947 | // | |
948 | if (changed) { | |
949 | AliCDBMetaData metaData; | |
950 | metaData.SetBeamPeriod(0); | |
951 | metaData.SetResponsible("Haavard Helstrup"); | |
952 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
953 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
954 | ||
955 | Bool_t storeOK = Store("Calib", "Pulser", pulserObjects, &metaData, 0, kTRUE); | |
956 | if ( !storeOK ) ++result; | |
957 | } | |
958 | } else { | |
959 | Log ("Error: no entries in pulser file list!"); | |
960 | result = 1; | |
961 | } | |
962 | pulserObjects->Delete(); | |
963 | delete pulserObjects; | |
964 | pulserObjectsOCDB->Delete(); | |
965 | delete pulserObjectsOCDB; | |
966 | ||
967 | return result; | |
968 | } | |
969 | ||
970 | //______________________________________________________________________________________________ | |
971 | ||
972 | ||
973 | UInt_t AliTPCPreprocessor::ExtractRaw(Int_t sourceFXS) | |
974 | { | |
975 | // | |
976 | // Read Raw calibration file from file exchage server | |
977 | // | |
978 | ||
979 | UInt_t result=0; | |
980 | TObjArray* rawArray = new TObjArray; | |
981 | ||
982 | TList* list = GetFileSources(sourceFXS,"tpcCalibRaw"); | |
983 | ||
984 | if (list && list->GetEntries()>0) { | |
985 | ||
986 | // loop through all files | |
987 | ||
988 | UInt_t index = 0; | |
989 | while (list->At(index)!=NULL) { | |
990 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
991 | if (fileNameEntry!=NULL) { | |
992 | TString fileName = GetFile(sourceFXS, "tpcCalibRaw", | |
993 | fileNameEntry->GetString().Data()); | |
994 | TFile *f = TFile::Open(fileName); | |
995 | if (!f) { | |
996 | Log ("Error opening raw file."); | |
997 | result =2; | |
998 | break; | |
999 | } | |
1000 | AliTPCCalibRaw *calRaw; | |
1001 | f->GetObject("tpcCalibRaw",calRaw); | |
1002 | if ( !calRaw ) { | |
1003 | Log ("No raw calibration object in file."); | |
1004 | result = 2; | |
1005 | break; | |
1006 | } | |
1007 | rawArray->Add(calRaw); | |
1008 | f->Close(); | |
1009 | } | |
1010 | ++index; | |
1011 | } // while(list) | |
1012 | // | |
1013 | // Store updated pedestal entry to OCDB | |
1014 | // | |
1015 | AliCDBMetaData metaData; | |
1016 | metaData.SetBeamPeriod(0); | |
1017 | metaData.SetResponsible("Haavard Helstrup"); | |
1018 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
1019 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
1020 | ||
1021 | Bool_t storeOK = Store("Calib", "Raw", rawArray, &metaData, 0, kTRUE); | |
1022 | if ( !storeOK ) ++result; | |
1023 | } else { | |
1024 | Log ("Error: no entries in raw file list!"); | |
1025 | result = 1; | |
1026 | } | |
1027 | ||
1028 | rawArray->Delete(); | |
1029 | delete rawArray; | |
1030 | ||
1031 | return result; | |
1032 | } | |
1033 | //______________________________________________________________________________________________ | |
1034 | ||
1035 | UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS) | |
1036 | { | |
1037 | // | |
1038 | // Read Central Electrode file from file exchage server | |
1039 | // | |
1040 | // | |
1041 | AliTPCCalPad *ceTmean=0; | |
1042 | AliTPCCalPad *ceTrms=0; | |
1043 | AliTPCCalPad *ceQmean=0; | |
1044 | TObjArray *rocTtime=0; | |
1045 | TObjArray *rocQtime=0; | |
1046 | ||
1047 | TObjArray *ceObjects= new TObjArray; | |
1048 | ||
1049 | ||
1050 | Int_t nSectors = fROC->GetNSectors(); | |
1051 | ||
1052 | ceTmean = new AliTPCCalPad("CETmean","CETmean"); | |
1053 | ceObjects->Add(ceTmean); | |
1054 | ||
1055 | ceTrms = new AliTPCCalPad("CETrms","CETrms"); | |
1056 | ceObjects->Add(ceTrms); | |
1057 | ||
1058 | ceQmean = new AliTPCCalPad("CEQmean","CEQmean"); | |
1059 | ceObjects->Add(ceQmean); | |
1060 | ||
1061 | rocTtime = new TObjArray(nSectors+2); // also make room for A and C side average | |
1062 | rocTtime->SetName("rocTtime"); | |
1063 | ceObjects->Add(rocTtime); | |
1064 | ||
1065 | rocQtime = new TObjArray(nSectors); | |
1066 | rocQtime->SetName("rocQtime"); | |
1067 | ceObjects->Add(rocQtime); | |
1068 | ||
1069 | //=== new part | |
1070 | TObjArray *arrFitGraphs=new TObjArray; | |
1071 | arrFitGraphs->SetName("ceFitsDrift"); | |
1072 | ceObjects->Add(arrFitGraphs); | |
1073 | ||
1074 | // Temperature maps | |
1075 | ||
1076 | if (fTemp) { | |
1077 | AliTPCSensorTempArray *tempMap = new AliTPCSensorTempArray(*fTemp); | |
1078 | tempMap->SetNameTitle("TempMap","TempMap"); | |
1079 | ceObjects->Add(tempMap); | |
1080 | } | |
1081 | ||
1082 | // Pressure maps | |
1083 | ||
1084 | if (fPressure) { | |
1085 | AliDCSSensor *sensor=0, *sensorCopy=0; | |
1086 | for (Int_t isensor=0; isensor<kNumPressureSensors; ++isensor ) { | |
1087 | sensor = fPressure->GetSensor(kPressureSensorNames[isensor]); | |
1088 | if (sensor) { | |
1089 | sensorCopy = new AliDCSSensor(*sensor); | |
1090 | sensorCopy->SetNameTitle(kPressureSensorNames[isensor],kPressureSensorNames[isensor]); | |
1091 | ceObjects->Add(sensorCopy); | |
1092 | } | |
1093 | } | |
1094 | } | |
1095 | ||
1096 | UInt_t result=0; | |
1097 | ||
1098 | TList* list = GetFileSources(sourceFXS,"CE"); | |
1099 | ||
1100 | if (list && list->GetEntries()>0) { | |
1101 | ||
1102 | // loop through all files from LDCs | |
1103 | ||
1104 | UInt_t index = 0; | |
1105 | while (list->At(index)!=NULL) { | |
1106 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
1107 | if (fileNameEntry!=NULL) { | |
1108 | TString fileName = GetFile(sourceFXS, "CE", | |
1109 | fileNameEntry->GetString().Data()); | |
1110 | AliTPCCalibCE *calCE=AliTPCCalibCE::ReadFromFile(fileName.Data()); | |
1111 | ||
1112 | if (!calCE) { | |
1113 | Log ("No valid calibCE object."); | |
1114 | result=2; | |
1115 | break; | |
1116 | } | |
1117 | // replace entries for the sectors available in the present file | |
1118 | ||
1119 | for (Int_t sector=0; sector<nSectors; sector++) { | |
1120 | AliTPCCalROC *rocTmean=calCE->GetCalRocT0(sector); | |
1121 | if ( rocTmean ) ceTmean->SetCalROC(rocTmean,sector); | |
1122 | AliTPCCalROC *rocTrms=calCE->GetCalRocRMS(sector); | |
1123 | if ( rocTrms ) ceTrms->SetCalROC(rocTrms,sector); | |
1124 | AliTPCCalROC *rocQmean=calCE->GetCalRocQ(sector); | |
1125 | if ( rocQmean ) ceQmean->SetCalROC(rocQmean,sector); | |
1126 | TGraph *grT=calCE->MakeGraphTimeCE(sector,0,2); // T time graph | |
1127 | if ( grT ) rocTtime->AddAt(grT,sector); | |
1128 | TGraph *grQ=calCE->MakeGraphTimeCE(sector,0,3); // Q time graph | |
1129 | if ( grQ ) rocQtime->AddAt(grQ,sector); | |
1130 | } | |
1131 | ||
1132 | TGraph *grT=calCE->MakeGraphTimeCE(-1,0,2); // A side average | |
1133 | if ( grT ) { | |
1134 | rocTtime->AddAt(grT,nSectors); | |
1135 | } else { | |
1136 | result=10; | |
1137 | } | |
1138 | grT=calCE->MakeGraphTimeCE(-2,0,2); // C side average | |
1139 | if ( grT ) { | |
1140 | rocTtime->AddAt(grT,nSectors+1); | |
1141 | } else { | |
1142 | result=10; | |
1143 | } | |
1144 | ||
1145 | delete calCE; | |
1146 | } | |
1147 | ++index; | |
1148 | } // while(list) | |
1149 | // | |
1150 | // Check number of calibrated sectors per side | |
1151 | // | |
1152 | Int_t aside=0, cside=0; | |
1153 | for (Int_t ind=0; ind<nSectors/4; ind++ ) { | |
1154 | TGraph *grT=(TGraph*)rocTtime->At(ind); | |
1155 | if (grT) aside++; | |
1156 | grT=(TGraph*)rocTtime->At(ind+nSectors/2); | |
1157 | if (grT) aside++; | |
1158 | grT=(TGraph*)rocTtime->At(ind+nSectors/4); | |
1159 | if (grT) cside++; | |
1160 | grT=(TGraph*)rocTtime->At(ind+3*nSectors/4); | |
1161 | if (grT) cside++; | |
1162 | } | |
1163 | if ( (aside<kMinCESectors) && (cside<kMinCESectors) ) { | |
1164 | Log (Form("ExtractCE: Too few fitted sectors: Aside =%d, Cside=%d\n", | |
1165 | aside, cside)) ; | |
1166 | result=10; | |
1167 | } | |
1168 | ||
1169 | // | |
1170 | //=== New CE part | |
1171 | // if it is validated this part needs to be modified again | |
1172 | // currently its only processed if there is a valid standard CE object | |
1173 | // | |
1174 | list = GetFileSources(sourceFXS,"CEnew"); | |
1175 | ||
1176 | if (result==0 && list && list->GetEntries()>0) { | |
1177 | ||
1178 | // loop through all files from LDCs | |
1179 | ||
1180 | UInt_t index2 = 0; | |
1181 | while (list->At(index2)!=NULL) { | |
1182 | TObjString* fileNameEntry = (TObjString*) list->At(index2); | |
1183 | if (fileNameEntry!=NULL) { | |
1184 | TString fileName = GetFile(sourceFXS, "CEnew", | |
1185 | fileNameEntry->GetString().Data()); | |
1186 | AliTPCCalibCE *calCE=AliTPCCalibCE::ReadFromFile(fileName.Data()); | |
1187 | ||
1188 | if (!calCE) { | |
1189 | Log ("No valid new calibCE object."); | |
1190 | // result=2; | |
1191 | break; | |
1192 | } | |
1193 | ||
1194 | TIter nextObj(calCE->GetArrFitGraphs()); | |
1195 | TObject *obj=0x0; | |
1196 | while ( (obj=nextObj()) ){ | |
1197 | arrFitGraphs->Add(obj->Clone()); | |
1198 | } | |
1199 | delete calCE; | |
1200 | } | |
1201 | ++index2; | |
1202 | } | |
1203 | } | |
1204 | ||
1205 | // | |
1206 | // Store updated pedestal entry to OCDB | |
1207 | // | |
1208 | AliCDBMetaData metaData; | |
1209 | metaData.SetBeamPeriod(0); | |
1210 | metaData.SetResponsible("Haavard Helstrup"); | |
1211 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
1212 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
1213 | ||
1214 | if ( result == 0 ) { | |
1215 | Bool_t storeOK = Store("Calib", "CE", ceObjects, &metaData, 0, kTRUE); | |
1216 | if ( !storeOK ) ++result; | |
1217 | } else { | |
1218 | Log ("Warning: Average time graphs not available - no OCDB entry written"); | |
1219 | } | |
1220 | } else { | |
1221 | Log ("Error: no CE entries available from FXS!"); | |
1222 | result = 1; | |
1223 | } | |
1224 | ||
1225 | ceObjects->Delete(); | |
1226 | delete ceObjects; | |
1227 | ||
1228 | return result; | |
1229 | } | |
1230 | //______________________________________________________________________________________________ | |
1231 | ||
1232 | UInt_t AliTPCPreprocessor::ExtractQA(Int_t sourceFXS) | |
1233 | { | |
1234 | // | |
1235 | // Read Quality Assurance file from file exchage server | |
1236 | // | |
1237 | ||
1238 | UInt_t result=0; | |
1239 | ||
1240 | TList* list = GetFileSources(sourceFXS,"QA"); | |
1241 | ||
1242 | if (list && list->GetEntries()>0) { | |
1243 | ||
1244 | // only one QA object should be available! | |
1245 | ||
1246 | AliTPCdataQA *calQA; | |
1247 | ||
1248 | UInt_t nentries = list->GetEntries(); | |
1249 | UInt_t index=0; | |
1250 | if ( nentries > 1) Log ( "More than one QA entry. First one processed"); | |
1251 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
1252 | if (fileNameEntry!=NULL) { | |
1253 | TString fileName = GetFile(sourceFXS, "QA", | |
1254 | fileNameEntry->GetString().Data()); | |
1255 | TFile *f = TFile::Open(fileName); | |
1256 | if (!f) { | |
1257 | Log ("Error opening QA file."); | |
1258 | result =2; | |
1259 | } else { | |
1260 | f->GetObject("tpcCalibQA",calQA); | |
1261 | if ( calQA ) { | |
1262 | // | |
1263 | // Store updated pedestal entry to OCDB | |
1264 | // | |
1265 | AliCDBMetaData metaData; | |
1266 | metaData.SetBeamPeriod(0); | |
1267 | metaData.SetResponsible("Haavard Helstrup"); | |
1268 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
1269 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
1270 | ||
1271 | Bool_t storeOK = Store("Calib", "QA", calQA, &metaData, 0, kFALSE); | |
1272 | if ( !storeOK ) ++result; | |
1273 | ||
1274 | delete calQA; | |
1275 | } | |
1276 | } | |
1277 | } else { | |
1278 | Log ("Error: no QA files on FXS!"); | |
1279 | result = 2; | |
1280 | } | |
1281 | } else { | |
1282 | Log ("Error: no QA entries in FXS list!"); | |
1283 | result = 1; | |
1284 | } | |
1285 | return result; | |
1286 | } | |
1287 | ||
1288 | //______________________________________________________________________________________________ | |
1289 | ||
1290 | ||
1291 | UInt_t AliTPCPreprocessor::ExtractAltro(Int_t sourceFXS, TMap* dcsMap) | |
1292 | { | |
1293 | // | |
1294 | // Read Altro configuration file from file exchage server | |
1295 | // Keep original entry from OCDB in case no new pulser calibration is available | |
1296 | // | |
1297 | TObjArray *altroObjects=0; | |
1298 | AliTPCCalPad *acqStart=0; | |
1299 | AliTPCCalPad *zsThr=0; | |
1300 | AliTPCCalPad *acqStop=0; | |
1301 | AliTPCCalPad *FPED=0; | |
1302 | AliTPCCalPad *masked=0; | |
1303 | AliTPCCalPad *k1=0, *k2=0, *k3=0; | |
1304 | AliTPCCalPad *l1=0, *l2=0, *l3=0; | |
1305 | TMap *mapRCUconfig=0; | |
1306 | ||
1307 | AliCDBEntry* entry = GetFromOCDB("Calib", "AltroConfig"); | |
1308 | if (entry) altroObjects = (TObjArray*)entry->GetObject(); | |
1309 | if ( altroObjects==NULL ) { | |
1310 | Log("AliTPCPreprocsessor: No previous TPC altro calibration entry available.\n"); | |
1311 | altroObjects = new TObjArray; | |
1312 | } | |
1313 | ||
1314 | acqStart = (AliTPCCalPad*)altroObjects->FindObject("AcqStart"); | |
1315 | if ( !acqStart ) { | |
1316 | acqStart = new AliTPCCalPad("AcqStart","AcqStart"); | |
1317 | altroObjects->Add(acqStart); | |
1318 | } | |
1319 | zsThr = (AliTPCCalPad*)altroObjects->FindObject("ZsThr"); | |
1320 | if ( !zsThr ) { | |
1321 | zsThr = new AliTPCCalPad("ZsThr","ZsThr"); | |
1322 | altroObjects->Add(zsThr); | |
1323 | } | |
1324 | FPED = (AliTPCCalPad*)altroObjects->FindObject("FPED"); | |
1325 | if ( !FPED ) { | |
1326 | FPED = new AliTPCCalPad("FPED","FPED"); | |
1327 | altroObjects->Add(FPED); | |
1328 | } | |
1329 | acqStop = (AliTPCCalPad*)altroObjects->FindObject("AcqStop"); | |
1330 | if ( !acqStop ) { | |
1331 | acqStop = new AliTPCCalPad("AcqStop","AcqStop"); | |
1332 | altroObjects->Add(acqStop); | |
1333 | } | |
1334 | masked = (AliTPCCalPad*)altroObjects->FindObject("Masked"); | |
1335 | if ( !masked ) { | |
1336 | masked = new AliTPCCalPad("Masked","Masked"); | |
1337 | altroObjects->Add(masked); | |
1338 | } | |
1339 | k1 = (AliTPCCalPad*)altroObjects->FindObject("K1"); | |
1340 | if ( !k1 ) { | |
1341 | k1 = new AliTPCCalPad("K1","K1"); | |
1342 | altroObjects->Add(k1); | |
1343 | } | |
1344 | k2 = (AliTPCCalPad*)altroObjects->FindObject("K2"); | |
1345 | if ( !k2 ) { | |
1346 | k2 = new AliTPCCalPad("K2","K2"); | |
1347 | altroObjects->Add(k2); | |
1348 | } | |
1349 | k3 = (AliTPCCalPad*)altroObjects->FindObject("K3"); | |
1350 | if ( !k3 ) { | |
1351 | k3 = new AliTPCCalPad("K3","K3"); | |
1352 | altroObjects->Add(k3); | |
1353 | } | |
1354 | l1 = (AliTPCCalPad*)altroObjects->FindObject("L1"); | |
1355 | if ( !l1 ) { | |
1356 | l1 = new AliTPCCalPad("L1","L1"); | |
1357 | altroObjects->Add(l1); | |
1358 | } | |
1359 | l2 = (AliTPCCalPad*)altroObjects->FindObject("L2"); | |
1360 | if ( !l2 ) { | |
1361 | l2 = new AliTPCCalPad("L2","L2"); | |
1362 | altroObjects->Add(l2); | |
1363 | } | |
1364 | l3 = (AliTPCCalPad*)altroObjects->FindObject("L3"); | |
1365 | if ( !l3 ) { | |
1366 | l3 = new AliTPCCalPad("L3","L3"); | |
1367 | altroObjects->Add(l3); | |
1368 | } | |
1369 | mapRCUconfig = (TMap*)altroObjects->FindObject("RCUconfig"); | |
1370 | if (!mapRCUconfig) { | |
1371 | mapRCUconfig = new TMap(); | |
1372 | mapRCUconfig->SetName("RCUconfig"); | |
1373 | altroObjects->Add(mapRCUconfig); | |
1374 | } | |
1375 | ||
1376 | ||
1377 | UInt_t result=0; | |
1378 | TString idFXS[2]={"AltroConfigA","AltroConfigC"}; | |
1379 | ||
1380 | Int_t nSectors = fROC->GetNSectors(); | |
1381 | Bool_t changed=false; | |
1382 | if (altroObjects == 0 ) altroObjects = new TObjArray; | |
1383 | ||
1384 | // extract list of active DDLs | |
1385 | ||
1386 | Bool_t found; | |
1387 | TString arrDDL(kNumDDL); | |
1388 | arrDDL.Append('x',kNumDDL); | |
1389 | for ( Int_t iDDL = 0; iDDL<kNumDDL; iDDL++ ) { | |
1390 | TString stringID = Form (kAmandaDDL.Data(),iDDL+kFirstDDL); | |
1391 | TPair *pair = (TPair*)dcsMap->FindObject(stringID.Data()); | |
1392 | found = false; | |
1393 | if ( pair ) { | |
1394 | TObjArray *valueSet=(TObjArray*)pair->Value(); | |
1395 | if ( valueSet) { | |
1396 | AliDCSValue *val = (AliDCSValue*)valueSet->At(0); | |
1397 | if (val) { | |
1398 | found = val->GetBool(); | |
1399 | if (found){ | |
1400 | arrDDL[iDDL] = '1'; | |
1401 | } else { | |
1402 | arrDDL[iDDL] = '0'; | |
1403 | } | |
1404 | } | |
1405 | } | |
1406 | } | |
1407 | } | |
1408 | TObjString *ddlArray = new TObjString; | |
1409 | ddlArray->SetString(arrDDL); | |
1410 | TMap *activeDDL = new TMap; | |
1411 | activeDDL->SetName("DDLArray"); | |
1412 | TObjString *key = new TObjString("DDLArray"); | |
1413 | activeDDL->Add(key,ddlArray); | |
1414 | altroObjects->Add(activeDDL); | |
1415 | changed=true; | |
1416 | ||
1417 | ||
1418 | // extract Altro configuration files | |
1419 | ||
1420 | for ( Int_t id=0; id<2; id++) { | |
1421 | TList* list = GetFileSources(sourceFXS,idFXS[id].Data()); | |
1422 | ||
1423 | if (list && list->GetEntries()>0) { | |
1424 | ||
1425 | // loop through all files from LDCs | |
1426 | ||
1427 | UInt_t index = 0; | |
1428 | while (list->At(index)!=NULL) { | |
1429 | TObjString* fileNameEntry = (TObjString*) list->At(index); | |
1430 | if (fileNameEntry!=NULL) { | |
1431 | TString fileName = GetFile(sourceFXS, idFXS[id].Data(), | |
1432 | fileNameEntry->GetString().Data()); | |
1433 | TFile *f = TFile::Open(fileName); | |
1434 | if (!f) { | |
1435 | const int mess_length=40; | |
1436 | char message[mess_length]; | |
1437 | snprintf(message,mess_length,"Error opening Altro configuration file, id = %d",id); | |
1438 | Log (message); | |
1439 | result =2; | |
1440 | break; | |
1441 | } | |
1442 | TObjArray *altroFXS; | |
1443 | f->GetObject("AltroConfig",altroFXS); | |
1444 | if ( !altroFXS ) { | |
1445 | Log ("No Altro configuration object in file."); | |
1446 | result = 2; | |
1447 | break; | |
1448 | } | |
1449 | ||
1450 | // replace entries for the sectors available in the present file | |
1451 | AliTPCCalPad *acqStartFXS=(AliTPCCalPad*)altroFXS->FindObject("AcqStart"); | |
1452 | AliTPCCalPad *zsThrFXS=(AliTPCCalPad*)altroFXS->FindObject("ZsThr"); | |
1453 | AliTPCCalPad *acqStopFXS=(AliTPCCalPad*)altroFXS->FindObject("AcqStop"); | |
1454 | AliTPCCalPad *FPEDFXS=(AliTPCCalPad*)altroFXS->FindObject("FPED"); | |
1455 | AliTPCCalPad *maskedFXS=(AliTPCCalPad*)altroFXS->FindObject("Masked"); | |
1456 | AliTPCCalPad *k1FXS=(AliTPCCalPad*)altroFXS->FindObject("K1"); | |
1457 | AliTPCCalPad *k2FXS=(AliTPCCalPad*)altroFXS->FindObject("K2"); | |
1458 | AliTPCCalPad *k3FXS=(AliTPCCalPad*)altroFXS->FindObject("K3"); | |
1459 | AliTPCCalPad *l1FXS=(AliTPCCalPad*)altroFXS->FindObject("L1"); | |
1460 | AliTPCCalPad *l2FXS=(AliTPCCalPad*)altroFXS->FindObject("L2"); | |
1461 | AliTPCCalPad *l3FXS=(AliTPCCalPad*)altroFXS->FindObject("L3"); | |
1462 | TMap *mapRCUconfigFXS = (TMap*)altroFXS->FindObject("RCUconfig"); | |
1463 | TIterator *mapFXSiter = mapRCUconfigFXS->MakeIterator(); | |
1464 | ||
1465 | changed=true; | |
1466 | for (Int_t sector=0; sector<nSectors; sector++) { | |
1467 | ||
1468 | if (acqStartFXS) { | |
1469 | AliTPCCalROC *rocAcqStart=acqStartFXS->GetCalROC(sector); | |
1470 | if ( rocAcqStart ) acqStart->SetCalROC(rocAcqStart,sector); | |
1471 | } | |
1472 | if (zsThrFXS ) { | |
1473 | AliTPCCalROC *rocZsThr=zsThrFXS->GetCalROC(sector); | |
1474 | if ( rocZsThr ) zsThr->SetCalROC(rocZsThr,sector); | |
1475 | } | |
1476 | if (acqStopFXS) { | |
1477 | AliTPCCalROC *rocAcqStop=acqStopFXS->GetCalROC(sector); | |
1478 | if ( rocAcqStop ) acqStop->SetCalROC(rocAcqStop,sector); | |
1479 | } | |
1480 | if (FPEDFXS ) { | |
1481 | AliTPCCalROC *rocFPED=FPEDFXS->GetCalROC(sector); | |
1482 | if ( rocFPED ) FPED->SetCalROC(rocFPED,sector); | |
1483 | } | |
1484 | if (maskedFXS) { | |
1485 | AliTPCCalROC *rocMasked=maskedFXS->GetCalROC(sector); | |
1486 | if ( rocMasked ) masked->SetCalROC(rocMasked,sector); | |
1487 | } | |
1488 | if (k1FXS) { | |
1489 | AliTPCCalROC *rocK1=k1FXS->GetCalROC(sector); | |
1490 | if ( rocK1 ) k1->SetCalROC(rocK1,sector); | |
1491 | } | |
1492 | if (k2FXS) { | |
1493 | AliTPCCalROC *rocK2=k2FXS->GetCalROC(sector); | |
1494 | if ( rocK2 ) k2->SetCalROC(rocK2,sector); | |
1495 | } | |
1496 | if (k3FXS) { | |
1497 | AliTPCCalROC *rocK3=k3FXS->GetCalROC(sector); | |
1498 | if ( rocK3 ) k3->SetCalROC(rocK3,sector); | |
1499 | } | |
1500 | if (l1FXS) { | |
1501 | AliTPCCalROC *rocL1=l1FXS->GetCalROC(sector); | |
1502 | if ( rocL1 ) l1->SetCalROC(rocL1,sector); | |
1503 | } | |
1504 | if (l2FXS) { | |
1505 | AliTPCCalROC *rocL2=l2FXS->GetCalROC(sector); | |
1506 | if ( rocL2 ) l2->SetCalROC(rocL2,sector); | |
1507 | } | |
1508 | if (l3FXS) { | |
1509 | AliTPCCalROC *rocL3=l3FXS->GetCalROC(sector); | |
1510 | if ( rocL3 ) l3->SetCalROC(rocL3,sector); | |
1511 | } | |
1512 | } | |
1513 | if (mapRCUconfigFXS) { | |
1514 | Int_t mapEntries = mapRCUconfigFXS->GetEntries(); | |
1515 | TObjString* keyFXS; | |
1516 | TVectorF* vecFXS; | |
1517 | TVectorF* vec; // nSectors = 72 (total number of inner/outer sectors) | |
1518 | for (Int_t i=0; i<mapEntries; ++i) { | |
1519 | keyFXS=(TObjString*)mapFXSiter->Next(); | |
1520 | vecFXS=(TVectorF*)mapRCUconfigFXS->GetValue(keyFXS); | |
1521 | vec=(TVectorF*)mapRCUconfig->GetValue(keyFXS); | |
1522 | if (!vec) { | |
1523 | vec = new TVectorF(3*nSectors); | |
1524 | *vec = -1; | |
1525 | mapRCUconfig->Add(keyFXS,vec); | |
1526 | } | |
1527 | if (vec->GetNoElements() != 3*nSectors ) { | |
1528 | vec->ResizeTo(3*nSectors); | |
1529 | } | |
1530 | if (id==0) { // A side | |
1531 | vec->SetSub(0,vecFXS->GetSub(0,nSectors/2-1)); | |
1532 | vec->SetSub(nSectors,vecFXS->GetSub(nSectors,2*nSectors-1)); | |
1533 | } else { // C side | |
1534 | vec->SetSub(nSectors/2,vecFXS->GetSub(nSectors/2,nSectors-1)); | |
1535 | vec->SetSub(2*nSectors,vecFXS->GetSub(2*nSectors,3*nSectors-1)); | |
1536 | } | |
1537 | } | |
1538 | } | |
1539 | delete altroFXS; | |
1540 | f->Close(); | |
1541 | } | |
1542 | ++index; | |
1543 | } // while(list) | |
1544 | } else { | |
1545 | Log ("Error: no entries in AltroConfig file list!"); | |
1546 | result = 1; | |
1547 | } | |
1548 | ||
1549 | } // for - id | |
1550 | // | |
1551 | // Store updated pedestal entry to OCDB | |
1552 | // | |
1553 | if (changed) { | |
1554 | AliCDBMetaData metaData; | |
1555 | metaData.SetBeamPeriod(0); | |
1556 | metaData.SetResponsible("Haavard Helstrup"); | |
1557 | metaData.SetAliRootVersion(ALIROOT_SVN_BRANCH); | |
1558 | metaData.SetComment("Preprocessor AliTPC data base entries."); | |
1559 | ||
1560 | Bool_t storeOK = Store("Calib", "AltroConfig", altroObjects, &metaData, 0, kFALSE); | |
1561 | if ( !storeOK ) ++result; | |
1562 | } | |
1563 | ||
1564 | altroObjects->Delete(); | |
1565 | delete altroObjects; | |
1566 | ||
1567 | return result; | |
1568 | } |