Skip to content
Snippets Groups Projects
Commit 9d55b40d authored by Scott Snyder's avatar Scott Snyder Committed by Edward Moyse
Browse files

VP1AODSystems: Fix cppcheck 2.14 warnings.

VP1AODSystems: Fix cppcheck 2.14 warnings.

Copying values in range-for.
Prefer returning const references to members rather than copies.
parent e9af5fd7
No related branches found
No related tags found
25 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72239VP1AODSystems: Fix cppcheck 2.14 warnings.
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -196,7 +196,7 @@ bool IParticleCollHandleBase::cut(AODHandleBase* ahand)
double phi = VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() );
messageVerbose("value oh handle's phi: " + QString::number(phi));
bool ok(false);
for (VP1Interval phirange : m_cut_allowedPhi) {
for (const VP1Interval& phirange : m_cut_allowedPhi) {
if (phirange.contains(phi)||phirange.contains(phi+2*M_PI)||phirange.contains(phi-2*M_PI)) {
ok = true;
break;
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -108,8 +108,8 @@ public Q_SLOTS:
void setCutAllowedPhi(const QList<VP1Interval>&);
//getters
VP1Interval getCutAllowedPt() {return m_cut_allowedPtSq; };
VP1Interval getCutAllowedEta() {return m_cut_allowedEta; };
const VP1Interval& getCutAllowedPt() {return m_cut_allowedPtSq; };
const VP1Interval& getCutAllowedEta() {return m_cut_allowedEta; };
QList<VP1Interval> getCutAllowedPhi() {return m_cut_allowedPhi; };
bool getPtAllowall() {return m_cut_pt_allowall; };
bool getEtaAllowall() {return m_cut_eta_allowall; };
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -519,7 +519,7 @@ bool IParticleCollHandle_CaloCluster::cut(AODHandleBase* c) {
if (!getPhiAllowall() ) {
double phi = handle->phi();
bool ok(false);
for (VP1Interval phirange : getCutAllowedPhi() ) {
for (const VP1Interval& phirange : getCutAllowedPhi() ) {
messageVerbose("object's phi, phiCut, PhiAll: " + QString::number(phi) + " - " + phirange.toString() + " - " + QString::number(int(getPhiAllowall())) );
if (phirange.contains(phi)||phirange.contains(phi+2*M_PI)||phirange.contains(phi-2*M_PI)) {
ok = true;
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -557,7 +557,7 @@ bool IParticleCollHandle_Jet::cut(AODHandleBase* c) {
if (!getPhiAllowall() ) {
double phi = handle->phi();
bool ok(false);
for (VP1Interval phirange : getCutAllowedPhi() ) {
for (const VP1Interval& phirange : getCutAllowedPhi() ) {
messageVerbose("jet's phi, phiCut, PhiAll: " + QString::number(phi) + " - " + phirange.toString() + " - " + QString::number(int(getPhiAllowall())) );
if (phirange.contains(phi)||phirange.contains(phi+2*M_PI)||phirange.contains(phi-2*M_PI)) {
ok = true;
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -475,7 +475,7 @@ bool MissingEtCollHandle::cut(AODHandleBase* c) {
if (!getPhiAllowall() ) {
double phi = handle->phi();
bool ok(false);
for (VP1Interval phirange : getCutAllowedPhi() ) {
for (const VP1Interval& phirange : getCutAllowedPhi() ) {
messageVerbose("MET phi, phiCut, PhiAll: " + QString::number(phi) + " - " + phirange.toString() + " - " + QString::number(int(getPhiAllowall())) );
if (phirange.contains(phi)||phirange.contains(phi+2*M_PI)||phirange.contains(phi-2*M_PI)) {
ok = true;
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
......@@ -121,9 +121,9 @@ public Q_SLOTS:
void setVertexSize(int);
//getters
VP1Interval getCutAllowedY() {return m_cut_allowedY; };
VP1Interval getCutAllowedZ() {return m_cut_allowedZ; };
VP1Interval getCutAllowedR() {return m_cut_allowedR; };
const VP1Interval& getCutAllowedY() {return m_cut_allowedY; };
const VP1Interval& getCutAllowedZ() {return m_cut_allowedZ; };
const VP1Interval& getCutAllowedR() {return m_cut_allowedR; };
bool getYAllowall() {return m_cut_y_allowall; };
bool getZAllowall() {return m_cut_z_allowall; };
bool getRAllowall() {return m_cut_r_allowall; };
......
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