Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:46

0001 #ifndef PIXELHITMATCHER_H
0002 #define PIXELHITMATCHER_H
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    EgammaElectronAlgos
0007 // Class:      PixelHitMatcher
0008 //
0009 /**\class PixelHitMatcher EgammaElectronAlgos/PixelHitMatcher
0010 
0011  Description: Class to match an ECAL cluster to the pixel hits.
0012   Two compatible hits in the pixel layers are required.
0013 
0014  Implementation:
0015      future redesign
0016 */
0017 //
0018 // Original Author:  Ursula Berthon, Claude Charlot
0019 //         Created:  Mon Mar 27 13:22:06 CEST 2006
0020 //
0021 //
0022 
0023 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
0024 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0025 
0026 /** Class to match an ECAL cluster to the pixel hits.
0027  *  Two compatible hits in the pixel layers are required.
0028  */
0029 
0030 class TrackerGeometry;
0031 class MagneticField;
0032 
0033 struct SeedWithInfo {
0034   const TrajectorySeed seed;
0035   const unsigned char hitsMask;
0036   const int subDet2;
0037   const float dRz2;
0038   const float dPhi2;
0039   const int subDet1;
0040   const float dRz1;
0041   const float dPhi1;
0042 };
0043 
0044 class PixelHitMatcher {
0045 public:
0046   PixelHitMatcher(float phi1min,
0047                   float phi1max,
0048                   float phi2minB,
0049                   float phi2maxB,
0050                   float phi2minF,
0051                   float phi2maxF,
0052                   float z2maxB,
0053                   float r2maxF,
0054                   float rMaxI,
0055                   bool useRecoVertex);
0056 
0057   void setES(MagneticField const&, TrackerGeometry const& trackerGeometry);
0058 
0059   std::vector<SeedWithInfo> operator()(const std::vector<const TrajectorySeedCollection*>& seedsV,
0060                                        const GlobalPoint& xmeas,
0061                                        const GlobalPoint& vprim,
0062                                        float energy,
0063                                        int charge) const;
0064 
0065   void set1stLayer(float dummyphi1min, float dummyphi1max);
0066   void set1stLayerZRange(float zmin1, float zmax1);
0067   void set2ndLayer(float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF);
0068 
0069 private:
0070   struct BarrelMeasurementEstimator {
0071     bool operator()(const GlobalPoint& vprim, const TrajectoryStateOnSurface&, const GlobalPoint&, int charge) const;
0072 
0073     float thePhiMin;
0074     float thePhiMax;
0075     float theZMin;
0076     float theZMax;
0077   };
0078 
0079   struct ForwardMeasurementEstimator {
0080     bool operator()(const GlobalPoint& vprim, const TrajectoryStateOnSurface&, const GlobalPoint&, int charge) const;
0081 
0082     float thePhiMin;
0083     float thePhiMax;
0084     float theRMin;
0085     float theRMax;
0086     const float theRMinI;
0087     const float theRMaxI;
0088   };
0089 
0090   BarrelMeasurementEstimator meas1stBLayer;
0091   BarrelMeasurementEstimator meas2ndBLayer;
0092   ForwardMeasurementEstimator meas1stFLayer;
0093   ForwardMeasurementEstimator meas2ndFLayer;
0094   std::unique_ptr<PropagatorWithMaterial> prop1stLayer = nullptr;
0095   std::unique_ptr<PropagatorWithMaterial> prop2ndLayer = nullptr;
0096   const MagneticField* theMagField;
0097   const TrackerGeometry* theTrackerGeometry;
0098   const bool useRecoVertex_;
0099 };
0100 
0101 #endif