]>
Commit | Line | Data |
---|---|---|
33c82fbf | 1 | /************************************************************************** |
3dedb44a | 2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
7ca4655f | 16 | /* $Id$ */ |
17 | ||
3dedb44a | 18 | //------------------------------------------------------------------------- |
19 | // Class AliGRPPreprocessor | |
20 | // Global Run Parameters (GRP) preprocessor | |
21 | // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch | |
22 | //------------------------------------------------------------------------- | |
23 | ||
836d8b4f | 24 | #include <TChain.h> |
7ca4655f | 25 | #include <TList.h> |
26 | #include <TMap.h> | |
27 | #include <TObjString.h> | |
28 | #include <TTimeStamp.h> | |
29cc8704 | 29 | #include <TSystem.h> |
30 | #include <TFile.h> | |
7ca4655f | 31 | |
3dedb44a | 32 | #include "AliGRPPreprocessor.h" |
33 | #include "AliGRPDCS.h" | |
17984b61 | 34 | #include "AliDCSSensorArray.h" |
3dedb44a | 35 | |
48b1b444 | 36 | #include "AliTriggerConfiguration.h" |
37 | #include "AliTriggerRunScalers.h" | |
38 | ||
3dedb44a | 39 | #include "AliCDBMetaData.h" |
40 | #include "AliLog.h" | |
41 | ||
3dedb44a | 42 | class AliDCSValue; |
43 | class AliShuttleInterface; | |
44 | ||
45 | #include <TH1.h> | |
46 | ||
17984b61 | 47 | const Double_t kFitFraction = 0.7; // Fraction of DCS sensor fits required |
48 | ||
3dedb44a | 49 | ClassImp(AliGRPPreprocessor) |
50 | ||
17984b61 | 51 | //_______________________________________________________________ |
52 | const char* AliGRPPreprocessor::fgkDCSDataPoints[12] = {"LHCState","LHCPeriod","LHCLuminosity","BeamIntensity","L3Current","L3Polarity","DipoleCurrent","DipolePolarity","CavernTemperature","CavernAtmosPressure","gva_cr5AtmosphericPressure","gva_meyrinAtmosphericPressure"}; | |
53 | ||
3dedb44a | 54 | //_______________________________________________________________ |
55 | AliGRPPreprocessor::AliGRPPreprocessor(): | |
17984b61 | 56 | AliPreprocessor("GRP",0), fPressure(0) { |
3dedb44a | 57 | // default constructor - Don't use this! |
58 | ||
59 | } | |
60 | ||
61 | //_______________________________________________________________ | |
62 | AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle): | |
17984b61 | 63 | AliPreprocessor("GRP",shuttle), fPressure(0) { |
3dedb44a | 64 | // constructor - shuttle must be instantiated! |
65 | ||
66 | } | |
67 | ||
68 | //_______________________________________________________________ | |
69 | AliGRPPreprocessor::~AliGRPPreprocessor() { | |
70 | //destructor | |
17984b61 | 71 | delete fPressure; |
3dedb44a | 72 | } |
73 | ||
74 | //_______________________________________________________________ | |
75 | void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) { | |
76 | // Initialize preprocessor | |
5a5052e5 | 77 | |
78 | AliPreprocessor::Initialize(run, startTime, endTime); | |
79 | ||
17984b61 | 80 | AliInfo("Initialization of the GRP preprocessor."); |
81 | ||
82 | TClonesArray * array = new TClonesArray("AliDCSSensor",2); | |
83 | for(Int_t j = 0; j < 2; j++) { | |
84 | AliDCSSensor * sens = new ((*array)[j])AliDCSSensor; | |
85 | sens->SetStringID(fgkDCSDataPoints[j+10]); | |
86 | } | |
87 | AliInfo(Form("Pressure Entries: %d",array->GetEntries())); | |
88 | ||
89 | fPressure = new AliDCSSensorArray(fStartTime, fEndTime, array); | |
3dedb44a | 90 | } |
91 | ||
92 | //_______________________________________________________________ | |
93 | UInt_t AliGRPPreprocessor::Process(TMap* valueMap) { | |
94 | // process data retrieved by the Shuttle | |
17984b61 | 95 | |
96 | //=================// | |
97 | // DAQ logbook // | |
98 | //=================// | |
29cc8704 | 99 | |
17984b61 | 100 | TList *daqlblist = ProcessDaqLB(); |
101 | if(!daqlblist) { | |
102 | Log(Form("Problem with the DAQ logbook parameters!!!")); | |
b49acef7 | 103 | return 1; |
17984b61 | 104 | } |
17984b61 | 105 | |
106 | //=================// | |
107 | // DAQ FXS // | |
108 | //=================// | |
bba57327 | 109 | UInt_t iDaqFxs = ProcessDaqFxs(); |
8b5f35a9 | 110 | if(iDaqFxs == 0) { |
111 | Log(Form("ProcessDaqFxs successful!")); | |
b49acef7 | 112 | } else { |
113 | Log(Form("Could not store run raw tag file!")); | |
114 | return 1; | |
115 | } | |
116 | ||
48b1b444 | 117 | //=================// |
118 | // DCS FXS // | |
119 | //=================// | |
120 | UInt_t iDcsFxs = ProcessDcsFxs(); | |
121 | if(iDcsFxs == 0) { | |
122 | Log(Form("ProcessDcsFxs successful!")); | |
123 | } else { | |
124 | Log(Form("Could not store CTP run configuration and scalers!")); | |
125 | return 1; | |
126 | } | |
b49acef7 | 127 | |
17984b61 | 128 | //=================// |
129 | // DCS data points // | |
130 | //=================// | |
5a5052e5 | 131 | TList *dcsdplist = ProcessDcsDPs(valueMap); |
17984b61 | 132 | if(!dcsdplist) { |
133 | Log(Form("Problem with the DCS data points!!!")); | |
09d9e56b | 134 | return 1; |
17984b61 | 135 | } |
136 | if(dcsdplist->GetEntries() != 10) { | |
137 | Log(Form("Problem with the DCS data points!!!")); | |
09d9e56b | 138 | // return 1; // TODO:COMMENTED FOR TESTING PURPOSES! |
17984b61 | 139 | } |
140 | //NEEDS TO BE REVISED - BREAKS!!! | |
141 | // AliDCSSensorArray *dcsSensorArray = GetPressureMap(valueMap,fPressure); | |
142 | // if(!dcsSensorArray) { | |
143 | // Log(Form("Problem with the pressure sensor values!!!")); | |
144 | // return 0; | |
145 | // } | |
146 | ||
5a5052e5 | 147 | daqlblist->AddAll(dcsdplist); |
148 | daqlblist->SetOwner(1); | |
149 | AliInfo(Form("Final list entries: %d",daqlblist->GetEntries())); | |
17984b61 | 150 | |
151 | AliCDBMetaData md; | |
152 | md.SetResponsible("Panos Christakoglou"); | |
153 | md.SetComment("Output parameters from the GRP preprocessor."); | |
154 | ||
5a5052e5 | 155 | Bool_t result = Store("GRP", "Data", daqlblist, &md); |
17984b61 | 156 | |
5a5052e5 | 157 | delete daqlblist; |
17984b61 | 158 | |
159 | if (result) | |
160 | return 0; | |
161 | else | |
162 | return 1; | |
163 | } | |
164 | ||
17984b61 | 165 | //_______________________________________________________________ |
166 | TList *AliGRPPreprocessor::ProcessDaqLB() { | |
167 | //Getting the DAQ lb informnation | |
3dedb44a | 168 | const char* timeStart = GetRunParameter("time_start"); |
169 | const char* timeEnd = GetRunParameter("time_end"); | |
125567f8 | 170 | const char* beamEnergy = GetRunParameter("beamEnergy"); |
171 | const char* beamType = GetRunParameter("beamType"); | |
172 | const char* numberOfDetectors = GetRunParameter("numberOfDetectors"); | |
173 | const char* detectorMask = GetRunParameter("detectorMask"); | |
fed5d40b | 174 | const char* lhcPeriod = GetRunParameter("LHCperiod"); |
125567f8 | 175 | |
17984b61 | 176 | if (timeStart) { |
177 | Log(Form("Start time for run %d: %s",fRun, timeStart)); | |
178 | } else { | |
179 | Log(Form("Start time not put in logbook!")); | |
180 | } | |
181 | TMap *mapDAQ1 = new TMap(); | |
182 | mapDAQ1->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart)); | |
183 | ||
184 | if (timeEnd) { | |
185 | Log(Form("End time for run %d: %s",fRun, timeEnd)); | |
186 | } else { | |
187 | Log(Form("End time not put in logbook!")); | |
188 | } | |
189 | TMap *mapDAQ2 = new TMap(); | |
190 | mapDAQ2->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd)); | |
191 | ||
192 | if (beamEnergy) { | |
193 | Log(Form("Beam energy for run %d: %s",fRun, beamEnergy)); | |
194 | } else { | |
195 | Log(Form("Beam energy not put in logbook!")); | |
196 | } | |
197 | TMap *mapDAQ3 = new TMap(); | |
198 | mapDAQ3->Add(new TObjString("fAliceBeamEnergy"),new TObjString(beamEnergy)); | |
199 | ||
200 | if (beamType) { | |
201 | Log(Form("Beam type for run %d: %s",fRun, beamType)); | |
202 | } else { | |
203 | Log(Form("Beam type not put in logbook!")); | |
204 | } | |
205 | TMap *mapDAQ4 = new TMap(); | |
206 | mapDAQ4->Add(new TObjString("fAliceBeamType"),new TObjString(beamType)); | |
207 | ||
208 | if (numberOfDetectors) { | |
209 | Log(Form("Number of active detectors for run %d: %s",fRun, numberOfDetectors)); | |
210 | } else { | |
211 | Log(Form("Number of active detectors not put in logbook!")); | |
212 | } | |
213 | TMap *mapDAQ5 = new TMap(); | |
214 | mapDAQ5->Add(new TObjString("fNumberOfDetectors"),new TObjString(numberOfDetectors)); | |
215 | ||
216 | if (detectorMask) { | |
217 | Log(Form("Detector mask for run %d: %s",fRun, detectorMask)); | |
218 | } else { | |
219 | Log(Form("Detector mask not put in logbook!")); | |
220 | } | |
221 | TMap *mapDAQ6 = new TMap(); | |
222 | mapDAQ6->Add(new TObjString("fDetectorMask"),new TObjString(detectorMask)); | |
223 | ||
224 | if (lhcPeriod) { | |
225 | Log(Form("LHC period (DAQ) for run %d: %s",fRun, lhcPeriod)); | |
226 | } else { | |
227 | Log(Form("LHCperiod not put in logbook!")); | |
228 | } | |
229 | TMap *mapDAQ7 = new TMap(); | |
230 | mapDAQ7->Add(new TObjString("fLHCPeriod"),new TObjString(lhcPeriod)); | |
231 | ||
232 | TList *list = new TList(); | |
233 | list->Add(mapDAQ1); list->Add(mapDAQ2); | |
234 | list->Add(mapDAQ3); list->Add(mapDAQ4); | |
235 | list->Add(mapDAQ5); list->Add(mapDAQ6); | |
236 | list->Add(mapDAQ7); | |
5a5052e5 | 237 | |
238 | TMap* mapDAQ8 = new TMap; | |
239 | mapDAQ8->Add(new TObjString("fRunType"), new TObjString(GetRunType())); | |
240 | list->Add(mapDAQ8); | |
17984b61 | 241 | |
242 | return list; | |
243 | } | |
244 | ||
245 | //_______________________________________________________________ | |
bba57327 | 246 | UInt_t AliGRPPreprocessor::ProcessDaqFxs() { |
836d8b4f | 247 | //======DAQ FXS======// |
29cc8704 | 248 | |
c865efca | 249 | TList* list = GetFileSources(kDAQ); |
250 | if (!list) { | |
ff97356e | 251 | Log("No raw data tag list: connection problems with DAQ FXS logbook!"); |
252 | return 1; | |
253 | } | |
254 | ||
255 | if (list->GetEntries() == 0) | |
256 | { | |
257 | Log("no raw data tags in this run: nothing to merge!"); | |
258 | delete list; list=0; | |
259 | return 0; | |
c865efca | 260 | } |
ff97356e | 261 | |
262 | TChain *fRawTagChain = new TChain("T"); | |
263 | Int_t nFiles=0; | |
4a33bdd9 | 264 | TIterator* iter = list->MakeIterator(); |
265 | TObject* obj = 0; | |
958ecabf | 266 | while ((obj = iter->Next())) { |
267 | TObjString* objStr = dynamic_cast<TObjString*> (obj); | |
268 | if (objStr) { | |
269 | Log(Form("Found source %s", objStr->String().Data())); | |
270 | TList* list2 = GetFileIDs(kDAQ, objStr->String()); | |
836d8b4f | 271 | if (!list2) { |
ff97356e | 272 | Log("No list with ids from DAQ was found: connection problems with DAQ FXS logbook!"); |
273 | delete fRawTagChain; fRawTagChain=0; | |
274 | return 1; | |
836d8b4f | 275 | } |
276 | Log(Form("Number of ids: %d",list2->GetEntries())); | |
277 | for(Int_t i = 0; i < list2->GetEntries(); i++) { | |
278 | TObjString *idStr = (TObjString *)list2->At(i); | |
ff97356e | 279 | TString fileName = GetFile(kDAQ,idStr->String().Data(),objStr->String().Data()); |
280 | if (fileName.Length() > 0) | |
281 | { | |
282 | Log(Form("Adding file in the chain: %s",fileName.Data())); | |
283 | fRawTagChain->Add(fileName.Data()); | |
284 | nFiles++; | |
285 | } else { | |
286 | Log(Form("Could not retrieve file with id %s from source %s: " | |
287 | "connection problems with DAQ FXS!", | |
288 | idStr->String().Data(),objStr->String().Data())); | |
289 | delete list; list=0; | |
290 | delete list2; list2=0; | |
291 | delete fRawTagChain; fRawTagChain=0; | |
292 | return 2; | |
293 | } | |
836d8b4f | 294 | } |
958ecabf | 295 | delete list2; |
296 | } | |
297 | } | |
ff97356e | 298 | |
29cc8704 | 299 | TString fRawDataFileName = "GRP_Merged.tag.root"; |
ff97356e | 300 | Log(Form("Merging %d raw data tags into file: %s", nFiles, fRawDataFileName.Data())); |
b49acef7 | 301 | fRawTagChain->Merge(fRawDataFileName); |
29cc8704 | 302 | |
b49acef7 | 303 | TString outputfile = Form("Run%d.Merged.RAW.tag.root", fRun); |
bba57327 | 304 | Bool_t result = StoreRunMetadataFile(fRawDataFileName.Data(),outputfile.Data()); |
ff97356e | 305 | |
306 | if (!result) | |
307 | { | |
308 | Log("Problem storing raw data tags in local file!!"); | |
8b5f35a9 | 309 | } else { |
310 | Log("Raw data tags merged successfully!!"); | |
ff97356e | 311 | } |
312 | ||
313 | delete iter; | |
314 | delete list; | |
315 | delete fRawTagChain; fRawTagChain=0; | |
8b5f35a9 | 316 | |
317 | if (result == kFALSE) | |
318 | { | |
319 | return 3; | |
320 | } | |
321 | ||
073502c9 | 322 | return 0; |
8b5f35a9 | 323 | |
17984b61 | 324 | } |
325 | ||
48b1b444 | 326 | //_______________________________________________________________ |
327 | UInt_t AliGRPPreprocessor::ProcessDcsFxs() { | |
328 | //======DCS FXS======// | |
329 | // Get the CTP run configuration | |
330 | // and scalers from DCS FXS | |
331 | ||
332 | { | |
333 | // Get the CTP run configuration | |
334 | TList* list = GetFileSources(kDCS,"CTP_runconfig"); | |
335 | if (!list) { | |
cbdd8439 | 336 | Log("No CTP runconfig file: connection problems with DCS FXS logbook!"); |
48b1b444 | 337 | return 1; |
338 | } | |
339 | ||
340 | if (list->GetEntries() == 0) { | |
341 | Log("No CTP runconfig file to be processed!"); | |
342 | } | |
343 | else { | |
344 | TIter iter(list); | |
345 | TObjString *source; | |
346 | while ((source = dynamic_cast<TObjString *> (iter.Next()))) { | |
347 | TString runcfgfile = GetFile(kDCS, "CTP_runconfig", source->GetName()); | |
7229d3c2 | 348 | if (runcfgfile.IsNull()) { |
349 | Log("No CTP runconfig files has been found: empty source!"); | |
48b1b444 | 350 | } |
7229d3c2 | 351 | else { |
352 | Log(Form("File with Id CTP_runconfig found in source %s! Copied to %s",source->GetName(),runcfgfile.Data())); | |
353 | AliTriggerConfiguration *runcfg = AliTriggerConfiguration::LoadConfiguration(runcfgfile); | |
354 | if (!runcfg) { | |
355 | Log("Bad CTP run configuration file! The corresponding CDB entry will not be filled!"); | |
356 | } | |
357 | else { | |
358 | AliCDBMetaData metaData; | |
359 | metaData.SetBeamPeriod(0); | |
360 | metaData.SetResponsible("Roman Lietava"); | |
361 | metaData.SetComment("CTP run configuration"); | |
362 | if (!Store("CTP","Config", runcfg, &metaData, 0, 0)) { | |
363 | Log("Unable to store the CTP run configuration object to OCDB!"); | |
364 | } | |
365 | } | |
48b1b444 | 366 | } |
367 | } | |
368 | } | |
369 | delete list; | |
370 | } | |
371 | ||
372 | { | |
373 | // Get the CTP counters information | |
374 | TList* list = GetFileSources(kDCS,"CTP_xcounters"); | |
375 | if (!list) { | |
376 | Log("No CTP counters file: connection problems with DAQ FXS logbook!"); | |
377 | return 1; | |
378 | } | |
379 | ||
380 | if (list->GetEntries() == 0) { | |
381 | Log("No CTP counters file to be processed!"); | |
382 | } | |
383 | else { | |
384 | TIter iter(list); | |
385 | TObjString *source; | |
386 | while ((source = dynamic_cast<TObjString *> (iter.Next()))) { | |
387 | TString countersfile = GetFile(kDCS, "CTP_xcounters", source->GetName()); | |
7229d3c2 | 388 | if (countersfile.IsNull()) { |
389 | Log("No CTP counters files has been found: empty source!"); | |
48b1b444 | 390 | } |
7229d3c2 | 391 | else { |
392 | Log(Form("File with Id CTP_xcounters found in source %s! Copied to %s",source->GetName(),countersfile.Data())); | |
393 | AliTriggerRunScalers *scalers = AliTriggerRunScalers::ReadScalers(countersfile); | |
394 | if (!scalers) { | |
395 | Log("Bad CTP counters file! The corresponding CDB entry will not be filled!"); | |
396 | } | |
397 | else { | |
398 | AliCDBMetaData metaData; | |
399 | metaData.SetBeamPeriod(0); | |
400 | metaData.SetResponsible("Roman Lietava"); | |
401 | metaData.SetComment("CTP scalers"); | |
402 | if (!Store("CTP","Scalers", scalers, &metaData, 0, 0)) { | |
403 | Log("Unable to store the CTP scalers object to OCDB!"); | |
404 | } | |
405 | } | |
48b1b444 | 406 | } |
407 | } | |
408 | } | |
409 | delete list; | |
410 | } | |
411 | ||
412 | return 0; | |
413 | } | |
414 | ||
17984b61 | 415 | //_______________________________________________________________ |
5a5052e5 | 416 | TList *AliGRPPreprocessor::ProcessDcsDPs(TMap* valueMap) { |
17984b61 | 417 | //Getting the DCS dps |
e97cc90e | 418 | //===========// |
17984b61 | 419 | |
420 | TList *list = new TList(); | |
421 | ||
e97cc90e | 422 | //DCS data points |
423 | //===========// | |
17984b61 | 424 | AliInfo(Form("==========LHCState===========")); |
425 | TObjArray *aliasLHCState = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[0]); | |
e97cc90e | 426 | if(!aliasLHCState) { |
427 | Log(Form("LHCState not found!!!")); | |
17984b61 | 428 | return list; |
8ecdaed6 | 429 | } |
5a5052e5 | 430 | AliGRPDCS *dcs1 = new AliGRPDCS(aliasLHCState,fStartTime,fEndTime); |
e97cc90e | 431 | TString sLHCState = dcs1->ProcessDCS(3); |
432 | if (sLHCState) { | |
433 | Log(Form("<LHCState> for run %d: %s",fRun, sLHCState.Data())); | |
434 | } else { | |
435 | Log(Form("LHCState not put in TMap!")); | |
436 | } | |
17984b61 | 437 | TMap *mapDCS1 = new TMap(); |
438 | mapDCS1->Add(new TObjString("fLHCState"),new TObjString(sLHCState)); | |
439 | list->Add(mapDCS1); | |
e97cc90e | 440 | |
17984b61 | 441 | AliInfo(Form("==========LHCPeriod===========")); |
442 | TObjArray *aliasLHCPeriod = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[1]); | |
e97cc90e | 443 | if(!aliasLHCPeriod) { |
444 | Log(Form("LHCPeriod not found!!!")); | |
17984b61 | 445 | return list; |
e97cc90e | 446 | } |
5a5052e5 | 447 | AliGRPDCS *dcs2 = new AliGRPDCS(aliasLHCPeriod,fStartTime,fEndTime); |
e97cc90e | 448 | TString sLHCPeriod = dcs2->ProcessDCS(3); |
449 | if (sLHCPeriod) { | |
450 | Log(Form("<LHCPeriod> for run %d: %s",fRun, sLHCPeriod.Data())); | |
3dedb44a | 451 | } else { |
e97cc90e | 452 | Log(Form("LHCPeriod not put in TMap!")); |
3dedb44a | 453 | } |
17984b61 | 454 | TMap *mapDCS2 = new TMap(); |
455 | mapDCS2->Add(new TObjString("fLHCCondition"),new TObjString(sLHCPeriod)); | |
456 | list->Add(mapDCS2); | |
125567f8 | 457 | |
17984b61 | 458 | AliInfo(Form("==========LHCLuminosity===========")); |
459 | TObjArray *aliasLHCLuminosity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[2]); | |
e97cc90e | 460 | if(!aliasLHCLuminosity) { |
461 | Log(Form("LHCLuminosity not found!!!")); | |
17984b61 | 462 | return list; |
e97cc90e | 463 | } |
5a5052e5 | 464 | AliGRPDCS *dcs3 = new AliGRPDCS(aliasLHCLuminosity,fStartTime,fEndTime); |
e97cc90e | 465 | TString sMeanLHCLuminosity = dcs3->ProcessDCS(2); |
466 | if (sMeanLHCLuminosity) { | |
467 | Log(Form("<LHCLuminosity> for run %d: %s",fRun, sMeanLHCLuminosity.Data())); | |
468 | } else { | |
469 | Log(Form("LHCLuminosity not put in TMap!")); | |
470 | } | |
17984b61 | 471 | TMap *mapDCS3 = new TMap(); |
472 | mapDCS3->Add(new TObjString("fLHCLuminosity"),new TObjString(sMeanLHCLuminosity)); | |
473 | list->Add(mapDCS3); | |
e97cc90e | 474 | |
17984b61 | 475 | AliInfo(Form("==========BeamIntensity===========")); |
476 | TObjArray *aliasBeamIntensity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[3]); | |
e97cc90e | 477 | if(!aliasBeamIntensity) { |
478 | Log(Form("BeamIntensity not found!!!")); | |
17984b61 | 479 | return list; |
e97cc90e | 480 | } |
5a5052e5 | 481 | AliGRPDCS *dcs4 = new AliGRPDCS(aliasBeamIntensity,fStartTime,fEndTime); |
e97cc90e | 482 | TString sMeanBeamIntensity = dcs4->ProcessDCS(2); |
483 | if (sMeanBeamIntensity) { | |
484 | Log(Form("<BeamIntensity> for run %d: %s",fRun, sMeanBeamIntensity.Data())); | |
485 | } else { | |
486 | Log(Form("BeamIntensity not put in TMap!")); | |
487 | } | |
17984b61 | 488 | TMap *mapDCS4 = new TMap(); |
489 | mapDCS4->Add(new TObjString("fBeamIntensity"),new TObjString(sMeanBeamIntensity)); | |
490 | list->Add(mapDCS4); | |
e97cc90e | 491 | |
17984b61 | 492 | AliInfo(Form("==========L3Current===========")); |
493 | TObjArray *aliasL3Current = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[4]); | |
e97cc90e | 494 | if(!aliasL3Current) { |
495 | Log(Form("L3Current not found!!!")); | |
17984b61 | 496 | return list; |
e97cc90e | 497 | } |
5a5052e5 | 498 | AliGRPDCS *dcs5 = new AliGRPDCS(aliasL3Current,fStartTime,fEndTime); |
e97cc90e | 499 | TString sMeanL3Current = dcs5->ProcessDCS(2); |
500 | if (sMeanL3Current) { | |
501 | Log(Form("<L3Current> for run %d: %s",fRun, sMeanL3Current.Data())); | |
502 | } else { | |
503 | Log(Form("L3Current not put in TMap!")); | |
504 | } | |
17984b61 | 505 | TMap *mapDCS5 = new TMap(); |
506 | mapDCS5->Add(new TObjString("fL3Current"),new TObjString(sMeanL3Current)); | |
507 | list->Add(mapDCS5); | |
e97cc90e | 508 | |
17984b61 | 509 | AliInfo(Form("==========L3Polarity===========")); |
510 | TObjArray *aliasL3Polarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[5]); | |
e97cc90e | 511 | if(!aliasL3Polarity) { |
512 | Log(Form("L3Polarity not found!!!")); | |
17984b61 | 513 | return list; |
e97cc90e | 514 | } |
5a5052e5 | 515 | AliGRPDCS *dcs6 = new AliGRPDCS(aliasL3Polarity,fStartTime,fEndTime); |
e97cc90e | 516 | TString sL3Polarity = dcs6->ProcessDCS(4); |
517 | if (sL3Polarity) { | |
518 | Log(Form("<L3Polarity> for run %d: %s",fRun, sL3Polarity.Data())); | |
519 | } else { | |
520 | Log(Form("L3Polarity not put in TMap!")); | |
521 | } | |
17984b61 | 522 | TMap *mapDCS6 = new TMap(); |
523 | mapDCS6->Add(new TObjString("fL3Polarity"),new TObjString(sL3Polarity)); | |
524 | list->Add(mapDCS6); | |
e97cc90e | 525 | |
17984b61 | 526 | AliInfo(Form("==========DipoleCurrent===========")); |
527 | TObjArray *aliasDipoleCurrent = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[6]); | |
e97cc90e | 528 | if(!aliasDipoleCurrent) { |
529 | Log(Form("DipoleCurrent not found!!!")); | |
17984b61 | 530 | return list; |
e97cc90e | 531 | } |
5a5052e5 | 532 | AliGRPDCS *dcs7 = new AliGRPDCS(aliasDipoleCurrent,fStartTime,fEndTime); |
e97cc90e | 533 | TString sMeanDipoleCurrent = dcs7->ProcessDCS(2); |
534 | if (sMeanDipoleCurrent) { | |
535 | Log(Form("<DipoleCurrent> for run %d: %s",fRun, sMeanDipoleCurrent.Data())); | |
536 | } else { | |
537 | Log(Form("DipoleCurrent not put in TMap!")); | |
538 | } | |
17984b61 | 539 | TMap *mapDCS7 = new TMap(); |
540 | mapDCS7->Add(new TObjString("fDipoleCurrent"),new TObjString(sMeanDipoleCurrent)); | |
541 | list->Add(mapDCS7); | |
e97cc90e | 542 | |
17984b61 | 543 | AliInfo(Form("==========DipolePolarity===========")); |
544 | TObjArray *aliasDipolePolarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[7]); | |
e97cc90e | 545 | if(!aliasDipolePolarity) { |
546 | Log(Form("DipolePolarity not found!!!")); | |
17984b61 | 547 | return list; |
e97cc90e | 548 | } |
5a5052e5 | 549 | AliGRPDCS *dcs8 = new AliGRPDCS(aliasDipolePolarity,fStartTime,fEndTime); |
e97cc90e | 550 | TString sDipolePolarity = dcs8->ProcessDCS(4); |
551 | if (sDipolePolarity) { | |
552 | Log(Form("<DipolePolarity> for run %d: %s",fRun, sDipolePolarity.Data())); | |
553 | } else { | |
554 | Log(Form("DipolePolarity not put in TMap!")); | |
555 | } | |
17984b61 | 556 | TMap *mapDCS8 = new TMap(); |
557 | mapDCS8->Add(new TObjString("fDipolePolarity"),new TObjString(sDipolePolarity)); | |
558 | list->Add(mapDCS8); | |
e97cc90e | 559 | |
17984b61 | 560 | AliInfo(Form("==========CavernTemperature===========")); |
561 | TObjArray *aliasCavernTemperature = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[8]); | |
e97cc90e | 562 | if(!aliasCavernTemperature) { |
563 | Log(Form("CavernTemperature not found!!!")); | |
17984b61 | 564 | return list; |
e97cc90e | 565 | } |
5a5052e5 | 566 | AliGRPDCS *dcs9 = new AliGRPDCS(aliasCavernTemperature,fStartTime,fEndTime); |
e97cc90e | 567 | TString sMeanCavernTemperature = dcs9->ProcessDCS(2); |
568 | if (sMeanCavernTemperature) { | |
569 | Log(Form("<CavernTemperature> for run %d: %s",fRun, sMeanCavernTemperature.Data())); | |
570 | } else { | |
571 | Log(Form("CavernTemperature not put in TMap!")); | |
572 | } | |
17984b61 | 573 | TMap *mapDCS9 = new TMap(); |
574 | mapDCS9->Add(new TObjString("fCavernTemperature"),new TObjString(sMeanCavernTemperature)); | |
575 | list->Add(mapDCS9); | |
e97cc90e | 576 | |
17984b61 | 577 | AliInfo(Form("==========CavernPressure===========")); |
578 | TObjArray *aliasCavernPressure = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[9]); | |
e97cc90e | 579 | if(!aliasCavernPressure) { |
580 | Log(Form("CavernPressure not found!!!")); | |
17984b61 | 581 | return list; |
e97cc90e | 582 | } |
5a5052e5 | 583 | AliGRPDCS *dcs10 = new AliGRPDCS(aliasCavernPressure,fStartTime,fEndTime); |
e97cc90e | 584 | TString sMeanCavernPressure = dcs10->ProcessDCS(2); |
585 | if (sMeanCavernPressure) { | |
586 | Log(Form("<CavernPressure> for run %d: %s",fRun, sMeanCavernPressure.Data())); | |
587 | } else { | |
588 | Log(Form("CavernPressure not put in TMap!")); | |
589 | } | |
17984b61 | 590 | TMap *mapDCS10 = new TMap(); |
591 | mapDCS10->Add(new TObjString("fCavernPressure"),new TObjString(sMeanCavernPressure)); | |
592 | list->Add(mapDCS10); | |
e97cc90e | 593 | |
17984b61 | 594 | return list; |
595 | } | |
125567f8 | 596 | |
17984b61 | 597 | //_______________________________________________________________ |
598 | AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap, AliDCSSensorArray *fPressure) { | |
599 | // extract DCS pressure maps. Perform fits to save space | |
3dedb44a | 600 | |
17984b61 | 601 | TMap *map = fPressure->ExtractDCS(dcsAliasMap); |
602 | if (map) { | |
603 | fPressure->MakeSplineFit(map); | |
604 | Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); | |
605 | if (fitFraction > kFitFraction ) { | |
606 | AliInfo(Form("Pressure values extracted, fits performed.\n")); | |
607 | } else { | |
608 | AliInfo("Too few pressure maps fitted. \n"); | |
609 | } | |
610 | } else { | |
611 | AliInfo("AliGRPDCS: no atmospheric pressure map extracted. \n"); | |
612 | } | |
613 | delete map; | |
614 | ||
615 | return fPressure; | |
616 | } | |
e97cc90e | 617 | |
17984b61 | 618 | //_______________________________________________________________ |
619 | /*UInt_t AliGRPPreprocessor::MapPressure(TMap* dcsAliasMap) { | |
620 | // extract DCS pressure maps. Perform fits to save space | |
3dedb44a | 621 | |
17984b61 | 622 | UInt_t result=0; |
623 | TMap *map = fPressure->ExtractDCS(dcsAliasMap); | |
624 | if (map) { | |
625 | fPressure->MakeSplineFit(map); | |
626 | Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); | |
627 | if (fitFraction > kFitFraction ) { | |
628 | AliInfo(Form("Pressure values extracted, fits performed.\n")); | |
629 | } else { | |
630 | Log ("Too few pressure maps fitted. \n"); | |
631 | result = 9; | |
632 | } | |
633 | } else { | |
634 | Log("AliTPCPreprocsessor: no atmospheric pressure map extracted. \n"); | |
635 | result=9; | |
636 | } | |
637 | delete map; | |
638 | // Now store the final CDB file | |
3dedb44a | 639 | |
17984b61 | 640 | if ( result == 0 ) { |
641 | AliCDBMetaData metaData; | |
642 | metaData.SetBeamPeriod(0); | |
643 | metaData.SetResponsible("Panos Christakoglou"); | |
644 | metaData.SetComment("Preprocessor AliGRP data base pressure entries."); | |
645 | ||
646 | Bool_t storeOK = Store("Calib", "Pressure", fPressure, &metaData, 0, 0); | |
647 | if ( !storeOK ) result=1; | |
648 | } | |
3dedb44a | 649 | |
17984b61 | 650 | return result; |
651 | }*/ |