Skip to content

Commit

Permalink
Added const & to some ES getters and removed one unnecessary comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiXOfficial committed Nov 4, 2020
1 parent ec108b6 commit 3342705
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
6 changes: 3 additions & 3 deletions CalibPPS/AlignmentGlobal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ NB: Parameters here are written in snake_case. Many of them are in camelCase in
| `id` | `cms.int32` | `3` | `23` | `103` | `123` | ID of the RP |
| `slope` | `cms.double` | `0.19` | `0.19` | `0.40` | `0.39` | Base slope value |
| `sh_x` | `cms.double` | `-3.6` | `-42.` | `-2.8` | `-41.9` | Base sh_x value. X alignment method overwrites it. |
| `x_min_fit_mode` | `cms.double` | `2.` | `2.` | `2.` | `2.` | Mode graph parameter. See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L649). |
| `x_max_fit_mode` | `cms.double` | `7.` | `7.5` | `7.4` | `8.` | Mode graph parameter. See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L649). |
| `y_max_fit_mode` | `cms.double` | `7.` | `7.5` | `7.4` | `8.` | Mode graph parameter (in 2018 the same value as x_max_fit_mode). See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L655). |
| `x_min_fit_mode` | `cms.double` | `2.` | `2.` | `2.` | `2.` | Mode graph parameter. See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L648). |
| `x_max_fit_mode` | `cms.double` | `7.` | `7.5` | `7.4` | `8.` | Mode graph parameter. See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L648). |
| `y_max_fit_mode` | `cms.double` | `7.` | `7.5` | `7.4` | `8.` | Mode graph parameter (in 2018 the same value as x_max_fit_mode). See [buildModeGraph](plugins/PPSAlignmentHarvester.cc#L654). |
| `y_cen_add` | `cms.double` | `-0.3` | `-0.3` | `-0.8` | `-0.8` | The value is added to y_cen (mean of y) while constructing a graph in x alignment. |
| `y_width_mult` | `cms.double` | `1.1` | `1.1` | `1.0` | `1.` | y_width (RMS of y) is multiplied by the value when constructing a graph in x alignment. |
| `x_slice_min` | `cms.double` | `7.` | `46.` | `6.` | `45.` | Min x for slice plots (x alignment) |
Expand Down
1 change: 0 additions & 1 deletion CalibPPS/AlignmentGlobal/plugins/PPSAlignmentHarvester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ void PPSAlignmentHarvester::doMatch(DQMStore::IBooker &iBooker,
double sh_max,
double &sh_best,
double &sh_best_unc) {
// const auto &range_test = cfg->alignment_x_meth_o_ranges()[rpd.id_]; // Does not work (wrong results)
const auto range_test = cfg->alignment_x_meth_o_ranges()[rpd.id_];

// print config
Expand Down
20 changes: 10 additions & 10 deletions CondFormats/PPSObjects/interface/PPSAlignmentConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ std::ostream &operator<<(std::ostream &os, Binning &b);
class PPSAlignmentConfig {
public:
// Getters
std::vector<std::string> sequence() const;
std::string resultsDir() const;
const std::vector<std::string> &sequence() const;
const std::string &resultsDir() const;

SectorConfig sectorConfig45() const;
SectorConfig sectorConfig56() const;
const SectorConfig &sectorConfig45() const;
const SectorConfig &sectorConfig56() const;

double x_ali_sh_step() const;

Expand All @@ -111,23 +111,23 @@ class PPSAlignmentConfig {
double maxRPTracksSize() const;
double n_si() const;

std::map<unsigned int, std::vector<PointErrors>> matchingReferencePoints() const;
std::map<unsigned int, SelectionRange> matchingShiftRanges() const;
const std::map<unsigned int, std::vector<PointErrors>> &matchingReferencePoints() const;
const std::map<unsigned int, SelectionRange> &matchingShiftRanges() const;

std::map<unsigned int, SelectionRange> alignment_x_meth_o_ranges() const;
const std::map<unsigned int, SelectionRange> &alignment_x_meth_o_ranges() const;
unsigned int fitProfileMinBinEntries() const;
unsigned int fitProfileMinNReasonable() const;
unsigned int methOGraphMinN() const;
double methOUncFitRange() const;

std::map<unsigned int, SelectionRange> alignment_x_relative_ranges() const;
const std::map<unsigned int, SelectionRange> &alignment_x_relative_ranges() const;
unsigned int nearFarMinEntries() const;

std::map<unsigned int, SelectionRange> alignment_y_ranges() const;
const std::map<unsigned int, SelectionRange> &alignment_y_ranges() const;
unsigned int modeGraphMinN() const;
unsigned int multSelProjYMinEntries() const;

Binning binning() const;
const Binning &binning() const;

// Setters
void setSequence(std::vector<std::string> &sequence);
Expand Down
24 changes: 14 additions & 10 deletions CondFormats/PPSObjects/src/PPSAlignmentConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ TYPELOOKUP_DATA_REG(PPSAlignmentConfig);

// -------------------------------- PPSAlignmentConfig getters --------------------------------

std::vector<std::string> PPSAlignmentConfig::sequence() const { return sequence_; }
std::string PPSAlignmentConfig::resultsDir() const { return resultsDir_; }
const std::vector<std::string> &PPSAlignmentConfig::sequence() const { return sequence_; }
const std::string &PPSAlignmentConfig::resultsDir() const { return resultsDir_; }

SectorConfig PPSAlignmentConfig::sectorConfig45() const { return sectorConfig45_; }
SectorConfig PPSAlignmentConfig::sectorConfig56() const { return sectorConfig56_; }
const SectorConfig &PPSAlignmentConfig::sectorConfig45() const { return sectorConfig45_; }
const SectorConfig &PPSAlignmentConfig::sectorConfig56() const { return sectorConfig56_; }

double PPSAlignmentConfig::x_ali_sh_step() const { return x_ali_sh_step_; }

Expand All @@ -37,29 +37,33 @@ double PPSAlignmentConfig::y_mode_max_valid() const { return y_mode_max_valid_;
double PPSAlignmentConfig::maxRPTracksSize() const { return maxRPTracksSize_; }
double PPSAlignmentConfig::n_si() const { return n_si_; }

std::map<unsigned int, std::vector<PointErrors>> PPSAlignmentConfig::matchingReferencePoints() const {
const std::map<unsigned int, std::vector<PointErrors>> &PPSAlignmentConfig::matchingReferencePoints() const {
return matchingReferencePoints_;
}
std::map<unsigned int, SelectionRange> PPSAlignmentConfig::matchingShiftRanges() const { return matchingShiftRanges_; }
const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::matchingShiftRanges() const {
return matchingShiftRanges_;
}

std::map<unsigned int, SelectionRange> PPSAlignmentConfig::alignment_x_meth_o_ranges() const {
const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_x_meth_o_ranges() const {
return alignment_x_meth_o_ranges_;
}
unsigned int PPSAlignmentConfig::fitProfileMinBinEntries() const { return fitProfileMinBinEntries_; }
unsigned int PPSAlignmentConfig::fitProfileMinNReasonable() const { return fitProfileMinNReasonable_; }
unsigned int PPSAlignmentConfig::methOGraphMinN() const { return methOGraphMinN_; }
double PPSAlignmentConfig::methOUncFitRange() const { return methOUncFitRange_; }

std::map<unsigned int, SelectionRange> PPSAlignmentConfig::alignment_x_relative_ranges() const {
const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_x_relative_ranges() const {
return alignment_x_relative_ranges_;
}
unsigned int PPSAlignmentConfig::nearFarMinEntries() const { return nearFarMinEntries_; }

std::map<unsigned int, SelectionRange> PPSAlignmentConfig::alignment_y_ranges() const { return alignment_y_ranges_; }
const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_y_ranges() const {
return alignment_y_ranges_;
}
unsigned int PPSAlignmentConfig::modeGraphMinN() const { return modeGraphMinN_; }
unsigned int PPSAlignmentConfig::multSelProjYMinEntries() const { return multSelProjYMinEntries_; }

Binning PPSAlignmentConfig::binning() const { return binning_; }
const Binning &PPSAlignmentConfig::binning() const { return binning_; }

// -------------------------------- PPSAlignmentConfig setters --------------------------------

Expand Down

0 comments on commit 3342705

Please sign in to comment.