Skip to content

Commit

Permalink
Removed lexical_cast boost dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Purva-Chaudhari committed Aug 16, 2021
1 parent 5f75b2d commit f107145
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char** argv) {
std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");

std::string tag = "TrackerAlignment_v21_offline";
cond::Time_t start = boost::lexical_cast<unsigned long long>(294034);
cond::Time_t end = boost::lexical_cast<unsigned long long>(305898);
cond::Time_t start = static_cast<unsigned long long>(294034);
cond::Time_t end = static_cast<unsigned long long>(305898);

std::cout << "## Alignment Histos" << std::endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ int main(int argc, char** argv) {
// BeamSpot

std::string tag = "BeamSpotObjects_PCL_byLumi_v0_prompt";
cond::Time_t start = boost::lexical_cast<unsigned long long>(1406876667347162);
//cond::Time_t end = boost::lexical_cast<unsigned long long>(1406876667347162);
cond::Time_t start = static_cast<unsigned long long>(1406876667347162);
//cond::Time_t end = static_cast<unsigned long long>(1406876667347162);

edm::LogPrint("testBeamSpotPayloadInspector") << "## Exercising BeamSpot plots " << std::endl;

Expand All @@ -37,7 +37,7 @@ int main(int argc, char** argv) {
edm::LogPrint("testBeamSpotPayloadInspector") << histoParameters.data() << std::endl;

tag = "BeamSpotOnlineTestLegacy";
start = boost::lexical_cast<unsigned long long>(1443392479297557);
start = static_cast<unsigned long long>(1443392479297557);

edm::LogPrint("testBeamSpotPayloadInspector") << "## Exercising BeamSpotOnline plots " << std::endl;

Expand Down
4 changes: 2 additions & 2 deletions CondCore/DBOutputService/src/OnlineDBOutputService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ namespace cond {
if (!std::getline(sinfo, slumi, ',')) {
throw Exception("Can't get lumi id from OMS Service.");
}
unsigned int run = boost::lexical_cast<unsigned int>(srun);
unsigned int lumi = boost::lexical_cast<unsigned int>(slumi);
unsigned int run = std::stoul(srun);
unsigned int lumi = std::stoul(slumi);
lastLumiProcessed = cond::time::lumiTime(run, lumi);
return lastLumiProcessed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char** argv) {
std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");

std::string tag = "AlCaRecoHLTpaths8e29_1e31_v7_hlt";
cond::Time_t start = boost::lexical_cast<unsigned long long>(270000);
cond::Time_t end = boost::lexical_cast<unsigned long long>(304820);
cond::Time_t start = static_cast<unsigned long long>(270000);
cond::Time_t end = static_cast<unsigned long long>(304820);

std::cout << "## AlCaRecoTriggerBit Histos" << std::endl;

Expand Down
4 changes: 2 additions & 2 deletions CondCore/RunInfoPlugins/test/testRunInfoPayloadInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char** argv) {
std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");

std::string tag = "runinfo_31X_hlt";
cond::Time_t start = boost::lexical_cast<unsigned long long>(311950);
cond::Time_t end = boost::lexical_cast<unsigned long long>(312237);
cond::Time_t start = static_cast<unsigned long long>(311950);
cond::Time_t end = static_cast<unsigned long long>(312237);

std::cout << "## RunInfo testing" << std::endl;

Expand Down
4 changes: 2 additions & 2 deletions CondCore/SiPixelPlugins/interface/SiPixelGainCalibHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ namespace gainCalibHelper {
auto paramValues = cond::payloadInspector::PlotBase::inputParamValues();
auto ip = paramValues.find("SetLog");
if (ip != paramValues.end()) {
auto answer = boost::lexical_cast<std::string>(ip->second);
auto answer = ip->second;
if (!SiPixelPI::checkAnswerOK(answer, setLog)) {
throw cms::Exception(label_)
<< "\nERROR: " << answer
Expand Down Expand Up @@ -590,7 +590,7 @@ namespace gainCalibHelper {
auto paramValues = cond::payloadInspector::PlotBase::inputParamValues();
auto ip = paramValues.find("SetLog");
if (ip != paramValues.end()) {
auto answer = boost::lexical_cast<std::string>(ip->second);
auto answer = ip->second;
if (!SiPixelPI::checkAnswerOK(answer, setLog)) {
throw cms::Exception(label_)
<< "\nERROR: " << answer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("Scenarios");
if (ip != paramValues.end()) {
auto input = boost::lexical_cast<std::string>(ip->second);
auto input = ip->second;
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
boost::char_separator<char> sep{","};
tokenizer tok{input, sep};
Expand Down
34 changes: 17 additions & 17 deletions CondCore/SiPixelPlugins/test/testSiPixelPayloadInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ int main(int argc, char** argv) {
// Lorentz Angle

std::string tag = "SiPixelLorentzAngle_v11_offline";
cond::Time_t start = boost::lexical_cast<unsigned long long>(303790);
cond::Time_t end = boost::lexical_cast<unsigned long long>(324245);
cond::Time_t start = static_cast<unsigned long long>(303790);
cond::Time_t end = static_cast<unsigned long long>(324245);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising Lorentz Angle plots " << std::endl;

Expand Down Expand Up @@ -68,7 +68,7 @@ int main(int argc, char** argv) {
// 2 tags comparisons

std::string tag2 = "SiPixelLorentzAngle_2016_ultralegacymc_v2";
cond::Time_t start2 = boost::lexical_cast<unsigned long long>(1);
cond::Time_t start2 = static_cast<unsigned long long>(1);

SiPixelLorentzAngleValueComparisonTwoTags histo6;
histo6.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2));
Expand All @@ -81,8 +81,8 @@ int main(int argc, char** argv) {
// SiPixelQuality

tag = "SiPixelQuality_forDigitizer_phase1_2018_permanentlyBad";
start = boost::lexical_cast<unsigned long long>(1);
end = boost::lexical_cast<unsigned long long>(1);
start = static_cast<unsigned long long>(1);
end = static_cast<unsigned long long>(1);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQuality plots " << std::endl;

Expand All @@ -97,8 +97,8 @@ int main(int argc, char** argv) {
// SiPixelGainCalibrationOffline

tag = "SiPixelGainCalibration_2009runs_express";
start = boost::lexical_cast<unsigned long long>(312203);
end = boost::lexical_cast<unsigned long long>(312203);
start = static_cast<unsigned long long>(312203);
end = static_cast<unsigned long long>(312203);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGainCalibrationOffline plots " << std::endl;

Expand All @@ -118,7 +118,7 @@ int main(int argc, char** argv) {
histo13.process(connectionString, PI::mk_input(tag, start, end));
edm::LogPrint("testSiPixelPayloadInspector") << histo13.data() << std::endl;

end = boost::lexical_cast<unsigned long long>(326851);
end = static_cast<unsigned long long>(326851);

SiPixelGainCalibOfflinePedestalComparisonSingleTag histo14;
histo14.process(connectionString, PI::mk_input(tag, start, end));
Expand All @@ -143,8 +143,8 @@ int main(int argc, char** argv) {
// SiPixelTemplates

tag = "SiPixelTemplateDBObject38Tv3_express";
start = boost::lexical_cast<unsigned long long>(326083);
end = boost::lexical_cast<unsigned long long>(326083);
start = static_cast<unsigned long long>(326083);
end = static_cast<unsigned long long>(326083);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelTemplates plots " << std::endl;

Expand Down Expand Up @@ -177,8 +177,8 @@ int main(int argc, char** argv) {
// SiPixelGenErrors

tag = "SiPixelGenErrorDBObject_phase1_BoR3_HV350_Tr2000";
start = boost::lexical_cast<unsigned long long>(1);
end = boost::lexical_cast<unsigned long long>(1);
start = static_cast<unsigned long long>(1);
end = static_cast<unsigned long long>(1);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGenErrors plots " << std::endl;

Expand All @@ -193,8 +193,8 @@ int main(int argc, char** argv) {
// SiPixelQualityProbabilities

tag = "SiPixelQualityProbabilities_UltraLegacy2018_v0_mc";
start = boost::lexical_cast<unsigned long long>(1);
end = boost::lexical_cast<unsigned long long>(1);
start = static_cast<unsigned long long>(1);
end = static_cast<unsigned long long>(1);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQualityProbabilities plots " << std::endl;

Expand All @@ -205,8 +205,8 @@ int main(int argc, char** argv) {
// SiPixelDynamicInefficiency

tag = "SiPixelDynamicInefficiency_PhaseI_v9";
start = boost::lexical_cast<unsigned long long>(1);
end = boost::lexical_cast<unsigned long long>(1);
start = static_cast<unsigned long long>(1);
end = static_cast<unsigned long long>(1);

edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixeDynamicInefficiency plots " << std::endl;

Expand All @@ -215,7 +215,7 @@ int main(int argc, char** argv) {
edm::LogPrint("testSiPixelPayloadInspector") << histo26.data() << std::endl;

tag2 = "SiPixelDynamicInefficiency_PhaseI_v6";
start2 = boost::lexical_cast<unsigned long long>(1);
start2 = static_cast<unsigned long long>(1);

SiPixelFullIneffROCsMapCompareTwoTags histo27;
histo27.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("nsigma");
if (ip != paramValues.end()) {
nsigma = boost::lexical_cast<unsigned int>(ip->second);
nsigma = std::stoul(ip->second);
}

// trick to deal with the multi-ioved tag and two tag case at the same time
Expand Down Expand Up @@ -674,7 +674,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("nsigma");
if (ip != paramValues.end()) {
nsigma = boost::lexical_cast<unsigned int>(ip->second);
nsigma = std::stoul(ip->second);
edm::LogPrint("SiStripApvGain_PayloadInspector")
<< "using custom z-axis saturation: " << nsigma << " sigmas" << std::endl;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("DetIds");
if (ip != paramValues.end()) {
auto input = boost::lexical_cast<std::string>(ip->second);
auto input = ip->second;
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
boost::char_separator<char> sep{","};
tokenizer tok{input, sep};
Expand Down Expand Up @@ -316,7 +316,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("DetId");
if (ip != paramValues.end()) {
the_detid = boost::lexical_cast<unsigned int>(ip->second);
the_detid = std::stoul(ip->second);
}

if (payload.get()) {
Expand Down Expand Up @@ -962,7 +962,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("nsigma");
if (ip != paramValues.end()) {
nsigma = boost::lexical_cast<unsigned int>(ip->second);
nsigma = std::stoul(ip->second);
}

// trick to deal with the multi-ioved tag and two tag case at the same time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("DetIds");
if (ip != paramValues.end()) {
auto input = boost::lexical_cast<std::string>(ip->second);
auto input = ip->second;
typedef boost::tokenizer<boost::char_separator<char>> tokenizer;
boost::char_separator<char> sep{","};
tokenizer tok{input, sep};
Expand Down Expand Up @@ -315,7 +315,7 @@ namespace {
auto paramValues = PlotBase::inputParamValues();
auto ip = paramValues.find("DetId");
if (ip != paramValues.end()) {
the_detid = boost::lexical_cast<unsigned int>(ip->second);
the_detid = std::stoul(ip->second);
}

if (payload.get()) {
Expand Down
24 changes: 12 additions & 12 deletions CondCore/SiStripPlugins/test/testSiStripPayloadInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ int main(int argc, char** argv) {
// Gains

std::string tag = "SiStripApvGain_FromParticles_GR10_v11_offline";
cond::Time_t start = boost::lexical_cast<unsigned long long>(132440);
cond::Time_t end = boost::lexical_cast<unsigned long long>(285368);
cond::Time_t start = static_cast<unsigned long long>(132440);
cond::Time_t end = static_cast<unsigned long long>(285368);
boost::python::dict inputs;

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Gains plots " << std::endl;
Expand Down Expand Up @@ -72,8 +72,8 @@ int main(int argc, char** argv) {
// Noise

tag = "SiStripNoise_GR10_v1_hlt";
start = boost::lexical_cast<unsigned long long>(312968);
end = boost::lexical_cast<unsigned long long>(313120);
start = static_cast<unsigned long long>(312968);
end = static_cast<unsigned long long>(313120);

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Noise plots " << std::endl;

Expand All @@ -98,8 +98,8 @@ int main(int argc, char** argv) {
// Pedestals

tag = "SiStripPedestals_v2_prompt";
start = boost::lexical_cast<unsigned long long>(303420);
end = boost::lexical_cast<unsigned long long>(313120);
start = static_cast<unsigned long long>(303420);
end = static_cast<unsigned long long>(313120);

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Pedestal plots " << std::endl;

Expand All @@ -120,8 +120,8 @@ int main(int argc, char** argv) {
//Latency

tag = "SiStripLatency_v2_prompt";
start = boost::lexical_cast<unsigned long long>(315347);
end = boost::lexical_cast<unsigned long long>(316675);
start = static_cast<unsigned long long>(315347);
end = static_cast<unsigned long long>(316675);

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Latency plots " << std::endl;

Expand All @@ -135,8 +135,8 @@ int main(int argc, char** argv) {

//Threshold
tag = "SiStripThreshold_v1_prompt";
start = boost::lexical_cast<unsigned long long>(315352);
end = boost::lexical_cast<unsigned long long>(315460);
start = static_cast<unsigned long long>(315352);
end = static_cast<unsigned long long>(315460);

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Threshold plots " << std::endl;

Expand All @@ -146,8 +146,8 @@ int main(int argc, char** argv) {

// test SiStripTkMaps
tag = "SiStripBadComponents_startupMC_for2017_v1_mc";
start = boost::lexical_cast<unsigned long long>(1);
end = boost::lexical_cast<unsigned long long>(1);
start = static_cast<unsigned long long>(1);
end = static_cast<unsigned long long>(1);

edm::LogPrint("testSiStripPayloadInspector") << "## Exercising SiStripTkMaps plots " << std::endl;

Expand Down
2 changes: 1 addition & 1 deletion CondCore/Utilities/bin/conddb_test_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int cond::TestReadUtilities::execute() {
std::string siovs = getOptionValue<std::string>("iovs");
tokenizer tok(siovs);
for (auto &t : tok) {
iovs.push_back(boost::lexical_cast<unsigned long long>(t));
iovs.push_back(std::stoull(t));
}
}

Expand Down
6 changes: 3 additions & 3 deletions CondCore/Utilities/plugins/BasicP_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ namespace {
auto paramValues = cond::payloadInspector::PlotBase::inputParamValues();
auto ip = paramValues.find("Factor");
if (ip != paramValues.end()) {
v = v * boost::lexical_cast<float>(ip->second);
v = v * std::stof(ip->second);
}
ip = paramValues.find("Offset");
if (ip != paramValues.end()) {
v = v + boost::lexical_cast<float>(ip->second);
v = v + std::stof(ip->second);
}
ip = paramValues.find("Scale");
if (ip != paramValues.end()) {
v = v * boost::lexical_cast<float>(ip->second);
v = v * std::stof(ip->second);
}
return v;
}
Expand Down
2 changes: 1 addition & 1 deletion CondCore/Utilities/src/CondDBFetch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ namespace cond {
bool found = session.fetchPayloadData(payloadId, payloadTypeName, data, streamerInfo);
if (!found)
throwException(
"Payload with id " + boost::lexical_cast<std::string>(payloadId) + " has not been found in the database.",
"Payload with id " + payloadId + " has not been found in the database.",
"fetch");
return fetchOne(payloadTypeName, data, streamerInfo, payloadPtr);
}
Expand Down
4 changes: 2 additions & 2 deletions CondCore/Utilities/src/PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ namespace cond {
std::string tagName = boost::python::extract<std::string>(entry[0]);
std::string time0s = boost::python::extract<std::string>(entry[1]);
std::string time1s = boost::python::extract<std::string>(entry[2]);
cond::Time_t time0 = boost::lexical_cast<cond::Time_t>(time0s);
cond::Time_t time1 = boost::lexical_cast<cond::Time_t>(time1s);
cond::Time_t time0 = std::stoull(time0s);
cond::Time_t time1 = std::stoull(time1s);
tags[i] = std::make_tuple(tagName, time0, time1);
}
ret = exec_process(connectionString, tags);
Expand Down
2 changes: 1 addition & 1 deletion CondCore/Utilities/test/testPngHistograms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main(int argc, char** argv) {
std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");

std::string tag = std::string("BasicPayload_v10.0");
cond::Time_t since = boost::lexical_cast<unsigned long long>("901");
cond::Time_t since = std::stoull("901");

std::cout << "## PNG Histo" << std::endl;

Expand Down

0 comments on commit f107145

Please sign in to comment.