Skip to content
Snippets Groups Projects
Commit 4b679a69 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

AFP_Monitoring cppcheck and clang-tidy related fixes

parent 66d19a3b
No related branches found
No related tags found
5 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45318AFP_Monitoring cppcheck and clang-tidy related fixes
Showing
with 22 additions and 22 deletions
......@@ -114,7 +114,7 @@ protected:
/// stations and layers monitors and creates a TProfile with bins
/// for each layer. On Y axis mean value of o given histogram is
/// inserted.
void makeLayerSummaryHist (const std::string inputHistName, const std::string outputHistName, const std::string outputHistTitle);
void makeLayerSummaryHist (const std::string& inputHistName, const std::string& outputHistName, const std::string& outputHistTitle);
private:
SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey
......
......@@ -20,7 +20,7 @@ class AFPSiLayerSummaryProfileBase
{
public:
/// Creates a TPofile object #m_profile and sets bin labels according to monitors in #m_parentTool.
AFPSiLayerSummaryProfileBase (AFPHitsMonitorTool* parentTool, const ManagedMonitorToolBase::MonGroup& monGrp, const std::string name, const std::string title);
AFPSiLayerSummaryProfileBase (AFPHitsMonitorTool* parentTool, const ManagedMonitorToolBase::MonGroup& monGrp, const std::string& name, const std::string& title);
/// Does nothing. The ownership of the #m_profile object is taken by monitoring service.
virtual ~AFPSiLayerSummaryProfileBase() {}
......
......@@ -28,7 +28,7 @@ public:
///
/// @param toolToStoreHistograms pointer to the main monitoring object in which distributions should be bookd
/// @param histsDirName additional string used to form path in ROOT file where distributions should be saved
void bookHistograms(ManagedMonitorToolBase* toolToStoreHistograms, std::string histsDirName = "");
void bookHistograms(ManagedMonitorToolBase* toolToStoreHistograms, const std::string& histsDirName = "");
/// Fills distributions with information provided by the hit.
void fillHistograms(const AFP_SiRawData& hit);
......@@ -43,10 +43,10 @@ public:
protected:
/// Creates a name suffixed with station and layer numbers.
std::string makeHistName (const std::string name) const;
std::string makeHistName (const std::string& name) const;
/// Creates a title suffixed with station and layer numbers.
std::string makeHistTitle (const std::string title) const;
std::string makeHistTitle (const std::string& title) const;
/// ID number of the monitored pixel layer.
const int m_pixelLayerID;
......
......@@ -60,9 +60,9 @@ protected:
std::vector<AFPTechnicalStationMonitor*> m_stationsMonitors;
// histograms
LWHist1D* m_bcIDAfp; ///< distribution of bcID sent by AFP
LWHist1D* m_bcIDATLAS; ///< distribution of bcID sent by ATLAS
LWHist1D* m_bcIDDiffAfpAtlas; ///< distribution of difference between ATLAS and AFP bcID
LWHist1D* m_bcIDAfp = nullptr; ///< distribution of bcID sent by AFP
LWHist1D* m_bcIDATLAS = nullptr; ///< distribution of bcID sent by ATLAS
LWHist1D* m_bcIDDiffAfpAtlas = nullptr; ///< distribution of difference between ATLAS and AFP bcID
};
#endif
......@@ -51,12 +51,12 @@ protected:
/// @brief Create a string with station number. Used for creating names of distributions.
///
/// @param name text which should be prepended to the standard one e.g. "Station1"
std::string makeName (const std::string name) const;
std::string makeName (const std::string& name) const;
/// @brief Create a string with station number. Used for creating titles of distributions.
///
/// @param title text which should be prepended to the standard one e.g. " in station 1"
std::string makeTitle (const std::string title) const;
std::string makeTitle (const std::string& title) const;
/// ID number of the first layer
static const int s_firstLayerIndex;
......
......@@ -41,7 +41,7 @@ AFPHitsMonitorTool::
StatusCode AFPHitsMonitorTool::initialize()
{
if (m_stationsMonitors.size() != 0) {
if (!m_stationsMonitors.empty()) {
// loop over tools
for (ToolHandle<IAFPSiStationMonitor>& stationMon : m_stationsMonitors) {
if (stationMon.retrieve().isFailure())
......@@ -115,7 +115,7 @@ StatusCode AFPHitsMonitorTool::fillHistograms()
break;
}
if (matchStation == false)
if (!matchStation)
ATH_MSG_WARNING("Unrecognised station index: "<<hit->stationID());
}
......@@ -127,7 +127,7 @@ StatusCode AFPHitsMonitorTool::fillHistograms()
}
void AFPHitsMonitorTool::makeLayerSummaryHist (const std::string inputHistName, const std::string outputHistName, const std::string outputHistTitle)
void AFPHitsMonitorTool::makeLayerSummaryHist (const std::string& inputHistName, const std::string& outputHistName, const std::string& outputHistTitle)
{
ManagedMonitorToolBase::MonGroup managedBookingLumiBlock(this, histsDirectoryName(), lumiBlock, ManagedMonitorToolBase::ATTRIB_MANAGED); // to re-booked every luminosity block
......
......@@ -8,7 +8,7 @@
#include "AFP_Monitoring/IAFPSiLayerMonitor.h"
#include "AFP_Monitoring/AFPHitsMonitorTool.h"
AFPSiLayerSummaryProfileBase::AFPSiLayerSummaryProfileBase (AFPHitsMonitorTool* parentTool, const ManagedMonitorToolBase::MonGroup& monGrp, const std::string name, const std::string title) : m_parentTool(parentTool), m_monGrp (monGrp)
AFPSiLayerSummaryProfileBase::AFPSiLayerSummaryProfileBase (AFPHitsMonitorTool* parentTool, const ManagedMonitorToolBase::MonGroup& monGrp, const std::string& name, const std::string& title) : m_parentTool(parentTool), m_monGrp (monGrp)
{
// count number of layers in monitor
int totalPlanes = 0;
......
......@@ -21,7 +21,7 @@ AFPSiStationMonitor::AFPSiStationMonitor(const std::string& type,
StatusCode AFPSiStationMonitor::initialize()
{
if (m_layersMonitors.size() != 0) {
if (!m_layersMonitors.empty()) {
// loop over tools
for (ToolHandle<IAFPSiLayerMonitor>& layerMon : m_layersMonitors) {
// retrieve tools
......
......@@ -23,7 +23,7 @@ AFPTechnicalLayerMonitor::~AFPTechnicalLayerMonitor()
}
// Description: Used for re-booking managed histograms
void AFPTechnicalLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStoreHistograms, const std::string histsDirName)
void AFPTechnicalLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStoreHistograms, const std::string& histsDirName)
{
// ********** Per lumi block **********
......@@ -49,7 +49,7 @@ void AFPTechnicalLayerMonitor::endOfLumiBlock(ManagedMonitorToolBase* /* toolToS
}
std::string AFPTechnicalLayerMonitor::makeHistName (const std::string name) const
std::string AFPTechnicalLayerMonitor::makeHistName (const std::string& name) const
{
std::stringstream histName;
histName<<name<<"St"<<m_stationID<<"Layer"<<m_pixelLayerID;
......@@ -58,7 +58,7 @@ std::string AFPTechnicalLayerMonitor::makeHistName (const std::string name) cons
}
std::string AFPTechnicalLayerMonitor::makeHistTitle (const std::string title) const
std::string AFPTechnicalLayerMonitor::makeHistTitle (const std::string& title) const
{
std::stringstream histTitle;
histTitle<<title<<" in station "<<m_stationID<<" for layer "<<m_pixelLayerID;
......
......@@ -85,14 +85,14 @@ StatusCode AFPTechnicalMonitorTool::bookHistograms( )
StatusCode AFPTechnicalMonitorTool::fillHistograms()
{
// read information
const xAOD::EventInfo* eventInfo = 0;
const xAOD::EventInfo* eventInfo = nullptr;
CHECK( evtStore()->retrieve( eventInfo) );
// create and register histogram only if Raw data is processed
if(m_environment == AthenaMonManager::online || m_environment == AthenaMonManager::tier0Raw) {
// read information
const AFP_RawContainer* afpContainer = 0;
const AFP_RawContainer* afpContainer = nullptr;
CHECK(evtStore()->retrieve(afpContainer));
for (const AFP_SiRawCollection& hitCollection : afpContainer->collectionsSi()) {
......
......@@ -90,7 +90,7 @@ void AFPTechnicalStationMonitor::endOfLumiBlock(AFPTechnicalMonitorTool* toolToS
layer->endOfLumiBlock(toolToStoreHistograms);
}
std::string AFPTechnicalStationMonitor::makeName (const std::string name) const
std::string AFPTechnicalStationMonitor::makeName (const std::string& name) const
{
std::stringstream histName;
histName <<name<<"Station"<<m_stationID;
......@@ -98,7 +98,7 @@ std::string AFPTechnicalStationMonitor::makeName (const std::string name) const
return histName.str();
}
std::string AFPTechnicalStationMonitor::makeTitle (const std::string title) const
std::string AFPTechnicalStationMonitor::makeTitle (const std::string& title) const
{
std::stringstream histTitle;
histTitle <<title<<" in station "<<m_stationID;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment