]>
Commit | Line | Data |
---|---|---|
3dedb44a | 1 | /************************************************************************** |
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 | |
36 | #include "AliCDBMetaData.h" | |
37 | #include "AliLog.h" | |
38 | ||
3dedb44a | 39 | class AliDCSValue; |
40 | class AliShuttleInterface; | |
41 | ||
42 | #include <TH1.h> | |
43 | ||
17984b61 | 44 | const Double_t kFitFraction = 0.7; // Fraction of DCS sensor fits required |
45 | ||
3dedb44a | 46 | ClassImp(AliGRPPreprocessor) |
47 | ||
17984b61 | 48 | //_______________________________________________________________ |
49 | const char* AliGRPPreprocessor::fgkDCSDataPoints[12] = {"LHCState","LHCPeriod","LHCLuminosity","BeamIntensity","L3Current","L3Polarity","DipoleCurrent","DipolePolarity","CavernTemperature","CavernAtmosPressure","gva_cr5AtmosphericPressure","gva_meyrinAtmosphericPressure"}; | |
50 | ||
3dedb44a | 51 | //_______________________________________________________________ |
52 | AliGRPPreprocessor::AliGRPPreprocessor(): | |
17984b61 | 53 | AliPreprocessor("GRP",0), fPressure(0) { |
3dedb44a | 54 | // default constructor - Don't use this! |
55 | ||
56 | } | |
57 | ||
58 | //_______________________________________________________________ | |
59 | AliGRPPreprocessor::AliGRPPreprocessor(AliShuttleInterface* shuttle): | |
17984b61 | 60 | AliPreprocessor("GRP",shuttle), fPressure(0) { |
3dedb44a | 61 | // constructor - shuttle must be instantiated! |
62 | ||
63 | } | |
64 | ||
65 | //_______________________________________________________________ | |
66 | AliGRPPreprocessor::~AliGRPPreprocessor() { | |
67 | //destructor | |
17984b61 | 68 | delete fPressure; |
3dedb44a | 69 | } |
70 | ||
71 | //_______________________________________________________________ | |
72 | void AliGRPPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime) { | |
73 | // Initialize preprocessor | |
74 | ||
75 | AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, TTimeStamp(startTime).AsString(), TTimeStamp(endTime).AsString())); | |
76 | ||
77 | fRun = run; | |
78 | fStartTime = startTime; | |
79 | fEndTime = endTime; | |
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!!!")); | |
103 | return 0; | |
104 | } | |
105 | TMap *m1 = (TMap *)daqlblist->At(0); | |
106 | TObjString *s1 = (TObjString *)m1->GetValue("fAliceStartTime"); | |
107 | UInt_t iStartTime = atoi(s1->String().Data()); | |
108 | TMap *m2 = (TMap *)daqlblist->At(1); | |
109 | TObjString *s2 = (TObjString *)m2->GetValue("fAliceStopTime"); | |
110 | UInt_t iStopTime = atoi(s2->String().Data()); | |
111 | TMap *m3 = (TMap *)daqlblist->At(6); | |
112 | TObjString *s3 = (TObjString *)m3->GetValue("fLHCPeriod"); | |
113 | TString productionYear = ""; | |
114 | ||
115 | //=================// | |
116 | // DAQ FXS // | |
117 | //=================// | |
bba57327 | 118 | UInt_t iDaqFxs = ProcessDaqFxs(); |
119 | if(iDaqFxs == 1) Log(Form("Raw data merged tags copied succesfully in AliEn!!!")); | |
17984b61 | 120 | |
121 | //=================// | |
122 | // DCS data points // | |
123 | //=================// | |
124 | TList *dcsdplist = ProcessDcsDPs(valueMap, iStartTime, iStopTime); | |
125 | if(!dcsdplist) { | |
126 | Log(Form("Problem with the DCS data points!!!")); | |
127 | return 0; | |
128 | } | |
129 | if(dcsdplist->GetEntries() != 10) { | |
130 | Log(Form("Problem with the DCS data points!!!")); | |
131 | return 0; | |
132 | } | |
133 | //NEEDS TO BE REVISED - BREAKS!!! | |
134 | // AliDCSSensorArray *dcsSensorArray = GetPressureMap(valueMap,fPressure); | |
135 | // if(!dcsSensorArray) { | |
136 | // Log(Form("Problem with the pressure sensor values!!!")); | |
137 | // return 0; | |
138 | // } | |
139 | ||
140 | TList * list = new TList(); | |
141 | list = GetGlobalList(daqlblist,dcsdplist); | |
142 | list->SetOwner(1); | |
143 | AliInfo(Form("Final list entries: %d",list->GetEntries())); | |
144 | ||
145 | AliCDBMetaData md; | |
146 | md.SetResponsible("Panos Christakoglou"); | |
147 | md.SetComment("Output parameters from the GRP preprocessor."); | |
148 | ||
149 | Bool_t result = Store("GRP", "Data", list, &md); | |
150 | ||
151 | delete list; | |
152 | ||
153 | if (result) | |
154 | return 0; | |
155 | else | |
156 | return 1; | |
157 | } | |
158 | ||
159 | //_______________________________________________________________ | |
160 | TList *AliGRPPreprocessor::GetGlobalList(TList *l1, TList *l2) { | |
161 | //Getting the global output TList | |
162 | TList *list = new TList(); | |
163 | TMap *map = new TMap(); | |
164 | for(Int_t i = 0; i < l1->GetEntries(); i++) | |
165 | list->AddLast(map = (TMap *)l1->At(i)); | |
166 | for(Int_t i = 0; i < l2->GetEntries(); i++) | |
167 | list->AddLast(map = (TMap *)l2->At(i)); | |
168 | ||
169 | return list; | |
170 | } | |
171 | ||
172 | //_______________________________________________________________ | |
173 | TList *AliGRPPreprocessor::ProcessDaqLB() { | |
174 | //Getting the DAQ lb informnation | |
3dedb44a | 175 | const char* timeStart = GetRunParameter("time_start"); |
176 | const char* timeEnd = GetRunParameter("time_end"); | |
125567f8 | 177 | const char* beamEnergy = GetRunParameter("beamEnergy"); |
178 | const char* beamType = GetRunParameter("beamType"); | |
179 | const char* numberOfDetectors = GetRunParameter("numberOfDetectors"); | |
180 | const char* detectorMask = GetRunParameter("detectorMask"); | |
fed5d40b | 181 | const char* lhcPeriod = GetRunParameter("LHCperiod"); |
125567f8 | 182 | |
17984b61 | 183 | if (timeStart) { |
184 | Log(Form("Start time for run %d: %s",fRun, timeStart)); | |
185 | } else { | |
186 | Log(Form("Start time not put in logbook!")); | |
187 | } | |
188 | TMap *mapDAQ1 = new TMap(); | |
189 | mapDAQ1->Add(new TObjString("fAliceStartTime"),new TObjString(timeStart)); | |
190 | ||
191 | if (timeEnd) { | |
192 | Log(Form("End time for run %d: %s",fRun, timeEnd)); | |
193 | } else { | |
194 | Log(Form("End time not put in logbook!")); | |
195 | } | |
196 | TMap *mapDAQ2 = new TMap(); | |
197 | mapDAQ2->Add(new TObjString("fAliceStopTime"),new TObjString(timeEnd)); | |
198 | ||
199 | if (beamEnergy) { | |
200 | Log(Form("Beam energy for run %d: %s",fRun, beamEnergy)); | |
201 | } else { | |
202 | Log(Form("Beam energy not put in logbook!")); | |
203 | } | |
204 | TMap *mapDAQ3 = new TMap(); | |
205 | mapDAQ3->Add(new TObjString("fAliceBeamEnergy"),new TObjString(beamEnergy)); | |
206 | ||
207 | if (beamType) { | |
208 | Log(Form("Beam type for run %d: %s",fRun, beamType)); | |
209 | } else { | |
210 | Log(Form("Beam type not put in logbook!")); | |
211 | } | |
212 | TMap *mapDAQ4 = new TMap(); | |
213 | mapDAQ4->Add(new TObjString("fAliceBeamType"),new TObjString(beamType)); | |
214 | ||
215 | if (numberOfDetectors) { | |
216 | Log(Form("Number of active detectors for run %d: %s",fRun, numberOfDetectors)); | |
217 | } else { | |
218 | Log(Form("Number of active detectors not put in logbook!")); | |
219 | } | |
220 | TMap *mapDAQ5 = new TMap(); | |
221 | mapDAQ5->Add(new TObjString("fNumberOfDetectors"),new TObjString(numberOfDetectors)); | |
222 | ||
223 | if (detectorMask) { | |
224 | Log(Form("Detector mask for run %d: %s",fRun, detectorMask)); | |
225 | } else { | |
226 | Log(Form("Detector mask not put in logbook!")); | |
227 | } | |
228 | TMap *mapDAQ6 = new TMap(); | |
229 | mapDAQ6->Add(new TObjString("fDetectorMask"),new TObjString(detectorMask)); | |
230 | ||
231 | if (lhcPeriod) { | |
232 | Log(Form("LHC period (DAQ) for run %d: %s",fRun, lhcPeriod)); | |
233 | } else { | |
234 | Log(Form("LHCperiod not put in logbook!")); | |
235 | } | |
236 | TMap *mapDAQ7 = new TMap(); | |
237 | mapDAQ7->Add(new TObjString("fLHCPeriod"),new TObjString(lhcPeriod)); | |
238 | ||
239 | TList *list = new TList(); | |
240 | list->Add(mapDAQ1); list->Add(mapDAQ2); | |
241 | list->Add(mapDAQ3); list->Add(mapDAQ4); | |
242 | list->Add(mapDAQ5); list->Add(mapDAQ6); | |
243 | list->Add(mapDAQ7); | |
244 | ||
245 | return list; | |
246 | } | |
247 | ||
248 | //_______________________________________________________________ | |
bba57327 | 249 | UInt_t AliGRPPreprocessor::ProcessDaqFxs() { |
836d8b4f | 250 | //======DAQ FXS======// |
251 | TChain *fRawTagChain = new TChain("T"); | |
29cc8704 | 252 | |
c865efca | 253 | TList* list = GetFileSources(kDAQ); |
254 | if (!list) { | |
255 | Log("No raw data tag list found!!!"); | |
17984b61 | 256 | return 1; |
c865efca | 257 | } |
4a33bdd9 | 258 | TIterator* iter = list->MakeIterator(); |
259 | TObject* obj = 0; | |
958ecabf | 260 | while ((obj = iter->Next())) { |
261 | TObjString* objStr = dynamic_cast<TObjString*> (obj); | |
262 | if (objStr) { | |
263 | Log(Form("Found source %s", objStr->String().Data())); | |
264 | TList* list2 = GetFileIDs(kDAQ, objStr->String()); | |
836d8b4f | 265 | if (!list2) { |
266 | Log("No list with ids from DAQ was found!!!"); | |
17984b61 | 267 | return 2; |
836d8b4f | 268 | } |
269 | Log(Form("Number of ids: %d",list2->GetEntries())); | |
270 | for(Int_t i = 0; i < list2->GetEntries(); i++) { | |
271 | TObjString *idStr = (TObjString *)list2->At(i); | |
272 | //Log(Form("Filename1: %s",idStr->String().Data())); | |
273 | TString fileName = GetFile(kDAQ,idStr->String().Data(),objStr->String().Data()); | |
274 | Log(Form("Adding file in the chain: %s",fileName.Data())); | |
275 | fRawTagChain->Add(fileName.Data()); | |
29cc8704 | 276 | //fRawDataFileName = fileName(0,fileName.First("_")); |
836d8b4f | 277 | } |
958ecabf | 278 | delete list2; |
279 | } | |
280 | } | |
281 | delete iter; | |
836d8b4f | 282 | delete list; |
29cc8704 | 283 | TString fRawDataFileName = "GRP_Merged.tag.root"; |
836d8b4f | 284 | Log(Form("Merging raw data tags into file: %s",fRawDataFileName.Data())); |
17984b61 | 285 | |
29cc8704 | 286 | TFile* f = new TFile(fRawDataFileName.Data(), "RECREATE"); |
287 | f->cd(); | |
288 | fRawTagChain->Write(); | |
289 | f->Close(); | |
290 | delete f; f=0; | |
291 | ||
bba57327 | 292 | //TString outputfile = "alien:///alice/data/"; |
293 | //outputfile += productionYear.Data(); outputfile += "/"; | |
294 | //outputfile += lhcperiod.Data(); outputfile += "/"; | |
295 | //outputfile += fRun; outputfile += "/raw/"; | |
296 | TString outputfile = "runMetadata.root"; | |
297 | Bool_t result = StoreRunMetadataFile(fRawDataFileName.Data(),outputfile.Data()); | |
17984b61 | 298 | |
bba57327 | 299 | return result; |
17984b61 | 300 | } |
301 | ||
302 | //_______________________________________________________________ | |
303 | TList *AliGRPPreprocessor::ProcessDcsDPs(TMap* valueMap, UInt_t iStartTime, UInt_t iStopTime) { | |
304 | //Getting the DCS dps | |
e97cc90e | 305 | //===========// |
17984b61 | 306 | |
307 | TList *list = new TList(); | |
308 | ||
e97cc90e | 309 | //DCS data points |
310 | //===========// | |
17984b61 | 311 | AliInfo(Form("==========LHCState===========")); |
312 | TObjArray *aliasLHCState = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[0]); | |
e97cc90e | 313 | if(!aliasLHCState) { |
314 | Log(Form("LHCState not found!!!")); | |
17984b61 | 315 | return list; |
8ecdaed6 | 316 | } |
1f9bf847 | 317 | AliGRPDCS *dcs1 = new AliGRPDCS(aliasLHCState,iStartTime,iStopTime); |
e97cc90e | 318 | TString sLHCState = dcs1->ProcessDCS(3); |
319 | if (sLHCState) { | |
320 | Log(Form("<LHCState> for run %d: %s",fRun, sLHCState.Data())); | |
321 | } else { | |
322 | Log(Form("LHCState not put in TMap!")); | |
323 | } | |
17984b61 | 324 | TMap *mapDCS1 = new TMap(); |
325 | mapDCS1->Add(new TObjString("fLHCState"),new TObjString(sLHCState)); | |
326 | list->Add(mapDCS1); | |
e97cc90e | 327 | |
17984b61 | 328 | AliInfo(Form("==========LHCPeriod===========")); |
329 | TObjArray *aliasLHCPeriod = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[1]); | |
e97cc90e | 330 | if(!aliasLHCPeriod) { |
331 | Log(Form("LHCPeriod not found!!!")); | |
17984b61 | 332 | return list; |
e97cc90e | 333 | } |
1f9bf847 | 334 | AliGRPDCS *dcs2 = new AliGRPDCS(aliasLHCPeriod,iStartTime,iStopTime); |
e97cc90e | 335 | TString sLHCPeriod = dcs2->ProcessDCS(3); |
336 | if (sLHCPeriod) { | |
337 | Log(Form("<LHCPeriod> for run %d: %s",fRun, sLHCPeriod.Data())); | |
3dedb44a | 338 | } else { |
e97cc90e | 339 | Log(Form("LHCPeriod not put in TMap!")); |
3dedb44a | 340 | } |
17984b61 | 341 | TMap *mapDCS2 = new TMap(); |
342 | mapDCS2->Add(new TObjString("fLHCCondition"),new TObjString(sLHCPeriod)); | |
343 | list->Add(mapDCS2); | |
125567f8 | 344 | |
17984b61 | 345 | AliInfo(Form("==========LHCLuminosity===========")); |
346 | TObjArray *aliasLHCLuminosity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[2]); | |
e97cc90e | 347 | if(!aliasLHCLuminosity) { |
348 | Log(Form("LHCLuminosity not found!!!")); | |
17984b61 | 349 | return list; |
e97cc90e | 350 | } |
1f9bf847 | 351 | AliGRPDCS *dcs3 = new AliGRPDCS(aliasLHCLuminosity,iStartTime,iStopTime); |
e97cc90e | 352 | TString sMeanLHCLuminosity = dcs3->ProcessDCS(2); |
353 | if (sMeanLHCLuminosity) { | |
354 | Log(Form("<LHCLuminosity> for run %d: %s",fRun, sMeanLHCLuminosity.Data())); | |
355 | } else { | |
356 | Log(Form("LHCLuminosity not put in TMap!")); | |
357 | } | |
17984b61 | 358 | TMap *mapDCS3 = new TMap(); |
359 | mapDCS3->Add(new TObjString("fLHCLuminosity"),new TObjString(sMeanLHCLuminosity)); | |
360 | list->Add(mapDCS3); | |
e97cc90e | 361 | |
17984b61 | 362 | AliInfo(Form("==========BeamIntensity===========")); |
363 | TObjArray *aliasBeamIntensity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[3]); | |
e97cc90e | 364 | if(!aliasBeamIntensity) { |
365 | Log(Form("BeamIntensity not found!!!")); | |
17984b61 | 366 | return list; |
e97cc90e | 367 | } |
1f9bf847 | 368 | AliGRPDCS *dcs4 = new AliGRPDCS(aliasBeamIntensity,iStartTime,iStopTime); |
e97cc90e | 369 | TString sMeanBeamIntensity = dcs4->ProcessDCS(2); |
370 | if (sMeanBeamIntensity) { | |
371 | Log(Form("<BeamIntensity> for run %d: %s",fRun, sMeanBeamIntensity.Data())); | |
372 | } else { | |
373 | Log(Form("BeamIntensity not put in TMap!")); | |
374 | } | |
17984b61 | 375 | TMap *mapDCS4 = new TMap(); |
376 | mapDCS4->Add(new TObjString("fBeamIntensity"),new TObjString(sMeanBeamIntensity)); | |
377 | list->Add(mapDCS4); | |
e97cc90e | 378 | |
17984b61 | 379 | AliInfo(Form("==========L3Current===========")); |
380 | TObjArray *aliasL3Current = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[4]); | |
e97cc90e | 381 | if(!aliasL3Current) { |
382 | Log(Form("L3Current not found!!!")); | |
17984b61 | 383 | return list; |
e97cc90e | 384 | } |
1f9bf847 | 385 | AliGRPDCS *dcs5 = new AliGRPDCS(aliasL3Current,iStartTime,iStopTime); |
e97cc90e | 386 | TString sMeanL3Current = dcs5->ProcessDCS(2); |
387 | if (sMeanL3Current) { | |
388 | Log(Form("<L3Current> for run %d: %s",fRun, sMeanL3Current.Data())); | |
389 | } else { | |
390 | Log(Form("L3Current not put in TMap!")); | |
391 | } | |
17984b61 | 392 | TMap *mapDCS5 = new TMap(); |
393 | mapDCS5->Add(new TObjString("fL3Current"),new TObjString(sMeanL3Current)); | |
394 | list->Add(mapDCS5); | |
e97cc90e | 395 | |
17984b61 | 396 | AliInfo(Form("==========L3Polarity===========")); |
397 | TObjArray *aliasL3Polarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[5]); | |
e97cc90e | 398 | if(!aliasL3Polarity) { |
399 | Log(Form("L3Polarity not found!!!")); | |
17984b61 | 400 | return list; |
e97cc90e | 401 | } |
1f9bf847 | 402 | AliGRPDCS *dcs6 = new AliGRPDCS(aliasL3Polarity,iStartTime,iStopTime); |
e97cc90e | 403 | TString sL3Polarity = dcs6->ProcessDCS(4); |
404 | if (sL3Polarity) { | |
405 | Log(Form("<L3Polarity> for run %d: %s",fRun, sL3Polarity.Data())); | |
406 | } else { | |
407 | Log(Form("L3Polarity not put in TMap!")); | |
408 | } | |
17984b61 | 409 | TMap *mapDCS6 = new TMap(); |
410 | mapDCS6->Add(new TObjString("fL3Polarity"),new TObjString(sL3Polarity)); | |
411 | list->Add(mapDCS6); | |
e97cc90e | 412 | |
17984b61 | 413 | AliInfo(Form("==========DipoleCurrent===========")); |
414 | TObjArray *aliasDipoleCurrent = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[6]); | |
e97cc90e | 415 | if(!aliasDipoleCurrent) { |
416 | Log(Form("DipoleCurrent not found!!!")); | |
17984b61 | 417 | return list; |
e97cc90e | 418 | } |
1f9bf847 | 419 | AliGRPDCS *dcs7 = new AliGRPDCS(aliasDipoleCurrent,iStartTime,iStopTime); |
e97cc90e | 420 | TString sMeanDipoleCurrent = dcs7->ProcessDCS(2); |
421 | if (sMeanDipoleCurrent) { | |
422 | Log(Form("<DipoleCurrent> for run %d: %s",fRun, sMeanDipoleCurrent.Data())); | |
423 | } else { | |
424 | Log(Form("DipoleCurrent not put in TMap!")); | |
425 | } | |
17984b61 | 426 | TMap *mapDCS7 = new TMap(); |
427 | mapDCS7->Add(new TObjString("fDipoleCurrent"),new TObjString(sMeanDipoleCurrent)); | |
428 | list->Add(mapDCS7); | |
e97cc90e | 429 | |
17984b61 | 430 | AliInfo(Form("==========DipolePolarity===========")); |
431 | TObjArray *aliasDipolePolarity = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[7]); | |
e97cc90e | 432 | if(!aliasDipolePolarity) { |
433 | Log(Form("DipolePolarity not found!!!")); | |
17984b61 | 434 | return list; |
e97cc90e | 435 | } |
1f9bf847 | 436 | AliGRPDCS *dcs8 = new AliGRPDCS(aliasDipolePolarity,iStartTime,iStopTime); |
e97cc90e | 437 | TString sDipolePolarity = dcs8->ProcessDCS(4); |
438 | if (sDipolePolarity) { | |
439 | Log(Form("<DipolePolarity> for run %d: %s",fRun, sDipolePolarity.Data())); | |
440 | } else { | |
441 | Log(Form("DipolePolarity not put in TMap!")); | |
442 | } | |
17984b61 | 443 | TMap *mapDCS8 = new TMap(); |
444 | mapDCS8->Add(new TObjString("fDipolePolarity"),new TObjString(sDipolePolarity)); | |
445 | list->Add(mapDCS8); | |
e97cc90e | 446 | |
17984b61 | 447 | AliInfo(Form("==========CavernTemperature===========")); |
448 | TObjArray *aliasCavernTemperature = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[8]); | |
e97cc90e | 449 | if(!aliasCavernTemperature) { |
450 | Log(Form("CavernTemperature not found!!!")); | |
17984b61 | 451 | return list; |
e97cc90e | 452 | } |
1f9bf847 | 453 | AliGRPDCS *dcs9 = new AliGRPDCS(aliasCavernTemperature,iStartTime,iStopTime); |
e97cc90e | 454 | TString sMeanCavernTemperature = dcs9->ProcessDCS(2); |
455 | if (sMeanCavernTemperature) { | |
456 | Log(Form("<CavernTemperature> for run %d: %s",fRun, sMeanCavernTemperature.Data())); | |
457 | } else { | |
458 | Log(Form("CavernTemperature not put in TMap!")); | |
459 | } | |
17984b61 | 460 | TMap *mapDCS9 = new TMap(); |
461 | mapDCS9->Add(new TObjString("fCavernTemperature"),new TObjString(sMeanCavernTemperature)); | |
462 | list->Add(mapDCS9); | |
e97cc90e | 463 | |
17984b61 | 464 | AliInfo(Form("==========CavernPressure===========")); |
465 | TObjArray *aliasCavernPressure = (TObjArray *)valueMap->GetValue(fgkDCSDataPoints[9]); | |
e97cc90e | 466 | if(!aliasCavernPressure) { |
467 | Log(Form("CavernPressure not found!!!")); | |
17984b61 | 468 | return list; |
e97cc90e | 469 | } |
1f9bf847 | 470 | AliGRPDCS *dcs10 = new AliGRPDCS(aliasCavernPressure,iStartTime,iStopTime); |
e97cc90e | 471 | TString sMeanCavernPressure = dcs10->ProcessDCS(2); |
472 | if (sMeanCavernPressure) { | |
473 | Log(Form("<CavernPressure> for run %d: %s",fRun, sMeanCavernPressure.Data())); | |
474 | } else { | |
475 | Log(Form("CavernPressure not put in TMap!")); | |
476 | } | |
17984b61 | 477 | TMap *mapDCS10 = new TMap(); |
478 | mapDCS10->Add(new TObjString("fCavernPressure"),new TObjString(sMeanCavernPressure)); | |
479 | list->Add(mapDCS10); | |
e97cc90e | 480 | |
17984b61 | 481 | return list; |
482 | } | |
125567f8 | 483 | |
17984b61 | 484 | //_______________________________________________________________ |
485 | AliDCSSensorArray *AliGRPPreprocessor::GetPressureMap(TMap* dcsAliasMap, AliDCSSensorArray *fPressure) { | |
486 | // extract DCS pressure maps. Perform fits to save space | |
3dedb44a | 487 | |
17984b61 | 488 | TMap *map = fPressure->ExtractDCS(dcsAliasMap); |
489 | if (map) { | |
490 | fPressure->MakeSplineFit(map); | |
491 | Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); | |
492 | if (fitFraction > kFitFraction ) { | |
493 | AliInfo(Form("Pressure values extracted, fits performed.\n")); | |
494 | } else { | |
495 | AliInfo("Too few pressure maps fitted. \n"); | |
496 | } | |
497 | } else { | |
498 | AliInfo("AliGRPDCS: no atmospheric pressure map extracted. \n"); | |
499 | } | |
500 | delete map; | |
501 | ||
502 | return fPressure; | |
503 | } | |
e97cc90e | 504 | |
17984b61 | 505 | //_______________________________________________________________ |
506 | /*UInt_t AliGRPPreprocessor::MapPressure(TMap* dcsAliasMap) { | |
507 | // extract DCS pressure maps. Perform fits to save space | |
3dedb44a | 508 | |
17984b61 | 509 | UInt_t result=0; |
510 | TMap *map = fPressure->ExtractDCS(dcsAliasMap); | |
511 | if (map) { | |
512 | fPressure->MakeSplineFit(map); | |
513 | Double_t fitFraction = fPressure->NumFits()/fPressure->NumSensors(); | |
514 | if (fitFraction > kFitFraction ) { | |
515 | AliInfo(Form("Pressure values extracted, fits performed.\n")); | |
516 | } else { | |
517 | Log ("Too few pressure maps fitted. \n"); | |
518 | result = 9; | |
519 | } | |
520 | } else { | |
521 | Log("AliTPCPreprocsessor: no atmospheric pressure map extracted. \n"); | |
522 | result=9; | |
523 | } | |
524 | delete map; | |
525 | // Now store the final CDB file | |
3dedb44a | 526 | |
17984b61 | 527 | if ( result == 0 ) { |
528 | AliCDBMetaData metaData; | |
529 | metaData.SetBeamPeriod(0); | |
530 | metaData.SetResponsible("Panos Christakoglou"); | |
531 | metaData.SetComment("Preprocessor AliGRP data base pressure entries."); | |
532 | ||
533 | Bool_t storeOK = Store("Calib", "Pressure", fPressure, &metaData, 0, 0); | |
534 | if ( !storeOK ) result=1; | |
535 | } | |
3dedb44a | 536 | |
17984b61 | 537 | return result; |
538 | }*/ |