Skip to content

Commit

Permalink
Merge pull request #23570 from Dr15Jones/threadSafePFEnergyCalibration
Browse files Browse the repository at this point in the history
Changed function local static map to be const
  • Loading branch information
cmsbuild committed Jun 15, 2018
2 parents 05a03af + ff9bf22 commit e63273d
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions RecoParticleFlow/PFClusterTools/src/PFEnergyCalibration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,22 +518,22 @@ std::ostream& operator<<(std::ostream& out,

if ( calib.pfCalibrations ) {

static std::map<std::string, PerformanceResult::ResultType> functType;

functType["PFfa_BARREL"] = PerformanceResult::PFfa_BARREL;
functType["PFfa_ENDCAP"] = PerformanceResult::PFfa_ENDCAP;
functType["PFfb_BARREL"] = PerformanceResult::PFfb_BARREL;
functType["PFfb_ENDCAP"] = PerformanceResult::PFfb_ENDCAP;
functType["PFfc_BARREL"] = PerformanceResult::PFfc_BARREL;
functType["PFfc_ENDCAP"] = PerformanceResult::PFfc_ENDCAP;
functType["PFfaEta_BARRELH"] = PerformanceResult::PFfaEta_BARRELH;
functType["PFfaEta_ENDCAPH"] = PerformanceResult::PFfaEta_ENDCAPH;
functType["PFfbEta_BARRELH"] = PerformanceResult::PFfbEta_BARRELH;
functType["PFfbEta_ENDCAPH"] = PerformanceResult::PFfbEta_ENDCAPH;
functType["PFfaEta_BARRELEH"] = PerformanceResult::PFfaEta_BARRELEH;
functType["PFfaEta_ENDCAPEH"] = PerformanceResult::PFfaEta_ENDCAPEH;
functType["PFfbEta_BARRELEH"] = PerformanceResult::PFfbEta_BARRELEH;
functType["PFfbEta_ENDCAPEH"] = PerformanceResult::PFfbEta_ENDCAPEH;
static const std::map<std::string, PerformanceResult::ResultType> functType = {
{"PFfa_BARREL", PerformanceResult::PFfa_BARREL},
{"PFfa_ENDCAP", PerformanceResult::PFfa_ENDCAP},
{"PFfb_BARREL", PerformanceResult::PFfb_BARREL},
{"PFfb_ENDCAP", PerformanceResult::PFfb_ENDCAP},
{"PFfc_BARREL", PerformanceResult::PFfc_BARREL},
{"PFfc_ENDCAP", PerformanceResult::PFfc_ENDCAP},
{"PFfaEta_BARRELH", PerformanceResult::PFfaEta_BARRELH},
{"PFfaEta_ENDCAPH", PerformanceResult::PFfaEta_ENDCAPH},
{"PFfbEta_BARRELH", PerformanceResult::PFfbEta_BARRELH},
{"PFfbEta_ENDCAPH", PerformanceResult::PFfbEta_ENDCAPH},
{"PFfaEta_BARRELEH", PerformanceResult::PFfaEta_BARRELEH},
{"PFfaEta_ENDCAPEH", PerformanceResult::PFfaEta_ENDCAPEH},
{"PFfbEta_BARRELEH", PerformanceResult::PFfbEta_BARRELEH},
{"PFfbEta_ENDCAPEH", PerformanceResult::PFfbEta_ENDCAPEH}
};

for(std::map<std::string,PerformanceResult::ResultType>::const_iterator
func = functType.begin();
Expand Down

0 comments on commit e63273d

Please sign in to comment.