Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:12

0001 #ifndef RecoLocalTracker_SiStripRecHitConverter_StripCPE_H
0002 #define RecoLocalTracker_SiStripRecHitConverter_StripCPE_H
0003 
0004 #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h"
0005 
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "MagneticField/Engine/interface/MagneticField.h"
0008 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0009 #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h"
0010 #include "CondFormats/SiStripObjects/interface/SiStripBackPlaneCorrection.h"
0011 #include "CondFormats/SiStripObjects/interface/SiStripConfObject.h"
0012 #include "CondFormats/SiStripObjects/interface/SiStripLatency.h"
0013 #include "DataFormats/SiStripDetId/interface/SiStripDetId.h"
0014 
0015 class StripTopology;
0016 
0017 class StripCPE : public StripClusterParameterEstimator {
0018 public:
0019   using StripClusterParameterEstimator::localParameters;
0020 
0021   StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster& cl,
0022                                                               const GeomDetUnit&) const override;
0023 
0024   StripCPE(edm::ParameterSet& conf,
0025            const MagneticField&,
0026            const TrackerGeometry&,
0027            const SiStripLorentzAngle&,
0028            const SiStripBackPlaneCorrection&,
0029            const SiStripConfObject&,
0030            const SiStripLatency&);
0031   LocalVector driftDirection(const StripGeomDetUnit* det) const override;
0032 
0033   struct Param {
0034     Param() : topology(nullptr) {}
0035     StripTopology const* topology;
0036     LocalVector drift;
0037     float thickness, invThickness, pitch_rel_err2, maxLength;
0038     int nstrips;
0039     float backplanecorrection;
0040     SiStripModuleGeometry moduleGeom;
0041     float coveredStrips(const LocalVector&, const LocalPoint&) const;
0042   };
0043 
0044   struct AlgoParam {
0045     Param const& p;
0046     const LocalTrajectoryParameters& ltp;
0047     SiStripDetId::SubDetector loc;
0048     float afullProjection;
0049     float corr;
0050   };
0051 
0052   virtual StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster& cl,
0053                                                                       AlgoParam const& ap) const {
0054     return std::make_pair(LocalPoint(), LocalError());
0055   }
0056 
0057   AlgoParam getAlgoParam(const GeomDetUnit& det, const LocalTrajectoryParameters& ltp) const {
0058     StripCPE::Param const& p = param(det);
0059     SiStripDetId::SubDetector loc = SiStripDetId(det.geographicalId()).subDetector();
0060 
0061     LocalVector track = ltp.directionNotNormalized();
0062     track *= -p.thickness;
0063 
0064     const float fullProjection = p.coveredStrips(track + p.drift, ltp.position());
0065 
0066     auto const corr =
0067         -0.5f * (1.f - p.backplanecorrection) * fullProjection + 0.5f * p.coveredStrips(track, ltp.position());
0068 
0069     return AlgoParam{p, ltp, loc, std::abs(fullProjection), corr};
0070   }
0071 
0072 protected:
0073   const bool peakMode_;
0074   const TrackerGeometry& geom_;
0075   const MagneticField& magfield_;
0076   const SiStripLorentzAngle& LorentzAngleMap_;
0077   const SiStripBackPlaneCorrection& BackPlaneCorrectionMap_;
0078   std::vector<float> xtalk1;
0079   std::vector<float> xtalk2;
0080 
0081   Param const& param(const GeomDetUnit& det) const { return m_Params[det.index() - m_off]; }
0082 
0083 private:
0084   void fillParams();
0085   typedef std::vector<Param> Params;
0086   Params m_Params;
0087   unsigned int m_off;
0088 };
0089 #endif