Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup
if (i == 0)
adcGain = adcG[i];
if (i > 0)
adcGain = TMath::Max(adcG[i], adcGain);
adcGain = std::max(adcG[i], adcGain);

if (adc[i] > adcmax) {
adcmax = adc[i];
Expand Down Expand Up @@ -485,7 +485,7 @@ void EcalPerEvtLaserAnalyzer::analyze(const edm::Event& e, const edm::EventSetup
if (i == 0)
adcGain = adcG[i];
if (i > 0)
adcGain = TMath::Max(adcG[i], adcGain);
adcGain = std::max(adcG[i], adcGain);

if (adc[i] > adcmax) {
adcmax = adc[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <sstream>
#include <iomanip>
#include <cmath>

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

Expand Down Expand Up @@ -323,7 +324,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
if (samId == 0)
pngain = pnG[samId];
if (samId > 0)
pngain = TMath::Max(pnG[samId], pngain);
pngain = std::max(pnG[samId], pngain);
}

for (dsum = 0., k = 0; k < _presamplePN; k++) {
Expand Down Expand Up @@ -430,7 +431,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
if (i == 0)
adcgain = adcG[i];
if (i > 0)
adcgain = TMath::Max(adcG[i], adcgain);
adcgain = std::max(adcG[i], adcgain);
}
// Remove pedestal
//====================
Expand Down Expand Up @@ -555,7 +556,7 @@ void EcalTestPulseAnalyzer::analyze(const edm::Event& e, const edm::EventSetup&
if (i == 0)
adcgain = adcG[i];
if (i > 0)
adcgain = TMath::Max(adcG[i], adcgain);
adcgain = std::max(adcG[i], adcgain);
}

// Remove pedestal
Expand Down
6 changes: 4 additions & 2 deletions DQM/SiStripMonitorClient/bin/moduleOccupancyPlots.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>

#include "TFile.h"
#include "TH1D.h"
Expand Down Expand Up @@ -185,7 +186,8 @@ void printPlot(TH1D* hist, char* prefix, char* postfix) {
delete cc;
}
int getChannelNumber(int ival) {
int chan = int(32 * fmod(int(fmod(ival, 256.) / 2.), 4.) + 8 * int(int(fmod(ival, 256.) / 2.) / 4.) -
31 * int(int(fmod(ival, 256.) / 2.) / 16.) + fmod(fmod(ival, 256.), 2.) * 128 + int(ival / 256) * 256);
int chan = int(32 * std::fmod(int(std::fmod(ival, 256.) / 2.), 4.) + 8 * int(int(std::fmod(ival, 256.) / 2.) / 4.) -
31 * int(int(std::fmod(ival, 256.) / 2.) / 16.) + std::fmod(std::fmod(ival, 256.), 2.) * 128 +
int(ival / 256) * 256);
return chan;
}
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWGeometryTableViewBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class FWGeometryTableViewBase

void checkExpandLevel();

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

FWEveDigitSetScalableMarker* getMarker() { return m_marker; }
void transparencyChanged();
Expand Down
13 changes: 7 additions & 6 deletions Fireworks/Core/src/CmsAnnotation.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <sstream>
#include <cmath>

#include "TGLIncludes.h"
#include "TGLCamera.h"
Expand Down Expand Up @@ -261,16 +262,16 @@ Bool_t CmsAnnotation::Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec, Even
else if (fPosY > 1.0f)
fPosY = 1.0f;
} else {
using namespace TMath;
using namespace std;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akritkbehera , I would suggest to not have using namespace std; and update the code to explicitly use std:: e.g. std::min or std::max

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok will make the changes

Float_t oovpw = 1.0f / vp.Width(), oovph = 1.0f / vp.Height();

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

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

fSize = Max(fSizeDrag * Min(rx, ry), 0.01f);
fSize = max(fSizeDrag * min(rx, ry), 0.01f);
}
}
return kTRUE;
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/src/FWCompactVerticalLayout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void FWCompactVerticalLayout::Layout() {
exp_max = 0;
expandSizes.push_back(size.fHeight);
} else
exp_max = TMath::Max(exp_max, (Int_t)size.fHeight);
exp_max = std::max(exp_max, (Int_t)size.fHeight);
} else {
remain -= size.fHeight;
if (remain < 0)
Expand Down Expand Up @@ -222,7 +222,7 @@ TGDimension FWCompactVerticalLayout::GetDefaultSize() const {
while ((ptr = (TGFrameElement *)next())) {
if (ptr->fState & kIsVisible) {
csize = ptr->fFrame->GetDefaultSize();
size.fWidth = TMath::Max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() + ptr->fLayout->GetPadRight());
size.fWidth = std::max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() + ptr->fLayout->GetPadRight());
size.fHeight += csize.fHeight + ptr->fLayout->GetPadTop() + ptr->fLayout->GetPadBottom();
}
}
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ void DTTrigPhase2Prod::processDigi(std::queue<std::pair<DTLayerId, DTDigi>>& inQ
for (auto& sC : vec) { // Conditions for entering a super cell.
if ((sC->front().second.time() + superCelltimewidth_) > inQ.front().second.time()) {
// Time requirement
if (TMath::Abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
if (std::abs(sC->front().second.wire() - inQ.front().second.wire()) <= superCellhalfspacewidth_) {
// Spatial requirement
sC->push(std::move(inQ.front()));
classified = true;
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/Phase2L1GMT/interface/KMTFLUTs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef L1Trigger_Phase2L1GMT_KMTFLUTS_h
#define L1Trigger_Phase2L1GMT_KMTFLUTS_h
#include <cstdlib>
#include <cmath>
#include "TH1.h"
#include "TFile.h"
#include <map>
Expand Down
3 changes: 2 additions & 1 deletion SimFastTiming/FastTimingCommon/src/ETLDeviceSim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Geometry/CommonTopologies/interface/PixelTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h"
#include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h"
#include <cmath>

ETLDeviceSim::ETLDeviceSim(const edm::ParameterSet& pset, edm::ConsumesCollector iC)
: geomToken_(iC.esConsumes()),
Expand Down Expand Up @@ -111,7 +112,7 @@ void ETLDeviceSim::getHitsResponse(const std::vector<std::tuple<int, uint32_t, f
MPV_charge *= gain[0];
} else {
if (applyDegradation_) {
double dGapCenter = TMath::Max(TMath::Abs(simscaled.x()), TMath::Abs(simscaled.y()));
double dGapCenter = std::max(std::abs(simscaled.x()), std::abs(simscaled.y()));
param[0] = gain[0];
param[1] = dGapCenter;
gain[0] = lgadGainDegradation_.evaluate(param, emptyV);
Expand Down
2 changes: 1 addition & 1 deletion Validation/RecoParticleFlow/bin/PlotCompareUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void PlotCompareUtility::centerRebin(TH1 *H1, TH1 *H2) {
// determine x axis range and binning requirements
float h1RMS = H1->GetRMS();
float h2RMS = H2->GetRMS();
float rms = TMath::Max(h1RMS, h2RMS);
float rms = std::max(h1RMS, h2RMS);
float h1Mean = H1->GetMean();
float h2Mean = H2->GetMean();
float mean = 0.5 * (h1Mean + h2Mean);
Expand Down