CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
constexpr int32_t ceil(float num)
double BottomEdgeFactor(double x, double y)
Definition: RPSimTopology.h:57
static const double phys_edge_lenght_
Definition: RPTopology.h:56
std::vector< strip_info > theRelevantStrips_
Definition: RPSimTopology.h:35
double top_edge_sigma_
Definition: RPSimTopology.h:43
double active_edge_sigma_
Definition: RPSimTopology.h:45
static const unsigned short no_of_strips_
Definition: RPTopology.h:53
double active_edge_y_
Definition: RPSimTopology.h:41
static const double y_width_
Definition: RPTopology.h:55
static const double x_width_
Definition: RPTopology.h:54
double ActiveEdgeFactor(double x, double y)
Definition: RPSimTopology.h:53
RPSimTopology(const edm::ParameterSet &params)
Definition: RPSimTopology.cc:4
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
double no_of_sigms_to_include_
Definition: RPSimTopology.h:36
double top_edge_x_
Definition: RPSimTopology.h:38
double active_edge_x_
Definition: RPSimTopology.h:40
double bot_edge_x_
Definition: RPSimTopology.h:39
static const double last_strip_to_border_dist_
Definition: RPTopology.h:57
double bot_edge_sigma_
Definition: RPSimTopology.h:44
double TopEdgeFactor(double x, double y)
Definition: RPSimTopology.h:61
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< strip_info > GetStripsInvolved(double x, double y, double sigma, double &hit_pos)
static const double pitch_
Definition: RPTopology.h:51
tuple cout
Definition: gather_cfg.py:144
static const double sqrt_2
Definition: RPTopology.h:49