diff --git a/PhysicsAnalysis/AnalysisCommon/PMGTools/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PMGTools/CMakeLists.txt index 9a81cd237969d1c6ce78bf6437002858ec1cbda6..478e348b38650138abc8c52d7a284a9cb8fb9087 100644 --- a/PhysicsAnalysis/AnalysisCommon/PMGTools/CMakeLists.txt +++ b/PhysicsAnalysis/AnalysisCommon/PMGTools/CMakeLists.txt @@ -17,16 +17,14 @@ endif() # External(s) used by the package: find_package( ROOT COMPONENTS Core Hist RIO ) -find_package( Boost ) # Libraries in the package: atlas_add_library( PMGToolsLib PMGTools/*.h Root/*.cxx PUBLIC_HEADERS PMGTools INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools PATCoreLib PATInterfaces PMGAnalysisInterfacesLib xAODTruth - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} CxxUtils FourMomUtils PathResolver RootCoreUtils xAODBase xAODEventInfo xAODJet xAODMetaData ${extra_private_libs}) + PRIVATE_LINK_LIBRARIES FourMomUtils PathResolver RootCoreUtils xAODEventInfo xAODJet xAODMetaData ${extra_private_libs}) if( NOT XAOD_STANDALONE ) atlas_add_component( PMGTools @@ -57,15 +55,17 @@ if( XAOD_STANDALONE ) atlas_add_test( ut_PMGSherpa22VJetsWeightTool_test SOURCES test/ut_PMGSherpa22VJetsWeightTool_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools PATInterfaces PMGToolsLib ${xaod_access_lib} ) + LINK_LIBRARIES ${ROOT_LIBRARIES} PMGToolsLib ${xaod_access_lib} ) atlas_add_test( ut_PMGSherpaVjetsSysTool_test SOURCES test/ut_PMGSherpaVjetsSysTool_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools PATInterfaces PMGAnalysisInterfacesLib PMGToolsLib ${xaod_access_lib} ) + LINK_LIBRARIES ${ROOT_LIBRARIES} PMGToolsLib ${xaod_access_lib} ) endif() # ... AthAnalysis/AnalysisBase +if( XAOD_STANDALONE ) # temporarily disabled in Athena (ATEAM-681) atlas_add_test( ut_PMGTruthWeightTool_test SOURCES test/ut_PMGTruthWeightTool_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgMessagingLib AsgTools PMGAnalysisInterfacesLib PMGToolsLib xAODTruth ${xaod_access_lib} ) +endif() diff --git a/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGTruthWeightTool.cxx b/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGTruthWeightTool.cxx index 1e5cf58d3c7078ce7b8f3801dce3b1684e1751b6..8067c8d33a764c29381ba278889625e5347ef728 100644 --- a/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGTruthWeightTool.cxx +++ b/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGTruthWeightTool.cxx @@ -19,9 +19,6 @@ #include <PMGTools/PMGTruthWeightTool.h> -// For replacing substrings -#include <boost/algorithm/string/replace.hpp> -#include <boost/algorithm/string/case_conv.hpp> namespace PMGTools { @@ -125,9 +122,14 @@ namespace PMGTools return m_weights.at(m_weightIndices.at(weightName)); } catch (const std::out_of_range& e) { // Before throwing an exception, try to recover with bad naming conventions - std::string strippedName = boost::algorithm::to_lower_copy(boost::replace_all_copy(weightName, " ", "")); - for (const auto & weight:m_weightNames){ - if (strippedName==boost::algorithm::to_lower_copy(boost::replace_all_copy(weight," ", ""))){ + std::string strippedName = RCU::substitute (weightName, " ", "_"); + std::transform(strippedName.begin(), strippedName.end(), strippedName.begin(), + [](unsigned char c){ return std::tolower(c); }); + for (const std::string &weight : m_weightNames) { + std::string modifiedName = RCU::substitute (weight, " ", "_"); + std::transform(modifiedName.begin(), modifiedName.end(), modifiedName.begin(), + [](unsigned char c){ return std::tolower(c); }); + if (strippedName == modifiedName){ ATH_MSG_WARNING("Using weight name \"" << weight << "\" instead of requested \"" << weightName << "\""); return getWeight(weight); } diff --git a/PhysicsAnalysis/AnalysisCommon/PMGTools/test/ut_PMGTruthWeightTool_test.cxx b/PhysicsAnalysis/AnalysisCommon/PMGTools/test/ut_PMGTruthWeightTool_test.cxx index 7cf8129077802d0ed22d79c60ebda83a1ba5ee81..5438fa6f46a824bd29ad76b44f2ef547d63fcc08 100644 --- a/PhysicsAnalysis/AnalysisCommon/PMGTools/test/ut_PMGTruthWeightTool_test.cxx +++ b/PhysicsAnalysis/AnalysisCommon/PMGTools/test/ut_PMGTruthWeightTool_test.cxx @@ -89,20 +89,12 @@ int main(int argc, char *argv[]) // Create the truth weight tool: ANA_MSG_INFO("Creating PMGTruthWeightTool..."); -#ifdef XAOD_STANDALONE - asg::AnaToolHandle< PMGTools::IPMGTruthWeightTool > weightTool; - ASG_SET_ANA_TOOL_TYPE(weightTool, PMGTools::PMGTruthWeightTool); - weightTool.setName("PMGTruthWeightTool"); - ANA_CHECK(weightTool.initialize()); -#else asg::AnaToolHandle< PMGTools::IPMGTruthWeightTool > weightTool("PMGTools::PMGTruthWeightTool/PMGTruthWeightTool"); ANA_CHECK(weightTool.retrieve()); -#endif // Loop over a few events: ANA_MSG_INFO("Preparing to loop over events..."); const Long64_t nEntries = 5; - // double retrievalTimeNanoSeconds = 0; for(Long64_t entry = 0; entry < nEntries; ++entry) { if (event.getEntry(entry) < 0) { ANA_MSG_ERROR("Failed to read event " << entry); continue; } diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt index a193110e30bd7ac8b17bd78d35d6018831277d05..a28db6d9539bac1b873f39e752a301324a17cd83 100644 --- a/Projects/Athena/package_filters.txt +++ b/Projects/Athena/package_filters.txt @@ -32,7 +32,6 @@ + PhysicsAnalysis/Algorithms/SelectionHelpers + PhysicsAnalysis/Algorithms/SystematicsHandles - PhysicsAnalysis/Algorithms/.* -- PhysicsAnalysis/AnalysisCommon/PMGTools - PhysicsAnalysis/D3PDTools/EventLoop.* - PhysicsAnalysis/D3PDTools/MultiDraw - PhysicsAnalysis/D3PDTools/SampleHandler