Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:23

0001 #ifndef RecoLocalTracker_SiPixelRecHits_PixelCPEGenericBase_H
0002 #define RecoLocalTracker_SiPixelRecHits_PixelCPEGenericBase_H
0003 
0004 #include <vector>
0005 
0006 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h"
0007 
0008 class PixelCPEGenericBase : public PixelCPEBase {
0009 public:
0010   struct ClusterParamGeneric : ClusterParam {
0011     ClusterParamGeneric(){};
0012     ClusterParamGeneric(const SiPixelCluster& cl) : ClusterParam(cl) {}
0013     // The truncation value pix_maximum is an angle-dependent cutoff on the
0014     // individual pixel signals. It should be applied to all pixels in the
0015     // cluster [signal_i = fminf(signal_i, pixmax)] before the column and row
0016     // sums are made. Morris
0017     int pixmx{};
0018 
0019     // These are errors predicted by PIXELAV
0020     float sigmay{};  // CPE Generic y-error for multi-pixel cluster
0021     float sigmax{};  // CPE Generic x-error for multi-pixel cluster
0022     float sy1{};     // CPE Generic y-error for single single-pixel
0023     float sy2{};     // CPE Generic y-error for single double-pixel cluster
0024     float sx1{};     // CPE Generic x-error for single single-pixel cluster
0025     float sx2{};     // CPE Generic x-error for single double-pixel cluster
0026 
0027     // These are irradiation bias corrections
0028     float deltay{};  // CPE Generic y-bias for multi-pixel cluster
0029     float deltax{};  // CPE Generic x-bias for multi-pixel cluster
0030     float dy1{};     // CPE Generic y-bias for single single-pixel cluster
0031     float dy2{};     // CPE Generic y-bias for single double-pixel cluster
0032     float dx1{};     // CPE Generic x-bias for single single-pixel cluster
0033     float dx2{};     // CPE Generic x-bias for single double-pixel cluster
0034   };
0035 
0036   PixelCPEGenericBase(edm::ParameterSet const& conf,
0037                       const MagneticField* mag,
0038                       const TrackerGeometry& geom,
0039                       const TrackerTopology& ttopo,
0040                       const SiPixelLorentzAngle* lorentzAngle,
0041                       const SiPixelGenErrorDBObject* genErrorDBObject,
0042                       const SiPixelLorentzAngle* lorentzAngleWidth);
0043 
0044   ~PixelCPEGenericBase() override = default;
0045 
0046   static void fillPSetDescription(edm::ParameterSetDescription& desc);
0047 
0048 protected:
0049   std::unique_ptr<ClusterParam> createClusterParam(const SiPixelCluster& cl) const override;
0050 
0051   static void collect_edge_charges(ClusterParam& theClusterParam,  //!< input, the cluster
0052                                    int& q_f_X,                     //!< output, Q first  in X
0053                                    int& q_l_X,                     //!< output, Q last   in X
0054                                    int& q_f_Y,                     //!< output, Q first  in Y
0055                                    int& q_l_Y,                     //!< output, Q last   in Y
0056                                    bool truncate);
0057 
0058   void initializeLocalErrorVariables(float& xerr,
0059                                      float& yerr,
0060                                      bool& edgex,
0061                                      bool& edgey,
0062                                      bool& bigInX,
0063                                      bool& bigInY,
0064                                      int& maxPixelCol,
0065                                      int& maxPixelRow,
0066                                      int& minPixelCol,
0067                                      int& minPixelRow,
0068                                      uint& sizex,
0069                                      uint& sizey,
0070                                      DetParam const& theDetParam,
0071                                      ClusterParamGeneric const& theClusterParam) const;
0072 
0073   void setXYErrors(float& xerr,
0074                    float& yerr,
0075                    const bool edgex,
0076                    const bool edgey,
0077                    const unsigned int sizex,
0078                    const unsigned int sizey,
0079                    const bool bigInX,
0080                    const bool bigInY,
0081                    const bool useTemplateErrors,
0082                    DetParam const& theDetParam,
0083                    ClusterParamGeneric const& theClusterParam) const;
0084 
0085   const float edgeClusterErrorX_;
0086   const float edgeClusterErrorY_;
0087   bool useErrorsFromTemplates_;
0088   const bool truncatePixelCharge_;
0089 
0090   // Rechit errors in case other, more correct, errors are not vailable
0091   const std::vector<float> xerr_barrel_l1_, yerr_barrel_l1_, xerr_barrel_ln_;
0092   const std::vector<float> yerr_barrel_ln_, xerr_endcap_, yerr_endcap_;
0093   const float xerr_barrel_l1_def_, yerr_barrel_l1_def_, xerr_barrel_ln_def_;
0094   const float yerr_barrel_ln_def_, xerr_endcap_def_, yerr_endcap_def_;
0095 };
0096 
0097 #endif  // RecoLocalTracker_SiPixelRecHits_PixelCPEGenericBase_H