Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:50:15

0001 #ifndef Geometry_VeryForwardRPTopology_RPSimTopology
0002 #define Geometry_VeryForwardRPTopology_RPSimTopology
0003 
0004 #include "TMath.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 
0007 #include "Geometry/VeryForwardRPTopology/interface/RPTopology.h"
0008 
0009 class strip_info {
0010 public:
0011   strip_info(double lower_border, double higher_border, double eff_factor, unsigned short strip_no)
0012       : lower_border_(lower_border), higher_border_(higher_border), eff_factor_(eff_factor), strip_no_(strip_no) {}
0013   inline double &HigherBoarder() { return higher_border_; }
0014   inline double &LowerBoarder() { return lower_border_; }
0015   inline double &EffFactor() { return eff_factor_; }
0016   inline unsigned short &StripNo() { return strip_no_; }
0017   inline double LowerBoarder() const { return lower_border_; }
0018   inline double HigherBoarder() const { return higher_border_; }
0019   inline double EffFactor() const { return eff_factor_; }
0020   inline unsigned short StripNo() const { return strip_no_; }
0021 
0022 private:
0023   double lower_border_;
0024   double higher_border_;
0025   double eff_factor_;
0026   unsigned short strip_no_;
0027 };
0028 
0029 class RPSimTopology : public RPTopology {
0030 public:
0031   RPSimTopology(const edm::ParameterSet &params);
0032   std::vector<strip_info> GetStripsInvolved(double x, double y, double sigma, double &hit_pos);
0033 
0034 private:
0035   std::vector<strip_info> theRelevantStrips_;
0036   double no_of_sigms_to_include_;
0037   //(0,0) in the center of the wafer
0038   double top_edge_x_;
0039   double bot_edge_x_;
0040   double active_edge_x_;
0041   double active_edge_y_;
0042 
0043   double top_edge_sigma_;
0044   double bot_edge_sigma_;
0045   double active_edge_sigma_;
0046 
0047   int verbosity_;
0048 
0049   const Vector strip_readout_direction_;
0050   const Vector strip_direction_;
0051   const Vector normal_direction_;
0052 
0053   inline double ActiveEdgeFactor(double x, double y) {
0054     return TMath::Erf(DistanceFromActiveEdge(x, y) / sqrt_2 / active_edge_sigma_) / 2 + 0.5;
0055   }
0056 
0057   inline double BottomEdgeFactor(double x, double y) {
0058     return TMath::Erf(DistanceFromBottomEdge(x, y) / sqrt_2 / bot_edge_sigma_) / 2 + 0.5;
0059   }
0060 
0061   inline double TopEdgeFactor(double x, double y) {
0062     return TMath::Erf(DistanceFromTopEdge(x, y) / sqrt_2 / top_edge_sigma_) / 2 + 0.5;
0063   }
0064 
0065   inline double DistanceFromActiveEdge(double x, double y) {
0066     return ((x - active_edge_x_) + (y - active_edge_y_)) / sqrt_2;
0067   }
0068   inline double DistanceFromBottomEdge(double x, double y) { return x - bot_edge_x_; }
0069   inline double DistanceFromTopEdge(double x, double y) { return top_edge_x_ - x; }
0070 };
0071 
0072 #endif  //Geometry_VeryForwardRPTopology_RPSimTopology