Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Oct 15, 2024
1 parent d236128 commit 3d8512f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
22 changes: 7 additions & 15 deletions CondFormats/JetMETObjects/bin/JetResolution_t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
////////////////////////////////////////////////////////////////////////////////

#include "CondFormats/JetMETObjects/interface/JetResolution.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"

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

// CMSSW_BASE and CMSSW_RELEASE_BASE are always set
[[clang::suppress]] string cmssw_base(std::getenv("CMSSW_BASE"));
[[clang::suppress]] string cmssw_release_base(std::getenv("CMSSW_RELEASE_BASE"));
string path = cmssw_base + "/src/CondFormats/JetMETObjects/data";
struct stat st;
if (stat(path.c_str(), &st) != 0)
path = cmssw_release_base + "/src/CondFormats/JetMETObjects/data";
if (stat(path.c_str(), &st) != 0) {
cerr << "ERROR: tried to set path but failed, abort." << endl;
return 0;
}

string ptFileName = path + "/" + era + "_PtResolution_" + alg + ".txt";
string etaFileName = path + "/" + era + "_EtaResolution_" + alg + ".txt";
string phiFileName = path + "/" + era + "_PhiResolution_" + alg + ".txt";
string ptFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PtResolution_" + alg + ".txt").fullPath();
string etaFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_EtaResolution_" + alg + ".txt").fullPath();
string phiFileName =
edm::FileInPath("CondFormats/JetMETObjects/data/" + era + "_PhiResolution_" + alg + ".txt").fullPath();

cout << ptFileName << endl;
cout << etaFileName << endl;
Expand Down
3 changes: 1 addition & 2 deletions CondTools/DT/src/DTPerformanceHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ void DTPerformanceHandler::getNewObjects() {
std::map<std::string, popcon::PayloadIOV>::iterator itag =
mp.find( dataTag );
*/
cond::Time_t snc = runNumber;
if (runNumber <= last) {
std::cout << "More recent data already present - skipped" << std::endl;
return;
Expand Down Expand Up @@ -130,7 +129,7 @@ void DTPerformanceHandler::getNewObjects() {
*/

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

std::string DTPerformanceHandler::id() const { return dataTag; }
4 changes: 1 addition & 3 deletions CondTools/DT/src/DTStatusFlagHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ void DTStatusFlagHandler::getNewObjects() {
std::map<std::string, popcon::PayloadIOV>::iterator itag =
mp.find( dataTag );
*/
cond::Time_t snc = runNumber;

if (runNumber <= last) {
std::cout << "More recent data already present - skipped" << std::endl;
return;
Expand Down Expand Up @@ -128,7 +126,7 @@ void DTStatusFlagHandler::getNewObjects() {
*/

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

std::string DTStatusFlagHandler::id() const { return dataTag; }
6 changes: 2 additions & 4 deletions CondTools/SiPixel/plugins/SiPixelDynamicInefficiencyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void SiPixelDynamicInefficiencyReader::analyze(const edm::Event& e, const edm::E
}

//DB PU factor calculation
unsigned int pu_iterator = 0;
for (it_pu = map_pufactor.begin(); it_pu != map_pufactor.end(); it_pu++, pu_iterator++) {
it_pu = map_pufactor.begin();
for (unsigned int pu_iterator = 0; pu_iterator < pu_det; it_pu++, pu_iterator++) {
const DetId mapid = DetId(it_pu->first);
if (mapid.subdetId() != detid.subdetId())
continue;
Expand Down Expand Up @@ -270,13 +270,11 @@ void SiPixelDynamicInefficiencyReader::analyze(const edm::Event& e, const edm::E
mismatch++;
}
for (unsigned int i = 0; i < pu_det; i++) {
[[clang::suppress]]
if (_pu_scale[i] != 0 && _pu_scale_conf[i] != 0 && _pu_scale[i] == _pu_scale_conf[i]) {
//printf("Config match! detid %x\t db_pu_scale %f\tconf_pu_scale %f\n",detid.rawId(),_pu_scale[i],_pu_scale_conf[i]);
pu_match++;
break;
}
[[clang::suppress]]
if (_pu_scale[i] != 0 && _pu_scale_conf[i] != 0 && _pu_scale[i] != _pu_scale_conf[i]) {
//printf("Config mismatch! detid %x\t db_pu_scale %f\tconf_pu_scale %f\n",detid.rawId(),_pu_scale[i],_pu_scale_conf[i]);
pu_mismatch++;
Expand Down

0 comments on commit 3d8512f

Please sign in to comment.