Skip to content

Commit

Permalink
Merge pull request #46996 from smuzaffar/geometry-code-checks1
Browse files Browse the repository at this point in the history
[GEOMETRY] Apply code checks/format
  • Loading branch information
cmsbuild authored Dec 19, 2024
2 parents b81e288 + 29f4912 commit c812bd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions DetectorDescription/Core/src/DDValue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "DetectorDescription/Core/interface/DDComparator.h"

#include <cassert>
#include <memory>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
Expand Down Expand Up @@ -49,7 +50,7 @@ DDValue::DDValue(const std::string& name, const std::vector<DDValuePair>& v) : i
auto it = v.begin();
std::vector<std::string> svec;
std::vector<double> dvec;
vecPair_.reset(new vecpair_type(false, std::make_pair(svec, dvec)));
vecPair_ = std::make_shared<vecpair_type>(false, std::make_pair(svec, dvec));
for (; it != v.end(); ++it) {
vecPair_->second.first.emplace_back(it->first);
vecPair_->second.second.emplace_back(it->second);
Expand All @@ -62,7 +63,7 @@ DDValue::DDValue(const std::string& name, double val) : id_(0) {
std::vector<std::string> svec(1, "");
std::vector<double> dvec(1, val);

vecPair_.reset(new vecpair_type(false, std::make_pair(svec, dvec)));
vecPair_ = std::make_shared<vecpair_type>(false, std::make_pair(svec, dvec));
setEvalState(true);
}

Expand All @@ -71,7 +72,7 @@ DDValue::DDValue(const std::string& name, const std::string& sval, double dval)

std::vector<std::string> svec(1, sval);
std::vector<double> dvec(1, dval);
vecPair_.reset(new vecpair_type(false, std::make_pair(svec, dvec)));
vecPair_ = std::make_shared<vecpair_type>(false, std::make_pair(svec, dvec));
setEvalState(true);
}

Expand All @@ -80,7 +81,7 @@ DDValue::DDValue(const std::string& name, const std::string& sval) : id_(0) {

std::vector<std::string> svec(1, sval);
std::vector<double> dvec(1, 0);
vecPair_.reset(new vecpair_type(false, std::make_pair(svec, dvec)));
vecPair_ = std::make_shared<vecpair_type>(false, std::make_pair(svec, dvec));
setEvalState(false);
}

Expand Down
2 changes: 1 addition & 1 deletion DetectorDescription/Parser/src/DDLParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool DDLParser::isParsed(const std::string& filename) {
bool DDLParser::parseOneFile(const std::string& fullname) {
std::string filename = extractFileName(fullname);
edm::FileInPath fp(fullname);
std::string absoluteFileName = fp.fullPath();
const std::string& absoluteFileName = fp.fullPath();
size_t foundFile = isFound(filename);
if (!foundFile) {
pair<std::string, std::string> pss;
Expand Down
2 changes: 1 addition & 1 deletion Geometry/ForwardGeometry/plugins/moduleDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CaloGeometryDBEP<ZdcGeometry, CaloGeometryDBReader>::produceAligned(const typena
ZdcGeometry* zdcGeometry = new ZdcGeometry(&zdcTopology);
PtrType ptr(zdcGeometry);

if (dins.size() > 0) {
if (!dins.empty()) {
const unsigned int nTrParm(tvec.size() / zdcTopology.kSizeForDenseIndexing());

assert(dvec.size() == ZdcGeometry::k_NumberOfShapes * ZdcGeometry::k_NumberOfParametersPerShape);
Expand Down

0 comments on commit c812bd4

Please sign in to comment.