correcting printf format specifiers
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCHistogramHandlerComponent.cxx
CommitLineData
5a19f42a 1// $Id$
cdfe3c01 2//**************************************************************************
3//* This file is property of and copyright by the ALICE HLT Project *
4//* ALICE Experiment at CERN, All rights reserved. *
5//* *
6//* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
7//* for The ALICE HLT Project. *
8//* *
9//* Permission to use, copy, modify and distribute this software and its *
10//* documentation strictly for non-commercial purposes is hereby granted *
11//* without fee, provided that the above copyright notice appears in all *
12//* copies and that both the copyright notice and this permission notice *
13//* appear in the supporting documentation. The authors make no claims *
14//* about the suitability of this software for any purpose. It is *
15//* provided "as is" without express or implied warranty. *
16//**************************************************************************
17
18/** @file AliHLTTPCHistogramHandlerComponent.cxx
19 @author Kalliopi Kanaki
20 @date
21 @brief The Histogram Handler component
22*/
23
24#if __GNUC__>= 3
25using namespace std;
26#endif
27#include "AliHLTTPCHistogramHandlerComponent.h"
28#include "AliHLTTPCDefinitions.h"
29#include "AliCDBEntry.h"
30#include "AliCDBManager.h"
0efebbac 31#include "AliHLTTPCTransform.h"
cdfe3c01 32
33#include <cstdlib>
34#include <cerrno>
35#include "TString.h"
36#include "TFile.h"
37#include "TObjArray.h"
38#include "TObjString.h"
39#include <sys/time.h>
40#include "TH1.h"
41#include "TH2.h"
42#include "TLine.h"
43#include "TMath.h"
44
cdfe3c01 45ClassImp(AliHLTTPCHistogramHandlerComponent) //ROOT macro for the implementation of ROOT specific class methods
46
3789100d 47 AliHLTTPCHistogramHandlerComponent::AliHLTTPCHistogramHandlerComponent()
cdfe3c01 48 :
0e588049 49 fSpecification(0),
cdfe3c01 50 fNoiseHistograms(0),
51 fKryptonHistograms(0),
3789100d 52 fUseGeneral(kFALSE),
fec96a66 53 fIgnoreSpecification(kFALSE),
cdfe3c01 54 fSlice(-99),
0efebbac 55
cdfe3c01 56 fHistTH1Tmp(NULL),
0efebbac 57 fTotalClusterChargeIROCAll(NULL),
58 fTotalClusterChargeOROCAll(NULL),
59 fQMaxPartitionAll(NULL),
60 fPlotQmaxROCAll(NULL),
61 fNumberOfClusters(NULL),
62
cdfe3c01 63 fHistTH2Tmp(NULL),
55f2c86a 64 fHistTPCSideAmax(NULL),
65 fHistTPCSideCmax(NULL),
66 fHistTPCSideAtot(NULL),
67 fHistTPCSideCtot(NULL),
68 fHistTPCSideArms(NULL),
3789100d 69 fHistTPCSideCrms(NULL),
70
71 fHistogramData()
cdfe3c01 72{
73 // see header file for class documentation
74 // or
75 // refer to README to build package
76 // or
77 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
78}
79
80AliHLTTPCHistogramHandlerComponent::~AliHLTTPCHistogramHandlerComponent() {
3789100d 81 // see header file for class documentation
cdfe3c01 82
83}
84
85// Public functions to implement AliHLTComponent's interface.
86// These functions are required for the registration process
87
88const char* AliHLTTPCHistogramHandlerComponent::GetComponentID() {
3789100d 89 // see header file for class documentation
cdfe3c01 90
91 return "TPCHistogramHandler";
92}
93
94void AliHLTTPCHistogramHandlerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
3789100d 95 // see header file for class documentation
cdfe3c01 96
97 list.clear();
98 list.push_back( kAliHLTDataTypeHistogram );
99}
100
101AliHLTComponentDataType AliHLTTPCHistogramHandlerComponent::GetOutputDataType() {
3789100d 102 // see header file for class documentation
cdfe3c01 103
104 return kAliHLTDataTypeHistogram;
105}
106
107int AliHLTTPCHistogramHandlerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) {
3789100d 108 // see header file for class documentation
cdfe3c01 109
110 tgtList.clear();
111 tgtList.push_back(kAliHLTDataTypeHistogram);
112 return tgtList.size();
113}
114
115void AliHLTTPCHistogramHandlerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
3789100d 116 // see header file for class documentation
cdfe3c01 117
118 constBase=0;
119 inputMultiplier=2.0;
120}
121
122AliHLTComponent* AliHLTTPCHistogramHandlerComponent::Spawn() {
3789100d 123 // see header file for class documentation
cdfe3c01 124
125 return new AliHLTTPCHistogramHandlerComponent();
126}
127
128int AliHLTTPCHistogramHandlerComponent::DoInit( int argc, const char** argv ) {
3789100d 129 // see header file for class documentation
cdfe3c01 130
3f0fd8f1 131 //Int_t i = 0;
132 //Char_t* cpErr;
cdfe3c01 133
134 int iResult=0;
135
136 TString configuration="";
137 TString argument="";
0e588049 138 for (int j=0; j<argc && iResult>=0; j++) {
cdfe3c01 139
0e588049 140 argument=argv[j];
cdfe3c01 141 if (!configuration.IsNull()) configuration+=" ";
142 configuration+=argument;
143 }
144
145 if (!configuration.IsNull()) {
146 iResult=Configure(configuration.Data());
147 } else {
148 iResult=Reconfigure(NULL, NULL);
149 }
150
3789100d 151 if(fUseGeneral == kFALSE){
152 fHistTPCSideAmax = new TH2F("fHistTPCSideAmax","TPC side A (max signal)",250,-250,250,250,-250,250);
153 fHistTPCSideAmax->SetXTitle("global X (cm)"); fHistTPCSideAmax->SetYTitle("global Y (cm)");
154 fHistTPCSideCmax = new TH2F("fHistTPCSideCmax","TPC side C (max signal)",250,-250,250,250,-250,250);
155 fHistTPCSideCmax->SetXTitle("global X (cm)"); fHistTPCSideCmax->SetYTitle("global Y (cm)");
156
157 fHistTPCSideAtot = new TH2F("fHistTPCSideAtot","TPC side A (total signal)",250,-250,250,250,-250,250);
158 fHistTPCSideAtot->SetXTitle("global X (cm)"); fHistTPCSideAtot->SetYTitle("global Y (cm)");
159 fHistTPCSideCtot = new TH2F("fHistTPCSideCtot","TPC side C (total signal)",250,-250,250,250,-250,250);
160 fHistTPCSideCtot->SetXTitle("global X (cm)"); fHistTPCSideCtot->SetYTitle("global Y (cm)");
161
162 fHistTPCSideArms = new TH2F("fHistTPCSideArms","TPC side A (baseline RMS)",250,-250,250,250,-250,250);
163 fHistTPCSideArms->SetXTitle("global X (cm)"); fHistTPCSideArms->SetYTitle("global Y (cm)");
164 fHistTPCSideCrms = new TH2F("fHistTPCSideCrms","TPC side C (baseline RMS)",250,-250,250,250,-250,250);
165 fHistTPCSideCrms->SetXTitle("global X (cm)"); fHistTPCSideCrms->SetYTitle("global Y (cm)");
166 }
cdfe3c01 167 return 0;
168} // end DoInit()
169
170int AliHLTTPCHistogramHandlerComponent::DoDeinit() {
3789100d 171 // see header file for class documentation
55f2c86a 172
3789100d 173 if(fHistTPCSideAmax){ delete fHistTPCSideAmax; fHistTPCSideAmax=NULL; }
174 if(fHistTPCSideCmax){ delete fHistTPCSideCmax; fHistTPCSideCmax=NULL; }
cdfe3c01 175
3789100d 176 if(fHistTPCSideAtot){ delete fHistTPCSideAtot; fHistTPCSideAtot=NULL; }
177 if(fHistTPCSideCtot){ delete fHistTPCSideCtot; fHistTPCSideCtot=NULL; }
55f2c86a 178
3789100d 179 if(fHistTPCSideArms){ delete fHistTPCSideArms; fHistTPCSideArms=NULL; }
180 if(fHistTPCSideCrms){ delete fHistTPCSideCrms; fHistTPCSideCrms=NULL; }
55f2c86a 181
3789100d 182 return 0;
cdfe3c01 183}
184
0e588049 185int AliHLTTPCHistogramHandlerComponent::DoEvent(const AliHLTComponentEventData&/* evtData*/, AliHLTComponentTriggerData& /*trigData*/){
3789100d 186 // see header file for class documentation
cdfe3c01 187
3f0fd8f1 188 //HLTInfo("--- Entering DoEvent() in TPCHistogramHandler ---");
cdfe3c01 189
190 if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0;
0efebbac 191
3789100d 192 if(fUseGeneral == kFALSE){
193 fTotalClusterChargeIROCAll = new TH1F("fTotalClusterChargeIROCAll","Total Charge of clusters in all IROC",4000,0,4000);
194 fTotalClusterChargeOROCAll = new TH1F("fTotalClusterChargeOROCAll","Total Charge of clusters in all OROC",4000,0,4000);
195 fQMaxPartitionAll = new TH1F("fQMaxPartitionAll", "QMax for All Partitions", 216,0,216);
196 fPlotQmaxROCAll = new TH1F("fQMaxROCAll", "QMax for All ROC", 72,0,72);
197 fNumberOfClusters = new TH1F("fNumberOfClusters", "Total Number of Clusters", 1,0,1);
3f0fd8f1 198 }
3789100d 199
3f0fd8f1 200 const TObject *iter = NULL;
cdfe3c01 201 for(iter = GetFirstInputObject(kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputObject()){
55f2c86a 202
3789100d 203 // HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
204 // evtData.fEventID, evtData.fEventID,
205 // DataType2Text(GetDataType(iter)).c_str(),
206 // DataType2Text(kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC).c_str());
cdfe3c01 207
3789100d 208 // if (GetDataType(iter) == (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC) && GetEventCount()<2){
209 // HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeHistogram)!",
210 // DataType2Text(kAliHLTDataTypeHistogram).c_str(),
211 // DataType2Text(kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC).c_str());
212 // }
cdfe3c01 213
3789100d 214 if (GetDataType(iter) != (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC)) continue;
cdfe3c01 215
3789100d 216 // Summing the output histograms of the AliHLTTPCNoiseMapComponent (from partition to TPC sides)
217
218 if(fUseGeneral == kFALSE){
3f0fd8f1 219 if(fNoiseHistograms == kTRUE){
55f2c86a 220
3789100d 221 fHistTH2Tmp = (TH2F*)iter;
222 TString histName = fHistTH2Tmp->GetName();
55f2c86a 223
224 UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
3789100d 225 UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(GetSpecification(iter));
226 UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
227 UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(GetSpecification(iter));
228
229 if((minSlice!=maxSlice) || (minPartition!=maxPartition)){
230 HLTWarning("TPCHistogramHandler::The Noise Map component is not running on partition level!");
231 }
232
233 // minSlice=maxSlice, when the Noise Map component runs on partition level (as it should)
55f2c86a 234
3f0fd8f1 235 if (histName.Contains("fHistSideAMaxSignal")) fHistTPCSideAmax->Add(fHistTH2Tmp,1);
236 else if(histName.Contains("fHistSideATotSignal")) fHistTPCSideAtot->Add(fHistTH2Tmp,1);
237 else if(histName.Contains("fHistSideAPadRMS")) fHistTPCSideArms->Add(fHistTH2Tmp,1);
238 else if(histName.Contains("fHistSideCMaxSignal")) fHistTPCSideCmax->Add(fHistTH2Tmp,1);
239 else if(histName.Contains("fHistSideCTotSignal")) fHistTPCSideCtot->Add(fHistTH2Tmp,1);
240 else if(histName.Contains("fHistSideCPadRMS")) fHistTPCSideCrms->Add(fHistTH2Tmp,1);
241 else continue;
242
3789100d 243 } // endif fNoiseHistograms==kTRUE
3f0fd8f1 244
3789100d 245 // Summing the output of AliHLTTPCClusterHistoComponent
246 if(fKryptonHistograms){
247 Int_t thisrow=-1,thissector=-1,row=-1;
248
249 AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
250 AliHLTUInt8_t patch = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
251 row = AliHLTTPCTransform::GetFirstRow(patch);
252 AliHLTTPCTransform::Slice2Sector(slice,row,thissector,thisrow);
253
3f0fd8f1 254 fHistTH1Tmp = (TH1F*)iter;
0efebbac 255 TString name = fHistTH1Tmp->GetName();
3789100d 256
0efebbac 257 if(name=="fTotalClusterChargeIROCAll"){
3789100d 258 fTotalClusterChargeIROCAll->Add(fTotalClusterChargeIROCAll,fHistTH1Tmp,1,1);
0efebbac 259 }
260 else if(name=="fTotalClusterChargeOROCAll"){
3789100d 261 fTotalClusterChargeOROCAll->Add(fTotalClusterChargeOROCAll,fHistTH1Tmp,1,1);
0efebbac 262 }
263 else if(name=="fQMaxPartitionAll"){
0e588049 264 for(Int_t t=0;t<216;t++){
265 if(fHistTH1Tmp->GetBinContent(t)>fQMaxPartitionAll->GetBinContent(t)){
266 fQMaxPartitionAll->SetBinContent(t,fHistTH1Tmp->GetBinContent(t));
267 }
268 }
269 }
270 else if(name=="fQMaxROCAll"){
271 for(Int_t t=0;t<72;t++){
272 if(fHistTH1Tmp->GetBinContent(t)>fPlotQmaxROCAll->GetBinContent(t)){
273 fPlotQmaxROCAll->SetBinContent(t,fHistTH1Tmp->GetBinContent(t));
274 }
275 }
0efebbac 276 }
0efebbac 277 else if(name=="fNumberOfClusters"){
0e588049 278 fNumberOfClusters->Add(fNumberOfClusters,fHistTH1Tmp,1,1);
279 }
280 else{
281 HLTWarning("No histogram names match. %s",name.Data());
282 continue;
283 }
3789100d 284 } //endif fKryptonHistograms==kTRUE
285 }
3f0fd8f1 286
287 else { // means fUseGeneral ==kTRUE
288
3789100d 289 TH1 * tmp = (TH1*)iter;
290 TString histName = tmp->GetName();
291 UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
292 UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(GetSpecification(iter));
293 UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
294 UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(GetSpecification(iter));
295
296 Bool_t histogramNotAdded = kTRUE;
297
298 for(UInt_t i=0;i<fHistogramData.size();i++){
3f0fd8f1 299 if(fIgnoreSpecification == kTRUE){
300
301 /*
302 if(histName.Contains(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition))){
303 cout << "HistogramContains the given string." << endl;
304 }
305 */
306 histName.ReplaceAll(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition),"");
307 }
308
fec96a66 309 if(histName.CompareTo(fHistogramData.at(i).fHistogram->GetName())==0){
32f88fc5 310 if((minSlice==fHistogramData.at(i).fMinSlice && maxSlice == fHistogramData.at(i).fMaxSlice) || fIgnoreSpecification == kTRUE){
311 if((minPartition==fHistogramData.at(i).fMinPartition && maxPartition == fHistogramData.at(i).fMaxPartition) || fIgnoreSpecification == kTRUE){
3789100d 312 fHistogramData.at(i).fHistogram->Add(tmp);
313 histogramNotAdded = kFALSE;
314 break;
315 }
316 else{
317 HLTWarning("Histogram with same name does not have the same partition specification");
318 }
319 }
320 else{
321 HLTWarning("Histogram with same name does not have the same slice specification");
322 }
323 }
324 }
3f0fd8f1 325
326 if(fHistogramData.size()==0){
327 if(fIgnoreSpecification == kTRUE){
5a19f42a 328 if(histName.Contains(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition))){
3f0fd8f1 329 cout << "HistogramContains the given string." << endl;
330 }
331 histName.ReplaceAll(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition),"");
332 }
333 }
3789100d 334
335 if(histogramNotAdded == kTRUE){
3f0fd8f1 336 tmp->SetName(histName);
337 AliHLTHistogramData histogramData;
338 histogramData.fHistogram = tmp;
339 histogramData.fMinSlice = minSlice;
340 histogramData.fMaxSlice = maxSlice;
341 histogramData.fMinPartition = minPartition;
342 histogramData.fMaxPartition = maxPartition;
343 fHistogramData.push_back(histogramData);
3789100d 344 }
3f0fd8f1 345 }
cdfe3c01 346 } // end for loop over histogram blocks
347
348 MakeHistosPublic();
cdfe3c01 349 return 0;
350} // end DoEvent()
3789100d 351
cdfe3c01 352void AliHLTTPCHistogramHandlerComponent::MakeHistosPublic() {
3789100d 353 // see header file for class documentation
55f2c86a 354
3789100d 355 if(fUseGeneral == kFALSE){
356 if(fNoiseHistograms){
357 PushBack((TObject*)fHistTPCSideAmax,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
358 PushBack((TObject*)fHistTPCSideCmax,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(18,35,0,5));
359
360 PushBack((TObject*)fHistTPCSideAtot,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
361 PushBack((TObject*)fHistTPCSideCtot,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(18,35,0,5));
362
363 PushBack((TObject*)fHistTPCSideArms,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
364 PushBack((TObject*)fHistTPCSideCrms,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(18,35,0,5));
365
366 //if(fHistTH2Tmp) { delete fHistTH2Tmp; fHistTH2Tmp=NULL; }
367 // if(fHistTPCSideA){ delete fHistTPCSideA; fHistTPCSideA=NULL; }
368 // if(fHistTPCSideC){ delete fHistTPCSideC; fHistTPCSideC=NULL; }
369 }
55f2c86a 370
3789100d 371 if(fKryptonHistograms){
372 PushBack((TObject*)fTotalClusterChargeIROCAll,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,17,0,1));
373 PushBack((TObject*)fTotalClusterChargeOROCAll,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,17,2,5));
374 PushBack((TObject*)fQMaxPartitionAll, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
375 PushBack((TObject*)fPlotQmaxROCAll, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
376 PushBack((TObject*)fNumberOfClusters, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
377
378 if(fTotalClusterChargeIROCAll){ delete fTotalClusterChargeIROCAll; fTotalClusterChargeIROCAll=NULL; }
379 if(fTotalClusterChargeOROCAll){ delete fTotalClusterChargeOROCAll; fTotalClusterChargeOROCAll=NULL; }
380 if(fQMaxPartitionAll) { delete fQMaxPartitionAll; fQMaxPartitionAll=NULL; }
381 if(fPlotQmaxROCAll) { delete fPlotQmaxROCAll; fPlotQmaxROCAll=NULL; }
382 if(fNumberOfClusters) { delete fNumberOfClusters; fNumberOfClusters=NULL; }
383 if(fHistTH1Tmp) { delete fHistTH1Tmp; fHistTH1Tmp=NULL; }
384 }
cdfe3c01 385 }
3789100d 386 else{ // means fUseGeneral == kTRUE
387 for(UInt_t i=0;i<fHistogramData.size();i++){
388 PushBack((TObject*)fHistogramData.at(i).fHistogram,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(
3f0fd8f1 389 fHistogramData.at(i).fMinSlice,fHistogramData.at(i).fMaxSlice,fHistogramData.at(i).fMinPartition,fHistogramData.at(i).fMaxPartition));
3789100d 390 }
76a1edf9 391 fHistogramData.clear();
3789100d 392 }
393 // TObjArray histos;
cdfe3c01 394
3789100d 395 // if(fPlotSideA) histos.Add(fHistSideA);
396 // if(fPlotSideC) histos.Add(fHistSideC);
397 // if(fApplyNoiseMap) histos.Add(fHistCDBMap);
398 //
399 // TIter iterator(&histos);
400 // while(TObject *pObj=iterator.Next()){
401 //
402 // PushBack(pObj, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification);
403 // }
404 //
405 //
406 // //PushBack( (TObject*) &histos, kAliHLTDataTypeHistogram, fSpecification);
cdfe3c01 407}
408
409int AliHLTTPCHistogramHandlerComponent::Configure(const char* arguments) {
3789100d 410 // see header file for class documentation
cdfe3c01 411
412 int iResult=0;
413 if (!arguments) return iResult;
414 HLTInfo("parsing configuration string \'%s\'", arguments);
415
416 TString allArgs=arguments;
417 TString argument;
418 int bMissingParam=0;
419
420 TObjArray* pTokens=allArgs.Tokenize(" ");
421 if (pTokens) {
422 for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
423 argument=((TObjString*)pTokens->At(i))->GetString();
424 if (argument.IsNull()) continue;
425
3f0fd8f1 426 if (argument.CompareTo("-sum-noise-histograms")==0) {
427 fNoiseHistograms = kTRUE;
428 HLTInfo("got \'-sum-noise-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
429
430 } else if (argument.CompareTo("-sum-krypton-histograms")==0) {
431 fKryptonHistograms = kTRUE;
432 HLTInfo("got \'-sum-krypton-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
433
434 } else if (argument.CompareTo("-use-general")==0) {
435 fUseGeneral = kTRUE;
436 HLTInfo("got \'-use-general\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
437
438 } else if (argument.CompareTo("-ignore-specification")==0) {
439 fIgnoreSpecification = kTRUE;
440 HLTInfo("got \'-ignore-specification\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
441 }
442 else {
443 HLTError("unknown argument %s", argument.Data());
444 iResult=-EINVAL;
445 break;
446 }
447 } // end for
448
449 /*for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
450 argument=((TObjString*)pTokens->At(i))->GetString();
451 if (argument.IsNull()) continue;
452
cdfe3c01 453 if (argument.CompareTo("-sum-noise-histograms")==0) {
454 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
455 HLTInfo("got \'-sum-noise-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
456
457 } else if (argument.CompareTo("-sum-krypton-histograms")==0) {
458 if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
459 HLTInfo("got \'-sum-krypton-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
460
3f0fd8f1 461 } else if (argument.CompareTo("-use-general")==0) {
462 fUseGeneral = kTRUE;
463 HLTInfo("got \'-use-general\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
464
465 } else if (argument.CompareTo("-ignore-specification")==0) {
466 fIgnoreSpecification = kTRUE;
467 HLTInfo("got \'-ignore-specification\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
468 }
cdfe3c01 469 else {
470 HLTError("unknown argument %s", argument.Data());
471 iResult=-EINVAL;
472 break;
473 }
3f0fd8f1 474 } // end for*/
cdfe3c01 475
476 delete pTokens;
477
478 } // end if pTokens
479
480 if (bMissingParam) {
481 HLTError("missing parameter for argument %s", argument.Data());
482 iResult=-EINVAL;
483 }
484 return iResult;
485}
486
487int AliHLTTPCHistogramHandlerComponent::Reconfigure(const char* cdbEntry, const char* chainId) {
3789100d 488 // see header file for class documentation
cdfe3c01 489
490 int iResult=0;
491 const char* path="HLT/ConfigTPC/TPCHistogramHandlerComponent";
492 const char* defaultNotify="";
493 if (cdbEntry) {
3789100d 494 path=cdbEntry;
495 defaultNotify=" (default)";
cdfe3c01 496 }
497
498 if (path) {
499 HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
500 AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
501 if (pEntry) {
502 TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
503 if (pString) {
504 HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
505 iResult=Configure(pString->GetString().Data());
506 } else {
507 HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
508 }
509 } else {
510 HLTError("cannot fetch object \"%s\" from CDB", path);
511 }
512 }
513 return iResult;
514}