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