File indexing completed on 2023-10-25 09:50:15
0001 #include "Geometry/VeryForwardRPTopology/interface/RPSimTopology.h"
0002 #include <iostream>
0003
0004 RPSimTopology::RPSimTopology(const edm::ParameterSet ¶ms) {
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");
0009 bot_edge_sigma_ = params.getParameter<double>("RPBottomEdgeSmearing");
0010 active_edge_sigma_ = params.getParameter<double>("RPActiveEdgeSmearing");
0011
0012 double phys_active_edge_dist = params.getParameter<double>("RPActiveEdgePosition");
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");
0018 bot_edge_x_ = params.getParameter<double>("RPBottomEdgePosition") - x_width_ / 2;
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);
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 }