CMS 3D CMS Logo

RPSimTopology.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5  verbosity_ = params.getParameter<int>("RPVerbosity");
6  no_of_sigms_to_include_ = params.getParameter<double>("RPSharingSigmas");
7 
8  top_edge_sigma_ = params.getParameter<double>("RPTopEdgeSmearing"); //[mm]
9  bot_edge_sigma_ = params.getParameter<double>("RPBottomEdgeSmearing"); //[mm]
10  active_edge_sigma_ = params.getParameter<double>("RPActiveEdgeSmearing"); //[mm]
11 
12  double phys_active_edge_dist = params.getParameter<double>("RPActiveEdgePosition"); //[mm]
13 
14  active_edge_x_ = -x_width_ / 2.0 + phys_edge_lenght_ / sqrt_2 + phys_active_edge_dist * sqrt_2;
15  active_edge_y_ = -y_width_ / 2.0;
16 
17  top_edge_x_ = x_width_ / 2 - params.getParameter<double>("RPTopEdgePosition"); //[mm]
18  bot_edge_x_ = params.getParameter<double>("RPBottomEdgePosition") - x_width_ / 2; //[mm]
19 }
20 
21 std::vector<strip_info> RPSimTopology::GetStripsInvolved(double x, double y, double sigma, double &hit_pos) {
22  theRelevantStrips_.clear();
23  hit_pos = (no_of_strips_ - 1) * pitch_ -
25  y_width_ / 2.0); //hit position with respect to the center of the first strip, only in y direction
26  double hit_pos_in_strips = hit_pos / pitch_;
27  double hit_factor = ActiveEdgeFactor(x, y) * BottomEdgeFactor(x, y) * TopEdgeFactor(x, y);
28  double range_of_interest_in_strips = no_of_sigms_to_include_ * sigma / pitch_;
29  int lowest_strip_no = (int)floor(hit_pos_in_strips - range_of_interest_in_strips + 0.5);
30  int highest_strip_no = (int)ceil(hit_pos_in_strips + range_of_interest_in_strips - 0.5);
31 
32  if (verbosity_)
33  std::cout << "lowest_strip_no:" << lowest_strip_no << " highest_strip_no:" << highest_strip_no << std::endl;
34 
35  if (lowest_strip_no < 0)
36  lowest_strip_no = 0;
37  if (highest_strip_no > no_of_strips_ - 1)
38  highest_strip_no = no_of_strips_ - 1;
39 
40  for (int i = lowest_strip_no; i <= highest_strip_no; ++i) {
41  double low_strip_range = ((double)i - 0.5) * pitch_;
42  double high_strip_range = low_strip_range + pitch_;
43  theRelevantStrips_.emplace_back(strip_info(low_strip_range, high_strip_range, hit_factor, (unsigned short)i));
44  }
45  return theRelevantStrips_;
46 }
DDAxes::y
RPTopology::y_width_
static const double y_width_
Definition: RPTopology.h:60
mps_fire.i
i
Definition: mps_fire.py:428
RPSimTopology::top_edge_x_
double top_edge_x_
Definition: RPSimTopology.h:38
RPSimTopology::bot_edge_x_
double bot_edge_x_
Definition: RPSimTopology.h:39
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPSimTopology::TopEdgeFactor
double TopEdgeFactor(double x, double y)
Definition: RPSimTopology.h:61
DDAxes::x
reco::ceil
constexpr int32_t ceil(float num)
Definition: constexpr_cmath.h:7
RPSimTopology::active_edge_sigma_
double active_edge_sigma_
Definition: RPSimTopology.h:45
RPTopology::last_strip_to_border_dist_
static const double last_strip_to_border_dist_
Definition: RPTopology.h:62
RPSimTopology.h
RPSimTopology::GetStripsInvolved
std::vector< strip_info > GetStripsInvolved(double x, double y, double sigma, double &hit_pos)
Definition: RPSimTopology.cc:21
RPSimTopology::active_edge_x_
double active_edge_x_
Definition: RPSimTopology.h:40
RPSimTopology::verbosity_
int verbosity_
Definition: RPSimTopology.h:47
edm::ParameterSet
Definition: ParameterSet.h:47
RPTopology::pitch_
static const double pitch_
Definition: RPTopology.h:56
RPSimTopology::BottomEdgeFactor
double BottomEdgeFactor(double x, double y)
Definition: RPSimTopology.h:57
RPTopology::sqrt_2
static const double sqrt_2
Definition: RPTopology.h:54
RPSimTopology::bot_edge_sigma_
double bot_edge_sigma_
Definition: RPSimTopology.h:44
RPSimTopology::RPSimTopology
RPSimTopology(const edm::ParameterSet &params)
Definition: RPSimTopology.cc:4
createfilelist.int
int
Definition: createfilelist.py:10
RPSimTopology::active_edge_y_
double active_edge_y_
Definition: RPSimTopology.h:41
RPSimTopology::no_of_sigms_to_include_
double no_of_sigms_to_include_
Definition: RPSimTopology.h:36
RPTopology::no_of_strips_
static const unsigned short no_of_strips_
Definition: RPTopology.h:58
RPSimTopology::top_edge_sigma_
double top_edge_sigma_
Definition: RPSimTopology.h:43
RPTopology::x_width_
static const double x_width_
Definition: RPTopology.h:59
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
strip_info
Definition: RPSimTopology.h:9
RPTopology::phys_edge_lenght_
static const double phys_edge_lenght_
Definition: RPTopology.h:61
RPSimTopology::theRelevantStrips_
std::vector< strip_info > theRelevantStrips_
Definition: RPSimTopology.h:35
RPSimTopology::ActiveEdgeFactor
double ActiveEdgeFactor(double x, double y)
Definition: RPSimTopology.h:53