CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPSimTopology.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5 {
6  verbosity_ = params.getParameter<int>("RPVerbosity");
7  no_of_sigms_to_include_ = params.getParameter<double>("RPSharingSigmas");
8 
9  top_edge_sigma_ = params.getParameter<double>("RPTopEdgeSmearing"); //[mm]
10  bot_edge_sigma_ = params.getParameter<double>("RPBottomEdgeSmearing"); //[mm]
11  active_edge_sigma_ = params.getParameter<double>("RPActiveEdgeSmearing"); //[mm]
12 
13  double phys_active_edge_dist = params.getParameter<double>("RPActiveEdgePosition"); //[mm]
14 
15  active_edge_x_ = -x_width_/2.0 + phys_edge_lenght_/sqrt_2 + phys_active_edge_dist*sqrt_2;
16  active_edge_y_ = -y_width_/2.0;
17 
18  top_edge_x_ = x_width_/2-params.getParameter<double>("RPTopEdgePosition"); //[mm]
19  bot_edge_x_ = params.getParameter<double>("RPBottomEdgePosition")-x_width_/2; //[mm]
20 }
21 
22 std::vector<strip_info> RPSimTopology::GetStripsInvolved(double x, double y, double sigma, double &hit_pos)
23 {
24  theRelevantStrips_.clear();
25  hit_pos = (no_of_strips_-1)*pitch_ -(y-last_strip_to_border_dist_+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  {
42  double low_strip_range = ((double)i-0.5)*pitch_;
43  double high_strip_range = low_strip_range+pitch_;
44  theRelevantStrips_.push_back(strip_info(low_strip_range, high_strip_range, hit_factor, (unsigned short)i));
45  }
46  return theRelevantStrips_;
47 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
double BottomEdgeFactor(double x, double y)
Definition: RPSimTopology.h:60
static const double phys_edge_lenght_
Definition: RPTopology.h:63
std::vector< strip_info > theRelevantStrips_
Definition: RPSimTopology.h:37
double top_edge_sigma_
Definition: RPSimTopology.h:45
double active_edge_sigma_
Definition: RPSimTopology.h:47
static const unsigned short no_of_strips_
Definition: RPTopology.h:60
double active_edge_y_
Definition: RPSimTopology.h:43
T x() const
Cartesian x coordinate.
static const double y_width_
Definition: RPTopology.h:62
static const double x_width_
Definition: RPTopology.h:61
double ActiveEdgeFactor(double x, double y)
Definition: RPSimTopology.h:55
RPSimTopology(const edm::ParameterSet &params)
Definition: RPSimTopology.cc:4
double no_of_sigms_to_include_
Definition: RPSimTopology.h:38
double top_edge_x_
Definition: RPSimTopology.h:40
double active_edge_x_
Definition: RPSimTopology.h:42
double bot_edge_x_
Definition: RPSimTopology.h:41
static const double last_strip_to_border_dist_
Definition: RPTopology.h:64
double bot_edge_sigma_
Definition: RPSimTopology.h:46
double TopEdgeFactor(double x, double y)
Definition: RPSimTopology.h:65
std::vector< strip_info > GetStripsInvolved(double x, double y, double sigma, double &hit_pos)
static const double pitch_
Definition: RPTopology.h:58
tuple cout
Definition: gather_cfg.py:145
static const double sqrt_2
Definition: RPTopology.h:56