Skip to content
Snippets Groups Projects
Commit db8c94d0 authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2:
Browse files

Okay I give up with the file meta data

Former-commit-id: 90dd04937615d4d8d0213a6db4b8eb87a9bd696a
parent fd60cda9
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@ atlas_depends_on_subdirs(
Event/xAOD/xAODBase
Event/xAOD/xAODCore
Event/xAOD/xAODEventInfo
Event/xAOD/xAODMetaData
Tools/PathResolver
${extra_deps} )
......@@ -37,7 +36,7 @@ atlas_add_library( MuonMomentumCorrectionsLib
MuonMomentumCorrections/*.h Root/*.cxx
PUBLIC_HEADERS MuonMomentumCorrections
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODMuon xAODMetaData MuonAnalysisInterfacesLib
LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODMuon MuonAnalysisInterfacesLib
PATInterfaces
PRIVATE_LINK_LIBRARIES xAODEventInfo PathResolver )
......
......@@ -53,7 +53,7 @@ class MuonCalibrationPeriodTool : public virtual IMuonCalibrationAndSmearingTool
virtual StatusCode beginInputFile();
virtual StatusCode beginEvent();
private:
// Have three tool instances for each Monte Carlo campaign
......
......@@ -7,14 +7,12 @@
// Local include(s):
#include "MuonMomentumCorrections/MuonCalibrationPeriodTool.h"
#include <xAODMetaData/FileMetaData.h>
#include <cmath>
namespace CP {
StatusCode MuonCalibrationPeriodTool::beginInputFile() {
StatusCode MuonCalibrationPeriodTool::beginEvent() {
static const unsigned int mc16a_period_number = 284500;
static const unsigned int mc16d_period_number = 300000;
static const unsigned int mc16e_period_number = 320000;
......@@ -24,16 +22,11 @@ namespace CP {
static const unsigned int last_run_17 = 350000;
static const unsigned int last_run_18 = 500000;
const xAOD::EventInfo* info = nullptr;
ATH_CHECK(evtStore()->retrieve(info, "EventInfo"));
// Let's try the FileMetaData
unsigned int run = -1;
bool isData = false;
if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
const xAOD::FileMetaData* metaData = nullptr;
ATH_CHECK(inputMetaStore()->retrieve(metaData, "FileMetaData"));
std::string data_type;
metaData->value(xAOD::FileMetaData::dataType, data_type);
std::cout<<data_type<<std::endl;
}
unsigned int run = info->runNumber();
bool isData = info->eventType(xAOD::EventInfo::IS_SIMULATION);
if ( (isData && run <= last_run_16) || (!isData && run == mc16a_period_number) ) m_activeTool = m_calibTool_1516.operator->();
else if ( (isData && run <= last_run_17) || (!isData && run == mc16d_period_number) ) m_activeTool = m_calibTool_17.operator->();
......
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