diff --git a/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.cxx b/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.cxx index 38518c1c7da58de58e45ceae82c83d151be58bc3..9e1d11894ee45b31a4dedf572998c391261edb55 100755 --- a/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.cxx +++ b/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.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,7 +19,7 @@ //******************************************************************** -#include "CaloMonitoring/CaloClusterVecMon.h" +#include "CaloClusterVecMon.h" #include "AthenaMonitoring/DQBadLBFilterTool.h" #include "AthenaMonitoring/DQAtlasReadyFilterTool.h" @@ -67,8 +67,6 @@ CaloClusterVecMon::CaloClusterVecMon(const std::string& type, const std::string& { declareInterface<IMonitorToolBase>(this); - declareProperty("CaloClusterContainer", m_clusterContainerName="CaloCalTopoClusters"); - declareProperty("TimeGran",m_timeGran="lowStat"); declareProperty("lowEthresh", m_Ethresh[LOW_E]=0.0); @@ -169,6 +167,8 @@ StatusCode CaloClusterVecMon::initialize() { StatusCode sc = StatusCode::SUCCESS; sc = retrieveTools(); + //Initialize read handle key + ATH_CHECK( m_clusterContainerName.initialize() ); sc = ManagedMonitorToolBase::initialize(); if(sc.isFailure()){ @@ -225,7 +225,7 @@ StatusCode CaloClusterVecMon::bookHistograms(){ bookCellHists(theinterval); bookClusterHists(theinterval); bookClusterStatHists(theinterval); - if( m_clusterContainerName == "CaloCalTopoClusters" ) { + if( m_clusterContainerName.key() == "CaloCalTopoClusters" ) { fillTileHistRange(); bookTileHists(theinterval); } @@ -286,11 +286,11 @@ void CaloClusterVecMon::bookCellHists(const Interval_t theinterval){ if (m_triggerChainProp == "") TheTrigger="NoTrigSel"; else TheTrigger = m_triggerChainProp; - MonGroup cluster_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/General", theinterval); - MonGroup cluster_energytime_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/Time_Energy", theinterval); - MonGroup cluster_leadcell_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/LeadCell", theinterval); + MonGroup cluster_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/General", theinterval); + MonGroup cluster_energytime_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/Time_Energy", theinterval); + MonGroup cluster_leadcell_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/LeadCell", theinterval); - if ( m_clusterContainerName == "LArMuClusterCandidates" ) { + if ( m_clusterContainerName.key() == "LArMuClusterCandidates" ) { m_nCells = new TH1I("NCells","NCellsinCluster",20,0.,20.); }else { m_nCells = new TH1I("NCells","NCellsinCluster",200,0.,200.); @@ -365,16 +365,16 @@ void CaloClusterVecMon::bookClusterHists(const Interval_t theinterval){ if (m_triggerChainProp == "") TheTrigger="NoTrigSel"; else TheTrigger = m_triggerChainProp; - MonGroup cluster_1drates_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/1d_Rates", theinterval); - MonGroup cluster_2drates_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/2d_Rates", theinterval); - MonGroup cluster_2drates_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/2d_Rates", theinterval); - MonGroup cluster_2davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/2d_AvEnergy", theinterval); - MonGroup cluster_2davge_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/2d_AvEnergy", theinterval); - MonGroup cluster_1davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/1d_AvEnergy", theinterval); - MonGroup cluster_2davgEt_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/TransEnergy", theinterval); - MonGroup cluster_2dTotale_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/TotalEnergy", theinterval); - MonGroup cluster_energytime_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/Time_Energy", theinterval); - MonGroup cluster_SummaryGroup_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/Summary", theinterval); + MonGroup cluster_1drates_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/1d_Rates", theinterval); + MonGroup cluster_2drates_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/2d_Rates", theinterval); + MonGroup cluster_2drates_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/2d_Rates", theinterval); + MonGroup cluster_2davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/2d_AvEnergy", theinterval); + MonGroup cluster_2davge_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/2d_AvEnergy", theinterval); + MonGroup cluster_1davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/1d_AvEnergy", theinterval); + MonGroup cluster_2davgEt_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/TransEnergy", theinterval); + MonGroup cluster_2dTotale_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/TotalEnergy", theinterval); + MonGroup cluster_energytime_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/Time_Energy", theinterval); + MonGroup cluster_SummaryGroup_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/Summary", theinterval); bookBaseHists(&cluster_SummaryGroup_expert).ignore(); //from base class @@ -567,18 +567,18 @@ void CaloClusterVecMon::bookClusterStatHists(const Interval_t theinterval){ if (m_triggerChainProp == "") TheTrigger="NoTrigSel"; else TheTrigger = m_triggerChainProp; - MonGroup cluster_2davgEt_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/TransEnergy", theinterval); - MonGroup cluster_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/General", theinterval); - MonGroup cluster_2davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/2d_AvEnergy", theinterval); + MonGroup cluster_2davgEt_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/TransEnergy", theinterval); + MonGroup cluster_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/General", theinterval); + MonGroup cluster_2davge_expert ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/2d_AvEnergy", theinterval); if (m_dataType == AthenaMonManager::cosmics ){ - if ( m_clusterContainerName == "LArMuClusterCandidates" ) { + if ( m_clusterContainerName.key() == "LArMuClusterCandidates" ) { m_nClusters = new TH1I("NClus","NCluster",200,0,200); }else { m_nClusters = new TH1I("NClus","NCluster",50,0,50); } }else { - if ( m_clusterContainerName == "EMTopoCluster" ){ + if ( m_clusterContainerName.key() == "EMTopoCluster" ){ m_nClusters = new TH1I("NClus","NCluster",300,0,300); }else { m_nClusters = new TH1I("NClus","NCluster",600,0,600); @@ -644,7 +644,7 @@ void CaloClusterVecMon::bookTileHists(const Interval_t theinterval){ if (m_triggerChainProp == "") TheTrigger="NoTrigSel"; else TheTrigger = m_triggerChainProp; - MonGroup tile_cluster_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName+TheTrigger+"/General", theinterval); //SHIFT + MonGroup tile_cluster_shift ( this, "/CaloMonitoring/ClusterMon/"+m_clusterContainerName.key()+TheTrigger+"/General", theinterval); //SHIFT m_clustersCellsRatioEta = new TProfile("TileCalXRatioXEta","Ratio: cluster E/ cluster cells",(int)m_binRangeEta[0],m_binRangeEta[1], m_binRangeEta[2]); m_clustersCellsRatioEta->GetXaxis()->SetTitle("Eta"); @@ -707,12 +707,9 @@ StatusCode CaloClusterVecMon::fillHistograms() { sc = checkFilters(ifPass); if(sc.isFailure() || !ifPass) return StatusCode::SUCCESS; - const xAOD::CaloClusterContainer* clusterCont = nullptr; - sc=evtStore()->retrieve( clusterCont, m_clusterContainerName); - if( sc.isFailure() || !clusterCont ) { - ATH_MSG_WARNING( "No CaloCluster container found in TDS"); - return sc; - } + SG::ReadHandle<xAOD::CaloClusterContainer> clusterContHandle{m_clusterContainerName}; + if (! clusterContHandle.isValid()) { ATH_MSG_WARNING("No CaloCluster container found in TDS"); return StatusCode::FAILURE; } + const xAOD::CaloClusterContainer* clusterCont = clusterContHandle.get(); initCounter(); @@ -734,7 +731,7 @@ StatusCode CaloClusterVecMon::fillHistograms() { fillClusterStatHist(clusterCont); - if( m_clusterContainerName == "CaloCalTopoClusters" ) fillTileHist(clusterCont); + if( m_clusterContainerName.key() == "CaloCalTopoClusters" ) fillTileHist(clusterCont); return sc; } diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/CaloClusterVecMon.h b/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.h similarity index 96% rename from Calorimeter/CaloMonitoring/CaloMonitoring/CaloClusterVecMon.h rename to Calorimeter/CaloMonitoring/src/CaloClusterVecMon.h index 8ae3c45e9367ef6330173018a099459e2e576af4..45420690513b4614379c3c23977ecca74298b3ca 100755 --- a/Calorimeter/CaloMonitoring/CaloMonitoring/CaloClusterVecMon.h +++ b/Calorimeter/CaloMonitoring/src/CaloClusterVecMon.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 */ // ******************************************************************** @@ -16,7 +16,7 @@ #ifndef CALOClusterVecMon_H #define CALOClusterVecMon_H -#include "CaloMonitoring/CaloMonToolBase.h" +#include "CaloMonToolBase.h" #include "GaudiKernel/ToolHandle.h" @@ -90,7 +90,7 @@ class CaloClusterVecMon : public CaloMonToolBase { }; // CaloClusterContainer name - std::string m_clusterContainerName; + SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clusterContainerName{ this, "CaloClusterContainer", "CaloCalTopoClusters" }; // Time granularity std::string m_timeGran; diff --git a/Calorimeter/CaloMonitoring/src/CaloMonToolBase.cxx b/Calorimeter/CaloMonitoring/src/CaloMonToolBase.cxx index f5fdee62837c02cf0e69c745a25d7f70f824dae1..e1815f657026a59579bab452d25eeace2c360599 100644 --- a/Calorimeter/CaloMonitoring/src/CaloMonToolBase.cxx +++ b/Calorimeter/CaloMonitoring/src/CaloMonToolBase.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "CaloMonitoring/CaloMonToolBase.h" +#include "CaloMonToolBase.h" #include "xAODEventInfo/EventInfo.h" #include "LArRecEvent/LArCollisionTime.h" #include "RecBackgroundEvent/BeamBackgroundData.h" diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/CaloMonToolBase.h b/Calorimeter/CaloMonitoring/src/CaloMonToolBase.h similarity index 100% rename from Calorimeter/CaloMonitoring/CaloMonitoring/CaloMonToolBase.h rename to Calorimeter/CaloMonitoring/src/CaloMonToolBase.h diff --git a/Calorimeter/CaloMonitoring/src/CaloTowerVecMon.cxx b/Calorimeter/CaloMonitoring/src/CaloTowerVecMon.cxx index a14a847faf99dc972d3e42e7f864af005521f37c..050ba9d02af8209fbd8933f2e414256489fec884 100755 --- a/Calorimeter/CaloMonitoring/src/CaloTowerVecMon.cxx +++ b/Calorimeter/CaloMonitoring/src/CaloTowerVecMon.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,7 +13,7 @@ // D. Hu (Jun 2011 - May 2012) // L. Sawyer (Dec 2013 - ) // ******************************************************************** -#include "CaloMonitoring/CaloTowerVecMon.h" +#include "CaloTowerVecMon.h" #include "AthenaMonitoring/DQBadLBFilterTool.h" #include "AthenaMonitoring/DQAtlasReadyFilterTool.h" diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/CaloTowerVecMon.h b/Calorimeter/CaloMonitoring/src/CaloTowerVecMon.h similarity index 100% rename from Calorimeter/CaloMonitoring/CaloMonitoring/CaloTowerVecMon.h rename to Calorimeter/CaloMonitoring/src/CaloTowerVecMon.h diff --git a/Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.cxx b/Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.cxx index c11b12812825265dd01ae24ab7f5bc6514769ec6..2cb61e262dd1cc2b209ecfb3ca2fd1a1fd46ac4f 100755 --- a/Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.cxx +++ b/Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.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 */ // ******************************************************************** @@ -11,7 +11,7 @@ //******************************************************************** -#include "CaloMonitoring/CaloTransverseBalanceVecMon.h" +#include "CaloTransverseBalanceVecMon.h" #include "xAODEventInfo/EventInfo.h" diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/CaloTransverseBalanceVecMon.h b/Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.h similarity index 100% rename from Calorimeter/CaloMonitoring/CaloMonitoring/CaloTransverseBalanceVecMon.h rename to Calorimeter/CaloMonitoring/src/CaloTransverseBalanceVecMon.h diff --git a/Calorimeter/CaloMonitoring/src/LArCellBinning.cxx b/Calorimeter/CaloMonitoring/src/LArCellBinning.cxx index a5f4927aced29ad1b202708b0900f95ea4ebc50b..957b19207bf045bccd3e8217a8cbf3f1b621c4d2 100644 --- a/Calorimeter/CaloMonitoring/src/LArCellBinning.cxx +++ b/Calorimeter/CaloMonitoring/src/LArCellBinning.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // *********************************************************** @@ -9,7 +9,7 @@ // LArCellMonTools class // // *********************************************************** -#include "CaloMonitoring/LArCellBinning.h" +#include "LArCellBinning.h" #include <iostream> #include "TMath.h" diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellBinning.h b/Calorimeter/CaloMonitoring/src/LArCellBinning.h similarity index 100% rename from Calorimeter/CaloMonitoring/CaloMonitoring/LArCellBinning.h rename to Calorimeter/CaloMonitoring/src/LArCellBinning.h diff --git a/Calorimeter/CaloMonitoring/src/LArCellMonAlg.h b/Calorimeter/CaloMonitoring/src/LArCellMonAlg.h index 8617b0a2cf24fec14b3daa96219010d2f5560031..24a2d7a694089e73485b1ab91d29bfa302c1a212 100644 --- a/Calorimeter/CaloMonitoring/src/LArCellMonAlg.h +++ b/Calorimeter/CaloMonitoring/src/LArCellMonAlg.h @@ -20,7 +20,7 @@ #include "TrigDecisionTool/TrigDecisionTool.h" -#include "CaloMonitoring/LArCellBinning.h" +#include "LArCellBinning.h" #include <vector> #include <string> diff --git a/Calorimeter/CaloMonitoring/src/LArCellMonSetBinning.cxx b/Calorimeter/CaloMonitoring/src/LArCellMonSetBinning.cxx index 3aaf9be6f91c310c0a2e50d1a28f6d6c1a875d6c..d7f8271769df8d8a873b42b1d57aa7a13eb3a867 100644 --- a/Calorimeter/CaloMonitoring/src/LArCellMonSetBinning.cxx +++ b/Calorimeter/CaloMonitoring/src/LArCellMonSetBinning.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "CaloMonitoring/LArCellMonTool.h" +#include "LArCellMonTool.h" using namespace CaloMonitoring; void LArCellMonTool::setLArCellBinning() { diff --git a/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx b/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx index f72bd2ec8ada686c0ac8f819c063dc266a1a889f..4c4d89b00d06d5dc6795c0a12385e51086f16686 100644 --- a/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx +++ b/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // NAME: LArCellMonTool.cxx // W.Lampl - Spring 2017: Major re-design // ******************************************************************** -#include "CaloMonitoring/LArCellMonTool.h" +#include "LArCellMonTool.h" #include "LArRecConditions/LArBadChannel.h" #include "LArRecConditions/LArBadChanBitPacking.h" @@ -51,9 +51,6 @@ LArCellMonTool::LArCellMonTool(const std::string& type, const std::string& name, declareProperty("DoSaveTempHists",m_doSaveTempHists=false,"Store temporary, intermediate histograms in a /Temp/ directory (for debugging"); - // CaloCellContainer name - declareProperty("CaloCellContainer", m_cellContainerName="AllCalo","SG key of the input cell container"); - // tools declareProperty("useElectronicNoiseOnly",m_useElectronicNoiseOnly=false,"Consider only electronic noise and ignore pile-up contributiuon)"); declareProperty("CaloNoiseTool",m_noiseTool,"Tool Handle for noise Tool"); @@ -150,7 +147,7 @@ LArCellMonTool::~LArCellMonTool() { //////////////////////////////////////////// StatusCode LArCellMonTool::initialize() { - ATH_MSG_INFO("LArCellMonTool::initialize() start"); + ATH_MSG_DEBUG("LArCellMonTool::initialize() start"); //Identfier-helpers ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") ); @@ -207,11 +204,14 @@ StatusCode LArCellMonTool::initialize() { //Fill the LArCellBinning for each layer setLArCellBinning(); + //Initialize read handle key + ATH_CHECK( m_cellContainerName.initialize() ); + //Call base-call initialize methods ATH_CHECK( ManagedMonitorToolBase::initialize() ); ATH_CHECK( CaloMonToolBase::initialize() ); - ATH_MSG_INFO("LArCellMonTool::initialize() is done!"); + ATH_MSG_DEBUG("LArCellMonTool::initialize() is done!"); return StatusCode::SUCCESS; } @@ -660,8 +660,9 @@ StatusCode LArCellMonTool::fillHistograms(){ return StatusCode::FAILURE; } - const CaloCellContainer* cellCont = nullptr; - ATH_CHECK(evtStore()->retrieve(cellCont, m_cellContainerName)); + SG::ReadHandle<CaloCellContainer> cellContHandle{m_cellContainerName}; + if (! cellContHandle.isValid()) { return StatusCode::FAILURE; } + const CaloCellContainer* cellCont = cellContHandle.get(); if (!m_oncePerJobHistosDone) { ATH_CHECK(createPerJobHistograms(cellCont)); diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h b/Calorimeter/CaloMonitoring/src/LArCellMonTool.h similarity index 98% rename from Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h rename to Calorimeter/CaloMonitoring/src/LArCellMonTool.h index ea2539c5bcda564831dee5759a6c50a1be6722ec..820eaec12634cbea183718d669cb5a9607d08011 100644 --- a/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h +++ b/Calorimeter/CaloMonitoring/src/LArCellMonTool.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*-c++-*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -10,7 +10,7 @@ #ifndef CALOMONITORING_LARCELLMONTOOL_H #define CALOMONITORING_LARCELLMONTOOL_H -#include "CaloMonitoring/CaloMonToolBase.h" +#include "CaloMonToolBase.h" #include "GaudiKernel/ToolHandle.h" #include "LArRecConditions/ILArBadChannelMasker.h" @@ -25,7 +25,7 @@ #include "TrigDecisionTool/TrigDecisionTool.h" -#include "CaloMonitoring/LArCellBinning.h" +#include "LArCellBinning.h" #include <vector> #include <string> @@ -155,7 +155,7 @@ private: //Job Properties and other private variables bool m_oncePerJobHistosDone=false; - std::string m_cellContainerName; + SG::ReadHandleKey<CaloCellContainer> m_cellContainerName { this, "CaloCellContainer", "AllCalo", "SG key of the input cell container" }; bool m_useElectronicNoiseOnly; ICalorimeterNoiseTool::CalorimeterNoiseType m_noiseType=ICalorimeterNoiseTool::TOTALNOISE; diff --git a/Calorimeter/CaloMonitoring/src/ROIMon.cxx b/Calorimeter/CaloMonitoring/src/ROIMon.cxx index eb7922932829d9d19ef1ea70d251d715cf7fe4eb..81c04d2710313a711ea5666b7c326724b6440888 100755 --- a/Calorimeter/CaloMonitoring/src/ROIMon.cxx +++ b/Calorimeter/CaloMonitoring/src/ROIMon.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 */ // ******************************************************************** @@ -7,7 +7,7 @@ // // AUTHORS: F Spano' 06/15/2006 // ******************************************************************** -#include "CaloMonitoring/ROIMon.h" +#include "ROIMon.h" #include <stdint.h> #include <algorithm> diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/ROIMon.h b/Calorimeter/CaloMonitoring/src/ROIMon.h similarity index 92% rename from Calorimeter/CaloMonitoring/CaloMonitoring/ROIMon.h rename to Calorimeter/CaloMonitoring/src/ROIMon.h index ef46a04be7581511026e7af9d1d75e0bbcbc8a36..e1c9419051461177618920c7fc7df680116b8bc9 100755 --- a/Calorimeter/CaloMonitoring/CaloMonitoring/ROIMon.h +++ b/Calorimeter/CaloMonitoring/src/ROIMon.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 */ //=========================== diff --git a/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.cxx b/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.cxx index 87db9b1fc2f7a2596243cd8982a2d2b9ceb4c108..4692e5028c151a6d032a2b2edd64792e1f91a644 100644 --- a/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.cxx +++ b/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.cxx @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // NAME: TileCalCellMonTool.cxx -#include "CaloMonitoring/TileCalCellMonTool.h" +#include "TileCalCellMonTool.h" #include "CaloIdentifier/TileID.h" @@ -33,9 +33,6 @@ TileCalCellMonTool::TileCalCellMonTool(const std::string& type, const std::strin { declareInterface<IMonitorToolBase>(this); - // CaloCellContainer name - declareProperty("CaloCellContainer", m_cellContainerName="AllCalo","SG key of the input cell container"); - // tools declareProperty("useElectronicNoiseOnly",m_useElectronicNoiseOnly=false,"Consider only electronic noise and ignore pile-up contributiuon)"); declareProperty("useTwoGaus", m_useTwoGaus=true,"Use double-gaussian noise description for Tile-cells"); @@ -55,7 +52,7 @@ TileCalCellMonTool::~TileCalCellMonTool() { //////////////////////////////////////////// StatusCode TileCalCellMonTool::initialize() { - ATH_MSG_INFO("TileCalCellMonTool::initialize() start"); + ATH_MSG_DEBUG("TileCalCellMonTool::initialize() start"); ATH_CHECK( detStore()->retrieve(m_tile_id) ); @@ -71,11 +68,13 @@ StatusCode TileCalCellMonTool::initialize() { initParam(); - + //Initialize read handle key + ATH_CHECK( m_cellContainerName.initialize() ); + ATH_CHECK( ManagedMonitorToolBase::initialize() ); ATH_CHECK( CaloMonToolBase::initialize() ); - ATH_MSG_INFO("TileCalCellMonTool::initialize() is done!"); + ATH_MSG_DEBUG("TileCalCellMonTool::initialize() is done!"); return StatusCode::SUCCESS; } @@ -299,12 +298,9 @@ StatusCode TileCalCellMonTool::fillHistograms(){ // CaloCell info //============================ - const CaloCellContainer* cellCont = nullptr; - sc=evtStore()->retrieve(cellCont, m_cellContainerName); - if( sc.isFailure() || !cellCont ) { - ATH_MSG_WARNING("No CaloCell container found in TDS"); - return sc; - } + SG::ReadHandle<CaloCellContainer> cellContHandle{m_cellContainerName}; + if (! cellContHandle.isValid()) { ATH_MSG_WARNING("No CaloCell container found in TDS"); return StatusCode::FAILURE; } + const CaloCellContainer* cellCont = cellContHandle.get(); CaloCellContainer::const_iterator it = cellCont->beginConstCalo(CaloCell_ID::TILE); diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/TileCalCellMonTool.h b/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.h similarity index 92% rename from Calorimeter/CaloMonitoring/CaloMonitoring/TileCalCellMonTool.h rename to Calorimeter/CaloMonitoring/src/TileCalCellMonTool.h index 299ff376687e9fd5da1493a06c704031fd6cf261..8679cbee697bb54acc0130b94ccbad5be1af0af7 100644 --- a/Calorimeter/CaloMonitoring/CaloMonitoring/TileCalCellMonTool.h +++ b/Calorimeter/CaloMonitoring/src/TileCalCellMonTool.h @@ -1,13 +1,13 @@ //Dear emacs, this is -*-c++-*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TILEMONTOOL_H #define TILEMONTOOL_H -#include "CaloMonitoring/CaloMonToolBase.h" +#include "CaloMonToolBase.h" #include "GaudiKernel/ToolHandle.h" @@ -47,7 +47,7 @@ private: void getRMSdevNoise(TProfile *t1, TProfile *t2, TH1F *t3); //Job Properties and other private variables - std::string m_cellContainerName; + SG::ReadHandleKey<CaloCellContainer> m_cellContainerName { this, "CaloCellContainer", "AllCalo", "SG key of the input cell container" }; bool m_useElectronicNoiseOnly; bool m_useTwoGaus; diff --git a/Calorimeter/CaloMonitoring/src/components/CaloMonitoring_entries.cxx b/Calorimeter/CaloMonitoring/src/components/CaloMonitoring_entries.cxx index 6d47955193bf9075eed4cdca33cb40dafcd623a0..c6da5d71d1e531d170c5b1be1dcb0adc0abdb90a 100755 --- a/Calorimeter/CaloMonitoring/src/components/CaloMonitoring_entries.cxx +++ b/Calorimeter/CaloMonitoring/src/components/CaloMonitoring_entries.cxx @@ -1,8 +1,8 @@ -#include "CaloMonitoring/LArCellMonTool.h" -#include "CaloMonitoring/TileCalCellMonTool.h" -#include "CaloMonitoring/CaloClusterVecMon.h" -#include "CaloMonitoring/CaloTowerVecMon.h" -#include "CaloMonitoring/CaloTransverseBalanceVecMon.h" +#include "../LArCellMonTool.h" +#include "../TileCalCellMonTool.h" +#include "../CaloClusterVecMon.h" +#include "../CaloTowerVecMon.h" +#include "../CaloTransverseBalanceVecMon.h" #include "../CaloBaselineMonAlg.h" #include "../TileCalCellMonAlg.h" #include "../LArCellMonAlg.h" diff --git a/ForwardDetectors/LUCID/LUCID_Monitoring/CMakeLists.txt b/ForwardDetectors/LUCID/LUCID_Monitoring/CMakeLists.txt index 3cec6e9f4fe7f02751129764313ca9a8fde881c7..985ca52ac1c770f2d392dc860cdaf8fbd4317ebe 100644 --- a/ForwardDetectors/LUCID/LUCID_Monitoring/CMakeLists.txt +++ b/ForwardDetectors/LUCID/LUCID_Monitoring/CMakeLists.txt @@ -23,6 +23,5 @@ atlas_add_component( LUCID_Monitoring LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib LUCID_RawEvent GaudiKernel ) # Install files from the package: -atlas_install_headers( LUCID_Monitoring ) atlas_install_joboptions( share/*.py ) diff --git a/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.cxx b/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.cxx index b0edd2ff0319d2d561e301e6bbc804334293192c..e37c24136b575d365a58c2c9e75c12b49512d4a3 100644 --- a/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.cxx +++ b/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.cxx @@ -1,27 +1,27 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <sstream> -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" - -#include "AthenaMonitoring/AthenaMonManager.h" -#include "LUCID_Monitoring/LUCID_HitsMoniTool.h" +#include "LUCID_HitsMoniTool.h" LUCID_HitsMoniTool::LUCID_HitsMoniTool(const std::string& type, const std::string& name, const IInterface* parent): ManagedMonitorToolBase(type, name, parent) { - m_LUCID_RawDataContainer = 0; } LUCID_HitsMoniTool::~LUCID_HitsMoniTool() {} +StatusCode LUCID_HitsMoniTool::initialize() { + ATH_CHECK( ManagedMonitorToolBase::initialize() ); + ATH_CHECK( m_LUCID_RawDataContainerKey.initialize() ); + return StatusCode::SUCCESS; +} + StatusCode LUCID_HitsMoniTool::bookHistograms() { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " LUCID_HitsMoniTool::bookHistograms " << endmsg; + ATH_MSG_DEBUG(" LUCID_HitsMoniTool::bookHistograms "); m_LUCID_Histos.clear(); @@ -103,30 +103,27 @@ StatusCode LUCID_HitsMoniTool::bookHistograms() { StatusCode LUCID_HitsMoniTool::fillHistograms() { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " LUCID_HitsMoniTool::fillHistograms " << endmsg; + ATH_MSG_DEBUG(" LUCID_HitsMoniTool::fillHistograms "); - StatusCode sc = evtStore()->retrieve(m_LUCID_RawDataContainer, "Lucid_RawData"); + SG::ReadHandle<LUCID_RawDataContainer> rawdata{m_LUCID_RawDataContainerKey}; - if (sc.isFailure()) { if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << " Could not retireved LUCID_RawDataContainer from StoreGate " << endmsg; return sc; } - else if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " LUCID_RawDataContainer is retireved from StoreGate " << endmsg; - - LUCID_RawDataContainer::const_iterator LUCID_RawData_itr = m_LUCID_RawDataContainer->begin(); - LUCID_RawDataContainer::const_iterator LUCID_RawData_end = m_LUCID_RawDataContainer->end(); + if (!rawdata.isValid()) { ATH_MSG_WARNING(" Could not retireved LUCID_RawDataContainer from StoreGate "); return StatusCode::FAILURE; } + else ATH_MSG_DEBUG(" LUCID_RawDataContainer is retireved from StoreGate "); - for (; LUCID_RawData_itr != LUCID_RawData_end; LUCID_RawData_itr++) { + for (const auto& LUCID_RawData_itr : *rawdata) { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << (*LUCID_RawData_itr); + ATH_MSG_DEBUG(LUCID_RawData_itr); for (int bxID=0; bxID<3; bxID++) { for (int tub=0; tub<m_nLucidTubes; tub++) { - bool isTubeFired = (*LUCID_RawData_itr)->isTubeFired(tub, bxID); + bool isTubeFired = LUCID_RawData_itr->isTubeFired(tub, bxID); - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) - << " bxID: " << std::setw(10) << bxID + ATH_MSG_DEBUG( + " bxID: " << std::setw(10) << bxID << " tub: " << std::setw(10) << tub << " fire: " << std::setw(10) << isTubeFired - << endmsg; + ); if (isTubeFired) m_LUCID_Histos[bxID]->Fill(tub); } @@ -135,8 +132,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { int hitsA, hitsC, hitsT; bool coinFlag; - hitsA = (*LUCID_RawData_itr)->getNhitsPMTsideA(); - hitsC = (*LUCID_RawData_itr)->getNhitsPMTsideC(); + hitsA = LUCID_RawData_itr->getNhitsPMTsideA(); + hitsC = LUCID_RawData_itr->getNhitsPMTsideC(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -148,8 +145,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { m_LUCID_Histos[7]->Fill(hitsC*coinFlag); m_LUCID_Histos[8]->Fill(hitsT*coinFlag); - hitsA = (*LUCID_RawData_itr)->getNhitsFIBsideA(); - hitsC = (*LUCID_RawData_itr)->getNhitsFIBsideC(); + hitsA = LUCID_RawData_itr->getNhitsFIBsideA(); + hitsC = LUCID_RawData_itr->getNhitsFIBsideC(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -161,8 +158,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { m_LUCID_Histos[13]->Fill(hitsC*coinFlag); m_LUCID_Histos[14]->Fill(hitsT*coinFlag); - hitsA = (*LUCID_RawData_itr)->getNhitsPMTsideAprevBX(); - hitsC = (*LUCID_RawData_itr)->getNhitsPMTsideCprevBX(); + hitsA = LUCID_RawData_itr->getNhitsPMTsideAprevBX(); + hitsC = LUCID_RawData_itr->getNhitsPMTsideCprevBX(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -174,8 +171,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { m_LUCID_Histos[19]->Fill(hitsC*coinFlag); m_LUCID_Histos[20]->Fill(hitsT*coinFlag); - hitsA = (*LUCID_RawData_itr)->getNhitsFIBsideAprevBX(); - hitsC = (*LUCID_RawData_itr)->getNhitsFIBsideCprevBX(); + hitsA = LUCID_RawData_itr->getNhitsFIBsideAprevBX(); + hitsC = LUCID_RawData_itr->getNhitsFIBsideCprevBX(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -187,8 +184,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { m_LUCID_Histos[25]->Fill(hitsC*coinFlag); m_LUCID_Histos[26]->Fill(hitsT*coinFlag); - hitsA = (*LUCID_RawData_itr)->getNhitsPMTsideAnextBX(); - hitsC = (*LUCID_RawData_itr)->getNhitsPMTsideCnextBX(); + hitsA = LUCID_RawData_itr->getNhitsPMTsideAnextBX(); + hitsC = LUCID_RawData_itr->getNhitsPMTsideCnextBX(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -200,8 +197,8 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { m_LUCID_Histos[31]->Fill(hitsC*coinFlag); m_LUCID_Histos[32]->Fill(hitsT*coinFlag); - hitsA = (*LUCID_RawData_itr)->getNhitsFIBsideAnextBX(); - hitsC = (*LUCID_RawData_itr)->getNhitsFIBsideCnextBX(); + hitsA = LUCID_RawData_itr->getNhitsFIBsideAnextBX(); + hitsC = LUCID_RawData_itr->getNhitsFIBsideCnextBX(); hitsT = hitsA + hitsC; coinFlag = (hitsA>0 && hitsC>0); @@ -219,11 +216,11 @@ StatusCode LUCID_HitsMoniTool::fillHistograms() { StatusCode LUCID_HitsMoniTool::procHistograms() { - if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << " LUCID_HitsMoniTool::procHistograms " << endmsg; + ATH_MSG_DEBUG(" LUCID_HitsMoniTool::procHistograms "); if (endOfRunFlag()) { - msg(MSG::DEBUG) << " m_nEvents: " << m_nEvents << endmsg; + ATH_MSG_DEBUG(" m_nEvents: " << m_nEvents); for (int bxID=0; bxID<3; bxID++) m_LUCID_Histos[18+bxID]->Scale(1./m_nEvents); } diff --git a/ForwardDetectors/LUCID/LUCID_Monitoring/LUCID_Monitoring/LUCID_HitsMoniTool.h b/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.h similarity index 67% rename from ForwardDetectors/LUCID/LUCID_Monitoring/LUCID_Monitoring/LUCID_HitsMoniTool.h rename to ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.h index cb78a7c5d52a5f760575bbd06fa708e3a9479e1e..129a02bed026b8e7a14363b6ffcc2fe7fe9d5e9c 100644 --- a/ForwardDetectors/LUCID/LUCID_Monitoring/LUCID_Monitoring/LUCID_HitsMoniTool.h +++ b/ForwardDetectors/LUCID/LUCID_Monitoring/src/LUCID_HitsMoniTool.h @@ -23,13 +23,14 @@ class LUCID_HitsMoniTool: public ManagedMonitorToolBase { virtual ~LUCID_HitsMoniTool(); - virtual StatusCode bookHistograms(); - virtual StatusCode fillHistograms(); - virtual StatusCode procHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; + virtual StatusCode fillHistograms() override; + virtual StatusCode procHistograms() override; protected: - const LUCID_RawDataContainer* m_LUCID_RawDataContainer; + SG::ReadHandleKey<LUCID_RawDataContainer> m_LUCID_RawDataContainerKey{this, "RawDataKey", "Lucid_RawData"}; std::vector<TH1F*> m_LUCID_Histos; diff --git a/ForwardDetectors/LUCID/LUCID_Monitoring/src/components/LUCID_Monitoring_entries.cxx b/ForwardDetectors/LUCID/LUCID_Monitoring/src/components/LUCID_Monitoring_entries.cxx index 05a53b223f91b34592ef66e9ecf442311b99ba53..d7328a31be7af1ba497dab15632b101b6dbd32ea 100644 --- a/ForwardDetectors/LUCID/LUCID_Monitoring/src/components/LUCID_Monitoring_entries.cxx +++ b/ForwardDetectors/LUCID/LUCID_Monitoring/src/components/LUCID_Monitoring_entries.cxx @@ -1,3 +1,3 @@ -#include "LUCID_Monitoring/LUCID_HitsMoniTool.h" +#include "../LUCID_HitsMoniTool.h" DECLARE_COMPONENT( LUCID_HitsMoniTool ) diff --git a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py index 4ef34f1cf866dd75643b49af943391ee6a5be18b..577deebb141c5d7b11cca1b954c274f34bd8ac0b 100755 --- a/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetAlignExample/ErrorScaling/InDetMonitoringAlignment.py @@ -108,7 +108,7 @@ if not jobproperties.Beam.beamType()=='cosmics': from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import InDetAlignMonBeamSpot InDetAlignMonBeamSpot_noTrig = InDetAlignMonBeamSpot (name = "InDetAlignMonBeamSpot_noTrig", extrapolator = InDetExtrapolator, - vxContainerName = InDetKeys.PrimaryVertices(), + vxContainerName = InDetKeys.xAODVertexContainer(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) #ToolSvc += InDetAlignMonBeamSpot_noTrig @@ -232,7 +232,7 @@ if (InDetFlags.doPrintConfigurables()): from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import IDAlignMonGenericTracks InDetAlignMonGenericTracks_noTrig = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks_noTrig", trackSelection = m_alignMonTrackSelectionTool[1], - VxPrimContainerName = InDetKeys.PrimaryVertices()) + VxPrimContainerName = InDetKeys.xAODVertexContainer()) if jobproperties.Beam.beamType()=='cosmics' or jobproperties.Beam.beamType()=='singlebeam': InDetAlignMonGenericTracks_noTrig.tracksName = InDetKeys.Tracks() @@ -375,10 +375,10 @@ else: InDetAlignMonGenericTracks = IDAlignMonGenericTracks (name = "InDetAlignMonGenericTracks", trackSelection = m_alignMonTrackSelectionTool[1], tracksName = InDetKeys.ExtendedTracks(), - VxPrimContainerName = InDetKeys.PrimaryVertices()) + VxPrimContainerName = InDetKeys.xAODVertexContainer()) InDetAlignMonBeamSpot = InDetAlignMonBeamSpot (name = "InDetAlignMonBeamSpot", - vxContainerName = InDetKeys.PrimaryVertices(), + vxContainerName = InDetKeys.xAODVertexContainer(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) if jobproperties.Beam.beamType()=='collisions': diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py index 98c7273852edcb93b88f8fa7718bcf042a5e6e7d..13db06af68b8a4ecebe8fa933d574b1b011056ce 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringAlignment.py @@ -111,7 +111,7 @@ if not jobproperties.Beam.beamType()=='cosmics': from InDetAlignmentMonitoring.InDetAlignmentMonitoringConf import InDetAlignMonBeamSpot InDetAlignMonBeamSpot_noTrig = InDetAlignMonBeamSpot (name = "InDetAlignMonBeamSpot_noTrig", extrapolator = InDetExtrapolator, - vxContainerName = InDetKeys.PrimaryVertices(), + vxContainerName = InDetKeys.xAODVertexContainer(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) #ToolSvc += InDetAlignMonBeamSpot_noTrig @@ -387,7 +387,7 @@ else: VxPrimContainerName = InDetKeys.xAODVertexContainer()) InDetAlignMonBeamSpot = InDetAlignMonBeamSpot (name = "InDetAlignMonBeamSpot", - vxContainerName = InDetKeys.PrimaryVertices(), + vxContainerName = InDetKeys.xAODVertexContainer(), vxContainerWithBeamConstraint = InDetFlags.useBeamConstraint()) if jobproperties.Beam.beamType()=='collisions': diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py index 7cfffe1a31d91e2ee54359a3b677051eca4eb700..619dd1fbbcf78679ebc82d5eeb96abd92c544db9 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringGlobal.py @@ -213,7 +213,7 @@ if InDetFlags.doMonitoringGlobal() or InDetFlags.doMonitoringPrimaryVertexingEnh if InDetFlags.doMonitoringGlobal(): from InDetVertexMonitoring.InDetVertexMonitoringConf import InDetVertexMonitoring InDetVertexMonitoring = InDetVertexMonitoring( name = "InDetVertexMonitoring", - VertexContainer = InDetKeys.PrimaryVertices(), + VertexContainer = InDetKeys.xAODVertexContainer(), DoControlPlots = False, histFolder = "InDetGlobal/PrimaryVertexMultiplicity" ) diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py index 1b42891a27f2e84836aa480aeda9b3ba4976c56e..fc9c9a0f08e7cc54890bd01b252ff1a5e73febcc 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringPixel.py @@ -81,6 +81,9 @@ if doErrorMonAlg: pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(PixelAthErrorMonAlg, 'PixelAthErrorMonAlg') for k, v in kwargsErrMonAlg.items(): setattr(pixelAthMonAlgErrorMonAlg, k, v) + from PixelConditionsTools.PixelConditionsToolsConf import PixelByteStreamErrorsTool + # never attempt to write bytestream error objects + pixelAthMonAlgErrorMonAlg.PixelByteStreamErrorsTool = PixelByteStreamErrorsTool(ReadingESD = True) PixelAthErrorMonAlgCfg(helper, pixelAthMonAlgErrorMonAlg, **kwargsErrMonAlg) topSequence += helper.result() diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py index b34c0cd5b111614b26169c23aea2fd464ebf1172..18736a0d8bfa2327daea67e2ab3ede0425981c46 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetMonitoringTRT.py @@ -88,7 +88,8 @@ InDetTRT_Monitoring_Tool = TRT_Monitoring_Tool (name = " min_si_hits = minSiHitCut, # default = 3 min_pixel_hits = minPixHitCut, # default = 1 min_sct_hits = 0, - min_trt_hits = 10 + min_trt_hits = 10, + TrigDecisionObjectName = "xTrigDecision" if DQMonFlags.useTrigger else "" ) if jobproperties.Beam.beamType()=='collisions': diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/CMakeLists.txt index e01c086e997b5dcfdeb4a25c627d187d95d3eb83..d68394414689d5bcc182eaa86ccaa2d397bd28a9 100644 --- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/CMakeLists.txt +++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/CMakeLists.txt @@ -26,6 +26,5 @@ atlas_add_component( InDetDiMuonMonitoring LINK_LIBRARIES ${ROOT_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaMonitoringLib xAODMuon xAODTracking GaudiKernel StoreGateLib SGtests ) # Install files from the package: -atlas_install_headers( InDetDiMuonMonitoring ) atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx index c9aabceb83ba52e40821fe022fbf76e118fbed52..8d488de9596076d676b74d9a816195f4da5d212d 100644 --- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.cxx +++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.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 <sstream> @@ -8,8 +8,7 @@ #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/PhysicalConstants.h" -#include "InDetDiMuonMonitoring/DiMuMon.h" -#include "xAODMuon/MuonContainer.h" +#include "DiMuMon.h" #include "xAODMuon/Muon.h" #include <math.h> @@ -41,11 +40,9 @@ DiMuMon::DiMuMon( const std::string & type, const std::string & name, const IInterface* parent ) : ManagedMonitorToolBase( type, name, parent ) , m_triggerChainName("NoTrig") - , m_muonCollection("Muons") { declareProperty( "resonName", m_resonName = "Zmumu" ); declareProperty( "triggerChainName", m_triggerChainName = "NoTrig" ); - declareProperty( "muonCollection", m_muonCollection = "Muons" ); declareProperty( "setDebug", m_setDebug = false ); declareProperty( "minInvmass", m_minInvmass = 60.); declareProperty( "maxInvmass", m_maxInvmass = 120.); @@ -72,6 +69,7 @@ DiMuMon::~DiMuMon() StatusCode DiMuMon::initialize(){ ATH_CHECK( ManagedMonitorToolBase::initialize() ); + ATH_CHECK( m_muonCollection.initialize() ); if (m_regions.empty()) { m_regions.push_back("All"); @@ -257,20 +255,17 @@ StatusCode DiMuMon::bookHistograms() StatusCode DiMuMon::fillHistograms() { - // if (m_lumiBlockNum<402 || m_lumiBlockNum>1330) return StatusCode::SUCCESS; - - double muonMass = 105.66*Gaudi::Units::MeV; + const double muonMass = 105.66*Gaudi::Units::MeV; //retrieve all muons - const xAOD::MuonContainer* muons(0); - StatusCode sc = evtStore()->retrieve(muons, m_muonCollection); - if(sc.isFailure()){ + SG::ReadHandle<xAOD::MuonContainer> muons{m_muonCollection}; + if(!muons.isValid()){ ATH_MSG_WARNING("Could not retrieve muon container"); - return sc; + return StatusCode::FAILURE; } else ATH_MSG_DEBUG("Muon container successfully retrieved."); //make a new container xAOD::MuonContainer* goodMuons = new xAOD::MuonContainer( SG::VIEW_ELEMENTS ); - sc = evtStore()->record ( goodMuons, "myGoodMuons" + m_triggerChainName + m_resonName); + StatusCode sc = evtStore()->record ( goodMuons, "myGoodMuons" + m_triggerChainName + m_resonName); if (!sc.isSuccess()) { ATH_MSG_WARNING("Could not record good muon tracks container."); return StatusCode::FAILURE; diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/InDetDiMuonMonitoring/DiMuMon.h b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.h similarity index 92% rename from InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/InDetDiMuonMonitoring/DiMuMon.h rename to InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.h index 07648797421d88eac48ea96d45f2d84651f6c096..5e260abc480ece3d30db2eee4e09b15fa15691ff 100644 --- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/InDetDiMuonMonitoring/DiMuMon.h +++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/DiMuMon.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 DiMuMon_H @@ -12,6 +12,7 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "xAODTracking/TrackParticle.h" #include "xAODTracking/TrackParticleContainer.h" +#include "xAODMuon/MuonContainer.h" class TH1F; @@ -62,7 +63,7 @@ class DiMuMon : public ManagedMonitorToolBase std::string m_resonName{}; std::string m_triggerChainName{}; - std::string m_muonCollection{}; + SG::ReadHandleKey<xAOD::MuonContainer> m_muonCollection{this, "muonCollection", "Muons"}; bool m_doFits{}; bool m_doSaveFits{}; diff --git a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/components/InDetDiMuonMonitoring_entries.cxx b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/components/InDetDiMuonMonitoring_entries.cxx index 0657ecf56b9f0c3f83978e32960c0154a5758569..aecca645a76f3580de0a7cb84ec015599b5fbe42 100644 --- a/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/components/InDetDiMuonMonitoring_entries.cxx +++ b/InnerDetector/InDetMonitoring/InDetDiMuonMonitoring/src/components/InDetDiMuonMonitoring_entries.cxx @@ -1,3 +1,3 @@ -#include "InDetDiMuonMonitoring/DiMuMon.h" +#include "../DiMuMon.h" DECLARE_COMPONENT( DiMuMon ) diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalBeamSpotMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalBeamSpotMonTool.h index 9c76bc489d27d3464f98c145f0d1eab38e643ec4..d2847b9ea97981993f54f857282fa16c853a9ee4 100755 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalBeamSpotMonTool.h +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalBeamSpotMonTool.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 */ // ******************************************************************************** @@ -90,7 +90,7 @@ private: std::string m_stream; bool m_useBeamspot; - SG::ReadHandleKey<xAOD::VertexContainer> m_vxContainerName{this,"vxContainerName","VxPrimaryCandidate","Vertex Container for Global Beamsport Monitoring"}; + SG::ReadHandleKey<xAOD::VertexContainer> m_vxContainerName{this,"vxContainerName","PrimaryVertices","Vertex Container for Global Beamsport Monitoring"}; bool m_vxContainerWithBeamConstraint; SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackContainerName{this,"trackContainerName","TrackParticle container for Gloabl Beamsport Monitoring"}; diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPrimaryVertexMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPrimaryVertexMonTool.cxx index 98bfffcc5ef8c0d18884755a014b62c8dc6ec6e8..8e0bade70f86e1ae83c4f8f7e6ec5485bc00f72c 100755 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPrimaryVertexMonTool.cxx +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalPrimaryVertexMonTool.cxx @@ -80,8 +80,8 @@ StatusCode InDetGlobalPrimaryVertexMonTool::initialize() { if(!sc.isSuccess()) return sc; ATH_CHECK( m_vxContainerName.initialize() ); - ATH_CHECK( m_vxContainerNameWithoutBeamConstraint.initialize() ); - ATH_CHECK( m_vxContainerNameSplit.initialize() ); + ATH_CHECK( m_vxContainerNameWithoutBeamConstraint.initialize(m_doEnhancedMonitoring) ); + ATH_CHECK( m_vxContainerNameSplit.initialize(m_doEnhancedMonitoring) ); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py index 77939a9147591949dc116373d87a7ce4dff2c9cd..c2ea2bf8c04e15d9da6c12221f3ebf9979b02ddd 100644 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/TrackMonitoring.py @@ -114,7 +114,7 @@ for trackCollection in trackCollections: tracksName = trackCollection, useExtendedPlots = True, triggerChainName = "all", - VxPrimContainerName = InDetKeys.PrimaryVertices() + VxPrimContainerName = InDetKeys.xAODVertexContainer() ) #ToolSvc += InDetAlignMonGenericTracks InDetAlignMonManager.AthenaMonTools += [ InDetAlignMonGenericTracks ] diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py index 0f6b56933ad591ecf84d85a957cbdd133367deb6..77bdacc15a1688a0b7cdbe3760944e06702e4151 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelMonitoringConfig.py @@ -75,6 +75,8 @@ def PixelMonitoringConfig(flags): pixelAthMonAlgErrorMonAlg = helper.addAlgorithm(PixelAthErrorMonAlg, 'PixelAthErrorMonAlg') for k, v in kwargsErrMonAlg.items(): setattr(pixelAthMonAlgErrorMonAlg, k, v) + from PixelConditionsTools.PixelConditionsToolsConf import PixelByteStreamErrorsTool + pixelAthMonAlgErrorMonAlg.PixelByteStreamErrorsTool = PixelByteStreamErrorsTool(ReadingESD = (flags.DQ.Environment == 'tier0ESD')) PixelAthErrorMonAlgCfg(helper, pixelAthMonAlgErrorMonAlg, **kwargsErrMonAlg) acc.merge(helper.result()) diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx index 2378a8e29b9159aa86cca5a07020a14288333bb9..5f5669ea3d4a73aa091d4724437c25201130c3f2 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthErrorMonAlg.cxx @@ -9,7 +9,7 @@ PixelAthErrorMonAlg::PixelAthErrorMonAlg( const std::string& name, ISvcLocator* m_pixelid(nullptr) { //jo flags - declareProperty("ErrorsTool", m_pixelErrorTool); + // declareProperty("ErrorsTool", m_pixelErrorTool); declareProperty("doOnline", m_doOnline = false); declareProperty("doModules", m_doModules = false); declareProperty("doLumiBlock", m_doLumiBlock = false); diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.cxx index c370f9d9b266d8bfbd512dca762840e3b3ebdee3..111a0cd10aae131ed5a490d02f426b40ab42308b 100644 --- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.cxx +++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifdef ONLINE // This tool is only meant for special online monitoring at Point 1 -#include "TRT_Monitoring/TRT_Hits_Monitoring_Tool.h" +#include "TRT_Hits_Monitoring_Tool.h" #include "TRT_ReadoutGeometry/TRT_DetectorManager.h" #include "StoreGate/ReadHandle.h" diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Hits_Monitoring_Tool.h b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.h similarity index 100% rename from InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Hits_Monitoring_Tool.h rename to InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Hits_Monitoring_Tool.h diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx index 8489cc144ad383aabff26161169e3dd41ccbc5a4..88680b033a191ec9eb3025dd5d0fc09a81acc00e 100644 --- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx +++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "TRT_Monitoring/TRT_Monitoring_Tool.h" +#include "TRT_Monitoring_Tool.h" #include "AthContainers/DataVector.h" #include "TRT_ReadoutGeometry/TRT_DetectorManager.h" @@ -589,7 +589,7 @@ StatusCode TRT_Monitoring_Tool::initialize() { ATH_CHECK( m_xAODEventInfoKey.initialize() ); ATH_CHECK( m_TRT_BCIDCollectionKey.initialize() ); ATH_CHECK( m_comTimeObjectKey.initialize() ); - ATH_CHECK( m_trigDecisionKey.initialize() ); + ATH_CHECK( m_trigDecisionKey.initialize(!m_trigDecisionKey.empty()) ); ATH_MSG_INFO("My TRT_DAQ_ConditionsSvc is " << m_DAQSvc); @@ -1131,7 +1131,13 @@ StatusCode TRT_Monitoring_Tool::fillHistograms() { SG::ReadHandle<xAOD::EventInfo> xAODEventInfo(m_xAODEventInfoKey); SG::ReadHandle<InDetTimeCollection> trtBCIDCollection(m_TRT_BCIDCollectionKey); SG::ReadHandle<ComTime> comTimeObject(m_comTimeObjectKey); - SG::ReadHandle<xAOD::TrigDecision> trigDecision(m_trigDecisionKey); + const xAOD::TrigDecision* trigDecision(nullptr); + if (!m_trigDecisionKey.empty()) { + SG::ReadHandle<xAOD::TrigDecision> htrigDecision{m_trigDecisionKey}; + if (htrigDecision.isValid()) { + trigDecision = htrigDecision.get(); + } + } if (!xAODEventInfo.isValid()) { ATH_MSG_ERROR("Could not find event info object " << m_xAODEventInfoKey.key() << @@ -1170,7 +1176,7 @@ StatusCode TRT_Monitoring_Tool::fillHistograms() { " in store"); return StatusCode::FAILURE; } - if (!trigDecision.isValid()) { + if (!m_trigDecisionKey.empty() && !trigDecision) { ATH_MSG_INFO("Could not find trigger decision object " << m_trigDecisionKey.key() << " in store"); } @@ -1180,7 +1186,7 @@ StatusCode TRT_Monitoring_Tool::fillHistograms() { " in store"); } if (m_passEventBurst) { - ATH_CHECK( fillTRTTracks(*trackCollection, trigDecision.ptr(), comTimeObject.ptr()) ); + ATH_CHECK( fillTRTTracks(*trackCollection, trigDecision, comTimeObject.ptr()) ); } } diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.h similarity index 100% rename from InnerDetector/InDetMonitoring/TRT_Monitoring/TRT_Monitoring/TRT_Monitoring_Tool.h rename to InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.h diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/components/TRT_Monitoring_entries.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/components/TRT_Monitoring_entries.cxx index 3cabca0e153cc8ff64a6d295c3df5013e093a778..a3d13d00e114561d9ffaf39037a01e2184ebfa49 100644 --- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/components/TRT_Monitoring_entries.cxx +++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/components/TRT_Monitoring_entries.cxx @@ -1,5 +1,5 @@ -#include "TRT_Monitoring/TRT_Monitoring_Tool.h" -#include "TRT_Monitoring/TRT_Hits_Monitoring_Tool.h" +#include "../TRT_Monitoring_Tool.h" +#include "../TRT_Hits_Monitoring_Tool.h" DECLARE_COMPONENT( TRT_Monitoring_Tool ) #ifdef ONLINE diff --git a/LArCalorimeter/LArClusterRec/src/LArClusterCollisionTimeAlg.cxx b/LArCalorimeter/LArClusterRec/src/LArClusterCollisionTimeAlg.cxx index 8a0b30657dcc51774772cc9b89f1ea45beeaca01..c75c8e931d35ae775bba4497c6e621d6f736b359 100644 --- a/LArCalorimeter/LArClusterRec/src/LArClusterCollisionTimeAlg.cxx +++ b/LArCalorimeter/LArClusterRec/src/LArClusterCollisionTimeAlg.cxx @@ -10,11 +10,10 @@ LArClusterCollisionTimeAlg:: LArClusterCollisionTimeAlg(const std::string& name, ISvcLocator* pSvcLocator): AthAlgorithm(name,pSvcLocator), m_nEvt(0), - m_nCollEvt(0) - { - declareProperty("InputName", m_clusterContainerName="LArClusterEM"); - declareProperty("OutputName",m_outputName="LArClusterCollTime"); - } + m_nCollEvt(0), + m_clusterContainerName{this, "InputName", "LArClusterEM"}, + m_outputName{this, "OutputName", "LArClusterCollTime"} + {} //__________________________________________________________________________ //Destructor diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx index 1022389efe0140b4bf47977e04f4abf43a3a4051..1742a1d2303c2d059856a84e41f8437392900fe4 100755 --- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx @@ -2,19 +2,13 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "xAODJet/JetContainer.h" #include "xAODJet/JetAttributes.h" #include "xAODBTagging/BTagging.h" -#include "xAODEventInfo/EventInfo.h" -#include "xAODEgamma/ElectronContainer.h" -#include "xAODMuon/MuonContainer.h" -#include "JetTagMonitoring/JetTagMonitoring.h" +#include "JetTagMonitoring.h" -#include "xAODTracking/TrackParticle.h" -#include "xAODTracking/TrackParticleContainer.h" -#include "xAODTracking/Vertex.h" -#include "xAODTracking/VertexContainer.h" +// #include "xAODTracking/TrackParticle.h" +// #include "xAODTracking/Vertex.h" #include "TrigDecisionTool/TrigDecisionTool.h" // added by SARA #include "TrkParticleBase/LinkToTrackParticleBase.h" @@ -39,43 +33,15 @@ #include <string> #include <sstream> -//** --------------------------------------------------------------------------------------------------------------- **// - -// Private methods - -namespace { - - template< class T > - bool retrieveCollection(const ServiceHandle<StoreGateSvc>& sg, const DataHandle<T>& coll, std::string key ) { - - StatusCode sc; - sc = sg->retrieve( coll, key ); - - if (!sc.isSuccess()) - return false; - - return true; - } - -} // unnamed namespace - - //** --------------------------------------------------------------------------------------------------------------- **// JetTagMonitoring::JetTagMonitoring(const std::string & type, const std::string & name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), - m_storeGate( "StoreGateSvc", name ), m_histogramsCreated(false), - m_switch_off(false) + m_switch_off(false), + m_jetBtagKey(this, "JetBtagKey", m_jetName.key()+".btaggingLink") { - - declareProperty("JetContainer", m_jetName = "AntiKt4EMTopoJets"); - declareProperty("TrackParticleContainer", m_trackParticleName = "InDetTrackParticles"); - declareProperty("PrimaryVertexContainer", m_primaryVertexName = "PrimaryVertices"); - declareProperty("ElectronContainer", m_electronName = "Electrons"); // added by SARA - declareProperty("MuonContainer", m_muonName = "Muons" ); // added by SARA - declareProperty("DQcuts", m_do_cuts = true); declareProperty("PriVtxTrkMinCut", m_pri_vtx_trk_min_cut = 4 ); @@ -174,11 +140,12 @@ StatusCode JetTagMonitoring::initialize() { return sc; } - sc = m_storeGate.retrieve(); - if (!sc.isSuccess()) { - ATH_MSG_WARNING("Unable to retrieve StoreGateSvc handle"); - m_switch_off = true; - } + ATH_CHECK(m_jetName.initialize()); + ATH_CHECK(m_trackParticleName.initialize()); + ATH_CHECK(m_primaryVertexName.initialize()); + ATH_CHECK(m_electronName.initialize()); + ATH_CHECK(m_muonName.initialize()); + ATH_CHECK(m_eventInfoKey.initialize()); if ( m_use_trackselector ) { if ( m_trackSelectorTool.retrieve().isFailure() ) { @@ -588,9 +555,11 @@ StatusCode JetTagMonitoring::fillHistograms() { m_cutflow->Fill(0.); - const xAOD::EventInfo* thisEventInfo; - if (evtStore()->retrieve(thisEventInfo).isFailure()) - ATH_MSG_WARNING("Cannot retrieve EventInfo"); + SG::ReadHandle<xAOD::EventInfo> thisEventInfo{m_eventInfoKey}; + if (!thisEventInfo.isValid()) { + ATH_MSG_ERROR("Cannot retrieve EventInfo"); + return StatusCode::FAILURE; + } m_lumiBlockNum = thisEventInfo->lumiBlock(); @@ -691,16 +660,13 @@ StatusCode JetTagMonitoring::fillHistograms() { unsigned int npv = 0, npv_trk = 0; double xpv = 0., ypv = 0., zpv = 0.; - const xAOD::VertexContainer* vxContainer(0); - // const DataHandle<VxContainer> vxContainer; - StatusCode foundPrimaryVtx = evtStore()->retrieve(vxContainer, m_primaryVertexName); - - if (!foundPrimaryVtx) { - ATH_MSG_WARNING("Unable to retrieve \"" << m_primaryVertexName << "\" from StoreGate"); + SG::ReadHandle<xAOD::VertexContainer> vxContainer{m_primaryVertexName}; + if (!vxContainer.isValid()) { + ATH_MSG_WARNING("Unable to retrieve \"" << m_primaryVertexName.key() << "\" from StoreGate"); return StatusCode::SUCCESS; } - ATH_MSG_DEBUG("VxContainer \"" << m_primaryVertexName << "\" found with " << vxContainer->size() << " entries"); + ATH_MSG_DEBUG("VxContainer \"" << m_primaryVertexName.key() << "\" found with " << vxContainer->size() << " entries"); npv = vxContainer->size(); m_global_nPrimVtx->Fill((float)npv); @@ -785,18 +751,14 @@ StatusCode JetTagMonitoring::fillHistograms() { /////////////////////////////// - const DataHandle<xAOD::TrackParticleContainer> trackParticles; - bool foundTrackPartColl = retrieveCollection(m_storeGate, trackParticles, m_trackParticleName); - - if (!foundTrackPartColl) { - - ATH_MSG_WARNING("Unable to retrieve \"" << m_trackParticleName << "\" from StoreGate"); + SG::ReadHandle<xAOD::TrackParticleContainer> trackParticles{m_trackParticleName}; + if (!trackParticles.isValid()) { + ATH_MSG_WARNING("Unable to retrieve \"" << m_trackParticleName.key() << "\" from StoreGate"); return StatusCode::SUCCESS; - } - ATH_MSG_DEBUG("TrackParticleContainer \"" << m_trackParticleName << "\" found with " << trackParticles->size() << " entries"); + ATH_MSG_DEBUG("TrackParticleContainer \"" << m_trackParticleName.key() << "\" found with " << trackParticles->size() << " entries"); xAOD::TrackParticleContainer::const_iterator trackParticleItr = trackParticles->begin(); xAOD::TrackParticleContainer::const_iterator trackParticleEnd = trackParticles->end(); @@ -926,29 +888,25 @@ bool JetTagMonitoring::isTopEvent() { // added by SARA for 2017 data taking // == 1 isolated muon with pT > m_MuonPtCut (normally 25 GeV) // electron and muon of opposite charge - const DataHandle<xAOD::ElectronContainer> electrons; - bool foundElectronColl = retrieveCollection(m_storeGate, electrons, m_electronName); - - if (!foundElectronColl) { - ATH_MSG_WARNING("Unable to retrieve \"" << m_electronName << "\" from StoreGate"); + SG::ReadHandle<xAOD::ElectronContainer> electrons{m_electronName}; + if (!electrons.isValid()) { + ATH_MSG_WARNING("Unable to retrieve \"" << m_electronName.key() << "\" from StoreGate"); return false; } - ATH_MSG_DEBUG("ElectronContainer \"" << m_electronName << "\" found with " << electrons->size() << " entries"); + ATH_MSG_DEBUG("ElectronContainer \"" << m_electronName.key() << "\" found with " << electrons->size() << " entries"); xAOD::ElectronContainer::const_iterator electronItr = electrons->begin(); xAOD::ElectronContainer::const_iterator electronEnd = electrons->end(); xAOD::ElectronContainer::const_iterator isoElectronItr = electrons->end(); - const DataHandle<xAOD::MuonContainer> muons; - bool foundMuonColl = retrieveCollection(m_storeGate, muons, m_muonName); - - if (!foundMuonColl) { - ATH_MSG_WARNING("Unable to retrieve \"" << m_muonName << "\" from StoreGate"); + SG::ReadHandle<xAOD::MuonContainer> muons{m_muonName}; + if (!muons.isValid()) { + ATH_MSG_WARNING("Unable to retrieve \"" << m_muonName.key() << "\" from StoreGate"); return false; } - ATH_MSG_DEBUG("MuonContainer \"" << m_muonName << "\" found with " << muons->size() << " entries"); + ATH_MSG_DEBUG("MuonContainer \"" << m_muonName.key() << "\" found with " << muons->size() << " entries"); xAOD::MuonContainer::const_iterator muonItr = muons->begin(); xAOD::MuonContainer::const_iterator muonEnd = muons->end(); @@ -1125,15 +1083,13 @@ void JetTagMonitoring::fillJetHistograms() { //* Jet container *// ///////////////////// - const DataHandle<xAOD::JetContainer> jets; - bool foundJetColl = retrieveCollection(m_storeGate, jets, m_jetName); - - if (!foundJetColl) { - ATH_MSG_WARNING("Unable to retrieve \"" << m_jetName << "\" from StoreGate"); + SG::ReadHandle<xAOD::JetContainer> jets{m_jetName}; + if (!jets.isValid()) { + ATH_MSG_WARNING("Unable to retrieve \"" << m_jetName.key() << "\" from StoreGate"); return; } - ATH_MSG_DEBUG("JetContainer \"" << m_jetName << "\" found with " << jets->size() << " entries"); + ATH_MSG_DEBUG("JetContainer \"" << m_jetName.key() << "\" found with " << jets->size() << " entries"); xAOD::JetContainer::const_iterator jetItr = jets->begin(); xAOD::JetContainer::const_iterator jetEnd = jets->end(); diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/JetTagMonitoring/JetTagMonitoring.h b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.h similarity index 94% rename from PhysicsAnalysis/JetTagging/JetTagMonitoring/JetTagMonitoring/JetTagMonitoring.h rename to PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.h index 91643af204a2c76f1bf9bf67f795329d95f93e18..aac2f4c94ea36866edd44aa7c58269af37fbd0a6 100755 --- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/JetTagMonitoring/JetTagMonitoring.h +++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.h @@ -26,7 +26,14 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "JetTagTools/TrackSelector.h" -#include "xAODJet/Jet.h" +#include "xAODJet/JetContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/VertexContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODMuon/MuonContainer.h" +#include "xAODEventInfo/EventInfo.h" + +// #include "xAODJet/Jet.h" #include "TrigDecisionTool/TrigDecisionTool.h" // added by SARA class TH1F_LW; @@ -93,8 +100,6 @@ private: Jet_t getTaggabilityLabel(const xAOD::Jet *jet); bool isTopEvent(); // added by SARA - ServiceHandle<StoreGateSvc> m_storeGate; - ToolHandle< Analysis::TrackSelector > m_trackSelectorTool{this, "TrackSelectorTool", "Analysis::TrackSelector"}; ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool{this, "TrackToVertexTool", "Reco::TrackToVertex"}; @@ -106,15 +111,18 @@ private: const xAOD::Vertex* m_priVtx = nullptr; /** @brief String to retrieve JetContainer from StoreGate. */ - std::string m_jetName; + SG::ReadHandleKey<xAOD::JetContainer> m_jetName {this, "JetContainer", "AntiKt4EMTopoJets"}; /** @brief String to retrieve TrackParticleContainer from StoreGate. */ - std::string m_trackParticleName; + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleName {this, "TrackParticleContainer", "InDetTrackParticles"}; /** @brief String to retrieve PrimaryVertexContainer from StoreGate. */ - std::string m_primaryVertexName; + SG::ReadHandleKey<xAOD::VertexContainer> m_primaryVertexName {this, "PrimaryVertexContainer", "PrimaryVertices"}; /** @brief String to retrieve ElectronContainer from StoreGate. */ - std::string m_electronName; // added by SARA + SG::ReadHandleKey<xAOD::ElectronContainer> m_electronName {this, "ElectronContainer", "Electrons"}; // added by SARA /** @brief String to retrieve MuonContainer from StoreGate. */ - std::string m_muonName; // added by SARA + SG::ReadHandleKey<xAOD::MuonContainer> m_muonName {this, "MuonContainer", "Muons"}; // added by SARA + + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "EventInfoKey", "EventInfo"}; + SG::ReadDecorHandleKey<xAOD::JetContainer> m_jetBtagKey; /** @brief DQ cuts switcher. */ bool m_do_cuts; double m_trk_d0_min_cut; diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/components/JetTagMonitoring_entries.cxx b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/components/JetTagMonitoring_entries.cxx index 31a3b80d3b711cc99e61b9786028fa358df89206..624e604f719815c05aaf2f039b005f2893bdb0c3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/components/JetTagMonitoring_entries.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/components/JetTagMonitoring_entries.cxx @@ -1,4 +1,4 @@ -#include "JetTagMonitoring/JetTagMonitoring.h" +#include "../JetTagMonitoring.h" #include "../JetTagMonitorAlgorithm.h" DECLARE_COMPONENT( JetTagMonitoring ) diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetContainerHistoFiller.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetContainerHistoFiller.h index 930ba84ed2cf10ab35c0acaf4421775183a6359d..08e34fcf8f17aec04ba06e4c544817dad9c9ca5f 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetContainerHistoFiller.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetContainerHistoFiller.h @@ -57,7 +57,7 @@ protected: /// The list of histogramming tools ToolHandleArray<JetHistoBase> m_histoTools; /// the jet container to build histos from - std::string m_jetContainerName; + SG::ReadHandleKey<xAOD::JetContainer> m_jetContainerName{this, "JetContainer", ""}; }; #endif diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx index f91740c24a2fa15923d2ab69ef140cf78797bdc4..6181d034482beb6e8751cf89d3811a74369a2fdb 100644 --- a/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.cxx +++ b/Reconstruction/Jet/JetMonitoring/Root/JetContainerHistoFiller.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 */ #include "JetMonitoring/JetContainerHistoFiller.h" @@ -7,11 +7,8 @@ JetContainerHistoFiller::JetContainerHistoFiller(const std::string& n) : HistoGroupBase(n) , m_histoTools(this) - , m_jetContainerName("") { declareInterface<JetContainerHistoFiller>(this); - - declareProperty("JetContainer", m_jetContainerName=""); declareProperty("HistoTools", m_histoTools); } @@ -20,12 +17,13 @@ StatusCode JetContainerHistoFiller::initialize() { CHECK( m_histoTools.retrieve() ); - if(m_jetContainerName=="") { + if(m_jetContainerName.empty()) { ATH_MSG_ERROR("Jet Container name not set. Please set the JetContainer property"); return StatusCode::FAILURE; } + CHECK( m_jetContainerName.initialize() ); - if(m_histoDir=="") m_histoDir = m_jetContainerName+"/"; + if(m_histoDir=="") m_histoDir = m_jetContainerName.key()+"/"; return StatusCode::SUCCESS; } @@ -34,7 +32,7 @@ StatusCode JetContainerHistoFiller::initialize() { int JetContainerHistoFiller::fillHistos(){ - ATH_MSG_DEBUG ("Filling hists " << name() << "..." << m_jetContainerName); + ATH_MSG_DEBUG ("Filling hists " << name() << "..." << m_jetContainerName.key()); const xAOD::EventInfo* evtInfo; CHECK(evtStore()->retrieve( evtInfo ), 1); @@ -45,10 +43,9 @@ int JetContainerHistoFiller::fillHistos(){ return 1; } - const xAOD::JetContainer* jCont = 0; - StatusCode sc= evtStore()->retrieve(jCont, m_jetContainerName) ; - if( sc.isFailure() ) { - ATH_MSG_DEBUG (" No container " << m_jetContainerName<< " in Evt store. Returning."); + SG::ReadHandle<xAOD::JetContainer> jCont{m_jetContainerName}; + if( !jCont.isValid() ) { + ATH_MSG_DEBUG (" No container " << m_jetContainerName.key()<< " in Evt store. Returning."); return 0; } diff --git a/Reconstruction/MissingETMonitoring/MissingETMonitoring/METMonTool.h b/Reconstruction/MissingETMonitoring/MissingETMonitoring/METMonTool.h index 5385981b6dfe9dd083eb89be7103128944864c3e..456fdb1154b8ff3b2d90d88674f3e75e999cca3f 100755 --- a/Reconstruction/MissingETMonitoring/MissingETMonitoring/METMonTool.h +++ b/Reconstruction/MissingETMonitoring/MissingETMonitoring/METMonTool.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 METMonTool_H @@ -17,6 +17,10 @@ #include "JetInterface/IJetSelector.h" +#include "xAODMissingET/MissingETContainer.h" +#include "xAODJet/JetContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODMuon/MuonContainer.h" #include <string> #include <vector> @@ -70,15 +74,18 @@ class METMonTool : public ManagedMonitorToolBase ToolHandle<GenericMonitoringTool> m_genTool{ this, "GenTool", "", "Generic monitoring tool" }; - Gaudi::Property<std::string> m_suffix{ this, "NameSuffix", "", "" }; + StringProperty m_suffix{ this, "NameSuffix", "", "" }; // TB this needs to be converted into the ReadHandles, for now doing c++11 move - std::vector<std::string> m_metKeys; - std::string m_metFinKey = "MET_RefFinal"; - std::string m_metCalKey = "MET_LocHadTopo"; - std::string m_metRegKey = ""; - std::string m_jetColKey = "AntiKt4LCTopoJets"; - std::string m_eleColKey = "Electrons"; - std::string m_muoColKey = "Muons"; + StringArrayProperty m_metKeys {this, "metKeys", {"MET_Base", "MET_Topo", "MET_Track"}}; + SG::ReadHandleKeyArray<xAOD::MissingETContainer> m_metKeysFull {this, "metKeysFull", {}, "Don't set this manually, please"}; + SG::ReadHandleKey<xAOD::MissingETContainer> m_metForCut {this, "metForCut", "MET_Reference_AntiKt4LCTopo", "MET object for cuts"}; + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "eventInfoKey", "EventInfo"}; + StringProperty m_metFinKey {this, "metFinKey", "MET_RefFinal"}; + StringProperty m_metCalKey {this, "metCalKey", "MET_Calo"}; + StringProperty m_metRegKey {this, "metRegKey", "", "Set to MET_TruthRegions if desired"}; + SG::ReadHandleKey<xAOD::JetContainer> m_jetColKey {this, "jetColKey", "AntiKt4LCTopoJets"}; + SG::ReadHandleKey<xAOD::ElectronContainer> m_eleColKey {this, "eleColKey", "Electrons"}; + SG::ReadHandleKey<xAOD::MuonContainer> m_muoColKey {this, "muoColKey", "Muons"}; diff --git a/Reconstruction/MissingETMonitoring/src/METMonTool.cxx b/Reconstruction/MissingETMonitoring/src/METMonTool.cxx index 3544071a592c09d616c44d1c6c0dfdb0325671e5..2b2cc4893241d3fc3e8fc60b7ae303fbc10d94c5 100755 --- a/Reconstruction/MissingETMonitoring/src/METMonTool.cxx +++ b/Reconstruction/MissingETMonitoring/src/METMonTool.cxx @@ -18,16 +18,12 @@ #include "xAODEventInfo/EventInfo.h" #include "xAODMissingET/MissingET.h" -#include "xAODMissingET/MissingETContainer.h" #include "xAODMissingET/MissingETComposition.h" #include "xAODJet/Jet.h" -#include "xAODJet/JetContainer.h" #include "xAODEgamma/Electron.h" -#include "xAODEgamma/ElectronContainer.h" #include "xAODMuon/Muon.h" -#include "xAODMuon/MuonContainer.h" #include "CLHEP/Units/SystemOfUnits.h" @@ -77,23 +73,63 @@ static const std::map<std::string, std::pair<std::string, std::string> > key2Sub METMonTool::METMonTool(const std::string& type, const std::string& name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent) -{ - // declare properties, this will disappear once moved data handles - // fill vector with Missing Et Sources - - declareProperty("metKeys", m_metKeys={"MET_Base", "MET_Topo", "MET_Track"}); - declareProperty("metFinKey", m_metFinKey); - declareProperty("metCalKey", m_metCalKey); - declareProperty("metRegKey", m_metRegKey); - declareProperty("jetColKey", m_jetColKey); - declareProperty("eleColKey", m_eleColKey); - declareProperty("muoColKey", m_muoColKey); -} +{} StatusCode METMonTool::initialize() { - + // If m_metFinKey is not empty then append it to m_metKeys + if (m_metFinKey != "") + { + std::vector<std::string>::iterator it = m_metKeys.begin(); + // Remove m_metFinKey from m_metKeys if it already exists + for (; it != m_metKeys.end();) + { + if ((*it) == m_metFinKey) it = m_metKeys.erase(it); + else it++; + } + m_metKeys.value().push_back(m_metFinKey); + } + + m_ContainerWarnings_metKeys.resize(m_metKeys.size(), 0); + + // ...and debug + + ATH_MSG_DEBUG("Using the following keys:"); + ATH_MSG_DEBUG("metCalKey = " << m_metCalKey); + ATH_MSG_DEBUG("metRegKey = " << m_metRegKey); + ATH_MSG_DEBUG("metKeys = "); + std::vector<std::string>::iterator it = m_metKeys.begin(); + for (; it != m_metKeys.end(); it++) + { + ATH_MSG_DEBUG((*it)); + } + ATH_MSG_DEBUG(""); + + // what are the actual storegate keys? + std::unordered_set<std::string> realSGKeys; + for (const auto& k : m_metKeys) { + const auto itr = key2SubSkeyMap.find(k); + if (itr != key2SubSkeyMap.end()) { + realSGKeys.insert(itr->second.first); + } + } + for (const auto& k : std::vector<std::string>{ m_metCalKey, m_metRegKey }) { + const auto itr = key2SubSkeyMap.find(k); + if (itr != key2SubSkeyMap.end()) { + realSGKeys.insert(itr->second.first); + } + } + for (const auto& k : realSGKeys) { + m_metKeysFull.push_back(k); + } + + ATH_CHECK(m_metKeysFull.initialize()); + ATH_CHECK(m_metForCut.initialize()); + ATH_CHECK(m_eventInfoKey.initialize()); + ATH_CHECK(m_jetColKey.initialize(!m_jetColKey.empty())); + ATH_CHECK(m_eleColKey.initialize(!m_eleColKey.empty())); + ATH_CHECK(m_muoColKey.initialize(!m_muoColKey.empty())); //resize vector with number of WARNINGs already displayed for retrieval of a certain container m_ContainerWarnings_metKeys.resize(m_metKeys.size(), 0); @@ -125,34 +161,6 @@ StatusCode METMonTool::bookHistograms() { ATH_MSG_DEBUG("in bookHistograms()"); - // If m_metFinKey is not empty then append it to m_metKeys - if (m_metFinKey != "") - { - std::vector<std::string>::iterator it = m_metKeys.begin(); - // Remove m_metFinKey from m_metKeys if it already exists - for (; it != m_metKeys.end();) - { - if ((*it) == m_metFinKey) it = m_metKeys.erase(it); - else it++; - } - m_metKeys.push_back(m_metFinKey); - } - - m_ContainerWarnings_metKeys.resize(m_metKeys.size(), 0); - - // ...and debug - - ATH_MSG_DEBUG("Using the following keys:"); - ATH_MSG_DEBUG("metCalKey = " << m_metCalKey); - ATH_MSG_DEBUG("metRegKey = " << m_metRegKey); - ATH_MSG_DEBUG("metKeys = "); - std::vector<std::string>::iterator it = m_metKeys.begin(); - for (; it != m_metKeys.end(); it++) - { - ATH_MSG_DEBUG((*it)); - } - ATH_MSG_DEBUG(""); - // Check consistency between m_etrangeCalFactors and m_calIndices if (m_etrangeCalFactors.size() < m_calIndices) @@ -204,9 +212,9 @@ StatusCode METMonTool::bookHistograms() if (m_metFinKey != "" && i == nSources - 1) { bookSourcesHistograms(m_metKeys[i], met_summary, true).ignore(); - if (m_jetColKey != "") bookProfileHistograms(m_metKeys[i], "Jet", met_jets, &m_iJet).ignore(); - if (m_eleColKey != "") bookProfileHistograms(m_metKeys[i], "Ele", met_electrons, &m_iEle).ignore(); - if (m_muoColKey != "") bookProfileHistograms(m_metKeys[i], "Muo", met_muons, &m_iMuo).ignore(); + if (!m_jetColKey.empty()) bookProfileHistograms(m_metKeys[i], "Jet", met_jets, &m_iJet).ignore(); + if (!m_eleColKey.empty()) bookProfileHistograms(m_metKeys[i], "Ele", met_electrons, &m_iEle).ignore(); + if (!m_muoColKey.empty()) bookProfileHistograms(m_metKeys[i], "Muo", met_muons, &m_iMuo).ignore(); } else bookSourcesHistograms(m_metKeys[i], met_sources, false).ignore(); } @@ -777,10 +785,8 @@ StatusCode METMonTool::fillHistograms() { ATH_MSG_DEBUG("in fillHistograms()"); - const xAOD::EventInfo* thisEventInfo = 0; - StatusCode sc(evtStore()->retrieve(thisEventInfo)); - - if (sc != StatusCode::SUCCESS) + SG::ReadHandle<xAOD::EventInfo> thisEventInfo{m_eventInfoKey}; + if (!thisEventInfo.isValid()) ATH_MSG_DEBUG("No EventInfo object found! Can't access LAr event info status!"); else { @@ -807,12 +813,13 @@ StatusCode METMonTool::fillSourcesHistograms() ATH_MSG_DEBUG("in fillSourcesHistograms()"); const xAOD::JetContainer* xJetCollection = 0; - if (m_jetColKey != "") + if (!m_jetColKey.empty()) { - ATH_CHECK(evtStore()->retrieve(xJetCollection, "AntiKt4LCTopoJets")); + SG::ReadHandle<xAOD::JetContainer> xhJetCollection{m_jetColKey}; + xJetCollection = xhJetCollection.get(); if (!xJetCollection) { - ATH_MSG_WARNING("Unable to retrieve JetContainer: " << "AntiKt4LCTopoJets"); + ATH_MSG_WARNING("Unable to retrieve JetContainer: " << m_jetColKey.key()); } else { @@ -856,12 +863,13 @@ StatusCode METMonTool::fillSourcesHistograms() const xAOD::ElectronContainer* xElectrons = 0; const xAOD::Electron* xhEle = 0; - if (m_eleColKey != "") + if (!m_eleColKey.empty()) { - ATH_CHECK(evtStore()->retrieve(xElectrons, "Electrons")); + SG::ReadHandle<xAOD::ElectronContainer> rhElectrons{m_eleColKey}; + xElectrons = rhElectrons.get(); if (!xElectrons) { - ATH_MSG_WARNING("Unable to retrieve ElectronContainer: " << "Electrons"); + ATH_MSG_WARNING("Unable to retrieve ElectronContainer: " << m_eleColKey.key()); } else { @@ -879,12 +887,13 @@ StatusCode METMonTool::fillSourcesHistograms() const xAOD::MuonContainer* xMuons = 0; const xAOD::Muon* xhMuon = 0; - if (m_muoColKey != "") + if (!m_muoColKey.empty()) { - ATH_CHECK(evtStore()->retrieve(xMuons, "Muons")); + SG::ReadHandle<xAOD::MuonContainer> rhMuons{m_muoColKey}; + xMuons = rhMuons.get(); if (!xMuons) { - ATH_MSG_WARNING("Unable to retrieve muon collection: " << "Muons"); + ATH_MSG_WARNING("Unable to retrieve muon collection: " << m_muoColKey.key()); m_ContainerWarnings_Muon++; } else @@ -907,9 +916,8 @@ StatusCode METMonTool::fillSourcesHistograms() bool doSummary = (m_metKeys.size() > 1); if (m_met_cut_80) { - if (evtStore()->contains<xAOD::MissingETContainer>("MET_Reference_AntiKt4LCTopo")) { - const xAOD::MissingETContainer* xMissEt_forCut = 0; - ATH_CHECK(evtStore()->retrieve(xMissEt_forCut, "MET_Reference_AntiKt4LCTopo")); + SG::ReadHandle<xAOD::MissingETContainer> xMissEt_forCut{m_metForCut}; + if (xMissEt_forCut.isValid()) { float et_RefFinal = (*xMissEt_forCut)["FinalClus"]->met() / CLHEP::GeV; if (et_RefFinal < m_met_cut) return StatusCode::SUCCESS; } @@ -942,11 +950,10 @@ StatusCode METMonTool::fillSourcesHistograms() const xAOD::MissingETContainer* xMissEt = 0; - bool sc_exists = evtStore()->contains<xAOD::MissingETContainer>(xaod_key); + SG::ReadHandle<xAOD::MissingETContainer> xhMissEt{xaod_key}; - if (sc_exists) - { - ATH_CHECK(evtStore()->retrieve(xMissEt, xaod_key)); + if (xhMissEt.isValid()) { + xMissEt = xhMissEt.get(); if (!xMissEt) @@ -1033,23 +1040,19 @@ StatusCode METMonTool::fillCalosHistograms() bool doSummary = (m_calIndices > 1); const xAOD::MissingETContainer* xmetCal = 0; - bool sc_exists = evtStore()->contains<xAOD::MissingETContainer>("MET_Calo"); - if ( not sc_exists ) { - ATH_MSG_DEBUG("Unable to retrieve MissingETContainer: " << "MET_Calo"); + SG::ReadHandle<xAOD::MissingETContainer> xhmetCal{m_metCalKey}; + if (! xhmetCal.isValid()) { + ATH_MSG_DEBUG("Unable to retrieve MissingETContainer: " << m_metCalKey); return StatusCode::SUCCESS; } - ATH_CHECK(evtStore()->retrieve(xmetCal, "MET_Calo")); + xmetCal = xhmetCal.get(); - ATH_MSG_DEBUG("Filling histograms per calorimeter subsystem with key " << m_metCalKey); - if (m_met_cut_80) { - if (evtStore()->contains<xAOD::MissingETContainer>("MET_Reference_AntiKt4LCTopo")) { - const xAOD::MissingETContainer* xMissEt_forCut = 0; - ATH_CHECK(evtStore()->retrieve(xMissEt_forCut, "MET_Reference_AntiKt4LCTopo")); + SG::ReadHandle<xAOD::MissingETContainer> xMissEt_forCut{m_metForCut}; + if (xMissEt_forCut.isValid()) { float et_RefFinal = (*xMissEt_forCut)["FinalClus"]->met() / CLHEP::GeV; - if (et_RefFinal < m_met_cut) return StatusCode::SUCCESS; } } @@ -1057,9 +1060,10 @@ StatusCode METMonTool::fillCalosHistograms() if (m_doJetcleaning && !m_badJets) { const xAOD::JetContainer* xJetCollection = 0; - ATH_CHECK(evtStore()->retrieve(xJetCollection, "AntiKt4LCTopoJets")); + SG::ReadHandle<xAOD::JetContainer> xhJetCollection{m_jetColKey}; + xJetCollection = xhJetCollection.get(); if ( xJetCollection == 0 ) { - ATH_MSG_WARNING("Unable to retrieve JetContainer: " << "AntiKt4LCTopoJets"); + ATH_MSG_WARNING("Unable to retrieve JetContainer: " << m_jetColKey.key()); //return StatusCode::FAILURE; } else { @@ -1109,59 +1113,40 @@ StatusCode METMonTool::fillRegionsHistograms() bool doSummary = (m_regIndices > 1); - const xAOD::MissingETContainer* xmetReg = 0; - - bool sc_exists = evtStore()->contains<xAOD::MissingETContainer>("MET_TruthRegions"); - - if (sc_exists) - { - - ATH_CHECK(evtStore()->retrieve(xmetReg, "MET_TruthRegions")); - - if (!xmetReg) - { - ATH_MSG_DEBUG("Unable to retrieve MissingETContainer: " << "MET_TruthRegions"); - } - else - { + SG::ReadHandle<xAOD::MissingETContainer> xmetReg{m_metRegKey}; + if (xmetReg.isValid()) { //s// ATH_MSG_DEBUG("Filling histograms per calorimeter region with key " << m_metRegKey); //s// metReg = missET->getRegions(); - for (unsigned int i = 0; i < m_regIndices; i++) - { - std::string xaod_truth_region = ""; - if (i == 0) xaod_truth_region = "Int_Central"; - else if (i == 1) xaod_truth_region = "Int_EndCap"; - else if (i == 2) xaod_truth_region = "Int_Forward"; - else xaod_truth_region = "Int_Central"; - - float ex = (*xmetReg)[xaod_truth_region]->mpx() / CLHEP::GeV; - float ey = (*xmetReg)[xaod_truth_region]->mpy() / CLHEP::GeV; - float et = sqrt(ex*ex + ey*ey); - float phi = atan2(ey, ex); - float sumet = (*xmetReg)[xaod_truth_region]->sumet() / CLHEP::GeV; - - if (et > 0.) - { - m_etReg[i]->Fill(et); - m_exReg[i]->Fill(ex); - m_eyReg[i]->Fill(ey); - m_phiReg[i]->Fill(phi); - m_sumetReg[i]->Fill(sumet); - // Mean summaries - if (doSummary) - { - m_exRegMean->Fill(i + 0.5, ex); - m_eyRegMean->Fill(i + 0.5, ey); - m_phiRegMean->Fill(i + 0.5, phi); - } - } - } + for (unsigned int i = 0; i < m_regIndices; i++) { + std::string xaod_truth_region = ""; + if (i == 0) xaod_truth_region = "Int_Central"; + else if (i == 1) xaod_truth_region = "Int_EndCap"; + else if (i == 2) xaod_truth_region = "Int_Forward"; + else xaod_truth_region = "Int_Central"; + + float ex = (*xmetReg)[xaod_truth_region]->mpx() / CLHEP::GeV; + float ey = (*xmetReg)[xaod_truth_region]->mpy() / CLHEP::GeV; + float et = sqrt(ex*ex + ey*ey); + float phi = atan2(ey, ex); + float sumet = (*xmetReg)[xaod_truth_region]->sumet() / CLHEP::GeV; + + if (et > 0.) { + m_etReg[i]->Fill(et); + m_exReg[i]->Fill(ex); + m_eyReg[i]->Fill(ey); + m_phiReg[i]->Fill(phi); + m_sumetReg[i]->Fill(sumet); + // Mean summaries + if (doSummary) { + m_exRegMean->Fill(i + 0.5, ex); + m_eyRegMean->Fill(i + 0.5, ey); + m_phiRegMean->Fill(i + 0.5, phi); } + } } - else - { - ATH_MSG_DEBUG("Unable to retrieve MissingETContainer: " << "MET_TruthRegions"); - } + } else { + ATH_MSG_DEBUG("Unable to retrieve MissingETContainer: " << m_metRegKey); + } return StatusCode::SUCCESS; } diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx index 0774cfe1982847ac2276a2912e99a1b939f779aa..4f7d23655bd723cde357bcf85087b86d12c77679 100755 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx @@ -5,7 +5,7 @@ 4 May 2020 */ -#include "egammaPerformance/MonitorElectronAlgorithm.h" +#include "MonitorElectronAlgorithm.h" MonitorElectronAlgorithm::MonitorElectronAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) :AthMonitorAlgorithm(name,pSvcLocator) diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorElectronAlgorithm.h b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.h similarity index 100% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorElectronAlgorithm.h rename to Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.h diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx index cb13efe3e84659b46bb9b4f09289038315e9ae16..4566d70901bcde3329e07d318f44a6928fd06ae5 100644 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx @@ -5,7 +5,7 @@ 4 May 2020 */ -#include "egammaPerformance/MonitorFwdElectronAlgorithm.h" +#include "MonitorFwdElectronAlgorithm.h" MonitorFwdElectronAlgorithm::MonitorFwdElectronAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) :AthMonitorAlgorithm(name,pSvcLocator) diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorFwdElectronAlgorithm.h b/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.h similarity index 100% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorFwdElectronAlgorithm.h rename to Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.h diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx index 0bb0c05d48e5b92e61426bc125e1675e0f993e18..77ed7c5d1efa8f90594c496ac75ad55ab0814c7f 100755 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx @@ -5,7 +5,7 @@ 4 May 2020 */ -#include "egammaPerformance/MonitorPhotonAlgorithm.h" +#include "MonitorPhotonAlgorithm.h" MonitorPhotonAlgorithm::MonitorPhotonAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) :AthMonitorAlgorithm(name,pSvcLocator) diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorPhotonAlgorithm.h b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.h similarity index 100% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorPhotonAlgorithm.h rename to Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.h diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx index 95cf12f768acc93a061c8d91755c00971937f31c..62465c2326eb58457f8e069c3ff248d7d95778fe 100644 --- a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx @@ -5,7 +5,7 @@ Author : B. Laforge (laforge@lpnhe.in2p3.fr) 4 May 2020 */ -#include "egammaPerformance/MonitorTnPAlgorithm.h" +#include "MonitorTnPAlgorithm.h" MonitorTnPAlgorithm::MonitorTnPAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) :AthMonitorAlgorithm(name,pSvcLocator) { diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorTnPAlgorithm.h b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.h similarity index 100% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/MonitorTnPAlgorithm.h rename to Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.h diff --git a/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx index 642284c93d2becab63573102135b47238805c439..3557c51416000574bd21f7d4db988056f6598d52 100755 --- a/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.cxx @@ -15,7 +15,7 @@ ///////////////////////////////////////////////////////////// -#include "egammaPerformance/ZeeTaPMonTool.h" +#include "ZeeTaPMonTool.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/StatusCode.h" #include "StoreGate/StoreGateSvc.h" @@ -58,7 +58,6 @@ ZeeTaPMonTool::ZeeTaPMonTool(const std::string & type, const std::string & name, m_hLB_N(nullptr) { // Name of the electron collection - declareProperty("ElectronContainer", m_ElectronContainer = "Electrons", "Name of the electron collection" ); declareProperty("massPeak", m_MassPeak = 91188, "Resonance peak position" ); declareProperty("electronEtCut",m_ElectronEtCut = 15*GeV, "Et cut for electrons"); declareProperty("massLowerCut", m_MassLowerCut = 70*GeV,"Lower mass cut"); @@ -74,6 +73,13 @@ ZeeTaPMonTool::~ZeeTaPMonTool() { } +StatusCode ZeeTaPMonTool::initialize() +{ + ATH_CHECK( egammaMonToolBase::initialize() ); + ATH_CHECK( m_ElectronContainer.initialize() ); + return StatusCode::SUCCESS; +} + StatusCode ZeeTaPMonTool::bookHistograms() { ATH_MSG_DEBUG("ZeeTaPMonTool::bookHistograms()"); @@ -165,15 +171,8 @@ StatusCode ZeeTaPMonTool::fillHistograms() //-------------------- //figure out current LB //-------------------- - const DataHandle<xAOD::EventInfo> evtInfo; - StatusCode sc = m_storeGate->retrieve(evtInfo); - if (sc.isFailure()) { - ATH_MSG_ERROR("couldn't retrieve event info"); - return StatusCode::FAILURE; - } - unsigned int previousLB = m_currentLB; - m_currentLB = evtInfo->lumiBlock(); + m_currentLB = getCurrentLB(); //deal with the change of LB if (m_currentLB>previousLB) { @@ -184,11 +183,10 @@ StatusCode ZeeTaPMonTool::fillHistograms() } // Get electron container - const xAOD::ElectronContainer* electron_container=nullptr; - sc = m_storeGate->retrieve(electron_container, m_ElectronContainer); - if(sc.isFailure() || !electron_container){ + SG::ReadHandle<xAOD::ElectronContainer> electron_container{m_ElectronContainer}; + if(!electron_container.isValid()){ ATH_MSG_VERBOSE("no electron container found in TDS"); - return sc; + return StatusCode::FAILURE; } xAOD::ElectronContainer::const_iterator e_iter = electron_container->begin(); diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/ZeeTaPMonTool.h b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.h similarity index 86% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/ZeeTaPMonTool.h rename to Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.h index 4b899a5ff1267421d265283dea34e9f2cceeffcf..e34197ddc443c9fb4daa0c829c1cdbf692afabe6 100755 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/ZeeTaPMonTool.h +++ b/Reconstruction/egamma/egammaPerformance/src/ZeeTaPMonTool.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 */ ///////////////////////////////////////////////////////////// @@ -12,7 +12,7 @@ #ifndef ZeeTaPMonTool_H #define ZeeTaPMonTool_H -#include "egammaPerformance/egammaMonToolBase.h" +#include "egammaMonToolBase.h" #include "xAODEgamma/Electron.h" class ZeeTaPMonTool : public egammaMonToolBase @@ -23,9 +23,10 @@ class ZeeTaPMonTool : public egammaMonToolBase virtual ~ZeeTaPMonTool(); - virtual StatusCode bookHistograms(); - virtual StatusCode fillHistograms(); - virtual StatusCode procHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; + virtual StatusCode fillHistograms() override; + virtual StatusCode procHistograms() override; private: void fillElectronProbe(const xAOD::Electron *el, bool isTight, bool isIso, double mass); @@ -33,7 +34,7 @@ class ZeeTaPMonTool : public egammaMonToolBase protected: // Properties - std::string m_ElectronContainer; // Container name for electrons + SG::ReadHandleKey<xAOD::ElectronContainer> m_ElectronContainer{this, "ElectronContainer", "Electrons", "Name of the electron collection"}; // Container name for electrons float m_MassPeak; float m_ElectronEtCut; float m_MassLowerCut; diff --git a/Reconstruction/egamma/egammaPerformance/src/components/egammaPerformance_entries.cxx b/Reconstruction/egamma/egammaPerformance/src/components/egammaPerformance_entries.cxx index af0888d573667cd9cb225721b9b66865fb0c3354..e9e3ac713b75307d10f87a60aff02fc23e188928 100644 --- a/Reconstruction/egamma/egammaPerformance/src/components/egammaPerformance_entries.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/components/egammaPerformance_entries.cxx @@ -4,15 +4,15 @@ // New Run 3 algorithms -#include "egammaPerformance/MonitorElectronAlgorithm.h" -#include "egammaPerformance/MonitorPhotonAlgorithm.h" -#include "egammaPerformance/MonitorFwdElectronAlgorithm.h" -#include "egammaPerformance/MonitorTnPAlgorithm.h" +#include "../MonitorElectronAlgorithm.h" +#include "../MonitorPhotonAlgorithm.h" +#include "../MonitorFwdElectronAlgorithm.h" +#include "../MonitorTnPAlgorithm.h" // Run 2 algorithms -#include "egammaPerformance/photonMonTool.h" -#include "egammaPerformance/electronMonTool.h" -#include "egammaPerformance/forwardElectronMonTool.h" -#include "egammaPerformance/ZeeTaPMonTool.h" +#include "../photonMonTool.h" +#include "../electronMonTool.h" +#include "../forwardElectronMonTool.h" +#include "../ZeeTaPMonTool.h" // Run 2 Algorithms diff --git a/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.cxx b/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.cxx index 9c779277cad57f78e541faeea414e3f7d880c742..f4ebbe1d87d99d6967b3f0ceaa941fc41f2e6ecb 100644 --- a/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.cxx @@ -13,7 +13,7 @@ ///////////////////////////////////////////////////////////// -#include "egammaPerformance/egammaMonToolBase.h" +#include "egammaMonToolBase.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/StatusCode.h" #include "StoreGate/StoreGateSvc.h" @@ -80,9 +80,22 @@ StatusCode egammaMonToolBase::initialize() } } + ATH_CHECK( m_EventInfoKey.initialize() ); + return sc; } +unsigned int egammaMonToolBase::getCurrentLB() +{ + SG::ReadHandle<xAOD::EventInfo> evtInfo{m_EventInfoKey}; + if (evtInfo.isValid()) { + return evtInfo->lumiBlock(); + } else { + ATH_MSG_ERROR("couldn't retrieve event info"); + return -1; + } +} + StatusCode egammaMonToolBase::bookHistograms() { ATH_MSG_DEBUG("egammaMonToolBase::bookHistograms()"); diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/egammaMonToolBase.h b/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.h similarity index 88% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/egammaMonToolBase.h rename to Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.h index 4f28d7639cc9a3df507860fe9113e814f933c4c2..29b0852b726971c0fc7a8a49cabeed6169895f97 100644 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/egammaMonToolBase.h +++ b/Reconstruction/egamma/egammaPerformance/src/egammaMonToolBase.h @@ -31,10 +31,10 @@ class egammaMonToolBase : public ManagedMonitorToolBase virtual ~egammaMonToolBase(); - virtual StatusCode initialize(); - virtual StatusCode bookHistograms(); - virtual StatusCode fillHistograms(); - virtual StatusCode procHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; + virtual StatusCode fillHistograms() override; + virtual StatusCode procHistograms() override; protected: @@ -52,6 +52,7 @@ class egammaMonToolBase : public ManagedMonitorToolBase void fillTH2FperRegion(std::vector<TH2*> &vhist, unsigned int ir, float x, float y); void fillEfficiencies(TH1* h, TH1* href); bool hasGoodTrigger(const std::string& comment); + unsigned int getCurrentLB(); // Data members StoreGateSvc * m_storeGate; @@ -63,6 +64,7 @@ class egammaMonToolBase : public ManagedMonitorToolBase std::string m_GroupExtension; unsigned int m_currentLB; + SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"}; private: std::vector<std::string> m_region; diff --git a/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx index 5ec769498afec587c8bcc55ac44d2d744953e20f..94e9e819e4888371c545da1173c1802a4080cf33 100755 --- a/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.cxx @@ -72,7 +72,7 @@ ///////////////////////////////////////////////////////////// -#include "egammaPerformance/electronMonTool.h" +#include "electronMonTool.h" electronMonTool::electronMonTool(const std::string & type, const std::string & name, const IInterface* parent) : egammaMonToolBase(type,name,parent), @@ -81,10 +81,6 @@ electronMonTool::electronMonTool(const std::string & type, const std::string & n m_electronIdGroup(nullptr), m_electronLBGroup(nullptr) { - - // Name of the electron collection - declareProperty("ElectronContainer", m_ElectronContainer = "Electrons", "Name of the electron collection" ); - bool WithFullHistList = true; bool WithLimitedHistList = false; @@ -138,6 +134,13 @@ electronMonTool::~electronMonTool() } +StatusCode electronMonTool::initialize() +{ + ATH_CHECK( egammaMonToolBase::initialize() ); + ATH_CHECK( m_ElectronContainer.initialize() ); + return StatusCode::SUCCESS; +} + StatusCode electronMonTool::bookHistogramsForOneElectronType(electronHist& myHist) { @@ -529,15 +532,8 @@ StatusCode electronMonTool::fillHistograms() { //-------------------- //figure out current LB //-------------------- - const DataHandle<xAOD::EventInfo> evtInfo; - StatusCode sc = m_storeGate->retrieve(evtInfo); - if (sc.isFailure()) { - ATH_MSG_ERROR("couldn't retrieve event info"); - return StatusCode::FAILURE; - } - unsigned int previousLB = m_currentLB; - m_currentLB = evtInfo->lumiBlock(); + m_currentLB = getCurrentLB(); //deal with the change of LB if (m_currentLB>previousLB) { @@ -558,9 +554,8 @@ StatusCode electronMonTool::fillHistograms() { } // Get electron container - const xAOD::ElectronContainer* electron_container=nullptr; - sc = m_storeGate->retrieve(electron_container, m_ElectronContainer); - if(sc.isFailure() || !electron_container){ + SG::ReadHandle<xAOD::ElectronContainer> electron_container{m_ElectronContainer}; + if(!electron_container.isValid()){ ATH_MSG_VERBOSE("no electron container found in TDS"); return StatusCode::FAILURE; } @@ -675,9 +670,3 @@ StatusCode electronMonTool::fillHistograms() { return StatusCode::SUCCESS; } - - -StatusCode electronMonTool::procHistograms() -{ - return StatusCode::SUCCESS; -} diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/electronMonTool.h b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.h similarity index 93% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/electronMonTool.h rename to Reconstruction/egamma/egammaPerformance/src/electronMonTool.h index 80858f4daedba5eec49b0c6d6e38cee1ce7f9094..55cdb1cb59ccc1b49a11332ec168dacf1dfcfb52 100755 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/electronMonTool.h +++ b/Reconstruction/egamma/egammaPerformance/src/electronMonTool.h @@ -18,7 +18,7 @@ #include "StoreGate/StoreGateSvc.h" #include "TH1F.h" #include "TH2F.h" -#include "egammaPerformance/egammaMonToolBase.h" +#include "egammaMonToolBase.h" #include "xAODEgamma/Electron.h" #include "xAODEgamma/ElectronContainer.h" #include "xAODEgamma/ElectronxAODHelpers.h" @@ -126,20 +126,20 @@ class electronMonTool : public egammaMonToolBase virtual ~electronMonTool(); - virtual StatusCode bookHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; virtual StatusCode bookHistogramsForOneElectronType(electronHist& myHist); - virtual StatusCode fillHistograms(); + virtual StatusCode fillHistograms() override; virtual StatusCode fillHistogramsForOneElectron(xAOD::ElectronContainer::const_iterator e_iter, electronHist& myHist); - virtual StatusCode procHistograms(); private: protected: // Properties - std::string m_ElectronContainer; // Container name for electrons + SG::ReadHandleKey<xAOD::ElectronContainer> m_ElectronContainer{this, "ElectronContainer", "Electrons", "Name of the electron collection"}; // Container name for electrons // LH Loose electrons histograms electronHist *m_LhLooseElectrons; diff --git a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx index aec9fb057e35711f05ae889ededcac4af8a45248..79b02d36aa2c2832c3fa179b6534858a22dd84b7 100644 --- a/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.cxx @@ -69,7 +69,7 @@ ///////////////////////////////////////////////////////////// -#include "egammaPerformance/forwardElectronMonTool.h" +#include "forwardElectronMonTool.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/StatusCode.h" #include "StoreGate/StoreGateSvc.h" @@ -97,9 +97,6 @@ forwardElectronMonTool::forwardElectronMonTool(const std::string & type, const s m_hLB_N(nullptr), m_nForwardElectrons(0) { - // Name of the electron collection - declareProperty("ForwardElectronContainer", m_ForwardElectronContainer = "egammaForwardCollection", "Name of the forward electron collection" ); - m_lumiBlockNumber = 0; m_nForwardElectronsInCurrentLB = 0; m_nForwardElectronsPerLumiBlock.clear(); @@ -110,6 +107,13 @@ forwardElectronMonTool::~forwardElectronMonTool() { } +StatusCode forwardElectronMonTool::initialize() +{ + ATH_CHECK( egammaMonToolBase::initialize() ); + ATH_CHECK( m_ForwardElectronContainer.initialize() ); + return StatusCode::SUCCESS; +} + StatusCode forwardElectronMonTool::bookHistograms() { ATH_MSG_DEBUG("forwardElectronMonTool::bookHistograms()"); @@ -197,15 +201,8 @@ StatusCode forwardElectronMonTool::fillHistograms() //-------------------- //figure out current LB //-------------------- - const DataHandle<xAOD::EventInfo> evtInfo; - StatusCode sc = m_storeGate->retrieve(evtInfo); - if (sc.isFailure()) { - ATH_MSG_ERROR("couldn't retrieve event info"); - return StatusCode::FAILURE; - } - unsigned int previousLB = m_currentLB; - m_currentLB = evtInfo->lumiBlock(); + m_currentLB = getCurrentLB(); //deal with the change of LB if (m_currentLB>previousLB) { @@ -216,9 +213,8 @@ StatusCode forwardElectronMonTool::fillHistograms() } // Get electron container - const xAOD::ElectronContainer* electron_container=nullptr; - sc = m_storeGate->retrieve(electron_container, m_ForwardElectronContainer); - if(sc.isFailure() || !electron_container){ + SG::ReadHandle<xAOD::ElectronContainer> electron_container{m_ForwardElectronContainer}; + if(!electron_container.isValid()){ ATH_MSG_VERBOSE("no electron container found in TDS"); return StatusCode::FAILURE; } @@ -363,5 +359,5 @@ StatusCode forwardElectronMonTool::fillHistograms() //} } - return sc; + return StatusCode::SUCCESS; } diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.h similarity index 90% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h rename to Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.h index f1844ba855ebfc0758476ef9215f522dc6ef1a9d..ac8f778182351d7b6de399110560914e20a2542d 100644 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/forwardElectronMonTool.h +++ b/Reconstruction/egamma/egammaPerformance/src/forwardElectronMonTool.h @@ -11,7 +11,7 @@ #ifndef forwardElectronMonTool_H #define forwardElectronMonTool_H -#include "egammaPerformance/egammaMonToolBase.h" +#include "egammaMonToolBase.h" class forwardElectronMonTool : public egammaMonToolBase { @@ -21,14 +21,15 @@ class forwardElectronMonTool : public egammaMonToolBase virtual ~forwardElectronMonTool(); - virtual StatusCode bookHistograms(); - virtual StatusCode fillHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; + virtual StatusCode fillHistograms() override; private: protected: // Properties - std::string m_ForwardElectronContainer; // Container name for forwardElectrons + SG::ReadHandleKey<xAOD::ElectronContainer> m_ForwardElectronContainer{this, "ForwardElectronContainer", "egammaForwardCollection", "Name of the forward electron collection"}; // Container name for forwardElectrons // Loose electrons histograms TH1 * m_hN; // Histogram for number of electrons diff --git a/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx index 03ca696df49d0ec979a707d358cd799d561b771c..e5a2dfe12b944859ffb7d23551aa74c4e62b4d7e 100755 --- a/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx +++ b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.cxx @@ -69,7 +69,7 @@ ///////////////////////////////////////////////////////////// -#include "egammaPerformance/photonMonTool.h" +#include "photonMonTool.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/StatusCode.h" #include "StoreGate/StoreGateSvc.h" @@ -90,9 +90,6 @@ photonMonTool::photonMonTool(const std::string & type, const std::string & name, m_photonRegionGroup(nullptr), m_photonLBGroup(nullptr) { - // Name of the photon collection - declareProperty("PhotonContainer", m_PhotonContainer = "PhotonCollection", "Name of the photon collection"); - m_CbTightPhotons = new photonHist(std::string("CbTight")); m_CbTightPhotons->m_lumiBlockNumber = 0; m_CbTightPhotons->m_nPhotonsInCurrentLB = 0; @@ -120,6 +117,13 @@ photonMonTool::~photonMonTool() ATH_MSG_DEBUG("photonMonTool ::: m_CbTightPhotons deleted"); } +StatusCode photonMonTool::initialize() +{ + ATH_CHECK( egammaMonToolBase::initialize() ); + ATH_CHECK( m_PhotonContainer.initialize() ); + return StatusCode::SUCCESS; +} + StatusCode photonMonTool::bookHistogramsForOnePhotonType(photonHist& myHist) { @@ -633,15 +637,8 @@ StatusCode photonMonTool::fillHistograms() { //-------------------- //figure out current LB //-------------------- - const DataHandle<xAOD::EventInfo> evtInfo; - StatusCode sc = m_storeGate->retrieve(evtInfo); - if (sc.isFailure()) { - ATH_MSG_ERROR("couldn't retrieve event info"); - return StatusCode::FAILURE; - } - unsigned int previousLB = m_currentLB; - m_currentLB = evtInfo->lumiBlock(); + m_currentLB = getCurrentLB(); //deal with the change of LB if (m_currentLB>previousLB) { @@ -685,9 +682,8 @@ StatusCode photonMonTool::fillHistograms() { } // Get photon container - const xAOD::PhotonContainer* photon_container=nullptr; - sc = m_storeGate->retrieve(photon_container, m_PhotonContainer); - if(sc.isFailure() || !photon_container){ + SG::ReadHandle<xAOD::PhotonContainer> photon_container{m_PhotonContainer}; + if(!photon_container.isValid()){ ATH_MSG_VERBOSE("no photon container found in TDS"); return StatusCode::FAILURE; } @@ -771,9 +767,3 @@ StatusCode photonMonTool::fillHistograms() { return StatusCode::SUCCESS; } - - -StatusCode photonMonTool::procHistograms() -{ - return StatusCode::SUCCESS; -} diff --git a/Reconstruction/egamma/egammaPerformance/egammaPerformance/photonMonTool.h b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.h similarity index 95% rename from Reconstruction/egamma/egammaPerformance/egammaPerformance/photonMonTool.h rename to Reconstruction/egamma/egammaPerformance/src/photonMonTool.h index cbd3187025f8705f34188603b93615b0aecb2152..b439c791c6cbdbb464b81ee19f147044d3fc601d 100755 --- a/Reconstruction/egamma/egammaPerformance/egammaPerformance/photonMonTool.h +++ b/Reconstruction/egamma/egammaPerformance/src/photonMonTool.h @@ -18,7 +18,7 @@ #include "StoreGate/StoreGateSvc.h" #include "TH1F.h" #include "TH2F.h" -#include "egammaPerformance/egammaMonToolBase.h" +#include "egammaMonToolBase.h" #include "xAODEgamma/Electron.h" #include "xAODEgamma/ElectronContainer.h" #include "xAODEgamma/ElectronxAODHelpers.h" @@ -178,19 +178,19 @@ class photonMonTool : public egammaMonToolBase photonMonTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~photonMonTool(); - virtual StatusCode bookHistograms(); + virtual StatusCode initialize() override; + virtual StatusCode bookHistograms() override; virtual StatusCode bookHistogramsForOnePhotonType(photonHist& myHist); - virtual StatusCode fillHistograms(); + virtual StatusCode fillHistograms() override; virtual StatusCode fillHistogramsForOnePhoton(xAOD::PhotonContainer::const_iterator g_iter, photonHist& myHist); - virtual StatusCode procHistograms(); private: protected: // Properties - std::string m_PhotonContainer; // Container name for photons + SG::ReadHandleKey<xAOD::PhotonContainer> m_PhotonContainer{this, "PhotonContainer", "PhotonCollection", "Name of the photon collection"}; // Container name for photons // Loose cut based photons histograms photonHist *m_CbLoosePhotons; diff --git a/Reconstruction/tauMonitoring/CMakeLists.txt b/Reconstruction/tauMonitoring/CMakeLists.txt index 3883a2972e4522ab797861979ac746bcf0f6e853..6386f5efc0e69b2eceb3f76bd84b831399a608e2 100644 --- a/Reconstruction/tauMonitoring/CMakeLists.txt +++ b/Reconstruction/tauMonitoring/CMakeLists.txt @@ -26,6 +26,5 @@ atlas_add_component( tauMonitoring LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib xAODTau GaudiKernel xAODEventInfo xAODTracking TrigDecisionToolLib ) # Install files from the package: -atlas_install_headers( tauMonitoring ) atlas_install_joboptions( share/*.py ) atlas_install_python_modules( python/*.py ) diff --git a/Reconstruction/tauMonitoring/src/components/tauMonitoring_entries.cxx b/Reconstruction/tauMonitoring/src/components/tauMonitoring_entries.cxx index 862f5b18869dfd057eaf2bf00ba96fdd02805362..629ff8320d8625b697d282b24b4af5928b19d8bc 100644 --- a/Reconstruction/tauMonitoring/src/components/tauMonitoring_entries.cxx +++ b/Reconstruction/tauMonitoring/src/components/tauMonitoring_entries.cxx @@ -1,5 +1,5 @@ -#include "tauMonitoring/tauMonTool.h" -#include "tauMonitoring/tauMonitorAlgorithm.h" +#include "../tauMonTool.h" +#include "../tauMonitorAlgorithm.h" DECLARE_COMPONENT( tauMonTool ) DECLARE_COMPONENT( tauMonitorAlgorithm ) diff --git a/Reconstruction/tauMonitoring/src/tauMonTool.cxx b/Reconstruction/tauMonitoring/src/tauMonTool.cxx index 315f666b0a6ad729ddb85dfea9315b67362dd83a..d209255a18f54f27818fde3dc591df44184a7738 100644 --- a/Reconstruction/tauMonitoring/src/tauMonTool.cxx +++ b/Reconstruction/tauMonitoring/src/tauMonTool.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 */ //********************************************************************* @@ -11,7 +11,7 @@ // Lianyou SHAN ( update for run2 ) //********************************************************************* -#include "tauMonitoring/tauMonTool.h" +#include "tauMonTool.h" #include "xAODEventInfo/EventInfo.h" #include "xAODTracking/TrackParticle.h" #include "TrigDecisionTool/TrigDecisionTool.h" @@ -28,7 +28,6 @@ using Gaudi::Units::GeV; tauMonTool::tauMonTool( const std::string & type, const std::string & name, const IInterface* parent ) :ManagedMonitorToolBase( type, name, parent ), - m_tauJetKey("TauJets"), m_doTrigger(false), m_maxNLB(1000) // m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") @@ -41,6 +40,13 @@ tauMonTool::tauMonTool( const std::string & type, tauMonTool::~tauMonTool() {} +StatusCode tauMonTool::initialize() { + ATH_CHECK( ManagedMonitorToolBase::initialize() ); + ATH_CHECK( m_tauJetKey.initialize() ); + ATH_CHECK( m_eventInfoKey.initialize() ); + return StatusCode::SUCCESS; +} + //-------------------------------------------------------------------------------- // Book Histograms //-------------------------------------------------------------------------------- @@ -146,8 +152,8 @@ StatusCode tauMonTool::fillHistograms() //-------------------- //figure out current LB //-------------------- - const DataHandle<xAOD::EventInfo> evtInfo; - if ( (evtStore()->retrieve(evtInfo)) . isFailure()) { + SG::ReadHandle<xAOD::EventInfo> evtInfo{m_eventInfoKey}; + if (!evtInfo.isValid()) { ATH_MSG_ERROR("couldn't retrieve event info"); return StatusCode::FAILURE; } @@ -207,9 +213,9 @@ StatusCode tauMonTool::fillHistograms() //-------------------- //Get Tau container //-------------------- - const xAOD::TauJetContainer *tau_container; - if ( (evtStore()->retrieve(tau_container,m_tauJetKey)).isFailure() ) { - ATH_MSG_WARNING("Cannot retrieve " << m_tauJetKey); + SG::ReadHandle<xAOD::TauJetContainer> tau_container{m_tauJetKey}; + if ( !tau_container.isValid() ) { + ATH_MSG_WARNING("Cannot retrieve " << m_tauJetKey.key()); return StatusCode::FAILURE; } diff --git a/Reconstruction/tauMonitoring/tauMonitoring/tauMonTool.h b/Reconstruction/tauMonitoring/src/tauMonTool.h similarity index 93% rename from Reconstruction/tauMonitoring/tauMonitoring/tauMonTool.h rename to Reconstruction/tauMonitoring/src/tauMonTool.h index 38d048bf4760d498197e098023ffa8eb797fc539..9298bf7e3ffda2b6a36dc7470d51d7b619b272d8 100644 --- a/Reconstruction/tauMonitoring/tauMonitoring/tauMonTool.h +++ b/Reconstruction/tauMonitoring/src/tauMonTool.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 TAUMONTOOL_H @@ -18,7 +18,7 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "xAODTau/TauDefs.h" -#include "xAODTau/TauJet.h" +#include "xAODTau/TauJetContainer.h" class tauMonTool : public ManagedMonitorToolBase { @@ -28,14 +28,16 @@ public: // destructor virtual ~tauMonTool(); - StatusCode bookHistograms(); - StatusCode fillHistograms(); - StatusCode procHistograms(); + StatusCode initialize() override; + StatusCode bookHistograms() override; + StatusCode fillHistograms() override; + StatusCode procHistograms() override; StatusCode Book1DHist(TH1 ** hist, MonGroup * monName, std::string histName, std::string histTitle, int NBins, double lowBin, double highBin); StatusCode Book2DHist(TH2 ** hist, MonGroup * monName, std::string histName, std::string histTitle, int NXBins, double lowXBin, double highXBin, int NYBins, double lowYBin, double highYBin); protected: - std::string m_tauJetKey; + SG::ReadHandleKey<xAOD::TauJetContainer> m_tauJetKey{this, "tauJetKey", "TauJets"}; + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo"}; bool m_doTrigger; int m_maxNLB; diff --git a/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx b/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx index 32e17fc9a1ff684f143441b75df88b7282ca65b1..07e39297516a446d35092f0aff4b8a2fc26f1867 100644 --- a/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx +++ b/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "tauMonitoring/tauMonitorAlgorithm.h" +#include "tauMonitorAlgorithm.h" #include "GaudiKernel/SystemOfUnits.h" #include "xAODCore/ShallowCopy.h" diff --git a/Reconstruction/tauMonitoring/tauMonitoring/tauMonitorAlgorithm.h b/Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.h similarity index 100% rename from Reconstruction/tauMonitoring/tauMonitoring/tauMonitorAlgorithm.h rename to Reconstruction/tauMonitoring/src/tauMonitorAlgorithm.h