Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:19:39

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