00001 #ifndef PIXELHITMATCHER_H
00002 #define PIXELHITMATCHER_H
00003
00004
00005
00006
00007
00008
00017
00018
00019
00020
00021
00022
00023
00024 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00025 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
00026
00027 #include "RecoEgamma/EgammaElectronAlgos/interface/BarrelMeasurementEstimator.h"
00028 #include "RecoEgamma/EgammaElectronAlgos/interface/ForwardMeasurementEstimator.h"
00029 #include "RecoEgamma/EgammaElectronAlgos/interface/PixelMatchStartLayers.h"
00030 #include "RecoEgamma/EgammaElectronAlgos/interface/FTSFromVertexToPointFactory.h"
00031
00032 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00033 #include "DataFormats/EgammaReco/interface/ElectronPixelSeed.h"
00034
00035 #include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h"
00036 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00037
00038 #include "CLHEP/Vector/ThreeVector.h"
00039 #include <vector>
00040
00045 class MeasurementTracker;
00046 class MagneticField;
00047 class GeometricSearchTracker;
00048 class LayerMeasurements;
00049 class TrackerGeometry;
00050
00051 class RecHitWithDist
00052 {
00053 public:
00054
00055 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00056 typedef TransientTrackingRecHit::RecHitPointer RecHitPointer;
00057 typedef TransientTrackingRecHit::RecHitContainer RecHitContainer;
00058
00059 RecHitWithDist(ConstRecHitPointer rh, float &dphi) : rh_(rh), dphi_(dphi)
00060 {}
00061 ConstRecHitPointer recHit() const {return rh_;}
00062 float dPhi() const {return dphi_;}
00063 void invert() {dphi_*=-1.;}
00064
00065 private:
00066
00067 ConstRecHitPointer rh_;
00068 float dphi_;
00069 };
00070
00071 class PixelHitMatcher{
00072 public:
00073
00074 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00075 typedef TransientTrackingRecHit::RecHitPointer RecHitPointer;
00076 typedef TransientTrackingRecHit::RecHitContainer RecHitContainer;
00077
00078 PixelHitMatcher(float phi1min, float phi1max, float phi2min, float phi2max,
00079 float z2minB, float z2maxB, float r2minF, float r2maxF,
00080 float rMinI, float rMaxI, bool searchInTIDTEC);
00081
00082 virtual ~PixelHitMatcher();
00083 void setES(const MagneticField*, const MeasurementTracker *theMeasurementTracker, const TrackerGeometry *trackerGeometry);
00084
00085 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> >
00086 compatibleHits(const GlobalPoint& xmeas, const GlobalPoint& vprim, float energy, float charge);
00087 std::vector<TrajectorySeed>
00088
00089 compatibleSeeds(TrajectorySeedCollection *seeds, const GlobalPoint& xmeas,
00090 const GlobalPoint& vprim, float energy, float charge);
00091
00092 std::vector<Hep3Vector> predicted1Hits();
00093 std::vector<Hep3Vector> predicted2Hits();
00094
00095 void set1stLayer (float dummyphi1min, float dummyphi1max);
00096 void set1stLayerZRange (float zmin1, float zmax1);
00097 void set2ndLayer (float dummyphi2min, float dummyphi2max);
00098
00099 float getVertex();
00100
00101 private:
00102
00103 RecHitContainer hitsInTrack;
00104
00105 std::vector<Hep3Vector> pred1Meas;
00106 std::vector<Hep3Vector> pred2Meas;
00107 FTSFromVertexToPointFactory myFTS;
00108 BarrelMeasurementEstimator meas1stBLayer;
00109 BarrelMeasurementEstimator meas2ndBLayer;
00110 ForwardMeasurementEstimator meas1stFLayer;
00111 ForwardMeasurementEstimator meas2ndFLayer;
00112 PixelMatchStartLayers startLayers;
00113 PropagatorWithMaterial *prop1stLayer;
00114 PropagatorWithMaterial *prop2ndLayer;
00115 const GeometricSearchTracker *theGeometricSearchTracker;
00116 const LayerMeasurements *theLayerMeasurements;
00117 const MagneticField* theMagField;
00118 const TrackerGeometry * theTrackerGeometry;
00119
00120 float vertex_;
00121
00122 bool searchInTIDTEC_;
00123 std::vector<std::pair<const GeomDet*, TrajectoryStateOnSurface> > mapTsos_;
00124 std::vector<std::pair<std::pair<const GeomDet*,GlobalPoint>, TrajectoryStateOnSurface> > mapTsos2_;
00125 };
00126 #endif
00127
00128
00129
00130
00131
00132
00133
00134