CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h

Go to the documentation of this file.
00001 #ifndef ElectronSeedGenerator_H
00002 #define ElectronSeedGenerator_H
00003 
00016 #include "RecoEgamma/EgammaElectronAlgos/interface/PixelHitMatcher.h"
00017 
00018 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00019 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00020 #include "TrackingTools/DetLayers/interface/NavigationSetter.h"
00021 
00022 #include "RecoTracker/TransientTrackingRecHit/interface/TSiPixelRecHit.h"
00023 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00024 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00025 
00026 #include "DataFormats/EgammaReco/interface//ElectronSeed.h"
00027 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
00028 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00029 //#include "DataFormats/EgammaReco/interface/SuperCluster.h"
00030 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
00031 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00032 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00033 #include "DataFormats/VertexReco/interface/Vertex.h"
00034 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00035 
00036 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00037 #include "FWCore/Framework/interface/EventSetup.h"
00038 #include "FWCore/Framework/interface/Event.h"
00039 #include "FWCore/Framework/interface/ESHandle.h"
00040 
00041 
00042 class PropagatorWithMaterial;
00043 class KFUpdator;
00044 class PixelHitMatcher;
00045 class MeasurementTracker;
00046 class NavigationSchool;
00047 
00048 class ElectronSeedGenerator
00049 {
00050  public:
00051 
00052   typedef edm::OwnVector<TrackingRecHit> PRecHitContainer;
00053   typedef TransientTrackingRecHit::ConstRecHitPointer   ConstRecHitPointer;
00054   typedef TransientTrackingRecHit::RecHitPointer        RecHitPointer;
00055   typedef TransientTrackingRecHit::RecHitContainer      RecHitContainer;
00056 
00057   ElectronSeedGenerator(const edm::ParameterSet&);
00058   ~ElectronSeedGenerator();
00059 
00060   void setupES(const edm::EventSetup& setup);
00061   void run(
00062     edm::Event&, const edm::EventSetup& setup,
00063     const reco::SuperClusterRefVector &, const std::vector<float> & hoe1s, const std::vector<float> & hoe2s,
00064     TrajectorySeedCollection *seeds, reco::ElectronSeedCollection&);
00065 
00066  private:
00067 
00068   void seedsFromThisCluster( edm::Ref<reco::SuperClusterCollection> seedCluster, float hoe1, float hoe2, reco::ElectronSeedCollection & out ) ;
00069   void seedsFromRecHits( std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > & elePixelHits, PropagationDirection & dir, const GlobalPoint & vertexPos, const reco::ElectronSeed::CaloClusterRef & cluster, reco::ElectronSeedCollection & out, bool positron ) ;
00070   void seedsFromTrajectorySeeds( const std::vector<SeedWithInfo> & elePixelSeeds, const reco::ElectronSeed::CaloClusterRef & cluster, float hoe1, float hoe2, reco::ElectronSeedCollection & out, bool positron ) ;
00071   void addSeed( reco::ElectronSeed & seed, const SeedWithInfo * info, bool positron, reco::ElectronSeedCollection & out ) ;
00072   bool prepareElTrackSeed( ConstRecHitPointer outerhit,ConstRecHitPointer innerhit, const GlobalPoint & vertexPos) ;
00073 
00074   bool dynamicphiroad_;
00075   bool fromTrackerSeeds_;
00076   //  edm::InputTag initialSeeds_;
00077   bool useRecoVertex_;
00078   edm::Handle<std::vector<reco::Vertex> > theVertices;
00079   edm::InputTag verticesTag_;
00080 
00081   edm::Handle<reco::BeamSpot> theBeamSpot;
00082   edm::InputTag beamSpotTag_;
00083 
00084   float lowPtThreshold_;
00085   float highPtThreshold_;
00086   float nSigmasDeltaZ1_; // first z window size if not using the reco vertex
00087   float deltaZ1WithVertex_; // first z window size when using the reco vertex
00088   float sizeWindowENeg_;
00089   float phiMin2B_ ;
00090   float phiMax2B_ ;
00091   float phiMin2F_ ;
00092   float phiMax2F_ ;
00093   float deltaPhi1Low_, deltaPhi1High_;
00094   float deltaPhi2B_;
00095   float deltaPhi2F_;
00096 
00097   // so that deltaPhi1 = deltaPhi1Coef1_ + deltaPhi1Coef2_/clusterEnergyT
00098   double deltaPhi1Coef1_ ;
00099   double deltaPhi1Coef2_ ;
00100 
00101   PixelHitMatcher *myMatchEle;
00102   PixelHitMatcher *myMatchPos;
00103 
00104   //  edm::Handle<TrajectorySeedCollection> theInitialSeedColl;
00105   TrajectorySeedCollection* theInitialSeedColl;
00106 
00107   edm::ESHandle<MagneticField>                theMagField;
00108   edm::ESHandle<TrackerGeometry>              theTrackerGeometry;
00109   //edm::ESHandle<GeometricSearchTracker>       theGeomSearchTracker;
00110   KFUpdator * theUpdator;
00111   PropagatorWithMaterial * thePropagator;
00112 
00113   std::string theMeasurementTrackerName;
00114   const MeasurementTracker*     theMeasurementTracker;
00115   const NavigationSchool*       theNavigationSchool;
00116 
00117   const edm::EventSetup *theSetup;
00118   
00119 
00120   PRecHitContainer recHits_;
00121   PTrajectoryStateOnDet pts_;
00122 
00123   // keep cacheIds to get records only when necessary
00124   unsigned long long cacheIDMagField_;
00125 //  unsigned long long cacheIDGeom_;
00126   unsigned long long cacheIDNavSchool_;
00127   unsigned long long cacheIDCkfComp_;
00128   unsigned long long cacheIDTrkGeom_;
00129 };
00130 
00131 #endif // ElectronSeedGenerator_H
00132 
00133