From: richterm Date: Sat, 7 Nov 2009 23:32:33 +0000 (+0000) Subject: removing all code regarding the solenoidBz OCDB entry formerly used X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=75970b8d09da4ec8bbec9b5de70040df721b755d removing all code regarding the solenoidBz OCDB entry formerly used to propagate the field value from DCS to the components in the online system. The framework now initializes the global AliMagF instance, which is used by the components fot the field setup --- diff --git a/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx b/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx index 7d02e9113ec..0c14e56737e 100644 --- a/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx +++ b/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx @@ -200,8 +200,7 @@ int AliHLTITSVertexerSPDComponent::ReadConfigurationString( const char* argumen if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } @@ -296,7 +295,8 @@ int AliHLTITSVertexerSPDComponent::Configure( const char* cdbEntry, const char* //* read magnetic field - int iResult2 = ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + int iResult2 = true; //ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + fSolenoidBz = GetBz(); //* read the actual CDB entry if required @@ -325,6 +325,13 @@ int AliHLTITSVertexerSPDComponent::DoInit( int argc, const char** argv ) fProduceHistos = 1; fAutoCalibration = 1000; + // Check field + if (!TGeoGlobalMagField::Instance()) { + HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF"); + return -ENODEV; + } + fSolenoidBz=GetBz(); + if(AliGeomManager::GetGeometry()==NULL){ AliGeomManager::LoadGeometry(""); } diff --git a/HLT/ITS/tracking/AliHLTITSTrackerComponent.cxx b/HLT/ITS/tracking/AliHLTITSTrackerComponent.cxx index 92cf2cd3238..447050a1bd5 100644 --- a/HLT/ITS/tracking/AliHLTITSTrackerComponent.cxx +++ b/HLT/ITS/tracking/AliHLTITSTrackerComponent.cxx @@ -177,8 +177,7 @@ int AliHLTITSTrackerComponent::ReadConfigurationString( const char* arguments ) if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } @@ -253,7 +252,8 @@ int AliHLTITSTrackerComponent::Configure( const char* cdbEntry, const char* chai //* read magnetic field - int iResult2 = ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + int iResult2 = true; //ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + fSolenoidBz = GetBz(); //* read the actual CDB entry if required @@ -279,7 +279,7 @@ int AliHLTITSTrackerComponent::DoInit( int argc, const char** argv ) { // Configure the ITS tracker component - if ( fTracker ) return EINPROGRESS; + if ( fTracker ) return -EINPROGRESS; if(AliGeomManager::GetGeometry()==NULL){ AliGeomManager::LoadGeometry(); @@ -294,14 +294,13 @@ int AliHLTITSTrackerComponent::DoInit( int argc, const char** argv ) int ret = Configure( NULL, NULL, arguments.Data() ); - // set field - if (!TGeoGlobalMagField::Instance()->IsLocked()) { - AliMagF* field = new AliMagF("Maps","Maps",1.,1.,AliMagF::k5kG); - field->SetFactorSol(1); - Double_t initialFieldStrengh=field->SolenoidField(); - field->SetFactorSol(fSolenoidBz/initialFieldStrengh); - TGeoGlobalMagField::Instance()->SetField(field); + // Check field + if (!TGeoGlobalMagField::Instance()) { + HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF"); + return -ENODEV; } + fSolenoidBz=GetBz(); + fTracker = new AliITStrackerHLT(0); return ret; diff --git a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx index 8307363f0f8..e72abcd7424 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx @@ -51,6 +51,7 @@ using namespace std; #include "AliCDBEntry.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" +#include "TGeoGlobalMagField.h" #include @@ -209,6 +210,12 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv ) return -ENOENT; } + // Check field + if (!TGeoGlobalMagField::Instance()) { + HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF"); + return -ENODEV; + } + fClusterFinder = new AliHLTTPCClusterFinder(); // first configure the default @@ -233,11 +240,6 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv ) iResult=ConfigureFromArgumentString(argc, argv); // return iResult; - if(iResult>=0){ - //initialize the magnetic field from CDB - iResult = ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz); - } - /* Int_t iResult=0; TString configuration=""; @@ -529,17 +531,18 @@ int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const c if (argument.CompareTo("-solenoidBz")==0){ if (++i>=argc) return -EPROTO; - argument=argv[i]; - AliTPCcalibDB* calib=AliTPCcalibDB::Instance(); - if(!calib){ - HLTError("CalibDB not availible"); - } - Float_t magneticField = argument.Atof(); - calib->SetExBField(magneticField); - HLTInfo("SolenoidBz is set to %f in the calibDB",magneticField); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); return 2; } + AliTPCcalibDB* calib=AliTPCcalibDB::Instance(); + if(!calib){ + HLTError("CalibDB not availible"); + } else { + calib->SetExBField(GetBz()); + HLTInfo("SolenoidBz is set to %f in the calibDB", GetBz()); + } + if (argument.CompareTo("-update-calibdb")==0 || argument.CompareTo("-update-transform")==0 ){ if(fClusterFinder->UpdateCalibDB()){ HLTDebug("CalibDB and offline transform successfully updated."); diff --git a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx index 54964f39cf2..f28f4c49c1e 100644 --- a/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx @@ -45,6 +45,7 @@ #include "AliHLTExternalTrackParam.h" #include "AliHLTGlobalBarrelTrack.h" #include "AliHLTTrackMCLabel.h" +#include "TGeoGlobalMagField.h" #include @@ -155,6 +156,8 @@ int AliHLTTPCEsdWriterComponent::AliWriter::DumpEvent( const AliHLTComponentEven if (fESD) { AliESDEvent* pESD=fESD; + pESD->Reset(); + pESD->SetMagneticField(GetBz()); iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt); } else { @@ -182,8 +185,6 @@ int AliHLTTPCEsdWriterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD, int iAddedDataBlocks=0; if (pESD && blocks) { - pESD->Reset(); - pESD->SetMagneticField(fSolenoidBz); const AliHLTComponentBlockData* iter = NULL; int bIsTrackSegs=0; @@ -331,6 +332,12 @@ int AliHLTTPCEsdWriterComponent::Configure(const char* arguments) int iResult=0; if (!arguments) return iResult; + // Check field + if (!TGeoGlobalMagField::Instance()) { + HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF"); + return -ENODEV; + } + TString allArgs=arguments; TString argument; int bMissingParam=0; @@ -343,8 +350,7 @@ int AliHLTTPCEsdWriterComponent::Configure(const char* arguments) if (argument.CompareTo("-solenoidBz")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTInfo("Magnetic Field set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data()); - fSolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); + HLTWarning("parameter -solenoidBz deprecated, magnetic field handled by global AliMagF object and TGeoGlobalMagField"); continue; } else { HLTError("unknown argument %s", argument.Data()); @@ -366,7 +372,7 @@ int AliHLTTPCEsdWriterComponent::Reconfigure(const char* cdbEntry, const char* c { // see header file for class documentation int iResult=0; - const char* path=kAliHLTCDBSolenoidBz; + const char* path=NULL; const char* defaultNotify=""; if (cdbEntry) { path=cdbEntry; @@ -455,9 +461,7 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoInit(int argc, const char** arg // -solenoidBz } else if (argument.CompareTo("-solenoidBz")==0) { - TString tmp="-solenoidBz "; - tmp+=argv[++i]; - fBase->Configure(tmp.Data()); + HLTWarning("parameter -solenoidBz deprecated, magnetic field handled by global AliMagF object and TGeoGlobalMagField"); } else { HLTError("unknown argument %s", argument.Data()); break; @@ -519,6 +523,8 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoEvent(const AliHLTComponentEven pTree->SetDirectory(0); } + pESD->Reset(); + pESD->SetMagneticField(GetBz()); if ((iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt))>0) { // TODO: set the specification correctly if (pTree) { diff --git a/HLT/TPCLib/AliHLTTPCSliceTrackerComponent.cxx b/HLT/TPCLib/AliHLTTPCSliceTrackerComponent.cxx index 0606411b9bb..00abc77b047 100644 --- a/HLT/TPCLib/AliHLTTPCSliceTrackerComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCSliceTrackerComponent.cxx @@ -48,6 +48,7 @@ using namespace std; #include "AliCDBEntry.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" +#include "TGeoGlobalMagField.h" //#include "AliHLTTPC.h" //#include //#include @@ -704,6 +705,12 @@ int AliHLTTPCSliceTrackerComponent::Configure(const char* arguments) int iResult=0; if (!arguments) return iResult; + // Check field + if (!TGeoGlobalMagField::Instance()) { + HLTError("magnetic field not initialized, please set up TGeoGlobalMagField and AliMagF"); + return -ENODEV; + } + TString allArgs=arguments; TString argument; int bMissingParam=0; @@ -748,16 +755,12 @@ int AliHLTTPCSliceTrackerComponent::Configure(const char* arguments) } else if (argument.CompareTo("-solenoidBz")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - fBField=((TObjString*)pTokens->At(i))->GetString().Atof(); - fBField=fBField/10.0; - HLTInfo("Magnetic field set to: %.1f", fBField); + HLTWarning("parameter -solenoidBz deprecated, magnetic field handled by global AliMagF object and TGeoGlobalMagField"); continue; } else if (argument.CompareTo("-bfield")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - fBField=((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTWarning("'-bfield' is deprecated, use -solenoidBz %.1f. Please note the different convention.", 10*fBField); - HLTInfo("Magnetic field set to: %.1f", fBField); + HLTWarning("parameter -bfield deprecated, magnetic field handled by global AliMagF object and TGeoGlobalMagField"); continue; } else if (argument.CompareTo("-etarange")==0) { @@ -820,6 +823,7 @@ int AliHLTTPCSliceTrackerComponent::Configure(const char* arguments) HLTError("missing parameter for argument %s", argument.Data()); iResult=-EINVAL; } + fBField=GetBz()/10.0; if (fBField == 0.){ // parameter for B=0 T fDoPP = kTRUE; @@ -845,7 +849,7 @@ int AliHLTTPCSliceTrackerComponent::ReadPreprocessorValues(const char* modules) TString str(modules); if(str.Contains("HLT") || str.Contains("TPC") || str.Contains("GRP")){ - const char* pathBField=kAliHLTCDBSolenoidBz; + const char* pathBField=NULL; if (pathBField) { HLTInfo("reconfigure B-Field from entry %s, modules %s", pathBField,(modules!=NULL && modules[0]!=0)?modules:""); @@ -903,7 +907,7 @@ int AliHLTTPCSliceTrackerComponent::Reconfigure(const char* cdbEntry, const char } } - const char* pathBField=kAliHLTCDBSolenoidBz; + const char* pathBField=NULL; if (pathBField) { HLTInfo("reconfigure B-Field from entry %s, chain id %s", path,(chainId!=NULL && chainId[0]!=0)?chainId:""); diff --git a/HLT/TPCLib/AliHLTTPCTrackMCMarkerComponent.cxx b/HLT/TPCLib/AliHLTTPCTrackMCMarkerComponent.cxx index a839777478b..6e8ddfc504b 100644 --- a/HLT/TPCLib/AliHLTTPCTrackMCMarkerComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCTrackMCMarkerComponent.cxx @@ -114,13 +114,6 @@ int AliHLTTPCTrackMCMarkerComponent::ReadConfigurationString( const char* argum argument = ( ( TObjString* )pTokens->At( i ) )->GetString(); if ( argument.IsNull() ) continue; - //if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { - //if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - //fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - //HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); - //continue; - //} - HLTError( "Unknown option \"%s\"", argument.Data() ); iResult = -EINVAL; } diff --git a/HLT/TPCLib/AliHLTTPCdEdxComponent.cxx b/HLT/TPCLib/AliHLTTPCdEdxComponent.cxx index 89847430e7b..b69765d0fde 100644 --- a/HLT/TPCLib/AliHLTTPCdEdxComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCdEdxComponent.cxx @@ -166,8 +166,7 @@ int AliHLTTPCdEdxComponent::ReadConfigurationString( const char* arguments ) if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } @@ -235,7 +234,8 @@ int AliHLTTPCdEdxComponent::Configure( const char* cdbEntry, const char* chainId //* read magnetic field - int iResult2 = ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + int iResult2 = true;//ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + fSolenoidBz=GetBz(); //* read the actual CDB entry if required diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerCalibComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerCalibComponent.cxx index f2445a40e9f..175e417b130 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerCalibComponent.cxx +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerCalibComponent.cxx @@ -304,66 +304,8 @@ int AliHLTTPCOfflineTrackerCalibComponent::Configure(const char* arguments) if (argument.IsNull()) continue; if (argument.CompareTo("-solenoidBz")==0) { -#ifndef HAVE_NOT_ALIMAGF30848 - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - // TODO: Matthias 2009-05-08 this changes below look weird to me - // maybe this was not correctly done by Federico in r 30849 - float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); - if (SolenoidBz=3. && SolenoidBz<4.5) { - map=AliMagFMaps::k4kG; - factor=SolenoidBz/4; - } - else { - map=AliMagFMaps::k5kG; - factor=SolenoidBz/5; - } */ - // - // the magnetic field map is not supposed to change - // field initialization should be done once in the beginning - // TODO: does the factor need adjustment? - const AliMagF* currentMap = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - if (!currentMap) { - AliMagF* field = new AliMagF("MagneticFieldMap", "BMap", 1., 1., map); - TGeoGlobalMagField::Instance()->SetField(field); - HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map); - } else if (currentMap->GetMapType()!=map) { - HLTWarning("omitting request to override field map %d with %d", currentMap->GetMapType(), map); - } -#else // keeping the <30489 code for backward compatibility, to be merged at some point - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - // TODO: check if there is common functionality in the AliMagF* classes - float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); - if (SolenoidBz=3. && SolenoidBz<4.5) { - map=AliMagFMaps::k4kG; - factor=SolenoidBz/4; - } else { - map=AliMagFMaps::k5kG; - factor=SolenoidBz/5; - } - // the magnetic field map is not supposed to change - // field initialization should be done once in the beginning - // TODO: does the factor need adjustment? - const AliMagF* currentMap=AliTracker::GetFieldMap(); - if (!currentMap) { - AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., map); - AliTracker::SetFieldMap(field,kFALSE); - HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map); - } else if (currentMap->Map()!=map) { - HLTWarning("omitting request to override field map %s with %s", currentMap->Map(), map); - } -#endif + if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } else { HLTError("unknown argument %s", argument.Data()); diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx index 47a4f2b7985..97a83d30ef7 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx @@ -296,66 +296,8 @@ int AliHLTTPCOfflineTrackerComponent::Configure(const char* arguments) if (argument.IsNull()) continue; if (argument.CompareTo("-solenoidBz")==0) { -#ifndef HAVE_NOT_ALIMAGF30848 - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - // TODO: Matthias 2009-05-08 this changes below look weird to me - // maybe this was not correctly done by Federico in r 30849 - float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); - if (SolenoidBz=3. && SolenoidBz<4.5) { - map=AliMagFMaps::k4kG; - factor=SolenoidBz/4; - } - else { - map=AliMagFMaps::k5kG; - factor=SolenoidBz/5; - } */ - // the magnetic field map is not supposed to change - // field initialization should be done once in the beginning - // TODO: does the factor need adjustment? - const AliMagF* currentMap = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - if (!currentMap) { - AliMagF* field = new AliMagF("MagneticFieldMap", "BMap", 1., 1., map); - TGeoGlobalMagField::Instance()->SetField(field); - HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map); - } else if (currentMap->GetMapType()!=map) { - HLTWarning("omitting request to override field map %d with %d", currentMap->GetMapType(), map); - } -#else // keeping the <30489 code for backward compatibility, to be merged at some point - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - // TODO: check if there is common functionality in the AliMagF* classes - float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); - if (SolenoidBz=3. && SolenoidBz<4.5) { - map=AliMagFMaps::k4kG; - factor=SolenoidBz/4; - } else { - map=AliMagFMaps::k5kG; - factor=SolenoidBz/5; - } - // the magnetic field map is not supposed to change - // field initialization should be done once in the beginning - // TODO: does the factor need adjustment? - const AliMagF* currentMap=AliTracker::GetFieldMap(); - if (!currentMap) { - AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., map); - AliTracker::SetFieldMap(field,kFALSE); - HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map); - } else if (currentMap->Map()!=map) { - HLTWarning("omitting request to override field map %s with %s", currentMap->Map(), map); - } -#endif + if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } else { HLTError("unknown argument %s", argument.Data()); diff --git a/HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.cxx b/HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.cxx index 75a6367c5fe..6384bb1658c 100644 --- a/HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.cxx +++ b/HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.cxx @@ -137,8 +137,7 @@ int AliHLTTPCCAGlobalMergerComponent::ReadConfigurationString( const char* argu if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } @@ -220,7 +219,8 @@ int AliHLTTPCCAGlobalMergerComponent::Configure( const char* cdbEntry, const cha //* read magnetic field - int iResult2 = ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + int iResult2 = true;//ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + fSolenoidBz = GetBz(); //* read the actual CDB entry if required diff --git a/HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx b/HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx index a3b9bb09aaa..d21dc8044d8 100644 --- a/HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx +++ b/HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx @@ -191,8 +191,7 @@ int AliHLTTPCCATrackerComponent::ReadConfigurationString( const char* arguments if ( argument.CompareTo( "-solenoidBz" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; - fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof(); - HLTInfo( "Magnetic Field set to: %f", fSolenoidBz ); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } @@ -306,7 +305,8 @@ int AliHLTTPCCATrackerComponent::Configure( const char* cdbEntry, const char* ch //* read magnetic field - int iResult2 = ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + int iResult2 = true; //ReadCDBEntry( kAliHLTCDBSolenoidBz, chainId ); + fSolenoidBz = GetBz(); //* read the actual CDB entry if required diff --git a/HLT/TRD/AliHLTTRDTrackerV1Component.cxx b/HLT/TRD/AliHLTTRDTrackerV1Component.cxx index b1f991a2eb0..2be64c5e287 100644 --- a/HLT/TRD/AliHLTTRDTrackerV1Component.cxx +++ b/HLT/TRD/AliHLTTRDTrackerV1Component.cxx @@ -206,7 +206,7 @@ int AliHLTTRDTrackerV1Component::DoEvent( const AliHLTComponentEventData& evtDat HLTDebug("NofBlocks %i", evtData.fBlockCnt ); fESD->Reset(); - //fESD->SetMagneticField(fSolenoidBz); + //fESD->SetMagneticField(GetBz()); AliHLTUInt32_t totalSize = 0, offset = 0; @@ -341,8 +341,7 @@ int AliHLTTRDTrackerV1Component::Configure(const char* arguments){ } else if (argument.CompareTo("-solenoidBz")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - fieldStrength=((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Setting Magnetic field to %.1f KGauss", fieldStrength); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } else if (argument.CompareTo("-NTimeBins")==0) { @@ -523,83 +522,6 @@ int AliHLTTRDTrackerV1Component::SetParams() HLTDebug("Reconstructor options are: %s",recoOptions.Data()); fReconstructor->SetOption(recoOptions.Data()); - if (fMagneticField >= 0) - { - HLTWarning("Setting magnetic field by hand!"); - } - if (!TGeoGlobalMagField::Instance()->IsLocked()) { - AliMagF* field; - if (fMagneticField == 0){ - // magnetic field OFF - field = new AliMagF("Maps","Maps",0.,0.,AliMagF::k5kGUniform); - TGeoGlobalMagField::Instance()->SetField(field); - HLTDebug("Magnetic field is OFF."); - }else{ - // magnetic field ON - field = new AliMagF("Maps","Maps",-1.,-1.,AliMagF::k5kG); - TGeoGlobalMagField::Instance()->SetField(field); - HLTDebug("Magnetic field is ON."); - if( fMagneticField < 0 ) - iResult=ReconfigureField(); - } - }else{ - HLTError("Magnetic field is already set and locked, cannot redefine it." ); - } - return iResult; -} - -int AliHLTTRDTrackerV1Component::ReconfigureField() -{ - int iResult=0; - if(fieldStrength<-100){ - const char* pathBField=kAliHLTCDBSolenoidBz; - - if (pathBField) { - HLTInfo("reconfigure B-Field from entry %s", pathBField); - AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathBField/*,GetRunNo()*/); - if (pEntry) { - TObjString* pString=dynamic_cast(pEntry->GetObject()); - if (pString) { - HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); - TObjArray* pTokens=pString->GetString().Tokenize(" "); - TString argument; - int bMissingParam=0; - if (pTokens) { - for (int i=0; iGetEntries() && iResult>=0; i++) { - argument=((TObjString*)pTokens->At(i))->GetString(); - if (argument.IsNull()) continue; - - if (argument.CompareTo("-solenoidBz")==0) { - if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTDebug("Magnetic field in CDB: %s", ((TObjString*)pTokens->At(i))->GetString().Data()); - fieldStrength=((TObjString*)pTokens->At(i))->GetString().Atof(); - continue; - } else { - HLTError("unknown argument %s", argument.Data()); - iResult=-EINVAL; - break; - } - } - delete pTokens; - } - } else { - HLTError("configuration object \"%s\" has wrong type, required TObjString", pathBField); - } - } else { - HLTError("cannot fetch object \"%s\" from CDB", pathBField); - } - } - } - - if(fieldStrength>=-100){ - AliMagF* field = (AliMagF *) TGeoGlobalMagField::Instance()->GetField(); - HLTDebug("Magnetic field before change: %f KGauss", field->SolenoidField()); - field->SetFactorSol(1); - Double_t initialFieldStrengh=field->SolenoidField(); - field->SetFactorSol(fieldStrength/initialFieldStrengh); - field->SetFactorDip((fieldStrength/initialFieldStrengh>=0) ? 1 : -1); - HLTDebug("Magnetic field was changed to %f KGauss.", field->SolenoidField()); - } return iResult; } @@ -630,24 +552,6 @@ int AliHLTTRDTrackerV1Component::Reconfigure(const char* cdbEntry, const char* c } } - const char* pathBField=kAliHLTCDBSolenoidBz; - - if (pathBField) { - HLTInfo("reconfigure B-Field from entry %s, chain id %s", pathBField,(chainId!=NULL && chainId[0]!=0)?chainId:""); - AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathBField/*,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", pathBField); - } - } else { - HLTError("cannot fetch object \"%s\" from CDB", pathBField); - } - } - return iResult; } @@ -660,33 +564,6 @@ int AliHLTTRDTrackerV1Component::ReadPreprocessorValues(const char* modules) TString str(modules); if(str.Contains("HLT") || str.Contains("TRD") || str.Contains("GRP")){ - const char* pathBField=kAliHLTCDBSolenoidBz; - if (pathBField) { - - HLTInfo("reconfigure B-Field from entry %s, modules %s", pathBField,(modules!=NULL && modules[0]!=0)?modules:""); - AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathBField/*,GetRunNo()*/); - - // AliCDBPath path(pathBField); - - // AliCDBStorage *stor = AliCDBManager::Instance()->GetDefaultStorage(); - // Int_t version = stor->GetLatestVersion(pathBField, GetRunNo()); - // Int_t subVersion = stor->GetLatestSubVersion(pathBField, GetRunNo(), version); - // AliCDBEntry *pEntry = stor->Get(path,GetRunNo(), version, subVersion); - - // HLTInfo("RunNo %d, Version %d, subversion %d", 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()); - } else { - HLTError("configuration object \"%s\" has wrong type, required TObjString", pathBField); - } - } else { - HLTError("cannot fetch object \"%s\" from CDB", pathBField); - } - } } return iResult; } diff --git a/HLT/TRD/AliHLTTRDTrackerV1Component.h b/HLT/TRD/AliHLTTRDTrackerV1Component.h index 8752d417949..f794e637951 100644 --- a/HLT/TRD/AliHLTTRDTrackerV1Component.h +++ b/HLT/TRD/AliHLTTRDTrackerV1Component.h @@ -67,7 +67,6 @@ protected: int Configure(const char* arguments); int SetParams(); - int ReconfigureField(); private: /** copy constructor prohibited */ diff --git a/HLT/global/AliHLTGlobalEsdConverterComponent.cxx b/HLT/global/AliHLTGlobalEsdConverterComponent.cxx index 7929c49a02e..775ac059aae 100644 --- a/HLT/global/AliHLTGlobalEsdConverterComponent.cxx +++ b/HLT/global/AliHLTGlobalEsdConverterComponent.cxx @@ -88,8 +88,7 @@ int AliHLTGlobalEsdConverterComponent::Configure(const char* arguments) if (argument.CompareTo("-solenoidBz")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - HLTInfo("Magnetic Field set to: %s", ((TObjString*)pTokens->At(i))->GetString().Data()); - fSolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); continue; } else { HLTError("unknown argument %s", argument.Data()); @@ -111,7 +110,7 @@ int AliHLTGlobalEsdConverterComponent::Reconfigure(const char* cdbEntry, const c { // see header file for class documentation int iResult=0; - const char* path=kAliHLTCDBSolenoidBz; + const char* path=NULL; const char* defaultNotify=""; if (cdbEntry) { path=cdbEntry; @@ -202,6 +201,8 @@ int AliHLTGlobalEsdConverterComponent::DoInit(int argc, const char** argv) iResult=-EINVAL; } + fSolenoidBz=GetBz(); + if (iResult>=0) { fESD = new AliESDEvent; if (fESD) { diff --git a/HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx b/HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx index 48a3b816baa..59d081f7502 100644 --- a/HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx +++ b/HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx @@ -227,6 +227,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoInit(int argc, const char** argv) HLTError("decision parameter not initialized"); iResult=-ENODEV; } + fSolenoidBz=GetBz(); return iResult; } @@ -241,9 +242,8 @@ int AliHLTTriggerBarrelGeomMultiplicity::ReadPreprocessorValues(const char* /*mo { // see header file for function documentation - // TODO 2009-10-10: implementation - // for the moment very quick, just reload the magnetic field - return ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz); + // nothing to do for the moment + return 0; } int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const char *cdbEntry, const char* chainId) diff --git a/HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx b/HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx index cd1e4c59d02..784f2d325d9 100644 --- a/HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx +++ b/HLT/trigger/AliHLTTriggerBarrelMultiplicity.cxx @@ -227,13 +227,14 @@ int AliHLTTriggerBarrelMultiplicity::DoInit(int argc, const char** argv) // first configure the default int iResult=0; - iResult=ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz); - if (iResult>=0) iResult=ConfigureFromCDBTObjString(fgkOCDBEntry); + iResult=ConfigureFromCDBTObjString(fgkOCDBEntry); // configure from the command line parameters if specified if (iResult>=0 && argc>0) iResult=ConfigureFromArgumentString(argc, argv); return iResult; + + fSolenoidBz=GetBz(); } int AliHLTTriggerBarrelMultiplicity::DoDeinit() @@ -249,7 +250,6 @@ int AliHLTTriggerBarrelMultiplicity::Reconfigure(const char* cdbEntry, const cha // configure from the specified antry or the default one const char* entry=cdbEntry; if (!entry || entry[0]==0) { - ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz); entry=fgkOCDBEntry; } @@ -260,9 +260,8 @@ int AliHLTTriggerBarrelMultiplicity::ReadPreprocessorValues(const char* /*module { // see header file for class documentation - // TODO 2009-09-10: implementation - // for the moment very quick, just reload the magnetic field - return ConfigureFromCDBTObjString(kAliHLTCDBSolenoidBz); + // nothing to do for the moment + return 0; } int AliHLTTriggerBarrelMultiplicity::ScanConfigurationArgument(int argc, const char** argv) @@ -352,8 +351,7 @@ int AliHLTTriggerBarrelMultiplicity::ScanConfigurationArgument(int argc, const c // -solenoidBz if (argument.CompareTo("-solenoidBz")==0) { if (++i>=argc) return -EPROTO; - argument=argv[i]; - fSolenoidBz=argument.Atof(); + HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); return 2; }