Line data Source code
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 "AliHLTTPCGeometry.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 6 : ClassImp(AliHLTTPCHistogramHandlerComponent) //ROOT macro for the implementation of ROOT specific class methods
45 :
46 3 : AliHLTTPCHistogramHandlerComponent::AliHLTTPCHistogramHandlerComponent()
47 : :
48 3 : fSpecification(0),
49 3 : fNoiseHistograms(0),
50 3 : fKryptonHistograms(0),
51 3 : fUseGeneral(kFALSE),
52 3 : fIgnoreSpecification(kFALSE),
53 3 : fSlice(-99),
54 :
55 3 : fHistTH1Tmp(NULL),
56 3 : fTotalClusterChargeIROCAll(NULL),
57 3 : fTotalClusterChargeOROCAll(NULL),
58 3 : fQMaxPartitionAll(NULL),
59 3 : fPlotQmaxROCAll(NULL),
60 3 : fNumberOfClusters(NULL),
61 :
62 3 : fHistTH2Tmp(NULL),
63 3 : fHistTPCSideAmax(NULL),
64 3 : fHistTPCSideCmax(NULL),
65 3 : fHistTPCSideAtot(NULL),
66 3 : fHistTPCSideCtot(NULL),
67 3 : fHistTPCSideArms(NULL),
68 3 : fHistTPCSideCrms(NULL),
69 :
70 3 : fHistogramData()
71 15 : {
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 6 : }
78 :
79 18 : AliHLTTPCHistogramHandlerComponent::~AliHLTTPCHistogramHandlerComponent() {
80 : // see header file for class documentation
81 :
82 9 : }
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 468 : return "TPCHistogramHandler";
91 : }
92 :
93 : void AliHLTTPCHistogramHandlerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
94 : // see header file for class documentation
95 :
96 0 : list.clear();
97 0 : list.push_back( kAliHLTDataTypeHistogram );
98 0 : }
99 :
100 : AliHLTComponentDataType AliHLTTPCHistogramHandlerComponent::GetOutputDataType() {
101 : // see header file for class documentation
102 :
103 0 : return kAliHLTDataTypeHistogram;
104 : }
105 :
106 : int AliHLTTPCHistogramHandlerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) {
107 : // see header file for class documentation
108 :
109 0 : tgtList.clear();
110 0 : tgtList.push_back(kAliHLTDataTypeHistogram);
111 0 : return tgtList.size();
112 : }
113 :
114 : void AliHLTTPCHistogramHandlerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
115 : // see header file for class documentation
116 :
117 0 : constBase=0;
118 0 : inputMultiplier=2.0;
119 0 : }
120 :
121 : AliHLTComponent* AliHLTTPCHistogramHandlerComponent::Spawn() {
122 : // see header file for class documentation
123 :
124 0 : return new AliHLTTPCHistogramHandlerComponent();
125 0 : }
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 0 : TString configuration="";
136 0 : TString argument="";
137 0 : for (int j=0; j<argc && iResult>=0; j++) {
138 :
139 0 : argument=argv[j];
140 0 : if (!configuration.IsNull()) configuration+=" ";
141 0 : configuration+=argument;
142 : }
143 :
144 0 : if (!configuration.IsNull()) {
145 0 : iResult=Configure(configuration.Data());
146 0 : } else {
147 0 : iResult=Reconfigure(NULL, NULL);
148 : }
149 :
150 0 : if(fUseGeneral == kFALSE){
151 0 : fHistTPCSideAmax = new TH2F("fHistTPCSideAmax","TPC side A (max signal)",250,-250,250,250,-250,250);
152 0 : fHistTPCSideAmax->SetXTitle("global X (cm)"); fHistTPCSideAmax->SetYTitle("global Y (cm)");
153 0 : fHistTPCSideCmax = new TH2F("fHistTPCSideCmax","TPC side C (max signal)",250,-250,250,250,-250,250);
154 0 : fHistTPCSideCmax->SetXTitle("global X (cm)"); fHistTPCSideCmax->SetYTitle("global Y (cm)");
155 :
156 0 : fHistTPCSideAtot = new TH2F("fHistTPCSideAtot","TPC side A (total signal)",250,-250,250,250,-250,250);
157 0 : fHistTPCSideAtot->SetXTitle("global X (cm)"); fHistTPCSideAtot->SetYTitle("global Y (cm)");
158 0 : fHistTPCSideCtot = new TH2F("fHistTPCSideCtot","TPC side C (total signal)",250,-250,250,250,-250,250);
159 0 : fHistTPCSideCtot->SetXTitle("global X (cm)"); fHistTPCSideCtot->SetYTitle("global Y (cm)");
160 :
161 0 : fHistTPCSideArms = new TH2F("fHistTPCSideArms","TPC side A (baseline RMS)",250,-250,250,250,-250,250);
162 0 : fHistTPCSideArms->SetXTitle("global X (cm)"); fHistTPCSideArms->SetYTitle("global Y (cm)");
163 0 : fHistTPCSideCrms = new TH2F("fHistTPCSideCrms","TPC side C (baseline RMS)",250,-250,250,250,-250,250);
164 0 : fHistTPCSideCrms->SetXTitle("global X (cm)"); fHistTPCSideCrms->SetYTitle("global Y (cm)");
165 : }
166 : return 0;
167 0 : } // end DoInit()
168 :
169 : int AliHLTTPCHistogramHandlerComponent::DoDeinit() {
170 : // see header file for class documentation
171 :
172 0 : if(fHistTPCSideAmax){ delete fHistTPCSideAmax; fHistTPCSideAmax=NULL; }
173 0 : if(fHistTPCSideCmax){ delete fHistTPCSideCmax; fHistTPCSideCmax=NULL; }
174 :
175 0 : if(fHistTPCSideAtot){ delete fHistTPCSideAtot; fHistTPCSideAtot=NULL; }
176 0 : if(fHistTPCSideCtot){ delete fHistTPCSideCtot; fHistTPCSideCtot=NULL; }
177 :
178 0 : if(fHistTPCSideArms){ delete fHistTPCSideArms; fHistTPCSideArms=NULL; }
179 0 : if(fHistTPCSideCrms){ delete fHistTPCSideCrms; fHistTPCSideCrms=NULL; }
180 :
181 0 : 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 0 : if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0;
190 :
191 0 : if(fUseGeneral == kFALSE){
192 0 : fTotalClusterChargeIROCAll = new TH1F("fTotalClusterChargeIROCAll","Total Charge of clusters in all IROC",4000,0,4000);
193 0 : fTotalClusterChargeOROCAll = new TH1F("fTotalClusterChargeOROCAll","Total Charge of clusters in all OROC",4000,0,4000);
194 0 : fQMaxPartitionAll = new TH1F("fQMaxPartitionAll", "QMax for All Partitions", 216,0,216);
195 0 : fPlotQmaxROCAll = new TH1F("fQMaxROCAll", "QMax for All ROC", 72,0,72);
196 0 : fNumberOfClusters = new TH1F("fNumberOfClusters", "Total Number of Clusters", 1,0,1);
197 0 : }
198 :
199 : const TObject *iter = NULL;
200 0 : 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 0 : if (GetDataType(iter) != (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC)) continue;
214 :
215 : // Summing the output histograms of the AliHLTTPCNoiseMapComponent (from partition to TPC sides)
216 :
217 0 : if(fUseGeneral == kFALSE){
218 0 : if(fNoiseHistograms == kTRUE){
219 :
220 0 : fHistTH2Tmp = (TH2F*)iter;
221 0 : TString histName = fHistTH2Tmp->GetName();
222 :
223 0 : UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
224 0 : UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(GetSpecification(iter));
225 0 : UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
226 0 : UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(GetSpecification(iter));
227 :
228 0 : if((minSlice!=maxSlice) || (minPartition!=maxPartition)){
229 0 : 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 0 : if (histName.Contains("fHistSideAMaxSignal")) fHistTPCSideAmax->Add(fHistTH2Tmp,1);
235 0 : else if(histName.Contains("fHistSideATotSignal")) fHistTPCSideAtot->Add(fHistTH2Tmp,1);
236 0 : else if(histName.Contains("fHistSideAPadRMS")) fHistTPCSideArms->Add(fHistTH2Tmp,1);
237 0 : else if(histName.Contains("fHistSideCMaxSignal")) fHistTPCSideCmax->Add(fHistTH2Tmp,1);
238 0 : else if(histName.Contains("fHistSideCTotSignal")) fHistTPCSideCtot->Add(fHistTH2Tmp,1);
239 0 : else if(histName.Contains("fHistSideCPadRMS")) fHistTPCSideCrms->Add(fHistTH2Tmp,1);
240 0 : else continue;
241 :
242 0 : } // endif fNoiseHistograms==kTRUE
243 :
244 : // Summing the output of AliHLTTPCClusterHistoComponent
245 0 : if(fKryptonHistograms){
246 0 : Int_t thisrow=-1,thissector=-1,row=-1;
247 :
248 0 : AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
249 0 : AliHLTUInt8_t patch = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
250 0 : row = AliHLTTPCGeometry::GetFirstRow(patch);
251 0 : AliHLTTPCGeometry::Slice2Sector(slice,row,thissector,thisrow);
252 :
253 0 : fHistTH1Tmp = (TH1F*)iter;
254 0 : TString name = fHistTH1Tmp->GetName();
255 :
256 0 : if(name=="fTotalClusterChargeIROCAll"){
257 0 : fTotalClusterChargeIROCAll->Add(fTotalClusterChargeIROCAll,fHistTH1Tmp,1,1);
258 : }
259 0 : else if(name=="fTotalClusterChargeOROCAll"){
260 0 : fTotalClusterChargeOROCAll->Add(fTotalClusterChargeOROCAll,fHistTH1Tmp,1,1);
261 : }
262 0 : else if(name=="fQMaxPartitionAll"){
263 0 : for(Int_t t=0;t<216;t++){
264 0 : if(fHistTH1Tmp->GetBinContent(t)>fQMaxPartitionAll->GetBinContent(t)){
265 0 : fQMaxPartitionAll->SetBinContent(t,fHistTH1Tmp->GetBinContent(t));
266 : }
267 : }
268 0 : }
269 0 : else if(name=="fQMaxROCAll"){
270 0 : for(Int_t t=0;t<72;t++){
271 0 : if(fHistTH1Tmp->GetBinContent(t)>fPlotQmaxROCAll->GetBinContent(t)){
272 0 : fPlotQmaxROCAll->SetBinContent(t,fHistTH1Tmp->GetBinContent(t));
273 : }
274 : }
275 0 : }
276 0 : else if(name=="fNumberOfClusters"){
277 0 : fNumberOfClusters->Add(fNumberOfClusters,fHistTH1Tmp,1,1);
278 : }
279 : else{
280 0 : HLTWarning("No histogram names match. %s",name.Data());
281 0 : continue;
282 : }
283 0 : } //endif fKryptonHistograms==kTRUE
284 : }
285 :
286 : else { // means fUseGeneral ==kTRUE
287 :
288 0 : TH1 * tmp = (TH1*)iter;
289 0 : TString histName = tmp->GetName();
290 0 : UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
291 0 : UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(GetSpecification(iter));
292 0 : UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
293 0 : UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(GetSpecification(iter));
294 :
295 : Bool_t histogramNotAdded = kTRUE;
296 :
297 0 : for(UInt_t i=0;i<fHistogramData.size();i++){
298 0 : 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 0 : histName.ReplaceAll(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition),"");
306 : }
307 :
308 0 : if(histName.CompareTo(fHistogramData.at(i).fHistogram->GetName())==0){
309 0 : if((minSlice==fHistogramData.at(i).fMinSlice && maxSlice == fHistogramData.at(i).fMaxSlice) || fIgnoreSpecification == kTRUE){
310 0 : if((minPartition==fHistogramData.at(i).fMinPartition && maxPartition == fHistogramData.at(i).fMaxPartition) || fIgnoreSpecification == kTRUE){
311 0 : fHistogramData.at(i).fHistogram->Add(tmp);
312 : histogramNotAdded = kFALSE;
313 0 : break;
314 : }
315 : else{
316 0 : HLTWarning("Histogram with same name does not have the same partition specification");
317 : }
318 : }
319 : else{
320 0 : HLTWarning("Histogram with same name does not have the same slice specification");
321 : }
322 : }
323 : }
324 :
325 0 : if(fHistogramData.size()==0){
326 0 : if(fIgnoreSpecification == kTRUE){
327 0 : if(histName.Contains(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition))){
328 0 : cout << "HistogramContains the given string." << endl;
329 : }
330 0 : histName.ReplaceAll(Form("_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition),"");
331 : }
332 : }
333 :
334 0 : if(histogramNotAdded == kTRUE){
335 0 : tmp->SetName(histName);
336 0 : AliHLTHistogramData histogramData;
337 0 : histogramData.fHistogram = tmp;
338 0 : histogramData.fMinSlice = minSlice;
339 0 : histogramData.fMaxSlice = maxSlice;
340 0 : histogramData.fMinPartition = minPartition;
341 0 : histogramData.fMaxPartition = maxPartition;
342 0 : fHistogramData.push_back(histogramData);
343 0 : }
344 0 : }
345 : } // end for loop over histogram blocks
346 :
347 0 : MakeHistosPublic();
348 : return 0;
349 0 : } // end DoEvent()
350 :
351 : void AliHLTTPCHistogramHandlerComponent::MakeHistosPublic() {
352 : // see header file for class documentation
353 :
354 0 : if(fUseGeneral == kFALSE){
355 0 : if(fNoiseHistograms){
356 0 : PushBack((TObject*)fHistTPCSideAmax,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
357 0 : PushBack((TObject*)fHistTPCSideCmax,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(18,35,0,5));
358 :
359 0 : PushBack((TObject*)fHistTPCSideAtot,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
360 0 : PushBack((TObject*)fHistTPCSideCtot,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(18,35,0,5));
361 :
362 0 : PushBack((TObject*)fHistTPCSideArms,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification( 0,17,0,5));
363 0 : 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 0 : }
369 :
370 0 : if(fKryptonHistograms){
371 0 : PushBack((TObject*)fTotalClusterChargeIROCAll,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,17,0,1));
372 0 : PushBack((TObject*)fTotalClusterChargeOROCAll,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,17,2,5));
373 0 : PushBack((TObject*)fQMaxPartitionAll, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
374 0 : PushBack((TObject*)fPlotQmaxROCAll, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
375 0 : PushBack((TObject*)fNumberOfClusters, kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(0,35,0,5));
376 :
377 0 : if(fTotalClusterChargeIROCAll){ delete fTotalClusterChargeIROCAll; fTotalClusterChargeIROCAll=NULL; }
378 0 : if(fTotalClusterChargeOROCAll){ delete fTotalClusterChargeOROCAll; fTotalClusterChargeOROCAll=NULL; }
379 0 : if(fQMaxPartitionAll) { delete fQMaxPartitionAll; fQMaxPartitionAll=NULL; }
380 0 : if(fPlotQmaxROCAll) { delete fPlotQmaxROCAll; fPlotQmaxROCAll=NULL; }
381 0 : if(fNumberOfClusters) { delete fNumberOfClusters; fNumberOfClusters=NULL; }
382 0 : if(fHistTH1Tmp) { delete fHistTH1Tmp; fHistTH1Tmp=NULL; }
383 : }
384 : }
385 : else{ // means fUseGeneral == kTRUE
386 0 : for(UInt_t i=0;i<fHistogramData.size();i++){
387 0 : PushBack((TObject*)fHistogramData.at(i).fHistogram,kAliHLTDataTypeHistogram,AliHLTTPCDefinitions::EncodeDataSpecification(
388 0 : fHistogramData.at(i).fMinSlice,fHistogramData.at(i).fMaxSlice,fHistogramData.at(i).fMinPartition,fHistogramData.at(i).fMaxPartition));
389 : }
390 0 : 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 0 : }
407 :
408 : int AliHLTTPCHistogramHandlerComponent::Configure(const char* arguments) {
409 : // see header file for class documentation
410 :
411 : int iResult=0;
412 0 : if (!arguments) return iResult;
413 0 : HLTInfo("parsing configuration string \'%s\'", arguments);
414 :
415 0 : TString allArgs=arguments;
416 0 : TString argument;
417 : int bMissingParam=0;
418 :
419 0 : TObjArray* pTokens=allArgs.Tokenize(" ");
420 0 : if (pTokens) {
421 0 : for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
422 0 : argument=((TObjString*)pTokens->At(i))->GetString();
423 0 : if (argument.IsNull()) continue;
424 :
425 0 : if (argument.CompareTo("-sum-noise-histograms")==0) {
426 0 : fNoiseHistograms = kTRUE;
427 0 : HLTInfo("got \'-sum-noise-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
428 :
429 0 : } else if (argument.CompareTo("-sum-krypton-histograms")==0) {
430 0 : fKryptonHistograms = kTRUE;
431 0 : HLTInfo("got \'-sum-krypton-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
432 :
433 0 : } else if (argument.CompareTo("-use-general")==0) {
434 0 : fUseGeneral = kTRUE;
435 0 : HLTInfo("got \'-use-general\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
436 :
437 0 : } else if (argument.CompareTo("-ignore-specification")==0) {
438 0 : fIgnoreSpecification = kTRUE;
439 0 : HLTInfo("got \'-ignore-specification\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
440 : }
441 : else {
442 0 : HLTError("unknown argument %s", argument.Data());
443 : iResult=-EINVAL;
444 0 : 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 0 : delete pTokens;
476 :
477 : } // end if pTokens
478 :
479 0 : if (bMissingParam) {
480 0 : HLTError("missing parameter for argument %s", argument.Data());
481 : iResult=-EINVAL;
482 0 : }
483 : return iResult;
484 0 : }
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 0 : if (cdbEntry) {
493 : path=cdbEntry;
494 : defaultNotify=" (default)";
495 0 : }
496 :
497 0 : if (path) {
498 0 : HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
499 0 : AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
500 0 : if (pEntry) {
501 0 : TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
502 0 : if (pString) {
503 0 : HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
504 0 : iResult=Configure(pString->GetString().Data());
505 0 : } else {
506 0 : HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
507 : }
508 0 : } else {
509 0 : HLTError("cannot fetch object \"%s\" from CDB", path);
510 : }
511 0 : }
512 0 : return iResult;
513 0 : }
|