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