From aad08c31a832b14541ca91784ce43a0342288651 Mon Sep 17 00:00:00 2001 From: Nicolas Koehler <nicolas.koehler@cern.ch> Date: Thu, 11 Jun 2020 09:32:08 +0000 Subject: [PATCH] Use MuonIdHelperSvc in athena components --- .../MuonTrackingGeometry/MuonStationBuilder.h | 48 +--- .../src/MuonStationBuilder.cxx | 247 ++++++++---------- .../MM_Digitization/MM_DigitToolOutput.h | 4 +- .../MM_Digitization/MM_Response_DigitTool.h | 18 +- .../src/MM_Response_DigitTool.cxx | 22 +- .../src/MM_FastDigitizer.cxx | 1 - .../sTGC_Digitization/sTgcVMMSim.h | 3 +- .../src/ProjectionMMClusterBuilderTool.cxx | 34 +-- .../src/SimpleMMClusterBuilderTool.cxx | 25 +- .../src/SimpleMMClusterBuilderTool.h | 23 +- .../G4AtlasTests/src/MMHitsTestTool.cxx | 3 +- .../G4AtlasTests/src/MuonHitTestToolBase.h | 6 +- .../G4AtlasTests/src/sTGCHitsTestTool.cxx | 3 +- .../Tools/HitAnalysis/src/MMHitAnalysis.cxx | 3 +- .../Tools/HitAnalysis/src/sTGCHitAnalysis.cxx | 3 +- .../TrigT1NSWSimTools/PadOfflineData.h | 3 +- .../TrigT1NSWSimTools/PadTdsOfflineTool.h | 4 +- .../PadTriggerLogicOfflineTool.h | 23 +- .../TrigT1NSWSimTools/PadTriggerLookupTool.h | 23 +- .../StripClusterOfflineData.h | 3 +- .../TrigT1NSWSimTools/StripClusterTool.h | 17 +- .../TrigT1NSWSimTools/StripSegmentTool.h | 22 +- .../TrigT1NSWSimTools/StripTdsOfflineTool.h | 15 +- .../src/PadTdsOfflineTool.cxx | 2 - .../src/PadTriggerLogicOfflineTool.cxx | 50 +--- .../src/PadTriggerLookupTool.cxx | 64 ++--- .../src/StripClusterTool.cxx | 34 +-- .../src/StripSegmentTool.cxx | 29 +- .../src/StripTdsOfflineTool.cxx | 46 ++-- 29 files changed, 274 insertions(+), 504 deletions(-) diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/MuonStationBuilder.h b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/MuonStationBuilder.h index 354a1c3f998..b902f9a68d3 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/MuonStationBuilder.h +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/MuonTrackingGeometry/MuonStationBuilder.h @@ -2,50 +2,29 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonStationBuilder.h, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - #ifndef MUONTRACKINGGEOMETRY_MUONSTATIONBUILDER_H #define MUONTRACKINGGEOMETRY_MUONSTATIONBUILDER_H -//Muon #include "MuonTrackingGeometry/MuonStationTypeBuilder.h" -//Trk #include "TrkDetDescrInterfaces/IDetachedTrackingVolumeBuilder.h" -#include "TrkDetDescrInterfaces/ITrackingVolumeHelper.h" -#include "TrkGeometry/DetachedTrackingVolume.h" -#include "TrkGeometry/TrackingVolume.h" -// Gaudi #include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" +#include "TrkDetDescrInterfaces/ITrackingVolumeHelper.h" +#include "TrkGeometry/DetachedTrackingVolume.h" +#include "TrkGeometry/TrackingVolume.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "GeoModelKernel/GeoVPhysVol.h" #include "TrkDetDescrGeoModelCnv/GeoMaterialConverter.h" #include "TrkDetDescrGeoModelCnv/GeoShapeConverter.h" -class MdtIdHelper; -class RpcIdHelper; -class CscIdHelper; -class TgcIdHelper; -class sTgcIdHelper; -class MmIdHelper; - namespace Trk { - class TrackingGeometry; - class TrackingVolume; - class Volume; - class Layer; - class ITrackingVolumeBuilder; - class ITrackingVolumeArrayCreator; - class ILayerBuilder; - class ILayerArrayCreator; class MaterialProperties; } namespace MuonGM { class MuonDetectorManager; - class MuonStation; } namespace Muon { @@ -59,21 +38,16 @@ namespace Muon { by Sarka.Todorova@cern.ch */ - class MuonStationBuilder : public AthAlgTool, - virtual public Trk::IDetachedTrackingVolumeBuilder { + class MuonStationBuilder : public AthAlgTool, virtual public Trk::IDetachedTrackingVolumeBuilder { public: - /** Constructor */ MuonStationBuilder(const std::string&,const std::string&,const IInterface*); - /** Destructor */ virtual ~MuonStationBuilder() = default; - /** AlgTool initailize method.*/ StatusCode initialize(); - /** AlgTool finalize method */ - StatusCode finalize(); const std::vector<const Trk::DetachedTrackingVolume*>* buildDetachedTrackingVolumes(bool blend=false); private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; const std::vector<const Trk::DetachedTrackingVolume*>* buildDetachedTrackingVolumeTypes(bool blend); @@ -83,13 +57,7 @@ namespace Muon { void identifyPrototype(const Trk::TrackingVolume*, int, int, Amg::Transform3D ) const; void getNSWStationsForTranslation(const GeoVPhysVol* pv, std::string name, Amg::Transform3D , std::vector<std::pair<std::pair<const GeoLogVol*,Trk::MaterialProperties*>,std::vector<Amg::Transform3D> > >& vols, std::vector<std::string>& volNames ) const; - const MuonGM::MuonDetectorManager* m_muonMgr; //!< the MuonDetectorManager - const MdtIdHelper* m_mdtIdHelper; //!< - const RpcIdHelper* m_rpcIdHelper; //!< - const CscIdHelper* m_cscIdHelper; //!< - const TgcIdHelper* m_tgcIdHelper; //!< - const sTgcIdHelper* m_stgcIdHelper; //!< - const MmIdHelper* m_mmIdHelper; //!< + const MuonGM::MuonDetectorManager* m_muonMgr; //!< the MuonDetectorManager Gaudi::Property<std::string> m_muonMgrLocation{this,"MuonDetManagerLocation","MuonMgr"}; //!< the location of the Muon Manager ToolHandle<Muon::MuonStationTypeBuilder> m_muonStationTypeBuilder diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx index 46af2e94b6f..6beaf1c1adf 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx @@ -2,13 +2,8 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonStationBuilder.cxx, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -// Muon #include "MuonTrackingGeometry/MuonStationBuilder.h" -//MuonSpectrometer include + #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonStation.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" @@ -17,10 +12,6 @@ #include "MuonReadoutGeometry/TgcReadoutElement.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" #include "MuonReadoutGeometry/MMReadoutElement.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "MuonIdHelpers/MmIdHelper.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" // Trk @@ -48,13 +39,11 @@ #include "TrkGeometry/Layer.h" #include "TrkGeometry/MaterialProperties.h" #include "TrkGeometry/HomogeneousLayerMaterial.h" -#include<fstream> #include "GeoModelKernel/GeoShape.h" #include "GeoModelKernel/GeoShapeShift.h" #include "GeoModelKernel/GeoTube.h" #include "GeoModelKernel/GeoTubs.h" #include "GeoModelKernel/GeoCons.h" -//mw #include "GeoModelKernel/GeoShapeSubtraction.h" #include "GeoModelKernel/GeoShapeUnion.h" #include "GeoModelKernel/GeoShapeIntersection.h" @@ -64,10 +53,6 @@ #include "GeoModelKernel/GeoPgon.h" #include "GeoModelKernel/GeoPara.h" #include "GeoModelKernel/GeoVolumeCursor.h" - -// STD -#include <map> - #include "GeoModelKernel/GeoShape.h" #include "GeoModelKernel/GeoShapeShift.h" #include "GeoModelKernel/GeoShapeSubtraction.h" @@ -75,6 +60,9 @@ #include "GeoModelKernel/GeoTrd.h" #include "GeoModelKernel/GeoVolumeCursor.h" +#include <map> +#include <fstream> + // constructor Muon::MuonStationBuilder::MuonStationBuilder(const std::string& t, const std::string& n, const IInterface* p) : AthAlgTool(t,n,p) @@ -89,13 +77,6 @@ StatusCode Muon::MuonStationBuilder::initialize() // get Muon Spectrometer Description Manager ATH_CHECK( detStore()->retrieve(m_muonMgr) ); - - m_mdtIdHelper = m_muonMgr-> mdtIdHelper(); - m_rpcIdHelper = m_muonMgr-> rpcIdHelper(); - m_cscIdHelper = m_muonMgr-> cscIdHelper(); - m_tgcIdHelper = m_muonMgr-> tgcIdHelper(); - m_stgcIdHelper = m_muonMgr-> stgcIdHelper(); - m_mmIdHelper = m_muonMgr-> mmIdHelper(); ATH_MSG_INFO( m_muonMgr->geometryVersion() ); @@ -122,7 +103,9 @@ StatusCode Muon::MuonStationBuilder::initialize() return StatusCode::FAILURE; } - ATH_MSG_INFO( name() <<" initialize() successful" ); + ATH_MSG_INFO( name() <<" initialize() successful" ); + + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } @@ -205,7 +188,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: const Trk::DiamondBounds* dia=nullptr; const Trk::RotatedDiamondBounds* rdia=nullptr; Amg::Transform3D layTransf(Trk::s_idTransform); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(nswId)) { + if (m_idHelperSvc->issTgc(nswId)) { const MuonGM::sTgcReadoutElement* stgc=m_muonMgr->getsTgcReadoutElement(nswId); if (stgc) rtrd = dynamic_cast<const Trk::RotatedTrapezoidBounds*> (&stgc->bounds(nswId)); if (stgc) trd = dynamic_cast<const Trk::TrapezoidBounds*> (&stgc->bounds(nswId)); @@ -214,7 +197,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (stgc) layTransf = stgc->transform(nswId); if(stgc) ATH_MSG_DEBUG( " STGC readout element " ); if(!stgc) ATH_MSG_DEBUG( " STGC and NO readout element " ); - } else if (m_mmIdHelper && m_mmIdHelper->is_mm(nswId)) { + } else if (m_idHelperSvc->isMM(nswId)) { const MuonGM::MMReadoutElement* mm=m_muonMgr->getMMReadoutElement(nswId); if (mm) rtrd = dynamic_cast<const Trk::RotatedTrapezoidBounds*> (&mm->bounds(nswId)); if (mm) layTransf = mm->transform(nswId); @@ -326,18 +309,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id)+it, - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id)+it, - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id)+it, + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id)+it, + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -358,18 +341,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - -m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id), - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - -m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id), - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + -m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id), + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + -m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id), + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -389,18 +372,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id)+it, - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id)+it, - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id)+it, + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id)+it, + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -427,18 +410,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id)+it, - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id)+it, - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id)+it, + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id)+it, + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -462,18 +445,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - -m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id), - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - -m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id), - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + -m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id), + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + -m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id), + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -493,18 +476,18 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (iType!=0) { Identifier id(iType); Identifier nid(0); - if (m_stgcIdHelper && m_stgcIdHelper->is_stgc(id)) { - nid = m_stgcIdHelper->channelID(m_stgcIdHelper->stationName(id), - m_stgcIdHelper->stationEta(id), - m_stgcIdHelper->stationPhi(id)+it, - m_stgcIdHelper->multilayer(id), - m_stgcIdHelper->gasGap(id),1,1); - } else if (m_mmIdHelper) { - nid = m_mmIdHelper->channelID(m_mmIdHelper->stationName(id), - m_mmIdHelper->stationEta(id), - m_mmIdHelper->stationPhi(id)+it, - m_mmIdHelper->multilayer(id), - m_mmIdHelper->gasGap(id),1); + if (m_idHelperSvc->issTgc(id)) { + nid = m_idHelperSvc->stgcIdHelper().channelID(m_idHelperSvc->stgcIdHelper().stationName(id), + m_idHelperSvc->stgcIdHelper().stationEta(id), + m_idHelperSvc->stgcIdHelper().stationPhi(id)+it, + m_idHelperSvc->stgcIdHelper().multilayer(id), + m_idHelperSvc->stgcIdHelper().gasGap(id),1,1); + } else if (m_idHelperSvc->isMM(id)) { + nid = m_idHelperSvc->mmIdHelper().channelID(m_idHelperSvc->mmIdHelper().stationName(id), + m_idHelperSvc->mmIdHelper().stationEta(id), + m_idHelperSvc->mmIdHelper().stationPhi(id)+it, + m_idHelperSvc->mmIdHelper().multilayer(id), + m_idHelperSvc->mmIdHelper().gasGap(id),1); } unsigned int nType = nid.get_identifier32().get_compact(); @@ -569,8 +552,8 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (msTV && gmStation) { Amg::Transform3D transf = Amg::CLHEPTransformToEigen(gmStation->getTransform()); Identifier stId(0); - if (m_cscIdHelper && stName.substr(0,1)=="C") { - stId = m_cscIdHelper->elementID(vname.substr(0,3),eta,phi); + if (m_idHelperSvc->hasCSC() && stName.substr(0,1)=="C") { + stId = m_idHelperSvc->cscIdHelper().elementID(vname.substr(0,3),eta,phi); } // adjust eta,phi if (msTypeName.substr(0,1)=="C") { @@ -606,7 +589,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: if (msName.substr(7,2)=="21") eta = az ? 5 : 4; if (msName.substr(7,2)=="22") eta = az ? 5 : 4; } - if (m_tgcIdHelper && stName.substr(0,1)=="T") { + if (m_idHelperSvc->hasTGC() && stName.substr(0,1)=="T") { int etaSt = eta - 4; if (eta < 5) etaSt = eta - 5; double phic = transf.translation().phi(); @@ -615,11 +598,11 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: else phi = static_cast<int> (phic<0 ? 12*phic/M_PI+24 : 12*phic/M_PI); phi++; - stId = m_tgcIdHelper->elementID(vname.substr(0,3),etaSt,phi); - } else if (m_rpcIdHelper && stName.substr(0,3)=="BML") { - stId = m_rpcIdHelper->elementID(vname.substr(0,3),eta,phi,1); - } else if (m_mdtIdHelper && stName.substr(0,1)!="C" ) { - stId = m_mdtIdHelper->elementID(vname.substr(0,3),eta,phi); + stId = m_idHelperSvc->tgcIdHelper().elementID(vname.substr(0,3),etaSt,phi); + } else if (m_idHelperSvc->hasRPC() && stName.substr(0,3)=="BML") { + stId = m_idHelperSvc->rpcIdHelper().elementID(vname.substr(0,3),eta,phi,1); + } else if (m_idHelperSvc->hasMDT() && stName.substr(0,1)!="C" ) { + stId = m_idHelperSvc->mdtIdHelper().elementID(vname.substr(0,3),eta,phi); } if (!(stId.get_compact())) ATH_MSG_WARNING( "identifier of the station not found:"<<vname <<","<<eta<<","<<phi ); unsigned int iD = stId.get_identifier32().get_compact(); @@ -850,13 +833,6 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder: return mStations; } -// finalize -StatusCode Muon::MuonStationBuilder::finalize() -{ - ATH_MSG_INFO( name() <<" finalize() successful" ); - return StatusCode::SUCCESS; -} -// void Muon::MuonStationBuilder::glueComponents(const Trk::DetachedTrackingVolume* stat) const { const Trk::TrackingVolumeArray* volArray = stat->trackingVolume()->confinedVolumes(); @@ -904,7 +880,7 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* if (!cscRE) cscRE = m_muonMgr->getCscReadoutElement(st,eta,phi,cLay); if (cscRE) { for (int gasgap = 0; gasgap < cscRE->Ngasgaps(); gasgap++) { - Identifier idi = m_cscIdHelper->channelID(cscRE->identify(),cscRE->ChamberLayer(),gasgap+1,0,1); + Identifier idi = m_idHelperSvc->cscIdHelper().channelID(cscRE->identify(),cscRE->ChamberLayer(),gasgap+1,0,1); const Trk::PlaneSurface* stripSurf = dynamic_cast<const Trk::PlaneSurface*> (&(cscRE->surface(idi))); const Amg::Vector3D gpi = stripSurf->center(); const Trk::TrackingVolume* assocVol = station->trackingVolume()->associatedSubVolume(gpi); @@ -949,9 +925,9 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* phi = phit; // update station identity Identifier oldId(station->layerRepresentation()->layerType()); - int stationName = m_tgcIdHelper->stationName(oldId); - int stationEta = m_tgcIdHelper->stationEta(oldId); - Identifier stId = m_tgcIdHelper->elementID(stationName,stationEta,phi); + int stationName = m_idHelperSvc->tgcIdHelper().stationName(oldId); + int stationEta = m_idHelperSvc->tgcIdHelper().stationEta(oldId); + Identifier stId = m_idHelperSvc->tgcIdHelper().elementID(stationName,stationEta,phi); station->layerRepresentation()->setLayerType(stId.get_identifier32().get_compact()); break; } @@ -965,7 +941,7 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* int phiSt = tgc->getStationPhi(); bool* validId=new bool(false); - Identifier wireId = m_tgcIdHelper->channelID(stationName.substr(0,3),etaSt,phiSt,1,0,1,true,validId); + Identifier wireId = m_idHelperSvc->tgcIdHelper().channelID(stationName.substr(0,3),etaSt,phiSt,1,0,1,true,validId); if (!(*validId)) ATH_MSG_ERROR( "invalid TGC channel:" << wireId ); const Amg::Vector3D gp = tgc->channelPos(wireId); const Trk::TrackingVolume* assocVol = station->trackingVolume()->associatedSubVolume(gp); @@ -973,7 +949,7 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* if (assocVol && assocVol->confinedLayers()) { const std::vector<const Trk::Layer*> layers = assocVol->confinedLayers()->arrayObjects(); for (unsigned int il=0;il<layers.size();il++) { - wireId = m_tgcIdHelper->channelID(stationName.substr(0,3),etaSt,phiSt,il+1,0,1,true,validId); + wireId = m_idHelperSvc->tgcIdHelper().channelID(stationName.substr(0,3),etaSt,phiSt,il+1,0,1,true,validId); if (!(*validId)) layers[il]->setLayerType(1); else { if (!(*validId)) ATH_MSG_ERROR( "invalid TGC channel:" << wireId ); @@ -995,11 +971,11 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* } } - if (m_mdtIdHelper && (stationName.substr(0,1)=="B" || stationName.substr(0,1)=="E" )) { + if (m_idHelperSvc->hasMDT() && (stationName.substr(0,1)=="B" || stationName.substr(0,1)=="E" )) { // recalculate id Identifier stId(station->layerRepresentation()->layerType()); - int nameIndex = m_mdtIdHelper->stationNameIndex( stationName.substr(0,3) ); + int nameIndex = m_idHelperSvc->mdtIdHelper().stationNameIndex( stationName.substr(0,3) ); if (station->trackingVolume()->confinedVolumes()) { const std::vector<const Trk::TrackingVolume*> cVols = station->trackingVolume()->confinedVolumes()->arrayObjects(); for (unsigned int i=0; i<cVols.size() ; i++) { @@ -1008,9 +984,9 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* const MuonGM::MdtReadoutElement* mdtROE = 0; for (unsigned int il=0; il<cLays.size() ; il++) { Identifier id(cLays[il]->layerType()); - if (id.get_compact() > 0 && m_mdtIdHelper->is_mdt(id)) { - Identifier newId = m_mdtIdHelper->channelID(nameIndex,eta,phi, - m_mdtIdHelper->multilayer(id),m_mdtIdHelper->tubeLayer(id),m_mdtIdHelper->tube(id)); + if (id.get_compact() > 0 && m_idHelperSvc->isMdt(id)) { + Identifier newId = m_idHelperSvc->mdtIdHelper().channelID(nameIndex,eta,phi, + m_idHelperSvc->mdtIdHelper().multilayer(id),m_idHelperSvc->mdtIdHelper().tubeLayer(id),m_idHelperSvc->mdtIdHelper().tube(id)); if (!mdtROE) mdtROE=m_muonMgr->getMdtReadoutElement(newId); unsigned int newid = newId.get_identifier32().get_compact(); cLays[il]->setLayerType(newid); @@ -1035,10 +1011,10 @@ void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* const std::vector<const Trk::Layer*>* cLays = cVols[i]->confinedArbitraryLayers(); for (unsigned int il=0; il<cLays->size() ; il++) { Identifier id((*cLays)[il]->layerType()); - if (m_rpcIdHelper && id.get_compact() > 0 && m_rpcIdHelper->is_rpc(id)) { - Identifier newId = m_rpcIdHelper->channelID(nameIndex,eta,phi,m_rpcIdHelper->doubletR(id), - m_rpcIdHelper->doubletZ(id),m_rpcIdHelper->doubletPhi(id),m_rpcIdHelper->gasGap(id), - m_rpcIdHelper->measuresPhi(id),m_rpcIdHelper->strip(id)); + if (m_idHelperSvc->hasRPC() && id.get_compact() > 0 && m_idHelperSvc->isRpc(id)) { + Identifier newId = m_idHelperSvc->rpcIdHelper().channelID(nameIndex,eta,phi,m_idHelperSvc->rpcIdHelper().doubletR(id), + m_idHelperSvc->rpcIdHelper().doubletZ(id),m_idHelperSvc->rpcIdHelper().doubletPhi(id),m_idHelperSvc->rpcIdHelper().gasGap(id), + m_idHelperSvc->rpcIdHelper().measuresPhi(id),m_idHelperSvc->rpcIdHelper().strip(id)); int newid = newId.get_identifier32().get_compact(); (*cLays)[il]->setLayerType(newid); } @@ -1087,9 +1063,9 @@ void Muon::MuonStationBuilder::identifyPrototype(const Trk::TrackingVolume* stat std::string stationName = station->volumeName(); ATH_MSG_VERBOSE( " for station " << stationName ); - if (m_mdtIdHelper && (stationName.substr(0,1)=="B" || stationName.substr(0,1)=="E" )) { + if (m_idHelperSvc->hasMDT() && (stationName.substr(0,1)=="B" || stationName.substr(0,1)=="E" )) { // MDT - int nameIndex = m_mdtIdHelper->stationNameIndex( stationName.substr(0,3) ); + int nameIndex = m_idHelperSvc->mdtIdHelper().stationNameIndex( stationName.substr(0,3) ); int nameIndexC = nameIndex; if (stationName.substr(0,3)=="EIS") nameIndexC = 22; if (stationName.substr(0,3)=="BIM") nameIndexC = 23; @@ -1102,12 +1078,11 @@ void Muon::MuonStationBuilder::identifyPrototype(const Trk::TrackingVolume* stat const Trk::TrackingVolume* assocVol = station->associatedSubVolume(transf.inverse()*multilayer->center()); if (!assocVol ) { ATH_MSG_WARNING( "valid multilayer outside station:" << stationName ); - //ATH_MSG_WARNING( "multilayer position:" << multilayer->center()<<", local: "<< transf.inverse()*multilayer->center() ); } if (assocVol) { int nLayers = multilayer->getNLayers(); for (int layer =1; layer <= nLayers ; layer++) { - Identifier id = m_mdtIdHelper->channelID(nameIndex,eta,phi,multi+1,layer,1); + Identifier id = m_idHelperSvc->mdtIdHelper().channelID(nameIndex,eta,phi,multi+1,layer,1); if (id.get_compact() > 0) { // retrieve associated layer Amg::Vector3D gp = multilayer->tubePos(id); @@ -1124,10 +1099,10 @@ void Muon::MuonStationBuilder::identifyPrototype(const Trk::TrackingVolume* stat const Trk::BinnedArray< Trk::TrackingVolume >* confinedVolumes = station->confinedVolumes(); if (confinedVolumes){ const std::vector<const Trk::TrackingVolume*>& vols = confinedVolumes->arrayObjects(); - for (unsigned int iv=0;iv<vols.size();iv++) if (m_rpcIdHelper && vols[iv]->volumeName() == "RPC") { + for (unsigned int iv=0;iv<vols.size();iv++) if (m_idHelperSvc->hasRPC() && vols[iv]->volumeName() == "RPC") { // for active layers do a search of associated ROE const std::vector<const Trk::Layer*>* layers = vols[iv]->confinedArbitraryLayers(); - int nameIndex = m_rpcIdHelper->stationNameIndex( stationName.substr(0,3) ); + int nameIndex = m_idHelperSvc->rpcIdHelper().stationNameIndex( stationName.substr(0,3) ); if (stationName.substr(0,3)=="BME") nameIndex=12; // hack for BME if (stationName.substr(0,3)=="BMG") nameIndex=13; // hack for BMG (even though BMG don't have RPC) // loop over doubletR, doubletZ @@ -1138,9 +1113,8 @@ void Muon::MuonStationBuilder::identifyPrototype(const Trk::TrackingVolume* stat if (rpc) { if (doubletZ < rpc->getDoubletZ() ) { for (int gasGap=0; gasGap<2; gasGap++) { - Identifier etaId = m_rpcIdHelper->channelID(nameIndex,eta,phi, + Identifier etaId = m_idHelperSvc->rpcIdHelper().channelID(nameIndex,eta,phi, doubletR+1,doubletZ+1,doubletPhi+1,gasGap+1,0,1); - if (1/*m_rpcIdHelper->valid(etaId)*/){ for (unsigned int il=0;il<layers->size();il++) { if ((*layers)[il]->layerType() != 0 && (*layers)[il]->surfaceRepresentation().isOnSurface(transf.inverse()*rpc->stripPos(etaId),false,0.5*(*layers)[il]->thickness() ) ) { const Amg::Vector3D locPos1 = (*layers)[il]->surfaceRepresentation().transform().inverse()*transf.inverse()*rpc->stripPos(etaId); @@ -1153,7 +1127,6 @@ void Muon::MuonStationBuilder::identifyPrototype(const Trk::TrackingVolume* stat (*layers)[il]->setRef(swap + locPos[0]); } } - } }}}}}} } } diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitToolOutput.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitToolOutput.h index 6e5e3de07f4..67d251a7c15 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitToolOutput.h +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_DigitToolOutput.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MM_DIGITIZATION_MM_DIGITTOOLOUTPUT_H @@ -20,6 +20,8 @@ Class to store output produced by MDT_Digitization tools: -----------------------------------------------*/ +#include <vector> + class MM_DigitToolOutput { public: MM_DigitToolOutput(bool hitWasEff, std::vector <int> strpos, std::vector<float> time, std::vector<float> charge, int strTrig, float strTimeTrig ) diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h index 16c97f34738..89de12db0b9 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/MM_Digitization/MM_Response_DigitTool.h @@ -1,16 +1,16 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MM_DIGITIZATION_MM_RESPONSE_DIGITTOOL_H #define MM_DIGITIZATION_MM_RESPONSE_DIGITTOOL_H -#include "AthenaBaseComps/AthAlgTool.h" -#include "MM_Digitization/MM_DigitToolOutput.h" #include "MM_Digitization/IMM_DigitizationTool.h" - +#include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" +// #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MM_Digitization/MM_DigitToolOutput.h" #include "CLHEP/Random/RandomEngine.h" #include "AthenaKernel/IAtRndmGenSvc.h" /*----------------------------------------------- @@ -26,14 +26,10 @@ input quantities into the output namespace MuonGM{ class MuonDetectorManager; } -class MmIdHelper; -class IAtRndmGenSvc; class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_DigitizationTool { public: - MM_Response_DigitTool( const std::string& type, - const std::string& name, - const IInterface* parent ); + MM_Response_DigitTool( const std::string& type, const std::string& name, const IInterface* parent); MM_DigitToolOutput digitize(/* const MmDigitToolInput& input */ ); StatusCode initialize(); @@ -41,8 +37,8 @@ class MM_Response_DigitTool : public AthAlgTool, virtual public IMM_Digitization private: - const MuonGM::MuonDetectorManager* m_muonGeoMgr; - const MmIdHelper* m_idHelper; + // const MuonGM::MuonDetectorManager* m_muonGeoMgr; + // ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; protected: CLHEP::HepRandomEngine *m_rndmEngine; // Random number engine used - not init in SiDigitization diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx index 1985f0d9c1f..577c1c8c2c5 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_Response_DigitTool.cxx @@ -2,11 +2,10 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "MM_Digitization/MM_DigitToolInput.h" #include "MM_Digitization/MM_Response_DigitTool.h" -#include "MuonIdHelpers/MmIdHelper.h" -#include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "AthenaKernel/IAtRndmGenSvc.h" + +#include "MM_Digitization/MM_DigitToolInput.h" +// #include "MuonReadoutGeometry/MuonDetectorManager.h" #include <iostream> #include <vector> @@ -16,8 +15,7 @@ using namespace MuonGM; /*******************************************************************************/ MM_Response_DigitTool::MM_Response_DigitTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), - m_muonGeoMgr(0), - m_idHelper(0), + // m_muonGeoMgr(0), m_rndmEngine(0), m_rndmEngineName("MuonDigitization"), m_rndmSvc("AtRndmGenSvc", name ) @@ -37,13 +35,11 @@ MM_DigitToolOutput MM_Response_DigitTool::digitize( /*const MmDigitToolInput& in /*******************************************************************************/ StatusCode MM_Response_DigitTool::initialize() { - if(detStore()->contains<MuonDetectorManager>( "Muon" )){ - ATH_CHECK( detStore()->retrieve(m_muonGeoMgr) ); - ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate."); - m_idHelper = m_muonGeoMgr->mmIdHelper(); - ATH_MSG_DEBUG("MdtIdHelper: " << m_idHelper ); - } - + // if(detStore()->contains<MuonDetectorManager>( "Muon" )){ + // ATH_CHECK( detStore()->retrieve(m_muonGeoMgr) ); + // ATH_MSG_DEBUG("MuonGeoModelDetectorManager retrieved from StoreGate."); + // } + // ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK( m_rndmSvc.retrieve() ); // getting our random numbers stream diff --git a/MuonSpectrometer/MuonDigitization/MuonFastDigitization/src/MM_FastDigitizer.cxx b/MuonSpectrometer/MuonDigitization/MuonFastDigitization/src/MM_FastDigitizer.cxx index 5dc51f9b854..886f3374232 100644 --- a/MuonSpectrometer/MuonDigitization/MuonFastDigitization/src/MM_FastDigitizer.cxx +++ b/MuonSpectrometer/MuonDigitization/MuonFastDigitization/src/MM_FastDigitizer.cxx @@ -14,7 +14,6 @@ #include "MuonSimEvent/MicromegasHitIdHelper.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MMReadoutElement.h" -#include "MuonIdHelpers/MmIdHelper.h" #include "TrkEventPrimitives/LocalDirection.h" #include "MuonAGDDDescription/MMDetectorDescription.h" #include "MuonAGDDDescription/MMDetectorHelper.h" diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcVMMSim.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcVMMSim.h index 6562bf72ca8..3fb9bbaf17e 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcVMMSim.h +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcVMMSim.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* This class is a simulation of the sTGC VMM behavior. It is intended to be used as a module controlling @@ -20,7 +20,6 @@ #include <iosfwd> #include <inttypes.h> #include "MuonDigitContainer/MuonDigit.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigitContainer.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx index 53fda070640..81ddd34b7f3 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx @@ -1,34 +1,24 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "ProjectionMMClusterBuilderTool.h" -#include <cmath> -#include <algorithm> +#include "ProjectionMMClusterBuilderTool.h" #include "MuonPrepRawData/MMPrepData.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonIdHelpers/MmIdHelper.h" - -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/SystemOfUnits.h" -namespace{ -// Parametrization of the strip error after the projection -constexpr double stripErrorSlope = 0.2; -constexpr double stripErrorIntercept = 0.15; -} - - - +#include <cmath> +#include <algorithm> +namespace { + // Parametrization of the strip error after the projection + constexpr double stripErrorSlope = 0.2; + constexpr double stripErrorIntercept = 0.15; +} -Muon::ProjectionMMClusterBuilderTool::ProjectionMMClusterBuilderTool(const std::string& t, - const std::string& n, - const IInterface* p ) - : - AthAlgTool(t,n,p) -{ +Muon::ProjectionMMClusterBuilderTool::ProjectionMMClusterBuilderTool(const std::string& t, const std::string& n, const IInterface* p) : + AthAlgTool(t,n,p) { declareInterface<IMMClusterBuilderTool>(this); declareProperty("tmin", m_tmin=0.0); declareProperty("tmax", m_tmax=5.0); @@ -40,8 +30,6 @@ Muon::ProjectionMMClusterBuilderTool::ProjectionMMClusterBuilderTool(const std:: declareProperty("minClusterSize",m_minClusterSize=2); } - - StatusCode Muon::ProjectionMMClusterBuilderTool::initialize() { ATH_CHECK(m_idHelperSvc.retrieve()); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx index 41270cbf238..b53d64d4eab 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx @@ -2,38 +2,21 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SimpleMMClusterBuilderTool.h" + #include "MuonPrepRawData/MMPrepData.h" -#include "MuonIdHelpers/MmIdHelper.h" using namespace Muon; -Muon::SimpleMMClusterBuilderTool::SimpleMMClusterBuilderTool(const std::string& t, - const std::string& n, - const IInterface* p ) - : - AthAlgTool(t,n,p) -{ +Muon::SimpleMMClusterBuilderTool::SimpleMMClusterBuilderTool(const std::string& t, const std::string& n, const IInterface* p) : + AthAlgTool(t,n,p) { declareInterface<IMMClusterBuilderTool>(this); declareProperty("useErrorParametrization", m_useErrorParametrization = true); declareProperty("maxHoleSize", m_maxHoleSize = 1); } -Muon::SimpleMMClusterBuilderTool::~SimpleMMClusterBuilderTool() -{ - -} - - StatusCode Muon::SimpleMMClusterBuilderTool::initialize() { - ATH_CHECK( m_idHelperSvc.retrieve() ); - return StatusCode::SUCCESS; -} - - -StatusCode Muon::SimpleMMClusterBuilderTool::finalize() -{ - + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h index eacd9b6fab0..6426c0655af 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h @@ -1,19 +1,19 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ + #ifndef SimpleMMClusterBuilderTool_h #define SimpleMMClusterBuilderTool_h -#include <vector> - -#include "GaudiKernel/ServiceHandle.h" #include "MMClusterization/IMMClusterBuilderTool.h" -#include "MuonPrepRawData/MMPrepData.h" #include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" - +#include "MuonPrepRawData/MMPrepData.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include <vector> +#include <string> // // Simple clusterization tool for MicroMegas @@ -24,23 +24,14 @@ namespace Muon class SimpleMMClusterBuilderTool : virtual public IMMClusterBuilderTool, public AthAlgTool { public: - /** Default constructor */ SimpleMMClusterBuilderTool(const std::string&, const std::string&, const IInterface*); - - /** Default destructor */ - virtual ~SimpleMMClusterBuilderTool(); - - /** standard initialize method */ + virtual ~SimpleMMClusterBuilderTool()=default; virtual StatusCode initialize(); - - /** standard finalize method */ - virtual StatusCode finalize(); StatusCode getClusters(std::vector<Muon::MMPrepData>& stripsVect, std::vector<Muon::MMPrepData*>& clustersVect) const; private: - /// Muon Detector Descriptor ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; bool m_useErrorParametrization; diff --git a/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx index f54464d6ac2..0c5ba191dfb 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx +++ b/Simulation/G4Atlas/G4AtlasTests/src/MMHitsTestTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MMHitsTestTool.h" @@ -13,7 +13,6 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MMReadoutElement.h" -#include "MuonIdHelpers/MmIdHelper.h" #include "MuonSimEvent/MicromegasHitIdHelper.h" #include "MuonSimEvent/MMSimHitCollection.h" diff --git a/Simulation/G4Atlas/G4AtlasTests/src/MuonHitTestToolBase.h b/Simulation/G4Atlas/G4AtlasTests/src/MuonHitTestToolBase.h index ce020cc0c61..cdcf36de308 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/MuonHitTestToolBase.h +++ b/Simulation/G4Atlas/G4AtlasTests/src/MuonHitTestToolBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef G4AT_MuonHitTestToolBase_h @@ -8,8 +8,6 @@ #include "SimTestToolBase.h" #include "GeoPrimitives/GeoPrimitives.h" -//#include "CLHEP/Geometry/Point3D.h" -//#include "CLHEP/Geometry/Vector3D.h" #include "Identifier/Identifier.h" #include "HitManagement/HitIdHelper.h" @@ -17,7 +15,6 @@ namespace MuonGM { class MuonDetectorManager; } - class MuonHitTestToolBase : public SimTestToolBase { public: @@ -31,7 +28,6 @@ protected: StatusCode executeFillHistos(const Amg::Vector3D &); StatusCode executeFillHistosSectors_Wedge1(const Amg::Vector3D &, std::string); StatusCode executeFillHistosSectors_Wedge2(const Amg::Vector3D &, std::string); - //StatusCode executeFillHistos_sTGc_Wedge1(const Amg::Vector3D &, std::string); StatusCode executeFillHistos_sTGc(const Amg::Vector3D &, std::string); protected: diff --git a/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx b/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx index f7f2b4d6529..eb95ce9778a 100644 --- a/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx +++ b/Simulation/G4Atlas/G4AtlasTests/src/sTGCHitsTestTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "sTGCHitsTestTool.h" @@ -13,7 +13,6 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonSimEvent/sTgcHitIdHelper.h" #include "MuonSimEvent/sTGCSimHitCollection.h" diff --git a/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx index 2f7e875917d..010d1d4756d 100755 --- a/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx +++ b/Simulation/Tools/HitAnalysis/src/MMHitAnalysis.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MMHitAnalysis.h" @@ -9,7 +9,6 @@ #include "GeoAdaptors/GeoMuonHits.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MMReadoutElement.h" -#include "MuonIdHelpers/MmIdHelper.h" #include "MuonSimEvent/MicromegasHitIdHelper.h" #include "MuonSimEvent/MMSimHitCollection.h" #include "MuonSimEvent/MMSimHit.h" diff --git a/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx index 79220a81a07..c39075e3098 100755 --- a/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx +++ b/Simulation/Tools/HitAnalysis/src/sTGCHitAnalysis.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "sTGCHitAnalysis.h" @@ -9,7 +9,6 @@ #include "GeoAdaptors/GeoMuonHits.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonSimEvent/sTgcHitIdHelper.h" #include "MuonSimEvent/sTGCSimHitCollection.h" #include "MuonSimEvent/sTGCSimHit.h" diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadOfflineData.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadOfflineData.h index 4d6dca9782e..36f84dc34f7 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadOfflineData.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadOfflineData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef PADOFFLINEDATA_H @@ -7,7 +7,6 @@ // Identifier includes #include "Identifier/Identifier.h" -#include "MuonIdHelpers/sTgcIdHelper.h" // local includes #include "TrigT1NSWSimTools/PadData.h" diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTdsOfflineTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTdsOfflineTool.h index bb0b6bc1c7d..9f9c20d7347 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTdsOfflineTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTdsOfflineTool.h @@ -14,9 +14,9 @@ #include "TrigT1NSWSimTools/IPadTdsTool.h" #include "PadTdsValidationTree.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "GaudiKernel/IIncidentSvc.h" +#include "AthenaKernel/IAtRndmGenSvc.h" -class IIncidentSvc; -class IAtRndmGenSvc; class sTgcDigit; class TTree; class MuonSimDataCollection; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h index ab0a094d5ac..e7d6e550ea1 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h @@ -1,33 +1,25 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// -*-c++-*- #ifndef NSWL1_PADTRIGGERLOGICOFFLINETOOL_H #define NSWL1_PADTRIGGERLOGICOFFLINETOOL_H -//basic includes +#include "TrigT1NSWSimTools/IPadTriggerLogicTool.h" +#include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/Property.h" -//local includes -#include "TrigT1NSWSimTools/IPadTriggerLogicTool.h" #include "TrigT1NSWSimTools/PadTriggerValidationTree.h" #include "TrigT1NSWSimTools/L1TdrStgcTriggerLogic.h" #include "TrigT1NSWSimTools/TriggerTypes.h" - - -//To access detector envelope +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "RegSelLUT/IRegionIDLUT_Creator.h" - //forward declarations class IIncidentSvc; class TTree; - namespace MuonGM { class MuonDetectorManager; } @@ -55,15 +47,13 @@ namespace NSWL1 { */ class PadTriggerLogicOfflineTool: - virtual public IPadTriggerLogicTool, - public AthAlgTool, - public IIncidentListener { + virtual public IPadTriggerLogicTool, public AthAlgTool, public IIncidentListener { public: enum CacheStatus {OK, FILL_ERROR, CLEARED}; PadTriggerLogicOfflineTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~PadTriggerLogicOfflineTool(); + virtual ~PadTriggerLogicOfflineTool()=default; virtual StatusCode initialize() override; virtual void handle (const Incident& inc) override; /// Log a message using the Athena controlled logging system @@ -86,6 +76,7 @@ namespace NSWL1 { PadTrigger convert(const SectorTriggerCandidate &t); private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; /// get the output tree from the athena histogram service const std::vector<float> m_etaBandsLargeSector; const std::vector<float> m_etaBandsSmallSector; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLookupTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLookupTool.h index 6a92d18c290..5b7054b023d 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLookupTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerLookupTool.h @@ -1,29 +1,23 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// -*-c++-*- - /* This tool utilizes the same LUT as in the pad trigger hardware. Trigger band-id and phi-d are looked up where pad coincidence patterns are keys */ - - - #ifndef NSWL1_PadTriggerLookupTool_H #define NSWL1_PadTriggerLookupTool_H -//basic includes +#include "TrigT1NSWSimTools/IPadTriggerLookupTool.h" +#include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/Property.h" -//local includes -#include "TrigT1NSWSimTools/IPadTriggerLookupTool.h" #include "TrigT1NSWSimTools/TriggerTypes.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include <unordered_map> +#include <string> #include <vector> namespace MuonGM { @@ -42,20 +36,19 @@ namespace NSWL1 { } }; class PadTriggerLookupTool: - virtual public IPadTriggerLookupTool, - public AthAlgTool, - public IIncidentListener { + virtual public IPadTriggerLookupTool, public AthAlgTool, public IIncidentListener { public: PadTriggerLookupTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~PadTriggerLookupTool(); + virtual ~PadTriggerLookupTool()=default; virtual StatusCode initialize() override; virtual void handle (const Incident& inc) override; virtual StatusCode lookup_pad_triggers(const std::vector<std::shared_ptr<PadData>>& pads, std::vector<std::unique_ptr<PadTrigger>> &triggers) override; private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; /// load the 4o4 coincidence table StatusCode loadCoincidenceTable(std::string); // inflates the table by appending 3o4s //empty hits/missing layers are -9999 (const value of the 'nullPadNumber' variable. Never use any nonsense number for non existing values it will break some rules ) diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterOfflineData.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterOfflineData.h index 8a3f13725b6..7634005c566 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterOfflineData.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterOfflineData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STRIPCLUSTEROFFLINEDATA_H @@ -7,7 +7,6 @@ // Identifier includes #include "Identifier/Identifier.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigit.h" // local includes #include "TrigT1NSWSimTools/StripClusterData.h" diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterTool.h index 0eb67c560fc..2ca6dcf30e6 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripClusterTool.h @@ -1,29 +1,24 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STRIPCLUSTERTOOL_H #define STRIPCLUSTERTOOL_H -//basic includes +#include "TrigT1NSWSimTools/IStripClusterTool.h" +#include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/Property.h" - -//local includes -#include "TrigT1NSWSimTools/IStripClusterTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "StripClusterOfflineData.h" #include "TrigT1NSWSimTools/PadTrigger.h" #include "TrigT1NSWSimTools/StripTdsOfflineTool.h" #include "TrigT1NSWSimTools/TriggerTypes.h" - //forward declarations class IIncidentSvc; class IAtRndmGenSvc; -class sTgcIdHelper; class sTgcDigit; class TTree; @@ -61,7 +56,7 @@ namespace NSWL1 { StripClusterTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~StripClusterTool(); + virtual ~StripClusterTool()=default; virtual StatusCode initialize() override; virtual void handle (const Incident& inc) override; virtual @@ -79,7 +74,7 @@ namespace NSWL1 { ServiceHandle< IIncidentSvc > m_incidentSvc; //!< Athena/Gaudi incident Service ServiceHandle< IAtRndmGenSvc > m_rndmSvc; //!< Athena random number service const MuonGM::MuonDetectorManager* m_detManager; //!< MuonDetectorManager - const sTgcIdHelper* m_sTgcIdHelper; //!< sTgc offline Id helper + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // analysis ntuple TTree* m_tree; //!< ntuple for analysis diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripSegmentTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripSegmentTool.h index e19124fb2a7..cb960dd1c36 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripSegmentTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripSegmentTool.h @@ -1,29 +1,22 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STRIPSEGMENTTOOL_H #define STRIPSEGMENTTOOL_H -//basic includes +#include "TrigT1NSWSimTools/IStripSegmentTool.h" +#include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" +#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/Property.h" - -//Muon RDOs for trigger EDM +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonRDO/NSW_TrigRawDataContainer.h" - - -//To access detector envelope #include "RegSelLUT/IRegionIDLUT_Creator.h" - -//local includes -#include "TrigT1NSWSimTools/IStripSegmentTool.h" #include "TrigT1NSWSimTools/PadTrigger.h" #include "TrigT1NSWSimTools/TriggerTypes.h" -//forward declarations + class IIncidentSvc; class TTree; @@ -52,7 +45,7 @@ namespace NSWL1 { StripSegmentTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~StripSegmentTool(); + virtual ~StripSegmentTool()=default; virtual StatusCode initialize() override; virtual void handle (const Incident& inc) override; virtual @@ -60,6 +53,7 @@ namespace NSWL1 { private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // methods implementing the internal data processing StatusCode book_branches(); //!< book the branches to analyze the StripTds behavior diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripTdsOfflineTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripTdsOfflineTool.h index b2218ea455d..52d2f7ba0f5 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripTdsOfflineTool.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/StripTdsOfflineTool.h @@ -1,27 +1,22 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef STRIPTDSOFFLINETOOL_H #define STRIPTDSOFFLINETOOL_H -//basic includes +#include "TrigT1NSWSimTools/IStripTdsTool.h" +#include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/IIncidentListener.h" -#include "GaudiKernel/Property.h" - -//local includes -#include "TrigT1NSWSimTools/IStripTdsTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "TrigT1NSWSimTools/PadTrigger.h" #include "TrigT1NSWSimTools/TriggerTypes.h" - //forward declarations class IIncidentSvc; class IAtRndmGenSvc; -class sTgcIdHelper; class sTgcDigit; class TTree; @@ -80,6 +75,7 @@ namespace NSWL1 { private: + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // methods implementing the internal data processing cStatus fill_strip_cache( const std::vector<std::unique_ptr<PadTrigger>>& padTriggers); //!< loop over the digit container, apply the additional processing then fill the cache void clear_cache(); //!< clear the strip hit cache deleting the StripData pointers @@ -95,7 +91,6 @@ namespace NSWL1 { ServiceHandle< IAtRndmGenSvc > m_rndmSvc; //!< Athena random number service CLHEP::HepRandomEngine* m_rndmEngine; //!< Random number engine const MuonGM::MuonDetectorManager* m_detManager; //!< MuonDetectorManager - const sTgcIdHelper* m_sTgcIdHelper; //!< sTgc offline Id helper // hidden variables std::vector<std::unique_ptr<StripData>> m_strip_cache; //!< cache for the STRIP hit data in the event diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx index b4c7177b8cb..43155a5d7b2 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTdsOfflineTool.cxx @@ -3,7 +3,6 @@ */ #include "GaudiKernel/ITHistSvc.h" -#include "GaudiKernel/IIncidentSvc.h" #include "AGDDKernel/AGDDDetector.h" #include "AGDDKernel/AGDDDetectorStore.h" @@ -20,7 +19,6 @@ #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" -#include "AthenaKernel/IAtRndmGenSvc.h" #include "GaudiKernel/ThreadLocalContext.h" #include "GaudiKernel/EventContext.h" #include "CLHEP/Random/RandFlat.h" diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLogicOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLogicOfflineTool.cxx index f1e028e34cb..a391a8ae155 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLogicOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLogicOfflineTool.cxx @@ -1,16 +1,11 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include <boost/geometry.hpp> -#include <boost/geometry/geometries/point_xy.hpp> -#include <boost/geometry/geometries/polygon.hpp> +#include "TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h" -// Athena/Gaudi includes #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/IIncidentSvc.h" -// local includes -#include "TrigT1NSWSimTools/PadTriggerLogicOfflineTool.h" #include "TrigT1NSWSimTools/PadData.h" #include "TrigT1NSWSimTools/PadOfflineData.h" #include "TrigT1NSWSimTools/PadTrigger.h" @@ -18,52 +13,41 @@ #include "TrigT1NSWSimTools/SingleWedgePadTrigger.h" #include "TrigT1NSWSimTools/tdr_compat_enum.h" #include "TrigT1NSWSimTools/sTGCTriggerBandsInEta.h" - - -//Event info includes #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" - -// Muon software includes #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigitContainer.h" #include "MuonDigitContainer/sTgcDigit.h" #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" #include "MuonAGDDDescription/sTGCDetectorDescription.h" #include "MuonAGDDDescription/sTGCDetectorHelper.h" -// trk #include "TrkSurfaces/PlaneSurface.h" #include "TrkSurfaces/TrapezoidBounds.h" - -// random numbers #include "AthenaKernel/IAtRndmGenSvc.h" #include "CLHEP/Random/RandFlat.h" #include "CLHEP/Random/RandGauss.h" - -// root +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include "TTree.h" #include "TVector3.h" -// std #include <functional> #include <algorithm> #include <map> #include <utility> -#include <math.h> +#include <cmath> namespace NSWL1 { //------------------------------------------------------------------------------ -PadTriggerLogicOfflineTool::PadTriggerLogicOfflineTool( const std::string& type, - const std::string& name, - const IInterface* parent) : +PadTriggerLogicOfflineTool::PadTriggerLogicOfflineTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), m_etaBandsLargeSector(BandsInEtaLargeSector), m_etaBandsSmallSector(BandsInEtaSmallSector), m_incidentSvc("IncidentSvc",name), - m_detManager(0), + m_detManager(nullptr), m_rndmEngineName(""), m_sTgcDigitContainer(""), m_sTgcSdoContainer(""), @@ -72,20 +56,13 @@ PadTriggerLogicOfflineTool::PadTriggerLogicOfflineTool( const std::string& type, m_useSimple4of4(false), m_doNtuple(false), m_tdrLogic(), - m_lutCreatorToolsTGC ("sTGC_RegionSelectorTable",this) -{ + m_lutCreatorToolsTGC ("sTGC_RegionSelectorTable",this) { declareInterface<NSWL1::IPadTriggerLogicTool>(this); declareProperty("TimeJitter", m_PadEfficiency = 1.0, "pad trigger efficiency (tmp placeholder)"); declareProperty("PhiIdBits", m_phiIdBits = 6, "Number of bit to compute Phi-Id of pad triggers"); declareProperty("UseSimple4of4", m_useSimple4of4 = false, "use simplified logic requiring 4 hits on 4 gas gaps"); declareProperty("DoNtuple", m_doNtuple = false, "save the trigger outputs in an analysis ntuple"); } -//------------------------------------------------------------------------------ -PadTriggerLogicOfflineTool::~PadTriggerLogicOfflineTool() { - -} - - StatusCode PadTriggerLogicOfflineTool::initialize() { ATH_MSG_INFO( "initializing " << name() ); @@ -104,8 +81,8 @@ StatusCode PadTriggerLogicOfflineTool::initialize() { ATH_CHECK(m_incidentSvc.retrieve()); m_incidentSvc->addListener(this,IncidentType::BeginEvent); ATH_CHECK(m_lutCreatorToolsTGC.retrieve()); - ATH_CHECK( detStore()->retrieve( m_detManager )); - + ATH_CHECK(detStore()->retrieve(m_detManager)); + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } //------------------------------------------------------------------------------ @@ -478,11 +455,10 @@ NSWL1::PadTrigger PadTriggerLogicOfflineTool::convert(const SectorTriggerCandida //Assignment of Phi Id using 6 bits slicing Identifier padIdentifier(pt.m_pads.at(0)->id() ); IdentifierHash moduleHashId; - const sTgcIdHelper* idhelper=m_detManager->stgcIdHelper(); - const IdContext ModuleContext = idhelper->detectorElement_context(); + const IdContext ModuleContext = m_idHelperSvc->stgcIdHelper().detectorElement_context(); //get the module Identifier using the pad's - idhelper->get_hash( padIdentifier, moduleHashId, &ModuleContext ); + m_idHelperSvc->stgcIdHelper().get_hash( padIdentifier, moduleHashId, &ModuleContext ); const auto regSelector = m_lutCreatorToolsTGC->getLUT(); const RegSelModule* thismodule=regSelector->Module(moduleHashId); diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx index 935dce62eb8..4236e9ace4a 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx @@ -1,63 +1,45 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include <boost/geometry.hpp> -#include <boost/geometry/geometries/point_xy.hpp> -#include <boost/geometry/geometries/polygon.hpp> +#include "TrigT1NSWSimTools/PadTriggerLookupTool.h" -// Athena/Gaudi includes #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/IIncidentSvc.h" -// local includes -#include "TrigT1NSWSimTools/PadTriggerLookupTool.h" #include "TrigT1NSWSimTools/PadData.h" #include "TrigT1NSWSimTools/PadOfflineData.h" #include "TrigT1NSWSimTools/PadTrigger.h" #include "TrigT1NSWSimTools/tdr_compat_enum.h" #include "TrigT1NSWSimTools/sTGCTriggerBandsInEta.h" - - - -// Muon software includes #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonAGDDDescription/sTGCDetectorDescription.h" #include "MuonAGDDDescription/sTGCDetectorHelper.h" - #include "PathResolver/PathResolver.h" +#include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <algorithm> #include <fstream> #include <numeric> namespace NSWL1 { //------------------------------------------------------------------------------ -PadTriggerLookupTool::PadTriggerLookupTool( const std::string& type, - const std::string& name, - const IInterface* parent) : +PadTriggerLookupTool::PadTriggerLookupTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), m_etaBandsLargeSector(BandsInEtaLargeSector), m_etaBandsSmallSector(BandsInEtaSmallSector), - m_detManager(0), - m_dumpSectorGeometry(true) -{ + m_detManager(nullptr), + m_dumpSectorGeometry(true) { declareInterface<NSWL1::IPadTriggerLookupTool>(this); declareProperty("DumpSectorGeometry",m_dumpSectorGeometry = true, "record sector pad geometry into an ASCII file / use it for debugging"); } -//------------------------------------------------------------------------------ -PadTriggerLookupTool::~PadTriggerLookupTool() { - -} - - StatusCode PadTriggerLookupTool::initialize() { ATH_MSG_INFO( "initializing " << name() ); ATH_MSG_INFO( name() << " configuration:"); ATH_CHECK( detStore()->retrieve( m_detManager )); ATH_CHECK(loadCoincidenceTable("TriggerPatterns.dat") ); - if(m_dumpSectorGeometry){ ATH_MSG_INFO(" Will dump 3D pad geometry / sector"); std::ofstream padGeoFile("NSWSectorPadsGeoDump.dat");//use local variables in order not to contaminate members @@ -69,7 +51,7 @@ StatusCode PadTriggerLookupTool::initialize() { padGeoFile.close(); } - + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } //------------------------------------------------------------------------------ @@ -416,23 +398,23 @@ std::vector<std::vector<std::shared_ptr<PadData> >> PadTriggerLookupTool::select also useful to dump the full geometetry for geometry validation& side studies(see 'printGeometry' meth. and corresponding flag in the JO) */ std::vector<std::shared_ptr<PadOfflineData>> PadTriggerLookupTool::fetchSectorPads(bool isSmall, int SIDE,int SECTOR) { - const sTgcIdHelper* idhelper=m_detManager->stgcIdHelper(); std::vector<std::shared_ptr<PadOfflineData>> sectorPads; std::vector<Identifier> padIds; - for(const Identifier& modId : idhelper->idVector() ){ - int ModuleSide=1?idhelper->stationEta(modId)>0 :0; - int ModuleSect=idhelper->stationPhi(modId); - bool SectType=idhelper->isSmall(modId); + for(const Identifier& modId : m_idHelperSvc->stgcIdHelper().idVector() ){ + int ModuleSide=1?m_idHelperSvc->stgcIdHelper().stationEta(modId)>0 :0; + int ModuleSect=m_idHelperSvc->stgcIdHelper().stationPhi(modId); + bool SectType=m_idHelperSvc->stgcIdHelper().isSmall(modId); if(ModuleSide!=SIDE || ModuleSect !=SECTOR || SectType!=isSmall) continue;//grab only sector modules selected by the method args std::vector<Identifier> all_channels; - idhelper->idChannels(modId,all_channels); + m_idHelperSvc->stgcIdHelper().idChannels(modId,all_channels); std::vector<Identifier> pad_channels; + const sTgcIdHelper* idHelper = &m_idHelperSvc->stgcIdHelper(); std::copy_if(all_channels.begin(),all_channels.end(),std::back_inserter(pad_channels), - [idhelper](const Identifier& id){ - int chanType=idhelper->channelType(id); + [idHelper](const Identifier& id){ + int chanType=idHelper->channelType(id); return chanType==0; } ); @@ -441,23 +423,23 @@ std::vector<std::vector<std::shared_ptr<PadData> >> PadTriggerLookupTool::select } for(Identifier id : padIds){ - int multilayer=idhelper->multilayer(id); - int gasgap=idhelper->gasGap(id); + int multilayer=m_idHelperSvc->stgcIdHelper().multilayer(id); + int gasgap=m_idHelperSvc->stgcIdHelper().gasGap(id); - int channeltype=idhelper->channelType(id); + int channeltype=m_idHelperSvc->stgcIdHelper().channelType(id); const MuonGM::sTgcReadoutElement* rdoEl = m_detManager->getsTgcReadoutElement(id); const MuonGM::MuonPadDesign* mpd=rdoEl->getPadDesign(id); int padEtaMinFromDesign=mpd->padEtaMin; int padEtaMaxFromDesign=mpd->padEtaMax; int nPadCols=mpd->nPadColumns; - int thisEta=idhelper->padEta(id); - int thisPhi=idhelper->padPhi(id); + int thisEta=m_idHelperSvc->stgcIdHelper().padEta(id); + int thisPhi=m_idHelperSvc->stgcIdHelper().padPhi(id); int nPadRowsFromDesign=padEtaMaxFromDesign-padEtaMinFromDesign; if( thisEta>nPadRowsFromDesign || thisPhi > nPadCols ) continue; - Identifier pid=idhelper->padID(id, multilayer, gasgap, channeltype, thisEta, thisPhi,true); + Identifier pid=m_idHelperSvc->stgcIdHelper().padID(id, multilayer, gasgap, channeltype, thisEta, thisPhi,true); auto pad=std::make_shared<PadOfflineData>(pid, 0, 0, m_detManager); pad->fillGeometricInformation(); sectorPads.push_back(pad); diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripClusterTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripClusterTool.cxx index d64e4873280..5192479b8db 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripClusterTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripClusterTool.cxx @@ -1,24 +1,18 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// Athena/Gaudi includes +#include "TrigT1NSWSimTools/StripClusterTool.h" + #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/IIncidentSvc.h" - -// local includes -#include "TrigT1NSWSimTools/StripClusterTool.h" #include "TrigT1NSWSimTools/StripOfflineData.h" - -// Muon software includes #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigitContainer.h" #include "MuonDigitContainer/sTgcDigit.h" #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" -// random numbers #include "AthenaKernel/IAtRndmGenSvc.h" #include "CLHEP/Random/RandFlat.h" #include "CLHEP/Random/RandGauss.h" @@ -29,17 +23,14 @@ #include <map> #include <utility> - - namespace NSWL1 { StripClusterTool::StripClusterTool( const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), m_incidentSvc("IncidentSvc",name), m_rndmSvc("AtRndmGenSvc",name), - m_detManager(0), - m_sTgcIdHelper(0), - m_tree(0), + m_detManager(nullptr), + m_tree(nullptr), m_clusters() { declareInterface<NSWL1::IStripClusterTool>(this); @@ -47,11 +38,6 @@ namespace NSWL1 { declareProperty("sTGC_SdoContainerName", m_sTgcSdoContainer = "sTGC_SDO", "the name of the sTGC SDO container"); } - StripClusterTool::~StripClusterTool() { - } - - - StatusCode StripClusterTool::initialize() { ATH_MSG_INFO( "initializing " << name() ); ATH_MSG_INFO( name() << " configuration:"); @@ -74,11 +60,9 @@ namespace NSWL1 { // retrieve the Random Service ATH_CHECK(m_rndmSvc.retrieve()); - // retrieve the MuonDetectormanager + // retrieve the MuonDetectormanager ATH_CHECK(detStore()->retrieve( m_detManager )); - // retrieve the sTGC offline Id helper - ATH_CHECK(detStore()->retrieve( m_sTgcIdHelper )); - + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } @@ -387,7 +371,7 @@ void StripClusterTool::fill_strip_validation_id(std::vector<std::unique_ptr<Stri StripData* prev_hit=nullptr; int first_ch=(*hit)->channelId();//channel id of the first strip - ATH_MSG_DEBUG("Cluster Hits :" << (*hit)->channelId() << " " << m_sTgcIdHelper->gasGap( (*hit)->Identity()) + ATH_MSG_DEBUG("Cluster Hits :" << (*hit)->channelId() << " " << m_idHelperSvc->stgcIdHelper().gasGap( (*hit)->Identity()) << " " << (*hit)->moduleId() << " " << (*hit)->sectorId() << " " <<(*hit)->wedge() << " "<< (*hit)->sideId() ); hit++;//S.I is this ncessary ? @@ -395,7 +379,7 @@ void StripClusterTool::fill_strip_validation_id(std::vector<std::unique_ptr<Stri for(auto & this_hit : strips){ if(!(this_hit)->readStrip() )continue; if( ((this_hit)->bandId()==-1 || this_hit->phiId()==-1) ){ - ATH_MSG_WARNING("Read Strip without BandId :" << (this_hit)->channelId() << " " << m_sTgcIdHelper->gasGap( (this_hit)->Identity()) + ATH_MSG_WARNING("Read Strip without BandId :" << (this_hit)->channelId() << " " << m_idHelperSvc->stgcIdHelper().gasGap( (this_hit)->Identity()) << " " << (this_hit)->moduleId() << " " << (this_hit)->sectorId() << " " <<(this_hit)->wedge() << " "<< (this_hit)->sideId() ); continue; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx index 1d1fdb04256..c070b85c5bf 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripSegmentTool.cxx @@ -1,48 +1,39 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// Athena/Gaudi includes +#include "TrigT1NSWSimTools/StripSegmentTool.h" + #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/IIncidentSvc.h" - -// local includes -#include "TrigT1NSWSimTools/StripSegmentTool.h" #include "TrigT1NSWSimTools/StripOfflineData.h" #include "TrigT1NSWSimTools/tdr_compat_enum.h" - -// Muon software includes #include "MuonAGDDDescription/sTGCDetectorHelper.h" #include "MuonAGDDDescription/sTGCDetectorDescription.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigitContainer.h" #include "MuonDigitContainer/sTgcDigit.h" #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" #include "MuonRegionSelector/sTGC_RegionSelectorTable.h" - -// random numbers #include "AthenaKernel/IAtRndmGenSvc.h" #include "CLHEP/Random/RandFlat.h" #include "CLHEP/Random/RandGauss.h" -// local includes #include "TTree.h" - #include <functional> #include <algorithm> #include <map> #include <utility> -#include <math.h> +#include <cmath> namespace NSWL1 { StripSegmentTool::StripSegmentTool( const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), m_incidentSvc("IncidentSvc",name), - m_tree(0), + m_tree(nullptr), m_rIndexBits(0), m_dThetaBits(0), m_zbounds({-1,1}), @@ -63,10 +54,6 @@ namespace NSWL1 { declareProperty("rIndexScheme", m_ridxScheme = 1, "rIndex slicing scheme/ 0-->R / 1-->eta"); } - - StripSegmentTool::~StripSegmentTool() { - - } StatusCode StripSegmentTool::initialize() { ATH_MSG_INFO("initializing " << name() ); @@ -87,6 +74,7 @@ namespace NSWL1 { m_incidentSvc->addListener(this,IncidentType::BeginEvent); ATH_CHECK(m_lutCreatorToolsTGC.retrieve()); ATH_CHECK( FetchDetectorEnvelope()); + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } @@ -99,12 +87,11 @@ namespace NSWL1 { StatusCode StripSegmentTool::FetchDetectorEnvelope(){ const MuonGM::MuonDetectorManager* p_det; ATH_CHECK(detStore()->retrieve(p_det)); - const auto p_IdHelper =p_det->stgcIdHelper(); const auto regSelector = m_lutCreatorToolsTGC->getLUT(); std::vector<const RegSelModule*> moduleList; - for(const auto& i : p_IdHelper->idVector()){// all modules + for(const auto& i : m_idHelperSvc->stgcIdHelper().idVector()){// all modules IdentifierHash moduleHashId; - p_IdHelper->get_module_hash( i, moduleHashId); + m_idHelperSvc->stgcIdHelper().get_module_hash( i, moduleHashId); moduleList.push_back(regSelector->Module(moduleHashId)); } float etamin=-1; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx index 3b719efb936..8e99cccba6a 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/StripTdsOfflineTool.cxx @@ -1,27 +1,22 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#include "TrigT1NSWSimTools/StripTdsOfflineTool.h" + #include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/IIncidentSvc.h" - -#include "TrigT1NSWSimTools/StripTdsOfflineTool.h" #include "TrigT1NSWSimTools/StripOfflineData.h" #include "TrigT1NSWSimTools/PadOfflineData.h" - - #include "EventInfo/EventID.h" - #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/sTgcIdHelper.h" #include "MuonDigitContainer/sTgcDigitContainer.h" #include "MuonDigitContainer/sTgcDigit.h" #include "MuonSimData/MuonSimDataCollection.h" #include "MuonSimData/MuonSimData.h" #include "MuonAGDDDescription/sTGCDetectorDescription.h" #include "MuonAGDDDescription/sTGCDetectorHelper.h" - #include "AthenaKernel/IAtRndmGenSvc.h" #include "GaudiKernel/ThreadLocalContext.h" #include "GaudiKernel/EventContext.h" @@ -29,13 +24,11 @@ #include "CLHEP/Random/RandGauss.h" #include "TTree.h" - #include <functional> #include <algorithm> #include <map> #include <utility> - namespace NSWL1 { class StripHits { @@ -54,13 +47,12 @@ namespace NSWL1 { AthAlgTool(type,name,parent), m_incidentSvc("IncidentSvc",name), m_rndmSvc("AtRndmGenSvc",name), - m_rndmEngine(0), - m_detManager(0), - m_sTgcIdHelper(0), + m_rndmEngine(nullptr), + m_detManager(nullptr), m_strip_cache_runNumber(-1), m_strip_cache_eventNumber(-1), m_strip_cache_status(CLEARED), - m_tree(0) + m_tree(nullptr) { declareInterface<NSWL1::IStripTdsTool>(this); @@ -75,8 +67,6 @@ namespace NSWL1 { if(m_stripCharge) delete m_stripCharge; if(m_stripCharge_6bit) delete m_stripCharge_6bit; if(m_stripCharge_10bit) delete m_stripCharge_10bit; - - } void StripTdsOfflineTool::clear_cache() { @@ -115,8 +105,8 @@ namespace NSWL1 { ATH_MSG_FATAL("Could not retrieve the random engine " << m_rndmEngineName); return StatusCode::FAILURE; } - ATH_CHECK(detStore()->retrieve( m_detManager )); - ATH_CHECK(detStore()->retrieve( m_sTgcIdHelper )); + ATH_CHECK(detStore()->retrieve(m_detManager)); + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } @@ -294,7 +284,7 @@ namespace NSWL1 { const sTgcDigit* digit = coll->at(item); Identifier Id = digit->identify(); const MuonGM::sTgcReadoutElement* rdoEl = m_detManager->getsTgcReadoutElement(Id); - int channel_type = m_sTgcIdHelper->channelType(Id); + int channel_type = m_idHelperSvc->stgcIdHelper().channelType(Id); // process only Strip data if (channel_type!=1) continue; @@ -304,17 +294,17 @@ namespace NSWL1 { auto stripSurface=rdoEl->surface(Id); stripSurface.localToGlobal(strip_lpos, strip_gpos, strip_gpos); - std::string stName = m_sTgcIdHelper->stationNameString(m_sTgcIdHelper->stationName(Id)); - int stationEta = m_sTgcIdHelper->stationEta(Id); - int stationPhi = m_sTgcIdHelper->stationPhi(Id); - int wedge = m_sTgcIdHelper->multilayer(Id); - int layer = m_sTgcIdHelper->gasGap(Id); - int channel = m_sTgcIdHelper->channel(Id); + std::string stName = m_idHelperSvc->stgcIdHelper().stationNameString(m_idHelperSvc->stgcIdHelper().stationName(Id)); + int stationEta = m_idHelperSvc->stgcIdHelper().stationEta(Id); + int stationPhi = m_idHelperSvc->stgcIdHelper().stationPhi(Id); + int wedge = m_idHelperSvc->stgcIdHelper().multilayer(Id); + int layer = m_idHelperSvc->stgcIdHelper().gasGap(Id); + int channel = m_idHelperSvc->stgcIdHelper().channel(Id); int bctag = digit->bcTag(); strip_hit_number++; - int strip_eta = 0;// m_sTgcIdHelper->stripEta(Id); - int strip_phi = 0;// m_sTgcIdHelper->stripPhi(Id); + int strip_eta = 0; + int strip_phi = 0; ATH_MSG_DEBUG( "sTGC Strip hit " << strip_hit_number << ": Station Name [" << stName << "]" << " Station Eta [" << stationEta << "]" @@ -345,7 +335,7 @@ namespace NSWL1 { m_strip_eta->push_back(stationEta); m_strip_phi->push_back(stationPhi); ATH_MSG_DEBUG( "Fill Stuff more" ); - auto strip=std::make_unique<StripOfflineData>(Id,m_sTgcIdHelper,digit); + auto strip=std::make_unique<StripOfflineData>(Id,&m_idHelperSvc->stgcIdHelper(),digit); strip->set_locX(strip_lpos.x()); strip->set_locY(strip_lpos.y()); int sideid= (stationEta>0) ? 1 : 0; -- GitLab