Skip to content

Commit 3d8512f

Browse files
committed
Changes from review
1 parent d236128 commit 3d8512f

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

CondFormats/JetMETObjects/bin/JetResolution_t.cc

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
////////////////////////////////////////////////////////////////////////////////
88

99
#include "CondFormats/JetMETObjects/interface/JetResolution.h"
10+
#include "FWCore/ParameterSet/interface/FileInPath.h"
1011

1112
#include <TROOT.h>
1213
#include <TApplication.h>
@@ -61,21 +62,12 @@ int main(int argc, char** argv) {
6162
cout << "nevts: " << nevts << endl;
6263
cout << "gaussian: " << doGaussian << endl << endl;
6364

64-
// CMSSW_BASE and CMSSW_RELEASE_BASE are always set
65-
[[clang::suppress]] string cmssw_base(std::getenv("CMSSW_BASE"));
66-
[[clang::suppress]] string cmssw_release_base(std::getenv("CMSSW_RELEASE_BASE"));
67-
string path = cmssw_base + "/src/CondFormats/JetMETObjects/data";
68-
struct stat st;
69-
if (stat(path.c_str(), &st) != 0)
70-
path = cmssw_release_base + "/src/CondFormats/JetMETObjects/data";
71-
if (stat(path.c_str(), &st) != 0) {
72-
cerr << "ERROR: tried to set path but failed, abort." << endl;
73-
return 0;
74-
}
75-
76-
string ptFileName = path + "/" + era + "_PtResolution_" + alg + ".txt";
77-
string etaFileName = path + "/" + era + "_EtaResolution_" + alg + ".txt";
78-
string phiFileName = path + "/" + era + "_PhiResolution_" + alg + ".txt";
65+
string ptFileName =
66+
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PtResolution_" + alg + ".txt").fullPath();
67+
string etaFileName =
68+
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_EtaResolution_" + alg + ".txt").fullPath();
69+
string phiFileName =
70+
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PhiResolution_" + alg + ".txt").fullPath();
7971

8072
cout << ptFileName << endl;
8173
cout << etaFileName << endl;

CondTools/DT/src/DTPerformanceHandler.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void DTPerformanceHandler::getNewObjects() {
7878
std::map<std::string, popcon::PayloadIOV>::iterator itag =
7979
mp.find( dataTag );
8080
*/
81-
cond::Time_t snc = runNumber;
8281
if (runNumber <= last) {
8382
std::cout << "More recent data already present - skipped" << std::endl;
8483
return;
@@ -130,7 +129,7 @@ void DTPerformanceHandler::getNewObjects() {
130129
*/
131130

132131
//for each payload provide IOV information (say in this case we use since)
133-
m_to_transfer.push_back(std::make_pair(dtPerf, snc));
132+
m_to_transfer.emplace_back(dtPerf, runNumber);
134133
}
135134

136135
std::string DTPerformanceHandler::id() const { return dataTag; }

CondTools/DT/src/DTStatusFlagHandler.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ void DTStatusFlagHandler::getNewObjects() {
7676
std::map<std::string, popcon::PayloadIOV>::iterator itag =
7777
mp.find( dataTag );
7878
*/
79-
cond::Time_t snc = runNumber;
80-
8179
if (runNumber <= last) {
8280
std::cout << "More recent data already present - skipped" << std::endl;
8381
return;
@@ -128,7 +126,7 @@ void DTStatusFlagHandler::getNewObjects() {
128126
*/
129127

130128
//for each payload provide IOV information (say in this case we use since)
131-
m_to_transfer.push_back(std::make_pair(stFlag, snc));
129+
m_to_transfer.emplace_back(stFlag, runNumber);
132130
}
133131

134132
std::string DTStatusFlagHandler::id() const { return dataTag; }

CondTools/SiPixel/plugins/SiPixelDynamicInefficiencyReader.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void SiPixelDynamicInefficiencyReader::analyze(const edm::Event& e, const edm::E
197197
}
198198

199199
//DB PU factor calculation
200-
unsigned int pu_iterator = 0;
201-
for (it_pu = map_pufactor.begin(); it_pu != map_pufactor.end(); it_pu++, pu_iterator++) {
200+
it_pu = map_pufactor.begin();
201+
for (unsigned int pu_iterator = 0; pu_iterator < pu_det; it_pu++, pu_iterator++) {
202202
const DetId mapid = DetId(it_pu->first);
203203
if (mapid.subdetId() != detid.subdetId())
204204
continue;
@@ -270,13 +270,11 @@ void SiPixelDynamicInefficiencyReader::analyze(const edm::Event& e, const edm::E
270270
mismatch++;
271271
}
272272
for (unsigned int i = 0; i < pu_det; i++) {
273-
[[clang::suppress]]
274273
if (_pu_scale[i] != 0 && _pu_scale_conf[i] != 0 && _pu_scale[i] == _pu_scale_conf[i]) {
275274
//printf("Config match! detid %x\t db_pu_scale %f\tconf_pu_scale %f\n",detid.rawId(),_pu_scale[i],_pu_scale_conf[i]);
276275
pu_match++;
277276
break;
278277
}
279-
[[clang::suppress]]
280278
if (_pu_scale[i] != 0 && _pu_scale_conf[i] != 0 && _pu_scale[i] != _pu_scale_conf[i]) {
281279
//printf("Config mismatch! detid %x\t db_pu_scale %f\tconf_pu_scale %f\n",detid.rawId(),_pu_scale[i],_pu_scale_conf[i]);
282280
pu_mismatch++;

0 commit comments

Comments
 (0)