From 90863ad5f29fb51845119dea4542f9ef5edc9e3e Mon Sep 17 00:00:00 2001 From: Dave Casper <dcasper@uci.edu> Date: Sat, 13 Jan 2024 14:33:09 -0800 Subject: [PATCH] Readout geometry packages --- .../CaloGeoModelUtils/CaloDDAthenaComps.h | 13 +- .../CaloGeoModelUtils/CaloMaterialManager.h | 18 +- .../CaloGeoModelUtils/DetectorFactoryBase.h | 9 +- .../src/CaloDDAthenaComps.cxx | 2 +- .../src/CaloMaterialManager.cxx | 219 ++++++++---------- .../src/DistortedMaterialManager.cxx | 4 +- .../CaloReadoutGeometry/CaloCommonItems.h | 20 +- .../CaloDetectorManagerBase.h | 15 +- .../src/CaloCommonItems.cxx | 2 +- .../src/CaloDetectorManagerBase.cxx | 5 +- .../FaserDetectorManager.h | 14 +- .../src/FaserDetectorManager.cxx | 7 +- .../NeutrinoCommonItems.h | 16 +- .../NeutrinoDetectorManagerBase.h | 16 +- .../src/NeutrinoCommonItems.cxx | 6 +- .../src/NeutrinoDetectorManagerBase.cxx | 5 +- .../ScintReadoutGeometry/ScintCommonItems.h | 18 +- .../ScintDetectorManagerBase.h | 16 +- .../src/ScintCommonItems.cxx | 2 +- .../src/ScintDetectorManagerBase.cxx | 5 +- package_filters.txt | 5 + 21 files changed, 149 insertions(+), 268 deletions(-) diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloDDAthenaComps.h b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloDDAthenaComps.h index c77e23c9e..dc33da061 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloDDAthenaComps.h +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloDDAthenaComps.h @@ -6,7 +6,7 @@ #define CaloGeoModelUtils_CaloDDAthenaComps_H // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" class StoreGateSvc; class IGeoDbTagSvc; class IRDBAccessSvc; @@ -16,18 +16,12 @@ class IGeometryDBSvc; namespace CaloDD { /// Class to hold various Athena components. -class AthenaComps { +class AthenaComps : public AthMessaging { public: AthenaComps(const std::string & msgStreamName); - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - void setDetStore(StoreGateSvc *); void setGeoDbTagSvc(IGeoDbTagSvc *); void setRDBAccessSvc(IRDBAccessSvc *); @@ -39,9 +33,6 @@ public: IGeometryDBSvc * geomDB() const; private: - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - StoreGateSvc * m_detStore; IGeoDbTagSvc * m_geoDbTagSvc; IRDBAccessSvc * m_rdbAccessSvc; diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloMaterialManager.h b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloMaterialManager.h index 687c22bad..e5ff34786 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloMaterialManager.h +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/CaloMaterialManager.h @@ -6,7 +6,7 @@ #define CALOMATERIALMANAGER_H // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #include "RDBAccessSvc/IRDBAccessSvc.h" class GeoMaterial; @@ -30,7 +30,7 @@ namespace CaloDD /// materials with a density such that the the total weight is correct. -class CaloMaterialManager +class CaloMaterialManager : public AthMessaging { public: @@ -60,7 +60,7 @@ public: const GeoMaterial* getMaterial(const std::string & materialName); /// Get element from GeoModel material manager - const GeoElement* getElement(const std::string & elementName) const; + const GeoElement* getElement(const std::string & elementName); /// Create and get material with a specified density based on an existing material. /// If a newName is supplied it creates the new material even if the orginal material @@ -129,13 +129,6 @@ public: /// Add material void addMaterial(GeoMaterial *material); - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl){ return m_msg.get().level() <= lvl; } - - private: class MaterialByWeight { @@ -190,7 +183,7 @@ private: void addWeightTableOld(IRDBRecordset_ptr weightTable, const std::string & space); // Internal versions. The public versions allow materials to be have extra scaling. - const GeoMaterial* getMaterialInternal(const std::string & materialName) const; + const GeoMaterial* getMaterialInternal(const std::string & materialName); const GeoMaterial* getMaterialInternal(const std::string & origMaterialName, double density, const std::string & newName = ""); @@ -230,9 +223,6 @@ private: typedef std::map<std::string, double > ExtraScaleFactorMap; ExtraScaleFactorMap m_scalingMap; - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - // Has linear weight flag. bool m_extraFunctionality; diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/DetectorFactoryBase.h b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/DetectorFactoryBase.h index a344e2668..613e3204b 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/DetectorFactoryBase.h +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/CaloGeoModelUtils/DetectorFactoryBase.h @@ -5,7 +5,6 @@ #ifndef CaloGeoModelUtils_DetectorFactoryBase_H #define CaloGeoModelUtils_DetectorFactoryBase_H -#include "AthenaKernel/MsgStreamMember.h" #include "GeoModelKernel/GeoVDetectorFactory.h" #include "CaloGeoModelUtils/CaloDDAthenaComps.h" @@ -15,7 +14,7 @@ class IRDBAccessSvc; namespace CaloDD { -class DetectorFactoryBase : public GeoVDetectorFactory +class DetectorFactoryBase : public GeoVDetectorFactory { public: @@ -31,12 +30,6 @@ public: IGeometryDBSvc * geomDB() const {return m_athenaComps->geomDB();} - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_athenaComps->msg(lvl); } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl) const { return m_athenaComps->msgLvl(lvl); } - const CaloDD::AthenaComps * getAthenaComps() {return m_athenaComps;} private: diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloDDAthenaComps.cxx b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloDDAthenaComps.cxx index 969b5832a..ac5c7b139 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloDDAthenaComps.cxx +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloDDAthenaComps.cxx @@ -6,7 +6,7 @@ namespace CaloDD { AthenaComps::AthenaComps(const std::string& msgStreamName) - : m_msg(msgStreamName), + : AthMessaging(msgStreamName), m_detStore(0), m_geoDbTagSvc(0), m_rdbAccessSvc(0), diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloMaterialManager.cxx b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloMaterialManager.cxx index 5f00bbd32..ac7847ece 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloMaterialManager.cxx +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/CaloMaterialManager.cxx @@ -23,8 +23,8 @@ // Constructor CaloMaterialManager::CaloMaterialManager(const std::string& managerName, StoreGateSvc* detStore) - : m_managerName(managerName), - m_msg(managerName), + : AthMessaging {managerName}, + m_managerName(managerName), m_extraFunctionality(false), m_athenaComps(0) { m_materialManager = retrieveManager(detStore); @@ -36,8 +36,8 @@ CaloMaterialManager::CaloMaterialManager(const std::string& managerName, IRDBRecordset_ptr weightTable, const std::string& space, bool extraFunctionality) - : m_managerName(managerName), - m_msg(managerName), + : AthMessaging {managerName}, + m_managerName(managerName), m_extraFunctionality(extraFunctionality), m_athenaComps(0) { m_materialManager = retrieveManager(detStore); @@ -55,8 +55,8 @@ CaloMaterialManager::CaloMaterialManager(const std::string& managerName, StoreGa IRDBRecordset_ptr weightTable, IRDBRecordset_ptr compositionTable, const std::string& space) - : m_managerName(managerName), - m_msg(managerName), + : AthMessaging {managerName}, + m_managerName(managerName), m_extraFunctionality(true), m_athenaComps(0) { m_materialManager = retrieveManager(detStore); @@ -67,8 +67,8 @@ CaloMaterialManager::CaloMaterialManager(const std::string& managerName, StoreGa CaloMaterialManager::CaloMaterialManager(const std::string& managerName, const CaloDD::AthenaComps* athenaComps) - : m_managerName(managerName), - m_msg(managerName), + : AthMessaging {managerName}, + m_managerName(managerName), m_extraFunctionality(true), m_athenaComps(athenaComps) { m_materialManager = retrieveManager(athenaComps->detStore()); @@ -85,17 +85,17 @@ CaloMaterialManager::~CaloMaterialManager() { const AbsMaterialManager* CaloMaterialManager::retrieveManager(StoreGateSvc* detStore) { - const StoredMaterialManager* theGeoMaterialManager = nullptr; - - if (StatusCode::SUCCESS != detStore->retrieve(theGeoMaterialManager, "MATERIALS")) { - msg(MSG::FATAL) << "Cannot locate Materials"; - } - - return theGeoMaterialManager; + return detStore->tryRetrieve<StoredMaterialManager>("MATERIALS"); } const GeoElement* -CaloMaterialManager::getElement(const std::string& elementName) const { +CaloMaterialManager::getElement(const std::string& elementName) { + if(!m_materialManager) { + std::string errorMessage("Null pointer to Stored Material Manager!"); + ATH_MSG_FATAL(errorMessage); + throw std::runtime_error(errorMessage); + } + return m_materialManager->getElement(elementName); } @@ -110,7 +110,7 @@ CaloMaterialManager::hasMaterial(const std::string& materialName) const { } const GeoMaterial* -CaloMaterialManager::getMaterialInternal(const std::string& materialName) const { +CaloMaterialManager::getMaterialInternal(const std::string& materialName) { // First check local store of materials. If not found then get it from the GeoModel // manager. const GeoMaterial* material = getAdditionalMaterial(materialName); @@ -143,9 +143,9 @@ CaloMaterialManager::getCompositeMaterialForVolume(const std::string& newMatName baseMaterials.reserve(2); fracWeight.reserve(2); - msg(MSG::DEBUG) << "Composite material : " << volumeTot / Gaudi::Units::cm3 << " = " << volume1 / Gaudi::Units::cm3 << " + " << - volume2 / Gaudi::Units::cm3 << endmsg; - msg(MSG::DEBUG) << "Composite material : " << matName1 << " " << matName2 << endmsg; + ATH_MSG_DEBUG("Composite material : " << volumeTot / Gaudi::Units::cm3 << " = " << volume1 / Gaudi::Units::cm3 << " + " << + volume2 / Gaudi::Units::cm3); + ATH_MSG_DEBUG("Composite material : " << matName1 << " " << matName2 ); double density1, density2; @@ -153,21 +153,21 @@ CaloMaterialManager::getCompositeMaterialForVolume(const std::string& newMatName if ((iter = m_weightMap.find(matName1)) != m_weightMap.end()) { const GeoMaterial* mat1 = getMaterialForVolume(matName1, volume1); density1 = mat1->getDensity(); - msg(MSG::DEBUG) << "Composite material 1 - weight : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + ATH_MSG_DEBUG("Composite material 1 - weight : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); } else { const GeoMaterial* mat1 = getMaterial(matName1); density1 = mat1->getDensity(); - msg(MSG::DEBUG) << "Composite material 1 - standard : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + ATH_MSG_DEBUG("Composite material 1 - standard : " << density1 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); } if ((iter = m_weightMap.find(matName2)) != m_weightMap.end()) { const GeoMaterial* mat2 = getMaterialForVolume(matName2, volume2); density2 = mat2->getDensity(); - msg(MSG::DEBUG) << "Composite material 2 - weight : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + ATH_MSG_DEBUG("Composite material 2 - weight : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); } else { const GeoMaterial* mat2 = getMaterial(matName2); density2 = mat2->getDensity(); - msg(MSG::DEBUG) << "Composite material 2 - standard : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + ATH_MSG_DEBUG("Composite material 2 - standard : " << density2 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); } double weight1 = density1 * volume1; @@ -180,9 +180,9 @@ CaloMaterialManager::getCompositeMaterialForVolume(const std::string& newMatName double frac2 = weight2 / (weight1 + weight2); double density_2 = 1.0 / (frac1 / density1 + frac2 / density2); double density_3 = (weight1 + weight2) / (volume1 + volume2); - msg(MSG::DEBUG) << "-> weights : " << weight1 / (GeoModelKernelUnits::gram) << " " << weight2 / (GeoModelKernelUnits::gram) << endmsg; - msg(MSG::DEBUG) << "-> density : " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << " " << density_2 / - (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << " " << density_3 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + ATH_MSG_DEBUG("-> weights : " << weight1 / (GeoModelKernelUnits::gram) << " " << weight2 / (GeoModelKernelUnits::gram) ); + ATH_MSG_DEBUG("-> density : " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << " " << density_2 / + (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << " " << density_3 / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); baseMaterials.push_back(matName1); @@ -228,9 +228,9 @@ CaloMaterialManager::getMaterialInternal(const std::string& origMaterialName, const GeoMaterial* material = getAdditionalMaterial(newName2); if (material) { if (!compareDensity(material->getDensity(), density)) { - msg(MSG::WARNING) << "Density is not consistent for material " << newName2 + ATH_MSG_WARNING("Density is not consistent for material " << newName2 << " " << material->getDensity() / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) - << " / " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) << endmsg; + << " / " << density / (GeoModelKernelUnits::gram / Gaudi::Units::cm3) ); } newMaterial = material; } else { @@ -265,7 +265,7 @@ CaloMaterialManager::getMaterialScaledInternal(const std::string& origMaterialNa const std::string& newName) { // Don't allow large scale factors if (scaleFactor > 1000 || scaleFactor < 0.001) { - msg(MSG::ERROR) << "Scale factor must be between 0.001 and 1000." << endmsg; + ATH_MSG_ERROR("Scale factor must be between 0.001 and 1000." ); return 0; } @@ -301,7 +301,7 @@ void CaloMaterialManager::addMaterial(GeoMaterial* material) { std::string name(material->getName()); if (m_store.find(name) != m_store.end()) { - msg(MSG::WARNING) << "Ignoring attempt to redefine an existing material: " << name << endmsg; + ATH_MSG_WARNING("Ignoring attempt to redefine an existing material: " << name ); // Delete the material if it is not already ref counted. material->ref(); material->unref(); @@ -311,8 +311,8 @@ CaloMaterialManager::addMaterial(GeoMaterial* material) { material->ref(); m_store[name] = material; - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Created new material: " << name << ", " << material->getDensity() / - (Gaudi::Units::g / Gaudi::Units::cm3) << " g/cm3" << endmsg; + ATH_MSG_DEBUG("Created new material: " << name << ", " << material->getDensity() / + (Gaudi::Units::g / Gaudi::Units::cm3) << " g/cm3" ); } } @@ -323,10 +323,10 @@ CaloMaterialManager::compareDensity(double d1, double d2) const { void CaloMaterialManager::addWeightTable(IRDBRecordset_ptr weightTable, const std::string& space) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading in weight table: " << weightTable->nodeName() << endmsg; + ATH_MSG_DEBUG("Reading in weight table: " << weightTable->nodeName() ); // If not using geometryDBSvc revert to old version if (!db()) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "GeometryDBSvc not available. Using old version." << endmsg; + ATH_MSG_DEBUG("GeometryDBSvc not available. Using old version." ); addWeightTableOld(weightTable, space); return; } @@ -348,14 +348,14 @@ CaloMaterialManager::addWeightTable(IRDBRecordset_ptr weightTable, const std::st } if (m_weightMap.find(materialName) != m_weightMap.end()) { - msg(MSG::WARNING) << "Material: " << materialName << " already exists in weight table" << endmsg; + ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table" ); } else { - msg(MSG::DEBUG) << "Adding " << materialName + ATH_MSG_DEBUG("Adding " << materialName << " weight " << weight << " linearWeightFlag " << linearWeightFlag << " raw weight " << db()->getDouble(weightTable, "WEIGHT", i) << " m_extraFunctionality " << m_extraFunctionality - << " to weight table" << endmsg; + << " to weight table" ); m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag); } } @@ -368,12 +368,12 @@ CaloMaterialManager::addWeightMaterial(std::string materialName, std::string mat weight = weight * GeoModelKernelUnits::gram; if (m_weightMap.find(materialName) != m_weightMap.end()) { - msg(MSG::WARNING) << "Material: " << materialName << " already exists in weight table" << endmsg; + ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table" ); } else { - msg(MSG::DEBUG) << "Adding " << materialName + ATH_MSG_DEBUG("Adding " << materialName << " weight " << weight << " linearWeightFlag " << linearWeightFlag - << " to weight table" << endmsg; + << " to weight table" ); m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag); } } @@ -399,7 +399,7 @@ CaloMaterialManager::addWeightTableOld(IRDBRecordset_ptr weightTable, const std: } if (m_weightMap.find(materialName) != m_weightMap.end()) { - msg(MSG::WARNING) << "Material: " << materialName << " already exists in weight table" << endmsg; + ATH_MSG_WARNING("Material: " << materialName << " already exists in weight table" ); } else { m_weightMap[materialName] = MaterialByWeight(materialBase, weight, linearWeightFlag); } @@ -408,10 +408,10 @@ CaloMaterialManager::addWeightTableOld(IRDBRecordset_ptr weightTable, const std: void CaloMaterialManager::addCompositionTable(IRDBRecordset_ptr compositionTable, const std::string& space) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading in composition table: " << compositionTable->nodeName() << endmsg; + ATH_MSG_DEBUG("Reading in composition table: " << compositionTable->nodeName() ); if (!db()) { - msg(MSG::ERROR) << "GeometryDBSvc not available. Unable to read in composition table." << endmsg; + ATH_MSG_ERROR("GeometryDBSvc not available. Unable to read in composition table." ); } for (unsigned int i = 0; i < db()->getTableSize(compositionTable); i++) { std::string materialName = db()->getString(compositionTable, "MATERIAL", i); @@ -437,26 +437,22 @@ CaloMaterialManager::addScalingTable(IRDBRecordset_ptr scalingTable) { if (db()->getTableSize(scalingTable) == 0) return; - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Reading in extra material scaling table: " << scalingTable->nodeName() << - endmsg; + ATH_MSG_DEBUG("Reading in extra material scaling table: " << scalingTable->nodeName() ); if (!db()) { - msg(MSG::ERROR) << "GeometryDBSvc not available. Unable to read in scaling table." << endmsg; + ATH_MSG_ERROR("GeometryDBSvc not available. Unable to read in scaling table." ); } for (unsigned int i = 0; i < db()->getTableSize(scalingTable); i++) { std::string materialName = db()->getString(scalingTable, "MATERIAL", i); double scalingFactor = db()->getDouble(scalingTable, "FACTOR", i); - if (msgLvl(MSG::DEBUG)) { - if (scalingFactor >= 0 || scalingFactor == 1) { - msg(MSG::DEBUG) << "Material " << materialName << " will be scaled by: " << scalingFactor << endmsg; - } else { - // -ve or scalefactor = 1 means will not be scaled. - msg(MSG::DEBUG) << "Material " << materialName << " will be NOT be scaled." << endmsg; - } + if (scalingFactor >= 0 || scalingFactor == 1) { + ATH_MSG_DEBUG("Material " << materialName << " will be scaled by: " << scalingFactor ); + } else { + // -ve or scalefactor = 1 means will not be scaled. + ATH_MSG_DEBUG("Material " << materialName << " will be NOT be scaled." ); } if (m_scalingMap.find(materialName) != m_scalingMap.end()) { - msg(MSG::WARNING) << "Overriding material: " << materialName << " which already exists in scaling table" << - endmsg; + ATH_MSG_WARNING("Overriding material: " << materialName << " which already exists in scaling table" ); } m_scalingMap[materialName] = scalingFactor; } @@ -466,7 +462,7 @@ const GeoMaterial* CaloMaterialManager::getMaterialForVolume(const std::string& materialName, double volume, const std::string& newName) { // Make sure we have a valid volume size. if (volume <= 0) { - msg(MSG::ERROR) << "Invalid volume : " << volume << endmsg; + ATH_MSG_ERROR("Invalid volume : " << volume ); return 0; } @@ -486,20 +482,15 @@ CaloMaterialManager::getMaterialForVolume(const std::string& materialName, doubl double weight = iter->second.weight; double density = weight / volume; if (iter->second.linearWeightFlag) { - msg(MSG::ERROR) << "Material defined by linear weight cannot be created with getMaterialForVolume method: " << - materialName << endmsg; + ATH_MSG_ERROR("Material defined by linear weight cannot be created with getMaterialForVolume method: " << materialName ); } - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) - << - "Found material in weight table - name, base, weight(g), volume(cm3), density(g/cm3): " - << materialName << ", " - << materialBase << ", " - << weight / GeoModelKernelUnits::gram << ", " - << volume / Gaudi::Units::cm3 << ", " - << density / (Gaudi::Units::g / Gaudi::Units::cm3) << endmsg; - } + ATH_MSG_VERBOSE("Found material in weight table - name, base, weight(g), volume(cm3), density(g/cm3): " + << materialName << ", " + << materialBase << ", " + << weight / GeoModelKernelUnits::gram << ", " + << volume / Gaudi::Units::cm3 << ", " + << density / (Gaudi::Units::g / Gaudi::Units::cm3) ); if (materialBase.empty()) { return getMaterial(materialName, density, newName); @@ -513,12 +504,10 @@ CaloMaterialManager::getMaterialForVolume(const std::string& materialName, doubl } else { // If not in the weight table we just return the material. // This is not an error. - if (msgLvl(MSG::VERBOSE)) - msg(MSG::VERBOSE) - << "Material not in weight table, using standard material: " - << materialName - << ", volume(cm3) = " << volume / Gaudi::Units::cm3 - << endmsg; + ATH_MSG_VERBOSE( + "Material not in weight table, using standard material: " + << materialName + << ", volume(cm3) = " << volume / Gaudi::Units::cm3 ); return getMaterial(materialName); } } @@ -543,7 +532,7 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& materialName, // Make sure we have a valid volume size. if (volume <= 0 || length <= 0) { - msg(MSG::ERROR) << "Invalid volume or length : " << volume << ", " << length << endmsg; + ATH_MSG_ERROR("Invalid volume or length : " << volume << ", " << length ); return 0; } @@ -551,10 +540,7 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& materialName, std::pair<MaterialCompositionMap::const_iterator, MaterialCompositionMap::const_iterator> iterRange; iterRange = m_matCompositionMap.equal_range(materialName); if (iterRange.first != m_matCompositionMap.end()) { - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) - << "Found material in material composition table:" << materialName << endmsg; - } + ATH_MSG_VERBOSE("Found material in material composition table:" << materialName ); std::vector<double> factors; std::vector<std::string> components; @@ -583,12 +569,10 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& materialName, } else { // Otherwise we just return the material. // This is not an error. - if (msgLvl(MSG::VERBOSE)) - msg(MSG::VERBOSE) - << "Material not in weight table, using standard material: " - << materialName - << ", volume(cm3) = " << volume / Gaudi::Units::cm3 - << endmsg; + ATH_MSG_VERBOSE( + "Material not in weight table, using standard material: " + << materialName + << ", volume(cm3) = " << volume / Gaudi::Units::cm3 ); return getMaterial(materialName); } } @@ -612,13 +596,12 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& name, double length) { // Make sure we have a valid volume size. if (volume <= 0 || length <= 0) { - msg(MSG::ERROR) << "Invalid volume or length : " << volume << ", " << length << endmsg; + ATH_MSG_ERROR("Invalid volume or length : " << volume << ", " << length ); return 0; } if (!factors.empty() && factors.size() < materialComponents.size()) { - msg(MSG::WARNING) << "getMaterialForVolumeLength: factor vector size too small. Setting remaining factors to 1." << - endmsg; + ATH_MSG_WARNING("getMaterialForVolumeLength: factor vector size too small. Setting remaining factors to 1." ); } std::vector<std::string> baseMaterials; @@ -639,12 +622,12 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& name, if (iComp < factors.size()) { weight *= factors[iComp]; } - msg(MSG::DEBUG) << "Material " << materialName + ATH_MSG_DEBUG("Material " << materialName << " found in weight table, weight " << iter->second.weight / GeoModelKernelUnits::gram << " factor " << factors[iComp] << " w*fac*len " << weight * length / GeoModelKernelUnits::gram << " basMat " << materialBase - << " linear? " << iter->second.linearWeightFlag << endmsg; + << " linear? " << iter->second.linearWeightFlag ); if (iter->second.linearWeightFlag) weight *= length; if (materialBase.empty()) { @@ -678,12 +661,10 @@ CaloMaterialManager::getMaterialForVolumeLength(const std::string& name, } } - if (msgLvl(MSG::VERBOSE)) { - msg(MSG::VERBOSE) << "Creating material from multiple components: " << name << endmsg; - for (unsigned int i = 0; i < materialComponents.size(); ++i) { - msg(MSG::VERBOSE) << " Component " << i << ": Name = " << baseMaterials[i] - << " Weight(g) = " << fracWeight[i] / Gaudi::Units::g << endmsg; - } + ATH_MSG_VERBOSE("Creating material from multiple components: " << name ); + for (unsigned int i = 0; i < materialComponents.size(); ++i) { + ATH_MSG_VERBOSE(" Component " << i << ": Name = " << baseMaterials[i] + << " Weight(g) = " << fracWeight[i] / Gaudi::Units::g ); } for (unsigned int i = 0; i < fracWeight.size(); ++i) { @@ -754,7 +735,7 @@ CaloMaterialManager::getMaterialInternal(const std::string& name, if (material) { if (!compareDensity(material->getDensity(), density)) { - msg(MSG::WARNING) << "Density is not consistent for material " << name << endmsg; + ATH_MSG_WARNING("Density is not consistent for material " << name ); } newMaterial = material; } else { @@ -764,7 +745,7 @@ CaloMaterialManager::getMaterialInternal(const std::string& name, if (origMaterial) { newMaterialTmp->add(const_cast<GeoMaterial*>(origMaterial), fracWeight[i]); } else { - msg(MSG::ERROR) << "Material component missing " << materialComponents[i] << endmsg; + ATH_MSG_ERROR("Material component missing " << materialComponents[i] ); } } addMaterial(newMaterialTmp); @@ -792,7 +773,7 @@ CaloMaterialManager::addTextFileMaterials() { || !db()->testField("", "TableSize:" + componentsTable) || !db()->getTableSize(componentsTable)) return; - msg(MSG::INFO) << "Extra materials being read in from text file." << endmsg; + ATH_MSG_INFO("Extra materials being read in from text file." ); typedef std::map<std::string, MaterialDef> MatMap; MatMap materials; @@ -813,8 +794,8 @@ CaloMaterialManager::addTextFileMaterials() { if (iter != materials.end()) { iter->second.addComponent(compName, fracWeight); } else { - msg(MSG::ERROR) << "Attemp to add material component, " << compName << ", to non-existing material: " << - materialName << endmsg; + ATH_MSG_ERROR("Attempt to add material component, " << compName << ", to non-existing material: " << + materialName ); } } @@ -857,14 +838,14 @@ CaloMaterialManager::addTextFileMaterials() { if (someUndefined) { - msg(MSG::ERROR) << "Not all materials could be defined due to cyclic definitions" << endmsg; + ATH_MSG_ERROR("Not all materials could be defined due to cyclic definitions" ); } } void CaloMaterialManager::createMaterial(const MaterialDef& material) { if (material.numComponents() == 0) { - msg(MSG::ERROR) << "Material has no components: " << material.name() << endmsg; + ATH_MSG_ERROR("Material has no components: " << material.name() ); return; } @@ -876,16 +857,16 @@ CaloMaterialManager::createMaterial(const MaterialDef& material) { for (unsigned int i = 0; i < material.numComponents(); i++) { if (material.compName(i).find("::") != std::string::npos) { // If component name has "::" in it then its not an element. - msg(MSG::ERROR) << "Material, " << material.name() + ATH_MSG_ERROR("Material, " << material.name() << ", is assumed to be defined by atomic ratio (due to total fraction > 1) but component is not an element: " - << material.compName(i) << endmsg; + << material.compName(i) ); return; } const GeoElement* element = getElement(material.compName(i)); if (!element) { - msg(MSG::ERROR) << "Error making material " << material.name() << ". Element not found: " << - material.compName(i) << endmsg; + ATH_MSG_ERROR("Error making material " << material.name() << ". Element not found: " << + material.compName(i) ); return; } totWeight += material.fraction(i) * element->getA(); @@ -893,22 +874,20 @@ CaloMaterialManager::createMaterial(const MaterialDef& material) { } else { // Check if total fraction is close to 1. if (std::abs(totWeight - 1) > 0.01) { - msg(MSG::WARNING) << "Total fractional weight does not sum to 1. Will renormalize. Total = " << totWeight << - endmsg; + ATH_MSG_WARNING("Total fractional weight does not sum to 1. Will renormalize. Total = " << totWeight ); } } // Now build the material GeoMaterial* newMaterial = new GeoMaterial(material.name(), material.density()); - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Creating material: " << material.name() - << " with density: " << material.density() / (Gaudi::Units::g / Gaudi::Units::cm3) << - endmsg; + ATH_MSG_DEBUG("Creating material: " << material.name() + << " with density: " << material.density() / (Gaudi::Units::g / Gaudi::Units::cm3) ); for (unsigned int i = 0; i < material.numComponents(); i++) { double fracWeight = material.fraction(i) / totWeight; if (material.compName(i).find("::") == std::string::npos) { const GeoElement* element = getElement(material.compName(i)); if (!element) { - msg(MSG::ERROR) << "Error making material " << material.name() << ". Element not found: " << - material.compName(i) << endmsg; + ATH_MSG_ERROR("Error making material " << material.name() << ". Element not found: " << + material.compName(i) ); // delete the partially created material newMaterial->ref(); newMaterial->unref(); @@ -918,12 +897,12 @@ CaloMaterialManager::createMaterial(const MaterialDef& material) { fracWeight = material.fraction(i) * element->getA() / totWeight; } newMaterial->add(const_cast<GeoElement*>(element), fracWeight); - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Component: " << material.compName(i) << " " << fracWeight << endmsg; + ATH_MSG_ERROR("Component: " << material.compName(i) << " " << fracWeight ); } else { const GeoMaterial* materialTmp = getMaterialInternal(material.compName(i)); if (!materialTmp) { - msg(MSG::ERROR) << "Error making material " << material.name() << ". Component not found: " << - material.compName(i) << endmsg; + ATH_MSG_ERROR("Error making material " << material.name() << ". Component not found: " << + material.compName(i) ); // delete the partially created material newMaterial->ref(); newMaterial->unref(); @@ -931,10 +910,10 @@ CaloMaterialManager::createMaterial(const MaterialDef& material) { } if (byAtomicRatio) { // Should not happen as already checked that all components were elements. - msg(MSG::ERROR) << "Unexpected Error" << endmsg; + ATH_MSG_ERROR("Unexpected Error" ); } newMaterial->add(const_cast<GeoMaterial*>(materialTmp), fracWeight); - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " Component: " << material.compName(i) << " " << fracWeight << endmsg; + ATH_MSG_DEBUG("Component: " << material.compName(i) << " " << fracWeight ); } } newMaterial->lock(); diff --git a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/DistortedMaterialManager.cxx b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/DistortedMaterialManager.cxx index 1b10d0f25..e26575635 100644 --- a/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/DistortedMaterialManager.cxx +++ b/Calorimeter/CaloDetDescr/CaloGeoModelUtils/src/DistortedMaterialManager.cxx @@ -6,17 +6,17 @@ #include "CaloGeoModelUtils/DistortedMaterialManager.h" #include "GeoModelInterfaces/StoredMaterialManager.h" #include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" -#include "AthenaKernel/MsgStreamMember.h" #include "StoreGate/StoreGateSvc.h" #include "RDBAccessSvc/IRDBAccessSvc.h" #include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/Bootstrap.h" namespace CaloDD { DistortedMaterialManager::DistortedMaterialManager() { ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap - Athena::MsgStreamMember log("ExtraMaterialManager"); + MsgStream log(Athena::getMessageSvc(), "ExtraMaterialManager"); log << MSG::DEBUG << "Initialized Calo Distorted Material Manager" << endmsg; StoreGateSvc* detStore; diff --git a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloCommonItems.h b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloCommonItems.h index 51327ad88..b62a8a257 100644 --- a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloCommonItems.h +++ b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloCommonItems.h @@ -14,7 +14,7 @@ class FaserDetectorID; // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #include "CxxUtils/checker_macros.h" // #include "InDetCondTools/ISiLorentzAngleTool.h" #include "GeoPrimitives/GeoPrimitives.h" @@ -26,9 +26,6 @@ class FaserDetectorID; #include <mutex> -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace CaloDD { /** @class CaloCommonItems @@ -42,7 +39,7 @@ namespace CaloDD { modified: Dave Casper */ - class CaloCommonItems: public RCBase + class CaloCommonItems: public RCBase, public AthMessaging { public: @@ -52,18 +49,9 @@ namespace CaloDD { const FaserDetectorID* getIdHelper() const; // const HepGeom::Transform3D & solenoidFrame() const; // void setSolenoidFrame(const HepGeom::Transform3D & transform) const; - - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - + private: - - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - + const FaserDetectorID* m_idHelper; // mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; // Guarded by m_mutex diff --git a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloDetectorManagerBase.h b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloDetectorManagerBase.h index dde80dee4..b2fccf9ef 100644 --- a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloDetectorManagerBase.h +++ b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/CaloReadoutGeometry/CaloDetectorManagerBase.h @@ -19,7 +19,7 @@ #include "CaloReadoutGeometry/Version.h" #include "CLHEP/Geometry/Transform3D.h" // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" // IOV SVC for alignment: #include "AthenaKernel/IIOVSvc.h" @@ -41,9 +41,6 @@ class FaserDetectorID; class GeoVAlignmentStore; class CondAttrListCollection; -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace CaloDD { typedef std::map<std::string, const void*> RawAlignmentObjects; @@ -63,7 +60,7 @@ namespace CaloDD { @author: Grant Gorfine - modified & maintained: Nick Styles & Andreas Salzburger */ - class CaloDetectorManagerBase : public GeoVDetectorManager { + class CaloDetectorManagerBase : public GeoVDetectorManager, public AthMessaging { public: @@ -99,12 +96,6 @@ namespace CaloDD { /** Check identifier is for this detector */ virtual bool identifierBelongs(const Identifier & id) const = 0; - /** Declaring the Message method for further use */ - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - /** Declaring the Method providing Verbosity Level */ - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - AlignFolderType m_alignfoldertype; protected: @@ -188,8 +179,6 @@ namespace CaloDD { virtual const FaserDetectorID* getIdHelper() const = 0; //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - Version m_version; std::map<std::string, LevelInfo> m_keys; std::set<std::string> m_folders; diff --git a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloCommonItems.cxx b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloCommonItems.cxx index cc0eed376..0c9b97b00 100644 --- a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloCommonItems.cxx +++ b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloCommonItems.cxx @@ -7,7 +7,7 @@ namespace CaloDD { CaloCommonItems::CaloCommonItems(const FaserDetectorID* const idHelper) - : m_msg("CaloDetectorElement"), + : AthMessaging("CaloDetectorElement"), m_idHelper(idHelper), m_mutex{} {} diff --git a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloDetectorManagerBase.cxx b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloDetectorManagerBase.cxx index ca73b50ff..1c1b79368 100644 --- a/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloDetectorManagerBase.cxx +++ b/Calorimeter/CaloDetDescr/CaloReadoutGeometry/src/CaloDetectorManagerBase.cxx @@ -18,8 +18,9 @@ namespace CaloDD { CaloDetectorManagerBase::CaloDetectorManagerBase(StoreGateSvc * detStore, const std::string & name) - : m_alignfoldertype{none},m_detStore(detStore), - m_msg(name+"DetectorManager") + : AthMessaging(name+"DetectorManager") + , m_alignfoldertype{none} + , m_detStore(detStore) { setName(name); } diff --git a/DetectorDescription/FaserReadoutGeometry/FaserReadoutGeometry/FaserDetectorManager.h b/DetectorDescription/FaserReadoutGeometry/FaserReadoutGeometry/FaserDetectorManager.h index 2d6ecf125..24a817ae1 100644 --- a/DetectorDescription/FaserReadoutGeometry/FaserReadoutGeometry/FaserDetectorManager.h +++ b/DetectorDescription/FaserReadoutGeometry/FaserReadoutGeometry/FaserDetectorManager.h @@ -18,8 +18,7 @@ #include "FaserReadoutGeometry/FaserDD_Defs.h" #include "FaserReadoutGeometry/Version.h" #include "CLHEP/Geometry/Transform3D.h" -// Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" // IOV SVC for alignment: #include "AthenaKernel/IIOVSvc.h" @@ -58,7 +57,7 @@ namespace FaserDD { - modified & maintained: Nick Styles & Andreas Salzburger - adapted for FASER from InDetDetectorManager */ - class FaserDetectorManager : public GeoVDetectorManager { + class FaserDetectorManager : public GeoVDetectorManager, public AthMessaging { public: @@ -93,12 +92,6 @@ namespace FaserDD { /** Check identifier is for this detector */ virtual bool identifierBelongs(const Identifier & id) const = 0; - - /** Declaring the Message method for further use */ - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - /** Declaring the Method providing Verbosity Level */ - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } AlignFolderType m_alignfoldertype; @@ -177,9 +170,6 @@ namespace FaserDD { virtual const FaserDetectorID* getIdHelper() const = 0; - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - Version m_version; std::map<std::string, LevelInfo> m_keys; std::set<std::string> m_folders; diff --git a/DetectorDescription/FaserReadoutGeometry/src/FaserDetectorManager.cxx b/DetectorDescription/FaserReadoutGeometry/src/FaserDetectorManager.cxx index 053bf0d94..b0d1151a9 100644 --- a/DetectorDescription/FaserReadoutGeometry/src/FaserDetectorManager.cxx +++ b/DetectorDescription/FaserReadoutGeometry/src/FaserDetectorManager.cxx @@ -18,9 +18,10 @@ namespace FaserDD { FaserDetectorManager::FaserDetectorManager(StoreGateSvc * detStore, const std::string & name) - : m_alignfoldertype{none},m_detStore(detStore), - m_msg(name+"DetectorManager"), - m_suppressWarnings(false) + : AthMessaging{name + "DetectorManager"} + , m_alignfoldertype{none} + , m_detStore(detStore) + , m_suppressWarnings(false) { setName(name); } diff --git a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoCommonItems.h b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoCommonItems.h index ef57e62d0..d8cbe3054 100644 --- a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoCommonItems.h +++ b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoCommonItems.h @@ -14,7 +14,7 @@ class FaserDetectorID; // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #include "CxxUtils/checker_macros.h" // #include "InDetCondTools/ISiLorentzAngleTool.h" #include "GeoPrimitives/GeoPrimitives.h" @@ -26,9 +26,6 @@ class FaserDetectorID; #include <mutex> -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace NeutrinoDD { /** @class NeutrinoCommonItems @@ -42,7 +39,7 @@ namespace NeutrinoDD { modified: Dave Casper */ - class NeutrinoCommonItems: public RCBase + class NeutrinoCommonItems: public RCBase, public AthMessaging { public: @@ -53,17 +50,8 @@ namespace NeutrinoDD { // const HepGeom::Transform3D & solenoidFrame() const; // void setSolenoidFrame(const HepGeom::Transform3D & transform) const; - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - private: - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - const FaserDetectorID* m_idHelper; // mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; // Guarded by m_mutex diff --git a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoDetectorManagerBase.h b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoDetectorManagerBase.h index 8bce2c0e5..125e2d2e5 100644 --- a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoDetectorManagerBase.h +++ b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/NeutrinoReadoutGeometry/NeutrinoDetectorManagerBase.h @@ -19,7 +19,7 @@ #include "NeutrinoReadoutGeometry/Version.h" #include "CLHEP/Geometry/Transform3D.h" // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" // IOV SVC for alignment: #include "AthenaKernel/IIOVSvc.h" @@ -41,9 +41,6 @@ class FaserDetectorID; class GeoVAlignmentStore; class CondAttrListCollection; -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace NeutrinoDD { typedef std::map<std::string, const void*> RawAlignmentObjects; @@ -63,7 +60,7 @@ namespace NeutrinoDD { @author: Grant Gorfine - modified & maintained: Nick Styles & Andreas Salzburger */ - class NeutrinoDetectorManagerBase : public GeoVDetectorManager { + class NeutrinoDetectorManagerBase : public GeoVDetectorManager, public AthMessaging { public: @@ -99,12 +96,6 @@ namespace NeutrinoDD { /** Check identifier is for this detector */ virtual bool identifierBelongs(const Identifier & id) const = 0; - /** Declaring the Message method for further use */ - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - /** Declaring the Method providing Verbosity Level */ - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - AlignFolderType m_alignfoldertype; protected: @@ -187,9 +178,6 @@ namespace NeutrinoDD { virtual const FaserDetectorID* getIdHelper() const = 0; - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - Version m_version; std::map<std::string, LevelInfo> m_keys; std::set<std::string> m_folders; diff --git a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoCommonItems.cxx b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoCommonItems.cxx index 87ec9c5b1..42ad5dfb2 100644 --- a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoCommonItems.cxx +++ b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoCommonItems.cxx @@ -7,9 +7,9 @@ namespace NeutrinoDD { NeutrinoCommonItems::NeutrinoCommonItems(const FaserDetectorID* const idHelper) - : m_msg("NeutrinoDetectorElement"), - m_idHelper(idHelper), - m_mutex{} + : AthMessaging("NeutrinoDetectorElement") + , m_idHelper(idHelper) + , m_mutex{} {} // void diff --git a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoDetectorManagerBase.cxx b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoDetectorManagerBase.cxx index 5048b8422..4fb421407 100644 --- a/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoDetectorManagerBase.cxx +++ b/Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry/src/NeutrinoDetectorManagerBase.cxx @@ -18,8 +18,9 @@ namespace NeutrinoDD { NeutrinoDetectorManagerBase::NeutrinoDetectorManagerBase(StoreGateSvc * detStore, const std::string & name) - : m_alignfoldertype{none},m_detStore(detStore), - m_msg(name+"DetectorManager") + : AthMessaging{name + "DetectorManager"} + , m_alignfoldertype{none} + , m_detStore(detStore) { setName(name); } diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintCommonItems.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintCommonItems.h index 9bdee5c23..c518d5117 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintCommonItems.h +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintCommonItems.h @@ -14,7 +14,7 @@ class FaserDetectorID; // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #include "CxxUtils/checker_macros.h" // #include "InDetCondTools/ISiLorentzAngleTool.h" #include "GeoPrimitives/GeoPrimitives.h" @@ -26,9 +26,6 @@ class FaserDetectorID; #include <mutex> -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace ScintDD { /** @class ScintCommonItems @@ -42,7 +39,7 @@ namespace ScintDD { modified: Dave Casper */ - class ScintCommonItems: public RCBase + class ScintCommonItems: public RCBase , public AthMessaging { public: @@ -53,17 +50,8 @@ namespace ScintDD { // const HepGeom::Transform3D & solenoidFrame() const; // void setSolenoidFrame(const HepGeom::Transform3D & transform) const; - //Declaring the Message method for further use - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - //Declaring the Method providing Verbosity Level - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - private: - - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - + const FaserDetectorID* m_idHelper; // mutable HepGeom::Transform3D m_solenoidFrame ATLAS_THREAD_SAFE; // Guarded by m_mutex diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManagerBase.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManagerBase.h index 4357da297..75a06f3e4 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManagerBase.h +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManagerBase.h @@ -19,7 +19,7 @@ #include "ScintReadoutGeometry/Version.h" #include "CLHEP/Geometry/Transform3D.h" // Message Stream Member -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" // IOV SVC for alignment: #include "AthenaKernel/IIOVSvc.h" @@ -41,9 +41,6 @@ class FaserDetectorID; class GeoVAlignmentStore; class CondAttrListCollection; -// mutable Athena::MsgStreamMember issues warnings. -ATLAS_NO_CHECK_FILE_THREAD_SAFETY; - namespace ScintDD { typedef std::map<std::string, const void*> RawAlignmentObjects; @@ -63,7 +60,7 @@ namespace ScintDD { @author: Grant Gorfine - modified & maintained: Nick Styles & Andreas Salzburger */ - class ScintDetectorManagerBase : public GeoVDetectorManager { + class ScintDetectorManagerBase : public GeoVDetectorManager, public AthMessaging { public: @@ -99,12 +96,6 @@ namespace ScintDD { /** Check identifier is for this detector */ virtual bool identifierBelongs(const Identifier & id) const = 0; - /** Declaring the Message method for further use */ - MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } - - /** Declaring the Method providing Verbosity Level */ - bool msgLvl (MSG::Level lvl) const { return m_msg.get().level() <= lvl; } - AlignFolderType m_alignfoldertype; protected: @@ -187,9 +178,6 @@ namespace ScintDD { virtual const FaserDetectorID* getIdHelper() const = 0; - //Declaring private message stream member. - mutable Athena::MsgStreamMember m_msg; - Version m_version; std::map<std::string, LevelInfo> m_keys; std::set<std::string> m_folders; diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintCommonItems.cxx b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintCommonItems.cxx index 2f8465d40..eb1e02a32 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintCommonItems.cxx +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintCommonItems.cxx @@ -7,7 +7,7 @@ namespace ScintDD { ScintCommonItems::ScintCommonItems(const FaserDetectorID* const idHelper) - : m_msg("ScintDetectorElement"), + : AthMessaging("ScintDetectorElement"), m_idHelper(idHelper), m_mutex{} {} diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorManagerBase.cxx b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorManagerBase.cxx index 43d4fb3f3..70080b387 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorManagerBase.cxx +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorManagerBase.cxx @@ -18,8 +18,9 @@ namespace ScintDD { ScintDetectorManagerBase::ScintDetectorManagerBase(StoreGateSvc * detStore, const std::string & name) - : m_alignfoldertype{none},m_detStore(detStore), - m_msg(name+"DetectorManager") + : AthMessaging {name + "DetectorManager"} + , m_alignfoldertype{none} + , m_detStore(detStore) { setName(name); } diff --git a/package_filters.txt b/package_filters.txt index fd3e26a3b..e9ee3e7f9 100644 --- a/package_filters.txt +++ b/package_filters.txt @@ -1,4 +1,6 @@ ++Calorimeter/CaloDetDescr/CaloGeoModelUtils ++Calorimeter/CaloDetDescr/CaloReadoutGeometry +Calorimeter/CaloDetDescr/FaserCaloIdentifier +Calorimeter/CaloRecTools -Calorimeter/.* @@ -12,6 +14,7 @@ +Derivation/.* +DetectorDescription/DetDescrCnvSvc +DetectorDescription/FaserDetDescr ++DetectorDescription/FaserReadoutGeometry +DetectorDescription/GeoModel/GeoModelFaserUtilities +DetectorDescription/GeoModel/GeoModelInterfaces -DetectorDescription/.* @@ -29,9 +32,11 @@ -MagneticField/.* -Monitoring +Neutrino/NeutrinoDetDescr/NeutrinoIdentifier ++Neutrino/NeutrinoDetDescr/NeutrinoReadoutGeometry -Neutrino/.* -PhysicsAnalysis/.* +Scintillator/ScintDetDescr/ScintIdentifier ++Scintillator/ScintDetDescr/ScintReadoutGeometry -Scintillator/.* #+Simulation/G4Extensions/Pythia8Decayer #+Simulation/G4Faser/G4FaserAlg -- GitLab