]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.cxx
Updated SNM Glauber fit
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCHistogramHandlerComponent.cxx
1 // $Id$
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 #include "AliHLTTPCHistogramHandlerComponent.h"
25 #include "AliHLTTPCDefinitions.h"
26 #include "AliCDBEntry.h"
27 #include "AliCDBManager.h"
28 #include "AliHLTTPCTransform.h"
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
42 using namespace std;
43
44 ClassImp(AliHLTTPCHistogramHandlerComponent) //ROOT macro for the implementation of ROOT specific class methods
45
46   AliHLTTPCHistogramHandlerComponent::AliHLTTPCHistogramHandlerComponent()
47     :    
48     fSpecification(0),
49     fNoiseHistograms(0),
50     fKryptonHistograms(0),
51     fUseGeneral(kFALSE),
52     fIgnoreSpecification(kFALSE),
53     fSlice(-99),
54     
55     fHistTH1Tmp(NULL),
56     fTotalClusterChargeIROCAll(NULL),
57     fTotalClusterChargeOROCAll(NULL),
58     fQMaxPartitionAll(NULL),
59     fPlotQmaxROCAll(NULL),
60     fNumberOfClusters(NULL),
61     
62     fHistTH2Tmp(NULL),
63     fHistTPCSideAmax(NULL),  
64     fHistTPCSideCmax(NULL),   
65     fHistTPCSideAtot(NULL),  
66     fHistTPCSideCtot(NULL),   
67     fHistTPCSideArms(NULL),  
68     fHistTPCSideCrms(NULL),
69
70     fHistogramData()
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
79 AliHLTTPCHistogramHandlerComponent::~AliHLTTPCHistogramHandlerComponent() { 
80   // see header file for class documentation
81
82 }
83
84 // Public functions to implement AliHLTComponent's interface.
85 // These functions are required for the registration process
86
87 const char* AliHLTTPCHistogramHandlerComponent::GetComponentID() { 
88   // see header file for class documentation
89
90   return "TPCHistogramHandler";
91 }
92
93 void AliHLTTPCHistogramHandlerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) { 
94   // see header file for class documentation
95
96   list.clear(); 
97   list.push_back( kAliHLTDataTypeHistogram );
98 }
99
100 AliHLTComponentDataType AliHLTTPCHistogramHandlerComponent::GetOutputDataType() { 
101   // see header file for class documentation
102
103   return kAliHLTDataTypeHistogram;
104 }
105
106 int AliHLTTPCHistogramHandlerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) { 
107   // see header file for class documentation
108
109   tgtList.clear();
110   tgtList.push_back(kAliHLTDataTypeHistogram);
111   return tgtList.size();
112 }
113
114 void AliHLTTPCHistogramHandlerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) { 
115   // see header file for class documentation
116
117   constBase=0;
118   inputMultiplier=2.0;
119 }
120
121 AliHLTComponent* AliHLTTPCHistogramHandlerComponent::Spawn() { 
122   // see header file for class documentation
123
124   return new AliHLTTPCHistogramHandlerComponent();
125 }
126         
127 int AliHLTTPCHistogramHandlerComponent::DoInit( int argc, const char** argv ) { 
128   // see header file for class documentation
129
130   //Int_t i = 0;
131   //Char_t* cpErr;
132   
133   int iResult=0;
134   
135   TString configuration="";
136   TString argument="";
137   for (int j=0; j<argc && iResult>=0; j++) {
138     
139     argument=argv[j];
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
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   }
166   return 0;
167 } // end DoInit()
168
169 int AliHLTTPCHistogramHandlerComponent::DoDeinit() { 
170   // see header file for class documentation 
171     
172   if(fHistTPCSideAmax){ delete fHistTPCSideAmax; fHistTPCSideAmax=NULL; }
173   if(fHistTPCSideCmax){ delete fHistTPCSideCmax; fHistTPCSideCmax=NULL; }
174    
175   if(fHistTPCSideAtot){ delete fHistTPCSideAtot; fHistTPCSideAtot=NULL; }
176   if(fHistTPCSideCtot){ delete fHistTPCSideCtot; fHistTPCSideCtot=NULL; }
177    
178   if(fHistTPCSideArms){ delete fHistTPCSideArms; fHistTPCSideArms=NULL; }
179   if(fHistTPCSideCrms){ delete fHistTPCSideCrms; fHistTPCSideCrms=NULL; }
180
181   return 0;
182 }
183
184 int AliHLTTPCHistogramHandlerComponent::DoEvent(const AliHLTComponentEventData&/* evtData*/, AliHLTComponentTriggerData& /*trigData*/){
185   // see header file for class documentation
186
187   //HLTInfo("--- Entering DoEvent() in TPCHistogramHandler ---");
188   
189   if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0;
190  
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);
197   }    
198
199   const TObject *iter = NULL;        
200   for(iter = GetFirstInputObject(kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputObject()){
201   
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());
206    
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     //      }      
212      
213     if (GetDataType(iter) != (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC)) continue;
214          
215     // Summing the output histograms of the AliHLTTPCNoiseMapComponent (from partition to TPC sides)
216
217     if(fUseGeneral == kFALSE){
218       if(fNoiseHistograms == kTRUE){  
219         
220         fHistTH2Tmp = (TH2F*)iter;
221         TString histName = fHistTH2Tmp->GetName();
222         
223         UInt_t minSlice     = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter)); 
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)
233         
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         
242       } // endif fNoiseHistograms==kTRUE   
243             
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         
253         fHistTH1Tmp = (TH1F*)iter;              
254         TString name = fHistTH1Tmp->GetName();
255         
256         if(name=="fTotalClusterChargeIROCAll"){
257           fTotalClusterChargeIROCAll->Add(fTotalClusterChargeIROCAll,fHistTH1Tmp,1,1);
258         } 
259         else if(name=="fTotalClusterChargeOROCAll"){
260           fTotalClusterChargeOROCAll->Add(fTotalClusterChargeOROCAll,fHistTH1Tmp,1,1);
261         } 
262         else if(name=="fQMaxPartitionAll"){
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           }
275         } 
276         else if(name=="fNumberOfClusters"){ 
277           fNumberOfClusters->Add(fNumberOfClusters,fHistTH1Tmp,1,1);
278         } 
279         else{
280           HLTWarning("No histogram names match. %s",name.Data());
281           continue;
282         }     
283       } //endif fKryptonHistograms==kTRUE
284     }
285     
286     else { // means fUseGeneral ==kTRUE
287
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++){
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         
308         if(histName.CompareTo(fHistogramData.at(i).fHistogram->GetName())==0){
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){
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       }
324       
325       if(fHistogramData.size()==0){       
326         if(fIgnoreSpecification == kTRUE){
327            if(histName.Contains(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition))){
328               cout << "HistogramContains the given string." << endl;
329            } 
330            histName.ReplaceAll(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition),"");    
331         }
332       }
333
334       if(histogramNotAdded == kTRUE){
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);
343       }
344     }    
345   } // end for loop over histogram blocks
346   
347   MakeHistosPublic();
348   return 0;
349 } // end DoEvent()
350   
351 void AliHLTTPCHistogramHandlerComponent::MakeHistosPublic() {
352   // see header file for class documentation
353
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     }  
369     
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     }
384   }
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( 
388                                                                                                                                 fHistogramData.at(i).fMinSlice,fHistogramData.at(i).fMaxSlice,fHistogramData.at(i).fMinPartition,fHistogramData.at(i).fMaxPartition));
389     }
390     fHistogramData.clear();
391   }
392   //  TObjArray histos;
393    
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);    
406 }
407
408 int AliHLTTPCHistogramHandlerComponent::Configure(const char* arguments) { 
409   // see header file for class documentation
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      
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      
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         
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       }
468       else {
469         HLTError("unknown argument %s", argument.Data());
470         iResult=-EINVAL;
471         break;
472       }
473     } // end for*/
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
486 int AliHLTTPCHistogramHandlerComponent::Reconfigure(const char* cdbEntry, const char* chainId) { 
487   // see header file for class documentation
488
489   int iResult=0;
490   const char* path="HLT/ConfigTPC/TPCHistogramHandlerComponent";
491   const char* defaultNotify="";
492   if (cdbEntry) {
493     path=cdbEntry;
494     defaultNotify=" (default)";
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 }