CMS 3D CMS Logo

PPSAlignmentConfig.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This class is obsolete! Use PPSAlignmentConfiguration instead.
4  *
5  * Authors:
6  * - Jan Kašpar
7  * - Mateusz Kocot
8  *
9  ****************************************************************************/
10 
12 
13 #include <iostream>
14 #include <cmath>
15 #include <iomanip>
16 
17 // -------------------------------- PPSAlignmentConfig getters --------------------------------
18 
19 const std::vector<std::string> &PPSAlignmentConfig::sequence() const { return sequence_; }
21 
24 
26 
31 
33 double PPSAlignmentConfig::n_si() const { return n_si_; }
34 
35 const std::map<unsigned int, std::vector<PointErrors>> &PPSAlignmentConfig::matchingReferencePoints() const {
37 }
38 const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::matchingShiftRanges() const {
39  return matchingShiftRanges_;
40 }
41 
42 const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_x_meth_o_ranges() const {
44 }
47 unsigned int PPSAlignmentConfig::methOGraphMinN() const { return methOGraphMinN_; }
49 
50 const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_x_relative_ranges() const {
52 }
54 
55 const std::map<unsigned int, SelectionRange> &PPSAlignmentConfig::alignment_y_ranges() const {
56  return alignment_y_ranges_;
57 }
58 unsigned int PPSAlignmentConfig::modeGraphMinN() const { return modeGraphMinN_; }
60 
61 const Binning &PPSAlignmentConfig::binning() const { return binning_; }
62 
63 // -------------------------------- PPSAlignmentConfig setters --------------------------------
64 
65 void PPSAlignmentConfig::setSequence(std::vector<std::string> &sequence) { sequence_ = sequence; }
67 
70 
72 
75 void PPSAlignmentConfig::setY_mode_unc_max_valid(double y_mode_unc_max_valid) {
77 }
79 
81 void PPSAlignmentConfig::setN_si(double n_si) { n_si_ = n_si; }
82 
84  std::map<unsigned int, std::vector<PointErrors>> &matchingReferencePoints) {
86 }
87 void PPSAlignmentConfig::setMatchingShiftRanges(std::map<unsigned int, SelectionRange> &matchingShiftRanges) {
89 }
90 
92  std::map<unsigned int, SelectionRange> &alignment_x_meth_o_ranges) {
94 }
95 void PPSAlignmentConfig::setFitProfileMinBinEntries(unsigned int fitProfileMinBinEntries) {
97 }
98 void PPSAlignmentConfig::setFitProfileMinNReasonable(unsigned int fitProfileMinNReasonable) {
100 }
103 
105  std::map<unsigned int, SelectionRange> &alignment_x_relative_ranges) {
107 }
108 void PPSAlignmentConfig::setNearFarMinEntries(unsigned int nearFarMinEntries) {
110 }
111 
112 void PPSAlignmentConfig::setAlignment_y_ranges(std::map<unsigned int, SelectionRange> &alignment_y_ranges) {
114 }
116 void PPSAlignmentConfig::setMultSelProjYMinEntries(unsigned int multSelProjYMinEntries) {
118 }
119 
121 
122 // -------------------------------- << operators --------------------------------
123 
124 std::ostream &operator<<(std::ostream &os, RPConfig &rc) {
125  os << std::fixed << std::setprecision(3);
126  os << " " << rc.name_ << ", id = " << rc.id_ << ", position = " << rc.position_ << ":\n";
127  os << " slope = " << rc.slope_ << ", sh_x = " << rc.sh_x_ << "\n";
128  os << " x_min_fit_mode = " << rc.x_min_fit_mode_ << ", x_max_fit_mode = " << rc.x_max_fit_mode_ << "\n";
129  os << " y_max_fit_mode = " << rc.y_max_fit_mode_ << "\n";
130  os << " y_cen_add = " << rc.y_cen_add_ << ", y_width_mult = " << rc.y_width_mult_ << "\n";
131  os << std::setprecision(2);
132  os << " x slices: min = " << rc.x_slice_min_ << ", w = " << rc.x_slice_w_ << ", n = " << rc.x_slice_n_;
133 
134  return os;
135 }
136 
137 std::ostream &operator<<(std::ostream &os, SectorConfig &sc) {
138  os << std::fixed << std::setprecision(3);
139  os << sc.name_ << ":\n";
140  os << sc.rp_N_ << "\n" << sc.rp_F_ << "\n";
141  os << std::setprecision(3);
142  os << " slope = " << sc.slope_ << "\n";
143  os << " cut_h: apply = " << sc.cut_h_apply_ << ", a = " << sc.cut_h_a_ << ", c = " << sc.cut_h_c_
144  << ", si = " << sc.cut_h_si_ << "\n";
145  os << " cut_v: apply = " << sc.cut_v_apply_ << ", a = " << sc.cut_v_a_ << ", c = " << sc.cut_v_c_
146  << ", si = " << sc.cut_v_si_ << "\n";
147 
148  return os;
149 }
150 
151 std::ostream &operator<<(std::ostream &os, Binning &b) {
152  os << " bin_size_x = " << b.bin_size_x_ << ", n_bins_x = " << b.n_bins_x_ << "\n";
153  os << " pixel_x_offset = " << b.pixel_x_offset_ << "\n";
154  os << " n_bins_y = " << b.n_bins_y_ << ", y_min = " << b.y_min_ << ", y_max = " << b.y_max_;
155 
156  return os;
157 }
158 
159 std::ostream &operator<<(std::ostream &os, PPSAlignmentConfig c) {
160  os << "* sequence\n";
161  for (unsigned int i = 0; i < c.sequence_.size(); i++) {
162  os << " " << i + 1 << ": " << c.sequence_[i] << "\n";
163  }
164  os << "\n";
165 
166  if (c.resultsDir_.empty()) {
167  os << "* no results file\n\n";
168  } else {
169  os << "* results file directory:\n";
170  os << " " << c.resultsDir_ << "\n\n";
171  }
172 
173  os << "* " << c.sectorConfig45_ << "\n\n";
174  os << "* " << c.sectorConfig56_ << "\n\n";
175 
176  std::map<unsigned int, std::string> rpTags = {{c.sectorConfig45_.rp_F_.id_, c.sectorConfig45_.rp_F_.name_},
177  {c.sectorConfig45_.rp_N_.id_, c.sectorConfig45_.rp_N_.name_},
178  {c.sectorConfig56_.rp_N_.id_, c.sectorConfig56_.rp_N_.name_},
179  {c.sectorConfig56_.rp_F_.id_, c.sectorConfig56_.rp_F_.name_}};
180 
181  os << "* x alignment shift step\n";
182  os << " x_ali_sh_step = " << c.x_ali_sh_step_ << "\n\n";
183 
184  os << "* mode graph parameters\n";
185  os << " y_mode_sys_unc = " << c.y_mode_sys_unc_ << "\n";
186  os << " chiSqThreshold = " << c.chiSqThreshold_ << "\n";
187  os << " y_mode_unc_max_valid = " << c.y_mode_unc_max_valid_ << "\n";
188  os << " y_mode_max_valid = " << c.y_mode_max_valid_ << "\n\n";
189 
190  os << "* selection\n";
191  os << " max_RP_tracks_size = " << c.maxRPTracksSize_ << "\n\n";
192 
193  os << "* cuts\n";
194  os << " n_si = " << c.n_si_ << "\n\n";
195 
196  os << "* matching\n" << std::setprecision(3);
197 
198  os << " shift ranges:\n";
199  for (const auto &p : c.matchingShiftRanges_)
200  os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_
201  << ", sh_max = " << p.second.x_max_ << "\n";
202 
203  os << " reference points:\n";
204  for (const auto &pm : c.matchingReferencePoints_) {
205  os << " " << std::setw(3) << pm.first << ": ";
206  for (unsigned int i = 0; i < pm.second.size(); i++) {
207  const auto &p = pm.second[i];
208  if (i % 5 == 0 && i > 0)
209  os << "\n ";
210  os << "(" << std::setw(6) << p.x_ << " +- " << p.ex_ << ", " << std::setw(6) << p.y_ << " +- " << p.ey_ << "), ";
211  }
212  os << "\n";
213  }
214 
215  os << "\n"
216  << "* alignment_x_meth_o\n";
217  for (const auto &p : c.alignment_x_meth_o_ranges_)
218  os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_
219  << ", sh_max = " << p.second.x_max_ << "\n";
220  os << " fit_profile_min_bin_entries = " << c.fitProfileMinBinEntries_ << "\n";
221  os << " fit_profile_min_N_reasonable = " << c.fitProfileMinNReasonable_ << "\n";
222  os << " meth_o_graph_min_N = " << c.methOGraphMinN_ << "\n";
223  os << " meth_o_unc_fit_range = " << c.methOUncFitRange_ << "\n";
224 
225  os << "\n"
226  << "* alignment_x_relative\n";
227  for (const auto &p : c.alignment_x_relative_ranges_)
228  os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_
229  << ", sh_max = " << p.second.x_max_ << "\n";
230  os << " near_far_min_entries = " << c.nearFarMinEntries_ << "\n";
231 
232  os << "\n"
233  << "* alignment_y\n";
234  for (const auto &p : c.alignment_y_ranges_)
235  os << " RP " << rpTags[p.first] << " (" << std::setw(3) << p.first << "): sh_min = " << p.second.x_min_
236  << ", sh_max = " << p.second.x_max_ << "\n";
237  os << " mode_graph_min_N = " << c.modeGraphMinN_ << "\n";
238  os << " mult_sel_proj_y_min_entries = " << c.multSelProjYMinEntries_ << "\n";
239 
240  os << "\n"
241  << "* binning\n";
242  os << c.binning_ << "\n";
243 
244  return os;
245 }
void setBinning(Binning &binning)
const Binning & binning() const
SectorConfig sectorConfig45_
unsigned int fitProfileMinNReasonable() const
const std::map< unsigned int, SelectionRange > & alignment_x_relative_ranges() const
double maxRPTracksSize() const
const std::map< unsigned int, SelectionRange > & alignment_x_meth_o_ranges() const
double y_mode_unc_max_valid() const
unsigned int methOGraphMinN() const
void setMaxRPTracksSize(unsigned int maxRPTracksSize)
double x_min_fit_mode_
unsigned int multSelProjYMinEntries() const
const std::map< unsigned int, SelectionRange > & matchingShiftRanges() const
unsigned int modeGraphMinN() const
double chiSqThreshold() const
const std::vector< std::string > & sequence() const
unsigned int nearFarMinEntries() const
std::map< unsigned int, SelectionRange > alignment_x_meth_o_ranges_
std::string name_
double y_width_mult_
void setSequence(std::vector< std::string > &sequence)
double x_ali_sh_step() const
std::map< unsigned int, SelectionRange > alignment_x_relative_ranges_
void setFitProfileMinBinEntries(unsigned int fitProfileMinBinEntries)
SectorConfig sectorConfig56_
std::vector< std::string > sequence_
double y_mode_sys_unc() const
unsigned int fitProfileMinBinEntries_
double methOUncFitRange() const
std::map< unsigned int, SelectionRange > alignment_y_ranges_
void setY_mode_unc_max_valid(double y_mode_unc_max_valid)
const std::string & resultsDir() const
unsigned int methOGraphMinN_
double x_max_fit_mode_
unsigned int fitProfileMinNReasonable_
void setChiSqThreshold(double chiSqThreshold)
void setAlignment_x_relative_ranges(std::map< unsigned int, SelectionRange > &alignment_x_relative_ranges)
void setAlignment_y_ranges(std::map< unsigned int, SelectionRange > &alignment_y_ranges)
void setNearFarMinEntries(unsigned int nearFarMinEntries)
void setMatchingReferencePoints(std::map< unsigned int, std::vector< PointErrors >> &matchingReferencePoints)
std::map< unsigned int, std::vector< PointErrors > > matchingReferencePoints_
void setFitProfileMinNReasonable(unsigned int fitProfileMinNReasonable)
std::string name_
unsigned int id_
unsigned int fitProfileMinBinEntries() const
double y_max_fit_mode_
void setMultSelProjYMinEntries(unsigned int multSelProjYMinEntries)
std::ostream & operator<<(std::ostream &os, RPConfig &rc)
void setResultsDir(std::string &resultsDir)
double x_slice_min_
void setAlignment_x_meth_o_ranges(std::map< unsigned int, SelectionRange > &alignment_x_meth_o_ranges)
void setMatchingShiftRanges(std::map< unsigned int, SelectionRange > &matchingShiftRanges)
void setY_mode_sys_unc(double y_mode_sys_unc)
void setY_mode_max_valid(double y_mode_max_valid)
std::map< unsigned int, SelectionRange > matchingShiftRanges_
const SectorConfig & sectorConfig45() const
void setMethOGraphMinN(unsigned int methOGraphMinN)
unsigned int nearFarMinEntries_
double y_cen_add_
void setMethOUncFitRange(double methOUncFitRange)
void setSectorConfig45(SectorConfig &sectorConfig45)
void setX_ali_sh_step(double x_ali_sh_step)
std::string position_
double x_slice_w_
double b
Definition: hdecay.h:118
unsigned int maxRPTracksSize_
const std::map< unsigned int, SelectionRange > & alignment_y_ranges() const
const SectorConfig & sectorConfig56() const
void setModeGraphMinN(unsigned int modeGraphMinN)
double y_mode_max_valid() const
unsigned int multSelProjYMinEntries_
void setN_si(double n_si)
unsigned int modeGraphMinN_
void setSectorConfig56(SectorConfig &sectorConfig56)
const std::map< unsigned int, std::vector< PointErrors > > & matchingReferencePoints() const