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