Skip to content

Commit 829c8b0

Browse files
authored
Merge pull request #48716 from akritkbehera/update/plugins/EcalPerEvtLaserAnalyzer.cc
Replacing"TMath.h" usage in favor of CMath
2 parents 0c0c0b1 + 8d0c3c4 commit 829c8b0

File tree

10 files changed

+24
-19
lines changed

10 files changed

+24
-19
lines changed

CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalPerEvtLaserAnalyzer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup
401401
if (i == 0)
402402
adcGain = adcG[i];
403403
if (i > 0)
404-
adcGain = TMath::Max(adcG[i], adcGain);
404+
adcGain = std::max(adcG[i], adcGain);
405405

406406
if (adc[i] > adcmax) {
407407
adcmax = adc[i];
@@ -485,7 +485,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup
485485
if (i == 0)
486486
adcGain = adcG[i];
487487
if (i > 0)
488-
adcGain = TMath::Max(adcG[i], adcGain);
488+
adcGain = std::max(adcG[i], adcGain);
489489

490490
if (adc[i] > adcmax) {
491491
adcmax = adc[i];

CalibCalorimetry/EcalLaserAnalyzer/plugins/EcalTestPulseAnalyzer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <sstream>
1414
#include <iomanip>
15+
#include <cmath>
1516

1617
#include "FWCore/MessageLogger/interface/MessageLogger.h"
1718

@@ -323,7 +324,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
323324
if (samId == 0)
324325
pngain = pnG[samId];
325326
if (samId > 0)
326-
pngain = TMath::Max(pnG[samId], pngain);
327+
pngain = std::max(pnG[samId], pngain);
327328
}
328329

329330
for (dsum = 0., k = 0; k < _presamplePN; k++) {
@@ -430,7 +431,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
430431
if (i == 0)
431432
adcgain = adcG[i];
432433
if (i > 0)
433-
adcgain = TMath::Max(adcG[i], adcgain);
434+
adcgain = std::max(adcG[i], adcgain);
434435
}
435436
// Remove pedestal
436437
//====================
@@ -555,7 +556,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
555556
if (i == 0)
556557
adcgain = adcG[i];
557558
if (i > 0)
558-
adcgain = TMath::Max(adcG[i], adcgain);
559+
adcgain = std::max(adcG[i], adcgain);
559560
}
560561

561562
// Remove pedestal

DQM/SiStripMonitorClient/bin/moduleOccupancyPlots.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <fstream>
33
#include <sstream>
44
#include <string>
5+
#include <cmath>
56

67
#include "TFile.h"
78
#include "TH1D.h"
@@ -185,7 +186,8 @@ void printPlot(TH1D* hist, char* prefix, char* postfix) {
185186
delete cc;
186187
}
187188
int getChannelNumber(int ival) {
188-
int chan = int(32 * fmod(int(fmod(ival, 256.) / 2.), 4.) + 8 * int(int(fmod(ival, 256.) / 2.) / 4.) -
189-
31 * int(int(fmod(ival, 256.) / 2.) / 16.) + fmod(fmod(ival, 256.), 2.) * 128 + int(ival / 256) * 256);
189+
int chan = int(32 * std::fmod(int(std::fmod(ival, 256.) / 2.), 4.) + 8 * int(int(std::fmod(ival, 256.) / 2.) / 4.) -
190+
31 * int(int(std::fmod(ival, 256.) / 2.) / 16.) + std::fmod(std::fmod(ival, 256.), 2.) * 128 +
191+
int(ival / 256) * 256);
190192
return chan;
191193
}

Fireworks/Core/interface/FWGeometryTableViewBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class FWGeometryTableViewBase
9494

9595
void checkExpandLevel();
9696

97-
int getTopNodeIdx() const { return TMath::Max((int)m_topNodeIdx.value(), 0); }
97+
int getTopNodeIdx() const { return std::max((int)m_topNodeIdx.value(), 0); }
9898

9999
FWEveDigitSetScalableMarker* getMarker() { return m_marker; }
100100
void transparencyChanged();

Fireworks/Core/src/CmsAnnotation.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <sstream>
2+
#include <cmath>
23

34
#include "TGLIncludes.h"
45
#include "TGLCamera.h"
@@ -261,16 +262,15 @@ Bool_t CmsAnnotation::Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Even
261262
else if (fPosY > 1.0f)
262263
fPosY = 1.0f;
263264
} else {
264-
using namespace TMath;
265265
Float_t oovpw = 1.0f / vp.Width(), oovph = 1.0f / vp.Height();
266266

267-
Float_t xw = oovpw * Min(Max(0, event->fX), vp.Width());
268-
Float_t yw = oovph * Min(Max(0, vp.Height() - event->fY), vp.Height());
267+
Float_t xw = oovpw * std::min(std::max(0, event->fX), vp.Width());
268+
Float_t yw = oovph * std::min(std::max(0, vp.Height() - event->fY), vp.Height());
269269

270-
Float_t rx = Max((xw - fPosX) / (oovpw * fMouseX - fPosX), 0.0f);
271-
Float_t ry = Max((yw - fPosY) / (oovph * (vp.Height() - fMouseY) - fPosY), 0.0f);
270+
Float_t rx = std::max((xw - fPosX) / (oovpw * fMouseX - fPosX), 0.0f);
271+
Float_t ry = std::max((yw - fPosY) / (oovph * (vp.Height() - fMouseY) - fPosY), 0.0f);
272272

273-
fSize = Max(fSizeDrag * Min(rx, ry), 0.01f);
273+
fSize = std::max(fSizeDrag * std::min(rx, ry), 0.01f);
274274
}
275275
}
276276
return kTRUE;

Fireworks/Core/src/FWCompactVerticalLayout.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void FWCompactVerticalLayout::Layout() {
9797
exp_max = 0;
9898
expandSizes.push_back(size.fHeight);
9999
} else
100-
exp_max = TMath::Max(exp_max, (Int_t)size.fHeight);
100+
exp_max = std::max(exp_max, (Int_t)size.fHeight);
101101
} else {
102102
remain -= size.fHeight;
103103
if (remain < 0)
@@ -222,7 +222,7 @@ TGDimension FWCompactVerticalLayout::GetDefaultSize() const {
222222
while ((ptr = (TGFrameElement *)next())) {
223223
if (ptr->fState & kIsVisible) {
224224
csize = ptr->fFrame->GetDefaultSize();
225-
size.fWidth = TMath::Max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() + ptr->fLayout->GetPadRight());
225+
size.fWidth = std::max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() + ptr->fLayout->GetPadRight());
226226
size.fHeight += csize.fHeight + ptr->fLayout->GetPadTop() + ptr->fLayout->GetPadBottom();
227227
}
228228
}

L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ void DTTrigPhase2Prod::processDigi(std::queue<std::pair<DTLayerId, DTDigi>>& inQ
12731273
for (auto& sC : vec) { // Conditions for entering a super cell.
12741274
if ((sC->front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
12751275
// Time requirement
1276-
if (TMath::Abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
1276+
if (std::abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
12771277
// Spatial requirement
12781278
sC->push(std::move(inQ.front()));
12791279
classified = true;

L1Trigger/Phase2L1GMT/interface/KMTFLUTs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef L1Trigger_Phase2L1GMT_KMTFLUTS_h
22
#define L1Trigger_Phase2L1GMT_KMTFLUTS_h
33
#include <cstdlib>
4+
#include <cmath>
45
#include "TH1.h"
56
#include "TFile.h"
67
#include <map>

SimFastTiming/FastTimingCommon/src/ETLDeviceSim.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "Geometry/CommonTopologies/interface/PixelTopology.h"
1212
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
1313
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
14+
#include <cmath>
1415

1516
ETLDeviceSim::ETLDeviceSim(const edm::ParameterSet& pset, edm::ConsumesCollector iC)
1617
: geomToken_(iC.esConsumes()),
@@ -111,7 +112,7 @@ void ETLDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_t, f
111112
MPV_charge *= gain[0];
112113
} else {
113114
if (applyDegradation_) {
114-
double dGapCenter = TMath::Max(TMath::Abs(simscaled.x()), TMath::Abs(simscaled.y()));
115+
double dGapCenter = std::max(std::abs(simscaled.x()), std::abs(simscaled.y()));
115116
param[0] = gain[0];
116117
param[1] = dGapCenter;
117118
gain[0] = lgadGainDegradation_.evaluate(param, emptyV);

Validation/RecoParticleFlow/bin/PlotCompareUtility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void PlotCompareUtility::centerRebin(TH1 *H1, TH1 *H2) {
173173
// determine x axis range and binning requirements
174174
float h1RMS = H1->GetRMS();
175175
float h2RMS = H2->GetRMS();
176-
float rms = TMath::Max(h1RMS, h2RMS);
176+
float rms = std::max(h1RMS, h2RMS);
177177
float h1Mean = H1->GetMean();
178178
float h2Mean = H2->GetMean();
179179
float mean = 0.5 * (h1Mean + h2Mean);

0 commit comments

Comments
 (0)