Skip to content
Snippets Groups Projects
Commit 92dbbbe8 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'cppcheck.BCM_Digitization-20231013' into 'main'

BCM_Digitization+MM_Digitization: Fix cppcheck warnings.

See merge request !66489
parents 875080e1 49a05955
No related branches found
No related tags found
1 merge request!66489BCM_Digitization+MM_Digitization: Fix cppcheck warnings.
/* /*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/ */
#include <cmath> #include <cmath>
...@@ -324,7 +324,7 @@ void BCM_DigitizationTool::addNoise(int iMod, std::vector<float> &analog, CLHEP: ...@@ -324,7 +324,7 @@ void BCM_DigitizationTool::addNoise(int iMod, std::vector<float> &analog, CLHEP:
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// ApplyThreshold method: // ApplyThreshold method:
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::bitset<64> BCM_DigitizationTool::applyThreshold(int iChan, std::vector<float> analog) std::bitset<64> BCM_DigitizationTool::applyThreshold(int iChan, const std::vector<float>& analog)
{ {
std::bitset<64> digital; std::bitset<64> digital;
digital.reset(); digital.reset();
...@@ -355,7 +355,7 @@ void BCM_DigitizationTool::applyFilter(std::bitset<64> &digital) ...@@ -355,7 +355,7 @@ void BCM_DigitizationTool::applyFilter(std::bitset<64> &digital)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// FindPulses method: // FindPulses method:
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void BCM_DigitizationTool::findPulses(std::bitset<64> digital, int &p1x, int &p1w, int &p2x, int &p2w) void BCM_DigitizationTool::findPulses(const std::bitset<64>& digital, int &p1x, int &p1w, int &p2x, int &p2w)
{ {
p1x = 0; p1w = 0; p2x = 0; p2w = 0; p1x = 0; p1w = 0; p2x = 0; p2w = 0;
......
/* /*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef BCM_DIGITIZATION_BCM_DIGITIZATIONTOOL_H #ifndef BCM_DIGITIZATION_BCM_DIGITIZATIONTOOL_H
...@@ -65,13 +65,13 @@ class BCM_DigitizationTool : public PileUpToolBase { ...@@ -65,13 +65,13 @@ class BCM_DigitizationTool : public PileUpToolBase {
void addNoise(int mod, std::vector<float> &analog, CLHEP::HepRandomEngine *randomEngine); void addNoise(int mod, std::vector<float> &analog, CLHEP::HepRandomEngine *randomEngine);
/** Do ToT digitization */ /** Do ToT digitization */
std::bitset<64> applyThreshold(int chan, std::vector<float> analog); std::bitset<64> applyThreshold(int chan, const std::vector<float>& analog);
/** Apply hole and spike filter to digital waveform */ /** Apply hole and spike filter to digital waveform */
static void applyFilter(std::bitset<64> &digital); static void applyFilter(std::bitset<64> &digital);
/** Find first two pulses on digital waveform */ /** Find first two pulses on digital waveform */
static void findPulses(std::bitset<64> digital, int &p1x, int &p1w, int &p2x, int &p2w); static void findPulses(const std::bitset<64>& digital, int &p1x, int &p1w, int &p2x, int &p2w);
/** Create raw data object and put it in the container */ /** Create raw data object and put it in the container */
void fillRDO(unsigned int chan, int p1x, int p1w, int p2x, int p2w); void fillRDO(unsigned int chan, int p1x, int p1w, int p2x, int p2w);
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/ */
// MMStripVmmMappingTool.h // MMStripVmmMappingTool.h
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
class electronics { class electronics {
public: public:
int elec(int stripNumber, std::string tech, int off_stationEta, int chMax); int elec(int stripNumber, const std::string& tech, int off_stationEta, int chMax);
}; };
#endif #endif
/* /*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MM_Digitization/MM_StripVmmMappingTool.h" #include "MM_Digitization/MM_StripVmmMappingTool.h"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/MsgStream.h"
// returns ADDC, MMFE, VMM // returns ADDC, MMFE, VMM
int electronics::elec(int stripNumber, std::string tech, int off_stationEta, int chMax) { int electronics::elec(int stripNumber, const std::string& tech, int off_stationEta, int chMax) {
off_stationEta = std::abs(off_stationEta); off_stationEta = std::abs(off_stationEta);
int MMFE_total = off_stationEta == 1 ? 10 : 6; int MMFE_total = off_stationEta == 1 ? 10 : 6;
......
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