diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt index 40a789ec03a8b8a19a0a9619533db44a0a45224b..f6266d80a6b3c94dac256f5c9265d6af63b08734 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/CMakeLists.txt @@ -7,28 +7,29 @@ atlas_subdir( SCT_Monitoring ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC + Commission/CommissionEvent Control/AthenaMonitoring + Control/StoreGate + Event/EventInfo + Event/xAOD/xAODEventInfo GaudiKernel InnerDetector/InDetConditions/InDetConditionsSummaryService InnerDetector/InDetConditions/SCT_ConditionsServices InnerDetector/InDetDetDescr/InDetReadoutGeometry InnerDetector/InDetRecEvent/InDetPrepRawData + InnerDetector/InDetRawEvent/InDetRawData MagneticField/MagFieldInterfaces Reconstruction/RecoTools/ITrackToVertex + Tracking/TrkEvent/TrkSpacePoint Tracking/TrkEvent/TrkTrack Tracking/TrkTools/TrkToolInterfaces Trigger/TrigAnalysis/TrigAnalysisInterfaces Trigger/TrigAnalysis/TrigDecisionTool PRIVATE - Commission/CommissionEvent Control/AthenaKernel Control/DataModel - Control/StoreGate DetectorDescription/Identifier - Event/EventInfo - Event/xAOD/xAODEventInfo InnerDetector/InDetDetDescr/InDetIdentifier - InnerDetector/InDetRawEvent/InDetRawData InnerDetector/InDetRecEvent/InDetRIO_OnTrack Tools/LWHists Tools/PathResolver @@ -37,7 +38,6 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkEvent/TrkMeasurementBase Tracking/TrkEvent/TrkParameters Tracking/TrkEvent/TrkRIO_OnTrack - Tracking/TrkEvent/TrkSpacePoint Tracking/TrkEvent/TrkTrackSummary ) # External dependencies: diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h index 98a69ebcd6cff816b6d59128f0bceead5f726f2c..3323a12211c29a08d009afb381efc48d7137533e 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h @@ -26,6 +26,10 @@ #include "SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h" #include "SCT_Monitoring/SCT_MonitoringNumbers.h" +#include "StoreGate/ReadHandleKey.h" +#include "xAODEventInfo/EventInfo.h" +#include "InDetRawData/SCT_RDO_Container.h" + /** Forward declarations*/ class IInterface; class TH1F; @@ -198,7 +202,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase //@{ /// Data object name: for the SCT this is "SCT_RDOs" - std::string m_dataObjectName; + SG::ReadHandle<SCT_RDO_Container> m_dataObjectName; ///SCT Helper class const SCT_ID* m_pSCTHelper; @@ -295,6 +299,8 @@ class SCTErrMonTool : public ManagedMonitorToolBase //TProfile * m_DisabledDetectorCoverageVsLB; //TProfile * m_ErrorDetectorCoverageVsLB; TProfile * m_TotalDetectorCoverageVsLB; + + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey; }; #endif diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h index db12815f3010cd5df454229e59cd24d4d728dfe3..d9b09fc988265ca7f1c93676fa518c2e49b9b661 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h @@ -42,6 +42,10 @@ #include "InDetPrepRawData/SCT_ClusterContainer.h" #include "InDetReadoutGeometry/SCT_DetectorManager.h" +#include "StoreGate/ReadHandleKey.h" +#include "CommissionEvent/ComTime.h" +#include "EventInfo/EventInfo.h" + class Identifier; class PixelID; class SCT_ID; @@ -124,7 +128,7 @@ private: const SCT_ID* m_pSCTHelper; const InDetDD::SCT_DetectorManager* m_pManager; - std::string m_TrackName; + SG::ReadHandle<TrackCollection> m_TrackName; IChronoStatSvc * m_chrono; const TrackCollection * m_tracks; Trk::TrackSummaryTool* m_TrackSum; @@ -150,7 +154,7 @@ private: UInt_t m_maxTracks; std::string m_path; - std::string m_sctContainerName; + SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_sctContainerName; Bool_t m_insideOutOnly; @@ -288,6 +292,9 @@ private: const SCT_ID * m_sctId; const TRT_ID * m_trtId; + SG::ReadHandleKey<ComTime> m_comTimeName; + SG::ReadHandleKey<EventInfo> m_eventInfoKey; + /**Convert a layer/disk number (0-21) to a bec index (0,1,2) according to position of that layer * Numbering is counter-intuitive, would expect C then B then A; in fact the original ordering was A, C, B * I have re-ordered this!!!! so now its C,B,A diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h index 87c816b52cb9f57b54b9d5f2244ad37ba1990275..3073a6e89270a90854a0fc226201738a773a24ab 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h @@ -28,6 +28,11 @@ #include "TrkTrack/Track.h" #include "TrkTrack/TrackCollection.h" +#include "StoreGate/ReadHandleKey.h" +#include "TrkSpacePoint/SpacePointContainer.h" +#include "InDetRawData/SCT_RDO_Container.h" +#include "EventInfo/EventInfo.h" +#include "InDetPrepRawData/SCT_ClusterContainer.h" // for CondDB #include "SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h" @@ -57,6 +62,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ typedef unsigned int ChipNumberType; SCTHitsNoiseMonTool(const std::string & type, const std::string & name,const IInterface* parent); ~SCTHitsNoiseMonTool(); + virtual StatusCode initialize() final; /** @name Book, fill & check (reimplemented from baseclass) */ //@{ ///Book is called at the beginning @@ -332,7 +338,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ ///additional maps for track NO to compare with SP NO calc std::map<Identifier, int> m_RDOs; //CAM adds map for SP NO - std::string m_SCTSPContainerName; + SG::ReadHandle<SpacePointContainer> m_SCTSPContainerName; std::map<Identifier, float> m_occSumUnbiased; std::map<Identifier, float> m_occSumUnbiasedTrigger; @@ -468,7 +474,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ //@{ /// Data object name: for the SCT this is "SCT_RDOs" - std::string m_dataObjectName; + SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName; ///SCT Helper class const SCT_ID* m_pSCTHelper; @@ -507,6 +513,9 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{ std::string positionString(const Identifier & plane) const; //@} + + SG::ReadHandleKey<EventInfo> m_eventInfoKey; + SG::ReadHandleKey<InDet::SCT_ClusterContainer> m_clusContainerKey; }; #endif diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h index d8cbf151384eedb76cef7cde099a1875517cbcef..4754797c51f42dd174f62c10dd28009fdd5816b3 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h @@ -35,6 +35,9 @@ //for vertexTool #include "ITrackToVertex/ITrackToVertex.h" //for m_trackToVertexTool +#include "StoreGate/ReadHandle.h" +#include "TrkTrack/TrackCollection.h" + // Forward declarations class IInterface; class TH1I; @@ -50,6 +53,8 @@ class SCTLorentzMonTool : public SCTMotherTrigMonTool{ public: SCTLorentzMonTool(const std::string & type, const std::string & name, const IInterface* parent); virtual ~SCTLorentzMonTool(); + //initialize + virtual StatusCode initialize() final; /** @name Book, fill & check (reimplemented from baseclass) */ //@{ ///Book histograms in initialization @@ -95,7 +100,7 @@ private: std::string m_path; //@} /// Name of the Track collection to use - std::string m_tracksName; + SG::ReadHandleKey<TrackCollection> m_tracksName; //@name Service members diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h index 780e925481211ae63c655d0d79bce899e750776b..41484fc3a3b509eb470b9de18830a18df6e381e9 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h @@ -20,6 +20,9 @@ #include <string> #include <bitset> +#include "StoreGate/ReadHandleKey.h" +#include "EventInfo/EventInfo.h" + //Fwd declarations class IInterface; class StatusCode; @@ -64,6 +67,7 @@ private: // TrigDecisionTool ToolHandle<Trig::TrigDecisionTool> m_trigDec; + SG::ReadHandleKey<EventInfo> m_eventInfoKey; }; #endif diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h index cf65d93d3ce7752556d8451989d043ad96c421a1..56ec071c6aac0ae0decd57bd89808a4ce0e84b9f 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h @@ -32,6 +32,9 @@ #include "GaudiKernel/ServiceHandle.h" //#include "GaudiKernel/ToolHandle.h" +#include "StoreGate/ReadHandleKey.h" +#include "InDetRawData/SCT_RDO_Container.h" + // Forward declarations class IInterface; class TH1I; @@ -59,6 +62,8 @@ class SCTRatioNoiseMonTool : public SCTMotherTrigMonTool{ public: SCTRatioNoiseMonTool(const std::string & type, const std::string & name, const IInterface* parent); virtual ~SCTRatioNoiseMonTool(); + // initialize + virtual StatusCode initialize() final; /** @name Book, fill & check (reimplemented from baseclass) */ //@{ ///Book histograms in initialization @@ -233,7 +238,7 @@ private: //@name Service members //@{ /// Data object name: for the SCT this is "SCT_RDOs" - std::string m_dataObjectName; + SG::ReadHandleKey<SCT_RDO_Container> m_dataObjectName; ///SCT Helper class const SCT_ID* m_pSCTHelper; //SCT Detector Manager diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h index 47af0ded5d34f70541342d4408d9b60898b7b9fa..a08cb83e0b7ecd1f8bd11b423a0c0127d3fd5eba 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h @@ -27,6 +27,9 @@ #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" +#include "StoreGate/ReadHandleKey.h" +#include "TrkTrack/TrackCollection.h" + // Forward declarations class IInterface; class TH1I; @@ -42,6 +45,8 @@ class SCTTracksMonTool : public SCTMotherTrigMonTool{ public: SCTTracksMonTool(const std::string & type, const std::string & name, const IInterface* parent); virtual ~SCTTracksMonTool(); + //initialize + virtual StatusCode initialize() final; /** @name Book, fill & check (reimplemented from baseclass) */ //@{ ///Book histograms in initialization @@ -142,7 +147,7 @@ private: bool m_useIDGlobal; //@} /// Name of the Track collection to use - std::string m_tracksName; + SG::ReadHandleKey<TrackCollection> m_tracksName; /// Cut on number of SCT hits on track int m_trackHitCut; /// CheckHists() frequency diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx index b5d27b25411b988e059129dae13370a7afcb5104..433d86bb33697a8fa89e48e93cdd508ce11df4b7 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx @@ -37,7 +37,6 @@ #include "InDetIdentifier/SCT_ID.h" #include "InDetReadoutGeometry/SCT_DetectorManager.h" #include "InDetReadoutGeometry/SiDetectorElement.h" -#include "xAODEventInfo/EventInfo.h" #include "cArrayUtilities.h" #include "StoreGate/ReadHandle.h" #include <vector> @@ -181,7 +180,7 @@ SCTErrMonTool::SCTErrMonTool(const std::string &type, const std::string &name, c // m_doPerLumiErrors{}, property // m_doErr2DPerLumiHists{}, property // m_min_stat_ineff_mod{}, property - m_dataObjectName{}, + m_dataObjectName(std::string("SCT_RDOs")), m_pSCTHelper{}, m_ConfigurationSvc("InDetSCT_ConfigurationConditionsSvc", name), m_flaggedSvc("InDetSCT_FlaggedConditionSvc", name), @@ -227,342 +226,346 @@ SCTErrMonTool::SCTErrMonTool(const std::string &type, const std::string &name, c m_ModulesThreshold( 2.5 ), //m_DisabledDetectorCoverageVsLB{}, //m_ErrorDetectorCoverageVsLB{}, - m_TotalDetectorCoverageVsLB{} { - /** - * sroe 3 Sept 2015: - * histoPathBase is declared as a property in the base class, assigned to m_path - * with default as empty string. - * Declaring it here as well gives rise to compilation warning - * WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 - * declareProperty("histoPathBase", m_stream = "/stat"); - **/ - - m_stream = "/stat"; - declareProperty("CheckRate", m_checkrate = 1000); - declareProperty("runOnline", m_runOnline = false); - declareProperty("CheckRecent", m_checkrecent = 20); - declareProperty("doPositiveEndcap", m_doPositiveEndcap = true); - declareProperty("doNegativeEndcap", m_doNegativeEndcap = true); - declareProperty("EvtsBins", m_evtsbins = 5000); - declareProperty("MakeConfHisto", m_makeConfHisto = true); - declareProperty("conditionsService", m_ConfigurationSvc); - declareProperty("flaggedService", m_flaggedSvc); - - // Thresholds for the SCTConf histogram - declareProperty("error_threshold", m_errThreshold = 0.7); - declareProperty("efficiency_threshold", m_effThreshold = 0.9); - declareProperty("noise_threshold", m_noiseThreshold = 150); - // Min stats per layer to use for number of inefficient modules - declareProperty("MinStatsForInEffModules", m_min_stat_ineff_mod = 500.0); - - declareProperty("DoPerLumiErrors", m_doPerLumiErrors = true); - declareProperty("DoErr2DPerLumiHists", m_doErr2DPerLumiHists = false); - declareProperty("checkBadModules", m_checkBadModules); - declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online); - //Detector Coverage Tool switch - declareProperty("CoverageCheck",m_CoverageCheck=false); - - } - -// ==================================================================================================== -//==================================================================================================== -StatusCode SCTErrMonTool::initialize() { - if (detStore()->retrieve(m_sctManager, "SCT").isFailure()){ - msg(MSG::ERROR) << "Could not retrieve SCT Detector Manager" << endmsg; - return StatusCode::FAILURE; - } - return ManagedMonitorToolBase::initialize(); -} - -//==================================================================================================== -// ==================================================================================================== -SCTErrMonTool::~SCTErrMonTool() { - - for (int reg(0); reg != NREGIONS_INC_GENERAL; ++reg) { - for (int layer(0); layer != SCT_Monitoring::N_ENDCAPSx2; ++layer) { - for (int errType(0); errType != N_ERRTYPES; ++errType) { - if(m_allErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_allErrsPerLumi[errType][reg][layer]); - if(m_pallErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_pallErrsPerLumi[errType][reg][layer]); - } - } - } - - free(nErrors_buf); - free(nLinksWithErrors_buf); -} - -// ==================================================================================================== -// SCTErrMonTool :: transfer [enum ErrorTypes] -> [SCT_ByteStreamErrors] -// ==================================================================================================== -int -SCTErrMonTool::errorsToGet(int errtype) { - if (errtype == ABCD) { - return SCT_ByteStreamErrors::ABCDError; - } - if (errtype == RAW) { - return SCT_ByteStreamErrors::RawError; - } - if (errtype == TIMEOUT) { - return SCT_ByteStreamErrors::TimeOutError; - } - if (errtype == LVL1ID) { - return SCT_ByteStreamErrors::LVL1IDError; - } - if (errtype == BCID) { - return SCT_ByteStreamErrors::BCIDError; - } - if (errtype == PREAMBLE) { - return SCT_ByteStreamErrors::PreambleError; - } - if (errtype == FORMATTER) { - return SCT_ByteStreamErrors::FormatterError; - } - if (errtype == MASKEDLINKS) { - return SCT_ByteStreamErrors::MaskedLink; - } - if (errtype == RODCLOCK) { - return SCT_ByteStreamErrors::RODClockError; - } - if (errtype == TRUNCATEDROD) { - return SCT_ByteStreamErrors::TruncatedROD; - } - if (errtype == ROBFRAG) { - return SCT_ByteStreamErrors::ROBFragmentError; - } - if (errtype == BSPARSE) { - return SCT_ByteStreamErrors::ByteStreamParseError; - } - if (errtype == MISSINGLINK) { - return SCT_ByteStreamErrors::MissingLinkHeaderError; - } - if (errtype == MASKEDRODS) { - return SCT_ByteStreamErrors::MaskedROD; - } - if (errtype == ABCDChip0) { - return SCT_ByteStreamErrors::ABCDError_Chip0; - } - if (errtype == ABCDChip1) { - return SCT_ByteStreamErrors::ABCDError_Chip1; - } - if (errtype == ABCDChip2) { - return SCT_ByteStreamErrors::ABCDError_Chip2; - } - if (errtype == ABCDChip3) { - return SCT_ByteStreamErrors::ABCDError_Chip3; - } - if (errtype == ABCDChip4) { - return SCT_ByteStreamErrors::ABCDError_Chip4; - } - if (errtype == ABCDChip5) { - return SCT_ByteStreamErrors::ABCDError_Chip5; - } - if (errtype == ABCDError1) { - return SCT_ByteStreamErrors::ABCDError_Error1; - } - if (errtype == ABCDError2) { - return SCT_ByteStreamErrors::ABCDError_Error2; - } - if (errtype == ABCDError4) { - return SCT_ByteStreamErrors::ABCDError_Error4; - } - return errtype; -} - -// ==================================================================================================== -// SCTErrMonTool :: transfer [enum ErrorTypes] -> [TString ErrorName] -// ==================================================================================================== -TString -SCTErrMonTool::errorsString(int errtype) { - if (errtype == ABCD) { - return "ABCDerrs"; - } - if (errtype == RAW) { - return "Rawerrs"; - } - if (errtype == TIMEOUT) { - return "TimeOut"; - } - if (errtype == LVL1ID) { - return "LVL1IDerrs"; - } - if (errtype == BCID) { - return "BCIDerrs"; - } - if (errtype == PREAMBLE) { - return "Preamble"; - } - if (errtype == FORMATTER) { - return "Formattererrs"; - } - if (errtype == MASKEDLINKS) { - return "MaskedLinkLink"; - } - if (errtype == RODCLOCK) { - return "RODClockerrs"; - } - if (errtype == TRUNCATEDROD) { - return "TruncatedROD"; - } - if (errtype == ROBFRAG) { - return "ROBFragment"; - } - if (errtype == BSPARSE) { - return "BSParseerrs"; - } - if (errtype == MISSINGLINK) { - return "MissingLink"; - } - if (errtype == MASKEDRODS) { - return "MaskedROD"; - } - if (errtype == SUMMARY) { - return "NumberOfErrors"; - } - if (errtype == BADERR) { - return "NumberOfBadErrors"; - } - if (errtype == LINKLEVEL) { - return "NumberOfLinkLevelErrors"; - } - if (errtype == RODLEVEL) { - return "NumberOfRODLevelErrors"; - } - if (errtype == MASKEDLINKALL) { - return "MaskedLink"; - } - if (errtype == ABCDChip0) { - return "ABCDChip0"; - } - if (errtype == ABCDChip1) { - return "ABCDChip1"; - } - if (errtype == ABCDChip2) { - return "ABCDChip2"; - } - if (errtype == ABCDChip3) { - return "ABCDChip3"; - } - if (errtype == ABCDChip4) { - return "ABCDChip4"; - } - if (errtype == ABCDChip5) { - return "ABCDChip5"; - } - if (errtype == ABCDError1) { - return "ABCDError1"; - } - if (errtype == ABCDError2) { - return "ABCDError2"; - } - if (errtype == ABCDError4) { - return "ABCDError4"; - } - return ""; -} - -// ==================================================================================================== -// SCTErrMonTool :: copyHistograms -// This function is used for copying histograms which is required to change their directories. -// If you change original ones immediately, you cannot see them in the web display for a while -// until new configuration for web display is applied. -// So you should copy histograms in the new directories in this function once, -// and then if you have new configuration for the webdisplay, you can delete this function and change original histograms. -// ==================================================================================================== -StatusCode -SCTErrMonTool::copyHistograms() { - - // BSError histograms - int nlayer = 0; - const std::string m_errorsNames[] = { - "ABCD", "Raw", "TimeOut", "", "", "", "", "", "", "", - "", "BSParse", "MissingLink", "", "", "", "", "", - "", "", "", "", "", "", "summary", "badError", "", "" - }; - for (int reg(0); reg != 3; ++reg) { - nlayer = 0; - if(reg==0)nlayer = N_BARRELSx2; - else if(reg==1||reg==2) nlayer = N_DISKSx2; - for (int layer(0); layer != nlayer; ++layer) { - for (int errType(0); errType != N_ERRTYPES; ++errType) { - if(m_errorsNames[errType]=="")continue; - if (m_doPerLumiErrors) { - if (m_doErr2DPerLumiHists) { - const int xbins(m_allErrsPerLumi[errType][reg][layer]->GetNbinsX() + 1); - const int ybins(m_allErrsPerLumi[errType][reg][layer]->GetNbinsY() + 1); - for (int xb(1); xb != xbins; ++xb) { - for (int yb(1); yb != ybins; ++yb) { - m_pallErrsPerLumi_tmp[errType][reg][layer] - ->SetBinContent(xb,yb,m_pallErrsPerLumi[errType][reg][layer]->GetBinContent(xb,yb)); - double nentry=0; - double content=0; - double error=0; - m_allErrsPerLumi[errType][reg][layer]->GetBinInfo(xb,yb,nentry,content,error); - for(int ientry=0; ientry<nentry; ientry++){ - m_allErrsPerLumi_tmp[errType][reg][layer] - ->Fill(m_allErrsPerLumi[errType][reg][layer]->GetXaxis()->GetBinCenter(xb), - m_allErrsPerLumi[errType][reg][layer]->GetYaxis()->GetBinCenter(yb), - m_allErrsPerLumi[errType][reg][layer]->GetBinContent(xb,yb)); - } - } - } - } - } - const int xbins(m_allErrs[errType][reg][layer]->GetNbinsX() + 1); - const int ybins(m_allErrs[errType][reg][layer]->GetNbinsY() + 1); - for (int xb(1); xb != xbins; ++xb) { - for (int yb(1); yb != ybins; ++yb) { - m_pallErrs_tmp[errType][reg][layer] - ->SetBinContent(xb,yb,m_pallErrs[errType][reg][layer]->GetBinContent(xb,yb)); - double nentry=0; - double content=0; - double error=0; - m_allErrs[errType][reg][layer]->GetBinInfo(xb,yb,nentry,content,error); - if(m_allErrs[errType][reg][layer]->GetBinContent(xb,yb)>0) - for(int ientry=0; ientry<nentry; ientry++){ - m_allErrs_tmp[errType][reg][layer] - ->Fill(m_allErrs[errType][reg][layer]->GetXaxis()->GetBinCenter(xb), - m_allErrs[errType][reg][layer]->GetYaxis()->GetBinCenter(yb), - m_allErrs[errType][reg][layer]->GetBinContent(xb,yb)); - } - } - } - } - } - } - - //RODLevelErrors histograms - - for (int reg = 0; reg != NREGIONS_INC_GENERAL; ++reg) { - const int xbins(m_LinksWithRODErrorsVsLB_check[reg]->GetNbinsX() + 1); - for (int xb(1); xb != xbins; ++xb) { - double nentry=m_LinksWithRODErrorsVsLB[reg]->GetBinEntries(xb); - for(int ientry=0; ientry<nentry; ientry++){ - m_LinksWithRODErrorsVsLB_check[reg]->Fill(m_LinksWithRODErrorsVsLB[reg]->GetXaxis()->GetBinCenter(xb), - m_LinksWithRODErrorsVsLB[reg]->GetBinContent(xb)); - } - } - } - - return StatusCode::SUCCESS; -} - -// ==================================================================================================== -// SCTErrMonTool :: bookHistograms -// ==================================================================================================== -StatusCode -SCTErrMonTool::bookHistograms() { - - ATH_MSG_DEBUG(" initialize being called "); - if (newRunFlag()) { - m_numberOfEvents = 0; - if (AthenaMonManager::dataType() == AthenaMonManager::cosmics) { - m_checkrate = 100; - } - } - if (ManagedMonitorToolBase::newLumiBlockFlag()) { - m_numberOfEventsLumi = 0; - } - m_dataObjectName = "SCT_RDOs"; + m_TotalDetectorCoverageVsLB{}, + m_eventInfoKey(std::string("")) { + /** + * sroe 3 Sept 2015: + * histoPathBase is declared as a property in the base class, assigned to m_path + * with default as empty string. + * Declaring it here as well gives rise to compilation warning + * WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023 + * declareProperty("histoPathBase", m_stream = "/stat"); + **/ + + m_stream = "/stat"; + declareProperty("CheckRate", m_checkrate = 1000); + declareProperty("runOnline", m_runOnline = false); + declareProperty("CheckRecent", m_checkrecent = 20); + declareProperty("doPositiveEndcap", m_doPositiveEndcap = true); + declareProperty("doNegativeEndcap", m_doNegativeEndcap = true); + declareProperty("EvtsBins", m_evtsbins = 5000); + declareProperty("MakeConfHisto", m_makeConfHisto = true); + declareProperty("conditionsService", m_ConfigurationSvc); + declareProperty("flaggedService", m_flaggedSvc); + + // Thresholds for the SCTConf histogram + declareProperty("error_threshold", m_errThreshold = 0.7); + declareProperty("efficiency_threshold", m_effThreshold = 0.9); + declareProperty("noise_threshold", m_noiseThreshold = 150); + // Min stats per layer to use for number of inefficient modules + declareProperty("MinStatsForInEffModules", m_min_stat_ineff_mod = 500.0); + + declareProperty("DoPerLumiErrors", m_doPerLumiErrors = true); + declareProperty("DoErr2DPerLumiHists", m_doErr2DPerLumiHists = false); + declareProperty("checkBadModules", m_checkBadModules); + declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online); + //Detector Coverage Tool switch + declareProperty("CoverageCheck",m_CoverageCheck=false); + + } + + // ==================================================================================================== + //==================================================================================================== + StatusCode SCTErrMonTool::initialize() { + if (detStore()->retrieve(m_sctManager, "SCT").isFailure()){ + msg(MSG::ERROR) << "Could not retrieve SCT Detector Manager" << endmsg; + return StatusCode::FAILURE; + } + + ATH_CHECK( m_dataObjectName.initialize() ); + ATH_CHECK( m_eventInfoKey.initialize() ); + + return ManagedMonitorToolBase::initialize(); + } + + //==================================================================================================== + // ==================================================================================================== + SCTErrMonTool::~SCTErrMonTool() { + + for (int reg(0); reg != NREGIONS_INC_GENERAL; ++reg) { + for (int layer(0); layer != SCT_Monitoring::N_ENDCAPSx2; ++layer) { + for (int errType(0); errType != N_ERRTYPES; ++errType) { + if(m_allErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_allErrsPerLumi[errType][reg][layer]); + if(m_pallErrsPerLumi[errType][reg][layer])LWHist::safeDelete(m_pallErrsPerLumi[errType][reg][layer]); + } + } + } + + free(nErrors_buf); + free(nLinksWithErrors_buf); + } + + // ==================================================================================================== + // SCTErrMonTool :: transfer [enum ErrorTypes] -> [SCT_ByteStreamErrors] + // ==================================================================================================== + int + SCTErrMonTool::errorsToGet(int errtype) { + if (errtype == ABCD) { + return SCT_ByteStreamErrors::ABCDError; + } + if (errtype == RAW) { + return SCT_ByteStreamErrors::RawError; + } + if (errtype == TIMEOUT) { + return SCT_ByteStreamErrors::TimeOutError; + } + if (errtype == LVL1ID) { + return SCT_ByteStreamErrors::LVL1IDError; + } + if (errtype == BCID) { + return SCT_ByteStreamErrors::BCIDError; + } + if (errtype == PREAMBLE) { + return SCT_ByteStreamErrors::PreambleError; + } + if (errtype == FORMATTER) { + return SCT_ByteStreamErrors::FormatterError; + } + if (errtype == MASKEDLINKS) { + return SCT_ByteStreamErrors::MaskedLink; + } + if (errtype == RODCLOCK) { + return SCT_ByteStreamErrors::RODClockError; + } + if (errtype == TRUNCATEDROD) { + return SCT_ByteStreamErrors::TruncatedROD; + } + if (errtype == ROBFRAG) { + return SCT_ByteStreamErrors::ROBFragmentError; + } + if (errtype == BSPARSE) { + return SCT_ByteStreamErrors::ByteStreamParseError; + } + if (errtype == MISSINGLINK) { + return SCT_ByteStreamErrors::MissingLinkHeaderError; + } + if (errtype == MASKEDRODS) { + return SCT_ByteStreamErrors::MaskedROD; + } + if (errtype == ABCDChip0) { + return SCT_ByteStreamErrors::ABCDError_Chip0; + } + if (errtype == ABCDChip1) { + return SCT_ByteStreamErrors::ABCDError_Chip1; + } + if (errtype == ABCDChip2) { + return SCT_ByteStreamErrors::ABCDError_Chip2; + } + if (errtype == ABCDChip3) { + return SCT_ByteStreamErrors::ABCDError_Chip3; + } + if (errtype == ABCDChip4) { + return SCT_ByteStreamErrors::ABCDError_Chip4; + } + if (errtype == ABCDChip5) { + return SCT_ByteStreamErrors::ABCDError_Chip5; + } + if (errtype == ABCDError1) { + return SCT_ByteStreamErrors::ABCDError_Error1; + } + if (errtype == ABCDError2) { + return SCT_ByteStreamErrors::ABCDError_Error2; + } + if (errtype == ABCDError4) { + return SCT_ByteStreamErrors::ABCDError_Error4; + } + return errtype; + } + + // ==================================================================================================== + // SCTErrMonTool :: transfer [enum ErrorTypes] -> [TString ErrorName] + // ==================================================================================================== + TString + SCTErrMonTool::errorsString(int errtype) { + if (errtype == ABCD) { + return "ABCDerrs"; + } + if (errtype == RAW) { + return "Rawerrs"; + } + if (errtype == TIMEOUT) { + return "TimeOut"; + } + if (errtype == LVL1ID) { + return "LVL1IDerrs"; + } + if (errtype == BCID) { + return "BCIDerrs"; + } + if (errtype == PREAMBLE) { + return "Preamble"; + } + if (errtype == FORMATTER) { + return "Formattererrs"; + } + if (errtype == MASKEDLINKS) { + return "MaskedLinkLink"; + } + if (errtype == RODCLOCK) { + return "RODClockerrs"; + } + if (errtype == TRUNCATEDROD) { + return "TruncatedROD"; + } + if (errtype == ROBFRAG) { + return "ROBFragment"; + } + if (errtype == BSPARSE) { + return "BSParseerrs"; + } + if (errtype == MISSINGLINK) { + return "MissingLink"; + } + if (errtype == MASKEDRODS) { + return "MaskedROD"; + } + if (errtype == SUMMARY) { + return "NumberOfErrors"; + } + if (errtype == BADERR) { + return "NumberOfBadErrors"; + } + if (errtype == LINKLEVEL) { + return "NumberOfLinkLevelErrors"; + } + if (errtype == RODLEVEL) { + return "NumberOfRODLevelErrors"; + } + if (errtype == MASKEDLINKALL) { + return "MaskedLink"; + } + if (errtype == ABCDChip0) { + return "ABCDChip0"; + } + if (errtype == ABCDChip1) { + return "ABCDChip1"; + } + if (errtype == ABCDChip2) { + return "ABCDChip2"; + } + if (errtype == ABCDChip3) { + return "ABCDChip3"; + } + if (errtype == ABCDChip4) { + return "ABCDChip4"; + } + if (errtype == ABCDChip5) { + return "ABCDChip5"; + } + if (errtype == ABCDError1) { + return "ABCDError1"; + } + if (errtype == ABCDError2) { + return "ABCDError2"; + } + if (errtype == ABCDError4) { + return "ABCDError4"; + } + return ""; + } + + // ==================================================================================================== + // SCTErrMonTool :: copyHistograms + // This function is used for copying histograms which is required to change their directories. + // If you change original ones immediately, you cannot see them in the web display for a while + // until new configuration for web display is applied. + // So you should copy histograms in the new directories in this function once, + // and then if you have new configuration for the webdisplay, you can delete this function and change original histograms. + // ==================================================================================================== + StatusCode + SCTErrMonTool::copyHistograms() { + + // BSError histograms + int nlayer = 0; + const std::string m_errorsNames[] = { + "ABCD", "Raw", "TimeOut", "", "", "", "", "", "", "", + "", "BSParse", "MissingLink", "", "", "", "", "", + "", "", "", "", "", "", "summary", "badError", "", "" + }; + for (int reg(0); reg != 3; ++reg) { + nlayer = 0; + if(reg==0)nlayer = N_BARRELSx2; + else if(reg==1||reg==2) nlayer = N_DISKSx2; + for (int layer(0); layer != nlayer; ++layer) { + for (int errType(0); errType != N_ERRTYPES; ++errType) { + if(m_errorsNames[errType]=="")continue; + if (m_doPerLumiErrors) { + if (m_doErr2DPerLumiHists) { + const int xbins(m_allErrsPerLumi[errType][reg][layer]->GetNbinsX() + 1); + const int ybins(m_allErrsPerLumi[errType][reg][layer]->GetNbinsY() + 1); + for (int xb(1); xb != xbins; ++xb) { + for (int yb(1); yb != ybins; ++yb) { + m_pallErrsPerLumi_tmp[errType][reg][layer] + ->SetBinContent(xb,yb,m_pallErrsPerLumi[errType][reg][layer]->GetBinContent(xb,yb)); + double nentry=0; + double content=0; + double error=0; + m_allErrsPerLumi[errType][reg][layer]->GetBinInfo(xb,yb,nentry,content,error); + for(int ientry=0; ientry<nentry; ientry++){ + m_allErrsPerLumi_tmp[errType][reg][layer] + ->Fill(m_allErrsPerLumi[errType][reg][layer]->GetXaxis()->GetBinCenter(xb), + m_allErrsPerLumi[errType][reg][layer]->GetYaxis()->GetBinCenter(yb), + m_allErrsPerLumi[errType][reg][layer]->GetBinContent(xb,yb)); + } + } + } + } + } + const int xbins(m_allErrs[errType][reg][layer]->GetNbinsX() + 1); + const int ybins(m_allErrs[errType][reg][layer]->GetNbinsY() + 1); + for (int xb(1); xb != xbins; ++xb) { + for (int yb(1); yb != ybins; ++yb) { + m_pallErrs_tmp[errType][reg][layer] + ->SetBinContent(xb,yb,m_pallErrs[errType][reg][layer]->GetBinContent(xb,yb)); + double nentry=0; + double content=0; + double error=0; + m_allErrs[errType][reg][layer]->GetBinInfo(xb,yb,nentry,content,error); + if(m_allErrs[errType][reg][layer]->GetBinContent(xb,yb)>0) + for(int ientry=0; ientry<nentry; ientry++){ + m_allErrs_tmp[errType][reg][layer] + ->Fill(m_allErrs[errType][reg][layer]->GetXaxis()->GetBinCenter(xb), + m_allErrs[errType][reg][layer]->GetYaxis()->GetBinCenter(yb), + m_allErrs[errType][reg][layer]->GetBinContent(xb,yb)); + } + } + } + } + } + } + + //RODLevelErrors histograms + + for (int reg = 0; reg != NREGIONS_INC_GENERAL; ++reg) { + const int xbins(m_LinksWithRODErrorsVsLB_check[reg]->GetNbinsX() + 1); + for (int xb(1); xb != xbins; ++xb) { + double nentry=m_LinksWithRODErrorsVsLB[reg]->GetBinEntries(xb); + for(int ientry=0; ientry<nentry; ientry++){ + m_LinksWithRODErrorsVsLB_check[reg]->Fill(m_LinksWithRODErrorsVsLB[reg]->GetXaxis()->GetBinCenter(xb), + m_LinksWithRODErrorsVsLB[reg]->GetBinContent(xb)); + } + } + } + + return StatusCode::SUCCESS; + } + + // ==================================================================================================== + // SCTErrMonTool :: bookHistograms + // ==================================================================================================== + StatusCode + SCTErrMonTool::bookHistograms() { + + ATH_MSG_DEBUG(" initialize being called "); + if (newRunFlag()) { + m_numberOfEvents = 0; + if (AthenaMonManager::dataType() == AthenaMonManager::cosmics) { + m_checkrate = 100; + } + } + if (ManagedMonitorToolBase::newLumiBlockFlag()) { + m_numberOfEventsLumi = 0; + } const InDetDD::SCT_DetectorManager *mgr; // confusingly this is in a dedicated namespace ATH_CHECK(detStore()->retrieve(mgr, "SCT")); ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); @@ -672,7 +675,7 @@ StatusCode SCTErrMonTool::fillHistograms() { typedef SCT_RDORawData SCTRawDataType; - SG::ReadHandle<xAOD::EventInfo> pEvent; + SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey); if (not pEvent.isValid()) { ATH_MSG_WARNING("Could not retrieve event info!"); return StatusCode::RECOVERABLE; @@ -1010,7 +1013,7 @@ SCTErrMonTool::numByteStreamErrors(const std::set<IdentifierHash> *errors, int & StatusCode SCTErrMonTool::fillByteStreamErrors() { // Masked and ROB Fragment vs. lb - SG::ReadHandle<xAOD::EventInfo> pEvent; + SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey); msg(MSG::INFO) << "INFO|| monitor ||INFO" << endmsg; if (not pEvent.isValid()) { diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx index cc2a113ecd8d42ff044c9ac886df964df491a750..710789083a27bc994f9a881f8ab742e7177c8ce1 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx @@ -30,7 +30,6 @@ #include "Identifier/IdentifierHash.h" #include "AthenaMonitoring/AthenaMonManager.h" #include "EventInfo/EventID.h" -#include "EventInfo/EventInfo.h" #include "StoreGate/ReadHandle.h" #include "SCT_ConditionsServices/ISCT_ConfigurationConditionsSvc.h" @@ -52,7 +51,6 @@ #include "TrkMeasurementBase/MeasurementBase.h" #include "TrkParameters/TrackParameters.h" -#include "CommissionEvent/ComTime.h" #include "TrkTrackSummary/TrackSummary.h" // SCT @@ -136,7 +134,7 @@ SCTHitEffMonTool::SCTHitEffMonTool(const string &type, const string &name, const mgr(nullptr), m_pSCTHelper(0), m_pManager(0), - m_TrackName("ResolvedSCTTracks"),// original track collection + m_TrackName(std::string("ResolvedSCTTracks")),// original track collection m_chrono(nullptr), m_tracks(nullptr),// original tracks m_TrackSum(nullptr), @@ -202,7 +200,8 @@ SCTHitEffMonTool::SCTHitEffMonTool(const string &type, const string &name, const m_badChipMap(nullptr), m_pixelId(nullptr), m_sctId(nullptr), - m_trtId(nullptr) { + m_trtId(nullptr), + m_comTimeName(std::string("TRT_Phase")) { declareProperty("TrackName", m_TrackName); declareProperty("IsCosmic", m_isCosmic); declareProperty("IsSim", m_isSim); @@ -232,7 +231,7 @@ SCTHitEffMonTool::SCTHitEffMonTool(const string &type, const string &name, const declareProperty("RunningMode", m_RunningMode); declareProperty("effDistanceCut", m_effdistcut); declareProperty("ChronoTime", m_chronotime); - declareProperty("SCT_ClusterContainer", m_sctContainerName = "SCT_ClusterCollection"); + declareProperty("SCT_ClusterContainer", m_sctContainerName = std::string("SCT_Clusters")); declareProperty("ROTCreator", m_rotcreator); declareProperty("HoleSearch", m_holeSearchTool); declareProperty("ResPullCalc", m_residualPullCalculator); @@ -389,6 +388,10 @@ SCTHitEffMonTool::initialize() { } } + ATH_CHECK( m_comTimeName.initialize(m_useTRTPhase or m_isCosmic) ); + ATH_CHECK( m_eventInfoKey.initialize() ); + ATH_CHECK( m_TrackName.initialize() ); + return StatusCode::SUCCESS; } @@ -1103,26 +1106,25 @@ SCTHitEffMonTool::fillHistograms() { errorcheck::ReportMessage::hideErrorLocus(true); VERBOSE("SCTHitEffMonTool::fillHistograms()"); - string m_comTimeName("TRT_Phase"); Double_t timecor(-20.); - SG::ReadHandle<ComTime> theComTime(m_comTimeName); if (m_useTRTPhase or m_isCosmic) { - if (evtStore()->contains<ComTime>(m_comTimeName)) { + if (evtStore()->contains<ComTime>(m_comTimeName.key())) { + SG::ReadHandle<ComTime> theComTime(m_comTimeName); if (theComTime.isValid()) { timecor = theComTime->getTime(); - VERBOSE("Retrieved ComTime object with name " << m_comTimeName << " found: Time = " << timecor); + VERBOSE("Retrieved ComTime object with name " << m_comTimeName.key() << " found: Time = " << timecor); } else { timecor = -18.; - WARNING("ComTime object not found with name " << m_comTimeName); + WARNING("ComTime object not found with name " << m_comTimeName.key()); } } else { timecor = -16.; - ERROR("ComTime object not in store with name " << m_comTimeName); + ERROR("ComTime object not in store with name " << m_comTimeName.key()); } } // If we are going to use TRT phase in anger, need run-dependent corrections. EventID *eventID; - SG::ReadHandle<EventInfo> pEvent; + SG::ReadHandle<EventInfo> pEvent(m_eventInfoKey); if (not pEvent.isValid()) { return ERROR("Could not find EventInfo"), StatusCode::FAILURE; } @@ -1139,27 +1141,27 @@ SCTHitEffMonTool::fillHistograms() { // ---- First try if m_tracksName is a TrackCollection SG::ReadHandle<TrackCollection>m_tracks(m_TrackName); - if (evtStore()->contains<TrackCollection> (m_TrackName)) { + if (evtStore()->contains<TrackCollection> (m_TrackName.key())) { if (not m_tracks.isValid()) { - WARNING("Tracks not found: " << m_tracks << " / " << m_TrackName); + WARNING("Tracks not found: " << m_tracks << " / " << m_TrackName.key()); if (m_chronotime) { m_chrono->chronoStop("SCTHitEff"); } return StatusCode::SUCCESS; }else { - VERBOSE("Successfully retrieved " << m_TrackName << " : " << m_tracks->size() << " items"); + VERBOSE("Successfully retrieved " << m_TrackName.key() << " : " << m_tracks->size() << " items"); } } else { - WARNING("Collection " << m_TrackName << " not found"); + WARNING("Collection " << m_TrackName.key() << " not found"); if (m_chronotime) { m_chrono->chronoStop("SCTHitEff"); } return StatusCode::SUCCESS; } - SG::ReadHandle<InDet::SCT_ClusterContainer> p_sctclcontainer("SCT_Clusters"); + SG::ReadHandle<InDet::SCT_ClusterContainer> p_sctclcontainer(m_sctContainerName); if (not p_sctclcontainer.isValid()) { - WARNING("SCT clusters container not found: " << p_sctclcontainer); + WARNING("SCT clusters container not found: " << m_sctContainerName.key()); if (m_chronotime) { m_chrono->chronoStop("SCTHitEff"); } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx index ba0e6f09f0b237eec62f5fbcc1aa1454bfd28b7f..61940ca5bfc4a1843331ee7b852ba464115b5e5a 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx @@ -49,13 +49,11 @@ #include "InDetPrepRawData/SCT_ClusterContainer.h" // ? #include "TrkSpacePoint/SpacePoint.h" #include "TrkSpacePoint/SpacePointCollection.h" -#include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" #include "TrkSpacePoint/SpacePointCLASS_DEF.h" // for TriggerType #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" -#include "InDetPrepRawData/SCT_ClusterContainer.h" #include "TrkTrack/TrackCollection.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" @@ -232,6 +230,7 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type, m_tbinfracVsLBECp(nullptr), m_tbinfracVsLBECm(nullptr), m_initialize(false), + m_SCTSPContainerName(std::string("SCT_SpacePoints")), m_noisyM100{}, m_noisyM1000{}, m_noisyM10000{}, @@ -301,8 +300,11 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type, m_hitoccTriggerECp_lb{}, m_hitoccTriggerECm_lb{}, // + m_dataObjectName(std::string("SCT_RDOs")), m_pSCTHelper(nullptr), - m_ConfigurationSvc("InDetSCT_ConfigurationConditionsSvc", name) { + m_ConfigurationSvc("InDetSCT_ConfigurationConditionsSvc", name), + m_eventInfoKey(std::string("")), + m_clusContainerKey("SCT_Clusters") { /** sroe 3 Sept 2015: histoPathBase is declared as a property in the base class, assigned to m_path with default as empty string. @@ -349,6 +351,16 @@ SCTHitsNoiseMonTool::~SCTHitsNoiseMonTool() { free(nHits_buf); } +// ==================================================================================================== +// ==================================================================================================== +StatusCode SCTHitsNoiseMonTool::initialize() { + ATH_CHECK(m_SCTSPContainerName.initialize()); + ATH_CHECK(m_dataObjectName.initialize()); + ATH_CHECK(m_eventInfoKey.initialize()); + ATH_CHECK(m_clusContainerKey.initialize()); + return StatusCode::SUCCESS; +} + // ==================================================================================================== // SCTHitsNoiseMonTool :: bookHistograms // ==================================================================================================== @@ -358,7 +370,6 @@ SCTHitsNoiseMonTool::bookHistograms() { if (newRunFlag()) { m_numberOfEvents = 0; } - m_dataObjectName = "SCT_RDOs"; // Get the helper: ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); ATH_CHECK(m_ConfigurationSvc.retrieve()); @@ -450,7 +461,6 @@ StatusCode SCTHitsNoiseMonTool::bookHistogramsRecurrent() { ATH_MSG_DEBUG("bookHistogramsRecurrent being called"); m_numberOfEvents = 0; - m_dataObjectName = "SCT_RDOs"; // Get the helper: ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); ATH_CHECK(m_ConfigurationSvc.retrieve()); @@ -809,7 +819,6 @@ SCTHitsNoiseMonTool::generalHistsandNoise() { return StatusCode::FAILURE; } // Get the space point container - m_SCTSPContainerName = "SCT_SpacePoints"; SG::ReadHandle<SpacePointContainer> sctContainer(m_SCTSPContainerName); if (not sctContainer.isValid()) { return StatusCode::FAILURE; @@ -1256,7 +1265,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() { // if(m_environment!=AthenaMonManager::online){ // Uncomment this line to turn off cluster hists in online // Fill Cluster size histogram - SG::ReadHandle<InDet::SCT_ClusterContainer> p_clucontainer("SCT_Clusters"); + SG::ReadHandle<InDet::SCT_ClusterContainer> p_clucontainer(m_clusContainerKey); if (not p_clucontainer.isValid()) { if (msgLvl(MSG::WARNING)) { msg(MSG::WARNING) << "Couldn't retrieve clusters" << endmsg; @@ -3058,7 +3067,7 @@ SCTHitsNoiseMonTool::bookSPvsEventNumber() { StatusCode SCTHitsNoiseMonTool::makeSPvsEventNumber() { // Retrieve the spacepoint collection - SG::ReadHandle<SpacePointContainer> SCT_spcontainer("SCT_SpacePoints"); + SG::ReadHandle<SpacePointContainer> SCT_spcontainer(m_SCTSPContainerName); // get space points for SCT from TDS if (not SCT_spcontainer.isValid()) { @@ -3143,11 +3152,11 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() { m_RDOsOnTracks.clear(); SG::ReadHandle<SCT_RDO_Container> p_rdocontainer(m_dataObjectName); if (not p_rdocontainer.isValid()) { - msg(MSG::FATAL) << "Could not find the data object " << m_dataObjectName << " !" << endmsg; + msg(MSG::FATAL) << "Could not find the data object " << m_dataObjectName.key() << " !" << endmsg; return StatusCode::FAILURE; } else { if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Data object " << m_dataObjectName << " found" << endmsg; + msg(MSG::DEBUG) << "Data object " << m_dataObjectName.key() << " found" << endmsg; } } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx index 18837d8ada7fb65f1610e0e11eb4c84b41fc0a75..a88e61ce95b88cd5e87bba316f276e31c854d325 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx @@ -26,7 +26,6 @@ #include "Identifier/Identifier.h" #include "InDetIdentifier/SCT_ID.h" #include "InDetReadoutGeometry/SCT_DetectorManager.h" -#include "TrkTrack/TrackCollection.h" #include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "InDetPrepRawData/SiCluster.h" #include "TrkParameters/TrackParameters.h" @@ -64,7 +63,7 @@ SCTLorentzMonTool::SCTLorentzMonTool(const string &type, const string &name, declareProperty("histoPathBase", m_stream = "/stat"); **/ m_stream = "/stat"; - declareProperty("tracksName", m_tracksName = "CombinedInDetTracks"); // this recommended + declareProperty("tracksName", m_tracksName = std::string("CombinedInDetTracks")); // this recommended declareProperty("TrackToVertexTool", m_trackToVertexTool); // for TrackToVertexTool m_numberOfEvents = 0; } @@ -75,6 +74,14 @@ SCTLorentzMonTool::~SCTLorentzMonTool() { // nada } +// ==================================================================================================== +// ==================================================================================================== +StatusCode SCTLorentzMonTool::initialize() { + ATH_CHECK( m_tracksName.initialize() ); + + return StatusCode::SUCCESS; +} + // ==================================================================================================== // SCTLorentzMonTool :: bookHistograms // ==================================================================================================== @@ -160,13 +167,13 @@ SCTLorentzMonTool::fillHistograms() { ATH_MSG_DEBUG("enters fillHistograms"); SG::ReadHandle<TrackCollection> tracks(m_tracksName); - if (evtStore()->contains<TrackCollection> (m_tracksName)) { + if (evtStore()->contains<TrackCollection> (m_tracksName.key())) { if (not tracks.isValid()) { - msg(MSG::WARNING) << " TrackCollection not found: Exit SCTLorentzTool" << m_tracksName << endmsg; + msg(MSG::WARNING) << " TrackCollection not found: Exit SCTLorentzTool" << m_tracksName.key() << endmsg; return StatusCode::SUCCESS; } } else { - msg(MSG::WARNING) << "Container " << m_tracksName << " not found. Exit SCTLorentzMonTool" << endmsg; + msg(MSG::WARNING) << "Container " << m_tracksName.key() << " not found. Exit SCTLorentzMonTool" << endmsg; return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx index 60007d625060d3fd3c9edf17bf7d91538a6e7014..cb6e7f963cf8d7eb979b5c143b8e19275f0d7fb5 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx @@ -25,7 +25,8 @@ SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string &type, const std::s m_doTrigger(true), m_isStream(false), m_firedTriggers(0), - m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool") { + m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), + m_eventInfoKey(std::string("ByteStreamEventInfo")) { declareProperty("doTrigger", m_doTrigger); } @@ -35,14 +36,17 @@ SCTMotherTrigMonTool::initialize() { msg(MSG::ERROR) << "Could not initialize Monitor tool base!" << endmsg; return StatusCode::FAILURE; } + + ATH_CHECK( m_eventInfoKey.initialize() ); + return StatusCode::SUCCESS; } // --------------------------------------------------------- StatusCode SCTMotherTrigMonTool::checkTriggers() { - if (evtStore()->contains<EventInfo>("ByteStreamEventInfo")) { - SG::ReadHandle<EventInfo> evtInfo("ByteStreamEventInfo"); + if (evtStore()->contains<EventInfo>(m_eventInfoKey.key())) { + SG::ReadHandle<EventInfo> evtInfo(m_eventInfoKey); m_firedTriggers = evtInfo->trigger_info()->level1TriggerType(); return StatusCode::SUCCESS; @@ -82,8 +86,8 @@ SCTMotherTrigMonTool::isCalibrationNoise(const std::string &L1_Item) { bool SCTMotherTrigMonTool::isStream(const std::string &StreamName) { - if (evtStore()->contains<EventInfo>("ByteStreamEventInfo")) { - SG::ReadHandle<EventInfo> evtInfo("ByteStreamEventInfo"); + if (evtStore()->contains<EventInfo>(m_eventInfoKey.key())) { + SG::ReadHandle<EventInfo> evtInfo(m_eventInfoKey); m_isStream = false; diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx index 8da03ec450c9dec98f418ff9da0e4a81ae888d3c..d136161f29d42eea171c42eab1c0b8a3fbbc4b61 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx @@ -232,7 +232,7 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string &type, m_path(""), m_tracksName(""), // never used? m_NOTrigger("L1_RD0_EMPTY"), - m_dataObjectName("SCT_RDOs"), + m_dataObjectName(std::string("SCT_RDOs")), m_pSCTHelper(nullptr), m_sctmgr(nullptr), m_pSummarySvc("SCT_ConditionsSummarySvc", name), @@ -263,6 +263,14 @@ SCTRatioNoiseMonTool::~SCTRatioNoiseMonTool() { // nada } +// ==================================================================================================== +// ==================================================================================================== +StatusCode SCTRatioNoiseMonTool::initialize() { + ATH_CHECK( m_dataObjectName.initialize() ); + + return StatusCode::SUCCESS; +} + // ==================================================================================================== // SCTRatioNoiseMonTool :: bookHistograms // ==================================================================================================== @@ -272,7 +280,6 @@ SCTRatioNoiseMonTool::bookHistogramsRecurrent() { if (newRunFlag()) { m_numberOfEvents = 0; } - m_dataObjectName = "SCT_RDOs"; ATH_MSG_DEBUG("initialize being called"); ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); if (m_checkBadModules) { @@ -296,7 +303,6 @@ StatusCode SCTRatioNoiseMonTool::bookHistograms() { m_path = ""; m_numberOfEvents = 0; - m_dataObjectName = "SCT_RDOs"; ATH_MSG_DEBUG("initialize being called"); ATH_CHECK(detStore()->retrieve(m_pSCTHelper, "SCT_ID")); if (m_checkBadModules) { diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx index 37d6b1cdfc797d27eb52d697cfffb5386a264a72..feb0acb9355ffaa2292df1b044019f3834f32951 100755 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx @@ -23,7 +23,6 @@ #include "Identifier/Identifier.h" #include "InDetIdentifier/SCT_ID.h" #include "InDetReadoutGeometry/SCT_DetectorManager.h" -#include "TrkTrack/TrackCollection.h" #include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "InDetPrepRawData/SiCluster.h" #include "TrkParameters/TrackParameters.h" @@ -33,6 +32,8 @@ // for GetKalmanUpdator #include "GaudiKernel/ListItem.h" +#include "StoreGate/ReadHandle.h" + using namespace std; using namespace SCT_Monitoring; @@ -128,7 +129,7 @@ SCTTracksMonTool::SCTTracksMonTool(const string &type, declareProperty("histoPathBase", m_stream = "/stat"); **/ m_stream = "/stat"; - declareProperty("tracksName", m_tracksName = "SCT_Cosmic_Tracks"); // "ExtendedTracks"); + declareProperty("tracksName", m_tracksName = std::string("SCT_Cosmic_Tracks")); // "ExtendedTracks"); declareProperty("trackHitCut", m_trackHitCut = 3); declareProperty("CheckRate", m_checkrate = 1000); declareProperty("doPositiveEndcap", m_doPositiveEndcap = true); @@ -147,6 +148,14 @@ SCTTracksMonTool::~SCTTracksMonTool() { // nop } +// ==================================================================================================== +// ==================================================================================================== +StatusCode SCTTracksMonTool::initialize() { + ATH_MSG_INFO( m_tracksName.initialize() ); + + return StatusCode::SUCCESS; +} + // ==================================================================================================== // SCTTracksMonTool :: bookHistograms // ==================================================================================================== @@ -273,14 +282,12 @@ SCTTracksMonTool::fillHistograms() { if (m_doTrigger and SCTMotherTrigMonTool::CheckTriggers() != StatusCode::SUCCESS) { ATH_MSG_WARNING("Triggers not found!"); } - const TrackCollection *tracks(nullptr); + SG::ReadHandle<TrackCollection> tracks(m_tracksName); const bool doThisSubsystem[N_REGIONS] = { m_doNegativeEndcap, true, m_doPositiveEndcap }; - if (evtStore()->contains<TrackCollection> (m_tracksName)) { - CHECK(evtStore()->retrieve(tracks, m_tracksName)); - }else { - ATH_MSG_WARNING("No collection named " << m_tracksName << " in StoreGate"); + if (not evtStore()->contains<TrackCollection> (m_tracksName.key())) { + ATH_MSG_WARNING("No collection named " << m_tracksName.key() << " in StoreGate"); return StatusCode::SUCCESS; } int local_tot_trkhits(0);