Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:28

0001 #ifndef CondFormats_PPSObjects_PPSPixelTopology_h
0002 #define CondFormats_PPSObjects_PPSPixelTopology_h
0003 // -*- C++ -*-
0004 //
0005 // Package:    PPSObjects
0006 // Class:      PPSPixelTopology
0007 //
0008 /**\class PPSPixelTopology PPSPixelTopology.h CondFormats/PPSObjects/src/PPSPixelTopology.cc
0009 
0010  Description: Internal topology of PPS detectors
0011 
0012  Implementation:
0013      <Notes on implementation>
0014 */
0015 //
0016 
0017 #include "CondFormats/Serialization/interface/Serializable.h"
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019 #include "CondFormats/PPSObjects/interface/CTPPSPixelIndices.h"
0020 #include <cmath>
0021 
0022 class PPSPixelTopology {
0023 public:
0024   // Constructor
0025   PPSPixelTopology();
0026   // Destructor
0027   ~PPSPixelTopology();
0028 
0029   class PixelInfo {
0030   public:
0031     PixelInfo(double lower_simX_border,
0032               double higher_simX_border,
0033               double lower_simY_border,
0034               double higher_simY_border,
0035               double eff_factor,
0036               unsigned short pixel_row_no,
0037               unsigned short pixel_col_no)
0038         : lower_simX_border_(lower_simX_border),
0039           higher_simX_border_(higher_simX_border),
0040           lower_simY_border_(lower_simY_border),
0041           higher_simY_border_(higher_simY_border),
0042           eff_factor_(eff_factor),
0043           pixel_row_no_(pixel_row_no),
0044           pixel_col_no_(pixel_col_no)
0045     //,
0046     //      pixel_index_(pixel_col_no * PPSPixelTopology::no_of_pixels_simX_ + pixel_row_no)
0047     {}
0048 
0049     inline double higherSimXBorder() const { return higher_simX_border_; }
0050     inline double lowerSimXBorder() const { return lower_simX_border_; }
0051     inline double higherSimYBorder() const { return higher_simY_border_; }
0052     inline double lowerSimYBorder() const { return lower_simY_border_; }
0053     inline double effFactor() const { return eff_factor_; }
0054     inline unsigned short pixelRowNo() const { return pixel_row_no_; }
0055     inline unsigned short pixelColNo() const { return pixel_col_no_; }
0056     //    inline unsigned short pixelIndex() const { return pixel_index_; }
0057 
0058   private:
0059     double lower_simX_border_;
0060     double higher_simX_border_;
0061     double lower_simY_border_;
0062     double higher_simY_border_;
0063     double eff_factor_;
0064     unsigned short pixel_row_no_;
0065     unsigned short pixel_col_no_;
0066     //    unsigned short pixel_index_;
0067     COND_SERIALIZABLE;
0068   };
0069 
0070   unsigned short pixelIndex(PixelInfo pI) const;
0071   bool isPixelHit(float xLocalCoordinate, float yLocalCoordinate, bool is3x2) const;
0072   PixelInfo getPixelsInvolved(double x, double y, double sigma, double& hit_pos_x, double& hit_pos_y) const;
0073 
0074   void pixelRange(
0075       unsigned int arow, unsigned int acol, double& lower_x, double& higher_x, double& lower_y, double& higher_y) const;
0076 
0077   // Getters
0078 
0079   std::string getRunType() const;
0080   double getPitchSimY() const;
0081   double getPitchSimX() const;
0082   double getThickness() const;
0083   unsigned short getNoPixelsSimX() const;
0084   unsigned short getNoPixelsSimY() const;
0085   unsigned short getNoPixels() const;
0086   double getSimXWidth() const;
0087   double getSimYWidth() const;
0088   double getDeadEdgeWidth() const;
0089   double getActiveEdgeSigma() const;
0090   double getPhysActiveEdgeDist() const;
0091   double getActiveEdgeX() const;
0092   double getActiveEdgeY() const;
0093 
0094   // Setters
0095 
0096   void setRunType(std::string rt);
0097   void setPitchSimY(double psy);
0098   void setPitchSimX(double psx);
0099   void setThickness(double tss);
0100   void setNoPixelsSimX(unsigned short npx);
0101   void setNoPixelsSimY(unsigned short npy);
0102   void setNoPixels(unsigned short np);
0103   void setSimXWidth(double sxw);
0104   void setSimYWidth(double syw);
0105   void setDeadEdgeWidth(double dew);
0106   void setActiveEdgeSigma(double aes);
0107   void setPhysActiveEdgeDist(double pae);
0108   void setActiveEdgeX(double aex);
0109   void setActiveEdgeY(double aey);
0110 
0111   void printInfo(std::stringstream& s);
0112 
0113 private:
0114   /*
0115 Geometrical and topological information on RPix silicon detector.
0116 Uses coordinate a frame with origin in the center of the wafer.
0117 */
0118 
0119   double activeEdgeFactor(double x, double y) const;
0120   double distanceFromTopActiveEdge(double x, double y) const;
0121   double distanceFromBottomActiveEdge(double x, double y) const;
0122   double distanceFromRightActiveEdge(double x, double y) const;
0123   double distanceFromLeftActiveEdge(double x, double y) const;
0124   unsigned int row(double x) const;
0125   unsigned int col(double y) const;
0126   void rowCol2Index(unsigned int arow, unsigned int acol, unsigned int& index) const;
0127   void index2RowCol(unsigned int& arow, unsigned int& acol, unsigned int index) const;
0128 
0129   std::string runType_;
0130   double pitch_simY_;
0131   double pitch_simX_;
0132   double thickness_;
0133   unsigned short no_of_pixels_simX_;
0134   unsigned short no_of_pixels_simY_;
0135   unsigned short no_of_pixels_;
0136   double simX_width_;
0137   double simY_width_;
0138   double dead_edge_width_;
0139   double active_edge_sigma_;
0140   double phys_active_edge_dist_;
0141 
0142   double active_edge_x_;
0143   double active_edge_y_;
0144 
0145   COND_SERIALIZABLE;
0146 };
0147 
0148 std::ostream& operator<<(std::ostream&, PPSPixelTopology);
0149 
0150 #endif