Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:17

0001 #include "Geometry/VeryForwardRPTopology/interface/RPSimTopology.h"
0002 #include <iostream>
0003 
0004 RPSimTopology::RPSimTopology(const edm::ParameterSet &params) {
0005   verbosity_ = params.getParameter<int>("RPVerbosity");
0006   no_of_sigms_to_include_ = params.getParameter<double>("RPSharingSigmas");
0007 
0008   top_edge_sigma_ = params.getParameter<double>("RPTopEdgeSmearing");        //[mm]
0009   bot_edge_sigma_ = params.getParameter<double>("RPBottomEdgeSmearing");     //[mm]
0010   active_edge_sigma_ = params.getParameter<double>("RPActiveEdgeSmearing");  //[mm]
0011 
0012   double phys_active_edge_dist = params.getParameter<double>("RPActiveEdgePosition");  //[mm]
0013 
0014   active_edge_x_ = -x_width_ / 2.0 + phys_edge_lenght_ / sqrt_2 + phys_active_edge_dist * sqrt_2;
0015   active_edge_y_ = -y_width_ / 2.0;
0016 
0017   top_edge_x_ = x_width_ / 2 - params.getParameter<double>("RPTopEdgePosition");     //[mm]
0018   bot_edge_x_ = params.getParameter<double>("RPBottomEdgePosition") - x_width_ / 2;  //[mm]
0019 }
0020 
0021 std::vector<strip_info> RPSimTopology::GetStripsInvolved(double x, double y, double sigma, double &hit_pos) {
0022   theRelevantStrips_.clear();
0023   hit_pos = (no_of_strips_ - 1) * pitch_ -
0024             (y - last_strip_to_border_dist_ +
0025              y_width_ / 2.0);  //hit position with respect to the center of the first strip, only in y direction
0026   double hit_pos_in_strips = hit_pos / pitch_;
0027   double hit_factor = ActiveEdgeFactor(x, y) * BottomEdgeFactor(x, y) * TopEdgeFactor(x, y);
0028   double range_of_interest_in_strips = no_of_sigms_to_include_ * sigma / pitch_;
0029   int lowest_strip_no = (int)floor(hit_pos_in_strips - range_of_interest_in_strips + 0.5);
0030   int highest_strip_no = (int)ceil(hit_pos_in_strips + range_of_interest_in_strips - 0.5);
0031 
0032   if (verbosity_)
0033     std::cout << "lowest_strip_no:" << lowest_strip_no << "  highest_strip_no:" << highest_strip_no << std::endl;
0034 
0035   if (lowest_strip_no < 0)
0036     lowest_strip_no = 0;
0037   if (highest_strip_no > no_of_strips_ - 1)
0038     highest_strip_no = no_of_strips_ - 1;
0039 
0040   for (int i = lowest_strip_no; i <= highest_strip_no; ++i) {
0041     double low_strip_range = ((double)i - 0.5) * pitch_;
0042     double high_strip_range = low_strip_range + pitch_;
0043     theRelevantStrips_.emplace_back(strip_info(low_strip_range, high_strip_range, hit_factor, (unsigned short)i));
0044   }
0045   return theRelevantStrips_;
0046 }