Skip to content
Snippets Groups Projects
Commit 23fbcf73 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'AthenaBS_DRAW_BeamEnergyFix' into 'master'

Take run parameters from metadata, if available. Fix for taking beam data from TagInfo.

See merge request atlas/athena!34648
parents 4d7473e9 ea51f75f
No related branches found
No related tags found
No related merge requests found
...@@ -134,10 +134,10 @@ ByteStreamEventStorageOutputSvc::stop() ...@@ -134,10 +134,10 @@ ByteStreamEventStorageOutputSvc::stop()
const ByteStreamMetadataContainer* metaDataCont = 0; const ByteStreamMetadataContainer* metaDataCont = 0;
const ByteStreamMetadata* metaData = 0; const ByteStreamMetadata* metaData = 0;
ServiceHandle<StoreGateSvc> mds("StoreGateSvc/MetaDataStore", name()); ServiceHandle<StoreGateSvc> mds("StoreGateSvc/MetaDataStore", name());
StatusCode status = mds.retrieve(); if (mds.retrieve().isFailure()) {
if (!status.isFailure()) { ATH_MSG_WARNING("Cannot get MetaDataStore");
StatusCode stat = mds->retrieve(metaDataCont, "ByteStreamMetadata"); } else {
if (stat.isSuccess()) metaData = *(metaDataCont->begin()); if (mds->retrieve(metaDataCont, "ByteStreamMetadata").isSuccess()) metaData = *(metaDataCont->begin());
} }
// Try to write metadata to file // Try to write metadata to file
dWok = initDataWriterContents(0, metaData); dWok = initDataWriterContents(0, metaData);
...@@ -175,8 +175,16 @@ ByteStreamEventStorageOutputSvc::initDataWriter() ...@@ -175,8 +175,16 @@ ByteStreamEventStorageOutputSvc::initDataWriter()
ATH_MSG_ERROR("Cannot retrieve EventInfo"); ATH_MSG_ERROR("Cannot retrieve EventInfo");
return(false); return(false);
} }
const ByteStreamMetadataContainer* metaDataCont = 0;
const ByteStreamMetadata* metaData = 0;
ServiceHandle<StoreGateSvc> mds("InputMetaDataStore", name());
if (mds.retrieve().isFailure()) {
ATH_MSG_WARNING("Cannot get InputMetaDataStore");
} else {
if (mds->retrieve(metaDataCont, "ByteStreamMetadata").isSuccess()) metaData = *(metaDataCont->begin());
}
// Now try to write metadata to file // Now try to write metadata to file
return initDataWriterContents(evtInfo, 0); return initDataWriterContents(evtInfo, metaData);
} }
...@@ -258,10 +266,13 @@ ByteStreamEventStorageOutputSvc::initDataWriterContents( ...@@ -258,10 +266,13 @@ ByteStreamEventStorageOutputSvc::initDataWriterContents(
ATH_MSG_DEBUG("Cannot retrieve TagInfo"); ATH_MSG_DEBUG("Cannot retrieve TagInfo");
} else { } else {
std::string tagName, tagValue; std::string tagName, tagValue;
if (metaData == 0) { // FIXME: Set TriggerType, BeamType? if (metaData == 0) {
tagName = "beam_energy"; tagName = "beam_type";
tagInfo->findTag(tagName, tagValue); tagInfo->findTag(tagName, tagValue);
runPara.beam_type = atof(tagValue.c_str()); runPara.beam_type = atof(tagValue.c_str());
tagName = "beam_energy";
tagInfo->findTag(tagName, tagValue);
runPara.beam_energy = atof(tagValue.c_str());
} }
tagName = "GeoAtlas"; tagName = "GeoAtlas";
tagInfo->findTag(tagName, tagValue); tagInfo->findTag(tagName, tagValue);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment