diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx index b8bb8c1741ac97e4a6bd2a550727ec793381e4e6..c7bfe492c34fb482521ead9a2cf41056e2a90c1b 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx @@ -2,16 +2,11 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonInertMaterialBuilder.cxx, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - // Muon #include "MuonTrackingGeometry/MuonInertMaterialBuilder.h" #include "MuonTrackingGeometry/MuonStationTypeBuilder.h" //MuonSpectrometer include #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonIdHelpers/MuonIdHelper.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" @@ -41,9 +36,6 @@ #include "TrkGeometry/SubtractedCylinderLayer.h" #include "TrkGeometry/TrackingVolume.h" #include "TrkGeometry/TrackingGeometry.h" -//#include "TrkGeometry/HomogeneousLayerMaterial.h" - -//#include "PathResolver/PathResolver.h" // STD #include <map> diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx index 97f9d951db3bdb1ae18f8f6f6a4168192cf29bd7..68b06409ca8d8af2a9b297b92c76ea8050c70d91 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx @@ -8,7 +8,6 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MMReadoutElement.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/MuonIdHelper.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" // Trk diff --git a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h index bda5fa9d80196daae108496b055f0b611a205261..f2183343329f7b6b8f79d8f753104837b41696b0 100644 --- a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h +++ b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h @@ -2,26 +2,21 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - /*************************************************************************** test MuonGeoModel from digits to pos. in space ---------------------------------------------- ***************************************************************************/ -//<doc><file> $Id: MuonGMCheck.h,v 1.15 2009-03-28 10:59:00 stefspa Exp $ -//<version> $Name: not supported by cvs2svn $ - #ifndef MUONGEOMODEL_MUONGMCHECK_H # define MUONGEOMODEL_MUONGMCHECK_H #include "AthenaBaseComps/AthAlgorithm.h" - +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include "MuonCalibITools/IIdToFixedIdTool.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include <cmath> +#include "MuonIdHelpers/IMuonIdHelperSvc.h" -class Identifier; +#include <cmath> namespace MuonGM { @@ -35,11 +30,10 @@ class MuonGMCheck: public AthAlgorithm public: MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator); - ~MuonGMCheck(); + ~MuonGMCheck()=default; StatusCode initialize(); StatusCode execute(); - StatusCode finalize(); void clearCache() const; private: @@ -86,8 +80,7 @@ private: MuonGM::MuonDetectorManager* p_MuonMgr; ToolHandle<MuonCalib::IIdToFixedIdTool> m_fixedIdTool; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; int m_mem; //<! counter for memory allocated VmSize values read from /proc/<pid>/status int m_cpu[2]; //<! counter for cpu time read from /proc/<pid>/cpu diff --git a/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx b/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx index d2bf6ff0bf3845aa731dfea8399941a617ca8e0e..d07a9c428528995cb4e53612a0a46bb741352d5f 100644 --- a/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx +++ b/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx @@ -7,11 +7,7 @@ ----------------------------------------- ***************************************************************************/ -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGateSvc.h" - #include "MuonGeoModelTest/PerfUtils.h" - #include "MuonGeoModelTest/MuonGMCheck.h" #include "MuonDigitContainer/RpcDigitContainer.h" @@ -20,15 +16,6 @@ #include "MuonDigitContainer/MdtDigitContainer.h" #include "MuonDigitContainer/MdtDigitCollection.h" #include "MuonDigitContainer/MdtDigit.h" - -#include "MuonIdHelpers/MuonIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "MuonIdHelpers/MmIdHelper.h" - #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" @@ -39,15 +26,11 @@ #include "MuonReadoutGeometry/TgcReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonStation.h" - +#include "MuonReadoutGeometry/TgcReadoutParams.h" #include "MuonAlignmentData/ALinePar.h" #include "MuonAlignmentData/BLinePar.h" - -#include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "TrkSurfaces/Surface.h" #include "RegionSelector/IRegSelSvc.h" - #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <boost/format.hpp> @@ -57,12 +40,15 @@ typedef std::istringstream mystream; -using namespace MuonGM; +namespace { + static constexpr double const& invRad = 180/M_PI; +} +using namespace MuonGM; -MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm ( name, pSvcLocator ), - p_MuonMgr ( 0 ), +MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + p_MuonMgr(nullptr), m_fixedIdTool("MuonCalib::IdToFixedIdTool") { m_mem = 0; @@ -133,9 +119,6 @@ MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) } -MuonGMCheck::~MuonGMCheck() -{ } - StatusCode MuonGMCheck::initialize() { @@ -145,7 +128,7 @@ MuonGMCheck::initialize() // first get helpers ATH_MSG_DEBUG("Get Muon Id Helpers from the det store (through their converters)" ); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK( m_idHelperSvc.retrieve() ); ATH_MSG_DEBUG( " Muon Id Helper retrieved from handle " ); showVmemCpu("initialize (IDHELPER retrieved from handle)"); @@ -234,14 +217,6 @@ void MuonGMCheck::clearCache() const if (p_MuonMgr->cachingFlag() == 0) p_MuonMgr->clearCache(); } - -StatusCode -MuonGMCheck::finalize() -{ - ATH_MSG_DEBUG( "Finalizing" ); - return StatusCode::SUCCESS; -} - void MuonGMCheck::checkreadoutrpcgeo() { ATH_MSG_INFO( " *************************** Global Check for Rpc" ); @@ -313,7 +288,7 @@ void MuonGMCheck::checkreadoutrpcgeo() dbr_index, dbz_index); - if (rpc == NULL) continue; + if (!rpc) continue; fout<<" ///////////////////// Found a RpcReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<dbr_index<<" "<<dbz_index @@ -321,27 +296,27 @@ void MuonGMCheck::checkreadoutrpcgeo() Identifier idr = rpc->identify(); int ndbphi = rpc->NphiStripPanels(); fout<<" its offline hash Id = "<<rpc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" # doubletPhi = "<<ndbphi<<std::endl; - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idp)<<std::endl; fout<<" Center of the RpcReadoutElement at "<<rpc->center()<<std::endl; - int doubletR = m_muonIdHelperTool->rpcIdHelper().doubletR(idr); - int doubletZ = m_muonIdHelperTool->rpcIdHelper().doubletZ(idr); + int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(idr); + int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(idr); int stEta = rpc->getStationEta(); int stPhi = rpc->getStationPhi(); - int stNameInt = m_muonIdHelperTool->rpcIdHelper().stationName(idr); - std::string stNameString = m_muonIdHelperTool->rpcIdHelper().stationNameString(stNameInt); + int stNameInt = m_idHelperSvc->rpcIdHelper().stationName(idr); + std::string stNameString = m_idHelperSvc->rpcIdHelper().stationNameString(stNameInt); RpcReadoutSet Set(p_MuonMgr, idr); int ndbz = Set.NdoubletZ(); - fout1<<" its offline Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr)<<" means "<<stNameString<<" eta "<<stEta<<" phi "<<stPhi<<" doubletR "<<doubletR<<" dbZ "<<doubletZ<<"(out of "<<ndbz<<" in the set); n. of dbPhi in this chamber = "<< ndbphi<<std::endl; + fout1<<" its offline Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr)<<" means "<<stNameString<<" eta "<<stEta<<" phi "<<stPhi<<" doubletR "<<doubletR<<" dbZ "<<doubletZ<<"(out of "<<ndbz<<" in the set); n. of dbPhi in this chamber = "<< ndbphi<<std::endl; const MuonStation* ms = rpc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found "<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr)<<std::endl; fout<<" For this Module, gasGapSsize() "<<rpc->gasGapSsize() <<" and stripPanelSsize() "<<rpc->stripPanelSsize(1) @@ -354,20 +329,20 @@ void MuonGMCheck::checkreadoutrpcgeo() for (int idbphi = 1; idbphi<=ndbphi; ++idbphi) { - int dbp = m_muonIdHelperTool->rpcIdHelper().doubletPhi(idr); + int dbp = m_idHelperSvc->rpcIdHelper().doubletPhi(idr); if (ndbphi>1 && idbphi>1) dbp = idbphi; - fout<<" Changing doubletPhi for "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" Changing doubletPhi for "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" "<<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" dbr, dbz, dbp "<<doubletR<<" " - <<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" "<<dbp<<std::endl; + <<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" "<<dbp<<std::endl; for ( int igg=1; igg<3; igg++) { // - fout<<" Changing gas-gap "<<igg<<" for "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" Changing gas-gap "<<igg<<" for "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" "<<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" dbr, dbz, dbp "<<doubletR<<" " - <<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" "<< dbp<<std::endl; + <<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" "<< dbp<<std::endl; int measphi = 1; fout<<" Gas Gap "<<igg<<" measphi = "<<measphi<<" phi strip pitch = "<<rpc->StripPitch(measphi)<<" n. phi strips = "<<rpc->NphiStrips()<<std::endl; phistr_pitch += rpc->StripPitch(measphi) * rpc->NphiStrips(); @@ -381,8 +356,8 @@ void MuonGMCheck::checkreadoutrpcgeo() //here (gasgap-level) perform checks on local to global transform // BMF1 at stEta = 3 stPhi = 6, dbR=1,dbZ=1,dbPhi=1->should be 2 gg=1 or 2 Amg::Vector3D aLocalPoint = Amg::Vector3D(-1.,62.882732,-47.88338); - Identifier idgg = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier idgg = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, 1); Amg::Vector3D aGlobalPoint = rpc->localToGlobalCoords(aLocalPoint, idgg); fout<<" Global point = "<<aGlobalPoint<<std::endl; @@ -401,13 +376,13 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_first_last) stripStep = rpc->NphiStrips()-1; for (int strip = 1; strip<=rpc->NphiStrips();) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, strip); if (strip==1) { - fpanelidh<<"IdCodes "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " - <<m_muonIdHelperTool->rpcIdHelper().stationNameString(m_muonIdHelperTool->rpcIdHelper().stationName(chid))<<" " + fpanelidh<<"IdCodes "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(chid))<<" " <<chid<<" " <<chid.get_identifier32().get_compact()<<" " <<chid.get_compact()<<" n phi strips = "<<rpc->NphiStrips()<<std::endl; @@ -416,10 +391,10 @@ void MuonGMCheck::checkreadoutrpcgeo() int layerType=0; if ( doubletR==2 ) layerType=1; if ( (stNameInt>3&&(stNameInt!=53 && stNameInt!=8)) && doubletR==1 ) layerType=2; - layerType = layerType*2+m_muonIdHelperTool->rpcIdHelper().gasGap(chid); + layerType = layerType*2+m_idHelperSvc->rpcIdHelper().gasGap(chid); fpanelid<<layerType<<" " <<stNameString<<" phi " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " <<chid.get_identifier32().get_compact()<<" " <<etamin<<" "<<etamax<<" "<<phimin<<" "<<phimax<<" "<<zmin<<" "<<zmax<<std::endl; bool anyPad=true; @@ -441,10 +416,10 @@ void MuonGMCheck::checkreadoutrpcgeo() if (ndbz==1 || (stNameString.substr(0,3)=="BMS" && abs(stEta)==4 && dbz_index==0)){ fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; } @@ -460,10 +435,10 @@ void MuonGMCheck::checkreadoutrpcgeo() else {xC = 0.5*(keepxLS + xC); yC = 0.5*(keepyLS + yC); zC = 0.5*(keepzLS + zC);} fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; } } @@ -478,19 +453,19 @@ void MuonGMCheck::checkreadoutrpcgeo() if (dbp==1) { fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; } else { fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; xC = rpc->center().x(); yC = rpc->center().y();zC = rpc->center().z(); } @@ -511,11 +486,11 @@ void MuonGMCheck::checkreadoutrpcgeo() zFirstPhiS = 0.5*(keepzFS + zFirstPhiS); fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; } else { xLastPhiS = 0.5*(keepxLS + xLastPhiS); @@ -523,10 +498,10 @@ void MuonGMCheck::checkreadoutrpcgeo() zLastPhiS = 0.5*(keepzLS + zLastPhiS); fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; xC = 0.5*(keepxC + rpc->center().x()); yC = 0.5*(keepyC + rpc->center().y()); zC = 0.5*(keepzC + rpc->center().z()); } @@ -538,7 +513,7 @@ void MuonGMCheck::checkreadoutrpcgeo() } - fout<<" StripGlobalPosition "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" pos " + fout<<" StripGlobalPosition "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" pos " <<rpc->stripPos(chid)<<" Local Position = "<<rpc->localStripPos(chid) <<std::endl; Amg::Vector3D xxSD = rpc->globalToLocalCoords(rpc->stripPos(chid), chid); Amg::Vector3D xxMod = rpc->SDtoModuleCoords(xxSD, chid); @@ -551,32 +526,32 @@ void MuonGMCheck::checkreadoutrpcgeo() if (strip == 1 && m_check_rpc_distToReadout > 0) { - Identifier chtest0 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest0 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, 1); - Identifier chtest1 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest1 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, rpc->NphiStrips()); - Identifier chtest2 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest2 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, 1); - Identifier chtest3 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest3 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, rpc->NetaStrips()); fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest0)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest0)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest0),chtest0)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest0),chtest0)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest1)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest1)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest1),chtest1)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest1),chtest1)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest2)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest2)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest2),chtest2)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest2),chtest2)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest3)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest3)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest3),chtest3)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest3),chtest3)<<std::endl; } @@ -616,13 +591,13 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_first_last) stripStep = rpc->NetaStrips()-1; for (int strip = 1; strip<=rpc->NetaStrips();) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, strip); if (strip==1) { - fpanelidh<<"IdCodes "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " - <<m_muonIdHelperTool->rpcIdHelper().stationNameString(m_muonIdHelperTool->rpcIdHelper().stationName(chid))<<" " + fpanelidh<<"IdCodes "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(chid))<<" " <<chid<<" " <<chid.get_identifier32().get_compact()<<" " <<chid.get_compact()<<" n eta strips = "<<rpc->NetaStrips()<<std::endl; @@ -630,17 +605,17 @@ void MuonGMCheck::checkreadoutrpcgeo() int layerType=0; if ( doubletR==2 ) layerType=1; if ( (stNameInt>3&&(stNameInt!=53 && stNameInt!=8)) && doubletR==1 ) layerType=2; - layerType = layerType*2+m_muonIdHelperTool->rpcIdHelper().gasGap(chid); + layerType = layerType*2+m_idHelperSvc->rpcIdHelper().gasGap(chid); fpanelid<<layerType<<" " <<stNameString<<" eta " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " <<chid.get_identifier32().get_compact()<<" " <<etamin<<" "<<etamax<<" "<<phimin<<" "<<phimax<<" "<<zmin<<" "<<zmax<<std::endl; } - fout<<" StripGlobalPosition "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" pos " + fout<<" StripGlobalPosition "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" pos " <<rpc->stripPos(chid)<<" Local Position = "<<rpc->localStripPos(chid)<<std::endl; @@ -672,12 +647,12 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_surfaces_details){ for (int strip = 1; strip<=rpc->NphiStrips(); strip++) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 1, strip); // Global position Amg::Vector3D tempGlobalPosition = rpc->stripPos(chid); - fout<<"GG: "<<igg<<" dbZ: "<<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Phi strip: "<<strip + fout<<"GG: "<<igg<<" dbZ: "<<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Phi strip: "<<strip <<" glob.pos. " <<tempGlobalPosition.x()<<", " <<tempGlobalPosition.y()<<", " @@ -692,12 +667,12 @@ void MuonGMCheck::checkreadoutrpcgeo() } for (int strip = 1; strip<=rpc->NetaStrips(); strip++) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, strip); // Global position Amg::Vector3D tempGlobalPosition = rpc->stripPos(chid); - fout<<"GG: "<<igg<<" dbZ: "<<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Eta strip: "<<strip + fout<<"GG: "<<igg<<" dbZ: "<<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Eta strip: "<<strip <<" glob.pos. " <<tempGlobalPosition.x()<<", " <<tempGlobalPosition.y()<<", " @@ -782,7 +757,7 @@ void MuonGMCheck::getPanelEdgeCenter(const MuonGM::RpcReadoutElement* rpc, Ident { int n_strips = 0; // in phi or eta dir. depening on measphi-field of chid int view =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -794,17 +769,17 @@ void MuonGMCheck::getPanelEdgeCenter(const MuonGM::RpcReadoutElement* rpc, Ident view = 0; n_strips = rpc->NetaStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); @@ -845,7 +820,7 @@ void MuonGMCheck::getPanelBoundaries(const MuonGM::RpcReadoutElement* rpc, Ident int n_stripsOtherView = 0; int view =-1; int otherview =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -861,29 +836,29 @@ void MuonGMCheck::getPanelBoundaries(const MuonGM::RpcReadoutElement* rpc, Ident n_strips = rpc->NetaStrips(); n_stripsOtherView = rpc->NphiStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); - Identifier chidFirstOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidFirstOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, 1); - Identifier chidLastOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLastOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, n_stripsOtherView); @@ -945,7 +920,7 @@ void MuonGMCheck::getActivePanelBoundaries(const MuonGM::RpcReadoutElement* rpc, int n_stripsOtherView = 0; int view =-1; int otherview =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -961,29 +936,29 @@ void MuonGMCheck::getActivePanelBoundaries(const MuonGM::RpcReadoutElement* rpc, n_strips = rpc->NetaStrips(); n_stripsOtherView = rpc->NphiStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); - Identifier chidFirstOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidFirstOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, 1); - Identifier chidLastOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLastOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, n_stripsOtherView); @@ -1065,32 +1040,31 @@ void MuonGMCheck::checkParentStation() seta_index, sphi_index, dbr_index); - if (mdt == NULL) continue; - std::cout<<" ///////////////////// Found a MdtReadoutElement for indices = " + if (!mdt) continue; + ATH_MSG_INFO(" ///////////////////// Found a MdtReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<dbr_index - <<std::endl; + ); Identifier idr = mdt->identify(); - std::cout<<" its offline Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) + ATH_MSG_INFO(" its offline Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<mdt->getTechnologyName()<<"/" - <<mdt->getStationName()<<std::endl; - Identifier idp = m_muonIdHelperTool->mdtIdHelper().parentID(idr); - std::cout<<" parent Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idp)<<std::endl; - std::cerr<<" now the positions "<<std::endl; + <<mdt->getStationName()); + Identifier idp = m_idHelperSvc->mdtIdHelper().parentID(idr); + ATH_MSG_INFO(" parent Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idp)); + ATH_MSG_ERROR(" now the positions "); Amg::Vector3D stc = mdt->parentMuonStationPos(); - //HepGeom::Point3D<double> stcm = mdt->parentMuonStationPos(); - std::cout<<" Station centre is at "<<stc - <<" cyl. coords R,phi,Z "<<stc.perp()<<" "<<stc.phi()<<" "<<stc.z()<<std::endl; - std::cout<<" New Station centre is at " //<<stcm + ATH_MSG_INFO(" Station centre is at "<<stc + <<" cyl. coords R,phi,Z "<<stc.perp()<<" "<<stc.phi()<<" "<<stc.z()); + ATH_MSG_INFO(" New Station centre is at " //<<stcm <<" s_amdb "<<mdt->parentStation_s_amdb()<<" S,Z,R sizes " <<mdt->parentStationSsize()<<" " <<mdt->parentStationZsize()<<" " <<mdt->parentStationRsize()<<" " - <<std::endl; + ); Amg::Vector3D elc = mdt->globalPosition(); - std::cout<<" Element centre is at "<<elc - <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()<<std::endl; + ATH_MSG_INFO(" Element centre is at "<<elc + <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()); } } @@ -1109,7 +1083,7 @@ void MuonGMCheck::checkreadoutmmgeo() return; } else ATH_MSG_INFO(p_MuonMgr->nMMRE() << " MMReadoutElements found " ); - const MmIdHelper& helper = m_muonIdHelperTool->mmIdHelper(); + const MmIdHelper& helper = m_idHelperSvc->mmIdHelper(); std::string gVersion = p_MuonMgr->geometryVersion(); @@ -1146,9 +1120,9 @@ void MuonGMCheck::checkreadoutmmgeo() fout<<"------------------------------------- ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; const MMReadoutElement* mmA=p_MuonMgr->getMMRElement_fromIdFields(iSL, etaA, iphi8, iml+1); - if (mmC==NULL) std::cout<<" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmA==NULL) std::cout<<" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmC!=NULL && mmA!=NULL) + if (!mmC) ATH_MSG_INFO(" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1); + if (!mmA) ATH_MSG_INFO(" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1); + if (mmC && mmA) { Identifier idA = mmA->identify(); Identifier idC = mmC->identify(); @@ -1163,8 +1137,8 @@ void MuonGMCheck::checkreadoutmmgeo() fout<<helper.show_to_string(idC)<<" # of gas gaps = "<<helper.gasGapMax(idC)-helper.gasGapMin(idC)+1<<" ggMax = "<<helper.gasGapMax(idC)<<" number of layers(from geo)= "<<mmC->numberOfLayers(true)<<" nStrips = "<<mmC->numberOfStrips(idC)<<std::endl; Amg::Vector3D chCenterC = (mmC->absTransform())*Amg::Vector3D(0.,0.,0.); Amg::Vector3D chCenterA = (mmA->absTransform())*Amg::Vector3D(0.,0.,0.); - fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*180./M_PI<<std::endl; - fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*180./M_PI<<std::endl; + fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*invRad<<std::endl; + fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*invRad<<std::endl; Amg::Vector2D lpos(0.,0.); for (int igg=1;igg<mmA->numberOfLayers(true)+1;++igg) { @@ -1177,9 +1151,9 @@ void MuonGMCheck::checkreadoutmmgeo() const Amg::Vector3D *chCenter_fC = mmC->surface(idgg_fC).Trk::Surface::localToGlobal(lpos); const Amg::Vector3D *chCenter_lC = mmC->surface(idgg_lC).Trk::Surface::localToGlobal(lpos); fout<<"A-side: center of surface for gg "<<igg<<" 1st ch, "<<mmA->numberOfStrips(idA)<<"-th ch: r "<<chCenter_fA->perp()<<" "<<chCenter_lA->perp() - <<" phi "<<chCenter_fA->phi()*180./M_PI<<" "<<chCenter_lA->phi()*180./M_PI<<" z "<<chCenter_fA->z()<<" "<<chCenter_lA->z()<<" "<<helper.show_to_string(idgg_fA)<<std::endl; + <<" phi "<<chCenter_fA->phi()*invRad<<" "<<chCenter_lA->phi()*invRad<<" z "<<chCenter_fA->z()<<" "<<chCenter_lA->z()<<" "<<helper.show_to_string(idgg_fA)<<std::endl; fout<<"C-side: center of surface for gg "<<igg<<" 1st ch, "<<mmC->numberOfStrips(idC)<<"-th ch: r "<<chCenter_fC->perp()<<" "<<chCenter_lC->perp() - <<" phi "<<chCenter_fC->phi()*180./M_PI<<" "<<chCenter_lC->phi()*180./M_PI<<" z "<<chCenter_fC->z()<<" "<<chCenter_lC->z()<<" "<<helper.show_to_string(idgg_fC)<<std::endl; + <<" phi "<<chCenter_fC->phi()*invRad<<" "<<chCenter_lC->phi()*invRad<<" z "<<chCenter_fC->z()<<" "<<chCenter_lC->z()<<" "<<helper.show_to_string(idgg_fC)<<std::endl; } } @@ -1203,7 +1177,7 @@ void MuonGMCheck::checkreadoutstgcgeo() std::string fileName = "sTgc_current_"+gVersion; std::ofstream fout(fileName.c_str()); ATH_MSG_INFO( " ***** Writing file "<< fileName ); - const sTgcIdHelper& helper = m_muonIdHelperTool->stgcIdHelper(); + const sTgcIdHelper& helper = m_idHelperSvc->stgcIdHelper(); for (int ieta=0; ieta<MuonDetectorManager::NsTgStatEta/2; ++ieta) @@ -1233,9 +1207,9 @@ void MuonGMCheck::checkreadoutstgcgeo() fout<<"------------------------------------- ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; const sTgcReadoutElement* mmA=p_MuonMgr->getsTgcRElement_fromIdFields(iSL, etaA, iphi8, iml+1); - if (mmC==NULL) std::cout<<" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmA==NULL) std::cout<<" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmC!=NULL && mmA!=NULL) + if (!mmC) ATH_MSG_INFO(" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1); + if (!mmA) ATH_MSG_INFO(" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1); + if (mmC && mmA) { Identifier idA = mmA->identify(); Identifier idC = mmC->identify(); @@ -1245,13 +1219,13 @@ void MuonGMCheck::checkreadoutstgcgeo() fout<<"Found MMRE in C side; identified with: "<< helper.show_to_string(idC) <<" From Id: StName/Eta/Phi/ML = <"<<helper.stationNameString(helper.stationName(idA))<<">="<<helper.stationName(idC)<<"/"<<helper.stationEta(idC)<<"/"<<helper.stationPhi(idC)<<"/"<<helper.multilayer(idC)<<" CollHash = "<<mmC->collectionHash()<<" REhash = "/*<<mmC->detectorElementHash()<<" number of layers= "<<mmC->numberOfLayers()*/ <<std::endl; - fout<<"# of gas gaps = "<<helper.gasGapMax(idA)-helper.gasGapMin(idA)+1/*<<" isLargeSector = "<<helper.LargeSector(helper.stationName(idA))*/<<std::endl; + fout<<"# of gas gaps = "<<helper.gasGapMax(idA)-helper.gasGapMin(idA)+1<<std::endl; Amg::Vector3D chCenterC = (mmC->absTransform())*Amg::Vector3D(0.,0.,0.); Amg::Vector3D chCenterA = (mmA->absTransform())*Amg::Vector3D(0.,0.,0.); - fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*180./M_PI<<std::endl; - fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*180./M_PI<<std::endl; + fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*invRad<<std::endl; + fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*invRad<<std::endl; } } @@ -1301,7 +1275,7 @@ void MuonGMCheck::checkreadoutmdtgeo() seta_index, sphi_index, dbr_index); - if (mdt == NULL) continue; + if (!mdt) continue; fout<<" ///////////////////// Found a MdtReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " @@ -1309,7 +1283,7 @@ void MuonGMCheck::checkreadoutmdtgeo() <<std::endl; Identifier idr = mdt->identify(); fout<<" its offline hash Id = "<<mdt->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<mdt->getTechnologyName()<<"/" <<mdt->getStationName(); @@ -1317,12 +1291,12 @@ void MuonGMCheck::checkreadoutmdtgeo() else fout<<std::endl; // here get B-line - const BLinePar* bLine = NULL; + const BLinePar* bLine = nullptr; bLine = mdt->getBLinePar();// - Identifier idp = m_muonIdHelperTool->mdtIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->mdtIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idp)<<std::endl; const MuonStation* pms = mdt->parentMuonStation(); @@ -1336,7 +1310,7 @@ void MuonGMCheck::checkreadoutmdtgeo() fout<<" tube layer = "<<tl<<std::endl; for (int tube = 1; tube<mdt->getNtubesperlayer(); tube++) { - Identifier chid = m_muonIdHelperTool->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); + Identifier chid = m_idHelperSvc->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); Amg::Vector3D locPos = gToStation*mdt->tubePos(chid); const Amg::Vector3D locTubePos = mdt->AmdbLRStubePos( chid ); fout<<" locPos = "<<locPos<<" locTubePos "<<locTubePos<<std::endl; @@ -1387,8 +1361,8 @@ void MuonGMCheck::checkreadoutmdtgeo() } gotTube = tube; - chid = m_muonIdHelperTool->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); - fout<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + chid = m_idHelperSvc->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); + fout<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" wire global pos "<<mdt->tubePos(chid); fout<<" Tube length is "<<mdt->tubeLength(chid); if (mdt->hasCutouts()) fout<<" HAS CUTOUTS"<<std::endl; @@ -1423,8 +1397,8 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D pz0 = mdt->center(chid); fout<<" point on the wire at 1m from the center @ RO side "<<mdt->transform(chid)*Amg::Vector3D(0.,0., z1000RO)<<std::endl; fout<<" point on the wire at 1m from the center @ HV side "<<mdt->transform(chid)*Amg::Vector3D(0.,0.,-z1000RO)<<std::endl; - fout<<" RO side tube end-point "<<pzRO<<std::endl;//mdt->transform(chid)*Amg::Vector3D(0.,0., zRO)<<std::endl; - fout<<" HV side tube end-point "<<pzHV<<std::endl;//mdt->transform(chid)*Amg::Vector3D(0.,0.,-zRO)<<std::endl; + fout<<" RO side tube end-point "<<pzRO<<std::endl; + fout<<" HV side tube end-point "<<pzHV<<std::endl; fout<<" s+ half-tube end-point "<<pzEPsplus<<std::endl; fout<<" s- half-tube end-point "<<pzEPsminus<<std::endl; if (doHeader) @@ -1432,8 +1406,6 @@ void MuonGMCheck::checkreadoutmdtgeo() doHeader = false; fendpoints<<"================================================="<<std::endl; - // fendpoints - // <<" Atlas id RO end-point x,y,z center x,y,z HV end-point x,y,z MGM_nativeFrameZRO"<<std::endl; fendpoints <<" Atlas id s+ end-point x,y,z center x,y,z s- end-point x,y,z halfTubeLength"<<std::endl; fendpoints<<"================================================="<<std::endl; @@ -1443,7 +1415,7 @@ void MuonGMCheck::checkreadoutmdtgeo() doChHeader = false; - fendpoints<<" ----------- New MDT Station --------- id = "<<m_muonIdHelperTool->mdtIdHelper().print_to_string(chid)<<"----------------------------------------------------------------------- "<<std::endl; + fendpoints<<" ----------- New MDT Station --------- id = "<<m_idHelperSvc->mdtIdHelper().print_to_string(chid)<<"----------------------------------------------------------------------- "<<std::endl; fendpoints<<" A-line in use is s,z,t rots,z,t "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) <<pms->getALine_tras()<<" " <<pms->getALine_traz()<<" " @@ -1451,10 +1423,10 @@ void MuonGMCheck::checkreadoutmdtgeo() <<pms->getALine_rots()<<" " <<pms->getALine_rotz()<<" " <<pms->getALine_rott()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; - if (bLine==NULL) - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid)<<" B-line is NOT defined "<<std::endl; + if (!bLine) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid)<<" B-line is NOT defined "<<std::endl; else { - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid)<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid)<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) <<bLine->bz()<<" " <<bLine->bp()<<" " <<bLine->bn()<<" " @@ -1468,12 +1440,12 @@ void MuonGMCheck::checkreadoutmdtgeo() <<bLine->en()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; } if (mdt->barrel()) - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" MDT envelop Ssize, LongSsize, Rsize=Height, Zsize=Length " <<pms->Ssize()<<" "<<pms->LongSsize()<<" " <<pms->RsizeMdtStation()<<" "<<pms->ZsizeMdtStation()<<std::endl; else - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" MDT envelop Ssize, LongSsize, Zsize=Height, Rsize=Length " <<pms->Ssize()<<" "<<pms->LongSsize()<<" " <<pms->ZsizeMdtStation()<<" "<<pms->RsizeMdtStation()<<std::endl; @@ -1481,19 +1453,19 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D bLineFixedPointAMDBl(temp[0],temp[1],temp[2]); Amg::Vector3D aLineFixedPoint = mdt->AmdbLRSToGlobalCoords(Amg::Vector3D(0.,0.,0.)); Amg::Vector3D bLineFixedPoint = mdt->AmdbLRSToGlobalCoords(bLineFixedPointAMDBl); - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" A-line szt frame origine: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " <<aLineFixedPoint.x()<<" "<<aLineFixedPoint.y()<<" " <<aLineFixedPoint.z()<<std::endl; - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" B-line fixed point in A-line szt frame: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " <<bLineFixedPointAMDBl.x()<<" "<<bLineFixedPointAMDBl.y()<<" " <<bLineFixedPointAMDBl.z()<<std::endl; - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" B-line fixed point: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " @@ -1505,7 +1477,7 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D amdbpos = mdt->AmdbLRStubePos(chid); fendpoints << "Amdb LRS rubePos " << amdbpos.x() << " " << amdbpos.y() << " " << amdbpos.z() << std::endl; - fendpoints<<std::setw(20)<<setiosflags(std::ios::fixed)<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<std::setw(20)<<setiosflags(std::ios::fixed)<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" s+ " <<std::setw(12)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " @@ -1523,7 +1495,7 @@ void MuonGMCheck::checkreadoutmdtgeo() fendpoints2 << boost::format("%10d %25s %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f\n") - % m_fixedIdTool->idToFixedId(chid).getIdInt() % m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + % m_fixedIdTool->idToFixedId(chid).getIdInt() % m_idHelperSvc->mdtIdHelper().show_to_string(chid) % pzEPsplus.x() % pzEPsplus.y() % pzEPsplus.z() % pz0.x() % pz0.y() % pz0.z() % pzEPsminus.x() % pzEPsminus.y() % pzEPsminus.z() @@ -1536,7 +1508,7 @@ void MuonGMCheck::checkreadoutmdtgeo() <<pms->getALine_rots()<<" " <<pms->getALine_rotz()<<" " <<pms->getALine_rott()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; - if (bLine==NULL) + if (!bLine) fout<<" B-line is NOT defined "<<std::endl; else { fout<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) @@ -1621,26 +1593,26 @@ void MuonGMCheck::checkreadouttgcgeo() const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(sname_index, seta_index, sphi_index); - if (tgc == NULL) continue; + if (!tgc) continue; fout<<" ///////////////////// Found a TgcReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<std::endl; Identifier idr = tgc->identify(); fout<<" its offline hash Id = "<<tgc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<tgc->getTechnologyName()<<"/" <<tgc->getStationName() <<" stEta/stPhi "<<tgc->getStationEta()<<" "<<tgc->getStationPhi()<<std::endl; - Identifier idp = m_muonIdHelperTool->tgcIdHelper().parentID(idr); - Identifier idp1 = m_muonIdHelperTool->tgcIdHelper().elementID(m_muonIdHelperTool->tgcIdHelper().stationName(idp), - -m_muonIdHelperTool->tgcIdHelper().stationEta(idp), - m_muonIdHelperTool->tgcIdHelper().stationPhi(idp)); - fout<<" parent Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp); - fout<<" opposite stEta = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1); + Identifier idp = m_idHelperSvc->tgcIdHelper().parentID(idr); + Identifier idp1 = m_idHelperSvc->tgcIdHelper().elementID(m_idHelperSvc->tgcIdHelper().stationName(idp), + -m_idHelperSvc->tgcIdHelper().stationEta(idp), + m_idHelperSvc->tgcIdHelper().stationPhi(idp)); + fout<<" parent Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp); + fout<<" opposite stEta = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1); const TgcReadoutElement* tgc1 = p_MuonMgr->getTgcReadoutElement(idp1); if (!tgc1) { - ATH_MSG_FATAL( " TGC readout Element at z<0, with id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1)<<" not found " ); + ATH_MSG_FATAL( " TGC readout Element at z<0, with id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1)<<" not found " ); ATH_MSG_FATAL( " is the geometry COMPLETE ? Any StationSelection active ? Exiting" ); return; } @@ -1648,11 +1620,11 @@ void MuonGMCheck::checkreadouttgcgeo() const MuonStation* ms = tgc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found for element at z>0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp)<<std::endl; const MuonStation* ms1 = tgc1->parentMuonStation(); if (ms1) fout<<"Parent MuonStation found for element at z<0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1)<<std::endl; fout<<" N gasgaps layers = "<<tgc->NwirePlanes(); fout<<" N strip planes = "<<tgc->NstripPlanes()<<std::endl; @@ -1672,70 +1644,70 @@ void MuonGMCheck::checkreadouttgcgeo() <<rpar->nWires(ngg+1,2)<<"/" <<rpar->nWires(ngg+1,3)<<std::endl; - Identifier idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, 1); + Identifier idch = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, 1); Amg::Vector3D ggcentre = tgc->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); ggcentre = tgc1->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, 1); ggcentre = tgc->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); ggcentre = tgc1->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - Identifier fg = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, 1); - Identifier lg = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, tgc->getNGangs(ngg+1)); - Identifier fgn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); - Identifier lgn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, tgc1->getNGangs(ngg+1)); + Identifier fg = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, 1); + Identifier lg = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, tgc->getNGangs(ngg+1)); + Identifier fgn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); + Identifier lgn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, tgc1->getNGangs(ngg+1)); Amg::Vector3D xfg = tgc->channelPos(fg); Amg::Vector3D xlg = tgc->channelPos(lg); Amg::Vector3D xfgn = tgc1->channelPos(fgn); Amg::Vector3D xlgn = tgc1->channelPos(lgn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fg) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fg) <<"GM:: first eta gang z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fgn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fgn) <<"GM:: first eta gang z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; - Identifier fs = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, 1); - Identifier ls = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, tgc->getNStrips(ngg+1)); - Identifier fsn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); - Identifier lsn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, tgc1->getNStrips(ngg+1)); + Identifier fs = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, 1); + Identifier ls = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, tgc->getNStrips(ngg+1)); + Identifier fsn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); + Identifier lsn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, tgc1->getNStrips(ngg+1)); xfg = tgc->channelPos(fs); xlg = tgc->channelPos(ls); xfgn = tgc1->channelPos(fsn); xlgn = tgc1->channelPos(lsn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fs) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fs) <<"GM:: first phi strip z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fsn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fsn) <<"GM:: first phi strip z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; xfg = tgc->localChannelPos(fs); xlg = tgc->localChannelPos(ls); xfgn = tgc1->localChannelPos(fsn); xlgn = tgc1->localChannelPos(lsn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fs) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fs) <<"GM:: first p_S local z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fsn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fsn) <<"GM:: first p_S local z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; if (m_check_surfaces) { @@ -1824,8 +1796,8 @@ void MuonGMCheck::checkreadouttgcgeo() if (m_check_surfaces_details){ for (int strip = 1; strip<=tgc->getNStrips(ngg+1); strip++) { - Identifier chid = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, strip); - Identifier chid1 = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, strip); + Identifier chid = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, strip); + Identifier chid1 = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, strip); // Global position Amg::Vector3D tempGlobalPosition = tgc->channelPos(chid); Amg::Vector3D tempGlobalPosition1 = tgc1->channelPos(chid1); @@ -1856,8 +1828,8 @@ void MuonGMCheck::checkreadouttgcgeo() } for (int gang = 1; gang<=tgc->getNGangs(ngg+1); gang++) { - Identifier chid = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, gang); - Identifier chid1 = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, gang); + Identifier chid = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, gang); + Identifier chid1 = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, gang); // Global position Amg::Vector3D tempGlobalPosition = tgc->channelPos(chid); Amg::Vector3D tempGlobalPosition1 = tgc1->channelPos(chid1); @@ -1931,33 +1903,33 @@ void MuonGMCheck::checkreadoutcscgeo() seta_index, sphi_index, ml); - if (csc == NULL) continue; + if (!csc) continue; fout<<" ///////////////////// Found a CscReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" "<<ml <<std::endl; Identifier idr = csc->identify(); fout<<" its offline hash Id = "<<csc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<csc->getTechnologyName()<<"/" <<csc->getStationName()<<" centre at "<<(csc->transform())*Amg::Vector3D(0.,0.,0.)<<std::endl; - Identifier idp = m_muonIdHelperTool->cscIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->cscIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idp)<<std::endl; - Identifier idp1 = m_muonIdHelperTool->cscIdHelper().elementID(m_muonIdHelperTool->cscIdHelper().stationName(idp), - -m_muonIdHelperTool->cscIdHelper().stationEta(idp), - m_muonIdHelperTool->cscIdHelper().stationPhi(idp)); + Identifier idp1 = m_idHelperSvc->cscIdHelper().elementID(m_idHelperSvc->cscIdHelper().stationName(idp), + -m_idHelperSvc->cscIdHelper().stationEta(idp), + m_idHelperSvc->cscIdHelper().stationPhi(idp)); - Identifier idp1ch = m_muonIdHelperTool->cscIdHelper().channelID(idp1, csc->ChamberLayer(), 1, 0, 1); + Identifier idp1ch = m_idHelperSvc->cscIdHelper().channelID(idp1, csc->ChamberLayer(), 1, 0, 1); const CscReadoutElement* csc1 = p_MuonMgr->getCscReadoutElement(idp1ch); if (!csc1) { - ATH_MSG_FATAL( " CSC readout Element at z<0, with id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp1ch)<<" not found " ); + ATH_MSG_FATAL( " CSC readout Element at z<0, with id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idp1ch)<<" not found " ); ATH_MSG_FATAL( " is the geometry COMPLETE ? Any StationSelection active ? Exiting" ); return; } - fout<<" at opposite z = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(csc1->identify()) + fout<<" at opposite z = "<<m_idHelperSvc->cscIdHelper().show_to_string(csc1->identify()) <<" ////////////////// belongs to module " <<csc1->getTechnologyName()<<"/" <<csc1->getStationName()<<" centre at "<<(csc1->transform())*Amg::Vector3D(0.,0.,0.)<<std::endl; @@ -1966,11 +1938,11 @@ void MuonGMCheck::checkreadoutcscgeo() const MuonStation* ms = csc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found for element at z>0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->cscIdHelper().show_to_string(idp)<<std::endl; const MuonStation* ms1 = csc1->parentMuonStation(); if (ms1) fout<<"Parent MuonStation found for element at z<0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp1)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->cscIdHelper().show_to_string(idp1)<<std::endl; int netastrips = csc->NetaStrips(1); int nphistrips = csc->NphiStrips(1); fout<<"N or eta / phi strips in this chamber = "<<netastrips<<" "<<nphistrips @@ -2027,14 +1999,14 @@ void MuonGMCheck::checkreadoutcscgeo() fout<<"Side-C: in AmdbLRS Gas Gap center (after internal alignment) = "<<csc1->GlobalToAmdbLRSCoords(ggCenter1)<<std::endl; - Identifier fwzp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 0, 1); - Identifier fszp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 1, 1); - Identifier lwzp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 0, csc->NetaStrips(gg)); - Identifier lszp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 1, csc->NphiStrips(gg)); - Identifier fwzp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 0, 1); - Identifier fszp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 1, 1); - Identifier lwzp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 0, csc1->NetaStrips(gg)); - Identifier lszp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 1, csc1->NphiStrips(gg)); + Identifier fwzp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 0, 1); + Identifier fszp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 1, 1); + Identifier lwzp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 0, csc->NetaStrips(gg)); + Identifier lszp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 1, csc->NphiStrips(gg)); + Identifier fwzp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 0, 1); + Identifier fszp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 1, 1); + Identifier lwzp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 0, csc1->NetaStrips(gg)); + Identifier lszp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 1, csc1->NphiStrips(gg)); Amg::Vector3D AoriginGlobalF = csc->AmdbLRSToGlobalCoords(Amg::Vector3D(0.,0.,0.)); Amg::Vector3D AoriginTrkF = csc->transform(fszp).inverse()*AoriginGlobalF; fout<<" Side-A: A-line origin Global Frame " @@ -2058,70 +2030,60 @@ void MuonGMCheck::checkreadoutcscgeo() Amg::Vector3D xfszp1 = csc1->stripPos(fszp1); Amg::Vector3D xlwzp1 = csc1->stripPos(lwzp1); Amg::Vector3D xlszp1 = csc1->stripPos(lszp1); - /* - Amg::Vector3D xfwzpNew = csc->transform(fwzp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfszpNew = csc->transform(fszp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlwzpNew = csc->transform(lwzp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlszpNew = csc->transform(lszp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfwzp1New = csc1->transform(fwzp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfszp1New = csc1->transform(fszp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlwzp1New = csc1->transform(lwzp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlszp1New = csc1->transform(lszp1)*Amg::Vector3D(0.,0.,0.); - */ - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 local coord "<<csc->localStripPos(fwzp) <<" last "<<csc->localStripPos(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 AMDB lcoord "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(fwzp)) <<" last "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(lwzp))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire is at z<0 AMDB lcoord "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(fwzp1)) <<" last "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(lwzp1))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"Nom:: first eta wire is at z>0 local coord "<<csc->nominalLocalStripPos(fwzp) <<" last "<<csc->nominalLocalStripPos(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"TRK:: first eta wire on TrackingSurface "<<csc->stripPosOnTrackingSurface(fwzp) <<" last "<<csc->stripPosOnTrackingSurface(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 "<<xfwzp <<" last "<<xlwzp<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"Nom:: first eta wire is at z>0 "<<xfwzpNom <<" last "<<xlwzpNom<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire is at z<0 "<<xfwzp1<<" last "<<xlwzp1<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip is at z>0 local coord "<<csc->localStripPos(fszp) <<" last "<<csc->localStripPos(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi wire is at z>0 AMDB lcoord "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(fszp)) <<" last "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(lszp))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi wire is at z<0 AMDB lcoord "<<csc1->GlobalToAmdbLRSCoords(csc->stripPos(fszp1)) <<" last "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(lszp1))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"Nom:: first phi strip is at z>0 local coord "<<csc->nominalLocalStripPos(fszp) <<" last "<<csc->nominalLocalStripPos(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"TRK:: first phi strip on TrackingSurface "<<csc->stripPosOnTrackingSurface(fszp) <<" last "<<csc->stripPosOnTrackingSurface(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip is at z>0 "<<xfszp <<" last "<<xlszp<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"Nom:: first phi strip is at z>0 "<<xfszpNom <<" last "<<xlszpNom<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi strip is at z<0 "<<xfszp1<<" last "<<xlszp1<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta gang z>0 r,p,z " - <<xfwzp.perp()<<" "<<xfwzp.phi()*180./M_PI<<" "<<xfwzp.z()<<" last " - <<xlwzp.perp()<<" "<<xlwzp.phi()*180./M_PI<<" "<<xlwzp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + <<xfwzp.perp()<<" "<<xfwzp.phi()*invRad<<" "<<xfwzp.z()<<" last " + <<xlwzp.perp()<<" "<<xlwzp.phi()*invRad<<" "<<xlwzp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire z<0 r,p,z " - <<xfwzp1.perp()<<" "<<xfwzp1.phi()*180./M_PI<<" "<<xfwzp1.z()<<" last " - <<xlwzp1.perp()<<" "<<xlwzp1.phi()*180./M_PI<<" "<<xlwzp1.z()<<std::endl; + <<xfwzp1.perp()<<" "<<xfwzp1.phi()*invRad<<" "<<xfwzp1.z()<<" last " + <<xlwzp1.perp()<<" "<<xlwzp1.phi()*invRad<<" "<<xlwzp1.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip z>0 r,p,z " - <<xfszp.perp()<<" "<<xfszp.phi()*180./M_PI<<" "<<xfszp.z()<<" last " - <<xlszp.perp()<<" "<<xlszp.phi()*180./M_PI<<" "<<xlszp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + <<xfszp.perp()<<" "<<xfszp.phi()*invRad<<" "<<xfszp.z()<<" last " + <<xlszp.perp()<<" "<<xlszp.phi()*invRad<<" "<<xlszp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi strip z<0 r,p,z " - <<xfszp1.perp()<<" "<<xfszp1.phi()*180./M_PI<<" "<<xfszp1.z()<<" last " - <<xlszp1.perp()<<" "<<xlszp1.phi()*180./M_PI<<" "<<xlszp1.z()<<std::endl; + <<xfszp1.perp()<<" "<<xfszp1.phi()*invRad<<" "<<xfszp1.z()<<" last " + <<xlszp1.perp()<<" "<<xlszp1.phi()*invRad<<" "<<xlszp1.z()<<std::endl; Amg::Vector3D lxfszp = csc->localStripPos(fszp); Amg::Vector3D lxlszp = csc->localStripPos(lszp); @@ -2130,14 +2092,14 @@ void MuonGMCheck::checkreadoutcscgeo() - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi_S local z>0 r,p,z " - <<lxfszp.perp()<<" "<<lxfszp.phi()*180./M_PI<<" "<<lxfszp.z()<<" last " - <<lxlszp.perp()<<" "<<lxlszp.phi()*180./M_PI<<" "<<lxlszp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + <<lxfszp.perp()<<" "<<lxfszp.phi()*invRad<<" "<<lxfszp.z()<<" last " + <<lxlszp.perp()<<" "<<lxlszp.phi()*invRad<<" "<<lxlszp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi_S local z<0 r,p,z " - <<lxfszp1.perp()<<" "<<lxfszp1.phi()*180./M_PI<<" "<<lxfszp1.z()<<" last " - <<lxlszp1.perp()<<" "<<lxlszp1.phi()*180./M_PI<<" "<<lxlszp1.z()<<std::endl; + <<lxfszp1.perp()<<" "<<lxfszp1.phi()*invRad<<" "<<lxfszp1.z()<<" last " + <<lxlszp1.perp()<<" "<<lxlszp1.phi()*invRad<<" "<<lxlszp1.z()<<std::endl; if (m_check_surfaces) @@ -2232,10 +2194,10 @@ void MuonGMCheck::checkreadoutcscgeo() } void MuonGMCheck::buildRpcRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().module_end(); - IdContext rpcModuleContext = m_muonIdHelperTool->rpcIdHelper().module_context(); + IdContext rpcModuleContext = m_idHelperSvc->rpcIdHelper().module_context(); std::ofstream fout0("RPCMapIdAndHash.txt"); fout0 <<"RPC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2245,11 +2207,11 @@ void MuonGMCheck::buildRpcRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); - std::cout<<" Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); + ATH_MSG_INFO(" Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2268,20 +2230,18 @@ void MuonGMCheck::buildRpcRegionSelectorMap() new_extid = rpcid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<Idhash<<" new format "<<new_extid<<std::endl; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format "<<new_extid); RpcReadoutSet Set(p_MuonMgr, Id); int nmod = Set.NreadoutElements(); - std::cout<<" Number of modules in this RpcSet "<<nmod<<std::endl; - std::cout<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()<<std::endl; + ATH_MSG_INFO(" Number of modules in this RpcSet "<<nmod); + ATH_MSG_INFO(" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()); int ndbz = Set.NdoubletZ(); - std::cout<<" Number of modules in Phi/DoubletZ: "; - for (int i=1; i<=ndbz; i++) std::cout<<Set.NPhimodules(i)<<" "; - std::cout<<std::endl; - std::cout<<" Number of modules in this RpcSet "<<nmod<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()<<std::endl; - std::cout<<" Number of modules in Phi/DoubletZ: "; - for (int i=1; i<=ndbz; i++) std::cout<<Set.NPhimodules(i)<<" "; - std::cout<<std::endl; + ATH_MSG_INFO(" Number of modules in Phi/DoubletZ: "); + for (int i=1; i<=ndbz; i++) ATH_MSG_INFO(Set.NPhimodules(i)<<" "); + ATH_MSG_INFO(" Number of modules in this RpcSet "<<nmod<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()); + ATH_MSG_INFO(" Number of modules in Phi/DoubletZ: "); + for (int i=1; i<=ndbz; i++) ATH_MSG_INFO(Set.NPhimodules(i)<<" "); double zmin = 99999999; double zmax = -99999999; @@ -2292,13 +2252,13 @@ void MuonGMCheck::buildRpcRegionSelectorMap() unsigned int nmodules = 0; for (int dbz=1; dbz<=ndbz; dbz++) { - const RpcReadoutElement* rpcold = NULL; + const RpcReadoutElement* rpcold = nullptr; int ndbp = Set.NPhimodules(dbz); for (int dbp=1; dbp<=ndbp; dbp++) { - std::cout<<" dbz, dbp = "<<dbz<<" "<<dbp<<std::endl; + ATH_MSG_INFO(" dbz, dbp = "<<dbz<<" "<<dbp); const RpcReadoutElement* rpc = Set.readoutElement(dbz, dbp); - std::cout<<"_rpc = "<<rpc<<std::endl; + ATH_MSG_INFO("_rpc = "<<rpc); if ( rpc != rpcold ) { nmodules ++; @@ -2327,13 +2287,13 @@ void MuonGMCheck::buildRpcRegionSelectorMap() } } if (nmodules != Set.NreadoutElements()) - std::cout<<" nmod = "<<nmodules<<" != NreadoutElements() "<<nmod<<std::endl; + ATH_MSG_INFO(" nmod = "<<nmodules<<" != NreadoutElements() "<<nmod); // here define the eta and phi(0-2*pi) ranges coercePositivePhi(phimin); coercePositivePhi(phimax); double eta_min = Pzmin.eta(); double eta_max = Pzmax.eta(); - std::cout<<"eta range "<<eta_min<<" "<<eta_max<<" phi range "<<phimin<<" "<<phimax<<std::endl; + ATH_MSG_INFO("eta range "<<eta_min<<" "<<eta_max<<" phi range "<<phimin<<" "<<phimax); fout0 << new_extid << setiosflags(std::ios::fixed) << std::setprecision(0) << std::setw(6) @@ -2355,10 +2315,10 @@ void MuonGMCheck::buildRpcRegionSelectorMap() void MuonGMCheck::buildMdtRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); std::ofstream fout0("MDTMapIdAndHash.txt"); fout0 <<"MDT ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2367,11 +2327,11 @@ void MuonGMCheck::buildMdtRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2390,37 +2350,37 @@ void MuonGMCheck::buildMdtRegionSelectorMap() new_extid = mdtid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<Idhash<<" new format "<<new_extid; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format "<<new_extid); - IdContext mdtChannelContext = m_muonIdHelperTool->mdtIdHelper().channel_context(); + IdContext mdtChannelContext = m_idHelperSvc->mdtIdHelper().channel_context(); // get the element corresponding to multilayer = 1 const MdtReadoutElement* mdt1 = p_MuonMgr->getMdtReadoutElement(Id); - if (mdt1 == NULL) { - std::cout<<" Mdt Readout Element not found for Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Id)<<" go to next "<<std::endl; + if (!mdt1) { + ATH_MSG_INFO(" Mdt Readout Element not found for Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(Id)<<" go to next "); continue; } - std::cout<<" Station name / technology "<<mdt1->getStationName()<<" / "<<mdt1->getTechnologyName()<<std::endl; - Identifier Id2 = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, 1, 1); + ATH_MSG_INFO(" Station name / technology "<<mdt1->getStationName()<<" / "<<mdt1->getTechnologyName()); + Identifier Id2 = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, 1, 1); // get the element corresponding to multilayer = 2 const MdtReadoutElement* mdt2 = p_MuonMgr->getMdtReadoutElement(Id2); double tubePitch = mdt1->tubePitch(); int ntlay = mdt1->getNLayers(); int ntubesl1 = mdt1->getNtubesperlayer(); int ntubesl2 = 0; - if (mdt2 == NULL) { - std::cout<<" Mdt Readout Element not found for Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Id2)<<std::endl; + if (!mdt2) { + ATH_MSG_INFO(" Mdt Readout Element not found for Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(Id2)); } else ntubesl2 = mdt2->getNtubesperlayer(); Identifier Idv[4]; - Idv[0] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 1, 1); - Idv[1] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 1, ntubesl1); - Idv[2] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, ntlay, 1); - Idv[3] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, ntlay, ntubesl2); + Idv[0] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 1, 1); + Idv[1] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 1, ntubesl1); + Idv[2] = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, ntlay, 1); + Idv[3] = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, ntlay, ntubesl2); - std::cout<<" Number of tube layers "<<ntlay; - std::cout<<" Number of tubes / layer (1 ,2) "<<ntubesl1<<", "<<ntubesl2; + ATH_MSG_INFO(" Number of tube layers "<<ntlay); + ATH_MSG_INFO(" Number of tubes / layer (1 ,2) "<<ntubesl1<<", "<<ntubesl2); double rmin = 99999999.; double rmax = -99999999.; @@ -2432,44 +2392,44 @@ void MuonGMCheck::buildMdtRegionSelectorMap() double phimax = -999999.; double zpos21 = 0.; - Identifier Idsl = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 2, 1); + Identifier Idsl = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 2, 1); if (mdt1->barrel()) { zpos21 = (mdt1->tubePos(Idsl)).z()-(mdt1->tubePos(Idv[0])).z(); - if (zpos21 > 1.) std::cout<<" staggering this way >>>>> "<<std::endl; - else if (zpos21 <-1.) std::cout<<" staggering this way <<<<< "<<std::endl; - else std::cout<<" zpos 21 = 0 ??? "<<zpos21<<std::endl; + if (zpos21 > 1.) ATH_MSG_INFO(" staggering this way >>>>> "); + else if (zpos21 <-1.) ATH_MSG_INFO(" staggering this way <<<<< "); + else ATH_MSG_INFO(" zpos 21 = 0 ??? "<<zpos21); } else { zpos21 = (mdt1->tubePos(Idsl)).perp()-(mdt1->tubePos(Idv[0])).perp(); - if (zpos21 > 1.) std::cout<<" staggering this way /\\ "<<std::endl; - else if (zpos21 <-1.) std::cout<<" staggering this way \\/ "<<std::endl; - else std::cout<<" zpos 21 = 0 ??? "<<zpos21<<std::endl; + if (zpos21 > 1.) ATH_MSG_INFO(" staggering this way /\\ "); + else if (zpos21 <-1.) ATH_MSG_INFO(" staggering this way \\/ "); + else ATH_MSG_INFO(" zpos 21 = 0 ??? "<<zpos21); } for (int i=0; i<4; i++) { // - const MdtReadoutElement* mdt = NULL; + const MdtReadoutElement* mdt = nullptr; i<2 ? mdt = mdt1: mdt = mdt2; - if (mdt == NULL) { - std::cout<<" element not found for index i = "<<i<<" --------- "<<std::endl; + if (!mdt) { + ATH_MSG_INFO(" element not found for index i = "<<i<<" --------- "); if (i==2) { - Idv[2] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, ntlay, 1); + Idv[2] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, ntlay, 1); mdt = p_MuonMgr->getMdtReadoutElement(Idv[2]); } else if (i==3) { - Idv[3] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, ntlay, ntubesl1); + Idv[3] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, ntlay, ntubesl1); mdt = p_MuonMgr->getMdtReadoutElement(Idv[3]); } } - if (mdt == NULL) { - std::cout<<" Skipping element; i = "<<i<<" ----- "<<std::endl; + if (!mdt) { + ATH_MSG_INFO(" Skipping element; i = "<<i<<" ----- "); continue; } Amg::Vector3D mdtPos = mdt->tubePos(Idv[i]); - std::cout<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Idv[i])<<" index "<<i<<" posx,y,z "<<mdtPos<<" R = "<<mdtPos.perp()<<std::endl; + ATH_MSG_INFO(m_idHelperSvc->mdtIdHelper().show_to_string(Idv[i])<<" index "<<i<<" posx,y,z "<<mdtPos<<" R = "<<mdtPos.perp()); // Amg::Vector3D mdtPos1 = mdtPos; Amg::Vector3D mdtPos2 = mdtPos; @@ -2601,10 +2561,10 @@ void MuonGMCheck::buildMdtRegionSelectorMap() } double pminMod = mdtPos.phi() - dphi; double pmaxMod = mdtPos.phi() + dphi; - std::cout<<" Stack zmin, max "<<zminMod<<" "<<zmaxMod + ATH_MSG_INFO(" Stack zmin, max "<<zminMod<<" "<<zmaxMod <<" phimin, max "<<pminMod<<" "<<pmaxMod <<" Rmin, max "<<rminMod<<" "<<rmaxMod - <<" etamin, max "<<eminMod<<" "<<emaxMod<<std::endl; + <<" etamin, max "<<eminMod<<" "<<emaxMod); if (zminMod < zmin) { zmin = zminMod; @@ -2618,7 +2578,7 @@ void MuonGMCheck::buildMdtRegionSelectorMap() if (emaxMod > emax) emax = emaxMod; if (rminMod < rmin) rmin = rminMod; if (rmaxMod > rmax) rmax = rmaxMod; - std::cout<<" Module emin - emax "<<emin<<" "<<emax<<" phimin - phimax "<<phimin<<" "<<phimax<<std::endl; + ATH_MSG_INFO(" Module emin - emax "<<emin<<" "<<emax<<" phimin - phimax "<<phimin<<" "<<phimax); } @@ -2626,9 +2586,9 @@ void MuonGMCheck::buildMdtRegionSelectorMap() coercePositivePhi(phimin); coercePositivePhi(phimax); - std::cout<<" ***** Z range "<<zmin<<" "<<zmax<<" ***** R range "<<rmin<<" "<<rmax + ATH_MSG_INFO(" ***** Z range "<<zmin<<" "<<zmax<<" ***** R range "<<rmin<<" "<<rmax <<" --- eta range "<<emin<<" "<<emax - <<" phi range "<<phimin<<" "<<phimax<<std::endl; + <<" phi range "<<phimin<<" "<<phimax); fout0 << new_extid << setiosflags(std::ios::fixed) << std::setprecision(0) << std::setw(6) @@ -2650,10 +2610,10 @@ void MuonGMCheck::buildMdtRegionSelectorMap() } void MuonGMCheck::buildTgcRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->tgcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().module_end(); - const IdContext tgcModuleContext = m_muonIdHelperTool->tgcIdHelper().module_context(); + const IdContext tgcModuleContext = m_idHelperSvc->tgcIdHelper().module_context(); std::ofstream fout0("TGCMapIdAndHash.txt"); fout0 <<"TGC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2663,12 +2623,12 @@ void MuonGMCheck::buildTgcRegionSelectorMap() Identifier elemId = *i; IdentifierHash hashId; - int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(elemId,hashId,&tgcModuleContext); + int gethash_code = m_idHelperSvc->tgcIdHelper().get_hash(elemId,hashId,&tgcModuleContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(elemId); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<hashId<<std::endl; - else std::cout<<" hash Id NOT computed "<<hashId<<std::endl; + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(elemId); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<hashId); + else ATH_MSG_INFO(" hash Id NOT computed "<<hashId); std::string new_extid = ""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2687,27 +2647,27 @@ void MuonGMCheck::buildTgcRegionSelectorMap() new_extid = mdtid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<hashId<<" new format "<<new_extid; + ATH_MSG_INFO(extid<<" hash Id "<<hashId<<" new format "<<new_extid); const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(elemId); - if (tgc == NULL) + if (!tgc) { - std::cout<<" Tgc Readout Element not found for Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(elemId)<<" go to next "<<std::endl; + ATH_MSG_INFO(" Tgc Readout Element not found for Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(elemId)<<" go to next "); continue; } - std::cout<<" Station name / technology "<<tgc->getStationName()<<" / "<<tgc->getTechnologyName()<<std::endl; + ATH_MSG_INFO(" Station name / technology "<<tgc->getStationName()<<" / "<<tgc->getTechnologyName()); Amg::Vector3D posmin, posmax; float etamin, etamax; - int gapMin = m_muonIdHelperTool->tgcIdHelper().gasGapMin(elemId); - int gapMax = m_muonIdHelperTool->tgcIdHelper().gasGapMax(elemId); + int gapMin = m_idHelperSvc->tgcIdHelper().gasGapMin(elemId); + int gapMax = m_idHelperSvc->tgcIdHelper().gasGapMax(elemId); Identifier chId; - chId = m_muonIdHelperTool->tgcIdHelper().channelID(elemId,gapMin,0,1); - const int chmax = m_muonIdHelperTool->tgcIdHelper().channelMax(chId); + chId = m_idHelperSvc->tgcIdHelper().channelID(elemId,gapMin,0,1); + const int chmax = m_idHelperSvc->tgcIdHelper().channelMax(chId); posmax = tgc->channelPos(gapMin,0,chmax); // gapMax gives posmax! - chId = m_muonIdHelperTool->tgcIdHelper().channelID(elemId,gapMax,0,1); - const int chmin = m_muonIdHelperTool->tgcIdHelper().channelMin(chId); + chId = m_idHelperSvc->tgcIdHelper().channelID(elemId,gapMax,0,1); + const int chmin = m_idHelperSvc->tgcIdHelper().channelMin(chId); posmin = tgc->channelPos(gapMax,0,chmin); // gapMin gives posmin! // calculation based on active sensitive area @@ -2717,7 +2677,7 @@ void MuonGMCheck::buildTgcRegionSelectorMap() activeheight = tgc->length(); etamin = -logf(tan(atan((posctr.perp()-activeheight/2.)/fabs(posmin.z()))/2.)); etamax = -logf(tan(atan((posctr.perp()+activeheight/2.)/fabs(posmax.z()))/2.)); - if (m_muonIdHelperTool->tgcIdHelper().stationEta(elemId) < 0) { + if (m_idHelperSvc->tgcIdHelper().stationEta(elemId) < 0) { etamin = -etamin; etamax = -etamax; } @@ -2749,10 +2709,10 @@ void MuonGMCheck::buildTgcRegionSelectorMap() void MuonGMCheck::buildCscRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->cscIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->cscIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->cscIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->cscIdHelper().module_end(); - IdContext cscModuleContext = m_muonIdHelperTool->cscIdHelper().module_context(); + IdContext cscModuleContext = m_idHelperSvc->cscIdHelper().module_context(); std::ofstream fout0("CSCMapIdAndHash.txt"); fout0 <<"CSC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2761,11 +2721,11 @@ void MuonGMCheck::buildCscRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->cscIdHelper().get_hash(Id, Idhash, &cscModuleContext); - std::string extid = m_muonIdHelperTool->cscIdHelper().show_to_string(Id); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->cscIdHelper().get_hash(Id, Idhash, &cscModuleContext); + std::string extid = m_idHelperSvc->cscIdHelper().show_to_string(Id); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1=0, aux2, aux3=0, aux4, aux5; @@ -2788,38 +2748,38 @@ void MuonGMCheck::buildCscRegionSelectorMap() // aux2 is eta region (-1,1) // aux3 is phi region (1,8) if( aux1==0 || aux3==0 ) { - std::cout<< "ERROR : There is something wrong in buildCscRegionSelectorMap!" << std::endl; - std::cout<< "ERROR : Variables aux1 and/or aux3 not initialized - Taking emergency exit!" << std::endl; + ATH_MSG_ERROR("There is something wrong in buildCscRegionSelectorMap!"); + ATH_MSG_ERROR("Variables aux1 and/or aux3 not initialized - Taking emergency exit!"); throw; } - std::cout<<extid<<" hash Id "<<Idhash<<" new format " << new_extid << std::endl; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format " << new_extid); // retrieve CscReadoutElement Identifier Id2ndLayer; int chamberLayer = 2; const CscReadoutElement *csc; csc = p_MuonMgr->getCscReadoutElement(Id); - if (csc == NULL) { - std::cout << "Csc Readout Element not found for this Id ---- try 2nd layer"<<std::endl; - Id2ndLayer = m_muonIdHelperTool->cscIdHelper().parentID(Id); - Id2ndLayer = m_muonIdHelperTool->cscIdHelper().channelID(Id2ndLayer, chamberLayer, 1, 0, 1); + if (!csc) { + ATH_MSG_INFO("Csc Readout Element not found for this Id ---- try 2nd layer"); + Id2ndLayer = m_idHelperSvc->cscIdHelper().parentID(Id); + Id2ndLayer = m_idHelperSvc->cscIdHelper().channelID(Id2ndLayer, chamberLayer, 1, 0, 1); csc = p_MuonMgr->getCscReadoutElement(Id2ndLayer); - if (csc == NULL) + if (!csc) { - std::cout << "Csc Readout Element not found for 2nd layer too ---- skip"<<std::endl; + ATH_MSG_INFO("Csc Readout Element not found for 2nd layer too ---- skip"); continue; } else { - std::cout << "Csc Readout Element found for 2nd layer"<<std::endl; + ATH_MSG_INFO("Csc Readout Element found for 2nd layer"); } } - std::cout << "number of chamber layers : " << m_muonIdHelperTool->cscIdHelper().chamberLayerMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().chamberLayerMax(Id) << std::endl; - std::cout << "number of wire layers : " << m_muonIdHelperTool->cscIdHelper().wireLayerMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().wireLayerMax(Id)<< std::endl; - std::cout << "strip number : " << m_muonIdHelperTool->cscIdHelper().stripMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().stripMax(Id) << std::endl; + ATH_MSG_INFO("number of chamber layers : " << m_idHelperSvc->cscIdHelper().chamberLayerMin(Id) << "," << m_idHelperSvc->cscIdHelper().chamberLayerMax(Id)); + ATH_MSG_INFO("number of wire layers : " << m_idHelperSvc->cscIdHelper().wireLayerMin(Id) << "," << m_idHelperSvc->cscIdHelper().wireLayerMax(Id)); + ATH_MSG_INFO("strip number : " << m_idHelperSvc->cscIdHelper().stripMin(Id) << "," << m_idHelperSvc->cscIdHelper().stripMax(Id)); double eta_min = 99999999.; double eta_max = -99999999.; @@ -2831,11 +2791,11 @@ void MuonGMCheck::buildCscRegionSelectorMap() Identifier Id_eta_max; Identifier Id_eta_min; - for(int chlayer=1; chlayer<=m_muonIdHelperTool->cscIdHelper().chamberLayerMax(Id);chlayer++){ - for (int wlayer=1;wlayer<=m_muonIdHelperTool->cscIdHelper().wireLayerMax(Id);wlayer++){ + for(int chlayer=1; chlayer<=m_idHelperSvc->cscIdHelper().chamberLayerMax(Id);chlayer++){ + for (int wlayer=1;wlayer<=m_idHelperSvc->cscIdHelper().wireLayerMax(Id);wlayer++){ for (int phis=1; phis<=csc->NphiStrips(wlayer); phis++){ - Identifier phis_id = m_muonIdHelperTool->cscIdHelper().channelID(Id, chlayer, wlayer, 1, phis); + Identifier phis_id = m_idHelperSvc->cscIdHelper().channelID(Id, chlayer, wlayer, 1, phis); Amg::Vector3D phis_x = csc->localStripPos(phis_id); double phis_lenght = csc->stripLength(phis_id); @@ -2893,22 +2853,20 @@ void MuonGMCheck::buildCscRegionSelectorMap() Id_eta_min=phis_id; eta_min=gphis_x2.eta(); } - std::cout << "pm 1 n " << phis << " phi1 " << gphis_x1.phi() + ATH_MSG_INFO("pm 1 n " << phis << " phi1 " << gphis_x1.phi() << " phi2 " << gphis_x2.phi() << " phi_min " << phi_min - << " phi_max " << phi_max - << std::endl; + << " phi_max " << phi_max); - std::cout << "pm 1 n " << phis << " eta1 " << gphis_x1.eta() + ATH_MSG_INFO("pm 1 n " << phis << " eta1 " << gphis_x1.eta() << " eta2 " << gphis_x2.eta() << " eta_min " << eta_min - << " eta_max " << eta_max - << std::endl; - std::cout << "------------------------------------------------------------------------------------------------" << std::endl; + << " eta_max " << eta_max); + ATH_MSG_INFO("------------------------------------------------------------------------------------------------"); } for (int etas=1; etas<=csc->NetaStrips(wlayer); etas++){ - Identifier etas_id = m_muonIdHelperTool->cscIdHelper().channelID(Id, chlayer, wlayer, 0, etas); + Identifier etas_id = m_idHelperSvc->cscIdHelper().channelID(Id, chlayer, wlayer, 0, etas); Amg::Vector3D etas_x = csc->localStripPos(etas_id); double etas_lenght = csc->stripLength(etas_id); @@ -2965,48 +2923,46 @@ void MuonGMCheck::buildCscRegionSelectorMap() eta_min=getas_x2.eta(); } - std::cout << "pm 0 n " << etas << " phi1 " << getas_x1.phi() + ATH_MSG_INFO("pm 0 n " << etas << " phi1 " << getas_x1.phi() << " phi2 " << getas_x2.phi() << " phi_min " << phi_min - << " phi_max " << phi_max - << std::endl; + << " phi_max " << phi_max); - std::cout << "pm 0 n " << etas << " eta1 " << getas_x1.eta() + ATH_MSG_INFO("pm 0 n " << etas << " eta1 " << getas_x1.eta() << " eta2 " << getas_x2.eta() << " eta_min " << eta_min - << " eta_max " << eta_max - << std::endl; - std::cout << "------------------------------------------------------------------------------------------------" << std::endl; + << " eta_max " << eta_max); + ATH_MSG_INFO("------------------------------------------------------------------------------------------------"); } } //gas gaps } // chamber layers - int cl_phi_min = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_phi_min); - int cl_phi_max = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_phi_max); - int cl_eta_min = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_eta_min); - int cl_eta_max = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_eta_max); + int cl_phi_min = m_idHelperSvc->cscIdHelper().chamberLayer(Id_phi_min); + int cl_phi_max = m_idHelperSvc->cscIdHelper().chamberLayer(Id_phi_max); + int cl_eta_min = m_idHelperSvc->cscIdHelper().chamberLayer(Id_eta_min); + int cl_eta_max = m_idHelperSvc->cscIdHelper().chamberLayer(Id_eta_max); - int wl_phi_min = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_phi_min); - int wl_phi_max = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_phi_max); - int wl_eta_min = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_eta_min); - int wl_eta_max = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_eta_max); + int wl_phi_min = m_idHelperSvc->cscIdHelper().wireLayer(Id_phi_min); + int wl_phi_max = m_idHelperSvc->cscIdHelper().wireLayer(Id_phi_max); + int wl_eta_min = m_idHelperSvc->cscIdHelper().wireLayer(Id_eta_min); + int wl_eta_max = m_idHelperSvc->cscIdHelper().wireLayer(Id_eta_max); - int N_phi_min = m_muonIdHelperTool->cscIdHelper().strip(Id_phi_min); - int N_phi_max = m_muonIdHelperTool->cscIdHelper().strip(Id_phi_max); - int N_eta_min = m_muonIdHelperTool->cscIdHelper().strip(Id_eta_min); - int N_eta_max = m_muonIdHelperTool->cscIdHelper().strip(Id_eta_max); + int N_phi_min = m_idHelperSvc->cscIdHelper().strip(Id_phi_min); + int N_phi_max = m_idHelperSvc->cscIdHelper().strip(Id_phi_max); + int N_eta_min = m_idHelperSvc->cscIdHelper().strip(Id_eta_min); + int N_eta_max = m_idHelperSvc->cscIdHelper().strip(Id_eta_max); - int mp_phi_min = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_phi_min); - int mp_phi_max = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_phi_max); - int mp_eta_min = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_eta_min); - int mp_eta_max = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_eta_max); + int mp_phi_min = m_idHelperSvc->cscIdHelper().measuresPhi(Id_phi_min); + int mp_phi_max = m_idHelperSvc->cscIdHelper().measuresPhi(Id_phi_max); + int mp_eta_min = m_idHelperSvc->cscIdHelper().measuresPhi(Id_eta_min); + int mp_eta_max = m_idHelperSvc->cscIdHelper().measuresPhi(Id_eta_max); - std::cout << "--------> phi_min " << phi_min << " mp " << mp_phi_min << " chl " << cl_phi_min << " wl " << wl_phi_min << " strip " << N_phi_min << std::endl; - std::cout << "--------> phi_max " << phi_max << " mp " << mp_phi_max << " chl " << cl_phi_max << " wl " << wl_phi_max << " strip " << N_phi_max << std::endl; - std::cout << "--------> eta_min " << eta_min << " mp " << mp_eta_min << " chl " << cl_eta_min << " wl " << wl_eta_min << " strip " << N_eta_min << std::endl; - std::cout << "--------> eta_max " << eta_max << " mp " << mp_eta_max << " chl " << cl_eta_max << " wl " << wl_eta_max << " strip " << N_eta_max << std::endl; - std::cout << "--------> Dphi " << fabs(phi_max-phi_min) << " Deta " << fabs(eta_max-eta_min) << std::endl; + ATH_MSG_INFO("--------> phi_min " << phi_min << " mp " << mp_phi_min << " chl " << cl_phi_min << " wl " << wl_phi_min << " strip " << N_phi_min); + ATH_MSG_INFO("--------> phi_max " << phi_max << " mp " << mp_phi_max << " chl " << cl_phi_max << " wl " << wl_phi_max << " strip " << N_phi_max); + ATH_MSG_INFO("--------> eta_min " << eta_min << " mp " << mp_eta_min << " chl " << cl_eta_min << " wl " << wl_eta_min << " strip " << N_eta_min); + ATH_MSG_INFO("--------> eta_max " << eta_max << " mp " << mp_eta_max << " chl " << cl_eta_max << " wl " << wl_eta_max << " strip " << N_eta_max); + ATH_MSG_INFO("--------> Dphi " << fabs(phi_max-phi_min) << " Deta " << fabs(eta_max-eta_min)); if(aux1==51 && aux3==1) if (phi_min < 0) phi_min += 2.*M_PI; if(aux1==51 && aux3==1) if (phi_max < 0) phi_max += 2.*M_PI; @@ -3071,7 +3027,7 @@ void MuonGMCheck::testRpcCache_here() dbr_index, dbz_index); - if (rpc == NULL) { + if (!rpc) { continue; } nre++; @@ -3079,7 +3035,7 @@ void MuonGMCheck::testRpcCache_here() Identifier idr = rpc->identify(); - ATH_MSG_DEBUG("Filling cache for rpcRE n "<<nre<<" "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG("Filling cache for rpcRE n "<<nre<<" "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) ); rpc->fillCache(); } } @@ -3117,10 +3073,10 @@ void MuonGMCheck::testTgcCache_here() TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(sname_index, seta_index, sphi_index); - if (tgc == NULL) continue; + if (!tgc) continue; nre++; Identifier idr = tgc->identify(); - ATH_MSG_DEBUG(" Filling cache for tgcRE n. "<<nre<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for tgcRE n. "<<nre<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(idr) ); tgc->fillCache(); } } @@ -3158,12 +3114,12 @@ void MuonGMCheck::testCscCache_here() seta_index, sphi_index, ml); - if (csc == NULL) continue; + if (!csc) continue; nre++; Identifier idr = csc->identify(); - ATH_MSG_DEBUG(" Filling cache for cscRE n. "<<nre<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for cscRE n. "<<nre<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(idr) ); csc->fillCache(); } } @@ -3202,12 +3158,12 @@ void MuonGMCheck::testMdtCache_here() dbr_index); - if (mdt == NULL) continue; + if (!mdt) continue; nre++; Identifier idr = mdt->identify(); - ATH_MSG_DEBUG(" Filling cache for mdtRE n. "<<nre<<" "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for mdtRE n. "<<nre<<" "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) ); mdt->fillCache(); } // end of multilayer } // end of stPhi @@ -3220,10 +3176,10 @@ void MuonGMCheck::testMdtCache_here() void MuonGMCheck::testMdtDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().detectorElement_end(); - IdContext mdtDetElemContext = m_muonIdHelperTool->mdtIdHelper().detectorElement_context(); + IdContext mdtDetElemContext = m_idHelperSvc->mdtIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_MDT.txt"); fout0 <<"MDT ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3233,8 +3189,8 @@ void MuonGMCheck::testMdtDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtDetElemContext); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtDetElemContext); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG("MDT Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash<<" for Id "<<extid ); @@ -3266,7 +3222,7 @@ void MuonGMCheck::testMdtDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const MdtReadoutElement* mdt = p_MuonMgr->getMdtReadoutElement(Idhash); - if (mdt == NULL) + if (!mdt) { ATH_MSG_ERROR("MuonManager->getMdtReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3312,10 +3268,10 @@ void MuonGMCheck::testMdtDetectorElementHash() void MuonGMCheck::testRpcDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().detectorElement_end(); - IdContext rpcDetElemContext = m_muonIdHelperTool->rpcIdHelper().detectorElement_context(); + IdContext rpcDetElemContext = m_idHelperSvc->rpcIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_RPC.txt"); fout0 <<"RPC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3325,8 +3281,8 @@ void MuonGMCheck::testRpcDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcDetElemContext); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcDetElemContext); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); ATH_MSG_DEBUG("RPC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3352,7 +3308,7 @@ void MuonGMCheck::testRpcDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const RpcReadoutElement* rpc = p_MuonMgr->getRpcReadoutElement(Idhash); - if (rpc == NULL) + if (!rpc) { ATH_MSG_ERROR("MuonManager->getRpcReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3401,10 +3357,10 @@ void MuonGMCheck::testTgcDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->tgcIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().detectorElement_end(); - IdContext tgcDetElemContext = m_muonIdHelperTool->tgcIdHelper().detectorElement_context(); + IdContext tgcDetElemContext = m_idHelperSvc->tgcIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_TGC.txt"); fout0 <<"TGC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3414,8 +3370,8 @@ void MuonGMCheck::testTgcDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(Id, Idhash, &tgcDetElemContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->tgcIdHelper().get_hash(Id, Idhash, &tgcDetElemContext); + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(Id); ATH_MSG_DEBUG("TGC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3441,7 +3397,7 @@ void MuonGMCheck::testTgcDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(Idhash); - if (tgc == NULL) + if (!tgc) { ATH_MSG_ERROR("MuonManager->getTgcReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3487,10 +3443,10 @@ void MuonGMCheck::testCscDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->cscIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->cscIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->cscIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->cscIdHelper().detectorElement_end(); - IdContext cscDetElemContext = m_muonIdHelperTool->cscIdHelper().detectorElement_context(); + IdContext cscDetElemContext = m_idHelperSvc->cscIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_CSC.txt"); fout0 <<"CSC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3500,8 +3456,8 @@ void MuonGMCheck::testCscDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->cscIdHelper().get_hash(Id, Idhash, &cscDetElemContext); - std::string extid = m_muonIdHelperTool->cscIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->cscIdHelper().get_hash(Id, Idhash, &cscDetElemContext); + std::string extid = m_idHelperSvc->cscIdHelper().show_to_string(Id); ATH_MSG_DEBUG("CSC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3527,7 +3483,7 @@ void MuonGMCheck::testCscDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const CscReadoutElement* csc = p_MuonMgr->getCscReadoutElement(Idhash); - if (csc == NULL) + if (!csc) { ATH_MSG_ERROR("MuonManager->getCscReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx index c5ae193554ce9a1adf129ee45c0301a3fdd447ee..2e0aa7acd14698efb19c01aa8412ded512e1743e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx @@ -58,8 +58,6 @@ StatusCode CscCalibMonToolBase::initialize() ATH_MSG_INFO( "CscCalibMonToolBase : in initialize()" ); ATH_CHECK( m_idHelperSvc.retrieve() ); - ATH_MSG_DEBUG( " Found the MuonIdHelperTool. " ); - ATH_CHECK( m_readKey.initialize() ); //m_generic_path_csccalibmonitoring = "Muon/MuonCalibrationMonitoring/CSC"; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx index 968f750f11eced0ca3b7443088026ddfd82c9a2f..64f6d8159920607a7963ccc66c208dd6a5c65b89 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx @@ -27,7 +27,7 @@ namespace Muon { if (isCloseTrack(track1, track2)==true) return false; /// Invariant mass cut - if (std::fabs(getInvariantMass(track1, track2)-91187.6)>m_MaximalMassDifferenceToZBoson) return false; + if (std::abs(getInvariantMass(track1, track2)-91187.6)>m_MaximalMassDifferenceToZBoson) return false; if ((isIsolatedTrack(track1)==true) && (isIsolatedTrack(track2)==true)) return true; return false; @@ -86,8 +86,8 @@ namespace Muon { double InsituTrackTools::getDistance(const INavigable4Momentum *track1, const INavigable4Momentum *track2) { - double dphi = std::fabs(track1->phi()-track2->phi()); - if (dphi>M_PI) dphi = std::fabs(dphi-2.0*M_PI); + double dphi = std::abs(track1->phi()-track2->phi()); + if (dphi>M_PI) dphi = std::abs(dphi-2.0*M_PI); return std::sqrt(std::pow(track1->eta()-track2->eta(),2)+std::pow(dphi,2)); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx index 14341efcd198b087a2689fa24b1f71ee7ca8abb0..9ca7a4e8f482ab734c9cbca9c73ab2637a9a9ba9 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx @@ -125,7 +125,7 @@ std::string convertChamberName(int ChamberName , int ChamberEta , int ChamberPhi } std::stringstream eta_inttostring; std::string eta_str; - eta_inttostring << abs(Eta_int); + eta_inttostring << std::abs(Eta_int); eta_inttostring >> eta_str; Eta_string += eta_str; Eta_string += "C"; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx index c752a45e4e8d72366989cb2550ba6bc7e8264e0d..23653af5f6aba4c6a54c2e769d30f966ce4d6085 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx @@ -53,8 +53,8 @@ namespace Muon { hmass->SetBinError(i+1,mass_error); hwidth->SetBinContent(i+1,width); hwidth->SetBinError(i+1,width_error); - if( (std::fabs(mass)+mass_error)>maxmass ) maxmass=std::fabs(mass)+mass_error; - if( (std::fabs(width)+width_error)>maxwidth ) maxwidth=std::fabs(width)+width_error; + if( (std::abs(mass)+mass_error)>maxmass ) maxmass=std::abs(mass)+mass_error; + if( (std::abs(width)+width_error)>maxwidth ) maxwidth=std::abs(width)+width_error; } } if (maxmass>0.1) maxmass=0.1; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx index a200ff91924298bd1a320cdc8a441438bd1422bd..99c0310a6c590df143de8729aefe559def721159 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx @@ -81,19 +81,19 @@ void getMuonPTResolution( TH1F *hist, hist->Fit(&gaussian,"R"); gaussian.GetParameters(&par[0]); mean = par[1]; - sigma = fabs(par[2]); + sigma = std::abs(par[2]); gaussian.SetRange(mean-sigma*2.,mean+sigma*2.); // Check if converged, if yes then quit - if (fabs(1.0-old_sigma/sigma)<0.0001) break; + if (std::abs(1.0-old_sigma/sigma)<0.0001) break; old_sigma=sigma; } PTResMean = mean; - PTSigma = fabs(sigma); + PTSigma = std::abs(sigma); ErrMean = (gaussian.GetParError(1)); - ErrSigma = fabs((gaussian.GetParError(2))); + ErrSigma = std::abs((gaussian.GetParError(2))); int i=0; double TailContent=0; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx index 54b97ae43fdfd3fb4c15e2d33c2373be9888be2e..e0760b9afdc0418e7cb787d1e0b9c0d7c9d0c262 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx @@ -1,7 +1,5 @@ - ///////////////////////// -*- C++ -*- ///////////////////////////// - /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // MuonPhysValMonitoringTool.cxx @@ -466,7 +464,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() if (M<66000 || M>116000) continue; //choose the Z candidate closest to the Z pole - if multiple exist - float dM = fabs(M-91187.); + float dM = std::abs(M-91187.); if (dM>dMmin) continue; dMmin = dM; mZ=M; @@ -612,7 +610,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() else ATH_MSG_DEBUG("Chain "<<L1trig <<" is passed: NO"); } for (auto mu: m_vRecoMuons) { - if (passesAcceptanceCuts(mu) && fabs(mu->eta())<2.4 ) { + if (passesAcceptanceCuts(mu) && std::abs(mu->eta())<2.4 ) { if (mu->author()==1) { m_vRecoMuons_EffDen_CB.push_back(mu); ATH_MSG_DEBUG("##### m_vRecoMuons_EffDen_CB pt:"<< mu->pt()<<" phi:"<<mu->phi()<<" eta:"<< mu->eta()); @@ -846,7 +844,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() if ((((*mufeat.cptr())[i]->author())==m_SelectedAuthor)&& (deltaR((*mufeat.cptr())[i],m_vRecoMuons_EffDen.at(k))<0.1) ) { break_flag=true; ATH_MSG_DEBUG(" $$$ match Reco_EffDen "<<muonItem<<" pt: "<< m_vRecoMuons_EffDen.at(k)->pt()<< " eta: "<<m_vRecoMuons_EffDen.at(k)->eta()<< " phi: "<<m_vRecoMuons_EffDen.at(k)->phi()<< " author: "<< m_vRecoMuons_EffDen.at(k)->author()); - ATH_MSG_DEBUG(" $$$ match EF MuidCo feature "<<muonItem<<" pt: "<< (*mufeat.cptr())[i]->pt()<< " eta: "<<(*mufeat.cptr())[i]->eta()<< " phi: "<<(*mufeat.cptr())[i]->phi()<< " author: "<< (*mufeat.cptr())[i]->author() << " rel_p "<< ( fabs(((*mufeat.cptr())[i]->pt()-m_vRecoMuons_EffDen.at(k)->pt())/(m_vRecoMuons_EffDen.at(k)->pt()))) ); + ATH_MSG_DEBUG(" $$$ match EF MuidCo feature "<<muonItem<<" pt: "<< (*mufeat.cptr())[i]->pt()<< " eta: "<<(*mufeat.cptr())[i]->eta()<< " phi: "<<(*mufeat.cptr())[i]->phi()<< " author: "<< (*mufeat.cptr())[i]->author() << " rel_p "<< ( std::abs(((*mufeat.cptr())[i]->pt()-m_vRecoMuons_EffDen.at(k)->pt())/(m_vRecoMuons_EffDen.at(k)->pt()))) ); for (unsigned int j=0; j<m_selectMuonCategories.size(); j++) { if (m_selectMuonCategories[j]==ALL) { m_TriggerMuonValidationPlots[j]->fillNumEff(*m_vRecoMuons_EffDen.at(k), muonItem); @@ -1271,7 +1269,7 @@ void MuonPhysValMonitoringTool::handleMuonTrack(const xAOD::TrackParticle* tp, x if (m_selectMuonCategories[i]==ALL || m_selectMuonCategories[i]==thisMuonCategory) { if (type==xAOD::Muon::InnerDetectorTrackParticle) { - if (m_fwdtracksName!="" && fabs((*truthLink)->eta())>2.5) m_muonIDForwardTrackValidationPlots[i]->fill(*truthLink, tp); + if (m_fwdtracksName!="" && std::abs((*truthLink)->eta())>2.5) m_muonIDForwardTrackValidationPlots[i]->fill(*truthLink, tp); else if (m_tracksName!="") { m_muonIDTrackValidationPlots[i]->fill(*truthLink, tp); if (passesMuonTrackSel) m_muonIDSelectedTrackValidationPlots[i]->fill(*truthLink,tp); @@ -1325,7 +1323,7 @@ void MuonPhysValMonitoringTool::L2SATriggerResolution(){ ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); k_L2SAMu_MinDeltaR=-1; MinDeltaR=1000; @@ -1367,7 +1365,7 @@ void MuonPhysValMonitoringTool::L2CBTriggerResolution(){ ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); k_L2CBMu_MinDeltaR=-1; MinDeltaR=1000; @@ -1424,7 +1422,7 @@ ATH_MSG_DEBUG(" m_vEFMuons.size()"<<m_vEFMuons.size()); ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); for (unsigned int l=0; l<vAvailableAuthors.size(); l++){ k_EFMu_MinDeltaR=-1; @@ -1573,7 +1571,7 @@ MuonPhysValMonitoringTool::MUCATEGORY MuonPhysValMonitoringTool::getMuonSegmentT truthLink = truthMuSeg->auxdata<TruthLink>("truthParticleLink"); if (truthLink.isValid()) { int theBarcode = (*truthLink)->barcode(); - if (abs( (*truthLink)->pdgId() ) != 13) return REST; + if (std::abs( (*truthLink)->pdgId() ) != 13) return REST; for (const auto muTruthPart: *muonTruthContainer) { if (muTruthPart->barcode() == theBarcode) { @@ -1897,54 +1895,10 @@ void MuonPhysValMonitoringTool::modifyHistogram(TH1* hist) } -// std::vector<const xAOD::TrackParticle*> MuonPhysValMonitoringTool::getMatchedTracks(const xAOD::TrackParticleContainer* Tracks) -// { -// std::vector<const xAOD::TrackParticle*> matchedTracks; -// std::vector<const xAOD::TruthParticle*> truthParticles; - -// for (const auto trk: *Tracks){ -// // find if this is a duplicate / fake: - -// float prob = getMatchingProbability(*trk); -// if (prob<0.8) continue; //bad matching prob, probably a fake; - -// const xAOD::TruthParticle* truthMu = findTruthMuon(trk); -// if (!truthMu) continue; -// //loop over accumulated matched tracks -// bool isDuplicate=false; -// for (unsigned int i=0; i<matchedTracks.size(); i++) { -// if (truthMu==truthParticles[i]) { //two tracks pointing to the same truth particle... resolve by truthMatchProbability -// isDuplicate = true; -// if (prob > getMatchingProbability(*matchedTracks[i])) { -// matchedTracks[i] = trk; -// } -// } -// } -// if (!isDuplicate) { -// truthParticles.push_back(truthMu); -// matchedTracks.push_back(trk); -// } -// } -// truthParticles.clear(); -// return matchedTracks; -// } -// const xAOD::TruthParticle* MuonPhysValMonitoringTool::findTruthMuon(const xAOD::TrackParticle* trk) -// { -// if( !trk ) return nullptr; -// if( !trk->isAvailable<TruthLink>("truthParticleLink") ) return nullptr; -// TruthLink truthLink = trk->auxdata<TruthLink>("truthParticleLink"); -// if (!truthLink.isValid()) return nullptr; - -// int truthType = trk->auxdata< int >("truthType"); -// if (truthType<5 || truthType>8) return nullptr; //not muon - -// return (*truthLink); -// } - bool MuonPhysValMonitoringTool::passesAcceptanceCuts(const xAOD::IParticle* prt) { if( prt->pt() < 2000. ) return false; - if( fabs(prt->eta()) > 2.7 ) return false; + if( std::abs(prt->eta()) > 2.7 ) return false; return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx index 4816df5dcd652930be725de3233db00daf4bc2db..bf6799e79102ff1ac33b70308a821abafe6f8d03 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.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 "TriggerMuonValidationPlots.h" @@ -185,22 +185,22 @@ void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::Muon &Trigmu, if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] )) { //if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] ) || m_selectedAuthors[i]==xAOD::Muon::NumberOfMuonAuthors) { m_oEFTriggerMuonResolutionPlots[i]->fill(Trigmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oEFTriggerMuonBarrelResolutionPlots[i]->fill(Trigmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oEFTriggerMuonEndcapsResolutionPlots[i]->fill(Trigmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oEFTriggerMuonBarrelResolutionPlots[i]->fill(Trigmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oEFTriggerMuonEndcapsResolutionPlots[i]->fill(Trigmu, Recomu); } } } void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::L2StandAloneMuon &L2SAmu, const xAOD::Muon &Recomu) { m_oL2TriggerMuonResolutionPlots[0]->fill(L2SAmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[0]->fill(L2SAmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[0]->fill(L2SAmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[0]->fill(L2SAmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[0]->fill(L2SAmu, Recomu); } void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::L2CombinedMuon &L2CBmu, const xAOD::Muon &Recomu) { m_oL2TriggerMuonResolutionPlots[1]->fill(L2CBmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[1]->fill(L2CBmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[1]->fill(L2CBmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[1]->fill(L2CBmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[1]->fill(L2CBmu, Recomu); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h index 25015ae43a404617d2d13f0a0ef923f72a69e130..e13ed2a63f064da249da9691e3213b8f5e315503 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.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 */ /* ********************************************************************** @@ -19,65 +19,38 @@ #ifndef CSCSegmValAlg_H #define CSCSegmValAlg_H -// Gaudi Tools -#include "GaudiKernel/StatusCode.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/MsgStream.h" - -// Athena Monitoring -#include "AthenaMonitoring/AthenaMonManager.h" -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "AthenaBaseComps/AthAlgorithm.h" -// Muon Segment #include "MuonSegment/MuonSegment.h" #include "TrkSegment/SegmentCollection.h" - -// Muon Track -#include "TrkParameters/TrackParameters.h" #include "TrkTrack/Track.h" -#include "TrkTrack/TrackCollection.h" -//TDT #include "TrigDecisionTool/TrigDecisionTool.h" - #include "StoreGate/ReadHandleKey.h" - #include "MuonRecHelperTools/IMuonEDMHelperSvc.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" -// STL #include <vector> #include <string> -#include <map> #include <memory> class TH1; class TH1F; class TH2F; -class CscIdHelper; -class TgcIdHelper; - -namespace Muon { - class MuonIdHelperTool; -} - namespace Trk { - class IUpdator; - class RIO_OnTrack; - class Track; - class TrackStateOnSurface; class MeasurementBase; } - + class CSCSegmValAlg : public ManagedMonitorToolBase { public: /** Constructor */ CSCSegmValAlg( const std::string & type, const std::string & name, const IInterface* parent ); /** Destructor */ - virtual ~CSCSegmValAlg(); + virtual ~CSCSegmValAlg()=default; /** Histogram booking method */ virtual StatusCode bookHistograms(); /** Histogram filling method */ @@ -85,7 +58,6 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { virtual StatusCode procHistograms(); StatusCode initialize(); - StatusCode finalize(); private: @@ -129,7 +101,6 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { TH2F* m_h2CSC_Segm_NumOfSegs_EA; TH2F* m_h2CSC_Segm_NumOfSegs_EC; - //unsigned int m_ncoll; std::vector<std::string> m_clusStatWord; std::vector<std::string> m_NClusWord; @@ -186,12 +157,10 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { TH2F* m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA; TH2F* m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC; - // Tool handles ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc {this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc", "Handle to the service providing the IMuonEDMHelperSvc interface" }; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; }; #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h index f7b30ea749e2295040b9b129e2b3887afdced43f..4784221b8963f2c490eb896fbcf484aba4c10f7c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h @@ -1,29 +1,29 @@ /* - 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 CscClusterValAlg_H #define CscClusterValAlg_H +#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "MuonPrepRawData/CscPrepDataContainer.h" #include "MuonPrepRawData/CscStripPrepDataContainer.h" - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "TrigDecisionTool/TrigDecisionTool.h" - #include "StoreGate/ReadHandleKey.h" - +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "CscClusterization/ICscStripFitter.h" +#include "CscCalibTools/ICscCalibTool.h" + +#include <vector> +#include <string> class TH1; class TH1F; class TH2F; -class ICscStripFitter; -class ICscCalibTool; - class CscClusterValAlg : public ManagedMonitorToolBase { public: @@ -44,14 +44,13 @@ class CscClusterValAlg : public ManagedMonitorToolBase { virtual StatusCode fillHistograms(); // finalize - virtual StatusCode procHistograms(); + virtual StatusCode procHistograms(){return StatusCode::SUCCESS;} float stripsSum_EA; float stripsSum_EAtest; float stripsSum_EC; float stripsSum_ECtest; - private: // initialize histograms @@ -72,9 +71,7 @@ class CscClusterValAlg : public ManagedMonitorToolBase { std::string m_cscClusterPath, m_cscGenPath; unsigned int m_qmaxADCCut; - // Id helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // Strip fitter. ToolHandle<ICscStripFitter> m_stripFitter; @@ -111,11 +108,9 @@ class CscClusterValAlg : public ManagedMonitorToolBase { TH2F *m_h2csc_clus_qmax_signal_EA; TH1F *m_h1csc_clus_qmax_signal_EA_count; - //TH1F *m_h1csc_clus_qmax_signal_EA_occupancy; TH2F *m_h2csc_clus_qmax_signal_EC; TH1F *m_h1csc_clus_qmax_signal_EC_count; - //TH1F *m_h1csc_clus_qmax_signal_EC_occupancy; // q_sum = q_max + q_left + q_right of cluster TH2F *m_h2csc_clus_qsum; @@ -124,12 +119,10 @@ class CscClusterValAlg : public ManagedMonitorToolBase { TH2F *m_h2csc_clus_qsum_signal_EA; TH1F *m_h1csc_clus_qsum_signal_EA_count; - //TH1F *m_h1csc_clus_qsum_signal_EA_occupancy; TH1F *m_h1csc_clus_qsum_signal_EA_lfitmean; TH2F *m_h2csc_clus_qsum_signal_EC; TH1F *m_h1csc_clus_qsum_signal_EC_count; - //TH1F *m_h1csc_clus_qsum_signal_EC_occupancy; TH1F *m_h1csc_clus_qsum_signal_EC_lfitmean; // sampling time - eta cluster diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h index 232f63c93bd7f5758b848548ca5e3046f84d6d5f..ff6dfcd8d61f21e737dc5a96b42faa5c362515fe 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.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 CscPrdValAlg_H @@ -9,15 +9,15 @@ #include "StoreGate/ReadHandleKey.h" #include "MuonPrepRawData/CscStripPrepDataContainer.h" #include "xAODEventInfo/EventInfo.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "CscClusterization/ICscStripFitter.h" class TH1; class TH1F; class TH2F; -class ICscStripFitter; - class CscPrdValAlg: public ManagedMonitorToolBase { public: @@ -30,7 +30,7 @@ class CscPrdValAlg: public ManagedMonitorToolBase { StatusCode bookHistograms(); StatusCode fillHistograms(); - StatusCode procHistograms(); + StatusCode procHistograms(){return StatusCode::SUCCESS;} StatusCode checkHists(bool fromFinalise); private: @@ -50,9 +50,7 @@ class CscPrdValAlg: public ManagedMonitorToolBase { // Strip fitter ToolHandle<ICscStripFitter> m_stripFitter; - // CSC identifier helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; StatusCode fillLumiBlock(); int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h index cf366098c2dab44f0825e6d1adccf84525a34c27..e201d0c3e8fa7ab440e03c1db7cc0d6827797a3c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h @@ -1,23 +1,21 @@ /* - 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 CscRdoValAlg_H #define CscRdoValAlg_H #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/ReadHandleKey.h" #include "MuonRDO/CscRawDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" class TH1F; class TH2F; -namespace Muon { - class ICSC_RDO_Decoder; -} - class CscRdoValAlg: public ManagedMonitorToolBase { @@ -32,7 +30,7 @@ class CscRdoValAlg: public ManagedMonitorToolBase StatusCode bookHistograms(); StatusCode fillHistograms(); - StatusCode procHistograms(); + StatusCode procHistograms(){return StatusCode::SUCCESS;} StatusCode checkHists(bool fromFinalise); private: @@ -46,8 +44,7 @@ class CscRdoValAlg: public ManagedMonitorToolBase size_t m_cscNoiseCut; SG::ReadHandleKey<CscRawDataContainer> m_cscRdoKey{this,"CSCRawDataKey","CSCRDO","CSC RDO"}; std::string m_cscRDOPath, m_cscGenPath; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // CSC RDO Decoder ToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx index 6b770d2c7d26a1d808c8715fc913295ea88bb752..609dc1436d759eca7af3304fd3ce7664e6cdf29f 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx @@ -17,11 +17,6 @@ #include "MuonPrepRawData/CscStripPrepDataContainer.h" #include "MuonPrepRawData/CscPrepData.h" -#include "MuonRecHelperTools/IMuonEDMHelperSvc.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - // Track #include "TrkTrack/TrackCollection.h" #include "TrkEventPrimitives/PropDirection.h" @@ -32,11 +27,6 @@ #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h" #include "MuonRIO_OnTrack/CscClusterOnTrack.h" -// Gaudi Tools -#include "GaudiKernel/SmartDataPtr.h" -#include "GaudiKernel/INTupleSvc.h" -#include "AthenaMonitoring/AthenaMonManager.h" - // ROOT #include "TH1F.h" #include "TH2F.h" @@ -53,7 +43,6 @@ CSCSegmValAlg::CSCSegmValAlg( const std::string & type, const std::string & name m_debuglevel(false), m_bookedhistos(false) { - //declareProperty( "UseCollections", m_segmCollectionFlag); declareProperty( "SegmentSlopeCut", m_segmSlope); declareProperty( "ClusterStatus", m_clusStatWord); @@ -64,34 +53,21 @@ CSCSegmValAlg::CSCSegmValAlg( const std::string & type, const std::string & name ATH_MSG_INFO( " in CSCSegmValAlg::CSCSegmValAlg() " ); } - -//________________________________________________________________________________________________________ -CSCSegmValAlg::~CSCSegmValAlg() { - ATH_MSG_INFO( " in CSCSegmValAlg::~CSCSegmValAlg() " ); -} - - - //________________________________________________________________________________________________________ StatusCode CSCSegmValAlg::initialize() { m_bookedhistos=false; - StatusCode sc = ManagedMonitorToolBase::initialize(); - if(!sc.isSuccess()) return sc; + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in CSCSegmValAlg::init()" ); - if( m_doEvtSel ) { - sc = m_trigDec.retrieve(); - if ( sc.isFailure() ) { + if (m_trigDec.retrieve().isFailure()) { ATH_MSG_WARNING ( "CSCSegmValAlg: Unable to retrieve trigger decision tool"); m_doEvtSel = false; - //return sc; } else { ATH_MSG_INFO ( "TrigDecisionTool : " << "Using TDT \"" << m_trigDec->name() << "\"" ); } - //m_doEvtSel = false; } if(m_sampSelTriggers.empty() && m_doEvtSel) { @@ -120,37 +96,12 @@ StatusCode CSCSegmValAlg::initialize() { m_NClusWord.push_back("123"); m_NClusWord.push_back("All"); - - //initializing tools - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL( "DetectorStore service not found !" ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Defined DetectorStore" ); - - - // Retrieve helper tools - sc = m_edmHelperSvc.retrieve(); - if (sc.isFailure()){ - ATH_MSG_FATAL("Could not get " << m_edmHelperSvc ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Retrieved " << m_edmHelperSvc ); - - sc = m_muonIdHelperTool.retrieve(); - if (sc.isFailure()){ - ATH_MSG_FATAL( "Could not get " << m_muonIdHelperTool ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Retrieved " << m_muonIdHelperTool ); - + StoreGateSvc* detStore = nullptr; + ATH_CHECK(service("DetectorStore", detStore)); + ATH_CHECK(m_edmHelperSvc.retrieve()); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_segmKey.initialize()); - - return sc; + return StatusCode::SUCCESS; } @@ -413,10 +364,7 @@ void CSCSegmValAlg::bookSegmentHistograms() { "Endcap A: #phi-cluster vs. good #eta-cluster;good #eta-cluster counts;good #phi-cluster counts", nqbins,nqmin,nqmax, nqbins,nqmin,nqmax); regCSCHist(m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA, m_segmDetail_EA.get()); regCSCHist(m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC, m_segmDetail_EC.get()); - - //m_h2csc_clus_r_vs_z_hitmap = new TH2F("h2csc_clus_r_vs_z_hitmap", "R vs. Z Cluster hitmap;z(CLHEP::mm);R(CLHEP::mm)",200, -10000., 10000., 40, 0., 4000); - //m_h2csc_clus_y_vs_x_hitmap = new TH2F("h2csc_clus_y_vs_x_hitmap", "Y vs. X Cluster hitmap;x(CLHEP::mm);y(CLHEP::mm)",100, -5000., 5000., 100, -5000., 5000); - + m_bookedhistos=true; } @@ -429,15 +377,10 @@ StatusCode CSCSegmValAlg::bookHistograms() { if( m_environment == AthenaMonManager::tier0 || m_environment == AthenaMonManager::tier0ESD ) { - //if(newEventsBlock){} - //if(newLumiBlock){} - //if(newRun) { if(!m_bookedhistos) bookSegmentHistograms(); - //} // if NewRun } // environment if return sc; - } @@ -457,8 +400,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { // arrays to hold cluster-count // 32 chambers and 8 layers (each has one extra - index '0' is not counted) int clusCount[33][9]; - //, m_sigclusCount[33][9]; - //unsigned int m_nEtaClusWidthCnt = 0, m_nPhiClusWidthCnt = 0; for(unsigned int kl = 0; kl < 33; kl++ ) { for(unsigned int cm3 = 0; cm3 < 9; cm3++ ) { clusCount[kl][cm3] = 0; @@ -538,7 +479,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { chi2 = fq->chiSquared(); ndof = fq->numberDoF(); ATH_MSG_DEBUG( "Chi2 " << chi2 ); - //chi2_histo->Fill(chi2); ATH_MSG_DEBUG( "Ndof " << ndof ); } @@ -550,7 +490,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { bool segmAngle_cut = segmSlopeCut(segm_ly, segm_ayz, segm_cut); ATH_MSG_DEBUG(" local_pos: " << segm_ly << "\tangle_yz: " << segm_ayz << "\tcut: " << segm_cut << "\t pass = " << segmAngle_cut ); - //if(!segmAngle_cut) continue; //already in the new reconstruction ATH_MSG_DEBUG( "R " << segm->globalPosition().perp() ); @@ -579,10 +518,10 @@ StatusCode CSCSegmValAlg::fillHistograms() { const Trk::MeasurementBase* rio = meas.at(0); Identifier segmId = m_edmHelperSvc->getIdentifier(*rio); - int segm_stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(segmId); - int segm_stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(segmId); - int segm_stationName = m_muonIdHelperTool->cscIdHelper().stationName(segmId); - std::string segm_stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(segm_stationName); + int segm_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(segmId); + int segm_stationEta = m_idHelperSvc->cscIdHelper().stationEta(segmId); + int segm_stationName = m_idHelperSvc->cscIdHelper().stationName(segmId); + std::string segm_stationString = m_idHelperSvc->cscIdHelper().stationNameString(segm_stationName); int segm_chamberType = segm_stationString == "CSS" ? 0 : 1; int segm_sectorNo = segm_stationEta * (2 * segm_stationPhi - segm_chamberType); // [-16 -> -1] and [+1 -> +16] int segm_isec = segm_sectorNo < 0 ? segm_sectorNo*(-1) : segm_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] @@ -591,13 +530,11 @@ StatusCode CSCSegmValAlg::fillHistograms() { else m_h2CSC_Segm_NumOfSegs_EC->Fill(n_clust, segm_sectorNo); // Loop over clusters - // [i][j] {i == 0(EA), 1(EC) } float clus_kiloele = 1.0e-3; // multiply # of electrons by this number to get kiloElectrons (1 ke = 1 ADC) int eta_clus_count[2][2] = {{0},{0}}, phi_clus_count[2][2] = {{0},{0}}; // no. of prec/trans hits per segment float eta_clus_qsum[2][5] = {{-1.}, {-1.}}, phi_clus_qsum[2][5] = {{-1.}, {-1.}}; // qsum over each prec/trans. layer on segment float eta_clus_time[2][5] = {{-1.}, {-1.}}, phi_clus_time[2][5] = {{-1.}, {-1.}}; // time over each prec/trans. layer on segment int eta_clus_use[2][5] = {{0},{0}}, phi_clus_use[2][5] = {{0}, {0}}; - //int eta_clus_status[5] = {-1}, phi_clus_status[5] = {-1}; layerindex = 0; @@ -608,24 +545,21 @@ StatusCode CSCSegmValAlg::fillHistograms() { Identifier clusId = m_edmHelperSvc->getIdentifier(*clust_rot); // get the cluster coordinates - int clus_stationName = m_muonIdHelperTool->cscIdHelper().stationName(clusId); - std::string clus_stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(clus_stationName); + int clus_stationName = m_idHelperSvc->cscIdHelper().stationName(clusId); + std::string clus_stationString = m_idHelperSvc->cscIdHelper().stationNameString(clus_stationName); int clus_chamberType = clus_stationString == "CSS" ? 0 : 1; - int clus_stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(clusId); - int clus_stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(clusId); - int clus_wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(clusId); - int clus_measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(clusId); + int clus_stationEta = m_idHelperSvc->cscIdHelper().stationEta(clusId); + int clus_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(clusId); + int clus_wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(clusId); + int clus_measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(clusId); // convert to my coordinates int clus_sectorNo = clus_stationEta * (2 * clus_stationPhi - clus_chamberType); // [-16 -> -1] and [+1 -> +16] float clus_secLayer = clus_sectorNo + 0.2 * (clus_wireLayer - 1) + 0.1; - //int xfac = clus_measuresPhi ? -1 : 1; // [-1 -> -48] / [+1 -> +192] int clus_isec = clus_sectorNo < 0 ? clus_sectorNo*(-1) : clus_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] int clus_ilay = (clus_measuresPhi ? clus_wireLayer : clus_wireLayer+4); // check the cluster status; probably need to read status info from jobOptions - not done for the moment - // status = Muon::CscStatusUnspoiled (i.e 0) or Muon::CscStatusSplitUnspoiled (i.e 10) are considered good for precision clusters - // status = Muon::CscStatusSimple (i.e 1) could be good for non-precision clusters (i.e for phi-layers) Muon::CscClusterStatus status = clust_rot->status(); if(segm_stationEta == 1) { if(clus_measuresPhi == 0) m_h1CSC_Segm_StatOfClus_Eta_EA->Fill(status); @@ -634,10 +568,7 @@ StatusCode CSCSegmValAlg::fillHistograms() { if(clus_measuresPhi == 0) m_h1CSC_Segm_StatOfClus_Eta_EC->Fill(status); else m_h1CSC_Segm_StatOfClus_Phi_EC->Fill(status); } - - //if(clus_measuresPhi == 0) eta_clus_status[clus_wireLayer] = status; - //else phi_clus_status[clus_wireLayer] = status; - + std::string clus_stat = Muon::toString(status); bool clus_status = ( (clus_stat == "unspoiled") || (clus_stat == "unspoiled with split") || @@ -649,16 +580,11 @@ StatusCode CSCSegmValAlg::fillHistograms() { // get cluster const Muon::CscPrepData* theClus = clust_rot->prepRawData(); float clus_qsum = 0, clus_time = -1.; - //float clus_globx = 0., clus_globy = 0., clus_globz = 0., clus_globr = 0.; if(theClus) { clus_qsum = theClus->charge() * clus_kiloele; clus_time = theClus->time(); - //clus_globx = theClus->globalPosition().x(); - //clus_globy = theClus->globalPosition().y(); - //clus_globz = theClus->globalPosition().z(); - //clus_globr = theClus->globalPosition().perp(); - + if(clus_measuresPhi == 0) { if(clus_stationEta == 1) eta_clus_count[0][0]++; else eta_clus_count[1][0]++; @@ -687,13 +613,13 @@ StatusCode CSCSegmValAlg::fillHistograms() { eta_clus_time[0][clus_wireLayer] = clus_time; eta_clus_use[0][clus_wireLayer] = 1; m_h2CSC_Segm_QsumOfGoodClusMap_Eta_EA->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EA->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EA->Fill(clus_time, clus_secLayer); } else { eta_clus_qsum[1][clus_wireLayer] = clus_qsum; eta_clus_time[1][clus_wireLayer] = clus_time; eta_clus_use[1][clus_wireLayer] = 1; m_h2CSC_Segm_QsumOfGoodClusMap_Eta_EC->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EC->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EC->Fill(clus_time, clus_secLayer); } } @@ -706,14 +632,14 @@ StatusCode CSCSegmValAlg::fillHistograms() { phi_clus_use[0][clus_wireLayer] = 1; phi_clus_count[0][1]++; m_h2CSC_Segm_QsumOfGoodClusMap_Phi_EA->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EA->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EA->Fill(clus_time, clus_secLayer); } else { phi_clus_qsum[1][clus_wireLayer] = clus_qsum; phi_clus_time[1][clus_wireLayer] = clus_time; phi_clus_use[1][clus_wireLayer] = 1; phi_clus_count[1][1]++; m_h2CSC_Segm_QsumOfGoodClusMap_Phi_EC->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EC->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EC->Fill(clus_time, clus_secLayer); } } @@ -770,32 +696,28 @@ StatusCode CSCSegmValAlg::fillHistograms() { if(i==1) m_h1CSC_Segm_QsumOfClus_Eta_EC->Fill(eta_clus_qsum[i][j]); if(i==0) m_h1CSC_Segm_QsumOfClus_Phi_EA->Fill(phi_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfClus_Phi_EC->Fill(phi_clus_qsum[i][j]); - if(i==0 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EA->Fill(eta_clus_time[i][j]); - if(i==1 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EC->Fill(eta_clus_time[i][j]); - if(i==0 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EA->Fill(phi_clus_time[i][j]); - if(i==1 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EC->Fill(phi_clus_time[i][j]); + if(i==0 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EA->Fill(eta_clus_time[i][j]); + if(i==1 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EC->Fill(eta_clus_time[i][j]); + if(i==0 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EA->Fill(phi_clus_time[i][j]); + if(i==1 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EC->Fill(phi_clus_time[i][j]); if(phi_clus_use[i][j] && eta_clus_use[i][j]) { eta_clus_qsum_tot += eta_clus_qsum[i][j]; if(i==0) m_h1CSC_Segm_QsumOfGoodClus_Eta_EA->Fill(eta_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfGoodClus_Eta_EC->Fill(eta_clus_qsum[i][j]); - if(i==0 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EA->Fill(eta_clus_time[i][j]); - if(i==1 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EC->Fill(eta_clus_time[i][j]); + if(i==0 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EA->Fill(eta_clus_time[i][j]); + if(i==1 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EC->Fill(eta_clus_time[i][j]); phi_clus_qsum_tot += phi_clus_qsum[i][j]; if(i==0) m_h1CSC_Segm_QsumOfGoodClus_Phi_EA->Fill(phi_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfGoodClus_Phi_EC->Fill(phi_clus_qsum[i][j]); - if(i==0 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EA->Fill(phi_clus_time[i][j]); - if(i==1 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EC->Fill(phi_clus_time[i][j]); + if(i==0 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EA->Fill(phi_clus_time[i][j]); + if(i==1 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EC->Fill(phi_clus_time[i][j]); } - //ATH_MSG_VERBOSE("phi charge = " << phi_clus_qsum[i][j] << "\tphi time = " << phi_clus_time[i][j]); - //ATH_MSG_VERBOSE("eta charge = " << eta_clus_qsum[i][j] << "\teta time = " << eta_clus_time[i][j]); } if(i==0) m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA->Fill(eta_clus_qsum_tot,phi_clus_qsum_tot); if(i==1) m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC->Fill(eta_clus_qsum_tot,phi_clus_qsum_tot); - //ATH_MSG_VERBOSE("eta_qsum_tot = " << eta_clus_qsum_tot << "\tphi_qsum = " << phi_clus_qsum_tot); } } // if is csc segment - // } // loop over ROTs } // loop over segms @@ -833,15 +755,6 @@ bool CSCSegmValAlg::evtSelTriggersPassed() { } // end evtSelTriggersPassed -//________________________________________________________________________________________________________ -StatusCode CSCSegmValAlg::finalize() { - StatusCode sc = ManagedMonitorToolBase::finalize(); - if(!sc.isSuccess()) return sc; - return sc; - -} - - //________________________________________________________________________________________________________ bool CSCSegmValAlg::isCscSegment( const Muon::MuonSegment* seg ) const { bool isCsc(false); @@ -857,7 +770,7 @@ bool CSCSegmValAlg::isCscSegment( const Muon::MuonSegment* seg ) const { if( !rot ) { continue; } - if( m_muonIdHelperTool->cscIdHelper().is_csc( rot->identify() ) ) isCsc=true; + if( m_idHelperSvc->cscIdHelper().is_csc( rot->identify() ) ) isCsc=true; } return isCsc; @@ -880,7 +793,7 @@ unsigned int CSCSegmValAlg::cscHits( const Muon::MuonSegment* seg ) const { if( !rot ) { continue; } - if( m_muonIdHelperTool->cscIdHelper().is_csc( rot->identify() ) ) ++nrHits; + if( m_idHelperSvc->cscIdHelper().is_csc( rot->identify() ) ) ++nrHits; } return nrHits ; @@ -940,7 +853,7 @@ bool CSCSegmValAlg::segmSlopeCut(float& csc_x, float& csc_ax, float& cut ) { float s0 = csc_x; float s1 = -tan(csc_ax); float s1corr = s1 - 0.000119 * s0; - bool good_segm = fabs(s1corr)<cut ? true : false; + bool good_segm = std::abs(s1corr)<cut ? true : false; return good_segm; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx index 00b487faa0545fb4bf7520f6fc146b7a72bdf3cb..9e78fb49f1128cf239383b65fc4785b6da9a1e4a 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx @@ -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 */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -13,12 +13,9 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // Athena include(s) -#include "MuonIdHelpers/CscIdHelper.h" #include "MuonPrepRawData/CscClusterStatus.h" #include "MuonPrepRawData/CscStripPrepDataCollection.h" #include "CscRawDataMonitoring/CscClusterValAlg.h" -#include "CscClusterization/ICscStripFitter.h" -#include "CscCalibTools/ICscCalibTool.h" // ROOT include(s) #include "TH1F.h" @@ -27,7 +24,7 @@ // STL include(s) #include <bitset> -#include <math.h> +#include <cmath> using namespace Muon; @@ -66,8 +63,7 @@ namespace CscBins { // // constructor ---------------------------------------------------------------- // -CscClusterValAlg::CscClusterValAlg(const std::string & type, - const std::string & name, const IInterface* parent) : +CscClusterValAlg::CscClusterValAlg(const std::string & type, const std::string & name, const IInterface* parent) : ManagedMonitorToolBase( type, name, parent ), m_stripFitter(name, this), m_cscCalibTool(name, this), @@ -104,7 +100,6 @@ CscClusterValAlg::~CscClusterValAlg() { delete m_cscclus_oviewEC; m_cscclus_oviewEC = 0; } - ATH_MSG_DEBUG( "CscClusterValAlg: in destructor" ); } @@ -118,49 +113,33 @@ StatusCode CscClusterValAlg::initialize(){ ATH_MSG_INFO ( "CSCClusterKey : " << m_cscClusterKey ); ATH_MSG_INFO ( "CSCPrepRawDataKey : " << m_cscPRDKey ); - StatusCode sc; - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK(ManagedMonitorToolBase::initialize()); + + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_MSG_DEBUG ("CSCIdHelper : " << "Using CscIdhelper " ); - sc = m_stripFitter.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve strip fitter"); - return sc; - } else { - ATH_MSG_INFO ( "CSCStripFitter : " << "Using Fitter with name \"" << m_stripFitter->name() << "\"" ); - } + ATH_CHECK(m_stripFitter.retrieve()); + ATH_MSG_INFO ( "CSCStripFitter : " << "Using Fitter with name \"" << m_stripFitter->name() << "\"" ); if( m_doEvtSel ) { - sc = m_trigDec.retrieve(); - if ( sc.isFailure() ) { + if ( m_trigDec.retrieve().isFailure() ) { ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve trigger decision tool"); m_doEvtSel = false; - //return sc; } else { ATH_MSG_INFO ( "TrigDecisionTool : " << "Using TDT \"" << m_trigDec->name() << "\"" ); } - //m_doEvtSel = false; - } - else { - m_trigDec.disable(); - } - sc = m_cscCalibTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve cluster fitter "); - return sc; } else { - ATH_MSG_INFO ( "CSCCalibTool : " << "Using calib tool with name \"" << m_cscCalibTool->name() << "\"" ); + m_trigDec.disable(); } + ATH_CHECK(m_cscCalibTool.retrieve()); + ATH_MSG_INFO ( "CSCCalibTool : " << "Using calib tool with name \"" << m_cscCalibTool->name() << "\"" ); if(m_sampSelTriggers.empty() && m_doEvtSel) { ATH_MSG_WARNING("Event selection triggers not specified. Switching off trigger-aware monitoring"); m_doEvtSel = false; } - - ManagedMonitorToolBase::initialize().ignore(); - - ATH_CHECK(m_cscClusterKey.initialize(m_muonIdHelperTool->hasCSC())); - ATH_CHECK(m_cscPRDKey.initialize(m_muonIdHelperTool->hasCSC())); + ATH_CHECK(m_cscClusterKey.initialize(m_idHelperSvc->hasCSC())); + ATH_CHECK(m_cscPRDKey.initialize(m_idHelperSvc->hasCSC())); return StatusCode::SUCCESS; } @@ -191,11 +170,9 @@ void CscClusterValAlg::initHistograms() { m_h2csc_clus_qmax_signal_EA = 0; m_h1csc_clus_qmax_signal_EA_count = 0; - //m_h1csc_clus_qmax_signal_EA_occupancy = 0; m_h2csc_clus_qmax_signal_EC = 0; m_h1csc_clus_qmax_signal_EC_count = 0; - //m_h1csc_clus_qmax_signal_EC_occupancy = 0; // q_sum = q_max + q_left + q_right of cluster m_h2csc_clus_qsum = 0; @@ -204,12 +181,10 @@ void CscClusterValAlg::initHistograms() { m_h2csc_clus_qsum_signal_EA = 0; m_h1csc_clus_qsum_signal_EA_count = 0; - //m_h1csc_clus_qsum_signal_EA_occupancy = 0; m_h1csc_clus_qsum_signal_EA_lfitmean = 0; m_h2csc_clus_qsum_signal_EC = 0; m_h1csc_clus_qsum_signal_EC_count = 0; - //m_h1csc_clus_qsum_signal_EC_occupancy = 0; m_h1csc_clus_qsum_signal_EC_lfitmean = 0; // sampling time - eta cluster @@ -374,12 +349,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qsum_signal_EA_count = new TH1F("h1csc_clus_qsum_signal_EA_count", Form("EndCap A: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qsum_signal_EA_occupancy = new TH1F("h1csc_clus_qsum_signal_EA_occupancy", - Form("EndCap A: Cluster charge(Qsum), Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEA,nyminEA,nymaxEA); - CscBins::BinLabels(m_h1csc_clus_qsum_signal_EA_occupancy,1); - */ - m_h1csc_clus_qsum_signal_EA_lfitmean = new TH1F("h1csc_clus_qsum_signal_EA_lfitmean", Form("EndCap A: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEA,nyminEA,nymaxEA); CscBins::BinLabels(m_h1csc_clus_qsum_signal_EA_lfitmean,1); @@ -390,13 +359,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qsum_signal_EC_count = new TH1F("h1csc_clus_qsum_signal_EC_count", Form("EndCap C: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - - /* - m_h1csc_clus_qsum_signal_EC_occupancy = new TH1F("h1csc_clus_qsum_signal_EC_occupancy", - Form("EndCap C: Cluster charge(Qsum), Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEC,nyminEC,nymaxEC); - CscBins::BinLabels(m_h1csc_clus_qsum_signal_EC_occupancy,-1); - */ - m_h1csc_clus_qsum_signal_EC_lfitmean = new TH1F("h1csc_clus_qsum_signal_EC_lfitmean", Form("EndCap C: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEC,nyminEC,nymaxEC); CscBins::BinLabels(m_h1csc_clus_qsum_signal_EC_lfitmean,-1); @@ -418,12 +380,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qmax_signal_EA_count = new TH1F("h1csc_clus_qmax_signal_EA_count", Form("EndCap A: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qmax_signal_EA_occupancy = new TH1F("h1csc_clus_qmax_signal_EA_occupancy", - Form("EndCap A: Cluster peak-strip charge, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEA,nyminEA,nymaxEA); - CscBins::BinLabels(m_h1csc_clus_qmax_signal_EA_occupancy,1); - */ - m_h2csc_clus_qmax_signal_EC = new TH2F("h2csc_clus_qmax_signal_EC", Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",m_qmaxADCCut), nqbins,nqmin,nqmax,nybinsEC,nyminEC,nymaxEC); @@ -431,12 +387,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qmax_signal_EC_count = new TH1F("h1csc_clus_qmax_signal_EC_count", Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qmax_signal_EC_occupancy = new TH1F("h1csc_clus_qmax_signal_EC_occupancy", - Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEC,nyminEC,nymaxEC); - CscBins::BinLabels(m_h1csc_clus_qmax_signal_EC_occupancy,-1); - */ - // eta-cluster sampling time m_h1csc_clus_precision_time = new TH1F("h1csc_clus_precision_time", "#eta-cluster sampling time;ns;entries/ns",ntbins,ntmin,ntmax ); @@ -530,9 +480,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_count_signal = new TH1F("h1csc_clus_count_signal", Form("Clusters per event, Qmax > %4u counts;no.of clusters;entries",m_qmaxADCCut),26,-1,25); - //m_h1csc_clus_count_perlayer = new TH1F("h1csc_clus_count_perlayer", - // Form("Clusters per layer, Qmax > %4u counts;[sector] + [0.2 #times layer];# clusters",m_qmaxADCCut),170,-17,17); - // correlation histograms m_h2csc_clus_eta_vs_phi_cluscount = new TH2F("h2csc_clus_eta_vs_phi_cluscount", "Eta vs. Phi Cluster count correlation;#varphi-cluster count;#eta-cluster count",100,0,100,100,0,100); @@ -544,9 +491,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h2csc_clus_eta_vs_phi_cluswidth = new TH2F("h2csc_clus_eta_vs_phi_cluswidth", "Eta vs. Phi Cluster width correlation;#varphi-cluster width;#eta-cluster width",100,0,100,100,0,100); - //m_h2csc_clus_eta_vs_phi_hitmap = new TH2F("h2csc_clus_eta_vs_phi_hitmap", - // "Eta vs. Phi Cluster hitmap;#varphi-cluster position;#eta-cluster position",68,-3.4,3.4,68,-3.4,3.4); // 2.0 < |eta-csc| < 2.8 - m_h2csc_clus_r_vs_z_hitmap = new TH2F("h2csc_clus_r_vs_z_hitmap", "R vs. Z Cluster hitmap;z(mm);R(mm)",200, -10000., 10000., 40, 0., 4000); @@ -560,7 +504,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusExpert.push_back(m_h2csc_clus_segmap_signal); // expert m_cscClusExpert.push_back(m_h2csc_clus_hitmap_noise); // expert - //m_cscClusShift.push_back(m_h2csc_clus_eta_vs_phi_hitmap); m_cscClusShift.push_back(m_h2csc_clus_r_vs_z_hitmap); // shift m_cscClusShift.push_back(m_h2csc_clus_y_vs_x_hitmap); // shift @@ -575,12 +518,10 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusOviewEA.push_back(m_h2csc_clus_qsum_signal_EA); m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_count); - //m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_occupancy); m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_lfitmean); m_cscClusOviewEC.push_back(m_h2csc_clus_qsum_signal_EC); m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_count); - //m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_occupancy); m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_lfitmean); // qmax @@ -590,11 +531,9 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusOviewEA.push_back(m_h2csc_clus_qmax_signal_EA); m_cscClusOviewEA.push_back(m_h1csc_clus_qmax_signal_EA_count); - //m_cscClusOviewEA.push_back(m_h1csc_clus_qmax_signal_EA_occupancy); m_cscClusOviewEC.push_back(m_h2csc_clus_qmax_signal_EC); m_cscClusOviewEC.push_back(m_h1csc_clus_qmax_signal_EC_count); - //m_cscClusOviewEC.push_back(m_h1csc_clus_qmax_signal_EC_occupancy); // phi time m_cscClusExpert.push_back(m_h1csc_clus_transverse_time); // expert @@ -647,8 +586,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusExpert.push_back(m_h1csc_clus_count_signal); // expert m_cscClusExpert.push_back(m_h1csc_clus_count_noise); // expert - //m_cscClusShift.push_back(m_h1csc_clus_count_perlayer); - // correlation plots // eta vs. phi count (# of clusters) m_cscClusExpert.push_back(m_h2csc_clus_eta_vs_phi_cluscount); // expert @@ -721,9 +658,6 @@ StatusCode CscClusterValAlg::bookHistograms(){ return sc; } } - //} - //if(newEventsBlock){} - //if(newLumiBlock){} // if we are here return success return sc; @@ -763,8 +697,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const for ( CscPrepDataContainer::const_iterator Icol = cols->begin(); Icol != cols->end(); ++Icol ) { const CscPrepDataCollection& clus = **Icol; - //Identifier coll_id = clus.identify(); - // arrays to hold cluster-count // 32 chambers and 8 layers (each has one extra - index '0' is not counted) @@ -813,23 +745,19 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const Identifier clusId = iClus.identify(); // get the cluster coordinates - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(clusId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(clusId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(clusId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(clusId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(clusId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(clusId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(clusId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(clusId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(clusId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(clusId); float x = iClus.globalPosition().x(); float y = iClus.globalPosition().y(); float z = iClus.globalPosition().z(); float r = sqrt(x*x + y*y); - //TVector3 m_clu(x,y,z); - //ATH_MSG_DEBUG(" cluster eta = " << m_clu.Eta() << "\t pseudorapidity = " << m_clu.PseudoRapidity() << "\t phi = " << m_clu.Phi()); - //ATH_MSG_DEBUG(" cluster x = " << x << "\t y = " << y << "\t z = " << z ); - //m_h2csc_clus_eta_vs_phi_hitmap->Fill(m_clu.Phi(),m_clu.Eta()); m_h2csc_clus_r_vs_z_hitmap->Fill(z,r); m_h2csc_clus_y_vs_x_hitmap->Fill(y,x); @@ -852,12 +780,7 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const } if(stripsSum_EC > stripsSum_ECtest) { stripsSum_ECtest = stripsSum_EC; - } - - - // check boundaries of sector/layer - redundancy - //if(!(sectorNo+16) < 33) sectorNo = 0; - //if(!(wireLayer < 5)) wireLayer = 0; + } // compute the indices to store cluster count int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] @@ -912,7 +835,7 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const // Loop over strip id's vector / strip collection and match the id's from vector with strips in collection for ( std::vector<Identifier>::const_iterator sId = stripIds.begin(); sId != stripIds.end(); ++sId, sIdx++ ) { Identifier id = *sId; // for strip Id's - int thisStrip = m_muonIdHelperTool->cscIdHelper().strip(id); + int thisStrip = m_idHelperSvc->cscIdHelper().strip(id); float stripid = thisStrip * xfac; // x-axis fill value fStripIDs.push_back(stripid); m_h2csc_clus_hitmap->Fill(stripid, secLayer); @@ -935,11 +858,8 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const found_strip = ( *istrip )->identify() == id ; if(found_strip) { stripVec.push_back(*istrip); - //std::ostringstream m_charges; std::vector<float> samp_charges = ( *istrip )->sampleCharges(); for(unsigned int i = 0; i < samp_charges.size(); i++ ) { - //std::string m_ch; sprintf((char *)m_ch.c_str(),"%6.2f , ",samp_charges[i]); - //m_charges << m_ch.c_str(); if(samp_charges[i] > maxsampChVal) maxsampChVal = samp_charges[i]; } if(maxsampChVal > maxStripCharge ) { @@ -947,7 +867,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const maxStipId = stripid; mxIdx = sIdx; } - //ATH_MSG_DEBUG ( " " << m_charges.str() << "\t time= " << ( *istrip )->timeOfFirstSample()); break; // break from inner loop } } // end for loop on strip collection @@ -1006,10 +925,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const float kiloele = 1.0e-3; // multiply # of electrons by this number to get kiloElectrons (1 ke = 1 ADC) // Assume 1000 e = 1 ADC for now = 1000 x 1.6022 x 10^{-4} fC = 0.16022 fC - //float m_fCperADC = 0.16022; // multiply ADC counts with with this to get fC - - //float m_kEperADC = 1000.; // multiply ADC counts with with this to get #of electrons - // convert qmax, qleft, qright into ADC float QmaxADC = qmax * kiloele; float QsumADC = qsum * kiloele; @@ -1054,11 +969,9 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(stationEta == 1) { m_h2csc_clus_qmax_signal_EA->Fill(QmaxADC, secLayer); m_h1csc_clus_qmax_signal_EA_count->Fill(QmaxADC); - //m_h1csc_clus_qmax_signal_EA_occupancy->Fill(secLayer); } else { m_h2csc_clus_qmax_signal_EC->Fill(QmaxADC, secLayer); m_h1csc_clus_qmax_signal_EC_count->Fill(QmaxADC); - //m_h1csc_clus_qmax_signal_EC_occupancy->Fill(secLayer); } } else { m_h2csc_clus_qmax_noise->Fill(QmaxADC, secLayer); @@ -1070,11 +983,9 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(stationEta == 1) { m_h2csc_clus_qsum_signal_EA->Fill(QsumADC, secLayer); m_h1csc_clus_qsum_signal_EA_count->Fill(QsumADC); - //m_h1csc_clus_qsum_signal_EA_occupancy->Fill(secLayer); } else { m_h2csc_clus_qsum_signal_EC->Fill(QsumADC, secLayer); m_h1csc_clus_qsum_signal_EC_count->Fill(QsumADC); - //m_h1csc_clus_qsum_signal_EC_occupancy->Fill(secLayer); } } else { m_h2csc_clus_qsum_noise->Fill(QsumADC, secLayer); @@ -1139,10 +1050,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(count) { float secLayer = sec + 0.2 * (lay - 1) + 0.1; - //for(int m_cnt = 0; m_cnt < scount; m_cnt++) { - // m_h1csc_clus_count_perlayer->Fill(secLayer); - //} - ATH_MSG_DEBUG ("sec[" << sec << "]\t" << wlay << "[" << lay << "] = " << secLayer << "= " << "\tNsig = " << scount << ", Ntot = " << count); @@ -1221,78 +1128,3 @@ bool CscClusterValAlg::evtSelTriggersPassed() { return false; } // end evtSelTriggersPassed - -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscClusterValAlg::procHistograms() { - - StatusCode sc = StatusCode::SUCCESS; - - /* book these only at the end of run - if(isEndOfRun){ - - //MonGroup m_cscclus_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(unsigned int j = 0; j < m_cscClusOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_cscClusOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscBins::BinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscclus_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscclus_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - - //MonGroup m_cscclus_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(unsigned int j = 0; j < m_cscClusOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_cscClusOviewEA[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscBins::BinLabels(m_hY,1); - // register histogram with Overview/CSCEA - sc = m_cscclus_oviewEA->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscclus_oviewEA->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - - } // end isEndofRun */ - return sc; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx index 28110d9ed165f16caffc31a6c91c08864090ab54..248c9939be02e89543f96c12101f8caab67278d0 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx @@ -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 */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -19,9 +19,6 @@ #include "MuonPrepRawData/CscStripPrepDataCollection.h" #include "MuonPrepRawData/CscStripPrepData.h" -#include "CscClusterization/ICscStripFitter.h" -#include "MuonIdHelpers/CscIdHelper.h" - // ROOT include(s) #include "TClass.h" #include "TH1F.h" @@ -65,8 +62,7 @@ namespace CscPrdBins { // // constructor ---------------------------------------------------------------- // -CscPrdValAlg::CscPrdValAlg(const std::string & type, const std::string & name, - const IInterface* parent) : +CscPrdValAlg::CscPrdValAlg(const std::string & type, const std::string & name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), m_stripFitter(name), m_cscprd_oviewEA(0), @@ -106,29 +102,13 @@ CscPrdValAlg::~CscPrdValAlg() { // StatusCode CscPrdValAlg::initialize() { ATH_MSG_INFO( "CscPrdValAlg: in initialize" ); - - ATH_MSG_DEBUG( "strip fitter " << m_stripFitter ); - - StatusCode sc; - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - ATH_MSG_DEBUG( " Found the MuonIdHelperTool. " ); - - //Fetch strip fitter - sc = m_stripFitter.retrieve(); - if ( !m_stripFitter || sc.isFailure() ) { - ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": unable to retrieve strip fitter " << m_stripFitter ); - return sc; - } else { - ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": retrieved " << m_stripFitter ); - } - + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); + ATH_CHECK(m_stripFitter.retrieve()); + ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": retrieved " << m_stripFitter ); ATH_CHECK(m_cscPrdKey.initialize()); ATH_CHECK(m_eventInfo.initialize()); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; return StatusCode::SUCCESS; - } // end CscPrdValAlg::initialize() @@ -226,12 +206,7 @@ void CscPrdValAlg::bookPrdHistograms() { float nxmaxLB = 2500.; // /// ******************** DO NOT MODIFY (end) *********************************************** /// - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - // book histograms - //m_h1csc_prd_maxdiffamp = new TH1F("h1csc_prd_maxdiffamp", "Max Amplitude in ROD Cluster;ADC counts;;",500,0,5000); // strip hitmap m_h2csc_prd_hitmap = new TH2F("h2csc_prd_hitmap", "Hit Occupancy;channel;[sector] + [0.2 #times layer]", @@ -383,14 +358,11 @@ void CscPrdValAlg::bookPrdHistograms() { m_regHExpert.push_back(m_h2csc_prd_eta_vs_phi_cluscount_noise); // expert m_regHExpert.push_back(m_h2csc_prd_eta_vs_phi_cluswidth); // expert - //m_regHShift.push_back(m_h2csc_prd_eta_vs_phi_hitmap); // shift if(m_mapxyrz) { m_regHShift.push_back(m_h2csc_prd_r_vs_z_hitmap); // shift m_regHShift.push_back(m_h2csc_prd_y_vs_x_hitmap); // shift } - //} - } // @@ -403,10 +375,6 @@ StatusCode CscPrdValAlg::bookHistograms() { bookPrdHistograms(); - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - //declare a group of histograms MonGroup cscprd_shift( this, m_cscPRDPath+"/Shift", run, ATTRIB_MANAGED ); MonGroup cscprd_expert( this, m_cscPRDPath+"/Expert", run, ATTRIB_MANAGED ); @@ -526,14 +494,14 @@ StatusCode CscPrdValAlg::fillHistograms() { // Identify the PRD cluster Identifier prawId = praw.identify(); - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(prawId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(prawId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(prawId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(prawId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(prawId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(prawId); - int stripId = m_muonIdHelperTool->cscIdHelper().strip(prawId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(prawId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(prawId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(prawId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(prawId); + int stripId = m_idHelperSvc->cscIdHelper().strip(prawId); int sectorNo = stationEta * (2 * stationPhi - chamberType); @@ -637,7 +605,6 @@ StatusCode CscPrdValAlg::fillHistograms() { int numetasignal = 0, numphisignal = 0; for(int kl = 1; kl < 33; kl++ ) { - //int m_sec = kl < 17 ? kl*(-1) : kl; // [1->16](-side) [17-32] (+side) for(int km = 1; km < 9; km++ ) { int lay = (km > 4 && km < 9) ? km-4 : km; // 1,2,3,4 (phi-layers) 5-4, 6-4, 7-4, 8-4 (eta-layers) bool mphi = (km > 0 && km < 5) ? true : false; // 1,2,3,4 (phi-layers) 5,6,7,8 (eta-layers) @@ -691,55 +658,6 @@ StatusCode CscPrdValAlg::fillHistograms() { return sc; } // end CscPrdValAlg::fillHistograms() -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscPrdValAlg::procHistograms() { - StatusCode sc = StatusCode::SUCCESS; - ATH_MSG_DEBUG( "CscPrdValAlg: in procHistograms" ); - if(endOfRunFlag()){ - /* - std::string m_cscGenPath = m_cscPRDPath.substr(0,m_cscPRDPath.find("CSC")); - //MonGroup m_cscprd_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(size_t j = 0; j < m_regHOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscPrdBins::PrdBinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscprd_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscprd_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - //MonGroup m_cscprd_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(size_t j = 0; j < m_regHOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEA[j]; - if(m_h != NULL) { - */ - } // end isEndOfRun - - return sc; - } - // // checkHists ---------------------------------------------------------------- // diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx index e200d06ef91862c672eaecc3d190a3a46e0fa88b..b9c8ff76d3f817a841eb5837988b7ddccc0fdd01 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx @@ -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 */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -15,9 +15,6 @@ // Athena include(s) #include "CscRawDataMonitoring/CscRdoValAlg.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" - #include "MuonRDO/CscRawData.h" #include "MuonRDO/CscRawDataCollection.h" @@ -100,19 +97,12 @@ CscRdoValAlg::~CscRdoValAlg() { // initialize ---------------------------------------------------------------- // StatusCode CscRdoValAlg::initialize() { - - ATH_MSG_DEBUG ( "CscRdoValAlg : in initialize()" ); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - ATH_MSG_DEBUG ( " Found the CscIdHelper. " ); - + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_MSG_DEBUG ("CscRdoValAlg : in initialize()"); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_cscRdoDecoderTool.retrieve()); - ATH_CHECK(m_cscRdoKey.initialize()); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; return StatusCode::SUCCESS; - } @@ -212,10 +202,6 @@ void CscRdoValAlg::bookRdoHistograms(){ float nyminEC = -17.; // float nymaxEC = 0.; // ///******************** DO NOT MODIFY (end) ***********************************************/// - - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { // book histograms m_h1csc_rdo_maxdiffamp = new TH1F("h1csc_rdo_maxdiffamp", "Max Amplitude in ROD Cluster;ADC counts;;",500,0,5000); @@ -408,8 +394,6 @@ void CscRdoValAlg::bookRdoHistograms(){ m_regHExpert.push_back(m_h2csc_rdo_eta_vs_phi_cluswidth); // expert - //} - } // @@ -422,10 +406,6 @@ StatusCode CscRdoValAlg::bookHistograms(){ bookRdoHistograms(); - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - //declare a group of histograms MonGroup cscrdo_shift( this, m_cscRDOPath+"/Shift", run, ATTRIB_MANAGED ); MonGroup cscrdo_expert( this, m_cscRDOPath+"/Expert", run, ATTRIB_MANAGED ); @@ -538,22 +518,18 @@ StatusCode CscRdoValAlg::fillHistograms() { // Identify side(A/C), sector(1-16)/layer(1-4) stationId = m_cscRdoDecoderTool->stationIdentifier(raw); channelId = m_cscRdoDecoderTool->channelIdentifier(raw,0); - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(channelId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(channelId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(channelId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(channelId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(channelId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(channelId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(channelId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(channelId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(channelId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(channelId); // determine the sector number int sectorNo = stationEta * (2 * stationPhi - chamberType); - // check boundaries of sector/layer - redundancy - //if(!(sectorNo+16) < 33) sectorNo = 0; - //if(!(wireLayer < 5)) wireLayer = 0; - // compute the indices to store cluster count int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] int nl = (measuresPhi ? wireLayer : wireLayer+4); // [ 1 -> 4] (phi-layers) and [5 -> 8] (eta-layers) @@ -574,7 +550,6 @@ StatusCode CscRdoValAlg::fillHistograms() { int xfac = measuresPhi ? -1 : 1; // -48 / +192 // this way we get 4 time samples per strip - // no of strips = width ATH_MSG_DEBUG ( " Width of ROD cluster : " << raw->width() ); uint16_t diff_max = 0, diff; std::vector<float> xVals ; /*, m_yVals;*/ @@ -594,14 +569,13 @@ StatusCode CscRdoValAlg::fillHistograms() { // identify this strip Identifier chID = m_cscRdoDecoderTool->channelIdentifier(raw, n); - int strip = m_muonIdHelperTool->cscIdHelper().strip(chID); + int strip = m_idHelperSvc->cscIdHelper().strip(chID); float stripId = strip * xfac; // x-axis fill value m_h2csc_rdo_hitmap->Fill(stripId, secLayer); // fill hitmap // for every strip that has a hit, store the X,Y values xVals.push_back(stripId); - //m_yVals.push_back(secLayer); // extract the (four) time samples for this strip std::vector<uint16_t> samples; @@ -741,78 +715,6 @@ StatusCode CscRdoValAlg::fillHistograms() { return sc; } -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscRdoValAlg::procHistograms() { - ATH_MSG_DEBUG ( "CscRdoValAlg : in procHistograms()" ); - StatusCode sc = StatusCode::SUCCESS; - /*if(isEndOfRun){ - std::string m_cscGenPath = m_cscRDOPath.substr(0,m_cscRDOPath.find("CSC")); - //MonGroup m_cscrdo_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(size_t j = 0; j < m_regHOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscRdoBins::RdoBinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscrdo_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscrdo_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - //MonGroup m_cscrdo_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(size_t j = 0; j < m_regHOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEA[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscRdoBins::RdoBinLabels(m_hY,1); - // register histogram with Overview/CSCEA - sc = m_cscrdo_oviewEA->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscrdo_oviewEA->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - } // end isEndOfRun*/ - - return sc; -} - - // // checkHists ---------------------------------------------------------------- // diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h index 3393a01813d1e749dc1436af2b80a2b4036fb31b..ccac9d53b25db4f80e28dd674fa7038caa0abc8e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h @@ -14,18 +14,17 @@ #ifndef MdtRawDataValAlg_H #define MdtRawDataValAlg_H -//Core Include #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -//Helper Includes #include "MuonAnalysisInterfaces/IMuonSelectionTool.h" #include "MdtRawDataMonitoring/MuonChamberIDSelector.h" #include "MdtRawDataMonitoring/MDTMonGroupStruct.h" #include "MdtRawDataMonitoring/MDTNoisyTubes.h" #include "MdtRawDataMonitoring/MDTChamber.h" #include "MuonDQAUtils/MuonDQAHistMap.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "TrkSegment/SegmentCollection.h" #include "AthenaMonitoring/DQAtlasReadyFilterTool.h" #include "EventInfo/EventInfo.h" @@ -36,13 +35,11 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandleKey.h" -//standard library includes + #include <fstream> #include <cstdlib> #include <iostream> -class Identifier; -class IdentifierHash; class MuonDQAHistList; namespace Muon { @@ -117,8 +114,7 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { MDTMonGroupStruct* m_mg; MDTNoisyTubes* m_masked_tubes; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool; // MuonDetectorManager from the conditions store @@ -129,13 +125,11 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { virtual StatusCode bookMDTHistograms( MDTChamber* chamber, Identifier digcoll_id );//book chamber by chamber histos virtual StatusCode fillMDTHistograms( const Muon::MdtPrepData* );//fill chamber by chamber histos virtual StatusCode bookMDTSummaryHistograms( bool newLumiBlock, bool newRun);//Those over barrel/encap layer etc. - //virtual StatusCode fillMDTSummaryHistograms( const Muon::MdtPrepData*, bool &isNoiseBurstCandidate); virtual StatusCode fillMDTSummaryHistograms( const Muon::MdtPrepData*, std::set<std::string>, bool &isNoiseBurstCandidate); virtual StatusCode bookMDTOverviewHistograms( bool newLumiBlock, bool newRun); virtual StatusCode fillMDTOverviewHistograms(const Muon::MdtPrepData*, bool &isNoiseBurstCandidate); StatusCode handleEvent_effCalc(const Trk::SegmentCollection* segms);//, const Muon::MdtPrepDataContainer* mdt_container ); - //MDTRawDataUtils_cxx bool AinB( int A, std::vector<int> & B ); virtual StatusCode binMdtGlobal( TH2* &, char ecap ); virtual StatusCode binMdtRegional( TH2* &, std::string &xAxis); @@ -181,12 +175,8 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { uint32_t m_time; uint32_t m_firstTime; int m_numberOfEvents; - //int m_time; - // - SG::ReadHandleKey<Trk::SegmentCollection> m_segm_type{this,"Eff_segm_type","MuonSegments","muon segments"}; - /* StatusCode analyseSegments_effCalc(); */ std::string returnString(int i){ std::stringstream ss; @@ -213,7 +203,6 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { bool m_doMdtESD ; - //bool m_booked; // to book or not bookMDTTDCplots --> /Chambers/tmp/ directory bool m_doChamberHists; bool m_isOnline; @@ -236,24 +225,11 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { //Define configurable adccut and TGC/RPC keys float m_ADCCut; float m_ADCCut_Bkgrd; -// float m_TDCCut_Bkgrd; float m_curTime; -// int m_TGCKey; -// int m_RPCKey; - - - //nobody looks at these histograms --> remove for now, to improve memory consumption - //TH1* mdtevents_RPCtrig; // Total number of MDT digits RPCtrig - //TH1* mdtevents_TGCtrig; // Total number of MDT digits TGCtrig - //TH1* mdthitsvseventnum; - //TH1* mdthitsvseventnumcut; - //TH1* overalltdccut_RPCtrig; // all chambers tdc superimposed with adc cut - //TH1* overalltdccut_TGCtrig; // all chambers tdc superimposed with adc cut //From Old BS TH2* m_overalltdcadcLumi; // all chambers tdc vs adc superimposed TH2* m_overalltdcadcPRLumi[4]; // all chambers tdc vs adc superimposed - // TH1* overalltdc; // all chambers tdc superimposed TH1* m_overalltdccutLumi; // all chambers tdc superimposed with adc cut TH1* m_overalltdccut_segm_Lumi; // all chambers tdc superimposed with adc cut TH1* m_overalladc_segm_Lumi; // all chambers adc on segm @@ -277,10 +253,8 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { TH1* m_overalladcPR_HighOcc[4]; // all chambers tdc superimposed with adc cut per region TH2* m_overall_mdt_DRvsDT; - // TH2* overall_mdt_DRvsDRerr; TH2* m_overall_mdt_DRvsSegD; TH2* m_overallPR_mdt_DRvsDT[4]; - // TH2* overallPR_mdt_DRvsDRerr[4]; TH2* m_overallPR_mdt_DRvsSegD[4]; TH2* m_MdtNHitsvsRpcNHits; @@ -317,19 +291,13 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { ///////////For t0 calculations////////// TH1* m_mdttdccut_sector[4][4][16]; //// [endcap/barrel A/C][layer][sector] - //These can be left to the post-processing -/* TH1* mdttdccut_t0[4]; //Just four plot */ -/* TH1* mdttdccut_tmax[4]; //Just four plot */ -/* TH1* mdttdccut_tdrift[4]; //Just four plot */ //Chamber by Chamber Plots - // std::map< IdentifierHash, MDTChamber* >* m_hist_map; std::vector< MDTChamber* >* m_hist_hash_list; void clear_hist_map(bool reallocate=true); std::string getChamberName(const Muon::MdtPrepData*); std::string getChamberName(Identifier); - // std::string getChamberName(IdentifierHash); StatusCode getChamber(IdentifierHash id, MDTChamber* &chamber); //Control for which histograms to add @@ -362,9 +330,7 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { bool m_do_mdt_DRvsSegD; bool m_do_mdttubenoise; bool m_do_mdttdctube; - // - // NEW float m_nb_hits; //minimum number of hits in segment float m_road_width; //road width for pattern recognition float m_chi2_cut; //track chi2 cut; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h index 2a3bb85a650c9eb08019bdb2442baa6b65fde10c..f8f886aa82703da65021c1bef6a7f5cfc9edd514 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h @@ -1,59 +1,37 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonChamberIDSelector.h -/////////////////////////////////////////////////////////////////// - #ifndef MUONCHAMBERIDSELECTOR_H #define MUONCHAMBERIDSELECTOR_H -//Base class #include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include <string> #include <sstream> #include <vector> -#include "MuonIdHelpers/MuonIdHelperTool.h" - -class Identifier; - class MuonChamberIDSelector : public AthAlgorithm { public: MuonChamberIDSelector(const std::string &name,ISvcLocator *pSvcLocator); //!< Athena algorithm constructor - virtual ~MuonChamberIDSelector(); + virtual ~MuonChamberIDSelector()=default; // Basic algorithm methods: virtual StatusCode initialize(); //!< Algorithm initialization: retrieves StoreGate/DetectorStore/MuonIdHelpers/MuonPrepDataContainers virtual StatusCode execute(); //!< Retrieves and records containers, performs selection - virtual StatusCode finalize(); //!< Does nothing - - /** vector of identifiers of mdt chambers */ - // std::vector<Identifier>& mdtchambersId() const; - StatusCode ChamberperformSelection() ; - // StatusCode selectMDT(std::vector<Identifier>& mdtchambersId) ; - StatusCode selectMDT() ; - StatusCode selectRPC() ; //!< selects the RPCcollections - StatusCode selectTGC() ; //!< selects the TGCcollections - StatusCode selectCSC() ; //!< selects the CSCcollections + StatusCode selectMDT(); + StatusCode selectRPC(); //!< selects the RPCcollections + StatusCode selectTGC(){return StatusCode::SUCCESS;} //!< selects the TGCcollections + StatusCode selectCSC(){return StatusCode::SUCCESS;} //!< selects the CSCcollections - //std::vector<Identifier> m_mdtchambersId; private: - - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; std::vector<Identifier>* m_mdtchambersId; std::vector<Identifier>* m_rpcchambersId; - }; - -//inline std::vector<Identifier>& MuonChamberIDSelector::mdtchambersId() const { -// return m_mdtchambersId; -// } - + #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py index 3098b02cfa8c028818a1590edfc8e1167f26a50e..fa68f8426b013223e33e36eec943efb70cdc8a5d 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py @@ -27,9 +27,6 @@ def MdtMonitoringConfig(inputFlags): from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg result.merge(MuonGeoModelCfg(inputFlags)) - # Temporary, until we move to services/private tools-- from MuonSpectrometer/MuonConfig - result.addPublicTool( CompFactory.Muon.MuonIdHelperTool() ) - # The following class will make a sequence, configure algorithms, and link # them to GenericMonitoringTools from AthenaMonitoring import AthMonitorCfgHelper diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx index 5bd78d1d75d75956778f5187f08701fd1f090542..370f37cec4b51497c48bccc70ebcef20a62975b1 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx @@ -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 */ /////////////////////////////////////////////////////////////////////////// @@ -723,15 +723,15 @@ StatusCode MdtRawDataValAlg::fillMDTMaskedTubes(IdentifierHash idHash, const std std::set<Identifier> noisyTubes = m_masked_tubes->getNoiseList(idHash); for(std::set<Identifier>::const_iterator itr = noisyTubes.begin(); itr != noisyTubes.end(); ++itr){ Identifier digcoll_id = *itr; - int mdtlayer = m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id); - if (m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)==2) { + int mdtlayer = m_idHelperSvc->mdtIdHelper().tubeLayer(digcoll_id); + if (m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)==2) { if ( hardware_name.at(1) == 'I' && hardware_name.at(3) != '8' ) mdtlayer += 4; else mdtlayer += 3; } - int mdttube= m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - ChamberTubeNumberCorrection(mdttube, hardware_name, m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id), mdtlayer-1); + int mdttube= m_idHelperSvc->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + ChamberTubeNumberCorrection(mdttube, hardware_name, m_idHelperSvc->mdtIdHelper().tube(digcoll_id), mdtlayer-1); h->Fill(mdttube, 1); } return StatusCode::SUCCESS; @@ -745,20 +745,20 @@ void MdtRawDataValAlg::mdtchamberId() { ATH_MSG_DEBUG("in MDT ChambersIDvector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); m_chambersId.push_back(Id); m_chambersIdHash.push_back(Idhash); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG("Adding the chamber Identifier: " << extid ); if (gethash_code == 0) { ATH_MSG_DEBUG(" its hash Id is " << Idhash ); @@ -774,10 +774,9 @@ void MdtRawDataValAlg::mdtchamberId() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * int MdtRawDataValAlg::mezzmdt(Identifier digcoll_id) { //int mezz_chamber, int mezz_eta, int mezz_ml, int mezz_tube, int max_tube) { int TotmezzTubes = 8; - if( m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id) == 4 ) + if( m_idHelperSvc->mdtIdHelper().tubeLayerMax(digcoll_id) == 4 ) TotmezzTubes = 6; - // if (mezz_chamber==1 || mezz_chamber==2 || mezz_chamber==8 || mezz_chamber==13) TotmezzTubes=6 ; // old way of doing things that didn't work - int Imezz = (int)((m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id)-1)/TotmezzTubes) + (int)((m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)-1)*((m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id))/TotmezzTubes)); + int Imezz = (int)((m_idHelperSvc->mdtIdHelper().tube(digcoll_id)-1)/TotmezzTubes) + (int)((m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)-1)*((m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id))/TotmezzTubes)); return Imezz; } @@ -786,9 +785,9 @@ int MdtRawDataValAlg::mezzmdt(Identifier digcoll_id) { //int mezz_chamber, int m // the 'if' statements are for chambers with ML1 != ML2 // except for BIS8 -- mdtIdHelper gets the # layers wrong in this instance int MdtRawDataValAlg::GetTubeMax( const Identifier & digcoll_id, const std::string & hardware_name ) { - int numtubes = m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - int numlayers = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id); - int numML = m_muonIdHelperTool->mdtIdHelper().numberOfMultilayers(digcoll_id); + int numtubes = m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + int numlayers = m_idHelperSvc->mdtIdHelper().tubeLayerMax(digcoll_id); + int numML = m_idHelperSvc->mdtIdHelper().numberOfMultilayers(digcoll_id); int tubeMax = numtubes * numlayers * numML; if( hardware_name.substr(0,4) == "BIS8" ) // Why does mdtIdHelper get this one wrong? @@ -922,14 +921,14 @@ std::string MdtRawDataValAlg::getChamberName(const Muon::MdtPrepData* hit){ std::string MdtRawDataValAlg::getChamberName(Identifier id){ if(m_hist_hash_list) { IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash(id, idHash); + m_idHelperSvc->mdtIdHelper().get_module_hash(id, idHash); if( idHash < m_hist_hash_list->size() ) { MDTChamber* chamber = (*m_hist_hash_list)[idHash]; if(chamber) return chamber->getName(); - else return convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(id),m_muonIdHelperTool->mdtIdHelper().stationEta(id),m_muonIdHelperTool->mdtIdHelper().stationPhi(id),"MDT"); + else return convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(id),m_idHelperSvc->mdtIdHelper().stationEta(id),m_idHelperSvc->mdtIdHelper().stationPhi(id),"MDT"); } } - return convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(id),m_muonIdHelperTool->mdtIdHelper().stationEta(id),m_muonIdHelperTool->mdtIdHelper().stationPhi(id),"MDT"); + return convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(id),m_idHelperSvc->mdtIdHelper().stationEta(id),m_idHelperSvc->mdtIdHelper().stationPhi(id),"MDT"); } StatusCode MdtRawDataValAlg::getChamber(IdentifierHash id, MDTChamber* &chamber){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx index 43cc30ac49ddb4bb55b19882547d67b8492cfcbf..1a2ce07ad7489b2c0df79cf7ec8a084ef68d8c82 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx @@ -552,21 +552,21 @@ void MdtRawDataMonAlg::fillMDTOverviewVects( const Muon::MdtPrepData* mdtCollect if( adc>m_ADCCut ) { //barrel - if(fabs(mdt_tube_eta)>0. && fabs(mdt_tube_eta)<0.9) { + if(std::abs(mdt_tube_eta)>0. && std::abs(mdt_tube_eta)<0.9) { vects.mdt_tube_x_barrel.push_back(mdtgPos.x()); vects.mdt_tube_y_barrel.push_back(mdtgPos.y()); vects.mdt_tube_z_barrel.push_back(mdtgPos.z()); vects.mdt_tube_perp_barrel.push_back(mdtgPos.perp()); } //OverLap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>0.9 && fabs(mdt_tube_eta)<1.2) { + if(std::abs(mdt_tube_eta)>0.9 && std::abs(mdt_tube_eta)<1.2) { vects.mdt_tube_x_ovl.push_back(mdtgPos.x()); vects.mdt_tube_y_ovl.push_back(mdtgPos.y()); vects.mdt_tube_z_ovl.push_back(mdtgPos.z()); vects.mdt_tube_perp_ovl.push_back(mdtgPos.perp()); } //EndCap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>1.2 && fabs(mdt_tube_eta)<2.7){ + if(std::abs(mdt_tube_eta)>1.2 && std::abs(mdt_tube_eta)<2.7){ vects.mdt_tube_x_endcap.push_back(mdtgPos.x()); vects.mdt_tube_y_endcap.push_back(mdtgPos.y()); vects.mdt_tube_z_endcap.push_back(mdtgPos.z()); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx index 3cc00ba39eda01db6090c9a6d20207cabcedc91f..0bc7b9b7c7e77f59e93355c61d08cdc565e16463 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx @@ -27,7 +27,6 @@ #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonCalibIdentifier/MuonFixedId.h" -#include "MuonIdHelpers/MdtIdHelper.h" #include "MdtCalibFitters/MTStraightLine.h" #include "MuonSegment/MuonSegment.h" @@ -77,8 +76,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string m_overalltdccut_segm_Lumi(0), m_overalladc_segm_Lumi(0), m_overalladc_Lumi(0), - //overalltdccut_RPCtrig(0), - //overalltdccut_TGCtrig(0), m_overalltdcadcHighOcc(0), m_overalltdcHighOcc(0), m_overalltdcHighOcc_ADCCut(0), @@ -90,8 +87,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string m_mdteventscutLumi_big(0), m_mdteventsLumi(0), m_mdteventsLumi_big(0), - //mdthitsvseventnum(0), - //mdthitsvseventnumcut(0), m_mdtglobalhitstime(0), m_nummdtchamberswithhits(0), m_nummdtchamberswithhits_ADCCut(0), @@ -113,9 +108,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string declareProperty("StationPhi", m_StationPhi=-100); declareProperty("ADCCut", m_ADCCut=50.); declareProperty("ADCCutForBackground", m_ADCCut_Bkgrd=80.); -// declareProperty("MaxTDCCutForBackground", m_TDCCut_Bkgrd=50.); -// declareProperty("RPCTrigKey", m_RPCKey=144); -// declareProperty("TGCTrigKey", m_TGCKey=136); declareProperty("Eff_nHits", m_nb_hits=5.); declareProperty("Eff_roadWidth", m_road_width=2.); declareProperty("Eff_chi2Cut", m_chi2_cut=10.); @@ -171,10 +163,7 @@ MdtRawDataValAlg::~MdtRawDataValAlg() StatusCode MdtRawDataValAlg::initialize() /*---------------------------------------------------------*/ { - //initialize to stop coverity bugs - //mdtevents_RPCtrig = 0; - //mdtevents_TGCtrig=0; m_MdtNHitsvsRpcNHits = 0; m_lumiblock = 0; m_eventNum = 0; @@ -212,9 +201,6 @@ StatusCode MdtRawDataValAlg::initialize() m_mdtchamberstatphislice[i]=0; } - - - // init message stream ATH_MSG_INFO("initialize MdtRawDataValAlg" ); @@ -222,8 +208,6 @@ StatusCode MdtRawDataValAlg::initialize() ATH_MSG_DEBUG("doMdtESD: " << m_doMdtESD ); ATH_MSG_DEBUG("******************" ); - StatusCode sc; - //If Online ensure that lowStat histograms are made at the runLevel and that _lowStat suffix is suppressed if(m_isOnline) m_mg = new MDTMonGroupStruct(this, m_title, ManagedMonitorToolBase::run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED, ""); else m_mg = new MDTMonGroupStruct(this, m_title, ManagedMonitorToolBase::lowStat, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED, "_lowStat"); @@ -233,22 +217,8 @@ StatusCode MdtRawDataValAlg::initialize() // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - sc = m_muonIdHelperTool.retrieve(); - if (sc.isFailure()) { - ATH_MSG_FATAL("Cannot get MuonIdHelperTool" ); - return StatusCode::FAILURE; - } - else { - ATH_MSG_DEBUG(" Found the MuonIdHelperTool. " ); - } - - sc = m_DQFilterTools.retrieve(); - if( !sc ) { - ATH_MSG_ERROR("Could Not Retrieve AtlasFilterTool " << m_DQFilterTools); - return StatusCode::FAILURE; - } - + ATH_CHECK(m_idHelperSvc.retrieve()); + ATH_CHECK(m_DQFilterTools.retrieve()); ATH_CHECK(m_muonSelectionTool.retrieve()); //back to MDTS... @@ -267,17 +237,14 @@ StatusCode MdtRawDataValAlg::initialize() // MuonDetectorManager from the Detector Store std::string managerName="Muon"; - const MuonGM::MuonDetectorManager* MuonDetMgrDS; - sc = detStore()->retrieve(MuonDetMgrDS); - if (sc.isFailure()) { - ATH_MSG_INFO("Could not find the MuonGeoModel Manager: " << managerName << " from the Detector Store! " ); - return StatusCode::FAILURE; - } else { ATH_MSG_DEBUG(" Found the MuonGeoModel Manager from the Detector Store" );} - - m_BMGpresent = m_muonIdHelperTool->mdtIdHelper().stationNameIndex("BMG") != -1; + const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr; + ATH_CHECK(detStore()->retrieve(MuonDetMgrDS)); + ATH_MSG_DEBUG(" Found the MuonGeoModel Manager from the Detector Store" ); + + m_BMGpresent = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG") != -1; if(m_BMGpresent){ ATH_MSG_INFO("Processing configuration for layouts with BMG chambers."); - m_BMGid = m_muonIdHelperTool->mdtIdHelper().stationNameIndex("BMG"); + m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG"); for(int phi=6; phi<8; phi++) { // phi sectors for(int eta=1; eta<4; eta++) { // eta sectors for(int side=-1; side<2; side+=2) { // side @@ -341,8 +308,8 @@ StatusCode MdtRawDataValAlg::bookHistogramsRecurrent( /*bool isNewEventsBlock, b ATH_MSG_DEBUG("MdtRawDataValAlg::MDT RawData Monitoring Histograms being filled" ); for(std::vector<Identifier>::const_iterator itr = m_chambersId.begin(); itr != m_chambersId.end(); ++itr, ++counter){ - std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(*itr),m_muonIdHelperTool->mdtIdHelper().stationEta(*itr), - m_muonIdHelperTool->mdtIdHelper().stationPhi(*itr),"MDT"); + std::string hardware_name = convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(*itr),m_idHelperSvc->mdtIdHelper().stationEta(*itr), + m_idHelperSvc->mdtIdHelper().stationPhi(*itr),"MDT"); //Skip Chambers That Do NOT Exist if(hardware_name=="BML6A13" || hardware_name=="BML6C13") continue; @@ -480,10 +447,10 @@ StatusCode MdtRawDataValAlg::fillHistograms() if(!rot_from_track) continue; // rot_from_track->dump(msg()); Identifier rotId = rot_from_track->identify(); - if(!m_muonIdHelperTool->mdtIdHelper().is_mdt(rotId)) continue; + if(!m_idHelperSvc->mdtIdHelper().is_mdt(rotId)) continue; IdentifierHash mdt_idHash; MDTChamber* mdt_chamber = 0; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( rotId, mdt_idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( rotId, mdt_idHash ); sc = getChamber(mdt_idHash, mdt_chamber); std::string mdt_chambername = mdt_chamber->getName(); chambers_from_tracks.insert(mdt_chambername); @@ -510,12 +477,6 @@ StatusCode MdtRawDataValAlg::fillHistograms() nPrdcut++; isHit_above_ADCCut = true; } - // Identifier digcoll_id = (*mdtCollection)->identify(); - - - //Relic from cosmic days nolonger relevant - // if (selectChambersRange(hardware_name, m_chamberName, m_muonIdHelperTool->mdtIdHelper().stationEta(digcoll_id), m_StationEta, m_muonIdHelperTool->mdtIdHelper().stationPhi(digcoll_id), m_StationPhi, m_StationSize) ) - // { sc = fillMDTOverviewHistograms(*mdtCollection, isNoiseBurstCandidate); if(sc.isSuccess()) { @@ -526,7 +487,6 @@ StatusCode MdtRawDataValAlg::fillHistograms() return sc; } - // sc = fillMDTSummaryHistograms(*mdtCollection, isNoiseBurstCandidate); sc = fillMDTSummaryHistograms(*mdtCollection, chambers_from_tracks, isNoiseBurstCandidate); if(sc.isSuccess()) { @@ -677,27 +637,6 @@ StatusCode MdtRawDataValAlg::procHistograms(/*bool isEndOfEventsBlock, bool isEn sc = regHist((TH1F*) m_overalltdccutPRLumi[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); sc = regHist((TH1F*) m_overalltdccutPRLumi[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); sc = regHist((TH1F*) m_overalltdccutPRLumi[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - /*sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - //Book tdcadc per region per lowStat, NoiseBurst cut - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); */ //Book adc adccut per region on & off segment sc = regHist((TH1F*) m_overalladc_segm_PR_Lumi[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); @@ -863,7 +802,7 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier std::string hardware_name = chamber->getName(); IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash(digcoll_id, idHash); + m_idHelperSvc->mdtIdHelper().get_module_hash(digcoll_id, idHash); int tubeIdMax = GetTubeMax(digcoll_id, hardware_name); @@ -905,34 +844,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdttdc, hardware_name + "_MDT_Station_TDC", "[nsec]", "Number of Entries", 100, 0, 2000., *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type RPC ML1 ADC Cut - ////////////////////////////////////////////////////////////////////////////////////// - /* if(m_do_mdttdccut_RPCtrig_ML1) - sc = bookMDTHisto_chambers(chamber->mdttdccut_RPCtrig_ML1, hardware_name + "_MDT_Station_TDC_ADCCut_RPCtrig_ML1", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type TGC ML1 - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_TGCtrig_ML1) - sc = bookMDTHisto_chambers(chamber->mdttdccut_TGCtrig_ML1, hardware_name + "_MDT_Station_TDC_ADCCut_TGCtrig_ML1", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type RPC ML2 ADC Cut - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_RPCtrig_ML2) - sc = bookMDTHisto_chambers(chamber->mdttdccut_RPCtrig_ML2, hardware_name + "_MDT_Station_TDC_ADCCut_RPCtrig_ML2", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type TGC ML2 - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_TGCtrig_ML2) - sc = bookMDTHisto_chambers(chamber->mdttdccut_TGCtrig_ML2, hardware_name + "_MDT_Station_TDC_ADCCut_TGCtrig_ML2", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt tdccut ML1 ////////////////////////////////////////////////////////////////////////////////////// @@ -967,12 +878,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdtadc, hardware_name + "_MDT_Station_ADC", "[adc counts]", "Number of Entries", 100, 0, 400., *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt multilayer -/* if(m_do_mdtmultil) - sc = bookMDTHisto_chambers(chamber->mdtmultil, hardware_name + "_MDT_Station_MULTIL_ADCCut", "multilayerID", "Number of Entries", - 4, 0, 4., *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt layer if(m_do_mdtlayer) @@ -985,18 +890,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdttube, hardware_name + "_MDT_Station_TUBE_ADCCut", "tubeID", "Number of Entries", tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tube bkgrd hits - /*if(m_do_mdttube_bkgrd) - sc = bookMDTHisto_chambers(chamber->mdttube_bkgrd, hardware_name + "_MDT_Station_TUBE_BKGRD_ADCCut", "tubeID", "Total Number of Hits", - tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tube counts for offline noise calculation - if(m_do_mdttube_fornoise) - sc = bookMDTHisto_chambers(chamber->mdttube_fornoise, hardware_name + "_MDT_Station_TUBE_fornoise", "tubeID", "Number of Entries", - tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt tube masked info if(m_do_mdttube_masked) { @@ -1194,18 +1087,6 @@ StatusCode MdtRawDataValAlg::bookMDTSummaryHistograms(/* bool isNewEventsBlock, if(newRun){ // //Book t0 tmax tdrift summary plots // //Just create these in the post-processing - // sc = bookMDTHisto_overview(mdttdccut_t0[enumBarrelA], "MDT_t0_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumBarrelC], "MDT_t0_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumEndCapA], "MDT_t0_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumEndCapC], "MDT_t0_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumBarrelA], "MDT_tmax_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumBarrelC], "MDT_tmax_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumEndCapA], "MDT_tmax_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumEndCapC], "MDT_tmax_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumBarrelA], "MDT_tdrift_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumBarrelC], "MDT_tdrift_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumEndCapA], "MDT_tdrift_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumEndCapC], "MDT_tdrift_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); //histo path for MDT Summary plots Barrel-EndCap std::string ecap[4]={"BA","BC","EA","EC"}; @@ -1553,27 +1434,7 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, //histo path for TotalNumber_of_MDT_hits_per_event without a cut on ADC (for high mult. events) sc = bookMDTHisto_overview(m_mdteventsLumi_big, "TotalNumber_of_MDT_hits_per_event_big", "[counts]", "Number of Events", 200, 0., 100000., m_mg->mongroup_overview_shiftLumi); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for TotalNumber_of_MDT_hits_per_event_RPCtrig - /* sc = bookMDTHisto_overview(mdtevents_RPCtrig, "TotalNumber_of_MDT_hits_per_event_RPCtrig_ADCCut", "[counts]", - "Number of Events", 200, 0., 800., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for TotalNumber_of_MDT_hits_per_event_TGCtrig - sc = bookMDTHisto_overview(mdtevents_TGCtrig, "TotalNumber_of_MDT_hits_per_event_TGCtrig_ADCCut", "[counts]", - "Number of Events", 200, 0., 800., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for overall tdccut RPCtrig spectrum - sc = bookMDTHisto_overview(m_overalltdccut_RPCtrig, "Overall_TDC_ADCCut_RPCtrig_spectrum", "[nsec]", "Number of Entries", - 120, 0., 2000., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for overall tdccut TGCtrig spectrum - sc = bookMDTHisto_overview(m_overalltdccut_TGCtrig, "Overall_TDC_ADCCut_TGCtrig_spectrum", "[nsec]", "Number of Entries", - 120, 0., 2000., m_mg->mongroup_overview_shiftLumi); - - */ + ////////////////////////////////////////////////////////////////////////////////////// //histo path for overall tdc vs adc spectrum sc = bookMDTHisto_overview_2D(m_overalltdcadcLumi, "Overall_TDCADC_spectrum", "[nsec]", "[adc counts]", 50, 0, 2000., @@ -1587,14 +1448,7 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, //histo path for Time_large_global_hits with a cut on ADC sc = bookMDTHisto_overview(m_mdtglobalhitstime, "Time_large_global_hits", "time", "Number of Events", 10000, 0., 10000., m_mg->mongroup_overview_shift); - /* - //histo path for TotalNumber_of_MDT_hits_vs_event_number without a cut on ADC - sc = bookMDTHisto_overview(mdthitsvseventnum, "TotalNumber_of_MDT_hits_vs_event_number", "event #", "Number of Hits", - 10000, 0., 10000., m_mg->mongroup_overview_shift); - //histo path for TotalNumber_of_MDT_hits_vs_event_number with a cut on ADC - sc = bookMDTHisto_overview(mdthitsvseventnumcut, "TotalNumber_of_MDT_hits_vs_event_number_ADCCut", "event #", "Number of Hits", - 10000, 0., 10000., m_mg->mongroup_overview_shift); - */ + //histo path for m_MdtNHitsvsRpcNHits sc = bookMDTHisto_overview_2D(m_MdtNHitsvsRpcNHits, "m_MdtNHitsvsRpcNHits", "# MDT hits","# RPC hits", 1000, 0., 100000., 100, 0., 10000., m_mg->mongroup_overview_shift); ////////////////////////////////////////////////////////////////////////////////////// @@ -1629,8 +1483,6 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, 1, 0., 1., m_mg->mongroup_overview_expert); for(std::vector<Identifier>::const_iterator itr = m_chambersId.begin(); itr != m_chambersId.end(); ++itr){ std::string hardware_name = getChamberName( *itr ); - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(*itr),m_muonIdHelperTool->mdtIdHelper().stationEta(*itr), - // m_muonIdHelperTool->mdtIdHelper().stationPhi(*itr),"MDT"); //Skip Chambers That Do NOT Exist if(hardware_name=="BML6A13" || hardware_name=="BML6C13") continue; m_mdtchamberstat->Fill( hardware_name.c_str(), 0.0); @@ -1676,30 +1528,17 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl // //convert layer numbering from 1->4 to 1->8 // //check if we are in 2nd multilayer // //then add 4 if large chamber, 3 if small chamber - int mdtlayer = m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id); - if (m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)==2) { + int mdtlayer = m_idHelperSvc->mdtIdHelper().tubeLayer(digcoll_id); + if (m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)==2) { if ( hardware_name.at(1) == 'I' && hardware_name.at(3) != '8' ) mdtlayer += 4; else mdtlayer += 3; } - int mdttube= m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - ChamberTubeNumberCorrection(mdttube, hardware_name, m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id), mdtlayer-1); + int mdttube= m_idHelperSvc->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + ChamberTubeNumberCorrection(mdttube, hardware_name, m_idHelperSvc->mdtIdHelper().tube(digcoll_id), mdtlayer-1); bool isNoisy = m_masked_tubes->isNoisy( mdtCollection ); - // //// Verifiy back-conversion of tubeID -> tube/layer/ML - // int test_tube = 0; - // int test_layer = 0; - // int test_ML = 0; - // TubeID_to_ID_L_ML(mdttube, hardware_name, test_tube, test_layer, test_ML, GetTubeMax(digcoll_id,hardware_name)); - // if( test_tube != m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) || test_layer != m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id) || test_ML != m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) ) { - // ATH_MSG_DEBUG("FAIL:" << hardware_name << ": true (ML,tubeLayer,tube): (" << m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) << ", " << m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id) << ", " << m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) << "), derived: (" << test_ML << ", " << test_layer << ", " << test_tube << "), [" << m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id) << "," << m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id) << "]"); - // if( (hardware_name.substr(0,4) == "BIR1" || hardware_name.substr(0,4) == "BIR4") && m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) == 1 ) { - // ATH_MSG_DEBUG(" Probably OK: shift due to cutout!" ); - // } - // else ATH_MSG_DEBUG("\n"); - // } - // //// end back-conversion verification std::string tube_str = returnString(mdttube); @@ -1715,16 +1554,12 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl } else { ATH_MSG_DEBUG("mdttdc not in hist list!" ); } - int mdtMultLayer = m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id); + int mdtMultLayer = m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id); // trigger specific if ( adc >m_ADCCut && !isNoisy ) { if (chamber->mdttdccut_ML1 && mdtMultLayer==1) { chamber->mdttdccut_ML1->Fill(tdc); } if (chamber->mdttdccut_ML2 && mdtMultLayer==2) { chamber->mdttdccut_ML2->Fill(tdc); } - //if (chamber->mdttdccut_RPCtrig_ML1 && HasTrigBARREL() && mdtMultLayer==1) { chamber->mdttdccut_RPCtrig_ML1->Fill(tdc); } - //if (chamber->mdttdccut_TGCtrig_ML1 && HasTrigENDCAP() && mdtMultLayer==1) { chamber->mdttdccut_TGCtrig_ML1->Fill(tdc); } - //if (chamber->mdttdccut_RPCtrig_ML2 && HasTrigBARREL() && mdtMultLayer==2) { chamber->mdttdccut_RPCtrig_ML2->Fill(tdc); } - //if (chamber->mdttdccut_TGCtrig_ML2 && HasTrigENDCAP() && mdtMultLayer==2) { chamber->mdttdccut_TGCtrig_ML2->Fill(tdc); } } if (chamber->mdtadc) { chamber->mdtadc->Fill(adc); } @@ -1734,20 +1569,11 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl if (chamber->mdtlayer) { if((adc >m_ADCCut && !isNoisy)) chamber->mdtlayer->Fill(mdtlayer); } if (chamber->mdttube) { if((adc >m_ADCCut) ) chamber->mdttube->Fill(mdttube); } -/* - if (chamber->mdttube_bkgrd ) { - if(adc > m_ADCCut_Bkgrd && tdc < m_TDCCut_Bkgrd) chamber->mdttube_bkgrd->Fill(m_mdttube); - } - if (chamber->mdtmultil) { if((mdtCollection->adc()>m_ADCCut && !isNoisy)) chamber->mdtmultil->Fill(m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)); } - - if (chamber->mdttube_fornoise) { if(tdc < m_TDCCut_Bkgrd) chamber->mdttube_fornoise->Fill(mdttube); } - */ if (chamber->mdtmezz) { if( adc > m_ADCCut) chamber->mdtmezz->Fill( mezzmdt( digcoll_id ) ); } return sc; } -//StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* mdtCollection, bool &isNoiseBurstCandidate ) { StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* mdtCollection, std::set<std::string> chambers_from_tracks, bool &isNoiseBurstCandidate ) { StatusCode sc = StatusCode::SUCCESS; @@ -1783,7 +1609,7 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* if( m_mdtChamberHits[iregion][ilayer][stationPhi] && adc > m_ADCCut ) m_mdtChamberHits[iregion][ilayer][stationPhi]->Fill(std::abs(stationEta)); - int mlayer_n = m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id); + int mlayer_n = m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id); // Fill Barrel - Endcap Multilayer Hits if(!isNoisy && adc > 0){ @@ -1849,10 +1675,6 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* mdtCollection, bool &isNoiseBurstCandidate ) { StatusCode sc = StatusCode::SUCCESS; Identifier digcoll_id = (mdtCollection)->identify(); - // std::string type="MDT"; - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(digcoll_id), - // m_muonIdHelperTool->mdtIdHelper().stationEta(digcoll_id), - // m_muonIdHelperTool->mdtIdHelper().stationPhi(digcoll_id),type); std::string hardware_name = getChamberName( mdtCollection ); bool isNoisy = m_masked_tubes->isNoisy( mdtCollection ); @@ -1881,11 +1703,11 @@ StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* //Barrel -->Fill MDT Global RZ and YX if( adc>m_ADCCut ) { - if(fabs(mdt_tube_eta)>0. && fabs(mdt_tube_eta)<0.9){m_mdtrzdet[0]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[0]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>0. && std::abs(mdt_tube_eta)<0.9){m_mdtrzdet[0]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[0]->Fill(mdt_tube_x,mdt_tube_y);} //OverLap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>0.9 && fabs(mdt_tube_eta)<1.2){m_mdtrzdet[1]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[1]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>0.9 && std::abs(mdt_tube_eta)<1.2){m_mdtrzdet[1]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[1]->Fill(mdt_tube_x,mdt_tube_y);} //EndCap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>1.2 && fabs(mdt_tube_eta)<2.7){m_mdtrzdet[2]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[2]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>1.2 && std::abs(mdt_tube_eta)<2.7){m_mdtrzdet[2]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[2]->Fill(mdt_tube_x,mdt_tube_y);} } if(m_overalltdcadcLumi && !isNoisy && adc > 0) m_overalltdcadcLumi->Fill(tdc, adc); @@ -1909,15 +1731,7 @@ StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* if(m_overalltdccutLumi && !isNoisy) m_overalltdccutLumi->Fill(tdc); if(!m_overalltdccutLumi) ATH_MSG_DEBUG("overalltdccut not in hist list"); } -/* if (adc>m_ADCCut && HasTrigBARREL()) { - if(m_overalltdccut_RPCtrig) m_overalltdccut_RPCtrig->Fill(tdc); - else ATH_MSG_DEBUG("overalltdccut not in hist list!" ); - } - if (adc>m_ADCCut && HasTrigENDCAP()) { - if(m_overalltdccut_TGCtrig) m_overalltdccut_TGCtrig->Fill(tdc); - else ATH_MSG_DEBUG("overalltdccut not in hist list!" ); - } -*/ + return sc; } @@ -1975,7 +1789,7 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s Identifier tmpid = rot->identify(); IdentifierHash idHash; MDTChamber* chamber = 0; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( tmpid, idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( tmpid, idHash ); sc = getChamber(idHash, chamber); std::string chambername = chamber->getName(); float adc = mrot->prepRawData()->adc(); @@ -2010,26 +1824,21 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s m_mdthitsperchamber_onSegm_InnerMiddleOuterLumi[ibarrel_endcap]->SetEntries(m_mdthitsperchamber_onSegm_InnerMiddleOuterLumi[ibarrel_endcap]->GetEntries()+1); } } - int mdtMultLayer = m_muonIdHelperTool->mdtIdHelper().multilayer(tmpid); - //chamber->mdtadc_onSegm->Fill(mrot->prepRawData()->adc()); + int mdtMultLayer = m_idHelperSvc->mdtIdHelper().multilayer(tmpid); if(chamber->mdtadc_onSegm_ML1 && mdtMultLayer == 1){ chamber->mdtadc_onSegm_ML1->Fill(adc); - //sumADC_ML1 += mrot->prepRawData()->adc(); - // numHits_ML1++; } if(chamber->mdtadc_onSegm_ML2&& mdtMultLayer == 2){ chamber->mdtadc_onSegm_ML2->Fill(adc); - // sumADC_ML2 += mrot->prepRawData()->adc(); - // numHits_ML2++; } } // This information needs to be stored fully for each segment (for calculations below), so deal with these duplicates later // (otherwise we may not check a traversed ML for a differently pointing overlapping segment, for example) ROTs_chamber.push_back( tmpid ); - ROTs_ML.push_back( m_muonIdHelperTool->mdtIdHelper().multilayer(tmpid) ); - ROTs_L.push_back( m_muonIdHelperTool->mdtIdHelper().tubeLayer(tmpid) ); - ROTs_tube.push_back( m_muonIdHelperTool->mdtIdHelper().tube(tmpid) ); + ROTs_ML.push_back( m_idHelperSvc->mdtIdHelper().multilayer(tmpid) ); + ROTs_L.push_back( m_idHelperSvc->mdtIdHelper().tubeLayer(tmpid) ); + ROTs_tube.push_back( m_idHelperSvc->mdtIdHelper().tube(tmpid) ); ROTs_DR.push_back( mrot->driftRadius() ); ROTs_DRerr.push_back( (mrot->localCovariance())(Trk::driftRadius,Trk::driftRadius) ) ; // always returns value 2.0 ROTs_DT.push_back( mrot->driftTime() ); @@ -2047,8 +1856,6 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s bool isUnique = true; for(unsigned j=0; j<unique_chambers.size(); j++) { if( getChamberName(ROTs_chamber.at(i)) == getChamberName(unique_chambers.at(j)) ){ - // if( convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(ROTs_chamber.at(i)), m_muonIdHelperTool->mdtIdHelper().stationEta(ROTs_chamber.at(i)), m_muonIdHelperTool->mdtIdHelper().stationPhi(ROTs_chamber.at(i)),type) - // == convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(unique_chambers.at(j)), m_muonIdHelperTool->mdtIdHelper().stationEta(unique_chambers.at(j)), m_muonIdHelperTool->mdtIdHelper().stationPhi(unique_chambers.at(j)),type) ) { isUnique = false; if( !AinB( ROTs_ML.at(i), unique_chambers_ML.at(j) ) ) unique_chambers_ML.at(j).push_back( ROTs_ML.at(i) ); @@ -2071,10 +1878,9 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s std::vector<float> traversed_distance; for( unsigned i_chamber=0; i_chamber<unique_chambers.size(); i_chamber++) { Identifier station_id = unique_chambers.at(i_chamber); - if( !m_muonIdHelperTool->mdtIdHelper().is_mdt( station_id ) ) { + if( !m_idHelperSvc->mdtIdHelper().is_mdt( station_id ) ) { ATH_MSG_DEBUG("is_mdt() returned false in segm-based mdt eff calc" ); } - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(station_id), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id),type); std::string hardware_name = getChamberName(station_id); // SEGMENT track @@ -2089,20 +1895,20 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s // Loop over tubes in chamber, find those along segment for(unsigned i_ML=0; i_ML<unique_chambers_ML.at(i_chamber).size(); i_ML++) { int ML = unique_chambers_ML.at(i_chamber).at(i_ML); - Identifier newId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id), ML, 1, 1); - int tubeMax = m_muonIdHelperTool->mdtIdHelper().tubeMax(newId); - int tubeLayerMax = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(newId); + Identifier newId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(station_id), m_idHelperSvc->mdtIdHelper().stationPhi(station_id), ML, 1, 1); + int tubeMax = m_idHelperSvc->mdtIdHelper().tubeMax(newId); + int tubeLayerMax = m_idHelperSvc->mdtIdHelper().tubeLayerMax(newId); CorrectTubeMax(hardware_name, tubeMax); CorrectLayerMax(hardware_name, tubeLayerMax); - for(int i_tube=m_muonIdHelperTool->mdtIdHelper().tubeMin(newId); i_tube<=tubeMax; i_tube++) { - for(int i_layer=m_muonIdHelperTool->mdtIdHelper().tubeLayerMin(newId); i_layer<=tubeLayerMax; i_layer++) { + for(int i_tube=m_idHelperSvc->mdtIdHelper().tubeMin(newId); i_tube<=tubeMax; i_tube++) { + for(int i_layer=m_idHelperSvc->mdtIdHelper().tubeLayerMin(newId); i_layer<=tubeLayerMax; i_layer++) { const MuonGM::MdtReadoutElement* MdtRoEl = MuonDetMgr->getMdtReadoutElement( newId ); - if(m_BMGpresent && m_muonIdHelperTool->mdtIdHelper().stationName(newId) == m_BMGid ) { + if(m_BMGpresent && m_idHelperSvc->mdtIdHelper().stationName(newId) == m_BMGid ) { std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find(MdtRoEl->identify()); if( myIt != m_DeadChannels.end() ){ - Identifier tubeId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id), ML, i_layer, i_tube ); + Identifier tubeId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(station_id), m_idHelperSvc->mdtIdHelper().stationPhi(station_id), ML, i_layer, i_tube ); if( std::find( (myIt->second).begin(), (myIt->second).end(), tubeId) != (myIt->second).end() ) { - ATH_MSG_DEBUG("Skipping tube with identifier " << m_muonIdHelperTool->mdtIdHelper().show_to_string(tubeId) ); + ATH_MSG_DEBUG("Skipping tube with identifier " << m_idHelperSvc->mdtIdHelper().show_to_string(tubeId) ); continue; } } @@ -2129,11 +1935,10 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s // Here we fill the DRvsDT/DRvsSegD histos, as well is unique hits and traversed tubes to calculate efficiencies if(traversed_tube.size() < 20) { // quality cut here -- 20 traversed tubes is ridiculous and generates low efficiencies (these are due to non-pointing segments) for (unsigned k=0; k<traversed_tube.size(); k++) { - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationPhi(traversed_station_id.at(k)),type); std::string hardware_name = getChamberName(traversed_station_id.at(k)); // GET HISTS IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( traversed_station_id.at(k), idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( traversed_station_id.at(k), idHash ); MDTChamber* chamber; sc = getChamber( idHash, chamber ); if(!sc.isSuccess()){ @@ -2143,8 +1948,6 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s bool hit_flag = false; for (unsigned j=0; j<ROTs_tube.size(); j++) { - // if( (convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(ROTs_chamber.at(j)), m_muonIdHelperTool->mdtIdHelper().stationEta(ROTs_chamber.at(j)), m_muonIdHelperTool->mdtIdHelper().stationPhi(ROTs_chamber.at(j)),type) == hardware_name) - // && (traversed_tube.at(k)==ROTs_tube.at(j)) && (traversed_L.at(k)==ROTs_L.at(j)) && (traversed_ML.at(k)==ROTs_ML.at(j))) { // found traversed tube with hit used in segment if( (getChamberName(ROTs_chamber.at(j)) == hardware_name) && (traversed_tube.at(k)==ROTs_tube.at(j)) && (traversed_L.at(k)==ROTs_L.at(j)) && (traversed_ML.at(k)==ROTs_ML.at(j))) { // found traversed tube with hit used in segment hit_flag = true; @@ -2154,13 +1957,13 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s break; } } - Identifier newId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationPhi(traversed_station_id.at(k)), traversed_ML.at(k), 1, 1); - int tubeLayerMax = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(newId); - m_muonIdHelperTool->mdtIdHelper().get_module_hash( newId, idHash ); + Identifier newId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_idHelperSvc->mdtIdHelper().stationPhi(traversed_station_id.at(k)), traversed_ML.at(k), 1, 1); + int tubeLayerMax = m_idHelperSvc->mdtIdHelper().tubeLayerMax(newId); + m_idHelperSvc->mdtIdHelper().get_module_hash( newId, idHash ); CorrectLayerMax(hardware_name, tubeLayerMax); // ChamberTubeNumberCorrection handles the tubeMax problem int mdtlayer = ( (traversed_L.at(k) - 1) + (traversed_ML.at(k) - 1) * tubeLayerMax ); - int ibin = traversed_tube.at(k) + mdtlayer * m_muonIdHelperTool->mdtIdHelper().tubeMax(newId); + int ibin = traversed_tube.at(k) + mdtlayer * m_idHelperSvc->mdtIdHelper().tubeMax(newId); ChamberTubeNumberCorrection(ibin, hardware_name, traversed_tube.at(k), mdtlayer); // Store info for eff calc // (Here we make sure we are removing duplicates from overlapping segments by using sets) @@ -2211,10 +2014,10 @@ void MdtRawDataValAlg::initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl Identifier detElId = mydetEl->identify(); - int name = m_muonIdHelperTool->mdtIdHelper().stationName(detElId); - int eta = m_muonIdHelperTool->mdtIdHelper().stationEta(detElId); - int phi = m_muonIdHelperTool->mdtIdHelper().stationPhi(detElId); - int ml = m_muonIdHelperTool->mdtIdHelper().multilayer(detElId); + int name = m_idHelperSvc->mdtIdHelper().stationName(detElId); + int eta = m_idHelperSvc->mdtIdHelper().stationEta(detElId); + int phi = m_idHelperSvc->mdtIdHelper().stationPhi(detElId); + int ml = m_idHelperSvc->mdtIdHelper().multilayer(detElId); std::vector<Identifier> deadTubes; std::vector<int>::iterator it = tubes.begin(); @@ -2230,7 +2033,7 @@ void MdtRawDataValAlg::initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl ++it; } else { - Identifier deadTubeId = m_muonIdHelperTool->mdtIdHelper().channelID( name, eta, phi, ml, layer, tube ); + Identifier deadTubeId = m_idHelperSvc->mdtIdHelper().channelID( name, eta, phi, ml, layer, tube ); deadTubes.push_back( deadTubeId ); ATH_MSG_VERBOSE("adding dead tube (" << tube << "), layer(" << layer << "), phi(" << phi << "), eta(" << eta << "), name(" << name diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx index 8a897a4648ae26ef4dce5dffe9b6047070744622..088389f7ca86205b16e4069e5d9cf010d3640d7a 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx @@ -1,15 +1,8 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -////////////////////////////////////////////////////////////////// -// MuonChamberIDSelector.cxx -// Source file for class MuonChamberIDSelector -/////////////////////////////////////////////////////////////////// - #include "MdtRawDataMonitoring/MuonChamberIDSelector.h" - -#include "Identifier/IdentifierHash.h" #include "MuonDQAUtils/MuonChamberNameConverter.h" #include <iomanip> @@ -21,29 +14,13 @@ MuonChamberIDSelector::MuonChamberIDSelector(const std::string &name, ISvcLocato m_rpcchambersId(0) {} -MuonChamberIDSelector::~MuonChamberIDSelector() -{ - ATH_MSG_INFO( " deleting MuonChamberIDSelector " ); -} - // Initialize method: StatusCode MuonChamberIDSelector::initialize() { - StatusCode sc; - // Get the messaging service, print where you are + ATH_CHECK(AthAlgorithm::initialize()); ATH_MSG_DEBUG( "initialize() called" ); - - IToolSvc* toolsvc; - sc=service("ToolSvc",toolsvc); - if( sc.isFailure() ){ - ATH_MSG_WARNING("Could not get tool sevices "); - return( StatusCode::FAILURE ); - } - - // Retrieve MuonIdHelperTool - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - return sc; + ATH_CHECK(m_idHelperSvc.retrieve()); + return StatusCode::SUCCESS; } StatusCode MuonChamberIDSelector::execute() @@ -56,45 +33,33 @@ StatusCode MuonChamberIDSelector::execute() return StatusCode::SUCCESS; } -StatusCode MuonChamberIDSelector::finalize() -{ - ATH_MSG_DEBUG( "finalize() called" ); - - return StatusCode::SUCCESS; -} - - StatusCode MuonChamberIDSelector::ChamberperformSelection() { - StatusCode sc = StatusCode::SUCCESS ; - - //sc = selectMDT(std::vector<Identifier>& mdtchambersId) ; + StatusCode sc = StatusCode::SUCCESS; sc = selectMDT() ; sc = selectRPC() ; sc = selectTGC() ; sc = selectCSC() ; - return sc ; } -//StatusCode MuonChamberIDSelector::selectMDT(std::vector<Identifier>& mdtchambersId) { StatusCode MuonChamberIDSelector::selectMDT() { StatusCode sc = StatusCode::SUCCESS ; ATH_MSG_DEBUG( "in MDT ChambersSelectorID vector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); m_mdtchambersId->push_back(Id); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG( "Adding the chamber Identifier: " << extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<< Idhash ); else ATH_MSG_DEBUG(" hash Id NOT computed "<< Idhash ); @@ -109,10 +74,10 @@ StatusCode MuonChamberIDSelector::selectRPC() { StatusCode sc = StatusCode::SUCCESS ; ATH_MSG_DEBUG( "in RPC ChambersSelectorID vector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().module_end(); - IdContext rpcModuleContext = m_muonIdHelperTool->rpcIdHelper().module_context(); + IdContext rpcModuleContext = m_idHelperSvc->rpcIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; m_rpcchambersId = new std::vector<Identifier>; @@ -120,9 +85,9 @@ StatusCode MuonChamberIDSelector::selectRPC() { for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); m_rpcchambersId->push_back(Id); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); ATH_MSG_DEBUG( "Adding the chamber Identifier: " << extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<< Idhash ); else ATH_MSG_DEBUG(" hash Id NOT computed "<< Idhash ); @@ -131,22 +96,3 @@ StatusCode MuonChamberIDSelector::selectRPC() { return sc ; } - -StatusCode MuonChamberIDSelector::selectTGC() { - - StatusCode sc = StatusCode::SUCCESS ; - ATH_MSG_DEBUG( "in TGC ChambersSelectorID vector" ); - - return sc ; - -} - -StatusCode MuonChamberIDSelector::selectCSC() { - - StatusCode sc = StatusCode::SUCCESS ; - ATH_MSG_DEBUG( "in CSC ChambersSelectorID vector" ); - - return sc ; - -} - diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h index f030af303c32dabf26dc459c7ab416a276420117..dee7184c8311a665e42102464a886b1108e39bb9 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h @@ -19,26 +19,19 @@ #include <vector> #include <map> -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ToolHandle.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" -#include "MuonReadoutGeometry/MdtReadoutElement.h" - - -#include "AthenaMonitoring/AthenaMonManager.h" -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" - +#include "MuonPrepRawData/RpcPrepDataContainer.h" +#include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/ReadHandleKey.h" -class TFile; +class TH1; +class TH2; + template <class ConcreteAlgorithm> class AlgFactory; ///////////////////////////////////////////////////////////////////////////// @@ -74,16 +67,13 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; void bookMDTvsRPCHistograms(std::string m_hardware_name, std::string m_layer_name, int binz, int binminz, int binmaxz, int binx, int binminx, int binmaxx ); void bookMDTvsRPCsectorHistograms(std::string m_sector_name, std::string m_layer_name, float stripzmin, float stripzmax,float wirezmin, float wirezmax ); - MuonDQAHistMap m_stationHists; - bool m_doClusters; std::string m_clusterContainerName; bool m_checkCabling; @@ -93,11 +83,9 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase int m_mdtvsrpcreducerpcnbins ; int m_mdtvsrpcreducemdtnbins ; int m_mdtvsrpcreducemdttdcnbins ; - + bool m_doMdtvsRpcESD ; - //Declare Properties - std::string m_chamberName; std::string m_StationSize; SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; @@ -107,9 +95,7 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase int m_lastEvent; int m_cosmicStation; - TH1* m_MdtRpcZdiff ; - TH2* m_MdtNHitsvsRpcNHits ; }; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx index aada0f4ad35d77ad87977cd3f2266497d832a020..76b8d94fe6426acb85be20a5cbf949a6a827251e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx @@ -20,9 +20,6 @@ #include "MuonRDO/RpcPadContainer.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" -#include "Identifier/Identifier.h" - - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" @@ -85,38 +82,14 @@ MdtVsRpcRawDataValAlg::~MdtVsRpcRawDataValAlg() } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -StatusCode MdtVsRpcRawDataValAlg::initialize(){ - +StatusCode MdtVsRpcRawDataValAlg::initialize() { + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO ( "in initializing MdtVsRpcRawDataValAlg" ); - - StatusCode sc; - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL ( "DetectorStore service not found !" ); - return StatusCode::FAILURE; - } - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - if (sc.isFailure()) { - ATH_MSG_FATAL ( "Cannot get MuonDetectorManager from detector store" ); - return StatusCode::FAILURE; - } - else { - ATH_MSG_DEBUG ( " Found the MuonDetectorManager from detector store. " ); - } - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; - + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_key_mdt.initialize()); ATH_CHECK(m_key_rpc.initialize()); - return StatusCode::SUCCESS; } @@ -210,16 +183,16 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() Identifier prd_id = (*rpcPrd)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi (prd_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prd_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta (prd_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR (prd_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi (prd_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prd_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta (prd_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR (prd_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prd_id)) ; // only take eta hits if( irpcmeasuresPhi != 0 )continue; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prd_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prd_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prd_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prd_id)) ; @@ -228,8 +201,8 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() std::string hardware_name=convertChamberName(irpcstationName,irpcstationEta,irpcstationPhi,type) ; if (selectChambersRange(hardware_name, m_chamberName, - m_muonIdHelperTool->rpcIdHelper().stationEta(dig_id), m_StationEta, - m_muonIdHelperTool->rpcIdHelper().stationPhi(dig_id), m_StationPhi, m_StationSize) && chambersCosmicSetup(hardware_name,m_cosmicStation)) { + m_idHelperSvc->rpcIdHelper().stationEta(dig_id), m_StationEta, + m_idHelperSvc->rpcIdHelper().stationPhi(dig_id), m_StationPhi, m_StationSize) && chambersCosmicSetup(hardware_name,m_cosmicStation)) { //define layer int imdt_multi_near = 0; @@ -379,21 +352,21 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() for (Muon::MdtPrepDataCollection::const_iterator mdtCollection=(*containerMdtIt)->begin(); mdtCollection!=(*containerMdtIt)->end(); ++mdtCollection ) { dig_idmdt = (*mdtCollection)->identify(); - int imdt_station = int(m_muonIdHelperTool->mdtIdHelper().stationName (dig_idmdt)); + int imdt_station = int(m_idHelperSvc->mdtIdHelper().stationName (dig_idmdt)); if (imdt_station != irpcstationName) continue; - int imdt_eta = int(m_muonIdHelperTool->mdtIdHelper().stationEta (dig_idmdt)); + int imdt_eta = int(m_idHelperSvc->mdtIdHelper().stationEta (dig_idmdt)); if (imdt_eta != irpcstationEta ) continue; - int imdt_phi = int(m_muonIdHelperTool->mdtIdHelper().stationPhi (dig_idmdt)); + int imdt_phi = int(m_idHelperSvc->mdtIdHelper().stationPhi (dig_idmdt)); if (imdt_phi != irpcstationPhi ) continue; dig_idmdt = (*mdtCollection)->identify(); - int imdt_multi = int(m_muonIdHelperTool->mdtIdHelper().multilayer (dig_idmdt)); + int imdt_multi = int(m_idHelperSvc->mdtIdHelper().multilayer (dig_idmdt)); // only look at near multilayer if(imdt_multi != imdt_multi_near) continue; int imdt_adc = int((*mdtCollection)->adc()); //cut on noise if( imdt_adc<ncutadc )continue; int imdt_tdc = int((*mdtCollection)->tdc()); - int imdt_wire = int(m_muonIdHelperTool->mdtIdHelper().tube (dig_idmdt)); + int imdt_wire = int(m_idHelperSvc->mdtIdHelper().tube (dig_idmdt)); //get mdt information from geomodel to book and fill mdtvsrpc histos with the right min and max range diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h index 39196451e49800baf4dadc3c5f88b0b92907e4a3..b8486bf76531d505f63c424a7a7ec82e792f0145 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.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 */ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,60 +15,26 @@ #ifndef MdtVsTgcRawDataValAlg_H #define MdtVsTgcRawDataValAlg_H -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" -#include "GaudiKernel/ToolHandle.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/TgcReadoutElement.h" - -//#include "TGCcablingInterface/ITGCcablingServerSvc.h" - -#include "MuonSegment/MuonSegment.h" -#include "TrkSegment/SegmentCollection.h" - -#include "TrkTrack/Track.h" -#include "TrkTrack/TrackCollection.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" -#include "muonEvent/MuonContainer.h" - #include "MuonTrigCoinData/TgcCoinData.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonTrigCoinData/TgcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" - -#include "MuonDQAUtils/TGCDQAUtils.h" -#include "MuonDQAUtils/MuonDQAFitFunc.h" -//use new mdt segment container #include "xAODMuon/MuonSegmentContainer.h" - #include "StoreGate/ReadHandleKey.h" +#include "MuonPrepRawData/MdtPrepDataContainer.h" #include "SegmTrack.h" -#include "TH1F.h" -#include "TH2F.h" -#include <sstream> -#include <string.h> +#include <string> #include <vector> -#include <map> -#include <fstream> - -class TFile; template <class ConcreteAlgorithm> class AlgFactory; -///////////////////////////////////////////////////////////////////////////// - class MdtVsTgcRawDataValAlg: public ManagedMonitorToolBase { public: @@ -76,7 +42,6 @@ public: MdtVsTgcRawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); virtual ~MdtVsTgcRawDataValAlg(); StatusCode initialize(); - //StatusCode finalize(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); @@ -101,15 +66,10 @@ public: // MuonDetectorManager from the conditions store SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager", - "Key of input MuonDetectorManager condition data"}; - - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - - // const ITGCcablingSvc* m_cabling; + "Key of input MuonDetectorManager condition data"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; //Declare Properties - bool m_checkCabling; bool m_tgclv1file; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx index b31f509b3250adb973cb8956f85b2efd6ace042c..ad1588dcc8143618cb3bf2391281dd52cd694145 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx @@ -10,35 +10,22 @@ // DESCRIPTION: // Subject: correlation btw MDT hits vs TGC RoI -->Offline Muon Data Quality ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ToolHandle.h" - + +#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" + #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" - -// MuonDetDesc #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" - #include "MuonRIO_OnTrack/MuonClusterOnTrack.h" - #include "TrkSegment/SegmentCollection.h" - -#include "Identifier/Identifier.h" - #include "MuonCalibIdentifier/MuonFixedId.h" - -#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" #include "AthenaMonitoring/AthenaMonManager.h" -#include <inttypes.h> - +#include <inttypes.h> #include <sstream> #include <algorithm> #include <fstream> @@ -110,15 +97,11 @@ MdtVsTgcRawDataValAlg::~MdtVsTgcRawDataValAlg(){ StatusCode MdtVsTgcRawDataValAlg::initialize(){ - // init message stream + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" ); - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; + ATH_CHECK(m_idHelperSvc.retrieve()); //MDT z position //Name MultiLayer TubeLayer z @@ -136,17 +119,14 @@ MdtVsTgcRawDataValAlg::initialize(){ //18 2 3 14030.6 // Retrieve the MuonDetectorManager - const MuonGM::MuonDetectorManager* MuonDetMgrDS; + const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr; ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) ); ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " ); - prepareTREarray(MuonDetMgrDS); - ATH_CHECK(m_tgc_PrepDataContainerName.initialize()); ATH_CHECK(m_tgc_CoinContainerName.initialize()); ATH_CHECK(m_mdt_PrepDataContainerName.initialize()); ATH_CHECK(m_mdt_SegmentCollectionName.initialize()); - return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx index d431d6f1db3c21eed4073b579887ad550f2285bb..103f0bea1f2dfd391ca8b37b598c7bcdb2623924 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx @@ -91,7 +91,7 @@ MdtVsTgcRawDataValAlg::prepareTREarray(const MuonGM::MuonDetectorManager* MuonDe int stationName = TGCStationNames[stationNameIndex]; for(int stationEta=-8; stationEta<=8; stationEta++){// Station Eta int tgcAC(stationEta<0); - int absStationEta = abs(stationEta); + int absStationEta = std::abs(stationEta); for(int stationPhi=0; stationPhi<=48; stationPhi++){// Station Phi // Exclude non-existent "zero" sectors included in the array for ease of use if(stationEta==0){ @@ -104,28 +104,28 @@ MdtVsTgcRawDataValAlg::prepareTREarray(const MuonGM::MuonDetectorManager* MuonDe // Exclude sectors known not to exist if(stationNameIndex==6){ // Inner Forward - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>24)continue; } else if(stationNameIndex==7){ // Inner Endcap - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>21)continue; } else if((stationNameIndex==0)|| // Midstation Forward (stationNameIndex==2)|| (stationNameIndex==4)){ - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>24)continue; } else{ // Midstation Endcap - if(abs(stationEta)>5)continue; + if(std::abs(stationEta)>5)continue; if((stationNameIndex==1)&& - (abs(stationEta)>4))continue; + (std::abs(stationEta)>4))continue; } // Get identifier of TRE at this set of indexes bool *isValid = new bool(true); - Identifier tgc_testId = m_muonIdHelperTool->tgcIdHelper().elementID(stationName, stationEta, stationPhi, true, isValid); + Identifier tgc_testId = m_idHelperSvc->tgcIdHelper().elementID(stationName, stationEta, stationPhi, true, isValid); if(!*isValid){delete isValid; continue;} delete isValid; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx index 9e4d9a5de7214cdc3945193dfd6dec87a14d0306..36124c806605979ea5be665839053f4b49bf673b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx @@ -11,26 +11,16 @@ // Subject: correlation btw MDT hits vs TGC RoI -->Offline Muon Data Quality //////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" +#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" -// MuonDetDesc #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "Identifier/Identifier.h" - -//mdt stuff #include "MuonCalibIdentifier/MuonFixedId.h" - -#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" -#include "AthenaMonitoring/AthenaMonManager.h" - -#include <inttypes.h> +#include <inttypes.h> #include <sstream> #include <algorithm> @@ -83,7 +73,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(tgcid); const Amg::Vector3D pos = pReadoutElementTGC->channelPos(tgcid); - float tgcEta = abs(pos.eta()); + float tgcEta = std::abs(pos.eta()); float tgcPhi = pos.phi(); if(tgcPhi<0)tgcPhi+=2*M_PI; @@ -122,7 +112,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con // endcap: increases with R // ============================================================================== - int mdtStationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(mdt_id)) ; + int mdtStationName = int(m_idHelperSvc->mdtIdHelper().stationName(mdt_id)) ; //SN Layer Tube Radial //13:EIL 2x4 x54 x4 @@ -144,8 +134,8 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con //only Endcap middle MDT if(mdtStationName!=17 && mdtStationName!=18 )continue; - int mdtStationEta = int(m_muonIdHelperTool->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R) - int mdtStationPhi = int(m_muonIdHelperTool->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8] + int mdtStationEta = int(m_idHelperSvc->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R) + int mdtStationPhi = int(m_idHelperSvc->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8] int mdtAC = (mdtStationEta<0);//a:0, c:1 float mdtSector=mdtStationPhi*2.-1.; @@ -161,8 +151,6 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con <<" mdtStationPhi "<<mdtStationPhi <<" mdtSectorPhi "<<mdtSectorPhi ); - //if( itgcstationEta!=RoIEta || itgcstationPhi!=RoIPhi48 || end_or_for!=RoIEF || a_or_c!=RoISide )continue; - //loop over MDT PRD Collection Muon::MdtPrepDataCollection::const_iterator collection_it_end=(*containerIt)->end(); @@ -179,10 +167,10 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con Identifier mdt_id2 = (*mdtCollection)->identify(); - int mdtMultiLayer = int(m_muonIdHelperTool->mdtIdHelper().multilayer(mdt_id2)); - int mdtTubeLayer = int(m_muonIdHelperTool->mdtIdHelper().tubeLayer(mdt_id2)); - int mdtTube = int(m_muonIdHelperTool->mdtIdHelper().tube(mdt_id2)); - int mdtTubeIdForEM = (abs(mdtStationEta)-1)*64 + mdtTube -1; + int mdtMultiLayer = int(m_idHelperSvc->mdtIdHelper().multilayer(mdt_id2)); + int mdtTubeLayer = int(m_idHelperSvc->mdtIdHelper().tubeLayer(mdt_id2)); + int mdtTube = int(m_idHelperSvc->mdtIdHelper().tube(mdt_id2)); + int mdtTubeIdForEM = (std::abs(mdtStationEta)-1)*64 + mdtTube -1; ATH_MSG_DEBUG("mdtMultiLayer "<<mdtMultiLayer <<" mdtTubeLayer "<<mdtTubeLayer @@ -199,7 +187,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con const MuonGM::MdtReadoutElement* pReadoutElementMDT = MuonDetMgr->getMdtReadoutElement(mdt_id2); const Amg::Vector3D mdtgPos = pReadoutElementMDT->tubePos(mdt_id2); //global position of the wire - float mdtEta = abs(mdtgPos.eta()); + float mdtEta = std::abs(mdtgPos.eta()); float mdtPhi = mdtgPos.phi(); float mdtr = mdtgPos.perp(); float mdtz = mdtgPos.z(); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx index 47716c34e23648724dac30c9a98a41196b9ebecd..7f93ee50b68e3fb16dbe7703d4fa7004c3b2442b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx @@ -21,7 +21,6 @@ #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "muonEvent/MuonContainer.h" -//use new MDT segment container #include "xAODMuon/MuonSegmentContainer.h" #include "xAODMuon/MuonSegment.h" @@ -63,10 +62,10 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, const Trk::RIO_OnTrack* rio = segm->rioOnTrack(i); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // Flag Segments with ROTs in the MDT & Endcap - if(m_muonIdHelperTool->mdtIdHelper().is_mdt(id))isMdt=true; - if(m_muonIdHelperTool->mdtIdHelper().isEndcap(id))isEndcap=true; + if(m_idHelperSvc->mdtIdHelper().is_mdt(id))isMdt=true; + if(m_idHelperSvc->mdtIdHelper().isEndcap(id))isEndcap=true; // If ROT is MDT if((stationName==13)||(stationName==49)){nMdtMeas[0]++;} if((stationName==14)||(stationName==15)){nMdtMeas[1]++;} @@ -94,7 +93,7 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, for(int jMDT=0;jMDT<4;jMDT++){// jMDT if(nMdtMeas[jMDT]){// If hits in this Station // Get position variables - float segmGlobalEta = abs(segmGlobalPos.eta()); + float segmGlobalEta = std::abs(segmGlobalPos.eta()); float segmGlobalPhi = segmGlobalPos.phi(); if(segmGlobalPhi<0) segmGlobalPhi+=2*M_PI; // Fill position histogram @@ -123,8 +122,8 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, // Get detector variables Identifier tgcid=(*tgc_itc)->identify(); - int tgcStationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int tgcStationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Get position variables const Amg::Vector3D tgcGlobalPos = tpd->globalPosition(); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx index 91b22b5f85c7d0ff920224bf05052a93515c25c8..e93506c7fa809292d0b47ae559e3b01c8f2d0e52 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx @@ -103,7 +103,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> const Trk::RIO_OnTrack* rio = segm0->rioOnTrack(iROT); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); if((stationName==17)||(stationName==18))nMdtMeas++;// MDT } @@ -135,16 +135,13 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Get position variables //const Trk::GlobalPosition segm1Pos = segm1->globalPosition(); const Amg::Vector3D segm1Pos = segm1->globalPosition(); - - //float segm1PosRho = abs(segm1Pos.perp()); - //float segm1PosEta = abs(segm1Pos.eta()); + float segm1PosPhi = segm1Pos.phi(); float segm1PosThe = segm1Pos.theta(); float segm1PosZ = segm1Pos.z(); if(segm1PosPhi<0)segm1PosPhi+=2*M_PI; if(segm1PosThe>M_PI/2) segm1PosThe=M_PI-segm1PosThe; - //Trk::GlobalDirection segm1PosZunit(segm1Pos/abs(segm1PosZ)); - Amg::Vector3D segm1PosZunit(segm1Pos/abs(segm1PosZ)); + Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ)); //////////////////////////////////////////////////////////////////////// @@ -156,8 +153,8 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> const Trk::RIO_OnTrack* rio = segm1->rioOnTrack(iROT); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); - bool isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); + bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id); if(((stationName==41)||(stationName==42))&&isStrip)nTGCStrips[0]++;// TGC if(((stationName==43)||(stationName==44))&&isStrip)nTGCStrips[1]++;// TGC @@ -186,29 +183,26 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(skipSegm)continue; // Get position variables - //const Trk::GlobalPosition segm2Pos = segm2->globalPosition(); const Amg::Vector3D segm2Pos = segm2->globalPosition(); - float segm2PosRho = abs(segm2Pos.perp()); + float segm2PosRho = std::abs(segm2Pos.perp()); float segm2PosPhi = segm2Pos.phi(); float segm2PosZ = segm2Pos.z(); if(segm2PosPhi<0)segm2PosPhi+=2*M_PI; - //Trk::GlobalDirection segm2PosZunit(segm2Pos/abs(segm2PosZ)); - Amg::Vector3D segm2PosZunit(segm2Pos/abs(segm2PosZ)); + Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ)); // Apply preliminary phi cut between segm1 and segm2 positions float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi; if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI; if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI; - if(abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){ + if(std::abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){ failedGroupingCut=true; break; } // Extrapolate segm1 position to segm2's Z position - float dZ = abs(segm2PosZ)-abs(segm1PosZ); - //Trk::GlobalPosition extrPos(segm1Pos+(segm1PosZunit*dZ)); + float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ); Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ)); - float extrPosRho = abs(extrPos.perp()); + float extrPosRho = std::abs(extrPos.perp()); float extrPosThe = extrPos.theta(); float extrPosPhi = extrPos.phi(); if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe; @@ -221,8 +215,8 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI; // Cut segments (segm1) which are inside difference cuts - if((abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)|| - (abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){ + if((std::abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)|| + (std::abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){ failedGroupingCut=true; break; } @@ -253,7 +247,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Extrapolate position from nearest Station's Segment to Sector's Z float sectorZ=tre->globalPosition().z(); - float dZ_sector=abs(sectorZ)-abs(segm1PosZ); + float dZ_sector=std::abs(sectorZ)-std::abs(segm1PosZ); //Trk::GlobalPosition sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector); Amg::Vector3D sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector); @@ -325,11 +319,11 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> Identifier tgcid=(*prepitc)->identify(); int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1 int tgcFE=(tre->forward()==false);//isNotForward f:0, e:1 - int tgcWS=(m_muonIdHelperTool->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); - int stationEta = abs(tre->getStationEta()); + int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 + int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); + int stationEta = std::abs(tre->getStationEta()); int stationPhi = tre->getStationPhi(); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Cut hits except those from same side Midstation if(tgcAC!=i) continue; @@ -341,20 +335,18 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(stationIndex==3)continue; // Get position variables - //const Trk::GlobalPosition prdPos = tpd->globalPosition(); const Amg::Vector3D prdPos = tpd->globalPosition(); - float tgcRho = abs(prdPos.perp()); + float tgcRho = std::abs(prdPos.perp()); float tgcPhi = prdPos.phi(); float tgcZ = prdPos.z(); if(tgcPhi<0)tgcPhi+=2*M_PI; // Extrapolate Segm1 to PRD Z position - float dZ = abs(tgcZ) - abs(segm1PosZ); - //Trk::GlobalPosition tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ)); + float dZ = std::abs(tgcZ) - std::abs(segm1PosZ); Amg::Vector3D tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ)); // Get extrapolated variables - float tgcExtrRho = abs(tgcExtrapolatedPos.perp()); + float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp()); float tgcExtrPhi = tgcExtrapolatedPos.phi(); if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI; @@ -365,7 +357,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(dPhi> M_PI)dPhi-=2*M_PI; // Pass through loose phi cut to eliminate some noise - if(abs(dPhi)<dPhiCut_Loose){ + if(std::abs(dPhi)<dPhiCut_Loose){ // Fill PRD sagitta histograms if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho); if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi); @@ -373,13 +365,12 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Do Global check if(canCheckGlobal[stationIndex]){ float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho; - if(abs(dPhi)<dPhiCutGlobal[tgcWS] && abs(dRho)<dRhoCut){ - // if(layer>=0)hitregistered[layer][tgcWS] = true;// Global hit + if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){ } }// global // Add PRD which matches Segm1 position to vector for further analysis - if(abs(dPhi)<dPhiCutSector[tgcWS] && abs(dRho)<dRhoCutSector[tgcWS]){ + if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){ tpdVector[tgcWS].push_back(tpd); } // Do Sector Efficiency Check @@ -389,7 +380,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> (stationPhi==TGCstation_StationPhi[stationIndex])&& (tgcFE==TGCstation_StationFE[stationIndex])){ // Do check - if(abs(dPhi)<dPhiCutSector[tgcWS] && abs(dRho)<dRhoCutSector[tgcWS]){ + if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){ if(layer>=0)sectorhitregistered[layer][tgcWS]=true;// Sector hit } } @@ -434,12 +425,12 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> float prd1Phi = prdPos1.phi(); float prd1Z = prdPos1.z(); if(prd1Phi<0)prd1Phi+=2*M_PI; - Amg::Vector3D prd1PosZunit(prdPos1/abs(prd1Z)); + Amg::Vector3D prd1PosZunit(prdPos1/std::abs(prd1Z)); // Get id values Identifier tgcid1=(tpdVector[k].at(iTPD1))->identify(); - int stationName1 = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid1); - int gasGap1 = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid1); + int stationName1 = m_idHelperSvc->tgcIdHelper().stationName(tgcid1); + int gasGap1 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid1); int layer1 = TGCgetlayer(stationName1,gasGap1); if(layer1>=0)thisTPDlayerMatches[layer1]++; @@ -449,17 +440,17 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Get position variables const Amg::Vector3D prdPos2 = tpdVector[k].at(iTPD2)->globalPosition(); - float prd2Rho = abs(prdPos2.perp()); + float prd2Rho = std::abs(prdPos2.perp()); float prd2Phi = prdPos2.phi(); float prd2Z = prdPos2.z(); if(prd2Phi<0)prd2Phi+=2*M_PI; // Extrapolate PRD1 to PRD2 Z position - float dZ = abs(prd2Z)- abs(prd1Z); + float dZ = std::abs(prd2Z)- std::abs(prd1Z); Amg::Vector3D prdExtrPos = ((prdPos1)+((prd1PosZunit)*dZ)); // Get extrapolated variables - float prdExtrRho = abs(prdExtrPos.perp()); + float prdExtrRho = std::abs(prdExtrPos.perp()); float prdExtrPhi = prdExtrPos.phi(); if(prdExtrPhi<0)prdExtrPhi+=2*M_PI; @@ -474,11 +465,11 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(m_tgc_prdcompsag[i][k][2]) m_tgc_prdcompsag[i][k][2]->Fill(dPhi); // Do check - if(abs(dPhi)<dPhiCutTPD[k] && abs(dRho)<dRhoCutTPD[k]){ + if(std::abs(dPhi)<dPhiCutTPD[k] && std::abs(dRho)<dRhoCutTPD[k]){ // Get id values Identifier tgcid2=(tpdVector[k].at(iTPD2))->identify(); - int stationName2 = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid2); - int gasGap2 = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid2); + int stationName2 = m_idHelperSvc->tgcIdHelper().stationName(tgcid2); + int gasGap2 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid2); int layer2 = TGCgetlayer(stationName2,gasGap2); // Add PRD2 to matches for PRD1 diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx index 74e912edeff8110b1ce13e97ffd3f0123b011aae..ba7b2c9512e8e8c6f35f715f79ddc2116631e920 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx @@ -202,16 +202,16 @@ MdtVsTgcRawDataValAlg::CheckTGConTrack(std::vector<SegmTrack> (&matchedSegments) const Muon::MuonClusterOnTrack * rio = mc_list[iROT]; //const Trk::RIO_OnTrack* rio = crot->rioOnTrack(iROT); Identifier id = rio->identify(); - int stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // 41=T1F 42=T1E 43=T2F 44=T2E 45=T3F 46=T3E 47=T4F 48=T4E - if(m_muonIdHelperTool->tgcIdHelper().isStrip(id)){ + if(m_idHelperSvc->tgcIdHelper().isStrip(id)){ if((jMDT==2)&&((stationName==41)||(stationName==42)))nTGCStrips[0]++;// TGC if((jMDT==2)&&((stationName==43)||(stationName==44)))nTGCStrips[1]++;// TGC if((jMDT==2)&&((stationName==45)||(stationName==46)))nTGCStrips[2]++;// TGC if((jMDT==0)&&((stationName==47)||(stationName==48)))nTGCStrips[3]++;// TGC } - ATH_MSG_DEBUG( " check if TGC strip: "<<m_muonIdHelperTool->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName ); + ATH_MSG_DEBUG( " check if TGC strip: "<<m_idHelperSvc->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName ); } } } @@ -257,11 +257,11 @@ MdtVsTgcRawDataValAlg::CheckTGConTrack(std::vector<SegmTrack> (&matchedSegments) Identifier tgcid=(*prepitc)->identify(); int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1 int tgcFE=(tre->forward()==false);//isNotForward f:0, e:1 - int tgcWS=(m_muonIdHelperTool->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); + int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 + int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); int stationEta = std::abs(tre->getStationEta()); int stationPhi = tre->getStationPhi(); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Cut hits except those from same side EIFI & Midstation if(tgcAC!=i) continue; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx index ea9aec81a91e515de5a2911bde73d82e9bae8330..85c281d806a96cb1995ec623411f04165cbd07c4 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx @@ -79,8 +79,8 @@ MdtVsTgcRawDataValAlg::DQCheckMDTSegments(std::vector<const Muon::MuonSegment*> continue; } Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); - int isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); + int isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id); if((stationName==41)||(stationName==42))nTgcMeas[isStrip]++;// TGC if((stationName==43)||(stationName==44))nTgcMeas[isStrip]++;// TGC @@ -129,7 +129,7 @@ MdtVsTgcRawDataValAlg::DQCheckMDTSegments(std::vector<const Muon::MuonSegment*> } // Cut Segments with too great a difference between position and direction vectors - if(abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){ + if(std::abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||std::abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){ segmDisqual = true; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx index 6a9361f7bf19707ee1a476a3e984fca81acebf83..18e36385f6edb26d66249fe5dd5d080035313428 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx @@ -66,16 +66,12 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& if(skipSegm)continue; // Get position variables - //const Trk::GlobalPosition segm1Pos = segm1->globalPosition(); const Amg::Vector3D segm1Pos = segm1->globalPosition(); - // float segm1Rho = abs(segm1Pos.perp()); float segm1PosPhi = segm1Pos.phi(); float segm1PosZ = segm1Pos.z(); if(segm1PosPhi<0)segm1PosPhi+=2*M_PI; - //Trk::GlobalDirection segm1PosZunit(segm1Pos/abs(segm1PosZ)); - //Trk::GlobalDirection segm1Dir = segm1->globalDirection(); - Amg::Vector3D segm1PosZunit(segm1Pos/abs(segm1PosZ)); + Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ)); Amg::Vector3D segm1Dir = segm1->globalDirection(); float segm1DirThe = segm1Dir.theta(); @@ -109,30 +105,27 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& ////////////////////////////////////////////////////// // Position Cut // Fill position variables - // const Trk::GlobalPosition segm2Pos = segm2->globalPosition(); const Amg::Vector3D segm2Pos = segm2->globalPosition(); - float segm2PosRho = abs(segm2Pos.perp()); + float segm2PosRho = std::abs(segm2Pos.perp()); float segm2PosPhi = segm2Pos.phi(); float segm2PosThe = segm2Pos.theta(); float segm2PosZ = segm2Pos.z(); if(segm2PosThe>M_PI/2) segm2PosThe=M_PI-segm2PosThe; if(segm2PosPhi<0)segm2PosPhi+=2*M_PI; - //Trk::GlobalDirection segm2PosZunit(segm2Pos/abs(segm2PosZ)); - Amg::Vector3D segm2PosZunit(segm2Pos/abs(segm2PosZ)); + Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ)); // Apply preliminary phi cut between segm1 and segm2 positions float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi; if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI; if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI; - if(abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue; + if(std::abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue; // Extrapolate segm1 position to segm2's Z position - float dZ = abs(segm2PosZ)-abs(segm1PosZ); - //Trk::GlobalPosition extrPos(segm1Pos+(segm1PosZunit*dZ)); + float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ); Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ)); - float extrPosRho = abs(extrPos.perp()); + float extrPosRho = std::abs(extrPos.perp()); float extrPosThe = extrPos.theta(); float extrPosPhi = extrPos.phi(); if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe; @@ -151,8 +144,8 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]->Fill(dThe_Extr_Segm2); // Cut segments (segm2) which are outside difference cuts - if(abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue; - if(abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue; + if(std::abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue; + if(std::abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue; ////////////////////////////////////////////////////// // Direction Cut diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx index 5776b08571bf4fc06a40e5b790ecd344d96891fd..f9a1afb128313c1599ab41f7225bde63f8d82d0b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx @@ -16,12 +16,10 @@ #include "TrkEventPrimitives/TrkEventPrimitivesDict.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "muonEvent/MuonContainer.h" -//use new MDT segment container #include "xAODMuon/MuonSegmentContainer.h" #include "xAODMuon/MuonSegment.h" #include <inttypes.h> - #include <sstream> #include <algorithm> #include <fstream> @@ -56,10 +54,10 @@ MdtVsTgcRawDataValAlg::SortMDTSegments(const xAOD::MuonSegmentContainer *newsegm Identifier id = rio->identify(); // Identify MDT Endcap Segments - if(m_muonIdHelperTool->mdtIdHelper().is_mdt(id))isMdt=true; - if(m_muonIdHelperTool->mdtIdHelper().isEndcap(id))isEndcap=true; + if(m_idHelperSvc->mdtIdHelper().is_mdt(id))isMdt=true; + if(m_idHelperSvc->mdtIdHelper().isEndcap(id))isEndcap=true; - int stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // Large (L) = odd, greater r, Small (S) = even, lower r // 13=EIL 49=EIS 14=EEL 15=EES 17=EML 18=EMS 20=EOL 21=EOS if((stationName==13)||(stationName==49))nMdtMeas[0]++;// MDT diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h index e32daa3183aff8e6250235238ac72de186ff5ee8..95a1d574a3f1030e0d7e2bc967063ae3b8d65859 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h @@ -15,40 +15,14 @@ #ifndef RpcLv1RawDataEfficiency_H #define RpcLv1RawDataEfficiency_H -#include "GaudiKernel/StatusCode.h" -#include "StoreGate/StoreGateSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" -#include "MuonReadoutGeometry/MuonReadoutElement.h" -#include "MuonReadoutGeometry/RpcReadoutSet.h" -#include "MuonGeoModel/MYSQL.h" - -#include "muonEvent/MuonContainer.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" - -#include "AthenaBaseComps/AthAlgorithm.h" - -#include "MuonRDO/RpcFiredChannel.h" -#include "MuonRDO/RpcCoinMatrix.h" -#include "MuonRDO/RpcPad.h" -#include "MuonRDO/RpcPadContainer.h" #include "MuonRDO/RpcSectorLogicContainer.h" - -#include "MuonTrigCoinData/RpcCoinData.h" #include "MuonTrigCoinData/RpcCoinDataContainer.h" -#include "MuonTrigCoinData/RpcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" - #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" // STL includes @@ -57,7 +31,6 @@ #include <vector> #include <map> - // ROOT includes #include <TH2I.h> #include <inttypes.h> @@ -65,7 +38,6 @@ //================================================================================================================================ template <class ConcreteAlgorithm> class AlgFactory; - //================================================================================================================================ class OfflineMuon { public: @@ -169,14 +141,11 @@ class RpcLv1RawDataEfficiency: public ManagedMonitorToolBase { StatusCode readRpcCoinDataContainer(); - // virtual StatusCode GetHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms( ); private: - // Retrieving information and data - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // MuonDetectorManager from the conditions store SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h index ed8224989afe1b1ee7128030c53dbcc1edc1a6be..6cd3cb8a1385921191dabb2e1d41edee06b0117e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h @@ -14,40 +14,26 @@ #ifndef RpcRawDataValAlg_H #define RpcRawDataValAlg_H -#include <sstream> -#include <string.h> -#include <vector> -#include <map> - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" - -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "RPCcablingInterface/IRPCcablingServerSvc.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/RpcCoinDataContainer.h" #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" +#include "MuonPrepRawData/RpcPrepDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" - +#include <string> +#include <vector> +#include <map> #include <TH2F.h> #include <TH2I.h> #include <TH1I.h> -#include <inttypes.h> +#include <inttypes.h> -#include <sstream> +class IRPCcablingSvc; template <class ConcreteAlgorithm> class AlgFactory; @@ -72,9 +58,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { // Private function to add the clusters to the ntuple StatusCode addClusters(std::string clusterContainerName); - - //ServiceHandle<IRPCConditionsSvc> m_pSummarySvc; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{this,"EventInfo","EventInfo","event info"}; SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; SG::ReadHandleKey<Muon::RpcCoinDataContainer> m_key_trig{this,"RPCTriggerContainer","RPC_triggerHits","RPC trigger hits"}; @@ -93,7 +76,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { void bookRPCLayerPhivsEtaHistograms(std::string, std::string, int, int, int, int, int, int); void bookRPCLayerPhivsEtaSectorHistograms(std::string, std::string, int, int, int, int, int, int); - /* void bookRPCSummaryHistograms( int, std::vector<std::string>::const_iterator &m_iter ) ; */ void bookRPCSummaryHistograms( int, const std::string & m_quantity ) ; MuonDQAHistMap m_stationHists; @@ -109,8 +91,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { std::vector<std::string> m_layervslayer_name_list ; std::vector<std::string> m_layerPhivsEta_name_list ; std::vector<std::string> m_layerPhivsEtaSector_name_list; - // std::vector<std::string> cm_time_list ; - // std::vector<int> ch16_index_list ; int m_StationNameViewIndex[100][2] ; float m_StationNameSectorSize[100] ; float m_StationPivotSectorSize[100] ; @@ -125,8 +105,7 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; const IRPCcablingSvc* m_cabling; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx index be2a1f530685f51b60a1c98c7ea26a2c808dc75a..a650050ed2f64d37bcc7da73aad8bdec76e92464 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx @@ -113,7 +113,7 @@ StatusCode RPCMonitorAlgorithm::fillHistograms(const EventContext& ctx) const xAOD::Muon::Quality quality = m_muonSelectionTool->getQuality(*muon); - if(fabs(pt) < m_minPt || fabs(eta) < m_minEta || fabs(eta) > m_maxEta) { + if(std::abs(pt) < m_minPt || std::abs(eta) < m_minEta || std::abs(eta) > m_maxEta) { continue; } if(!(quality <= m_quality)) { diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx index aaa6e5c74fccd4ccb743f0dd7c9d1a1b4df1840d..d03d3586dbf59641b935d2b3c0c34feea7ff4ecc 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx @@ -767,7 +767,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if( !metrack ) continue; ATH_MSG_DEBUG("xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle found for this muon "); - if( std::sqrt(std::fabs(irpc_clus_posetaII-metrack->eta())*std::fabs(irpc_clus_posetaII-metrack->eta()) + fabs(irpc_clus_posphi-metrack->phi())*fabs(irpc_clus_posphi-metrack->phi())) < m_MuonDeltaRMatching) foundmatch3DwithMuon = true ; + if( std::sqrt(std::abs(irpc_clus_posetaII-metrack->eta())*std::abs(irpc_clus_posetaII-metrack->eta()) + std::abs(irpc_clus_posphi-metrack->phi())*std::abs(irpc_clus_posphi-metrack->phi())) < m_MuonDeltaRMatching) foundmatch3DwithMuon = true ; }}//end muons @@ -960,7 +960,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() const xAOD::TrackParticle* metrack = muons->trackParticle( xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle ); if( !metrack ) continue; - if( std::fabs(metrack->eta())>1) continue; + if( std::abs(metrack->eta())>1) continue; sc = rpc_triggerefficiency.getHist( m_hMEtracks ,"hMEtracks" ) ; if(sc.isFailure() ) ATH_MSG_WARNING ( "couldn't get " << " hMEtracks " ); if(m_hMEtracks)m_hMEtracks->Fill( metrack->pt() / 1000.); @@ -1011,7 +1011,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id))continue; - if( std::sqrt( std::fabs(eta_atlas-metrack->eta())*std::fabs(eta_atlas-metrack->eta()) + std::fabs(phi_atlas-metrack->phi())*std::fabs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { + if( std::sqrt( std::abs(eta_atlas-metrack->eta())*std::abs(eta_atlas-metrack->eta()) + std::abs(phi_atlas-metrack->phi())*std::abs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { //Second coin phi view for( it_container_phi = rpc_coin_container->begin(); it_container_phi != rpc_coin_container->end(); ++it_container_phi ) { for ( Muon::RpcCoinDataCollection::const_iterator it_collection_phi = (*it_container_phi)->begin(); it_collection_phi != (*it_container_phi)->end(); ++it_collection_phi ) { // each collection is a trigger signal @@ -1027,14 +1027,14 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if(m_idHelperSvc->rpcIdHelper().doubletPhi (prdcoll_id) != m_idHelperSvc->rpcIdHelper().doubletPhi (prdcoll_id_phi)) continue ; if(m_idHelperSvc->rpcIdHelper().gasGap (prdcoll_id) != m_idHelperSvc->rpcIdHelper().gasGap (prdcoll_id_phi)) continue ; - if( std::fabs((*it_collection)->time() - (*it_collection_phi)->time()) > 50. ) continue ; + if( std::abs((*it_collection)->time() - (*it_collection_phi)->time()) > 50. ) continue ; if( (*it_collection)->isLowPtCoin() != (*it_collection_phi)->isLowPtCoin() || (*it_collection)->isHighPtCoin() != (*it_collection_phi)->isHighPtCoin()) continue ; descriptor_Atl = MuonDetMgr->getRpcReadoutElement( prdcoll_id_phi ); eta_atlas = descriptor_Atl->stripPos(prdcoll_id_phi ).eta(); phi_atlas = descriptor_Atl->stripPos(prdcoll_id_phi ).phi(); - if( std::sqrt( std::fabs(eta_atlas-metrack->eta())*std::fabs(eta_atlas-metrack->eta()) + std::fabs(phi_atlas-metrack->phi())*std::fabs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { + if( std::sqrt( std::abs(eta_atlas-metrack->eta())*std::abs(eta_atlas-metrack->eta()) + std::abs(phi_atlas-metrack->phi())*std::abs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { int minthrview = cointhr ; if(cointhrphi<minthrview)minthrview = cointhrphi; if( (*it_collection)-> isLowPtCoin() && (*it_collection_phi)-> isLowPtCoin()){ @@ -1215,8 +1215,8 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() for (int i_3DII=0;i_3DII!=N_Rpc_Clusters3D;i_3DII++) { if( !(Rpc_Matched_mu.at(i_3DII)) && m_StandAloneMatchedWithTrack )continue; - if( abs(Rpc_Eta_3D.at(i_3DII)-Rpc_Eta_3D.at(i_3DI)) > EtaStationSpan )continue; - if( abs(Rpc_Phi_3D.at(i_3DII)-Rpc_Phi_3D.at(i_3DI)) > DoublePhiSpan )continue; + if( std::abs(Rpc_Eta_3D.at(i_3DII)-Rpc_Eta_3D.at(i_3DI)) > EtaStationSpan )continue; + if( std::abs(Rpc_Phi_3D.at(i_3DII)-Rpc_Phi_3D.at(i_3DI)) > DoublePhiSpan )continue; if(LayerType.at(i_3DII)==ilayertype && ilayertype!=6 )continue; if(Rpc_track[ i_3DII ]>0)continue;//Third no-track assigned LowPt or Pivot or HighPt plane @@ -1398,7 +1398,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if ( ilayertype==6 ) { m_rpcchi2dof -> Fill (chi2dof) ; m_rpcetavsphichi2dof -> Fill (chi2dofphi,chi2dofeta) ; - trms = std::sqrt(std::fabs(t2av - tav*tav)); + trms = std::sqrt(std::abs(t2av - tav*tav)); m_rpcTimeTrackRMS -> Fill (trms) ; for (int i_3D=0;i_3D!=N_Rpc_Clusters3D;i_3D++) { if(Rpc_track[ i_3D ] != N_Rpc_Tracks) continue; @@ -1444,7 +1444,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() } - float anglephi = 90-std::atan(std::fabs(xyPhi))*180/M_PI ; //atan between -pi/2 and pi/2 , anglephi from 180 to 0 + float anglephi = 90-std::atan(std::abs(xyPhi))*180/M_PI ; //atan between -pi/2 and pi/2 , anglephi from 180 to 0 if(xyPhi<0) anglephi = 180.-anglephi; float rho = std::sqrt( xyPhi*xyPhi + 1 + zyEta*zyEta); @@ -2221,7 +2221,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() Inters3DL = ((rpc->transform(prd_id)).inverse())* Inters3DG ; stripPosCL = ((rpc->transform(prd_id)).inverse())* stripPosC ; - float distance = std::fabs(Inters3DL.x() - stripPosCL.x()); + float distance = std::abs(Inters3DL.x() - stripPosCL.x()); if(distance<MergePointDistance) { @@ -5150,8 +5150,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = m_LayerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; m_LayerEff->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5161,8 +5161,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = RPCBA_layerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; RPCBA_layerEfficiency->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5172,8 +5172,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = RPCBC_layerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; RPCBC_layerEfficiency->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5191,8 +5191,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr0 int RPCOnTr = m_hRPCPhiEtaCoinThr[0] ->GetBinContent ( ibin + 1 ) ; float RPCEff = RPCOnTr / TrkPrj ; - float RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + float RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5200,8 +5200,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr1 RPCOnTr = m_hRPCPhiEtaCoinThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5209,8 +5209,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr2 RPCOnTr = m_hRPCPhiEtaCoinThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5218,8 +5218,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr3 RPCOnTr = m_hRPCPhiEtaCoinThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5227,8 +5227,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr4 RPCOnTr = m_hRPCPhiEtaCoinThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5236,16 +5236,16 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr5 RPCOnTr = m_hRPCPhiEtaCoinThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; //hRPCPadThr0 RPCOnTr = m_hRPCPadThr[0] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5253,8 +5253,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr1 RPCOnTr = m_hRPCPadThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5262,8 +5262,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr2 RPCOnTr = m_hRPCPadThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5271,8 +5271,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr3 RPCOnTr = m_hRPCPadThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5280,8 +5280,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr4 RPCOnTr = m_hRPCPadThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5289,16 +5289,16 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr5 RPCOnTr = m_hRPCPadThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; //hRPCMuctpiThr0 RPCOnTr = m_hRPCMuctpiThr[0] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5306,8 +5306,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr1 RPCOnTr = m_hRPCMuctpiThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5315,8 +5315,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr2 RPCOnTr = m_hRPCMuctpiThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5324,8 +5324,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr3 RPCOnTr = m_hRPCMuctpiThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5333,8 +5333,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr4 RPCOnTr = m_hRPCMuctpiThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5342,8 +5342,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr5 RPCOnTr = m_hRPCMuctpiThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5387,8 +5387,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal = 0 ; if ( PanelTrackProj != 0 ) { PanelVal = PanelHitOnTrack/PanelTrackProj ; - PanelVal_err = std::sqrt( std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * - std::sqrt( 1. - std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / + PanelVal_err = std::sqrt( std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * + std::sqrt( 1. - std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / std::sqrt( PanelTrackProj ) ; SummaryEfficiency -> SetBinContent ( pos + shift_pos , PanelVal ) ; SummaryEfficiency -> SetBinError ( pos + shift_pos , PanelVal_err ) ; @@ -5407,8 +5407,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal = 0 ; if ( PanelTrackProj != 0 ) { PanelVal = PanelHitOnTrack/PanelTrackProj ; - PanelVal_err = std::sqrt( std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * - std::sqrt( 1. - std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / + PanelVal_err = std::sqrt( std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * + std::sqrt( 1. - std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / std::sqrt( PanelTrackProj ) ; m_SummaryHist[enumSumGapEfficiency+m_SummaryHist_Idx]-> SetBinContent ( pos + shift_pos , PanelVal ) ; m_SummaryHist[enumSumGapEfficiency+m_SummaryHist_Idx]-> SetBinError ( pos + shift_pos , PanelVal_err ) ; @@ -5466,7 +5466,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; // rpcAverageCS -> Fill(PanelVal) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvCS] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvCS] -> Fill(PanelVal) ; } @@ -5486,7 +5486,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CS1] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CS1] -> Fill(PanelVal) ; } SummaryRes_CS1DistriPerSector -> Fill(PanelVal) ; @@ -5507,7 +5507,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CS2] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CS2] -> Fill(PanelVal) ; } SummaryRes_CS2DistriPerSector -> Fill(PanelVal) ; @@ -5529,7 +5529,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CSmore2] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CSmore2] -> Fill(PanelVal) ; } SummaryRes_CSmore2DistriPerSector -> Fill(PanelVal) ; @@ -5580,7 +5580,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvTime] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvTime] -> Fill(PanelVal) ; } SummaryTimeDistriPerSector -> Fill(PanelVal) ; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx index 4fe74ba84ddb9368d9db7462617527f576175a96..d4a0498bf27ea77de4cffe0846945486882b5449 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx @@ -1,29 +1,17 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/*************************************************************************** - global stuff - ----------------------------------------- - ***************************************************************************/ - -//<doc><file> $Id: GlobalUtilities.cxx,v 1.2 2009-02-24 16:47:48 dwright Exp $ -//<version> $Name: not supported by cvs2svn $ - -//<<<<<< INCLUDES >>>>>> - #include <cstdlib> #include <sstream> #include <iostream> #include <cmath> - #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutElement.h" #include "RpcRawDataMonitoring/RpcGlobalUtilities.h" - namespace RpcGM { @@ -104,7 +92,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons //Extension feet Pivot if(irpcdoubletR==2)PlaneTipo=1; //BML7 assigned to pivot - if( irpcstationName==2 && ( (abs(irpcstationEta)==7)||(irpcstationPhi==7&&abs(irpcstationEta)==6) ) )PlaneTipo=1; + if( irpcstationName==2 && ( (std::abs(irpcstationEta)==7)||(irpcstationPhi==7&&std::abs(irpcstationEta)==6) ) )PlaneTipo=1; //evaluate strip shift //2=BML,3=BMS,4=BOL,5=BOS,8=BMF,9=BOF,10=BOG,53=BME @@ -143,13 +131,13 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons int krpcdoubletR=irpcdoubletR; if(PlaneTipo==0){ - if(krpcstationName==2&&abs(ieta)==7 )continue; - if(krpcstationName==2&&abs(ieta)==6&&irpcstationPhi==7)continue; + if(krpcstationName==2&&std::abs(ieta)==7 )continue; + if(krpcstationName==2&&std::abs(ieta)==6&&irpcstationPhi==7)continue; if(krpcstationName==4||krpcstationName==5||krpcstationName==9||krpcstationName==10)continue; } else if(PlaneTipo==1){ - if(krpcstationName==2&&abs(ieta)==7 ){krpcdoubletR=1;} - else if(krpcstationName==2&&abs(ieta)==6&&irpcstationPhi==7){krpcdoubletR=1;} + if(krpcstationName==2&&std::abs(ieta)==7 ){krpcdoubletR=1;} + else if(krpcstationName==2&&std::abs(ieta)==6&&irpcstationPhi==7){krpcdoubletR=1;} else{ krpcdoubletR=2;} } else if(PlaneTipo==2){ @@ -223,11 +211,11 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons else if(irpcstationName==4 ){ShiftStripPhiAtlas = (2*64+80*2) * ( irpcstationPhi -1 ) ;} else{ShiftStripPhiAtlas = (2*64+80*2) * ( irpcstationPhi -1 ) + 2*80 ;} //BML7 assigned to pivot - if( irpcstationName==2 && abs(irpcstationEta)==7){ + if( irpcstationName==2 && std::abs(irpcstationEta)==7){ ShiftStripPhiAtlas = (2*48+64*2) * ( irpcstationPhi -1 ); if(irpcstationPhi==8)ShiftStripPhiAtlas +=4*16; } - if( irpcstationName==2 && irpcstationPhi==7&&abs(irpcstationEta)==6 ){ + if( irpcstationName==2 && irpcstationPhi==7&&std::abs(irpcstationEta)==6 ){ ShiftStripPhiAtlas = (2*48+64*2) * ( irpcstationPhi -1 ) +2*16 ; } } @@ -267,7 +255,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + (irpcdoubletZ-1)*8 + (irpcstationName_index)*24 - + ( ( abs(irpcstationEta) ) )*72 ; + + ( ( std::abs(irpcstationEta) ) )*72 ; // exception station name=53, assume irpcstationEta = 0 ; if(irpcstationName ==53) PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + (irpcdoubletZ-1)*8 + (irpcstationName_index)*24; @@ -275,7 +263,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if ( irpcstationName==10 ) { // convention: BOG <-> doubletZ=3 <-> (3-1)*8=16 PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + 16 + (irpcstationName_index)*24 - + ( ( abs(irpcstationEta) ) )*72 ; + + ( ( std::abs(irpcstationEta) ) )*72 ; } if ( (irpcdoubletR==2) && (irpcstationName==9 || irpcstationName==10) ) { // convention: chambers of RPC upgrade -> eta = eta + 7 @@ -314,13 +302,10 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if (iname>10 && iname!=53) continue; if( iname==6 || iname==7 ) continue; ; - //if((iname==4||iname==5||iname==9||iname==10)&&!(irpcstationName==4||irpcstationName==5||irpcstationName==9||irpcstationName==10))continue; - - //if((iname==2||iname==3||iname==8||iname==53)&&!(irpcstationName==2||irpcstationName==3||irpcstationName==8||irpcstationName==53))continue; - + laststationEta = 8; if(iname==irpcstationName&&iphi==irpcstationPhi){ - laststationEta = abs(irpcstationEta) ; + laststationEta = std::abs(irpcstationEta) ; } for(int ieta = 0; ieta != laststationEta+1; ieta++ ){ @@ -341,8 +326,8 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if(iname==4||iname==5||iname==9||iname==10)continue; } else if(PlaneTipo==1){ - if(irpcstationName==2&&abs(irpcstationEta)==7 )ir=2; - if(irpcstationName==2&&abs(irpcstationEta)==6&&irpcstationPhi==7)ir=2; + if(irpcstationName==2&&std::abs(irpcstationEta)==7 )ir=2; + if(irpcstationName==2&&std::abs(irpcstationEta)==6&&irpcstationPhi==7)ir=2; if(iname==2&&ieta==7 )ir=1; if(iname==2&&ieta==6&&iphi==7)ir=1; } @@ -468,7 +453,7 @@ std::vector<std::string> RpcLayerSectorSideName(const RpcIdHelper& rpcIdHelpe else {layer_name="HighPt";} if(irpcdoubletR==2)layer_name="Pivot"; //BML7 assigned to pivot - if( irpcstationName==2 && ( (abs(irpcstationEta)==7)||(irpcstationPhi==7&&abs(irpcstationEta)==6) ) )layer_name="Pivot"; + if( irpcstationName==2 && ( (std::abs(irpcstationEta)==7)||(irpcstationPhi==7&&std::abs(irpcstationEta)==6) ) )layer_name="Pivot"; if(irpcstationName==3||irpcstationName==5||irpcstationName==8||irpcstationName==9||irpcstationName==10){ HVorROsideleft = "RO side" ; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx index fc52585c8c24808321b56fdd79d0e83ca89dd36b..8f433a0afee9898b5c6f499bcb616aa1ddabf222 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx @@ -38,6 +38,7 @@ RpcLv1RawDataEfficiency::RpcLv1RawDataEfficiency( const std::string & type, //================================================================================================================================ StatusCode RpcLv1RawDataEfficiency::initialize() { + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "In initializing 'RpcLv1RawDataEfficiency'" ); ATH_MSG_INFO( "Package version = "<< PACKAGE_VERSION ); @@ -64,7 +65,7 @@ StatusCode RpcLv1RawDataEfficiency::initialize() m_rpclv1_sectorhits_C[5] = 0 ; m_rpclv1_sectorhits_all[5]= 0 ; - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK( m_idHelperSvc.retrieve() ); // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); ATH_MSG_DEBUG( "Found the MuonDetectorManager from detector store." ); @@ -72,10 +73,6 @@ StatusCode RpcLv1RawDataEfficiency::initialize() ATH_CHECK(m_rpcCoinKey.initialize()); ATH_CHECK(m_eventInfo.initialize()); ATH_CHECK(m_sectorLogicContainerKey.initialize(!m_isMC)); - - // Ignore the checking code - ManagedMonitorToolBase::initialize().ignore(); - return StatusCode::SUCCESS; } @@ -111,24 +108,24 @@ StatusCode RpcLv1RawDataEfficiency::readRpcCoinDataContainer() coindata->SetThresholdLowHigh(int((*it_collection)->threshold()), int((*it_collection)->isLowPtCoin()), int((*it_collection)->isHighPtCoin())); prdcoll_id = (*it_collection)->identify(); descriptor_Atl = MuonDetMgr->getRpcReadoutElement( prdcoll_id ); - irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)); + irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)); x_atlas = descriptor_Atl->stripPos(prdcoll_id ).x(); y_atlas = descriptor_Atl->stripPos(prdcoll_id ).y(); z_atlas = descriptor_Atl->stripPos(prdcoll_id ).z(); //obtaining phi coordinate: if ( x_atlas > 0 ) { - phi_atlas = atan ( y_atlas / x_atlas ); + phi_atlas = std::atan ( y_atlas / x_atlas ); } else if ( x_atlas == 0 ){ if (y_atlas > 0) phi_atlas = CLHEP::pi/2; else phi_atlas = -CLHEP::pi/2; } else{ - if (y_atlas > 0) phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; - else phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + if (y_atlas > 0) phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; + else phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } // obtaining pseudorapidity coordinate - if ( z_atlas!=0 ) eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) ) ); + if ( z_atlas!=0 ) eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) ) ); else eta_atlas = 0; if ( irpcstationEta<0 ) eta_atlas = -eta_atlas; coindata->SetEtaPhi( eta_atlas, phi_atlas ); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx index 4d89bdfbc1015e1e2cb20f2614467dd795f479e4..f87df481622d2b1c598d6db058cbb88ce193f63c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx @@ -1826,10 +1826,10 @@ void RpcLv1RawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const if (kName>10 && kName!=53) continue; for (int iz=0; iz!=3; iz++ ) { int irc = ir ; - if(abs(ieta-8)==7&&ir==1&&kName==2)continue; - if(isec==12&&abs(ieta-8)==6&&ir==1&&kName==2)continue; - if(abs(ieta-8)==7&&ir==2)irc=1; - if(isec==12&&abs(ieta-8)==6&&ir==2)irc=1; + if(std::abs(ieta-8)==7&&ir==1&&kName==2)continue; + if(isec==12&&std::abs(ieta-8)==6&&ir==1&&kName==2)continue; + if(std::abs(ieta-8)==7&&ir==2)irc=1; + if(isec==12&&std::abs(ieta-8)==6&&ir==2)irc=1; const MuonGM::RpcReadoutElement* rpc = MuonDetMgr->getRpcRElement_fromIdFields(kName, ieta-8, istatPhi+1, irc, iz+1, idblPhi+1); if( rpc == NULL ) continue; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx index 1133f807fe63997cad7f7408c8dcaea7229d512d..6f9360cf2cb52274a5bdde823a1ef1afc7cf95a0 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx @@ -108,53 +108,21 @@ RpcRawDataValAlg::~RpcRawDataValAlg() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * StatusCode RpcRawDataValAlg::initialize(){ - - + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO ( "in initializing RpcRawDataValAlg" ); - ATH_MSG_DEBUG ( "******************" ); ATH_MSG_DEBUG ( "doRpcESD: " << m_doRpcESD ); ATH_MSG_DEBUG ( "RpcFile: "<< m_rpcfile ); - - StatusCode sc; - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL( "DetectorStore service not found !" ); - return StatusCode::FAILURE; - } - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - // get RPC cablingSvc - const IRPCcablingServerSvc* RpcCabGet = 0; - sc = service("RPCcablingServerSvc", RpcCabGet); - if (sc.isFailure()) { - ATH_MSG_WARNING ( "Could not get RPCcablingServerSvc !" ); - return StatusCode::FAILURE; - } - - sc = RpcCabGet->giveCabling(m_cabling); - if (sc.isFailure()) { - ATH_MSG_WARNING ( "Could not get RPCcablingSvc from the Server !" ); - m_cabling = 0; - return StatusCode::FAILURE; - } else { ATH_MSG_DEBUG ( " Found the RPCcablingSvc. " ); } - /* - sc = m_pSummarySvc.retrieve(); - if (StatusCode::SUCCESS not_eq sc) { - ATH_MSG_WARNING ( "Could not retrieve the summary service" ); - } - */ - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; + const IRPCcablingServerSvc* RpcCabGet = nullptr; + ATH_CHECK(service("RPCcablingServerSvc", RpcCabGet)); + ATH_CHECK(RpcCabGet->giveCabling(m_cabling)); + ATH_MSG_DEBUG(" Found the RPCcablingSvc. "); - m_rpc_eventstotal=0; // Clear Muon Monitoring Histograms @@ -205,12 +173,11 @@ StatusCode RpcRawDataValAlg::initialize(){ m_rpcCool_StripProfile = 0 ; m_rpcCool_PanelIdHist = 0 ; - m_first = true ; ATH_CHECK(m_eventInfo.initialize()); - ATH_CHECK( m_key_rpc.initialize()); - ATH_CHECK( m_key_trig.initialize()); + ATH_CHECK(m_key_rpc.initialize()); + ATH_CHECK(m_key_trig.initialize()); ATH_CHECK(m_clusterContainerName.initialize(m_doClusters)); return StatusCode::SUCCESS; @@ -592,15 +559,15 @@ StatusCode RpcRawDataValAlg::fillHistograms() { if (m_nPrd<maxPRD) { Identifier prdcoll_id = (*rpcCollection)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id)) ; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id)) ; - int irpcgasGap = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id)) ; + int irpcgasGap = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id)) ; double irpctime = double((*rpcCollection)->time()) ; int irpctriggerInfo = int((*rpcCollection)->triggerInfo ()) ; // double @@ -618,7 +585,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; @@ -643,7 +610,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() int shiftstripphiatlas = rpcstripshift[25]; //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; m_layer_name = rpclayersectorsidename[0] ; m_layertodraw1_name = rpclayersectorsidename[1] ; m_layertodraw2_name = rpclayersectorsidename[2] ; @@ -959,22 +926,22 @@ StatusCode RpcRawDataValAlg::fillHistograms() { Identifier prdcoll_id_II = (*rpcCollectionII)->identify(); - int irpcstationPhiII = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id_II)) ; - int irpcstationNameII = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id_II)) ; - int irpcstationEtaII = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id_II)) ; - int irpcdoubletRII = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id_II)) ; - int irpcdoubletZII = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id_II)) ; - int irpcdoubletPhiII = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id_II)) ; - int irpcgasGapII = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id_II)) ; - int irpcmeasuresPhiII = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; - int irpcstripII = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id_II)) ; + int irpcstationPhiII = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id_II)) ; + int irpcstationNameII = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id_II)) ; + int irpcstationEtaII = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id_II)) ; + int irpcdoubletRII = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id_II)) ; + int irpcdoubletZII = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id_II)) ; + int irpcdoubletPhiII = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id_II)) ; + int irpcgasGapII = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id_II)) ; + int irpcmeasuresPhiII = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; + int irpcstripII = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id_II)) ; const MuonGM::RpcReadoutElement* descriptor_Atl_II = MuonDetMgr->getRpcReadoutElement( prdcoll_id_II ); double z_atl_II = descriptor_Atl_II ->stripPos(prdcoll_id_II ).z() ; //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; if(irpcmeasuresPhi==1&&irpcmeasuresPhiII==0){ if(irpcstationPhi==irpcstationPhiII&&irpcstationName==irpcstationNameII&&irpcstationEta==irpcstationEtaII&& @@ -1041,11 +1008,11 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else{ if (y_atlas > 0) { - phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; + phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; } else { - phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } } @@ -1053,7 +1020,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() // pseudorapidity double eta_atlas = 0; if ( z_atlas!=0 ) { - eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) )); + eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) )); } else{ eta_atlas = 0 ; @@ -1065,7 +1032,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() m_rpcPhivsEtaAtlasPivot0 ->Fill( stripetaatlas , stripphiatlas -1 ); m_rpcPhivsEtaAtlasPivot0_PhivsZ ->Fill( z_atlas, phi_atlas ) ; // coord cilindriche: 1->phi, 2->z - //m_rpcPhivsEtaAtlasPivot0_PhivsZ ->Fill( phi_atlas, z_atlas ); } if(m_layeronly_name=="Pivot1" ) { m_rpcPhivsEtaAtlasPivot1 ->Fill( stripetaatlas , stripphiatlas -1 ); @@ -1195,37 +1161,30 @@ StatusCode RpcRawDataValAlg::fillHistograms() { if ( m_nTrig < maxPRD ) { Identifier prdcoll_id = (*rpcCoinCollection)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id)) ; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id)) ; - int irpcgasGap = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id)) ; + int irpcgasGap = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id)) ; double irpctime = double((*rpcCoinCollection)->time()) ; - // irpctriggerInfo = int((*rpcCoinCollection)->triggerInfo ()) ; // double int irpctriggerInfo = int ( ((*rpcCoinCollection)->isLowPtCoin())*6 + ((*rpcCoinCollection)->isLowPtInputToHighPtCm())*100 + ((*rpcCoinCollection)->isHighPtCoin())*106 ); int irpcthreshold = int((*rpcCoinCollection)->threshold() ) ; - //std::cout << "irpcthreshold rpcCoinCollection " << irpcthreshold << "\n"; // m_threshold: internal threshold // set in joboptions the correspondence between m_threshold and lvl1 thresholds if ( irpcthreshold == m_lv1Thres_0 ) m_threshold = 0 ; // no threshold assigned if ( irpcthreshold == m_lv1Thres_1 ) m_threshold = 1 ; if ( irpcthreshold == m_lv1Thres_2 ) m_threshold = 2 ; if ( irpcthreshold == m_lv1Thres_3 ) m_threshold = 3 ; - - /*switch (irpcthreshold ) { - case m_lv1Thres_0 : m_threshold = 0 ; break ; - case m_lv1Thres_1 : m_threshold = 1 ; break ; - case m_lv1Thres_2 : m_threshold = 2 ; break ; - } */ + if ( irpcmeasuresPhi==0 ){ if ( irpctriggerInfo==106 ) { m_RPC_Threshold_Eta->Fill( m_threshold+4 ) ; } else if ( irpctriggerInfo==6 ) { m_RPC_Threshold_Eta->Fill( m_threshold ) ; } @@ -1251,7 +1210,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; int NphiStrips = rpcstripshift[0] ; int ShiftPhiStrips = rpcstripshift[1] ; int NetaStrips = rpcstripshift[2] ; @@ -1272,7 +1231,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; m_layer_name = rpclayersectorsidename[0] ; m_layertodraw1_name = rpclayersectorsidename[1] ; m_layertodraw2_name = rpclayersectorsidename[2] ; @@ -1323,12 +1282,12 @@ StatusCode RpcRawDataValAlg::fillHistograms() for ( Muon::RpcPrepDataCollection::const_iterator it=(*collPrep)->begin(); it!=(*collPrep)->end(); it++) { Identifier prdConf_id = (*it)->identify(); - int irpcstationPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().stationPhi (prdConf_id )) ; - int irpcstationName_prep = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdConf_id )) ; - int irpcstationEta_prep = int(m_muonIdHelperTool->rpcIdHelper().stationEta (prdConf_id )) ; - int irpcdoubletR_prep = int(m_muonIdHelperTool->rpcIdHelper().doubletR (prdConf_id )) ; - int irpcdoubletPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi (prdConf_id )) ; - int irpcmeasuresPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdConf_id )) ; + int irpcstationPhi_prep = int(m_idHelperSvc->rpcIdHelper().stationPhi (prdConf_id )) ; + int irpcstationName_prep = int(m_idHelperSvc->rpcIdHelper().stationName(prdConf_id )) ; + int irpcstationEta_prep = int(m_idHelperSvc->rpcIdHelper().stationEta (prdConf_id )) ; + int irpcdoubletR_prep = int(m_idHelperSvc->rpcIdHelper().doubletR (prdConf_id )) ; + int irpcdoubletPhi_prep = int(m_idHelperSvc->rpcIdHelper().doubletPhi (prdConf_id )) ; + int irpcmeasuresPhi_prep = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdConf_id )) ; if ( irpcmeasuresPhi_prep != irpcmeasuresPhi ) continue; if ( irpcstationPhi_prep != irpcstationPhi ) continue; @@ -1336,12 +1295,9 @@ StatusCode RpcRawDataValAlg::fillHistograms() if ( irpcstationName_prep != irpcstationNameC1 && irpcstationName_prep != irpcstationNameC2 ) continue; if ( irpctriggerInfo== 6 && (irpcdoubletR_prep != irpcdoubletR - 1 ) ) continue; if ( irpctriggerInfo==106 && (irpcdoubletR_prep != irpcdoubletR - 1 ) ) continue; - if (abs(irpcstationEta_prep-irpcstationEta)>1) continue; + if (std::abs(irpcstationEta_prep-irpcstationEta)>1) continue; //get information from geomodel to book and fill rpc histos with the right max strip number - - // std::cout << "elementID trig " << irpcstrip << " " << irpcstationName <<" "<< irpcstationEta <<" "<< irpcstationPhi <<" "<< irpcdoubletR << " " << irpctriggerInfo << "\n"; - const MuonGM::RpcReadoutElement* descriptor_Atl_prep = MuonDetMgr->getRpcReadoutElement( prdConf_id ); double x_atl_prep = descriptor_Atl_prep ->stripPos(prdConf_id ).x() ; double y_atl_prep = descriptor_Atl_prep ->stripPos(prdConf_id ).y() ; @@ -1364,7 +1320,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() if(SegVector2D.mag()!=0)ImpactVector2D = ImpactVector2D/ SegVector2D.mag(); - // impactParam = ImpactVector2D.z(); double impactParam = ImpactVector2D.mag() ; if ( irpcmeasuresPhi==0 ) { @@ -1464,8 +1419,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else if(irpctriggerInfo==100){ m_rpc2DEtaStationTriggerHits->Fill(irpcstationEta, Settore-1 + 16 ); - // if ( irpcstationEta<0 ) { rpc2DEtaStationTriggerHits_BC ->Fill(irpcstationEta, Settore-1 + 16 );} - // else { rpc2DEtaStationTriggerHits_BA ->Fill(irpcstationEta, Settore-1 + 16 );} } else if(irpctriggerInfo==106){ if(irpcmeasuresPhi==0) {NTrigger_Eta_HighPt ++;} @@ -1571,16 +1524,15 @@ StatusCode RpcRawDataValAlg::fillHistograms() Identifier prdcoll_id_II = (*rpcCoinCollectionII)->identify(); - int irpcstationPhiII = int(m_muonIdHelperTool->rpcIdHelper().stationPhi( prdcoll_id_II)) ; - int irpcstationNameII = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id_II)) ; - int irpcstationEtaII = int(m_muonIdHelperTool->rpcIdHelper().stationEta( prdcoll_id_II)) ; - int irpcdoubletRII = int(m_muonIdHelperTool->rpcIdHelper().doubletR( prdcoll_id_II)) ; - int irpcdoubletZII = int(m_muonIdHelperTool->rpcIdHelper().doubletZ( prdcoll_id_II)) ; - int irpcdoubletPhiII = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi( prdcoll_id_II)) ; - int irpcgasGapII = int(m_muonIdHelperTool->rpcIdHelper().gasGap( prdcoll_id_II)) ; - int irpcmeasuresPhiII = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; - int irpcstripII = int(m_muonIdHelperTool->rpcIdHelper().strip( prdcoll_id_II)) ; - //irpctriggerInfoII = int((*rpcCoinCollectionII)->triggerInfo() ) ; // double + int irpcstationPhiII = int(m_idHelperSvc->rpcIdHelper().stationPhi( prdcoll_id_II)) ; + int irpcstationNameII = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id_II)) ; + int irpcstationEtaII = int(m_idHelperSvc->rpcIdHelper().stationEta( prdcoll_id_II)) ; + int irpcdoubletRII = int(m_idHelperSvc->rpcIdHelper().doubletR( prdcoll_id_II)) ; + int irpcdoubletZII = int(m_idHelperSvc->rpcIdHelper().doubletZ( prdcoll_id_II)) ; + int irpcdoubletPhiII = int(m_idHelperSvc->rpcIdHelper().doubletPhi( prdcoll_id_II)) ; + int irpcgasGapII = int(m_idHelperSvc->rpcIdHelper().gasGap( prdcoll_id_II)) ; + int irpcmeasuresPhiII = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; + int irpcstripII = int(m_idHelperSvc->rpcIdHelper().strip( prdcoll_id_II)) ; int irpctriggerInfoII = int ( ((*rpcCoinCollection)->isLowPtCoin())*6 + ((*rpcCoinCollection)->isLowPtInputToHighPtCm())*100 + ((*rpcCoinCollection)->isHighPtCoin())*106 ); @@ -1590,14 +1542,13 @@ StatusCode RpcRawDataValAlg::fillHistograms() double z_atl_II = descriptor_Atl_II ->stripPos(prdcoll_id_II ).z() ; //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; if(irpcmeasuresPhi==1&&irpcmeasuresPhiII==0&&irpctriggerInfo==irpctriggerInfoII){ if(irpcstationPhi==irpcstationPhiII&&irpcstationName==irpcstationNameII&&irpcstationEta==irpcstationEtaII&& irpcdoubletR==irpcdoubletRII&&irpcdoubletZ==irpcdoubletZII&&irpcdoubletPhi==irpcdoubletPhiII&&irpcgasGap==irpcgasGapII){ if(m_rpcchamberhist ){ - //if(1 == 0){ bool histo_flag=true; for (std::vector<std::string>::const_iterator iter=m_layerPhivsEta_name_list.begin(); iter!=m_layerPhivsEta_name_list.end(); iter++){ if ( (m_hardware_name+m_layerPhivsEta_name)==*iter){histo_flag=false;} @@ -1656,11 +1607,11 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else{ if (y_atlas > 0) { - phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; + phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; } else { - phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } } @@ -1668,7 +1619,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() double eta_atlas = 0; // pseudorapidity if ( z_atlas!=0 ) { - eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) )); + eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) )); } else{ eta_atlas = 0 ; @@ -1833,14 +1784,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() ATH_MSG_DEBUG ( "Adding a new cluster " ); int irpc_clus_size = ((*rpcCollection)->rdoList()).size(); - int irpc_clus_station = m_muonIdHelperTool->rpcIdHelper().stationName(prd_id) ; - int irpc_clus_eta = m_muonIdHelperTool->rpcIdHelper().stationEta(prd_id) ; - int irpc_clus_phi = m_muonIdHelperTool->rpcIdHelper().stationPhi(prd_id) ; - int irpc_clus_doublr = m_muonIdHelperTool->rpcIdHelper().doubletR(prd_id) ; - int irpc_clus_doublz = m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_id) ; - int irpc_clus_doublphi = m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_id) ; - int irpc_clus_gasgap = m_muonIdHelperTool->rpcIdHelper().gasGap(prd_id) ; - int irpc_clus_measphi = m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_id) ; + int irpc_clus_station = m_idHelperSvc->rpcIdHelper().stationName(prd_id) ; + int irpc_clus_eta = m_idHelperSvc->rpcIdHelper().stationEta(prd_id) ; + int irpc_clus_phi = m_idHelperSvc->rpcIdHelper().stationPhi(prd_id) ; + int irpc_clus_doublr = m_idHelperSvc->rpcIdHelper().doubletR(prd_id) ; + int irpc_clus_doublz = m_idHelperSvc->rpcIdHelper().doubletZ(prd_id) ; + int irpc_clus_doublphi = m_idHelperSvc->rpcIdHelper().doubletPhi(prd_id) ; + int irpc_clus_gasgap = m_idHelperSvc->rpcIdHelper().gasGap(prd_id) ; + int irpc_clus_measphi = m_idHelperSvc->rpcIdHelper().measuresPhi(prd_id) ; if(irpc_clus_measphi==0){ m_rpcCSEta->Fill( irpc_clus_size); @@ -1867,14 +1818,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_id, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_id, 0) ; int ShiftStrips = rpcstripshift[ 4] ; int ShiftEtaStripsTot = rpcstripshift[ 8] ; int EtaStripSign = rpcstripshift[10] ; //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prd_id, 0) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prd_id, 0) ; m_layer_name = rpclayersectorsidename[ 0] ; m_layertodraw1_name = rpclayersectorsidename[ 1] ; @@ -1894,7 +1845,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() float av_strip = 0 ; for(int i=0; i!=irpc_clus_size ; i++){ Identifier id = ((*rpcCollection)->rdoList())[i] ; - int strip = int(m_muonIdHelperTool->rpcIdHelper().strip(id)) ; + int strip = int(m_idHelperSvc->rpcIdHelper().strip(id)) ; strip += ShiftStrips ; av_strip += float(strip) ; } @@ -1914,7 +1865,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() rpcclustersizedislayer->Fill(irpc_clus_size); for(int i=0; i!=irpc_clus_size ; i++){ Identifier id = ((*rpcCollection)->rdoList())[i] ; - int strip = int(m_muonIdHelperTool->rpcIdHelper().strip(id)) ; + int strip = int(m_idHelperSvc->rpcIdHelper().strip(id)) ; strip += ShiftStrips ; if(rpcclustersizelayer)rpcclustersizelayer->Fill( strip, irpc_clus_size ); avstrip += float(strip); @@ -1945,14 +1896,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() Identifier prd_idII = (*rpcCollectionII)->identify(); int irpc_clus_sizeII = ((*rpcCollectionII)->rdoList()).size(); - int irpc_clus_stationII = m_muonIdHelperTool->rpcIdHelper().stationName(prd_idII) ; - int irpc_clus_etaII = m_muonIdHelperTool->rpcIdHelper().stationEta(prd_idII) ; - int irpc_clus_phiII = m_muonIdHelperTool->rpcIdHelper().stationPhi(prd_idII) ; - int irpc_clus_doublrII = m_muonIdHelperTool->rpcIdHelper().doubletR(prd_idII) ; - int irpc_clus_doublzII = m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_idII) ; - int irpc_clus_doublphiII = m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_idII) ; - int irpc_clus_gasgapII = m_muonIdHelperTool->rpcIdHelper().gasGap(prd_idII) ; - int irpc_clus_measphiII = m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_idII) ; + int irpc_clus_stationII = m_idHelperSvc->rpcIdHelper().stationName(prd_idII) ; + int irpc_clus_etaII = m_idHelperSvc->rpcIdHelper().stationEta(prd_idII) ; + int irpc_clus_phiII = m_idHelperSvc->rpcIdHelper().stationPhi(prd_idII) ; + int irpc_clus_doublrII = m_idHelperSvc->rpcIdHelper().doubletR(prd_idII) ; + int irpc_clus_doublzII = m_idHelperSvc->rpcIdHelper().doubletZ(prd_idII) ; + int irpc_clus_doublphiII = m_idHelperSvc->rpcIdHelper().doubletPhi(prd_idII) ; + int irpc_clus_gasgapII = m_idHelperSvc->rpcIdHelper().gasGap(prd_idII) ; + int irpc_clus_measphiII = m_idHelperSvc->rpcIdHelper().measuresPhi(prd_idII) ; if(irpc_clus_measphi == irpc_clus_measphiII )continue; if(irpc_clus_station != irpc_clus_stationII )continue; @@ -1966,12 +1917,12 @@ StatusCode RpcRawDataValAlg::fillHistograms() //evaluate average strip float avstripeta = 0 ; float avstripphi = av_strip ; - ShiftEtaStripsTot = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_idII, 0)[8] ; // angelo 07 oct 2009 - EtaStripSign = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_idII, 0)[10] ; // angelo 07 oct 2009 + ShiftEtaStripsTot = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_idII, 0)[8] ; // angelo 07 oct 2009 + EtaStripSign = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_idII, 0)[10] ; // angelo 07 oct 2009 for(int i=0; i!=irpc_clus_sizeII ; i++){ Identifier id = ((*rpcCollectionII)->rdoList())[i] ; - avstripeta += float(m_muonIdHelperTool->rpcIdHelper().strip(id))/irpc_clus_sizeII ; + avstripeta += float(m_idHelperSvc->rpcIdHelper().strip(id))/irpc_clus_sizeII ; } avstripeta += float(ShiftEtaStripsTot) ; @@ -3437,7 +3388,7 @@ StatusCode RpcRawDataValAlg::bookHistogramsRecurrent() if(rpc == NULL )continue; Identifier idr = rpc->identify(); - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr, 0) ; int rpcpanel_dbindex = rpcstripshift[23]; int PlaneTipo = rpcstripshift[15]; int rpctower_dbindex = rpcstripshift[24]; @@ -4805,10 +4756,10 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if(rpc != NULL ){ Identifier idr = rpc->identify(); - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr, 0) ; NTotStripsSideA = rpcstripshift[6]+rpcstripshift[17]; Identifier idr_c = rpc_c->identify(); - std::vector<int> rpcstripshift_c = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr_c, 0) ; + std::vector<int> rpcstripshift_c = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr_c, 0) ; NTotStripsSideC = rpcstripshift_c[7]+rpcstripshift_c[18]; } @@ -4839,10 +4790,10 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if(kNameF==1)kNameF=53;//BMLE for (int iz=0; iz!=3; iz++ ) { int irc = ir ; - if(abs(ieta-8)==7&&ir==1&&kNameF==2)continue; - if(isec==12&&abs(ieta-8)==6&&ir==1&&kNameF==2)continue; - if(abs(ieta-8)==7&&ir==2&&kNameF==2)irc=1; - if(isec==12&&abs(ieta-8)==6&&ir==2&&kNameF==2)irc=1; + if(std::abs(ieta-8)==7&&ir==1&&kNameF==2)continue; + if(isec==12&&std::abs(ieta-8)==6&&ir==1&&kNameF==2)continue; + if(std::abs(ieta-8)==7&&ir==2&&kNameF==2)irc=1; + if(isec==12&&std::abs(ieta-8)==6&&ir==2&&kNameF==2)irc=1; const MuonGM::RpcReadoutElement* rpc = MuonDetMgr->getRpcRElement_fromIdFields(kNameF, ieta-8, istatPhi+1, irc, iz+1, idblPhi+1); if( rpc == NULL ) continue; @@ -4850,24 +4801,24 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if ( iz+1 != rpc->getDoubletZ() ) { continue ; } - Identifier idr = m_muonIdHelperTool->rpcIdHelper().parentID( rpc->identify() ); + Identifier idr = m_idHelperSvc->rpcIdHelper().parentID( rpc->identify() ); rpcElemPhiStrip = int (rpc->NphiStrips() ) ; rpcElemEtaStrip = int (rpc->NetaStrips() ) ; for ( int istripEta=0; istripEta!=rpcElemEtaStrip; istripEta++ ) { - Identifier strip_id = m_muonIdHelperTool->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 0, istripEta+1) ; - Identifier panel_id = m_muonIdHelperTool->rpcIdHelper().panelID( strip_id ) ; + Identifier strip_id = m_idHelperSvc->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 0, istripEta+1) ; + Identifier panel_id = m_idHelperSvc->rpcIdHelper().panelID( strip_id ) ; if( strip_id == 0 ) continue; - coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), strip_id, 0)).at(16); + coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), strip_id, 0)).at(16); m_rpcCool_PanelIdHist->Fill(coolStripIndex, panel_id.get_identifier32().get_compact()) ; } for ( int istripPhi=0; istripPhi!=rpcElemPhiStrip; istripPhi++ ) { - Identifier strip_id = m_muonIdHelperTool->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 1, istripPhi+1) ; - Identifier panel_id = m_muonIdHelperTool->rpcIdHelper().panelID( strip_id ) ; + Identifier strip_id = m_idHelperSvc->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 1, istripPhi+1) ; + Identifier panel_id = m_idHelperSvc->rpcIdHelper().panelID( strip_id ) ; if( strip_id == 0 ) continue; - coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), strip_id, 0)).at(16); + coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), strip_id, 0)).at(16); m_rpcCool_PanelIdHist->Fill(coolStripIndex, panel_id.get_identifier32().get_compact() ); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h index f2df1fc3b87d9ddb4b8850ff256dad2fd3ab2fd7..edd6650e6afec811cdca9dac7c3428a19e0068f0 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.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 */ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,51 +15,27 @@ #ifndef TgcLv1RawDataValAlg_H #define TgcLv1RawDataValAlg_H -#include <sstream> -#include <string.h> -#include <vector> -#include <map> - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" -//#include "StoreGate/DataHandle.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonTrigCoinData/TgcCoinData.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonTrigCoinData/TgcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" - +#include "xAODTrigger/JetRoIContainer.h" #include "xAODMuon/MuonContainer.h" - #include "xAODTrigger/MuonRoIContainer.h" #include "xAODTrigger/EmTauRoIContainer.h" -#include "xAODTrigger/JetRoIContainer.h" -#include "xAODTrigger/JetEtRoI.h" #include "xAODTrigger/EnergySumRoI.h" - #include "TrigSteeringEvent/TrigOperationalInfoCollection.h" - #include "StoreGate/ReadHandleKey.h" - #include "xAODEventInfo/EventInfo.h" +#include <string> +#include <vector> #include "TH1F.h" #include "TH2F.h" #include "TGraphAsymmErrors.h" -class TFile; template <class ConcreteAlgorithm> class AlgFactory; ///////////////////////////////////////////////////////////////////////////// @@ -68,21 +44,15 @@ class TgcLv1RawDataValAlg: public ManagedMonitorToolBase { public: TgcLv1RawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); - virtual ~TgcLv1RawDataValAlg(); + virtual ~TgcLv1RawDataValAlg()=default; StatusCode initialize(); - // StatusCode finalize(); - //virtual StatusCode bookHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); virtual StatusCode procHistograms(); private: - - // Tool for TGC Id Helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // Event Properties int m_event; int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h index 456915f7f4fa182fe26a3d306c8e372170d1b5dd..d10309fa309288eaf2fdea4fe46ea8ada6995637 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.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 */ //////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,42 +15,26 @@ #ifndef TgcRawDataValAlg_H #define TgcRawDataValAlg_H -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/AlgTool.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/TgcReadoutElement.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" - #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" - #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" #include "TH1.h" #include "TH2.h" #include "TProfile.h" #include "TAxis.h" - -#include <sstream> -#include <string.h> +#include <string> #include <vector> #include <map> - -class TFile; -class Identifier; - // Maximum Collection and Prd static const int maxColl = 1200; static const int maxPrd = 50000; @@ -63,20 +47,16 @@ class TgcRawDataValAlg: public ManagedMonitorToolBase { public: TgcRawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); - virtual ~TgcRawDataValAlg(); + virtual ~TgcRawDataValAlg()=default; StatusCode initialize(); - //virtual StatusCode bookHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); virtual StatusCode procHistograms(); private: - - // Tool for TGC Id Helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; + // event properties int m_event; int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx index 2e31ef2e25f308197fc7f210773c603a7f8a5571..e6f380d37f930f6cb4d19e5dbf4fed7efd9b1f9e 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx @@ -12,9 +12,6 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/DataHandle.h" - #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" @@ -163,58 +160,17 @@ TgcLv1RawDataValAlg::TgcLv1RawDataValAlg(const std::string &type, const std::str } - -/////////////////////////////////////////////////////////////////////////// -// TgcLv1RawDataValAlg Destructor -/////////////////////////////////////////////////////////////////////////// -TgcLv1RawDataValAlg::~TgcLv1RawDataValAlg(){ - ATH_MSG_DEBUG( " deleting TgcLv1RawDataValAlg " ); -} - - /////////////////////////////////////////////////////////////////////////// // TgcLv1RawDataValAlg initialize /////////////////////////////////////////////////////////////////////////// StatusCode TgcLv1RawDataValAlg::initialize(){ + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in TgcLv1RawDataValAlg initialize" ); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - /* - if ( m_checkCabling ) { - // get Cabling Server Service - const ITGCcablingServerSvc* TgcCabGet = 0; - sc = service("TGCcablingServerSvc", TgcCabGet); - if (sc.isFailure()){ - m_log << MSG::ERROR << " Can't get TGCcablingServerSvc " << endmsg; - return StatusCode::FAILURE; - } - // get Cabling Service - sc = TgcCabGet->giveCabling(m_cabling); - if (sc.isFailure()){ - m_log << MSG::ERROR << " Can't get TGCcablingSvc Server" << endmsg; - return StatusCode::FAILURE; - } - - // check whether TGCcabling is compatible with 1/12 sector or not - int maxRodId,maxSswId, maxSbloc,minChannelId, maxChannelId; - m_cabling->getReadoutIDRanges( maxRodId,maxSswId, maxSbloc,minChannelId, maxChannelId); - if (maxRodId ==12) { - m_log << MSG::INFO << "TGCcabling12Svc OK" << endmsg ; - } else { - m_log << MSG::WARNING << "TGCcablingSvc(octant segmentation) OK" << endmsg ; - } - - } - */ - // Set number of Muon Algorithms to use, 1:muid, 2:muid&staco m_nMuonAlgorithms=1; if(m_environment==AthenaMonManager::online) m_nMuonAlgorithms=1; - - ManagedMonitorToolBase::initialize().ignore();// Ignore the checking code - ATH_CHECK(m_coinCollectionLocation.initialize()); ATH_CHECK(m_coinCollectionLocationPrevious.initialize()); ATH_CHECK(m_coinCollectionLocationNext.initialize()); @@ -225,7 +181,7 @@ TgcLv1RawDataValAlg::initialize(){ ATH_CHECK(m_L1esumRoIName.initialize()); ATH_CHECK(m_eventInfo.initialize()); ATH_CHECK(m_trigOpInfo.initialize(m_useExpressStream)); - + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx index e119bdc1c1df9f5fe30a98dd1a6c0fc22e43642b..ca3e3d13d15cfd9bf6509e5562b53f651107a658 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx @@ -303,7 +303,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco // Get Side int ac = (oeta<0); // Set pTs above 50 to 50.1 - if(fabs(opt)>50.) opt = 50.1*oq; + if(std::abs(opt)>50.) opt = 50.1*oq; //ophi = -pi to pi //ophi_mod = -pi/12 to 23*pi/12 @@ -314,7 +314,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco for(int pt=0;pt<6;pt++){ m_tgclv1turnondenom[ac][pt][pn][ms]->Fill(opt); if(opt> thresetavsphi[pt]){ - m_tgclv1effetavsphidenom[ac][pt][pn][ms]->Fill(fabs(oeta),ophi_mod); + m_tgclv1effetavsphidenom[ac][pt][pn][ms]->Fill(std::abs(oeta),ophi_mod); } if( m_found_express_stream && m_found_nonmuon_express_chain ){ m_tgclv1turnondenom_ES[ac][pt]->Fill(opt); @@ -411,7 +411,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco for(int pt=0;pt<6;pt++){ if(flag[pt]==true){ if(opt> thresetavsphi[pt]){ - m_tgclv1effetavsphinum[ac][pt][pn][ms][pcn]->Fill(fabs(oeta),ophi_mod); + m_tgclv1effetavsphinum[ac][pt][pn][ms][pcn]->Fill(std::abs(oeta),ophi_mod); } } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx index 6e95916211fbf187d32ee009e5f394c74d107987..abe1eb3d9a33a888422e1cd25c7c55eddae0280f 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx @@ -12,29 +12,19 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/DataHandle.h" +#include "TgcRawDataMonitoring/TgcLv1RawDataValAlg.h" #include "xAODEventInfo/EventInfo.h" - #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" - #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "Identifier/Identifier.h" - -#include "TgcRawDataMonitoring/TgcLv1RawDataValAlg.h" #include "AthenaMonitoring/AthenaMonManager.h" - #include "AnalysisTriggerEvent/LVL1_ROI.h" - #include "TrigSteeringEvent/TrigOperationalInfo.h" /////////////////////////////////////////////////////////////////////////// @@ -139,7 +129,6 @@ TgcLv1RawDataValAlg::readTgcCoinDataContainer(const Muon::TgcCoinDataContainer* int ws = (tcd->isStrip()); //isStrip w:0, s:1 (invalid in case of SL) int phi48 = tcd->phi() -1;//[0:47]MidEnd[0:23]Forward/EIFI if(ef==0) phi48 = phi48*2;//[0:2:46] - //int sector = phi2sector(phi48,ef); int pt = tcd->pt(); Amg::Vector3D gposout = tcd->globalposOut(); double eta, phi; @@ -147,11 +136,11 @@ TgcLv1RawDataValAlg::readTgcCoinDataContainer(const Muon::TgcCoinDataContainer* else { eta = gposout.eta(); phi = gposout.phi(); } const Identifier tcdidout = tcd->channelIdOut(); - int etaout = abs(int(m_muonIdHelperTool->tgcIdHelper().stationEta(tcdidout))); + int etaout = std::abs(int(m_idHelperSvc->tgcIdHelper().stationEta(tcdidout))); if(ef==0) etaout = 0; const Identifier tcdidin = tcd->channelIdIn(); - int etain = abs(int(m_muonIdHelperTool->tgcIdHelper().stationEta(tcdidin))); + int etain = std::abs(int(m_idHelperSvc->tgcIdHelper().stationEta(tcdidin))); if(ef==0) etain = 0; // Fill vectors for different Coincidence Types @@ -274,9 +263,9 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve float pt = (*it)->pt(); float eta = (*it)->eta(); float phi = (*it)->phi(); - if( fabs(pt) < ptcut || - fabs(eta) < etamin || - fabs(eta) > etamax ) continue; + if( std::abs(pt) < ptcut || + std::abs(eta) < etamin || + std::abs(eta) > etamax ) continue; bool getvalue = true; @@ -309,7 +298,7 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve trtOLfrac = trtOL/(trtHits + trtOL); bool trt=false; - if( fabs(eta) < 1.9 ){ + if( std::abs(eta) < 1.9 ){ trt= ( ( trtHits > 5 ) && ( trtOLfrac < 0.9 ) ); } else{ @@ -331,8 +320,8 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve bool overlapped = false; for(unsigned int itr=0; itr<mu_eta->size(); itr++){ - float deta = fabs(mu_eta->at(itr) - eta); - float dphi = fabs(mu_phi->at(itr) - phi); + float deta = std::abs(mu_eta->at(itr) - eta); + float dphi = std::abs(mu_phi->at(itr) - phi); if(dphi > M_PI) dphi = 2*M_PI - dphi; if(sqrt(deta*deta + dphi*dphi) < 0.1){ if(pt > mu_pt->at(itr)){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx index 2fe502e72b9bf1b8c81ed1d3b9f568c60cd48a14..5075045805f73b1ac7bfc8595414405a4713a323 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx @@ -822,7 +822,7 @@ TgcLv1RawDataValAlg::fillTriggerTimingAssociatedWithTrack( int ms,// 0:Muid 1:St float oeta = mu_eta->at(o); float ophi = mu_phi->at(o); float oq = mu_q->at(o); - if( fabs(opt) > 50. ) opt = 50.1 * oq; + if( std::abs(opt) > 50. ) opt = 50.1 * oq; // Get side index int ac = (oeta<0); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx index f7a762fd54427398a692111a95a9c961d57ea2ec..25366ebc5cd20892f224afb4024fc9125a3a2976 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx @@ -3,8 +3,8 @@ */ #include "TgcRawDataMonitorAlgorithm.h" + #include "TObjArray.h" -#include <memory> TgcRawDataMonitorAlgorithm::TgcRawDataMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : AthMonitorAlgorithm(name,pSvcLocator) @@ -12,10 +12,9 @@ TgcRawDataMonitorAlgorithm::TgcRawDataMonitorAlgorithm( const std::string& name, } StatusCode TgcRawDataMonitorAlgorithm::initialize() { - - ATH_CHECK(m_MuonIdHelperTool.retrieve()); + ATH_CHECK(AthMonitorAlgorithm::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_extrapolator.retrieve()); - ATH_CHECK(m_MuonContainerKey.initialize()); ATH_CHECK(m_MuonRoIContainerKey.initialize()); ATH_CHECK(m_TgcPrepDataContainerKey.initialize()); @@ -49,7 +48,7 @@ StatusCode TgcRawDataMonitorAlgorithm::initialize() { m_trigTagDefs.push_back(def); } - return AthMonitorAlgorithm::initialize(); + return StatusCode::SUCCESS; } StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const { @@ -230,7 +229,7 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) ATH_MSG_ERROR("evtStore() does not contain TgcPrepDataContainer with name "<< m_TgcPrepDataContainerKey); return StatusCode::FAILURE; } - const TgcIdHelper& tgcIdHelper = m_MuonIdHelperTool->tgcIdHelper(); + const TgcIdHelper& tgcIdHelper = m_idHelperSvc->tgcIdHelper(); std::vector<TgcHit> tgcHits; for(auto tgccnt : *tgcPrd){ for(auto data : *tgccnt){ @@ -470,7 +469,7 @@ TgcRawDataMonitorAlgorithm::extrapolateToTGC(const Trk::TrackStateOnSurface* tso } double targetZ = pos.z(); double trackZ = track->position().z(); - if (fabs(trackZ)<fabs(targetZ)-2000. || fabs(trackZ)>fabs(targetZ)+2000.){ + if (std::abs(trackZ)<std::abs(targetZ)-2000. || std::abs(trackZ)>std::abs(targetZ)+2000.){ return 0; } Amg::Transform3D* matrix = new Amg::Transform3D; @@ -485,7 +484,7 @@ TgcRawDataMonitorAlgorithm::extrapolateToTGC(const Trk::TrackStateOnSurface* tso return 0; } distance[0] = trackZ; - distance[1] = fabs(trackZ - targetZ); + distance[1] = std::abs(trackZ - targetZ); const bool boundaryCheck = true; const Trk::Surface* surface = disc; const Trk::TrackParameters* param = m_extrapolator->extrapolate(*track, diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h index 24986340082f33a645cc2fcfa21201317ae93074..b22c1e8c6e8a3f2c916c7adae8c4db6eeb58f6f5 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h @@ -6,15 +6,16 @@ #define TGCRAWDATAMONITORING_TGCRAWDATAMONITORALGORITHM_H #include "AthenaMonitoring/AthMonitorAlgorithm.h" -#include "AthenaMonitoringKernel/Monitored.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "StoreGate/ReadHandleKey.h" #include "xAODMuon/MuonContainer.h" #include "xAODTrigger/MuonRoIContainer.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include "MuonReadoutGeometry/TgcReadoutElement.h" #include "TrkExInterfaces/IExtrapolator.h" +#include "MuonPrepRawData/TgcPrepDataContainer.h" class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { public: @@ -86,7 +87,7 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { private: - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey{this,"MuonContainerName","Muons","Offline muon track container"}; SG::ReadHandleKey<xAOD::MuonRoIContainer> m_MuonRoIContainerKey{this,"MuonRoIContainerName","LVL1MuonRoIs","L1 muon RoI container"}; @@ -96,8 +97,6 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_TgcCoinDataContainerNextBCKey{this,"TgcCoinDataContainerNextBCName","TrigT1CoinDataCollectionNextBC","TGC Coin Data Container NextBC"}; SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_TgcCoinDataContainerPrevBCKey{this,"TgcCoinDataContainerPrevBCName","TrigT1CoinDataCollectionPriorBC","TGC Coin Data Container PrevBC"}; - ToolHandle<Muon::MuonIdHelperTool> m_MuonIdHelperTool{this, "MuonIdHelperTool", "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - StringProperty m_packageName{this,"PackageName","TgcRawDataMonitor","group name for histograming"}; StringProperty m_trigTagList{this,"TagTrigList","HLT_mu26_ivarmedium_L1MU20","list of triggers to be used for trigger matching"}; BooleanProperty m_TagAndProbe{this,"TagAndProbe",true,"switch to perform tag-and-probe method"}; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx index 8dec6aa1cc2ac478a568cabe62c38a11eb6bdbbc..e5317518bae0a157c56a63b5f298a4ce702a370a 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx @@ -12,13 +12,9 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" - // GeoModel #include "MuonReadoutGeometry/TgcReadoutParams.h" -#include "Identifier/Identifier.h" - // MuonRDO #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoIdHash.h" @@ -29,10 +25,8 @@ #include "MuonDQAUtils/MuonCosmicSetup.h" #include "TgcRawDataMonitoring/TgcRawDataValAlg.h" -#include "AthenaMonitoring/AthenaMonManager.h" #include <inttypes.h> - #include <sstream> #include <math.h> @@ -46,30 +40,17 @@ TgcRawDataValAlg::TgcRawDataValAlg( const std::string & type, const std::string m_numberingVersion=0; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -TgcRawDataValAlg::~TgcRawDataValAlg(){ - ATH_MSG_INFO( " deleting TgcRawDataValAlg " ); -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * StatusCode TgcRawDataValAlg::initialize(){ - ATH_MSG_INFO( "in initializing TgcRawDataValAlg" ); - - ATH_CHECK( ManagedMonitorToolBase::initialize() ); - -// MuonDetectorManager from the conditions store + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); + // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - //histograms directory names m_generic_path_tgcmonitoring = "Muon/MuonRawDataMonitoring/TGC"; - //tgcchamberId(); - - //offset setOffset(); //set minimum and maximum of channel difference diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx index 88333bd875448c4de84848650b1229c305c09885..13fe8a63402a1578292e1ce8424ffbfad0273f94 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx @@ -12,14 +12,8 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" - -// GeoModel #include "MuonReadoutGeometry/TgcReadoutParams.h" -#include "Identifier/Identifier.h" - -// MuonRDO #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoIdHash.h" #include "MuonRDO/TgcRdoContainer.h" @@ -37,7 +31,7 @@ #include <inttypes.h> #include <sstream> -#include <math.h> +#include <cmath> StatusCode TgcRawDataValAlg::bookHistogramsEfficiency(){ @@ -468,7 +462,7 @@ TgcRawDataValAlg::fillEfficiency(){ // If exactly one channel with hit if(m_hitIdVects[CURR][ac][ws][eta][phi48][l].size()==1){ // Fill channel variables - chIds[ws][l] = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)) + m_SLBoffset[ws][ac][eta][l]; + chIds[ws][l] = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)) + m_SLBoffset[ws][ac][eta][l]; const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)); const Amg::Vector3D channelPos = pReadoutElementTGC->channelPos(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)); //global position chEtas[ws][l] = channelPos.eta(); @@ -482,10 +476,10 @@ TgcRawDataValAlg::fillEfficiency(){ // Flag wire edge hits int wsize = m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].size(); for(int hit=0;hit<wsize;hit++){ - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); - int stationEta = abs(m_muonIdHelperTool->tgcIdHelper().stationEta(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit))); - int channel = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); - int stationPhi = m_muonIdHelperTool->tgcIdHelper().stationPhi(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationName = m_idHelperSvc->tgcIdHelper().stationName(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationEta = std::abs(m_idHelperSvc->tgcIdHelper().stationEta(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit))); + int channel = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationPhi = m_idHelperSvc->tgcIdHelper().stationPhi(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); // Flag as edge hit if within 3 channels of chamber edge if(channel<=3 || channel>=getNumberOfWires(stationName, l, stationEta, stationPhi)-3){ edgehit[WIRE][l] = true; @@ -495,7 +489,7 @@ TgcRawDataValAlg::fillEfficiency(){ // Flag strip edge hits int ssize = m_hitIdVects[CURR][ac][STRP][eta][phi48][l].size(); for(int hit=0;hit<ssize;hit++){ - int ch = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[1][ac][1][eta][phi48][l].at(hit)); + int ch = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[1][ac][1][eta][phi48][l].at(hit)); // Flag as edge hit if within 3 channels of chamber edge if(ch<= 3 || ch>=30){ edgehit[STRP][l] = true; @@ -557,10 +551,10 @@ TgcRawDataValAlg::fillEfficiency(){ for(int wsLpT=0;wsLpT<2;wsLpT++){ for(int i=0;i<nLpT[wsLpT];i++){ // Flag wire if LpT matches layer 2&3 hits - if((fabs(chEtas[WIRE][refLayer[WIRE]]-LptEta[wsLpT][ac][i]) <deta[WIRE][wsLpT])&& - (fabs(chPhis[WIRE][refLayer[WIRE]]-LptPhi[wsLpT][ac][i]) <dphi[WIRE][wsLpT])&& - (fabs(chEtas[STRP][refLayer[STRP]]-LptEta[wsLpT][ac][i]) <deta[STRP][wsLpT])&& - (fabs(chPhis[STRP][refLayer[STRP]]-LptPhi[wsLpT][ac][i]) <dphi[STRP][wsLpT])){ + if((std::abs(chEtas[WIRE][refLayer[WIRE]]-LptEta[wsLpT][ac][i]) <deta[WIRE][wsLpT])&& + (std::abs(chPhis[WIRE][refLayer[WIRE]]-LptPhi[wsLpT][ac][i]) <dphi[WIRE][wsLpT])&& + (std::abs(chEtas[STRP][refLayer[STRP]]-LptEta[wsLpT][ac][i]) <deta[STRP][wsLpT])&& + (std::abs(chPhis[STRP][refLayer[STRP]]-LptPhi[wsLpT][ac][i]) <dphi[STRP][wsLpT])){ LpTmatch[wsLpT]=true; break; } @@ -640,10 +634,10 @@ TgcRawDataValAlg::fillEfficiency(){ for(int wsEIFI=0;wsEIFI<2;wsEIFI++){ for(int i=0;i<nEIFI[wsEIFI];i++){ // Flag wire if LpT matches layer 2&3 hits - if((fabs(chEtas[WIRE][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[WIRE][wsEIFI])&& - (fabs(chPhis[WIRE][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[WIRE][wsEIFI])&& - (fabs(chEtas[STRP][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[STRP][wsEIFI])&& - (fabs(chPhis[STRP][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[STRP][wsEIFI])){ + if((std::abs(chEtas[WIRE][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[WIRE][wsEIFI])&& + (std::abs(chPhis[WIRE][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[WIRE][wsEIFI])&& + (std::abs(chEtas[STRP][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[STRP][wsEIFI])&& + (std::abs(chPhis[STRP][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[STRP][wsEIFI])){ EIFImatch[wsEIFI]=true; break; } @@ -703,7 +697,7 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la else if(layer==8) refLayer = 7; else refLayer = 2; - int referenceChannel = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][refLayer].at(0)); + int referenceChannel = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][refLayer].at(0)); referenceChannel+=m_SLBoffset[ws][ac][eta][refLayer]; // Loop over Current PRD @@ -711,7 +705,7 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[CURR][ac][ws][eta][phi48][layer].begin(); it!=itc_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ @@ -730,14 +724,12 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[PREV][ac][ws][eta][phi48][layer].begin(); it!=itp_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ ATH_MSG_DEBUG("calculate efficiency previous layer"<<layer+1 << " eta" << eta << " phi" << phi48 << " fire" ); - //if(!isEIFI){ m_tgceffmapnumbc[ac][ws][PREV]->Fill(binx, biny); - //} break; } } @@ -747,14 +739,12 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[NEXT][ac][ws][eta][phi48][layer].begin(); it!=itn_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ ATH_MSG_DEBUG("calculate efficiency next layer"<<layer+1 << " eta" << eta << " phi" << phi48 << " fire" ); - //if(!isEIFI){ m_tgceffmapnumbc[ac][ws][NEXT-1]->Fill(binx, biny); // only prev/next defined, array index should be 1 for NEXT PRD - //} break; } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx index 2c73fc46b579961881b35cd0906e64a3f78f73a4..a13ff3a709cc60675e09b57762666b131591d03b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx @@ -46,43 +46,23 @@ void TgcRawDataValAlg::tgcchamberId(){ ATH_MSG_DEBUG( "in TGC ChambersIDvector" ); - //std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().module_end(); - IdContext tgcModuleContext = m_muonIdHelperTool->tgcIdHelper().module_context(); + IdContext tgcModuleContext = m_idHelperSvc->tgcIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; - for(std::vector<Identifier>::const_iterator i = m_muonIdHelperTool->tgcIdHelper().module_begin(); + for(std::vector<Identifier>::const_iterator i = m_idHelperSvc->tgcIdHelper().module_begin(); i != idlast; i++){ Id=*i; - //int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(Id, Idhash, &tgcModuleContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(Id); - int stationName = int(m_muonIdHelperTool->tgcIdHelper().stationName(Id)); //unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) - int stationEta = int(m_muonIdHelperTool->tgcIdHelper().stationEta(Id)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) - int stationPhi = int(m_muonIdHelperTool->tgcIdHelper().stationPhi(Id)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] - //int itgcGasGap = int(m_muonIdHelperTool->tgcIdHelper().gasGap(tgc_id)); //increase with |Z|, doublet:[1:2], triplet:[1:3] + int stationName = int(m_idHelperSvc->tgcIdHelper().stationName(Id)); //unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationEta = int(m_idHelperSvc->tgcIdHelper().stationEta(Id)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) + int stationPhi = int(m_idHelperSvc->tgcIdHelper().stationPhi(Id)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] std::string type = "TGC"; std::string hardware_name=convertChamberName(stationName, stationEta, stationPhi, type) ; - - - //m_log << MSG::DEBUG << "Adding the chamber Identifier: " << extid << endmsg;} - //m_log << MSG::DEBUG << "Adding the chamber Identifier: " << extid <<" "; - /* - m_log << MSG::DEBUG << "Adding the chamber " << hardware_name <<" "; - if (gethash_code == 0) { - if (m_debuglevel) m_log << MSG::DEBUG <<" its Id is "; - if (m_debuglevel) m_log.setf( std::ios::showbase ); - if (m_debuglevel) m_log.setf( std::ios::hex, std::ios::basefield ); - if (m_debuglevel) m_log << Id; - //if (m_debuglevel) m_log.setf( std::ios::dec, std::ios::basefield ); - if (m_debuglevel) m_log << MSG::DEBUG <<" its hash Id is "<< Idhash << endmsg; - }else{ - if (m_debuglevel) m_log << MSG::DEBUG<<" hash Id NOT computed "<< Idhash << endmsg; - } - */ } return; } @@ -260,19 +240,18 @@ TgcRawDataValAlg::getNumberOfWires( const int istationName, const int layer, con //wire number in phi48 int TgcRawDataValAlg::getWireNumberPerPhi48(Identifier id) const{ - int stationName=m_muonIdHelperTool->tgcIdHelper().stationName(id);//41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T3F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationName=m_idHelperSvc->tgcIdHelper().stationName(id);//41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T3F 48:T4E (T4 means inner small wheel TGCs, EI/FI) if(stationName==47||stationName==48){ ATH_MSG_WARNING( "getWireNumberPerPhi48 is not implemented yet for EIFI" ); return -1; } - int GasGap=m_muonIdHelperTool->tgcIdHelper().gasGap(id);//[1-3] - int stationPhi=m_muonIdHelperTool->tgcIdHelper().stationPhi(id);//[1:24], [1:48] - int stationEta=m_muonIdHelperTool->tgcIdHelper().stationEta(id);//[-5:-1][1:5] - //int absstationEta=abs(stationEta);//[1-5] - int channel=m_muonIdHelperTool->tgcIdHelper().channel(id);//channel - int isStrip=m_muonIdHelperTool->tgcIdHelper().isStrip(id);//channel + int GasGap=m_idHelperSvc->tgcIdHelper().gasGap(id);//[1-3] + int stationPhi=m_idHelperSvc->tgcIdHelper().stationPhi(id);//[1:24], [1:48] + int stationEta=m_idHelperSvc->tgcIdHelper().stationEta(id);//[-5:-1][1:5] + int channel=m_idHelperSvc->tgcIdHelper().channel(id);//channel + int isStrip=m_idHelperSvc->tgcIdHelper().isStrip(id);//channel int tgc, gasgap, eta, phi; getEtaPhiBasedNumbering(stationName, GasGap, stationEta, stationPhi, @@ -321,7 +300,7 @@ TgcRawDataValAlg::getSectorBasedNumbering(int StationName, int GasGap, int Stati // etaIndex[0:5], 0 is Forward, [1:5] are Endcap // phiIndex[0:3], Endcap has [0:3] chambers per sector, Forward has [0:1] if(StationName==42||StationName==44||StationName==46){//Endcap - eta=abs(StationEta); + eta=std::abs(StationEta); phi=StationPhi+1;// offset +2, StationPhi is 1-based, phi is 0-based sector=phi/4; phi%=4;// convert to index inside sector (phi[0:3]) @@ -392,7 +371,7 @@ TgcRawDataValAlg::getEtaPhiBasedNumbering(int StationName, int GasGap, int Stati // Eta [0:5] eta=0; if(StationName==42||StationName==44||StationName==46||StationName==48){//Endcap - eta=abs(StationEta); + eta=std::abs(StationEta); }else if(StationName==41||StationName==43||StationName==45||StationName==47){//Forward eta=0; }else{ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx index f77a440eece08e6276b8f11ca30f4db1c944f701..3608553065533466f02d3a3f77dcccafbcc29627 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx @@ -98,9 +98,9 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc Identifier chamberID = (*containerIt)->identify(); // Get chamber indexes - int stationName = int(m_muonIdHelperTool->tgcIdHelper().stationName(chamberID));//unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) - int stationEta = int(m_muonIdHelperTool->tgcIdHelper().stationEta(chamberID)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) - int stationPhi = int(m_muonIdHelperTool->tgcIdHelper().stationPhi(chamberID)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] + int stationName = int(m_idHelperSvc->tgcIdHelper().stationName(chamberID));//unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationEta = int(m_idHelperSvc->tgcIdHelper().stationEta(chamberID)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) + int stationPhi = int(m_idHelperSvc->tgcIdHelper().stationPhi(chamberID)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] int fe = (stationName==42||stationName==44||stationName==46||stationName==48);// 0:forward, 1:endcap int ac = (stationEta<0); @@ -137,9 +137,9 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc Identifier elementID = (*collectionIt)->identify(); // Get element indexes - int gasGap = int(m_muonIdHelperTool->tgcIdHelper().gasGap(elementID)); //increase with |Z|, doublet:[1:2], triplet:[1:3] - int channel = int(m_muonIdHelperTool->tgcIdHelper().channel(elementID));//channel in a chamber - int ws = int(m_muonIdHelperTool->tgcIdHelper().isStrip(elementID));//[0:1] + int gasGap = int(m_idHelperSvc->tgcIdHelper().gasGap(elementID)); //increase with |Z|, doublet:[1:2], triplet:[1:3] + int channel = int(m_idHelperSvc->tgcIdHelper().channel(elementID));//channel in a chamber + int ws = int(m_idHelperSvc->tgcIdHelper().isStrip(elementID));//[0:1] // Get indexes for EtaPhi numbering scheme // tgc[0:3] TGC index, gasgap[0:2] GasGap index, @@ -166,7 +166,7 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc int ssize = m_hitIdVects[pcn][ac][ws][eta][phi48][layer].size(); bool multihit_inchannel=false; for(int hit=0;hit<ssize;hit++){ - int ch=m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[pcn][ac][ws][eta][phi48][layer].at(hit)); + int ch=m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[pcn][ac][ws][eta][phi48][layer].at(hit)); if(ch == channel){ multihit_inchannel=true; break; diff --git a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx index 49665ac392fae66b5bd92dcb4d09bc9840f7a2c7..5c1bfadcc485153fb6a587201fb637add6d152c2 100644 --- a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx +++ b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx @@ -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 */ /*************************************************************************** @@ -10,20 +10,8 @@ Modified by lkashif to include determination of chamber corner coordinates ***************************************************************************/ -//<<<<<< INCLUDES >>>>>> - -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" -#include "StoreGate/StoreGateSvc.h" - #include "MuonGMCheckCorners.h" -#include "MuonIdHelpers/MuonIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" #include "MuonReadoutGeometry/CscReadoutElement.h" @@ -31,23 +19,13 @@ #include "MuonReadoutGeometry/TgcReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonStation.h" - #include "MuonReadoutGeometry/TgcReadoutParams.h" #include "TrkSurfaces/Surface.h" #include <fstream> #include <sstream> -typedef std::istringstream mystream; -//<<<<<< PRIVATE DEFINES >>>>>> -//<<<<<< PRIVATE CONSTANTS >>>>>> -//<<<<<< PRIVATE TYPES >>>>>> -//<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> -//<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> -//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> -//<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> -//<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> -//<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> +typedef std::istringstream mystream; MuonGMCheckCorners::MuonGMCheckCorners(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm ( name, pSvcLocator ), @@ -88,791 +66,46 @@ MuonGMCheckCorners::MuonGMCheckCorners(const std::string& name, ISvcLocator* pSv declareProperty("station_index", m_station_index); } -MuonGMCheckCorners::~MuonGMCheckCorners() -{ } - StatusCode MuonGMCheckCorners::initialize() { - StatusCode status = StatusCode::SUCCESS; - - MsgStream ini_log(msgSvc(), name()); - ini_log <<MSG::DEBUG<<" starting up"<<endmsg; + ATH_CHECK(AthAlgorithm::initialize()); + ATH_MSG_DEBUG("MuonGMCheckCorners::initialize()"); // Locate the StoreGateSvc and initialize our local ptr - status = serviceLocator()->service("StoreGateSvc", p_EventStore); - if (!status.isSuccess() || 0 == p_EventStore) { - ini_log << MSG::ERROR << " Could not find StoreGateSvc" << endmsg; - return status; - } - else ini_log << MSG::DEBUG << " StoreGateSvc found" << endmsg; - - // Locate the ActiveStoreSvc and initialize our local ptr - status = serviceLocator()->service("ActiveStoreSvc", p_ActiveStore); - if (!status.isSuccess() || 0 == p_ActiveStore) { - ini_log << MSG::ERROR << " Could not find ActiveStoreSvc" << endmsg; - return status; - } - else ini_log << MSG::DEBUG << " ActiveStoreSvc found" << endmsg; - - - ATH_CHECK(m_idHelperSvc.retrieve()); - - if (status == StatusCode::SUCCESS) { - if (m_check_csc) checkreadoutcscgeo(); - if (m_check_mdt) checkreadoutmdtgeo(); - if (m_check_tgc) checkreadouttgcgeo(); - if (m_check_rpc) checkreadoutrpcgeo(); - if (m_check_rpcrsmap) buildRpcRegionSelectorMap(); - if (m_check_mdtrsmap) buildMdtRegionSelectorMap(); - if (m_check_tgcrsmap) buildTgcRegionSelectorMap(); - if (m_check_parent) checkParentStation(); - } + ATH_CHECK(serviceLocator()->service("StoreGateSvc", p_EventStore)); + ATH_MSG_DEBUG("StoreGateSvc found"); + // Locate the ActiveStoreSvc and initialize our local ptr + ATH_CHECK(serviceLocator()->service("ActiveStoreSvc", p_ActiveStore)); + ATH_MSG_DEBUG("ActiveStoreSvc found"); + + if (m_check_csc) checkreadoutcscgeo(); + if (m_check_mdt) checkreadoutmdtgeo(); + if (m_check_tgc) checkreadouttgcgeo(); + if (m_check_rpc) checkreadoutrpcgeo(); + if (m_check_rpcrsmap) buildRpcRegionSelectorMap(); + if (m_check_mdtrsmap) buildMdtRegionSelectorMap(); + if (m_check_tgcrsmap) buildTgcRegionSelectorMap(); + if (m_check_parent) checkParentStation(); // Access the output file - - if (status == StatusCode::SUCCESS) { NTupleFilePtr file1(ntupleSvc(), "/NTUPLES/FILE1"); NTuplePtr nt(ntupleSvc(), "/NTUPLES/FILE1/10"); if ( !nt ) { // Check if already booked nt = ntupleSvc()->book ("/NTUPLES/FILE1/10", CLID_ColumnWiseTuple, "Coords"); if ( nt ) { - ini_log << MSG::DEBUG << "booked ntuple " << endmsg; - - status = nt->addItem ("ChamberPhi", m_statPhi); - status = nt->addItem ("Multilayer", m_statML); - status = nt->addItem ("Corner", m_MLcorner); - status = nt->addItem ("x", m_x); - status = nt->addItem ("y", m_y); - status = nt->addItem ("z", m_z); + ATH_MSG_DEBUG("booked ntuple"); + ATH_CHECK(nt->addItem ("ChamberPhi", m_statPhi)); + ATH_CHECK(nt->addItem ("Multilayer", m_statML)); + ATH_CHECK(nt->addItem ("Corner", m_MLcorner)); + ATH_CHECK(nt->addItem ("x", m_x)); + ATH_CHECK(nt->addItem ("y", m_y)); + ATH_CHECK(nt->addItem ("z", m_z)); } - } else {ini_log << MSG::INFO <<"Failed to book ntuple"<< endmsg;} + } else { + ATH_MSG_WARNING("Failed to book ntuple"); } - return status; -} - - -StatusCode -MuonGMCheckCorners::execute() -{ - StatusCode status = StatusCode::SUCCESS; - // MsgStream exe_log(msgSvc(), name()); - // // exe_log << MSG::INFO << "m_statPhi" << m_statPhi << endmsg; - // exe_log << MSG::DEBUG << "Executing" << endmsg; - - // std::string gVersion = p_MuonMgr->geometryVersion(); - // std::string fileName = "mdt_current_"+gVersion; - // std::ofstream fout(fileName.c_str()); - // exe_log << MSG::INFO << " ***** Writing file "<< fileName << endmsg; - // fout << setiosflags(std::ios::fixed) << std::setprecision(4)<<std::endl; - - // int n=0; - - // //Array holds [][multilayer][corner][coord] - // double coord[8][256][8][3], l, w, t, wl; - // for (int sname_index = 0; sname_index<MuonDetectorManager::NMdtStatType; ++ sname_index) - - // { - // //int st = sname_index; - // for (int seta_index = 0; seta_index<MuonDetectorManager::NMdtStatEta; ++seta_index) - - // { - // //int zi = seta_index + MuonDetectorManager::NMdtStEtaOffset; - // for (int sphi_index = 0; sphi_index<MuonDetectorManager::NMdtStatPhi; ++sphi_index) - // { - // //int fi = sphi_index + 1; - // for (int dbr_index = 0; dbr_index<MuonDetectorManager::NMdtMultilayer; ++dbr_index) - // { - // const MdtReadoutElement* mdt = p_MuonMgr->getMdtReadoutElement(sname_index, - // seta_index, - // sphi_index, - // dbr_index); - // //std::cerr<<" st_i, zi_i, fi_i, ml_i "<<st<<"/"<<zi<<"/"<<fi<<"/"<<"/"<<dbr_index<<std::endl; - // if (mdt == NULL) continue; - - // //This if block determines what station is being looked at, extracts the chamber dimension and - // //global coordinates of the center from GeoModel, and finds the corner coordinates - - // //Specify the station_index in the jobOption - - // if (sname_index == m_station_index) - // { - // n++; - // fout<<"MLs processed: "<<n-1<<std::endl; - // fout<<" ///////////////////// Found a MdtReadoutElement for indices = " - // <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " - // <<dbr_index - // <<std::endl; - // Identifier idr = mdt->identify(); - // fout<<" its offline hash Id = "<<mdt->identifyHash()<<std::endl; - // fout<<" its offline Id = "<<p_MdtIdHelper->show_to_string(idr) - // <<" ///////////// belongs to module " - // <<mdt->getTechnologyName()<<"/" - // <<mdt->getStationName()<<std::endl; - // Identifier idp = p_MdtIdHelper->parentID(idr); - // fout<<" parent Id = "<<p_MdtIdHelper->show_to_string(idp)<<std::endl; - // HepGeom::Point3D<double> stc = mdt->parentStationPos(); - // const MuonGM::MuonStation* pms __attribute__((unused)) = mdt->parentMuonStation(); - - // fout<<" Multilayer = "<<mdt->getMultilayer(); - // fout<<" N tube layers = "<<mdt->getNLayers(); - // fout<<" tubes/layer = "<<mdt->getNtubesperlayer()<<std::endl; - - // //Set thickness, width and height of multilayer from GeoModel - // t = mdt->getRsize(); - // w = mdt->getSsize(); - // l = mdt->getZsize(); - - // wl = mdt->getLongSsize(); //width of long side for end-cap chambers - - // fout<<" Thickness = "<<t<<", short width = "<<w<<", long width = "<<wl<<", length = "<<l<<std::endl; - - // HepGeom::Point3D<double> elc = mdt->globalPosition(); - // fout<<" Element centre: "<<elc - // <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()<<std::endl<<std::endl; - - // double s = sin(elc.phi()), c = cos(elc.phi()); - // // double x = elc.x(); - // // fout<<"x = "<<x<<std::endl; - - // //End-cap chambers, trapezoidal - // if (m_station_index > 10 && m_station_index != 23) - // { - // if (elc.z() > 0) - // { - // if (fabs(elc.x())<5 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - t/2; - // coord[0][n-1][0][2] = elc.z() - l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + wl/2; - // coord[0][n-1][4][1] = elc.y() + t/2; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] - wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] + wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if (fabs(elc.x())<5 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() - w/2; - // coord[0][n-1][0][1] = elc.y() + t/2; - // coord[0][n-1][0][2] = elc.z() - l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - wl/2; - // coord[0][n-1][4][1] = elc.y() - t/2; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()>5 && elc.y()>5) || (elc.x()>5 && fabs(elc.y())<5) || (elc.x()<-5 && elc.y()<-5) || - // (elc.x()-5 && fabs(elc.y())<5)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() - (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() + (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()<-5 && elc.y()>5) || (elc.x()>5 && elc.y()<-5)) - // { - // coord[0][n-1][0][0] = elc.x() - (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() + (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() - (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - // } //end if over positive z - - // else { - - // if (fabs(elc.x())<5 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - t/2; - // coord[0][n-1][0][2] = elc.z() + l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + wl/2; - // coord[0][n-1][4][1] = elc.y() + t/2; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] - wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] + wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if (fabs(elc.x())<5 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() - w/2; - // coord[0][n-1][0][1] = elc.y() + t/2; - // coord[0][n-1][0][2] = elc.z() + l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - wl/2; - // coord[0][n-1][4][1] = elc.y() - t/2; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()>5 && elc.y()>5) || (elc.x()>5 && fabs(elc.y())<5) || (elc.x()<-5 && elc.y()<-5) || - // (elc.x()-5 && fabs(elc.y())<5)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() - (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() + (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()<-5 && elc.y()>5) || (elc.x()>5 && elc.y()<-5)) - // { - // coord[0][n-1][0][0] = elc.x() - (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() + (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() - (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - // } //end if over negative z - - // } //end if over end-cap chambers - - // //Barrel chambers, rectangular - // if (m_station_index < 13 || m_station_index == 23) - // { - // if (elc.z() < 0) - // { - // if (fabs(elc.x())<0.001 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() - (w/2); - // coord[0][n-1][0][1] = elc.y() + (t/2); - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - - // else if (fabs(elc.x())<0.001 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - (t/2); - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] + t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - // else if ((elc.x()>0.001 && elc.y()>=0) || (elc.x()<-0.001 && elc.y()<=0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - - // else if ((elc.x()<-0.001 && elc.y()>0) || (elc.x()>0.001 && elc.y()<0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() + (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] - w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] + w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - // } //end if over negative z - - // else { - - // if (fabs(elc.x())<0.001 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() - (w/2); - // coord[0][n-1][0][1] = elc.y() + (t/2); - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if (fabs(elc.x())<0.001 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() + (w/2); - // coord[0][n-1][0][1] = elc.y() - (t/2); - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] + t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if ((elc.x()>0.001 && elc.y()>=0) || (elc.x()<-0.001 && elc.y()<=0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if ((elc.x()<-0.001 && elc.y()>0) || (elc.x()>0.001 && elc.y()<0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() + (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] - w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] + w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // } //end if over positive z - // } //end if over barrel chambers - - // for (int i = 0; i<8; i++) - // { - // m_statPhi = (long)elc.phi(); - - // if (idr == idp) m_statML = 1; - // else m_statML = 2; - - // m_MLcorner = i+1; - - // m_x = coord[0][n-1][i][0]; - // m_y = coord[0][n-1][i][1]; - // m_z = coord[0][n-1][i][2]; - // //cout<<"accepted coords"<<endl; - // ntupleSvc()->writeRecord("/NTUPLES/FILE1/10"); - // } - - // fout<<"Corner 1: x= "<<coord[0][n-1][0][0]<<", y= "<<coord[0][n-1][0][1]<<", z= "<<coord[0][n-1][0][2]<<std::endl; - // fout<<"Corner 2: x= "<<coord[0][n-1][1][0]<<", y= "<<coord[0][n-1][1][1]<<", z= "<<coord[0][n-1][1][2]<<std::endl; - // fout<<"Corner 3: x= "<<coord[0][n-1][2][0]<<", y= "<<coord[0][n-1][2][1]<<", z= "<<coord[0][n-1][2][2]<<std::endl; - // fout<<"Corner 4: x= "<<coord[0][n-1][3][0]<<", y= "<<coord[0][n-1][3][1]<<", z= "<<coord[0][n-1][3][2]<<std::endl; - // fout<<"Corner 5: x= "<<coord[0][n-1][4][0]<<", y= "<<coord[0][n-1][4][1]<<", z= "<<coord[0][n-1][4][2]<<std::endl; - // fout<<"Corner 6: x= "<<coord[0][n-1][5][0]<<", y= "<<coord[0][n-1][5][1]<<", z= "<<coord[0][n-1][5][2]<<std::endl; - // fout<<"Corner 7: x= "<<coord[0][n-1][6][0]<<", y= "<<coord[0][n-1][6][1]<<", z= "<<coord[0][n-1][6][2]<<std::endl; - // fout<<"Corner 8: x= "<<coord[0][n-1][7][0]<<", y= "<<coord[0][n-1][7][1]<<", z= "<<coord[0][n-1][7][2]<<std::endl<<std::endl; - // } - - // /* Identifier chid; - // for ( int tl=1; tl<=mdt->getNLayers(); tl++) - // { - // //fout<<" A new tube layer "<<tl<<std::endl; - // int tube = 1; - // chid = p_MdtIdHelper->channelID(idp,mdt->getMultilayer(), tl, tube); - // //fout<<p_MdtIdHelper->show_to_string(chid) - // // <<" wire global pos "<<mdt->tubePos(chid); - // fout<<" Tube length is "<<mdt->tubeLength(chid)<<std::endl; - // }*/ - // } - // } - // } - // } - - return status; -} - -StatusCode -MuonGMCheckCorners::finalize() -{ - StatusCode status = StatusCode::SUCCESS; - - - MsgStream fin_log(msgSvc(), name()); - fin_log << MSG::DEBUG << "Finalizing" << endmsg; - - - return status; + return StatusCode::SUCCESS; } void MuonGMCheckCorners::checkreadoutrpcgeo() diff --git a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h index 3507a7c2d72125034604d4634966742bb1a3e030..df301cd768c699ff1a6939a7c5a9fa1f9d6fa358 100644 --- a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h +++ b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.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 */ /*************************************************************************** @@ -8,51 +8,23 @@ ***************************************************************************/ #ifndef MUONGEOMODEL_MUONGMCHECKCORNERS_H -# define MUONGEOMODEL_MUONGMCHECKCORNERS_H - -//<<<<<< INCLUDES >>>>>> -//<<<<<< PUBLIC DEFINES >>>>>> -//<<<<<< PUBLIC CONSTANTS >>>>>> -//<<<<<< PUBLIC TYPES >>>>>> -//<<<<<< PUBLIC VARIABLES >>>>>> -//<<<<<< PUBLIC FUNCTIONS >>>>>> -//<<<<<< CLASS DECLARATIONS >>>>>> +#define MUONGEOMODEL_MUONGMCHECKCORNERS_H #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/NTuple.h" - -#include "GaudiKernel/ServiceHandle.h" -#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - -class StoreGateSvc; -class ActiveStoreSvc; using namespace MuonGM; -//namespace MuonGM -// { -// class MuonReadoutElement; -// class MuonDetectorManager; -// } - - -//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> -//<<<<<< INLINE MEMBER FUNCTIONS >>>>>> class MuonGMCheckCorners: public AthAlgorithm { public: MuonGMCheckCorners(const std::string& name, ISvcLocator* pSvcLocator); - ~MuonGMCheckCorners(); + ~MuonGMCheckCorners()=default; StatusCode initialize(); - StatusCode execute(); - StatusCode finalize(); + StatusCode execute(){return StatusCode::SUCCESS;} private: @@ -82,8 +54,6 @@ class MuonGMCheckCorners: public AthAlgorithm // Pointers to the event StoreGateSvc* p_EventStore; ActiveStoreSvc* p_ActiveStore; - - ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; void checkreadoutcscgeo(); void checkreadoutrpcgeo(); diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx index 878133b3c2c9c8c8652f514ee927bb1a8daaa2e5..e4ed3633e90397ecd54348cca1cd560b2df8f536 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - //////////////////////////////////////////////////////////////// // // // Implementation of class VP1TrackSystem // @@ -40,13 +39,10 @@ #include "VP1TrackSystems/TrackCollHandle_TrkTrack.h" #include "VP1TrackSystems/TrackCollHandle_TrkSegment.h" -// #include "VP1TrackSystems/TrackCollHandle_FatrasTruthTracks.h" #include "VP1TrackSystems/TrackCollHandle_TruthTracks.h" #include "VP1TrackSystems/TrackCollHandle_SimulationTracks.h" #include "VP1TrackSystems/TrackCollHandle_TrackParticle.h" #include "VP1TrackSystems/TrackCollHandle_xAODTrackParticle.h" -// #include "VP1TrackSystems/TrackCollHandle_Muon.h" -// #include "VP1TrackSystems/TrackCollHandle_Egamma.h" #include "VP1TrackSystems/TrackHandle_TrkTrack.h" #include "VP1TrackSystems/TrackCollHandle_RefittedTracks.h" @@ -73,8 +69,6 @@ #include <Inventor/SoPath.h> #include <Inventor/nodes/SoFont.h> -//#include "TrkEventPrimitives/GlobalPosition.h" -//#include "TrkEventPrimitives/GlobalMomentum.h" #include "TrkEventPrimitives/FitQuality.h" #include <sstream> @@ -101,13 +95,6 @@ #include "VP1Utils/VP1AvailableToolsHelper.h" //////////////////////////////////////////////////////// - -// FOR DEBUG -//#include "MuonIdHelpers/MdtIdHelper.h" -//#include "MuonIdHelpers/MuonIdHelper.h" - - - //____________________________________________________________________ class VP1TrackSystem::Imp { public: