X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FTPCLib%2FAliHLTTPCNoiseMapComponent.cxx;h=a8481411d4ab91a96ebb96648bfc5333fbd1feb1;hb=3c788ec7075070e7dce76dde7319cb548a497615;hp=71becec32eb89fa65820725282dbf36aadaf7bd3;hpb=2fdb1ae7c13bca329b42393b7fbe784470554e34;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/TPCLib/AliHLTTPCNoiseMapComponent.cxx b/HLT/TPCLib/AliHLTTPCNoiseMapComponent.cxx index 71becec32eb..a8481411d4a 100644 --- a/HLT/TPCLib/AliHLTTPCNoiseMapComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCNoiseMapComponent.cxx @@ -28,12 +28,13 @@ using namespace std; #include "AliHLTTPCNoiseMapComponent.h" #include "AliHLTTPCDigitReaderDecoder.h" -#include "AliHLTTPCDigitReaderPacked.h" #include "AliHLTTPCTransform.h" #include "AliHLTTPCDefinitions.h" #include "AliCDBEntry.h" #include "AliCDBManager.h" +#include "AliCDBStorage.h" +#include "AliHLTTPCNoiseMap.h" #include "AliTPCCalPad.h" #include "AliTPCROC.h" @@ -47,30 +48,25 @@ using namespace std; #include "TObjString.h" #include #include "TH2.h" - - -AliHLTTPCNoiseMapComponent gAliHLTTPCNoiseMapComponent; +#include "TH3.h" ClassImp(AliHLTTPCNoiseMapComponent) //ROOT macro for the implementation of ROOT specific class methods AliHLTTPCNoiseMapComponent::AliHLTTPCNoiseMapComponent() : fSpecification(0), - noisePad(NULL), - //pDigitReader(0), - fPlotSideA(0), - fPlotSideC(0), - fApplyNoiseMap(0), + fReadNoiseMap(0), fResetHistograms(0), - fIsPacked(0), - fIsUnpacked(0), - fCurrentSlice(-99), - fCurrentPartition(-99), + fInitHist(kTRUE), fCurrentRow(-99), - fHistPartition(NULL), - fHistSideA(NULL), - fHistSideC(NULL), - fHistCDBMap(NULL) + fHistSignal(NULL), + fHistSideAMaxSignal(NULL), + fHistSideATotSignal(NULL), + fHistSideAPadRMS(NULL), + fHistSideCMaxSignal(NULL), + fHistSideCTotSignal(NULL), + fHistSideCPadRMS(NULL), + fHistCDBMap(NULL) { // see header file for class documentation // or @@ -130,8 +126,8 @@ AliHLTComponent* AliHLTTPCNoiseMapComponent::Spawn() { int AliHLTTPCNoiseMapComponent::DoInit( int argc, const char** argv ) { // see header file for class documentation - Int_t i = 0; - Char_t* cpErr; + //Int_t i = 0; + //Char_t* cpErr; int iResult=0; @@ -147,60 +143,51 @@ int AliHLTTPCNoiseMapComponent::DoInit( int argc, const char** argv ) { if (!configuration.IsNull()) { iResult=Configure(configuration.Data()); } else { - iResult=Reconfigure(NULL, NULL); + // iResult=Reconfigure(NULL, NULL); } - while ( i < argc ) { - if (!strcmp( argv[i], "-apply-noisemap")) { - fApplyNoiseMap = strtoul( argv[i+1], &cpErr ,0); - - if ( *cpErr ) { - HLTError("Cannot convert apply-noisemap specifier '%s'.", argv[i+1]); - return EINVAL; - } - i+=2; - continue; - } - - if (!strcmp( argv[i], "-plot-side-a")) { - fPlotSideA = strtoul( argv[i+1], &cpErr ,0); - - if ( *cpErr ) { - HLTError("Cannot convert plot-side-a specifier '%s'.", argv[i+1]); - return EINVAL; - } - i+=2; - continue; - } - - if (!strcmp( argv[i], "-plot-side-c")) { - fPlotSideC = strtoul( argv[i+1], &cpErr ,0); - - if ( *cpErr ) { - HLTError("Cannot convert plot-side-c specifier '%s'.", argv[i+1]); - return EINVAL; - } - i+=2; - continue; - } - - if (!strcmp( argv[i], "-reset-histograms")) { - fResetHistograms = strtoul( argv[i+1], &cpErr ,0); - - if ( *cpErr ) { - HLTError("Cannot convert reset-histograms specifier '%s'.", argv[i+1]); - return EINVAL; - } - i+=2; - continue; - } - - Logging(kHLTLogError, "HLT::TPCNoiseMap::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] ); - return EINVAL; - - } // end while +// while ( i < argc ) { +// if (!strcmp( argv[i], "-read-noisemap")) { +// fApplyNoiseMap = strtoul( argv[i+1], &cpErr ,0); +// +// if ( *cpErr ) { +// HLTError("Cannot convert apply-noisemap specifier '%s'.", argv[i+1]); +// return EINVAL; +// } +// i+=2; +// continue; +// } +// +// if (!strcmp( argv[i], "-reset-histograms")) { +// fResetHistograms = strtoul( argv[i+1], &cpErr ,0); +// +// if ( *cpErr ) { +// HLTError("Cannot convert reset-histograms specifier '%s'.", argv[i+1]); +// return EINVAL; +// } +// i+=2; +// continue; +// } +// +// Logging(kHLTLogError, "HLT::TPCNoiseMap::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] ); +// return EINVAL; +// +// } // end while + if(fReadNoiseMap){ + AliHLTTPCNoiseMap *nm = AliHLTTPCNoiseMap::Instance(); + if(!nm) { + HLTWarning("AliHLTTPCNoiseMap instance not existent."); + } + else { + AliTPCCalPad *noisePad = nm->ReadNoiseMap(GetRunNo()); + if(noisePad) { + fHistCDBMap = noisePad->MakeHisto2D(1); + + } + } + } // if(fApplyNoiseMap){ // //TFile *f = TFile::Open("/scratch/noiseComp/Run3398_4000_v0_s72.root"); @@ -210,7 +197,6 @@ int AliHLTTPCNoiseMapComponent::DoInit( int argc, const char** argv ) { // //fHistCDBMap = noisePad->MakeHisto2D(1); //side C // } - // HLTDebug("using AliHLTTPCDigitReaderDecoder"); // pDigitReader = new AliHLTTPCDigitReaderDecoder(); // double-loop // pDigitReader = new AliHLTTPCDigitReaderPacked(); @@ -220,151 +206,214 @@ int AliHLTTPCNoiseMapComponent::DoInit( int argc, const char** argv ) { } // end DoInit() int AliHLTTPCNoiseMapComponent::DoDeinit() { -// see header file for class documentation - - return 0; + // see header file for class documentation + + if(fHistSideAMaxSignal) delete fHistSideAMaxSignal; fHistSideAMaxSignal = NULL; + if(fHistSideATotSignal) delete fHistSideATotSignal; fHistSideATotSignal = NULL; + if(fHistSideAPadRMS) delete fHistSideAPadRMS; fHistSideAPadRMS = NULL; + + if(fHistSideCMaxSignal) delete fHistSideCMaxSignal; fHistSideCMaxSignal = NULL; + if(fHistSideCTotSignal) delete fHistSideCTotSignal; fHistSideCTotSignal = NULL; + if(fHistSideCPadRMS) delete fHistSideCPadRMS; fHistSideCPadRMS = NULL; + + return 0; } -int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& /*trigData*/){ -// see header file for class documentation +void AliHLTTPCNoiseMapComponent::InitializeHistograms(UInt_t minSlice, UInt_t maxSlice, UInt_t minPartition, UInt_t maxPartition){ + // see header file for class documentation + + Char_t name1[50], name2[50], name3[50]; + + if(minSlice<18){ + sprintf(name1, "fHistSideAMaxSignal_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + sprintf(name2, "fHistSideATotSignal_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + sprintf(name3, "fHistSideAPadRMS_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + fHistSideAMaxSignal = new TH2F(name1,name1,250,-250,250,250,-250,250); + fHistSideATotSignal = new TH2F(name2,name2,250,-250,250,250,-250,250); + fHistSideAPadRMS = new TH2F(name3,name3,250,-250,250,250,-250,250); + fHistSideAMaxSignal->SetXTitle("x [cm]"); + fHistSideATotSignal->SetXTitle("x [cm]"); + fHistSideAPadRMS->SetXTitle("x [cm]"); + fHistSideAMaxSignal->SetYTitle("y [cm]"); + fHistSideATotSignal->SetYTitle("y [cm]"); + fHistSideAPadRMS->SetYTitle("y [cm]"); + + } else { + sprintf(name1, "fHistSideCMaxSignal_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + sprintf(name2, "fHistSideCTotSignal_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + sprintf(name3, "fHistSideCPadRMS_Slice_%.2d%.2d_Partition_%.2d%.2d", minSlice, maxSlice, minPartition, maxPartition); + fHistSideCMaxSignal = new TH2F(name1,name1,250,-250,250,250,-250,250); + fHistSideCTotSignal = new TH2F(name2,name2,250,-250,250,250,-250,250); + fHistSideCPadRMS = new TH2F(name3,name3,250,-250,250,250,-250,250); + fHistSideCMaxSignal->SetXTitle("x [cm]"); + fHistSideCTotSignal->SetXTitle("x [cm]"); + fHistSideCPadRMS->SetXTitle("x [cm]"); + fHistSideCMaxSignal->SetYTitle("y [cm]"); + fHistSideCTotSignal->SetYTitle("y [cm]"); + fHistSideCPadRMS->SetYTitle("y [cm]"); +} + + fInitHist=kFALSE; + +} + +int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/){ + // see header file for class documentation - HLTInfo("--- Entering DoEvent() in TPCNoiseMap ---"); if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0; - - if(fPlotSideA){ - fHistSideA = new TH2F("fHistSideA","TPC Side A",250,-250,250,250,-250,250); - fHistSideA->SetXTitle("global X (cm)"); fHistSideA->SetYTitle("global Y (cm)"); - } - - if(fPlotSideC){ - fHistSideC = new TH2F("fHistSideC","TPC Side C",250,-250,250,250,-250,250); - fHistSideC->SetXTitle("global X (cm)"); fHistSideC->SetYTitle("global Y (cm)"); - } - + //HLTInfo("--- Entering DoEvent() in TPCNoiseMap ---"); + const AliHLTComponentBlockData *iter = NULL; Float_t xyz[3]; Int_t thissector, thisrow; - - fHistPartition = new TH2F("fHistPartition","fHistPartition",250,-250,250,250,-250,250); - + + /*if(fInitHist==kFALSE) { + fHistSideAMaxSignal->Reset(); + fHistSideCMaxSignal->Reset(); + }*/ + + for(iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputBlock()){ - HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", - evtData.fEventID, evtData.fEventID, - DataType2Text(iter->fDataType).c_str(), - DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); - - if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType && GetEventCount()<2){ - HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!", - DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(), - DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); - } +// HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s", +// evtData.fEventID, evtData.fEventID, +// DataType2Text(iter->fDataType).c_str(), +// DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); +// +// if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType && GetEventCount()<2){ +// HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!", +// DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(), +// DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str()); +// } - if (iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC)) continue; + if (iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC)) continue; - UInt_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); - UInt_t partition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); - - fSpecification = iter->fSpecification; + UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(*iter); + UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(*iter); + UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(*iter); + UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(*iter); + + if(fInitHist==kTRUE) InitializeHistograms(minSlice, maxSlice, minPartition, maxPartition); + fSpecification = iter->fSpecification; - AliHLTTPCDigitReader *pDigitReader = new AliHLTTPCDigitReaderDecoder; + AliHLTTPCDigitReader *pDigitReader = new AliHLTTPCDigitReaderDecoder; - pDigitReader->InitBlock(iter->fPtr,iter->fSize,partition,slice); - if(!pDigitReader) break; - - //sprintf(name,"hMaxSignal_slice%d_partition%d", slice, partition); - //fHistPartition = new TH2F(name,name,250,-250,250,250,-250,250); - - while( pDigitReader->Next() ){ - //while( pDigitReader->NextChannel()) { // pad loop + pDigitReader->InitBlock(iter->fPtr,iter->fSize,minPartition,minSlice); + if(!pDigitReader) break; + + // while(pDigitReader->Next()){ + + Float_t maxSignal = 0.; + Float_t totalSignal = 0.; + Float_t squaredSignal = 0.; + Float_t rms = 0.; + + while(pDigitReader->NextChannel()) { // pad loop fCurrentRow = pDigitReader->GetRow(); - fCurrentRow += pDigitReader->GetRowOffset(); + fCurrentRow += pDigitReader->GetRowOffset(); - AliHLTTPCTransform::Slice2Sector(slice,fCurrentRow,thissector,thisrow); + AliHLTTPCTransform::Slice2Sector(minSlice,fCurrentRow,thissector,thisrow); + AliHLTTPCTransform::Raw2Local(xyz,thissector,thisrow,pDigitReader->GetPad(),0); + + if(minSlice>17) xyz[1] = (-1.0)*xyz[1]; + + AliHLTTPCTransform::Local2Global(xyz,minSlice); + // temporarily the transformation Raw2Global will be broken down to 2 steps, + // as there is a correction necessary at the y coordinate of the local xyz. + //AliHLTTPCTransform::Raw2Global(xyz,thissector,thisrow,pDigitReader->GetPad(),0); + // transformation from pad-row coordinates to global ones + // time info is not taken into account -// AliTPCCalROC *calRoc = noisePad->GetCalROC(thissector); -// calRoc->GetValue(thisrow,pDigitReader->GetPad()); + // AliTPCCalROC *calRoc = noisePad->GetCalROC(thissector); + // calRoc->GetValue(thisrow,pDigitReader->GetPad()); - Float_t maxSignal = 0.; - //while( pDigitReader->NextBunch()) { + while(pDigitReader->NextBunch()) { - const UInt_t *bunchData = pDigitReader->GetSignals(); - for(Int_t i=0;iGetBunchSize();i++) { + const UInt_t *bunchData = pDigitReader->GetSignals(); + //Int_t time = pDigitReader->GetTime(); + + for(Int_t i=0;iGetBunchSize();i++){ - if((Float_t)(bunchData[i])>maxSignal){ - maxSignal = (Float_t)(bunchData[i]); - } - -// if((Float_t)(bunchData[i])>maxSignal){ -// if(fApplyNoiseMap) { //still in local coordinates -// -// if(calRoc->GetValue(thisrow,pDigitReader->GetPad())>0.) maxSignal = 0.; -// else maxSignal = bunchData[i]; -// -// } else maxSignal = bunchData[i]; -// } // end if - } // end for loop - //} // end of inner while loop + if((Float_t)(bunchData[i])>maxSignal){ maxSignal = (Float_t)(bunchData[i]); } + totalSignal += (Float_t)bunchData[i]; + squaredSignal += (Float_t)bunchData[i]*(Float_t)bunchData[i]; + //fHistSignal->Fill(time+i, bunchData[i]); + } // end for loop + + rms = TMath::Sqrt(squaredSignal/pDigitReader->GetBunchSize()); - AliHLTTPCTransform::Raw2Global(xyz,thissector,thisrow,pDigitReader->GetPad(),0); - // transformation from pad-row coordinates to global ones - // time info is not taken into account - - fHistPartition->Fill(xyz[0],xyz[1],maxSignal); + } // end of inner while loop + + + if(minSlice<18){ + if(maxSignal>0) fHistSideAMaxSignal->Fill(xyz[0],xyz[1],maxSignal); + if(totalSignal>0) fHistSideATotSignal->Fill(xyz[0],xyz[1],totalSignal); + if(rms>0) fHistSideAPadRMS->Fill(xyz[0],xyz[1],rms); + } else if(minSlice>17){ + if(maxSignal>0) fHistSideCMaxSignal->Fill(xyz[0],xyz[1],maxSignal); + if(totalSignal>0) fHistSideCTotSignal->Fill(xyz[0],xyz[1],totalSignal); + if(rms>0) fHistSideCPadRMS->Fill(xyz[0],xyz[1],rms); + } else continue; - if(fPlotSideA || fPlotSideC){ - if(slice<18) fHistSideA->Fill(xyz[0],xyz[1],maxSignal); - else fHistSideC->Fill(xyz[0],xyz[1],maxSignal); - } // end if plotting sides - } // end of while loop - delete pDigitReader; + maxSignal = 0.; + totalSignal = 0.; + squaredSignal = 0.; + rms = 0.; + } // end of while loop over pads + + pDigitReader->Reset(); + delete pDigitReader; } // end of for loop over data blocks - - if(fResetHistograms) ResetHistograms(); - MakeHistosPublic(); + //HLTImportant("fHistSideAMaxSignal entries at the end of event: %d", fHistSideAMaxSignal->GetEntries()); + + if(fResetHistograms) ResetHistograms(); fResetHistograms = kFALSE; + MakeHistosPublic(); + return 0; } // end DoEvent() + void AliHLTTPCNoiseMapComponent::MakeHistosPublic() { // see header file for class documentation - + // TFile *outputfile = new TFile("test.root","RECREATE"); -// fHistSideC->Write(); -// fHistPartition->Write(); -// fHistCDBMap->Write(); +// fHistSignal->Write(); // outputfile->Save(); // outputfile->Close(); - + TObjArray histos; - histos.Add(fHistPartition); - if(fPlotSideA) histos.Add(fHistSideA); - if(fPlotSideC) histos.Add(fHistSideC); - //histos.Add(fHistCDBMap); + histos.Add(fHistSideAMaxSignal); + histos.Add(fHistSideATotSignal); + histos.Add(fHistSideAPadRMS); - TIter iterator(&histos); - while(TObject *pObj=iterator.Next()){ + histos.Add(fHistSideCMaxSignal); + histos.Add(fHistSideCTotSignal); + histos.Add(fHistSideCPadRMS); - PushBack(pObj, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); - } + histos.Add(fHistCDBMap); + //histos.Add(fHistSignal); + + TIter iterator(&histos); + while(TObject *pObj=iterator.Next()){ PushBack(pObj, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification); } //PushBack( (TObject*) &histos, kAliHLTDataTypeHistogram, fSpecification); - - delete fHistPartition; - if(fHistSideA) delete fHistSideA; fHistSideA=NULL; - if(fHistSideC) delete fHistSideC; fHistSideC=NULL; } void AliHLTTPCNoiseMapComponent::ResetHistograms(){ // see header file for class documentation - fHistPartition->Reset(); - if(fHistSideA) fHistSideA->Reset(); - if(fHistSideC) fHistSideC->Reset(); + if(fHistSideAMaxSignal) fHistSideAMaxSignal->Reset(); + if(fHistSideATotSignal) fHistSideATotSignal->Reset(); + if(fHistSideAPadRMS) fHistSideAPadRMS->Reset(); + + if(fHistSideCMaxSignal) fHistSideCMaxSignal->Reset(); + if(fHistSideCTotSignal) fHistSideCTotSignal->Reset(); + if(fHistSideCPadRMS) fHistSideCPadRMS->Reset(); } int AliHLTTPCNoiseMapComponent::Configure(const char* arguments) { @@ -384,20 +433,16 @@ int AliHLTTPCNoiseMapComponent::Configure(const char* arguments) { argument=((TObjString*)pTokens->At(i))->GetString(); if (argument.IsNull()) continue; - if (argument.CompareTo("-apply-noisemap")==0) { - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTInfo("got \'-apply-noisemap\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); + if (argument.CompareTo("-read-noisemap")==0) { + //if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; + fReadNoiseMap = kTRUE; + HLTInfo("got \'-read-noisemap\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); } - else if (argument.CompareTo("-plot-side-c")==0) { - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTInfo("got \'-plot-side-c\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); - - } - else if (argument.CompareTo("-plot-side-a")==0) { - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTInfo("got \'-plot-side-a\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); - + else if(argument.CompareTo("-reset-histograms")==0){ + //if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; + fResetHistograms = kTRUE; + HLTInfo("got \'-reset-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data()); } else { HLTError("unknown argument %s", argument.Data()); @@ -419,47 +464,43 @@ int AliHLTTPCNoiseMapComponent::Configure(const char* arguments) { int AliHLTTPCNoiseMapComponent::Reconfigure(const char* cdbEntry, const char* chainId) { // see header file for class documentation - int iResult=0; - const char* path="HLT/ConfigTPC/TPCNoiseMapComponent"; - const char* defaultNotify=""; - if (cdbEntry) { - path=cdbEntry; - defaultNotify=" (default)"; - } - if (path) { - HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:""); - AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); - if (pEntry) { - TObjString* pString=dynamic_cast(pEntry->GetObject()); - if (pString) { - HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); - iResult=Configure(pString->GetString().Data()); - } else { - HLTError("configuration object \"%s\" has wrong type, required TObjString", path); - } - } else { - HLTError("cannot fetch object \"%s\" from CDB", path); - } + int iResult = 0; + const char* path = "HLT/ConfigTPC/TPCNoiseMapComponent"; + const char* defaultNotify = ""; + if(cdbEntry){ + path = cdbEntry; + defaultNotify = "(manual operator entry)"; } - const char* pathNoiseMap="TPC/Config/NoiseMap"; - - if (pathNoiseMap) { - HLTInfo("reconfigure noise map from entry %s, chain id %s", path,(chainId!=NULL && chainId[0]!=0)?chainId:""); - AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathNoiseMap/*,GetRunNo()*/); - if (pEntry) { - TObjString* pString=dynamic_cast(pEntry->GetObject()); - if (pString) { - HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); - iResult=Configure(pString->GetString().Data()); - } else { - HLTError("configuration object \"%s\" has wrong type, required TObjString", path); - } - } else { - HLTError("cannot fetch object \"%s\" from CDB", path); - } - } - + if(path){ + HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"" ); + + AliCDBPath argumentPath(path); + AliCDBStorage *stor = AliCDBManager::Instance()->GetDefaultStorage(); + + if(stor){ + Int_t version = stor->GetLatestVersion(path, GetRunNo()); + Int_t subVersion = stor->GetLatestSubVersion(path, GetRunNo(), version); + AliCDBEntry *pEntry = stor->Get(argumentPath,GetRunNo(), version, subVersion); + + if(pEntry){ + TObjString* pString = dynamic_cast(pEntry->GetObject()); + if(pString){ + HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); + iResult = Configure(pString->GetString().Data()); + } // if pString is valid + else { + HLTError("configuration object \"%s\" has wrong type, required TObjString", path); + } + } // if pEntry is valid + else { + HLTError("cannot fetch object \"%s\" from CDB", path); + } + } // end if stor is valid + } // end if path is valid + return iResult; + + }