-
Notifications
You must be signed in to change notification settings - Fork 671
Add compatibility with new GRP scheme #976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| #include "CommonUtils/NameConf.h" | ||
| #include "CCDB/CcdbApi.h" | ||
| #include "DataFormatsParameters/GRPObject.h" | ||
| #include "DataFormatsParameters/GRPMagField.h" | ||
| #include "CCDB/BasicCCDBManager.h" | ||
| #include "Framework/HistogramRegistry.h" | ||
| #include "Framework/runDataProcessing.h" | ||
|
|
@@ -61,13 +62,16 @@ struct TrackPropagation { | |
|
|
||
| const o2::dataformats::MeanVertexObject* mVtx = nullptr; | ||
| o2::parameters::GRPObject* grpo = nullptr; | ||
| o2::parameters::GRPMagField* grpmag = nullptr; | ||
| o2::base::MatLayerCylSet* lut = nullptr; | ||
|
|
||
| Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; | ||
| Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; | ||
| Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; | ||
| Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; | ||
| Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; | ||
| Configurable<std::string> mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; | ||
| Configurable<bool> checkGRPObject{"checkGRPObject", false, "Flag to check the CCDB for GRPObject before asking for the GRPMagField"}; | ||
|
|
||
| void init(o2::framework::InitContext& initContext) | ||
| { | ||
|
|
@@ -93,16 +97,34 @@ struct TrackPropagation { | |
| if (!o2::base::GeometryManager::isGeometryLoaded()) { | ||
| ccdb->get<TGeoManager>(geoPath); | ||
| } | ||
| if (checkGRPObject) { | ||
| ccdb->setFatalWhenNull(false); | ||
| } | ||
| } | ||
|
|
||
| void initCCDB(aod::BCsWithTimestamps::iterator const& bc) | ||
| { | ||
| if (runNumber == bc.runNumber()) { | ||
| return; | ||
| } | ||
| grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, bc.timestamp()); | ||
| LOGF(info, "Setting magnetic field to %d kG for run %d from its GRP CCDB object", grpo->getNominalL3Field(), bc.runNumber()); | ||
| o2::base::Propagator::initFieldFromGRP(grpo); | ||
| if (checkGRPObject) { | ||
| grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(grpPath, bc.timestamp()); | ||
| if (!grpo) { | ||
| grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(grpmagPath, bc.timestamp()); | ||
| if (!grpmag) { | ||
| LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << bc.timestamp(); | ||
| } | ||
| LOGF(info, "Setting magnetic field to current %d A for run %d from its GRPMagField CCDB object", grpmag->getL3Current(), bc.runNumber()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use the "detail" level for log by default, unless you really care about having the message during real production.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, however this is the same level of info that was present before, this is also important information that should be printed once per run i.e. once per job ideally |
||
| o2::base::Propagator::initFieldFromGRP(grpmag); | ||
| } else { | ||
| LOGF(info, "Setting magnetic field to %d kG for run %d from its GRP CCDB object", grpo->getNominalL3Field(), bc.runNumber()); | ||
| o2::base::Propagator::initFieldFromGRP(grpo); | ||
| } | ||
| } else { | ||
| grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(grpmagPath, bc.timestamp()); | ||
| LOG(info) << "Setting magnetic field to current " << grpmag->getL3Current() << " A for run " << bc.runNumber() << " from its GRPMagField CCDB object"; | ||
| o2::base::Propagator::initFieldFromGRP(grpmag); | ||
| } | ||
| o2::base::Propagator::Instance()->setMatLUT(lut); | ||
| mVtx = ccdb->getForTimeStamp<o2::dataformats::MeanVertexObject>(mVtxPath, bc.timestamp()); | ||
| runNumber = bc.runNumber(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, why not simply making it empty by default and use it if not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I want to have the feature that the CCDB will not be checked and will get directly the new structure.
This is because the old GRP structure will be translated to the new one