diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonJiveXML/CMakeLists.txt index 1a87b6915c411deb6723bd729d81c63287c55555..fc6ce5ff31b3d8b3ee3a1e28f40f262cd96ddcf8 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/CMakeLists.txt @@ -16,6 +16,5 @@ atlas_add_component( MuonJiveXML LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps MuonRPC_CnvToolsLib MuonReadoutGeometry JiveXMLLib GaudiKernel MuonIdHelpersLib MuonRDO MuonPrepRawData AnalysisTriggerEvent RPC_CondCablingLib) # Install files from the package: -atlas_install_headers( MuonJiveXML ) atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.cxx index 6cb8beab92ad33c6f42c628825910837c172b460..31417276076e9c83cab7f6bc35c7aef4d8a10fc7 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.cxx @@ -2,8 +2,8 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/CSCClusterRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "CSCClusterRetriever.h" +#include "MuonFullIDHelper.h" namespace JiveXML { diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/CSCClusterRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.h similarity index 100% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/CSCClusterRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/CSCClusterRetriever.h diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.cxx index 745cade49b8d46bb146b71ce7434f493e55808a7..92d12ad8d84a06596f09f95ea19eaf3c407f9a35 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.cxx @@ -2,34 +2,31 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/CscPrepDataRetriever.h" +#include "CscPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/CscReadoutElement.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" namespace JiveXML { //-------------------------------------------------------------------------- CscPrepDataRetriever::CscPrepDataRetriever(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type,name,parent), - m_typeName("CSCD") + AthAlgTool(type,name,parent) { declareInterface<IDataRetriever>(this); - - declareProperty("StoreGateKey", m_sgKey = "CSC_Clusters", "name of the CscPrepDataContainer"); + } //-------------------------------------------------------------------------- StatusCode CscPrepDataRetriever::initialize(){ - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); - return StatusCode::SUCCESS; } @@ -38,13 +35,10 @@ namespace JiveXML { StatusCode CscPrepDataRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) { //be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Retrieving " << dataTypeName()); + ATH_MSG_VERBOSE("Retrieving " << dataTypeName()); + + SG::ReadHandle<Muon::CscPrepDataContainer> cscContainer(m_sgKey); - const Muon::CscPrepDataContainer *cscContainer=nullptr; - if ( evtStore()->retrieve(cscContainer, m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Muon::CscPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } int ndata = 0; Muon::CscPrepDataContainer::const_iterator containerIt; @@ -73,7 +67,7 @@ namespace JiveXML { Identifier id = data->identify(); if (!element) { - if (msgLvl(MSG::WARNING)) ATH_MSG_WARNING("No MuonGM::CscReadoutElement for hit " << id); + ATH_MSG_WARNING("No MuonGM::CscReadoutElement for hit " << id); continue; } @@ -103,14 +97,14 @@ namespace JiveXML { myDataMap["barcode"] = barcode; //Be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); + ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); //forward data to formating tool //return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); //// Atlantis can't deal with SGkey in xml output in CSCD (freezes) //// So not output SGKey for now. jpt 20Aug09 std::string emptyStr=""; - return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } //-------------------------------------------------------------------------- diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/CscPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.h similarity index 80% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/CscPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.h index ba81d48817b32bf5b7ff27884ab5b508dd08f85f..eefc6840ebbe335ffe19c3b0843b35a3eab6a791 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/CscPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/CscPrepDataRetriever.h @@ -11,6 +11,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/CscPrepDataContainer.h" #include <string> @@ -26,17 +27,14 @@ namespace JiveXML { virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "CSCD"; }; ///Default AthAlgTool methods virtual StatusCode initialize(); private: - ///The data type that is generated by this retriever - const std::string m_typeName; - ///The storegate key for the CSC collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::CscPrepDataContainer> m_sgKey{this, "StoreGateKey", "CSC_Clusters", "Name of the CscPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.cxx index 0be5c84ed42253f7562be70ef8bf9afa528c7972..a2c8ae99a2e856e30290d75a5af831a83a7ea6cf 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.cxx @@ -2,9 +2,9 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/MMPrepDataRetriever.h" +#include "MMPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/MMReadoutElement.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonReadoutGeometry/MuonChannelDesign.h" @@ -18,13 +18,11 @@ namespace JiveXML { //-------------------------------------------------------------------------- MMPrepDataRetriever::MMPrepDataRetriever(const std::string& type,const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_typeName("MM") + AthAlgTool(type, name, parent) { declareInterface<IDataRetriever>(this); - declareProperty("StoreGateKey", m_sgKey = "MM_Measurements", "Storegate key for MM PredData container"); } //-------------------------------------------------------------------------- @@ -32,6 +30,7 @@ namespace JiveXML { StatusCode MMPrepDataRetriever::initialize(){ ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); @@ -43,13 +42,9 @@ namespace JiveXML { StatusCode MMPrepDataRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) { //be verbose - ATH_MSG_DEBUG("Retrieving " << dataTypeName()); + ATH_MSG_VERBOSE("Retrieving " << dataTypeName()); - const Muon::MMPrepDataContainer *mmContainer=nullptr; - if ( evtStore()->retrieve(mmContainer, m_sgKey).isFailure() ) { - ATH_MSG_DEBUG("Muon::MMPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } + SG::ReadHandle<Muon::MMPrepDataContainer> mmContainer(m_sgKey); int ndata = 0; for (const auto mmCollection : *mmContainer){ @@ -113,6 +108,6 @@ namespace JiveXML { // Atlantis can't deal with SGkey in xml output in CSCD (freezes) // So not output SGKey for now. jpt 20Aug09 std::string emptyStr=""; - return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MMPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.h similarity index 80% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MMPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.h index 5ca7edc1170621ac9d88b19af50ffa385db0d2b2..015522c1000856e27a16395c76782e9d0b61d7d9 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MMPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MMPrepDataRetriever.h @@ -12,6 +12,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/MMPrepDataContainer.h" #include <string> @@ -28,18 +29,15 @@ namespace JiveXML { virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "MM"; }; ///Default AthAlgTool methods StatusCode initialize(); private: - - ///The data type that is generated by this retriever - const std::string m_typeName; ///The storegate key for the MM collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::MMPrepDataContainer> m_sgKey{this, "StoreGateKey", "MM_Measurements", "Name of the MMPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.cxx index 04bdc4571f901ce7b5378fbc779e0527614c1d62..10f3ffeae0a679aa2045acda0019a321457baa25 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.cxx @@ -2,24 +2,21 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/MdtPrepDataRetriever.h" +#include "MdtPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" namespace JiveXML { //-------------------------------------------------------------------------- MdtPrepDataRetriever::MdtPrepDataRetriever(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_typeName("MDT") + AthAlgTool(type, name, parent) { declareInterface<IDataRetriever>(this); - declareProperty("StoreGateKey", m_sgKey = "MDT_DriftCircles", "Storegate key for MDT PredData container"); declareProperty("AdcCut", m_adcCut = 50, " Some ADC threshold cut"); declareProperty("ObeyMasked", m_obeyMasked = true, " Use info about masked channels"); } @@ -28,8 +25,8 @@ namespace JiveXML { StatusCode MdtPrepDataRetriever::initialize(){ - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); - + ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); return StatusCode::SUCCESS; @@ -40,13 +37,10 @@ namespace JiveXML { StatusCode MdtPrepDataRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) { //be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Retrieving " << dataTypeName()); + ATH_MSG_VERBOSE("Retrieving " << dataTypeName()); + + SG::ReadHandle<Muon::MdtPrepDataContainer> mdtContainer(m_sgKey); - const Muon::MdtPrepDataContainer *mdtContainer=nullptr; - if ( evtStore()->retrieve(mdtContainer, m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Muon::MdtPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } int ndata = 0; Muon::MdtPrepDataContainer::const_iterator containerIt; @@ -77,7 +71,7 @@ namespace JiveXML { Identifier id = data->identify(); if (!element) { - if (msgLvl(MSG::WARNING)) ATH_MSG_WARNING("No MuonGM::MdtReadoutElement for hit " << id); + ATH_MSG_WARNING("No MuonGM::MdtReadoutElement for hit " << id); continue; } @@ -106,10 +100,10 @@ namespace JiveXML { barcode.push_back(DataType(0)); } - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(" MdtPrepData x, y, z, driftR, lenght " << globalPos.x() << " " + ATH_MSG_DEBUG(" MdtPrepData x, y, z, driftR, lenght " << globalPos.x() << " " << globalPos.y() << " " << globalPos.z() << " " << localPos[Trk::driftRadius] << " " << tubeLength << " adc: " << adcCount); - if ( notMasked ){ if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(" *notMasked* "); } + if ( notMasked ){ ATH_MSG_DEBUG(" *notMasked* "); } } } @@ -124,14 +118,14 @@ namespace JiveXML { myDataMap["barcode"] = barcode; //Be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); + ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); //forward data to formating tool //return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); //// Atlantis problem with track-hits/MDT association when SGKey is set, //// so not output SGKey for now. jpt 20Jul12 std::string emptyStr=""; - return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } //-------------------------------------------------------------------------- diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MdtPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.h similarity index 81% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MdtPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.h index 84300c54b6d63594f372a1602c0242f83c03f0c3..55919c0201cc16312e0d2845f246bb51a5941443 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MdtPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MdtPrepDataRetriever.h @@ -11,6 +11,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/MdtPrepDataContainer.h" #include <string> @@ -27,18 +28,15 @@ namespace JiveXML { virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "MDT"; }; ///Default AthAlgTool methods StatusCode initialize(); private: - - ///The data type that is generated by this retriever - const std::string m_typeName; ///The storegate key for the MDT collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_sgKey{this, "StoreGateKey", "MDT_DriftCircles", "Name of the MdtPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.cxx index cfbf1bcfcb832b3c8ebba072632fae65de5f6224..aa7c9b915facf4f316dd4be77972c29256c6f42d 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonIdHelpers/MdtIdHelper.h" #include "MuonIdHelpers/RpcIdHelper.h" diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MuonFullIDHelper.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.h similarity index 100% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/MuonFullIDHelper.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/MuonFullIDHelper.h diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.cxx index 0b9d55321211d5e6cfe0a258d0c8dce75154da25..0d6247a68199dbf4144dcd4879f1c98b648a2c8a 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.cxx @@ -2,11 +2,10 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/RpcPrepDataRetriever.h" +#include "RpcPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/RpcReadoutElement.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" namespace JiveXML { @@ -18,16 +17,15 @@ namespace JiveXML { { declareInterface<IDataRetriever>(this); - - declareProperty("StoreGateKey", m_sgKey = "RPC_Measurements", "Storegate key for RPC PredData container"); + } //-------------------------------------------------------------------------- StatusCode RpcPrepDataRetriever::initialize(){ - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); - + ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); return StatusCode::SUCCESS; @@ -38,13 +36,9 @@ namespace JiveXML { StatusCode RpcPrepDataRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) { //be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Retrieving " << dataTypeName()); + ATH_MSG_DEBUG("Retrieving " << dataTypeName()); - const Muon::RpcPrepDataContainer *rpcContainer=nullptr; - if ( evtStore()->retrieve(rpcContainer, m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Muon::RpcPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } + SG::ReadHandle<Muon::RpcPrepDataContainer> rpcContainer(m_sgKey); int ndata = 0; Muon::RpcPrepDataContainer::const_iterator containerIt; @@ -104,9 +98,9 @@ namespace JiveXML { myDataMap["barcode"] = barcode; //Be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); + ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); //forward data to formating tool - return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/RpcPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.h similarity index 86% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/RpcPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.h index 4ad080b012daf3ce4379905609fbd4448a9d5e89..a0c921d11c4d87350ec5758c4447f486e0e8e292 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/RpcPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/RpcPrepDataRetriever.h @@ -12,6 +12,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/RpcPrepDataContainer.h" #include <string> @@ -39,7 +40,7 @@ namespace JiveXML { const std::string m_typeName; ///The storegate key for the RPC collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_sgKey{this, "StoreGateKey", "RPC_Measurements", "Name of the RpcPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.cxx index 489dd3caf6bb58ead99718a3958323d814436858..eeba935c39fa9647f64f01304550418ea0dee695 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.cxx @@ -2,32 +2,28 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/TgcPrepDataRetriever.h" +#include "TgcPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/TgcReadoutElement.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" namespace JiveXML { //-------------------------------------------------------------------------- TgcPrepDataRetriever::TgcPrepDataRetriever(const std::string& type,const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_typeName("TGC") + AthAlgTool(type, name, parent) { - declareInterface<IDataRetriever>(this); - - declareProperty("StoreGateKey", m_sgKey = "TGC_Measurements", "Storegate key for TGC PredData container"); + declareInterface<IDataRetriever>(this); } //-------------------------------------------------------------------------- StatusCode TgcPrepDataRetriever::initialize(){ - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); - + ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); return StatusCode::SUCCESS; @@ -38,13 +34,9 @@ namespace JiveXML { StatusCode TgcPrepDataRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) { //be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Retrieving " << dataTypeName()); + ATH_MSG_DEBUG("Retrieving " << dataTypeName()); - const Muon::TgcPrepDataContainer *tgcContainer=nullptr; - if ( evtStore()->retrieve(tgcContainer, m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Muon::TgcPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } + SG::ReadHandle<Muon::TgcPrepDataContainer> tgcContainer(m_sgKey); int ndata = 0; Muon::TgcPrepDataContainer::const_iterator containerIt; @@ -120,13 +112,13 @@ namespace JiveXML { myDataMap["barcode"] = barcode; //Be verbose - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); + ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); ////forward data to formating tool //return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); //// Atlantis can't deal with SGkey in xml output in CSCD (freezes) //// So not output SGKey for now. jpt 20Aug09 std::string emptyStr=""; - return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TgcPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.h similarity index 80% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TgcPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.h index e8b4a3dba2e0a11d6e12d9cd6c1423f9892c881c..bab8618d28dd2a97934719968729a9559fa3c9e7 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TgcPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TgcPrepDataRetriever.h @@ -12,6 +12,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/MuonPrepDataContainer.h" #include <string> @@ -28,18 +29,16 @@ namespace JiveXML { virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "TGC"; }; ///Default AthAlgTool methods StatusCode initialize(); private: - - ///The data type that is generated by this retriever - const std::string m_typeName; + ///The storegate key for the TGC collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_sgKey{this, "StoreGateKey", "TGC_Measurements", "Name of the MMPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.cxx index 6760616ddd51dac69097070706fc3f38f4e63ad6..75038032d627d8e5fc5042fec448ecc375e47637 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.cxx @@ -2,27 +2,22 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/TrigMuonROIRetriever.h" +#include "TrigMuonROIRetriever.h" #include <string> #include "CLHEP/Units/SystemOfUnits.h" -#include "AnalysisTriggerEvent/LVL1_ROI.h" - - namespace JiveXML { //-------------------------------------------------------------------------- TrigMuonROIRetriever::TrigMuonROIRetriever(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_typeName("TrigMuonROI") + AthAlgTool(type, name, parent) { declareInterface<IDataRetriever>(this); - declareProperty("StoreGateKey", m_sgKey = "LVL1_ROI", "Storegate key for LVL1 Muon RoIs"); } //-------------------------------------------------------------------------- @@ -32,13 +27,7 @@ namespace JiveXML { //be verbose if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Retrieving " << dataTypeName() << endmsg; - - const LVL1_ROI * roi; - - if ( evtStore()->retrieve(roi,m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No MuonROI (LVL1_ROI) found." << endmsg; - return StatusCode::SUCCESS; - } + SG::ReadHandle<LVL1_ROI> roi(m_sgKey); int nRoIs = roi->getMuonROIs().size(); @@ -88,6 +77,6 @@ namespace JiveXML { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< phi.size() << endmsg; //forward data to formating tool - return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigMuonROIRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.h similarity index 76% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigMuonROIRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.h index b8da1d4ac9f1e0581c1ad7b3f6468d4614d89109..24bc92374d29f5fd55109a589ebc2c4a4a1a5416 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigMuonROIRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigMuonROIRetriever.h @@ -10,6 +10,7 @@ #include "JiveXML/IDataRetriever.h" #include "AthenaBaseComps/AthAlgTool.h" +#include "AnalysisTriggerEvent/LVL1_ROI.h" namespace JiveXML{ @@ -25,15 +26,11 @@ namespace JiveXML{ virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "TrigMuonROI"; }; private: - - ///The data type that is generated by this retriever - const std::string m_typeName; - ///The storegate key for the LVL1 Muon RoIs - std::string m_sgKey; + SG::ReadHandleKey<LVL1_ROI> m_sgKey{this, "StoreGateKey", "LVL1_ROI", "Storegate key for LVL1 Muon RoIs"}; }; } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx index 6f1609b67ce2655ce8b05045cc403e8f85059ca1..eebb10e963e48def23097a1af98973c59b559be6 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx @@ -2,12 +2,11 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/TrigRpcDataRetriever.h" +#include "TrigRpcDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/RpcReadoutElement.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" -#include "MuonRDO/RpcPadContainer.h" #include <vector> #include <list> @@ -41,32 +40,11 @@ namespace JiveXML { if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Retrieving " << dataTypeName()); // retrieve the collection of RDO - const RpcPadContainer* rdoContainer; - if ( evtStore()->retrieve( rdoContainer, m_sgKey).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Muon::RpcPadContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } - else{ - if (msgLvl(MSG::DEBUG)) { - ATH_MSG_DEBUG("Muon::RpcPadContainer retrieved"); - ATH_MSG_DEBUG(rdoContainer->size() << " RPC RDO collections."); - } - } - - const DataHandle<RpcPad> firstRdoColl; - const DataHandle<RpcPad> lastRdoColl; - if ( evtStore()->retrieve(firstRdoColl,lastRdoColl).isFailure() ) { - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("RpcPad collections not found"); - return StatusCode::SUCCESS; - } - else{ - if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("RpcPad collections retrieved"); - } + SG::ReadHandle<RpcPadContainer> rdoContainer(m_sgKey); int ndata=0; - const DataHandle<RpcPad>& rdoColl(firstRdoColl); - for (; rdoColl!=lastRdoColl; ++rdoColl){ - ndata+= rdoColl->size(); + for (auto containerIt=rdoContainer->begin(); containerIt!=rdoContainer->end(); ++containerIt) { + ndata += (*containerIt)->size(); } //Make the vectors to contain the information and reserve space accordingly @@ -95,8 +73,7 @@ namespace JiveXML { SG::ReadCondHandle<RpcCablingCondData> readHandle{m_rpcCab, Gaudi::Hive::currentContext()}; const RpcCablingCondData* rpcCabling{*readHandle}; - const DataHandle<RpcPad>& itColl(firstRdoColl); - for (; itColl!=lastRdoColl; ++itColl){ + for (auto itColl=rdoContainer->begin(); itColl!=rdoContainer->end(); ++itColl) { if ( itColl->size() == 0 ) continue; ipad++; @@ -244,6 +221,6 @@ namespace JiveXML { if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(dataTypeName() << ": "<< x.size()); //forward data to formating tool - return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.h similarity index 91% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.h index 84c08779ea5d36572e1e86d17d9b111ffab724cc..b218c08ebd92531c17d8a1a0250a77d943e1a667 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.h @@ -16,6 +16,7 @@ #include "MuonRPC_CnvTools/IRPC_RDO_Decoder.h" #include "RPC_CondCabling/RpcCablingCondData.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonRDO/RpcPadContainer.h" #include <string> @@ -42,7 +43,7 @@ namespace JiveXML { ///The data type that is generated by this retriever const std::string m_typeName; - Gaudi::Property<std::string> m_sgKey{this,"StoreGateKey","RPCPAD","StoreGate key for the RPC RDO container"}; + SG::ReadHandleKey<RpcPadContainer> m_sgKey{this, "StoreGateKey", "RPCPAD", "StoreGate key for the RPC RDO container"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/components/MuonJiveXML_entries.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/components/MuonJiveXML_entries.cxx index e2738241f77d94e2eb6537d5646220257ec63efd..16632b6ecbedad397dddc3e66309192bf4a904e0 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/components/MuonJiveXML_entries.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/components/MuonJiveXML_entries.cxx @@ -1,13 +1,13 @@ -#include "MuonJiveXML/CSCClusterRetriever.h" -#include "MuonJiveXML/TgcPrepDataRetriever.h" -#include "MuonJiveXML/CscPrepDataRetriever.h" -#include "MuonJiveXML/MdtPrepDataRetriever.h" -#include "MuonJiveXML/RpcPrepDataRetriever.h" -//#include "MuonJiveXML/MuidTrackRetriever.h" -#include "MuonJiveXML/TrigRpcDataRetriever.h" -#include "MuonJiveXML/TrigMuonROIRetriever.h" -#include "MuonJiveXML/sTgcPrepDataRetriever.h" -#include "MuonJiveXML/MMPrepDataRetriever.h" +#include "../CSCClusterRetriever.h" +#include "../TgcPrepDataRetriever.h" +#include "../CscPrepDataRetriever.h" +#include "../MdtPrepDataRetriever.h" +#include "../RpcPrepDataRetriever.h" +//#include "MuidTrackRetriever.h" +#include "../TrigRpcDataRetriever.h" +#include "../TrigMuonROIRetriever.h" +#include "../sTgcPrepDataRetriever.h" +#include "../MMPrepDataRetriever.h" using namespace JiveXML; diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.cxx index e7f9ac07f6586f50edc8d9293a3c695dc94fe9a0..26c265a50a92a4cc0c2c767f9c4b818f5be43cee 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.cxx +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.cxx @@ -2,9 +2,9 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -#include "MuonJiveXML/sTgcPrepDataRetriever.h" +#include "sTgcPrepDataRetriever.h" -#include "MuonJiveXML/MuonFullIDHelper.h" +#include "MuonFullIDHelper.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonReadoutGeometry/MuonChannelDesign.h" @@ -18,13 +18,11 @@ namespace JiveXML { //-------------------------------------------------------------------------- sTgcPrepDataRetriever::sTgcPrepDataRetriever(const std::string& type,const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_typeName("STGC") + AthAlgTool(type, name, parent) { declareInterface<IDataRetriever>(this); - - declareProperty("StoreGateKey", m_sgKey = "STGC_Measurements", "Storegate key for STGC PredData container"); + } //-------------------------------------------------------------------------- @@ -32,7 +30,7 @@ namespace JiveXML { StatusCode sTgcPrepDataRetriever::initialize(){ ATH_MSG_DEBUG("Initializing retriever for " << dataTypeName()); - + ATH_CHECK(m_sgKey.initialize()); ATH_CHECK( m_idHelperSvc.retrieve() ); return StatusCode::SUCCESS; @@ -45,11 +43,7 @@ namespace JiveXML { //be verbose ATH_MSG_DEBUG("Retrieving " << dataTypeName()); - const Muon::sTgcPrepDataContainer *stgcContainer=nullptr; - if ( evtStore()->retrieve(stgcContainer, m_sgKey).isFailure() ) { - ATH_MSG_DEBUG("Muon::sTgcPrepDataContainer '" << m_sgKey << "' was not retrieved."); - return StatusCode::SUCCESS; - } + SG::ReadHandle<Muon::sTgcPrepDataContainer> stgcContainer(m_sgKey); int ndata = 0; for (const auto stgcCollection : *stgcContainer){ @@ -151,6 +145,6 @@ namespace JiveXML { // Atlantis can't deal with SGkey in xml output in CSCD (freezes) // So not output SGKey for now. jpt 20Aug09 std::string emptyStr=""; - return FormatTool->AddToEvent(dataTypeName(), emptyStr, &myDataMap); + return FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &myDataMap); } } diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/sTgcPrepDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.h similarity index 80% rename from MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/sTgcPrepDataRetriever.h rename to MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.h index 51aedc006a9dd712e5be836229a189a75cdffef0..e3f99dbf5cbd6ff4f1a2cefa6240d50d1accbf39 100644 --- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/sTgcPrepDataRetriever.h +++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/sTgcPrepDataRetriever.h @@ -12,6 +12,7 @@ #include "GaudiKernel/ToolHandle.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonPrepRawData/MuonPrepDataContainer.h" #include <string> @@ -28,18 +29,15 @@ namespace JiveXML { virtual StatusCode retrieve(ToolHandle<IFormatTool> &FormatTool); /// Return the name of the data type - virtual std::string dataTypeName() const { return m_typeName; }; + virtual std::string dataTypeName() const { return "STGC"; }; ///Default AthAlgTool methods StatusCode initialize(); private: - - ///The data type that is generated by this retriever - const std::string m_typeName; ///The storegate key for the STGC collection - std::string m_sgKey; + SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_sgKey{this, "StoreGateKey", "STGC_Measurements", "Name of the sTGCPrepDataContainer"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/graphics/JiveXML/src/AlgoJiveXML.cxx b/graphics/JiveXML/src/AlgoJiveXML.cxx index 7e2a495fda1cc7078ab95bbef0d4b7e22b159424..40c4f54a8fd56a01d1bd54b59e87bffd54cc0673 100755 --- a/graphics/JiveXML/src/AlgoJiveXML.cxx +++ b/graphics/JiveXML/src/AlgoJiveXML.cxx @@ -58,14 +58,14 @@ namespace JiveXML{ StatusCode AlgoJiveXML::initialize(){ //be verbose - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) <<"Initialize()" << endmsg; + ATH_MSG_VERBOSE("Initialize()"); /** * Get the geometry writer tools and write geometries */ if(m_writeGeometry){ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Writing geometry to file" << endmsg; + ATH_MSG_DEBUG("Writing geometry to file"); /// Loop over names std::vector<std::string>::iterator GeoWriterNameItr = m_GeoWriterNames.begin(); @@ -75,16 +75,15 @@ namespace JiveXML{ ToolHandle<IGeometryWriter> GeometryWriter(*GeoWriterNameItr); if ( GeometryWriter.retrieve().isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to locate " - << GeometryWriter.name() << " tool" << endmsg; + ATH_MSG_WARNING("Unable to locate "<<GeometryWriter.name()<<" tool"); } else { /// Write geometry if ( GeometryWriter->writeGeometry().isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Unable to write geometry" << endmsg; + ATH_MSG_WARNING("Unable to write geometry"); } /// Release tool if ( GeometryWriter.release().isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Unable to release tool GeometryWriter" << endmsg; + ATH_MSG_WARNING("Unable to release tool GeometryWriter"); } } } @@ -93,38 +92,35 @@ namespace JiveXML{ /** * Get the formatting tools */ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Retrieving XML format tool" << endmsg; + ATH_MSG_DEBUG("Retrieving XML format tool"); //Retrieve the format tool - if (m_FormatTool.retrieve().isFailure()){ - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) <<"Unable to retrieve XML format tool" << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK(m_FormatTool.retrieve()); //Setting the tags if ( m_FormatTool->SetTag( TagType("Release",m_AtlasRelease)).isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Couldn't set Release version" << endmsg; + ATH_MSG_WARNING( "Couldn't set Release version" ); } /** * Add default file streaming tools if requested */ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Retrieving streaming tools" << endmsg; + ATH_MSG_DEBUG("Retrieving streaming tools"); if (m_writeToFile){ - if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Adding default file streaming tool" << endmsg; + ATH_MSG_INFO("Adding default file streaming tool"); m_StreamTools.push_back("JiveXML::StreamToFileTool/StreamToFileTool"); } if (m_onlineMode){ - if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Adding default XMLRPC streaming tool" << endmsg; + ATH_MSG_INFO("Adding default XMLRPC streaming tool"); m_StreamTools.push_back("JiveXML::XMLRPCStreamTool/XMLRPCStreamTool"); } /// Get the streaming tools if (m_StreamTools.size() == 0) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"No streaming tools defined, events will be created but not stored!" << endmsg; + ATH_MSG_WARNING("No streaming tools defined, events will be created but not stored!"); } else { if (m_StreamTools.retrieve().isFailure()){ - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) <<"Unable to retrieve streaming tools !" << endmsg; + ATH_MSG_ERROR("Unable to retrieve streaming tools !"); return StatusCode::FAILURE; } } @@ -133,7 +129,7 @@ namespace JiveXML{ * Get the IDataRetrievers requested in the m_dataTypes list from the toolSvc * and store them in the ToolHandleArray */ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Obtaining list of data retrievers" << endmsg; + ATH_MSG_DEBUG("Obtaining list of data retrievers"); /// Iteratate over the given data types std::vector<std::string>::iterator DataTypesEnd = m_dataTypes.end(); @@ -146,16 +142,16 @@ namespace JiveXML{ ToolHandle<IDataRetriever> DataRetrieverTool(*DataTypeItr); /// See if we can retrieve the tool if( DataRetrieverTool.retrieve().isFailure() ) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Unable to locate tool " + ATH_MSG_WARNING( "Unable to locate tool " << DataRetrieverTool.type() << " with name " - << DataRetrieverTool.name() << endmsg; + << DataRetrieverTool.name()); } else { /// If so, store it in our list m_DataRetrievers.push_back(DataRetrieverTool); } } - if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Retrieving data from " << m_DataRetrievers.size() << " tools" << endmsg; + ATH_MSG_INFO("Retrieving data from " << m_DataRetrievers.size() << " tools" ); return StatusCode::SUCCESS; } @@ -186,14 +182,13 @@ namespace JiveXML{ //Retrieve eventInfo from StoreGate const xAOD::EventInfo* eventInfo; if (evtStore()->retrieve(eventInfo).isFailure()){ - if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) <<"Could not find xAODEventInfo" << endmsg; + ATH_MSG_FATAL("Could not find xAODEventInfo" ); return StatusCode::FAILURE; }else{ // Event/xAOD/xAODEventInfo/trunk/xAODEventInfo/versions/EventInfo_v1.h - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << " xAODEventInfo: " - << ", runNumber: " << eventInfo->runNumber() // is '222222' for mc events ? + ATH_MSG_VERBOSE(" xAODEventInfo: runNumber: " << eventInfo->runNumber() // is '222222' for mc events ? << ", eventNumber: " << eventInfo->eventNumber() - << ", mcChannelNumber: " << eventInfo->mcChannelNumber() + << ", mcChannelNumber: " << eventInfo->mcChannelNumber() << ", mcEventNumber: " << eventInfo->mcEventNumber() // MC: use this instead of runNumber << ", lumiBlock: " << eventInfo->lumiBlock() << ", timeStamp: " << eventInfo->timeStamp() @@ -201,7 +196,7 @@ namespace JiveXML{ << ", eventTypeBitmask: " << eventInfo->eventTypeBitmask() << ", actualInteractionsPerCrossing: " << eventInfo->actualInteractionsPerCrossing() << ", averageInteractionsPerCrossing: " << eventInfo->averageInteractionsPerCrossing() - << endmsg; + ); } // new treatment of mc_channel_number for mc12 @@ -211,40 +206,37 @@ namespace JiveXML{ bool firstEv = true; const PileUpEventInfo* pevt = 0; if (evtStore()->retrieve(pevt).isFailure()){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Could not find PileUpEventInfo" << endmsg; + ATH_MSG_WARNING( "Could not find PileUpEventInfo" ); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Pileup Info Retrieved Successfully as 'PileUpEventInfo' Object " << endmsg; + ATH_MSG_DEBUG( "Pileup Info Retrieved Successfully as 'PileUpEventInfo' Object " ); //+++ Get sub-event info object - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Sub Event Infos: " << endmsg; + ATH_MSG_DEBUG( "Sub Event Infos: " ); PileUpEventInfo::SubEvent::const_iterator it = pevt->beginSubEvt(); PileUpEventInfo::SubEvent::const_iterator end = pevt->endSubEvt(); - if (it == end) if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "None found" << endmsg; + if (it == end) ATH_MSG_DEBUG( "None found" ); for (; it != end; ++it) { const EventInfo* sevt = (*it).pSubEvt; if (sevt) { if (firstEv){ mcChannelNo = sevt->event_type()->mc_channel_number(); // the 'real' mc-channel - if (msgLvl(MSG::INFO)) msg(MSG::INFO) - << " mc_channel from PileUpEventInfo : " << sevt->event_type()->mc_channel_number() << endmsg; + ATH_MSG_INFO( " mc_channel from PileUpEventInfo : " << sevt->event_type()->mc_channel_number() ); firstEv = false; } - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "Sub Event Info:" << endmsg; - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) - << " Time : " << (*it).time() << endmsg - << " Index : " << (*it).index() << endmsg - << " Provenance : " << (*it).type() << endmsg // This is the provenance stuff: signal, minbias, cavern, etc - << " Run Number : " << sevt->event_ID()->run_number() << endmsg - << " Event Number : " << sevt->event_ID()->event_number() << endmsg - << " ns Offset : " << sevt->event_ID()->time_stamp_ns_offset() << endmsg - << " Lumi Block : " << sevt->event_ID()->lumi_block() << endmsg - << " mc_channel : " << sevt->event_type()->mc_channel_number() << endmsg - << " BCID : " << sevt->event_ID()->bunch_crossing_id() << endmsg - << " Geo version : " << m_geometryVersionIn << endmsg - << " User Type : " << sevt->event_type()->user_type() << endmsg; + ATH_MSG_VERBOSE("Sub Event Info:\n Time : " << (*it).time() + << " Index : " << (*it).index() + << " Provenance : " << (*it).type() // This is the provenance stuff: signal, minbias, cavern, etc + << " Run Number : " << sevt->event_ID()->run_number() + << " Event Number : " << sevt->event_ID()->event_number() + << " ns Offset : " << sevt->event_ID()->time_stamp_ns_offset() + << " Lumi Block : " << sevt->event_ID()->lumi_block() + << " mc_channel : " << sevt->event_type()->mc_channel_number() + << " BCID : " << sevt->event_ID()->bunch_crossing_id() + << " Geo version : " << m_geometryVersionIn + << " User Type : " << sevt->event_type()->user_type() ); } - else if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "Subevent is null ptr " << endmsg; + else ATH_MSG_VERBOSE("Subevent is null ptr "); } } @@ -255,8 +247,7 @@ namespace JiveXML{ // Note: 4294967293 is the maximum value for a unsigned long if ( mcChannelNo != 0 ){ runNo = mcChannelNo + 140000000; } // indicating 'mc14' - if (msgLvl(MSG::INFO)) msg(MSG::INFO) << " runNumber for filename: " << runNo - << ", eventNumber: " << eventNo << endmsg; + ATH_MSG_INFO( " runNumber for filename: " << runNo << ", eventNumber: " << eventNo); if ( eventInfo->lumiBlock() ){ lumiBlock = eventInfo->lumiBlock(); @@ -282,7 +273,7 @@ namespace JiveXML{ found2 = (DataType(dateTime).toString().find("CET")); if ( int(found1)<0 && int(found2)<0 ){ // not found is -1 strftime(dateTime, 32, "%Y-%m-%d %H:%M:%S UTC", utctime); - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " TIME NOT CET/CEST. Adjusted to:" << dateTime << endmsg; + ATH_MSG_DEBUG( " TIME NOT CET/CEST. Adjusted to:" << dateTime ); } } else { dateTime[0] = '\0'; // empty string @@ -293,7 +284,7 @@ namespace JiveXML{ * Then start a new event with this header information */ if ( m_FormatTool->StartEvent(eventNo, runNo, dateTime, lumiBlock, eventProperty, geometryVersion).isFailure() ){ - if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) <<"Couldn't start event in FormatTool" << endmsg; + ATH_MSG_FATAL("Couldn't start event in FormatTool"); return StatusCode::FAILURE; } @@ -301,7 +292,7 @@ namespace JiveXML{ * Now iterate over all the IDataRetrievers and * write their data to the xml file by giving it the XMLWriter */ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Starting loop over data retrievers" << endmsg; + ATH_MSG_DEBUG("Starting loop over data retrievers" ); //Loop over data retrievers ToolHandleArray<IDataRetriever>::iterator DataRetrieverItr = m_DataRetrievers.begin(); for(; DataRetrieverItr != m_DataRetrievers.end(); ++DataRetrieverItr) { @@ -309,43 +300,43 @@ namespace JiveXML{ try { //Retrieve information and pass it to formatting tool object if ((*DataRetrieverItr)->retrieve(m_FormatTool).isFailure()) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Failed to fill " << (*DataRetrieverItr)->dataTypeName() << endmsg; + ATH_MSG_WARNING( "Failed to fill " << (*DataRetrieverItr)->dataTypeName() ); } else { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Filled: " << (*DataRetrieverItr)->dataTypeName() << endmsg; + ATH_MSG_DEBUG("Filled: " << (*DataRetrieverItr)->dataTypeName() ); } //Only catch std::exception } catch ( std::exception& ex ){ //Now show some message - if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) <<"Caught exception in " << (*DataRetrieverItr)->name() + ATH_MSG_FATAL("Caught exception in " << (*DataRetrieverItr)->name() << " while retrieving data for " << (*DataRetrieverItr)->dataTypeName() - << " : " << ex.what() << endmsg; + << " : " << ex.what() ); //and return with an error return StatusCode::FAILURE; } } - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Finished loop over data retrievers" << endmsg; + ATH_MSG_DEBUG( "Finished loop over data retrievers" ); /** * Finish the event with a proper footer */ if ( m_FormatTool->EndEvent().isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) <<"Couldn't end event in FormatTool" << endmsg; + ATH_MSG_WARNING( "Couldn't end event in FormatTool" ); return StatusCode::FAILURE; } /** * Now stream the events to all registered streaming tools */ - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Starting loop over event streamers" << endmsg; + ATH_MSG_DEBUG( "Starting loop over event streamers" ); //Loop over streaming tools ToolHandleArray<IStreamTool>::iterator StreamToolsItr = m_StreamTools.begin(); for ( ; StreamToolsItr != m_StreamTools.end(); ++StreamToolsItr ){ - if (msgLvl(MSG::INFO)) msg(MSG::INFO) <<"Streaming event to " << (*StreamToolsItr)->name() << endmsg; + ATH_MSG_INFO("Streaming event to " << (*StreamToolsItr)->name() ); if ( (*StreamToolsItr)->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not stream event to " << (*StreamToolsItr)->name() << endmsg; + ATH_MSG_WARNING( "Could not stream event to " << (*StreamToolsItr)->name() ); } } - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) <<"Finished loop over event streamers" << endmsg; + ATH_MSG_DEBUG( "Finished loop over event streamers" ); return StatusCode::SUCCESS; } @@ -356,7 +347,7 @@ namespace JiveXML{ */ StatusCode AlgoJiveXML::finalize() { - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) <<"finalize()" << endmsg; + ATH_MSG_VERBOSE( "finalize()" ); /// Release all the tools m_DataRetrievers.release().ignore();