]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TRD/AliHLTTRDClusterizerComponent.cxx
cleanup of HLTTRDCalibration component, fixing bug in calibration: dQdl (Theodor)
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDClusterizerComponent.cxx
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:                                                       *
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 //**************************************************************************
18
19 /** @file   AliHLTTRDClusterizerComponent.cxx
20     @author 
21     @date   
22     @brief  A TRDClusterizer processing component for the HLT. 
23 */
24
25 // see header file for class documentation                                   //
26 // or                                                                        //
27 // refer to README to build package                                          //
28 // or                                                                        //
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt                          //
30
31 #if __GNUC__ >= 3
32 using namespace std;
33 #endif
34
35 #include "TTree.h"
36 #include "TFile.h"
37 #include "TBranch.h"
38
39 #include "AliHLTTRDClusterizerComponent.h"
40 #include "AliHLTTRDDefinitions.h"
41 #include "AliHLTTRDCluster.h"
42
43 #include "AliGeomManager.h"
44 #include "AliTRDReconstructor.h"
45 #include "AliCDBManager.h"
46 #include "AliCDBStorage.h"
47 #include "AliCDBEntry.h"
48 #include "AliHLTTRDClusterizer.h"
49 #include "AliTRDrecoParam.h"
50 #include "AliTRDrawStreamBase.h"
51 #include "AliTRDcluster.h"
52
53 #include "AliRawReaderMemory.h"
54
55 #ifdef HAVE_VALGRIND_CALLGRIND_H
56 #include <valgrind/callgrind.h>
57 #else
58 #define CALLGRIND_START_INSTRUMENTATION do { } while (0)
59 #define CALLGRIND_STOP_INSTRUMENTATION do { } while (0)
60 #endif
61
62 #include <cstdlib>
63 #include <cerrno>
64 #include <string>
65
66 #include "AliTRDrawStream.h"
67 #include "AliTRDrawFastStream.h"
68
69 ClassImp(AliHLTTRDClusterizerComponent)
70    
71 AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent()
72 : AliHLTProcessor(),
73   fOutputPercentage(500),
74   fOutputConst(0),
75   fClusterizer(NULL),
76   fRecoParam(NULL),
77   fMemReader(NULL),
78   fReconstructor(NULL),
79   fRecoParamType(-1),
80   fRecoDataType(-1),
81   fRawDataVersion(2),
82   fyPosMethod(1),
83   fgeometryFileName(""),
84   fProcessTracklets(kFALSE),
85   fHLTstreamer(kTRUE),
86   fTC(kFALSE),
87   fOffline(kFALSE)
88 {
89   // Default constructor
90
91 }
92
93 AliHLTTRDClusterizerComponent::~AliHLTTRDClusterizerComponent()
94 {
95   // Destructor
96   // Work is Done in DoDeInit()
97 }
98
99
100 const char* AliHLTTRDClusterizerComponent::GetComponentID()
101 {
102   // Return the component ID const char *
103   return "TRDClusterizer"; // The ID of this component
104 }
105
106 void AliHLTTRDClusterizerComponent::GetInputDataTypes( vector<AliHLTComponent_DataType>& list)
107 {
108   // Get the list of input data
109   list.clear(); // We do not have any requirements for our input data type(s).
110   list.push_back(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD);
111 }
112
113 AliHLTComponentDataType AliHLTTRDClusterizerComponent::GetOutputDataType()
114 {
115   // Get the output data type
116   return kAliHLTMultipleDataType;
117 }
118
119 int AliHLTTRDClusterizerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
120 {
121   // Get the output data type
122   tgtList.clear();
123   tgtList.push_back(AliHLTTRDDefinitions::fgkClusterDataType);
124   tgtList.push_back(AliHLTTRDDefinitions::fgkMCMtrackletDataType);
125   return tgtList.size();
126 }
127
128
129 void AliHLTTRDClusterizerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
130 {
131   // Get the output data size
132   constBase = fOutputConst;
133   inputMultiplier = ((double)fOutputPercentage)/100.0;
134 }
135
136 AliHLTComponent* AliHLTTRDClusterizerComponent::Spawn()
137 {
138   // Spawn function, return new instance of this class
139   return new AliHLTTRDClusterizerComponent;
140 };
141
142 int AliHLTTRDClusterizerComponent::DoInit( int argc, const char** argv )
143 {
144   // perform initialization. We check whether our relative output size is specified in the arguments.
145   int iResult=0;
146   
147   fReconstructor = new AliTRDReconstructor();
148   HLTDebug("TRDReconstructor at 0x%x", fReconstructor);
149
150   TString configuration="";
151   TString argument="";
152   for (int i=0; i<argc && iResult>=0; i++) {
153     argument=argv[i];
154     if (!configuration.IsNull()) configuration+=" ";
155     configuration+=argument;
156   }
157
158   if (!configuration.IsNull()) {
159     iResult=Configure(configuration.Data());
160   } else {
161     iResult=Reconfigure(NULL, NULL);
162   }
163
164   if(!fClusterizer){
165     HLTFatal("Clusterizer was not initialized!");
166     return -1;
167   }
168
169   if(iResult<0) return iResult;
170
171   fMemReader = new AliRawReaderMemory;
172   fClusterizer->SetReconstructor(fReconstructor);
173   fClusterizer->SetUseLabels(kFALSE);
174
175   if(fReconstructor->IsProcessingTracklets())
176     fOutputConst = fClusterizer->GetTrMemBlockSize();
177
178   return iResult;
179 }
180
181 int AliHLTTRDClusterizerComponent::DoDeinit()
182 {
183   // Deinitialization of the component
184   delete fMemReader;
185   fMemReader = 0;
186   delete fClusterizer;
187   fClusterizer = 0;
188   
189   fReconstructor->SetClusters(0x0);
190   delete fReconstructor;
191   fReconstructor = 0x0;
192   return 0;
193
194   if (fRecoParam)
195     {
196       HLTDebug("Deleting fRecoParam");
197       delete fRecoParam;
198       fRecoParam = 0;
199     }
200 }
201
202 int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponentEventData& evtData, 
203                                             const AliHLTComponentBlockData* blocks, 
204                                             AliHLTComponent_TriggerData& /*trigData*/, 
205                                             AliHLTUInt8_t* outputPtr, 
206                                             AliHLTUInt32_t& size, 
207                                             vector<AliHLTComponent_BlockData>& outputBlocks )
208 {
209   // Process an event
210
211   if (evtData.fEventID == 1)
212     CALLGRIND_START_INSTRUMENTATION;
213
214   HLTDebug( "NofBlocks %i", evtData.fBlockCnt );
215   // Process an event
216   AliHLTUInt32_t totalSize = 0, offset = 0;
217
218   //implement a usage of the following
219   //   AliHLTUInt32_t triggerDataStructSize = trigData.fStructSize;
220   //   AliHLTUInt32_t triggerDataSize = trigData.fDataSize;
221   //   void *triggerData = trigData.fData;
222   //HLTDebug( "Trigger data received. Struct size %d Data size %d Data location 0x%x", trigData.fStructSize, trigData.fDataSize, (UInt_t*)trigData.fData);
223
224   // Loop over all input blocks in the event
225   AliHLTComponentDataType expectedDataType = (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD);
226   for ( UInt_t iBlock = 0; iBlock < evtData.fBlockCnt; iBlock++ )
227     {      
228       const AliHLTComponentBlockData &block = blocks[iBlock];
229       // lets not use the internal TRD data types here : AliHLTTRDDefinitions::fgkDDLRawDataType
230       // which is depreciated - we use HLT global defs instead
231       //      if ( block.fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD) )
232       AliHLTComponentDataType inputDataType = block.fDataType;
233       if ( inputDataType != expectedDataType)
234         {
235           HLTDebug( "Block # %i/%i; Event 0x%08LX (%Lu) Wrong received datatype: %s - required datatype: %s; Skipping",
236                     iBlock, evtData.fBlockCnt,
237                     evtData.fEventID, evtData.fEventID, 
238                     DataType2Text(inputDataType).c_str(), 
239                     DataType2Text(expectedDataType).c_str());
240           continue;
241         }
242       else 
243         {
244           HLTDebug("We get the right data type: Block # %i/%i; Event 0x%08LX (%Lu) Received datatype: %s; Block Size: %i",
245                    iBlock, evtData.fBlockCnt,
246                    evtData.fEventID, evtData.fEventID, 
247                    DataType2Text(inputDataType).c_str(),
248                    block.fSize);
249         }
250       
251 #ifndef NDEBUG
252       unsigned long constBase;
253       double inputMultiplier;
254       GetOutputDataSize(constBase,inputMultiplier);
255       if(size<(constBase+block.fSize*inputMultiplier)){
256         HLTWarning("Memory Block given might be too small: %i < %i; Event %Lu", size, constBase+block.fSize*inputMultiplier, evtData.fEventID);
257       }
258 #endif
259
260       // fMemReader->Reset();
261       fMemReader->SetMemory((UChar_t*) block.fPtr, block.fSize);
262
263       AliHLTUInt32_t spec = block.fSpecification;
264       
265       Int_t id = 1024;
266       
267       for ( Int_t ii = 0; ii < 18 ; ii++ ) {
268         if ( spec & 0x1 ) {
269           id += ii;
270           break;
271         }
272         spec = spec >> 1 ;
273       }
274
275       fMemReader->SetEquipmentID( id ); 
276       
277       fClusterizer->SetMemBlock(outputPtr+offset);
278       Bool_t bclustered = fClusterizer->Raw2ClustersChamber(fMemReader);
279       if(bclustered)
280         {
281           HLTDebug("Clustered successfully");
282         }
283       else
284         {
285           HLTError("Clustering ERROR");
286           return -1;
287         }
288
289       AliHLTUInt32_t addedSize;
290       if(fReconstructor->IsProcessingTracklets()){
291         addedSize = fClusterizer->GetAddedTrSize();
292         totalSize += fClusterizer->GetTrMemBlockSize();  //if IsProcessingTracklets() is enabled we always reserve a data block of size GetTrMemBlockSize() for the tracklets
293         if (addedSize > 0){
294           // Using low-level interface 
295           // with interface classes
296           if ( totalSize > size )
297             {
298               HLTError("Too much data; Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
299                        totalSize, size );
300               return EMSGSIZE;
301             }
302
303           // Fill block 
304           AliHLTComponentBlockData bd;
305           FillBlockData( bd );
306           bd.fOffset = offset;
307           bd.fSize = addedSize;
308           bd.fSpecification = block.fSpecification;
309           bd.fDataType = AliHLTTRDDefinitions::fgkMCMtrackletDataType;
310           outputBlocks.push_back( bd );
311           HLTDebug( "BD ptr 0x%x, offset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
312         }
313         offset = totalSize;
314       }
315
316       addedSize = fClusterizer->GetAddedClSize();
317       if (addedSize > 0){
318         
319         Int_t* nTimeBins = (Int_t*)(outputPtr+offset+fClusterizer->GetAddedClSize());
320         *nTimeBins = fClusterizer->GetNTimeBins();
321         addedSize += sizeof(*nTimeBins);
322
323         totalSize += addedSize;
324         if ( totalSize > size )
325           {
326             HLTError("Too much data; Data written over allowed buffer. Amount written: %lu, allowed amount: %lu.",
327                      totalSize, size );
328             return EMSGSIZE;
329           }
330
331         // Fill block 
332         AliHLTComponentBlockData bd;
333         FillBlockData( bd );
334         bd.fOffset = offset;
335         bd.fSize = addedSize;
336         bd.fSpecification = block.fSpecification;
337         bd.fDataType = AliHLTTRDDefinitions::fgkClusterDataType;
338         outputBlocks.push_back( bd );
339         HLTDebug( "BD ptr 0x%x, offset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
340         offset = totalSize;
341       }
342       else{
343         HLTDebug("Array of clusters is empty!");
344       }
345     }
346   fReconstructor->SetClusters(0x0);
347
348   size = totalSize;
349   HLTDebug("Event is done. size written to the output is %i", size);
350   return 0;
351 }
352
353 void AliHLTTRDClusterizerComponent::PrintObject( TClonesArray* inClustersArray)
354 {
355   AliTRDcluster* cluster=0x0;
356   
357   for (Int_t i=0; i < inClustersArray->GetEntriesFast(); i++){
358     cluster = dynamic_cast<AliTRDcluster*>(inClustersArray->At(i));
359     HLTDebug("cluster[%i]",i);
360     HLTDebug("  PadCol = %i; PadRow = %i; PadTime = %i", cluster->GetPadCol(), cluster->GetPadRow(), cluster->GetPadTime());
361     HLTDebug("  Detector = %i, Amplitude = %f, Center = %f", cluster->GetDetector(), cluster->GetQ(), cluster->GetCenter());
362     HLTDebug("  LocalTimeBin =  %i; NPads = %i; maskedPosition: %s, status: %s", cluster->GetLocalTimeBin(), cluster->GetNPads(),cluster->GetPadMaskedPosition(),cluster->GetPadMaskedPosition());
363   }
364   
365 }
366
367 int AliHLTTRDClusterizerComponent::Configure(const char* arguments){
368   int iResult=0;
369   if (!arguments) return iResult;
370   
371   TString allArgs=arguments;
372   TString argument;
373   int bMissingParam=0;
374
375   TObjArray* pTokens=allArgs.Tokenize(" ");
376   if (pTokens) {
377     for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
378       argument=((TObjString*)pTokens->At(i))->GetString();
379       if (argument.IsNull()) continue;
380       
381       if (argument.CompareTo("output_percentage")==0) {
382         if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
383         HLTInfo("Setting output percentage to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
384         fOutputPercentage=((TObjString*)pTokens->At(i))->GetString().Atoi();
385         continue;
386       } 
387       else if (argument.CompareTo("-geometry")==0) {
388         if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
389         HLTInfo("Setting geometry to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
390         fgeometryFileName=((TObjString*)pTokens->At(i))->GetString();
391         continue;
392       } 
393       else if (argument.CompareTo("-lowflux")==0) {
394         fRecoParamType = 0;
395         HLTInfo("Low flux reconstruction selected");
396         continue;
397       }
398       else if (argument.CompareTo("-highflux")==0) {
399         fRecoParamType = 1;
400         HLTInfo("High flux reconstruction selected");
401         continue;
402       }
403       else if (argument.CompareTo("-cosmics")==0) {
404         fRecoParamType = 2;
405         HLTInfo("Cosmics reconstruction selected");
406         continue;
407       }
408       else if (argument.CompareTo("-simulation")==0) {
409         fRecoDataType = 0;
410         HLTInfo("Awaiting simulated data");
411         continue;
412       }
413       else if (argument.CompareTo("-experiment")==0) {
414         fRecoDataType = 1;
415         HLTInfo("Awaiting real data");
416         continue;
417       }
418       else if (argument.CompareTo("-processTracklets")==0) {
419         fProcessTracklets = kTRUE;
420         HLTInfo("Writing L1 tracklets to output");
421         continue;
422       }
423       else if (argument.CompareTo("-noZS")==0) {
424         fOutputPercentage = 100;
425         HLTInfo("Awaiting non zero surpressed data");
426         continue;
427       }
428       else if (argument.CompareTo("-faststreamer")==0) {
429         fHLTstreamer = kTRUE;
430         HLTInfo("Useing fast raw streamer");
431         continue;
432       }
433       else if (argument.CompareTo("-nofaststreamer")==0) {
434         fHLTstreamer = kFALSE;
435         HLTInfo("Don't use fast raw streamer");
436         continue;
437       }
438       else if (argument.CompareTo("-tailcancellation")==0) {
439         fTC = kTRUE;
440         HLTInfo("Useing tailcancellation");
441         continue;
442       }
443       else if (argument.CompareTo("-rawver")==0) {
444         if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
445         HLTInfo("Raw data version is: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
446         fRawDataVersion=((TObjString*)pTokens->At(i))->GetString().Atoi();
447         continue;
448       } 
449       else if (argument.CompareTo("-yPosMethod")==0) {
450         if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
451         TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
452         if (toCompareTo.CompareTo("COG")==0){
453           HLTInfo("Setting yPosMethod method to: %s", toCompareTo.Data());
454           fyPosMethod=0;
455         }
456         else if (toCompareTo.CompareTo("LUT")==0){
457           HLTInfo("Setting yPosMethod method to: %s", toCompareTo.Data());
458           fyPosMethod=1;
459         }
460         else if (toCompareTo.CompareTo("Gauss")==0){
461           HLTInfo("Setting yPosMethod method to: %s", toCompareTo.Data());
462           fyPosMethod=2;
463         }
464         else {
465           HLTError("unknown argument for yPosMethod: %s", toCompareTo.Data());
466           iResult=-EINVAL;
467           break;
468         }
469         continue;
470       }
471       
472       else {
473         HLTError("unknown argument: %s", argument.Data());
474         iResult=-EINVAL;
475         break;
476       }
477     }
478     delete pTokens;
479   }
480   if (bMissingParam) {
481     HLTError("missing parameter for argument %s", argument.Data());
482     iResult=-EINVAL;
483   }
484   if(iResult>=0){
485     iResult=SetParams();
486   }
487   return iResult;
488 }
489
490 int AliHLTTRDClusterizerComponent::SetParams()
491 {
492   Int_t iResult=0;
493   if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
494     HLTError("DefaultStorage is not set in CDBManager");
495     return -EINVAL;
496   }
497   if(AliCDBManager::Instance()->GetRun()<0){
498     HLTError("Run Number is not set in CDBManager");
499     return -EINVAL;
500   }
501   HLTInfo("CDB default storage: %s; RunNo: %i", (AliCDBManager::Instance()->GetDefaultStorage()->GetBaseFolder()).Data(), AliCDBManager::Instance()->GetRun());
502
503   if(!AliGeomManager::GetGeometry()){
504     if(fgeometryFileName.CompareTo("")==0 || !TFile::Open(fgeometryFileName.Data())){
505       HLTInfo("Loading standard geometry file");
506       AliGeomManager::LoadGeometry();
507     }else{
508       HLTWarning("Loading NON-standard geometry file");
509       AliGeomManager::LoadGeometry(fgeometryFileName.Data());
510     }
511     if(!AliGeomManager::GetGeometry()){
512       HLTError("Could not load geometry");
513       return -EINVAL;
514     }
515     HLTInfo("Applying Alignment from CDB object");
516     AliGeomManager::ApplyAlignObjsFromCDB("TRD");
517   }
518   else{
519     HLTInfo("Geometry Already Loaded!");
520   }
521
522   if (fRecoParamType == 0)
523     {
524       HLTDebug("Low flux params init.");
525       fRecoParam = AliTRDrecoParam::GetLowFluxParam();
526     }
527
528   if (fRecoParamType == 1)
529     {
530       HLTDebug("High flux params init.");
531       fRecoParam = AliTRDrecoParam::GetHighFluxParam();
532     }
533   
534   if (fRecoParamType == 2)
535     {
536       HLTDebug("Cosmic Test params init.");
537       fRecoParam = AliTRDrecoParam::GetCosmicTestParam();
538     }
539
540   if (fRecoParam == 0)
541     {
542       HLTError("No reco params initialized. Sniffing big trouble!");
543       return -EINVAL;
544     }
545
546   // backward compatibility to AliTRDrecoParam < r34995
547 # ifndef HAVE_NOT_ALITRDRECOPARAM_r34995
548 #   define AliTRDRecoParamSetTailCancelation(b) fRecoParam->SetTailCancelation(b)
549 #   define AliTRDRecoParamSetGAUS(b) fRecoParam->SetGAUS(b)
550 #   define AliTRDRecoParamSetLUT(b) fRecoParam->SetLUT(b)
551 # else
552 #   define AliTRDRecoParamSetTailCancelation(b) fRecoParam->SetTailCancelation()
553 #   define AliTRDRecoParamSetGAUS(b) fRecoParam->SetGAUS()
554 #   define AliTRDRecoParamSetLUT(b) fRecoParam->SetLUT()
555 # endif
556
557   if(fTC){AliTRDRecoParamSetTailCancelation(kTRUE); HLTDebug("Enableing Tail Cancelation"); }
558   else{AliTRDRecoParamSetTailCancelation(kFALSE); HLTDebug("Enableing Tail Cancelation"); }
559
560   switch(fyPosMethod){
561   case 0: AliTRDRecoParamSetGAUS(kFALSE); AliTRDRecoParamSetLUT(kFALSE); break;
562   case 1: AliTRDRecoParamSetGAUS(kFALSE); AliTRDRecoParamSetLUT(kTRUE); break;
563   case 2: AliTRDRecoParamSetGAUS(kTRUE); AliTRDRecoParamSetLUT(kFALSE); break;
564   }
565
566   fRecoParam->SetStreamLevel(AliTRDrecoParam::kClusterizer, 0);
567   fReconstructor->SetRecoParam(fRecoParam);
568
569   TString recoOptions="hlt,!cw";
570   if(fProcessTracklets) recoOptions += ",tp";
571   else  recoOptions += ",!tp";
572
573   HLTDebug("Reconstructor options are: %s",recoOptions.Data());
574   fReconstructor->SetOption(recoOptions.Data());
575
576   if (fRecoDataType < 0 || fRecoDataType > 1)
577     {
578       HLTWarning("No data type selected. Use -simulation or -experiment flag. Defaulting to simulation.");
579       fRecoDataType = 0;
580     }
581
582   if (fRecoDataType == 0)
583     {
584       AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDsimStream);
585       HLTDebug("Data type expected is SIMULATION!");
586     }
587
588   if (fRecoDataType == 1)
589     {
590       AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDrealStream);
591       HLTDebug("Data type expected is EXPERIMENT!");
592     }
593
594   if (fHLTstreamer)
595     {
596       AliTRDrawStreamBase::SetRawStreamVersion("FAST");
597       HLTDebug("fast rawstreamer used");  
598     }
599
600   if(!fClusterizer){
601     fClusterizer = new AliHLTTRDClusterizer("TRDCclusterizer", "TRDCclusterizer");  
602     HLTDebug("TRDClusterizer at 0x%x", fClusterizer);
603   }
604
605   fClusterizer->SetRawVersion(fRawDataVersion);
606
607   return iResult;
608 }
609
610 int AliHLTTRDClusterizerComponent::Reconfigure(const char* cdbEntry, const char* chainId)
611 {
612   // see header file for class documentation
613
614   int iResult=0;
615   const char* path="HLT/ConfigTRD/ClusterizerComponent";
616   const char* defaultNotify="";
617   if (cdbEntry) {
618     path=cdbEntry;
619     defaultNotify=" (default)";
620   }
621   if (path) {
622     HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
623     AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
624     if (pEntry) {
625       TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
626       if (pString) {
627         HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
628         iResult=Configure(pString->GetString().Data());
629       } else {
630         HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
631       }
632     } else {
633       HLTError("cannot fetch object \"%s\" from CDB", path);
634     }
635   }
636
637   return iResult;
638 }