]>
Commit | Line | Data |
---|---|---|
6d17f6d5 | 1 | // $Id$ |
2 | ||
3 | //************************************************************************** | |
4 | //* This file is property of and copyright by the ALICE HLT Project * | |
5 | //* ALICE Experiment at CERN, All rights reserved. * | |
6 | //* * | |
7 | //* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> * | |
8 | //* for The ALICE HLT Project. * | |
9 | //* * | |
10 | //* Permission to use, copy, modify and distribute this software and its * | |
11 | //* documentation strictly for non-commercial purposes is hereby granted * | |
12 | //* without fee, provided that the above copyright notice appears in all * | |
13 | //* copies and that both the copyright notice and this permission notice * | |
14 | //* appear in the supporting documentation. The authors make no claims * | |
15 | //* about the suitability of this software for any purpose. It is * | |
16 | //* provided "as is" without express or implied warranty. * | |
17 | //************************************************************************** | |
c12197a2 | 18 | |
19 | /** @file AliHLTTPCNoiseMapComponent.cxx | |
20 | @author Kalliopi Kanaki | |
21 | @date | |
22 | @brief The TPC Noise Map component | |
23 | */ | |
24 | ||
c12197a2 | 25 | #if __GNUC__>= 3 |
26 | using namespace std; | |
27 | #endif | |
21f63108 | 28 | |
c12197a2 | 29 | #include "AliHLTTPCNoiseMapComponent.h" |
30 | #include "AliHLTTPCDigitReaderDecoder.h" | |
3a3550fa | 31 | //#include "AliHLTTPCDigitReaderPacked.h" |
c12197a2 | 32 | #include "AliHLTTPCTransform.h" |
33 | #include "AliHLTTPCDefinitions.h" | |
21f63108 | 34 | |
c12197a2 | 35 | #include "AliCDBEntry.h" |
36 | #include "AliCDBManager.h" | |
3a3550fa | 37 | #include "AliHLTTPCNoiseMap.h" |
21f63108 | 38 | |
deeb9f12 | 39 | #include "AliTPCCalPad.h" |
21f63108 | 40 | #include "AliTPCROC.h" |
41 | #include "AliTPCCalROC.h" | |
42 | ||
c12197a2 | 43 | #include <cstdlib> |
44 | #include <cerrno> | |
45 | #include "TString.h" | |
46 | #include "TFile.h" | |
47 | #include "TObjArray.h" | |
48 | #include "TObjString.h" | |
49 | #include <sys/time.h> | |
6d17f6d5 | 50 | #include "TH2.h" |
c12197a2 | 51 | |
c12197a2 | 52 | ClassImp(AliHLTTPCNoiseMapComponent) //ROOT macro for the implementation of ROOT specific class methods |
53 | ||
54 | AliHLTTPCNoiseMapComponent::AliHLTTPCNoiseMapComponent() | |
6d17f6d5 | 55 | : |
deeb9f12 | 56 | fSpecification(0), |
deeb9f12 | 57 | fPlotSideA(0), |
58 | fPlotSideC(0), | |
59 | fApplyNoiseMap(0), | |
21f63108 | 60 | fResetHistograms(0), |
deeb9f12 | 61 | fIsPacked(0), |
6d17f6d5 | 62 | fIsUnpacked(0), |
21f63108 | 63 | fCurrentSlice(-99), |
64 | fCurrentPartition(-99), | |
65 | fCurrentRow(-99), | |
3a3550fa | 66 | fHistSignal(NULL), |
67 | fHistMaxSignal(NULL), | |
68 | fHistTotSignal(NULL), | |
69 | fHistPadRMS(NULL), | |
70 | fHistCDBMap(NULL), | |
deeb9f12 | 71 | fHistSideA(NULL), |
3a3550fa | 72 | fHistSideC(NULL) |
c12197a2 | 73 | { |
74 | // see header file for class documentation | |
75 | // or | |
76 | // refer to README to build package | |
77 | // or | |
78 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
79 | } | |
80 | ||
6d17f6d5 | 81 | AliHLTTPCNoiseMapComponent::~AliHLTTPCNoiseMapComponent() { |
82 | // see header file for class documentation | |
c12197a2 | 83 | |
84 | } | |
85 | ||
c12197a2 | 86 | // Public functions to implement AliHLTComponent's interface. |
87 | // These functions are required for the registration process | |
88 | ||
6d17f6d5 | 89 | const char* AliHLTTPCNoiseMapComponent::GetComponentID() { |
90 | // see header file for class documentation | |
c12197a2 | 91 | |
92 | return "TPCNoiseMap"; | |
93 | } | |
94 | ||
6d17f6d5 | 95 | void AliHLTTPCNoiseMapComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) { |
96 | // see header file for class documentation | |
c12197a2 | 97 | |
98 | list.clear(); | |
99 | list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC ); | |
100 | } | |
101 | ||
6d17f6d5 | 102 | AliHLTComponentDataType AliHLTTPCNoiseMapComponent::GetOutputDataType() { |
103 | // see header file for class documentation | |
c12197a2 | 104 | |
deeb9f12 | 105 | return kAliHLTDataTypeHistogram; |
c12197a2 | 106 | } |
107 | ||
6d17f6d5 | 108 | int AliHLTTPCNoiseMapComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) { |
109 | // see header file for class documentation | |
c12197a2 | 110 | |
111 | tgtList.clear(); | |
deeb9f12 | 112 | tgtList.push_back(kAliHLTDataTypeHistogram); |
c12197a2 | 113 | return tgtList.size(); |
114 | } | |
115 | ||
6d17f6d5 | 116 | void AliHLTTPCNoiseMapComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) { |
117 | // see header file for class documentation | |
c12197a2 | 118 | |
0e588049 | 119 | constBase=800000; |
120 | inputMultiplier=0.0; | |
c12197a2 | 121 | } |
122 | ||
6d17f6d5 | 123 | AliHLTComponent* AliHLTTPCNoiseMapComponent::Spawn() { |
124 | // see header file for class documentation | |
c12197a2 | 125 | |
126 | return new AliHLTTPCNoiseMapComponent(); | |
127 | } | |
128 | ||
6d17f6d5 | 129 | int AliHLTTPCNoiseMapComponent::DoInit( int argc, const char** argv ) { |
130 | // see header file for class documentation | |
21f63108 | 131 | |
c12197a2 | 132 | Int_t i = 0; |
133 | Char_t* cpErr; | |
134 | ||
135 | int iResult=0; | |
136 | ||
137 | TString configuration=""; | |
138 | TString argument=""; | |
0e588049 | 139 | for (int j=0; j<argc && iResult>=0; j++) { |
c12197a2 | 140 | |
0e588049 | 141 | argument=argv[j]; |
c12197a2 | 142 | if (!configuration.IsNull()) configuration+=" "; |
21f63108 | 143 | configuration+=argument; |
c12197a2 | 144 | } |
145 | ||
146 | if (!configuration.IsNull()) { | |
147 | iResult=Configure(configuration.Data()); | |
148 | } else { | |
149 | iResult=Reconfigure(NULL, NULL); | |
150 | } | |
151 | ||
152 | ||
153 | while ( i < argc ) { | |
deeb9f12 | 154 | if (!strcmp( argv[i], "-apply-noisemap")) { |
155 | fApplyNoiseMap = strtoul( argv[i+1], &cpErr ,0); | |
21f63108 | 156 | |
deeb9f12 | 157 | if ( *cpErr ) { |
158 | HLTError("Cannot convert apply-noisemap specifier '%s'.", argv[i+1]); | |
159 | return EINVAL; | |
160 | } | |
161 | i+=2; | |
162 | continue; | |
163 | } | |
c12197a2 | 164 | |
deeb9f12 | 165 | if (!strcmp( argv[i], "-plot-side-a")) { |
166 | fPlotSideA = strtoul( argv[i+1], &cpErr ,0); | |
21f63108 | 167 | |
c12197a2 | 168 | if ( *cpErr ) { |
deeb9f12 | 169 | HLTError("Cannot convert plot-side-a specifier '%s'.", argv[i+1]); |
c12197a2 | 170 | return EINVAL; |
171 | } | |
172 | i+=2; | |
173 | continue; | |
174 | } | |
deeb9f12 | 175 | |
176 | if (!strcmp( argv[i], "-plot-side-c")) { | |
177 | fPlotSideC = strtoul( argv[i+1], &cpErr ,0); | |
deeb9f12 | 178 | |
179 | if ( *cpErr ) { | |
180 | HLTError("Cannot convert plot-side-c specifier '%s'.", argv[i+1]); | |
181 | return EINVAL; | |
182 | } | |
183 | i+=2; | |
184 | continue; | |
185 | } | |
21f63108 | 186 | |
187 | if (!strcmp( argv[i], "-reset-histograms")) { | |
188 | fResetHistograms = strtoul( argv[i+1], &cpErr ,0); | |
deeb9f12 | 189 | |
21f63108 | 190 | if ( *cpErr ) { |
191 | HLTError("Cannot convert reset-histograms specifier '%s'.", argv[i+1]); | |
192 | return EINVAL; | |
193 | } | |
194 | i+=2; | |
195 | continue; | |
196 | } | |
197 | ||
c12197a2 | 198 | Logging(kHLTLogError, "HLT::TPCNoiseMap::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] ); |
199 | return EINVAL; | |
200 | ||
deeb9f12 | 201 | } // end while |
c12197a2 | 202 | |
3a3550fa | 203 | if(fApplyNoiseMap){ |
204 | AliHLTTPCNoiseMap *nm = AliHLTTPCNoiseMap::Instance(); | |
205 | AliTPCCalPad *noisePad = nm->ReadNoiseMap(); | |
206 | fHistCDBMap = noisePad->MakeHisto2D(1); | |
207 | } | |
c12197a2 | 208 | |
21f63108 | 209 | // if(fApplyNoiseMap){ |
210 | // //TFile *f = TFile::Open("/scratch/noiseComp/Run3398_4000_v0_s72.root"); | |
211 | // TFile *f = TFile::Open("/home/kanaki/noiseComp/Run3398_4000_v0_s72.root"); | |
212 | // AliCDBEntry *pEntry = (AliCDBEntry*)f->Get("AliCDBEntry"); | |
213 | // noisePad = (AliTPCCalPad*)pEntry->GetObject(); | |
214 | // //fHistCDBMap = noisePad->MakeHisto2D(1); //side C | |
215 | // } | |
216 | ||
217 | ||
218 | // HLTDebug("using AliHLTTPCDigitReaderDecoder"); | |
219 | // pDigitReader = new AliHLTTPCDigitReaderDecoder(); // double-loop | |
220 | // pDigitReader = new AliHLTTPCDigitReaderPacked(); | |
221 | ||
c12197a2 | 222 | return 0; |
21f63108 | 223 | |
c12197a2 | 224 | } // end DoInit() |
225 | ||
6d17f6d5 | 226 | int AliHLTTPCNoiseMapComponent::DoDeinit() { |
3a3550fa | 227 | // see header file for class documentation |
c12197a2 | 228 | return 0; |
229 | } | |
230 | ||
0e588049 | 231 | int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& /*trigData*/){ |
6d17f6d5 | 232 | // see header file for class documentation |
c12197a2 | 233 | |
234 | HLTInfo("--- Entering DoEvent() in TPCNoiseMap ---"); | |
21f63108 | 235 | |
deeb9f12 | 236 | if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0; |
237 | ||
2fdb1ae7 | 238 | if(fPlotSideA){ |
239 | fHistSideA = new TH2F("fHistSideA","TPC Side A",250,-250,250,250,-250,250); | |
240 | fHistSideA->SetXTitle("global X (cm)"); fHistSideA->SetYTitle("global Y (cm)"); | |
241 | } | |
242 | ||
243 | if(fPlotSideC){ | |
244 | fHistSideC = new TH2F("fHistSideC","TPC Side C",250,-250,250,250,-250,250); | |
245 | fHistSideC->SetXTitle("global X (cm)"); fHistSideC->SetYTitle("global Y (cm)"); | |
246 | } | |
247 | ||
21f63108 | 248 | const AliHLTComponentBlockData *iter = NULL; |
249 | ||
c12197a2 | 250 | Float_t xyz[3]; |
251 | Int_t thissector, thisrow; | |
3a3550fa | 252 | |
253 | fHistMaxSignal = new TH2F("fHistMaxSignal","maximum signal", 250,-250,250,250,-250,250); | |
254 | fHistTotSignal = new TH2F("fHistTotSignal","total signal", 250,-250,250,250,-250,250); | |
255 | fHistPadRMS = new TH2F("fHistPadRMS", "RMS", 250,-250,250,250,-250,250); | |
256 | ||
21f63108 | 257 | for(iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputBlock()){ |
258 | ||
deeb9f12 | 259 | HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", |
260 | evtData.fEventID, evtData.fEventID, | |
261 | DataType2Text(iter->fDataType).c_str(), | |
262 | DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); | |
263 | ||
264 | if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType && GetEventCount()<2){ | |
265 | HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!", | |
266 | DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(), | |
267 | DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); | |
268 | } | |
269 | ||
270 | if (iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC)) continue; | |
c12197a2 | 271 | |
deeb9f12 | 272 | UInt_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); |
273 | UInt_t partition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); | |
deeb9f12 | 274 | |
deeb9f12 | 275 | fSpecification = iter->fSpecification; |
276 | ||
277 | AliHLTTPCDigitReader *pDigitReader = new AliHLTTPCDigitReaderDecoder; | |
278 | ||
279 | pDigitReader->InitBlock(iter->fPtr,iter->fSize,partition,slice); | |
21f63108 | 280 | if(!pDigitReader) break; |
281 | ||
2fdb1ae7 | 282 | //sprintf(name,"hMaxSignal_slice%d_partition%d", slice, partition); |
3a3550fa | 283 | //fHistMaxSignal = new TH2F(name,name,250,-250,250,250,-250,250); |
21f63108 | 284 | |
3a3550fa | 285 | while(pDigitReader->Next()){ |
deeb9f12 | 286 | //while( pDigitReader->NextChannel()) { // pad loop |
c12197a2 | 287 | |
deeb9f12 | 288 | fCurrentRow = pDigitReader->GetRow(); |
289 | fCurrentRow += pDigitReader->GetRowOffset(); | |
6d17f6d5 | 290 | |
deeb9f12 | 291 | AliHLTTPCTransform::Slice2Sector(slice,fCurrentRow,thissector,thisrow); |
3a3550fa | 292 | AliHLTTPCTransform::Raw2Local(xyz,thissector,thisrow,pDigitReader->GetPad(),0); |
293 | ||
294 | if(slice>17) xyz[1] = (-1.0)*xyz[1]; | |
295 | else continue; | |
296 | ||
297 | AliHLTTPCTransform::Local2Global(xyz,slice); | |
298 | // temporarily the transformation Raw2Global will be broken down to 2 steps, | |
299 | // as there is a correction necessary at the y coordinate of the local xyz. | |
300 | ||
21f63108 | 301 | //AliHLTTPCTransform::Raw2Global(xyz,thissector,thisrow,pDigitReader->GetPad(),0); |
3a3550fa | 302 | // transformation from pad-row coordinates to global ones |
303 | // time info is not taken into account | |
21f63108 | 304 | |
305 | // AliTPCCalROC *calRoc = noisePad->GetCalROC(thissector); | |
306 | // calRoc->GetValue(thisrow,pDigitReader->GetPad()); | |
307 | ||
deeb9f12 | 308 | //while( pDigitReader->NextBunch()) { |
309 | ||
21f63108 | 310 | const UInt_t *bunchData = pDigitReader->GetSignals(); |
3a3550fa | 311 | Float_t maxSignal = 0.; |
312 | Float_t totalSignal = 0.; | |
313 | ||
314 | fHistSignal = new TH1F("fHistSignal", "signal distribution per pad",1024,0,1024); | |
315 | ||
316 | for(Int_t i=0;i<pDigitReader->GetBunchSize();i++){ | |
deeb9f12 | 317 | |
3a3550fa | 318 | if((Float_t)(bunchData[i])>maxSignal){ maxSignal = (Float_t)(bunchData[i]); } |
319 | totalSignal += bunchData[i]; | |
320 | fHistSignal->Fill(bunchData[i]); | |
321 | } // end for loop over bunches | |
322 | ||
55f2c86a | 323 | //cout << "total signal: " << totalSignal << endl; |
324 | //cout << " integral: " << fHistSignal->Integral() << endl; | |
325 | ||
deeb9f12 | 326 | //} // end of inner while loop |
21f63108 | 327 | |
3a3550fa | 328 | fHistMaxSignal->Fill(xyz[0],xyz[1],maxSignal); |
329 | fHistTotSignal->Fill(xyz[0],xyz[1],totalSignal); | |
330 | fHistPadRMS->Fill(xyz[0],xyz[1],fHistSignal->GetRMS()); | |
55f2c86a | 331 | delete fHistSignal; fHistSignal = NULL; |
332 | ||
21f63108 | 333 | if(fPlotSideA || fPlotSideC){ |
334 | if(slice<18) fHistSideA->Fill(xyz[0],xyz[1],maxSignal); | |
335 | else fHistSideC->Fill(xyz[0],xyz[1],maxSignal); | |
55f2c86a | 336 | } // end if plotting sides |
3a3550fa | 337 | } // end of while loop over pads |
55f2c86a | 338 | |
2fdb1ae7 | 339 | delete pDigitReader; |
deeb9f12 | 340 | } // end of for loop over data blocks |
c12197a2 | 341 | |
21f63108 | 342 | if(fResetHistograms) ResetHistograms(); |
deeb9f12 | 343 | MakeHistosPublic(); |
3a3550fa | 344 | |
deeb9f12 | 345 | return 0; |
c12197a2 | 346 | } // end DoEvent() |
347 | ||
3a3550fa | 348 | |
deeb9f12 | 349 | void AliHLTTPCNoiseMapComponent::MakeHistosPublic() { |
6d17f6d5 | 350 | // see header file for class documentation |
c12197a2 | 351 | |
deeb9f12 | 352 | // TFile *outputfile = new TFile("test.root","RECREATE"); |
55f2c86a | 353 | // fHistSignal->Write(); |
deeb9f12 | 354 | // outputfile->Save(); |
355 | // outputfile->Close(); | |
3a3550fa | 356 | |
deeb9f12 | 357 | TObjArray histos; |
3a3550fa | 358 | histos.Add(fHistMaxSignal); |
359 | histos.Add(fHistTotSignal); | |
360 | histos.Add(fHistPadRMS); | |
361 | histos.Add(fHistCDBMap); | |
21f63108 | 362 | if(fPlotSideA) histos.Add(fHistSideA); |
363 | if(fPlotSideC) histos.Add(fHistSideC); | |
21f63108 | 364 | |
365 | TIter iterator(&histos); | |
3a3550fa | 366 | while(TObject *pObj=iterator.Next()){ PushBack(pObj, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); } |
21f63108 | 367 | |
368 | //PushBack( (TObject*) &histos, kAliHLTDataTypeHistogram, fSpecification); | |
369 | ||
3a3550fa | 370 | if(fHistMaxSignal) delete fHistMaxSignal; fHistMaxSignal = NULL; |
371 | if(fHistTotSignal) delete fHistTotSignal; fHistTotSignal = NULL; | |
372 | if(fHistPadRMS) delete fHistPadRMS; fHistPadRMS = NULL; | |
373 | if(fHistSideA) delete fHistSideA; fHistSideA = NULL; | |
374 | if(fHistSideC) delete fHistSideC; fHistSideC = NULL; | |
375 | ||
c12197a2 | 376 | } |
377 | ||
21f63108 | 378 | void AliHLTTPCNoiseMapComponent::ResetHistograms(){ |
379 | // see header file for class documentation | |
380 | ||
3a3550fa | 381 | //if(fHistPartition) fHistPartition->Reset(); |
382 | if(fHistMaxSignal) fHistMaxSignal->Reset(); | |
383 | if(fHistTotSignal) fHistTotSignal->Reset(); | |
384 | if(fHistPadRMS) fHistPadRMS->Reset(); | |
385 | ||
2fdb1ae7 | 386 | if(fHistSideA) fHistSideA->Reset(); |
387 | if(fHistSideC) fHistSideC->Reset(); | |
21f63108 | 388 | } |
389 | ||
6d17f6d5 | 390 | int AliHLTTPCNoiseMapComponent::Configure(const char* arguments) { |
391 | // see header file for class documentation | |
c12197a2 | 392 | |
393 | int iResult=0; | |
394 | if (!arguments) return iResult; | |
395 | HLTInfo("parsing configuration string \'%s\'", arguments); | |
396 | ||
397 | TString allArgs=arguments; | |
398 | TString argument; | |
399 | int bMissingParam=0; | |
400 | ||
401 | TObjArray* pTokens=allArgs.Tokenize(" "); | |
402 | if (pTokens) { | |
403 | for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) { | |
404 | argument=((TObjString*)pTokens->At(i))->GetString(); | |
405 | if (argument.IsNull()) continue; | |
406 | ||
deeb9f12 | 407 | if (argument.CompareTo("-apply-noisemap")==0) { |
c12197a2 | 408 | if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; |
deeb9f12 | 409 | HLTInfo("got \'-apply-noisemap\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); |
410 | ||
411 | } | |
412 | else if (argument.CompareTo("-plot-side-c")==0) { | |
413 | if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; | |
414 | HLTInfo("got \'-plot-side-c\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); | |
415 | ||
416 | } | |
417 | else if (argument.CompareTo("-plot-side-a")==0) { | |
418 | if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; | |
419 | HLTInfo("got \'-plot-side-a\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); | |
c12197a2 | 420 | |
3a3550fa | 421 | } |
422 | else if(argument.CompareTo("-reset-histograms")==0){ | |
423 | if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; | |
424 | HLTInfo("got \'-reset-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); | |
425 | ||
c12197a2 | 426 | } |
427 | else { | |
428 | HLTError("unknown argument %s", argument.Data()); | |
429 | iResult=-EINVAL; | |
430 | break; | |
431 | } | |
deeb9f12 | 432 | } // end for |
433 | ||
c12197a2 | 434 | delete pTokens; |
deeb9f12 | 435 | |
436 | } // end if pTokens | |
437 | ||
c12197a2 | 438 | if (bMissingParam) { |
439 | HLTError("missing parameter for argument %s", argument.Data()); | |
440 | iResult=-EINVAL; | |
441 | } | |
21f63108 | 442 | return iResult; |
c12197a2 | 443 | } |
444 | ||
6d17f6d5 | 445 | int AliHLTTPCNoiseMapComponent::Reconfigure(const char* cdbEntry, const char* chainId) { |
446 | // see header file for class documentation | |
c12197a2 | 447 | int iResult=0; |
448 | const char* path="HLT/ConfigTPC/TPCNoiseMapComponent"; | |
449 | const char* defaultNotify=""; | |
450 | if (cdbEntry) { | |
deeb9f12 | 451 | path=cdbEntry; |
452 | defaultNotify=" (default)"; | |
c12197a2 | 453 | } |
deeb9f12 | 454 | |
c12197a2 | 455 | if (path) { |
456 | HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>"); | |
457 | AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); | |
458 | if (pEntry) { | |
459 | TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject()); | |
460 | if (pString) { | |
461 | HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); | |
462 | iResult=Configure(pString->GetString().Data()); | |
463 | } else { | |
464 | HLTError("configuration object \"%s\" has wrong type, required TObjString", path); | |
465 | } | |
466 | } else { | |
deeb9f12 | 467 | HLTError("cannot fetch object \"%s\" from CDB", path); |
c12197a2 | 468 | } |
469 | } | |
470 | ||
471 | return iResult; | |
472 | } |