CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef SiStripElectronSeedGenerator_H
00002 #define SiStripElectronSeedGenerator_H
00003 
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "FWCore/Utilities/interface/InputTag.h"
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "FWCore/Framework/interface/ValidityInterval.h"
00019 
00020 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00021 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
00022 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00023 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
00024 
00025 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00026 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00027 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
00028 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00029 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00030 
00031 #include "DataFormats/DetId/interface/DetId.h"
00032 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00033 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00034 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00035 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00036 
00037 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
00038 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00039 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00040 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
00041 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00042 
00043 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00044 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00045 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
00046 
00047 #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h"
00048 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00049 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00050 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h" 
00051 
00052 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00053 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00054 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorBase.h"
00055 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
00056 
00057 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00058 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00059 
00060 class PropagatorWithMaterial;
00061 class KFUpdator;
00062 class MeasurementTracker;
00063 class NavigationSchool;
00064 
00065 class SiStripElectronSeedGenerator
00066 {
00067 public:
00068 
00069   typedef edm::OwnVector<TrackingRecHit> PRecHitContainer;
00070   typedef TransientTrackingRecHit::ConstRecHitPointer  ConstRecHitPointer;
00071   typedef TransientTrackingRecHit::RecHitPointer       RecHitPointer;
00072   typedef TransientTrackingRecHit::RecHitContainer     RecHitContainer;
00073 
00074   SiStripElectronSeedGenerator(const edm::ParameterSet&);
00075 
00076   ~SiStripElectronSeedGenerator();
00077 
00078   void setupES(const edm::EventSetup& setup);
00079   void run(edm::Event&, const edm::EventSetup& setup,
00080            const edm::Handle<reco::SuperClusterCollection>&,
00081            reco::ElectronSeedCollection&);
00082 
00083 private:
00084   double normalPhi(double phi) const {
00085     while (phi > 2.* M_PI) { phi -= 2.*M_PI; }
00086     while (phi < 0) { phi += 2.*M_PI; }
00087     return phi;
00088   }
00089 
00090   double phiDiff(double phi1, double phi2){
00091     double result = normalPhi(phi1) - normalPhi(phi2);
00092     if(result > M_PI) result -= 2*M_PI;
00093     if(result < -M_PI) result += 2*M_PI;
00094     return result;
00095   }
00096 
00097   double unwrapPhi(double phi) const {
00098     while (phi > M_PI) { phi -= 2.*M_PI; }
00099     while (phi < -M_PI) { phi += 2.*M_PI; }
00100     return phi;
00101   }
00102 
00103   void findSeedsFromCluster(edm::Ref<reco::SuperClusterCollection>, edm::Handle<reco::BeamSpot>,
00104                             reco::ElectronSeedCollection&);
00105 
00106   int whichSubdetector(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit);
00107 
00108   bool preselection(GlobalPoint position,GlobalPoint superCluster,double phiVsRSlope, int hitLayer);
00109   //hitLayer: 1 = TIB, 2 = TID, 3 = TEC, 4 = Mono
00110 
00111   bool checkHitsAndTSOS(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1,
00112                         std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit2,
00113                         double scr,double scz,double pT,double scEta);
00114 
00115   bool altCheckHitsAndTSOS(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1,
00116                            std::vector<const SiStripRecHit2D*>::const_iterator hit2,
00117                            double scr,double scz,double pT,double scEta);
00118 
00119   const SiStripMatchedRecHit2D* matchedHitConverter(ConstRecHitPointer crhp);
00120   const SiStripRecHit2D* backupHitConverter(ConstRecHitPointer crhp);
00121 
00122   std::vector<bool> useDetLayer(double scEta);
00123 
00124   edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
00125   edm::ESHandle<MagneticField> theMagField;
00126   edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
00127   edm::Handle<reco::BeamSpot> theBeamSpot;
00128   edm::InputTag beamSpotTag_;
00129 
00130   KFUpdator* theUpdator;
00131   PropagatorWithMaterial* thePropagator;
00132   Chi2MeasurementEstimator* theEstimator;
00133 
00134   std::string theMeasurementTrackerName;
00135   const MeasurementTracker* theMeasurementTracker;
00136   const edm::EventSetup *theSetup;
00137   
00138   PRecHitContainer recHits_;
00139   PTrajectoryStateOnDet pts_;
00140 
00141   // member vectors to hold the good hits found between hit selection and combinatorics
00142   std::vector<const SiStripMatchedRecHit2D*> layer1Hits_;
00143   std::vector<const SiStripMatchedRecHit2D*> layer2Hits_;
00144   std::vector<const SiStripRecHit2D*> backupLayer2Hits_;
00145 
00146   const SiStripRecHitMatcher* theMatcher_;
00147 
00148   unsigned long long cacheIDMagField_;
00149   unsigned long long cacheIDCkfComp_;
00150   unsigned long long cacheIDTrkGeom_;
00151 
00152   double tibOriginZCut_;
00153   double tidOriginZCut_;
00154   double tecOriginZCut_;
00155   double monoOriginZCut_;
00156   double tibDeltaPsiCut_;
00157   double tidDeltaPsiCut_;
00158   double tecDeltaPsiCut_;
00159   double monoDeltaPsiCut_;
00160   double tibPhiMissHit2Cut_;
00161   double tidPhiMissHit2Cut_;
00162   double tecPhiMissHit2Cut_;
00163   double monoPhiMissHit2Cut_;
00164   double tibZMissHit2Cut_;
00165   double tidRMissHit2Cut_;
00166   double tecRMissHit2Cut_;
00167   double tidEtaUsage_;
00168   int tidMaxHits_;
00169   int tecMaxHits_;
00170   int monoMaxHits_;
00171   int maxSeeds_;
00172 
00173 };
00174 
00175 #endif // SiStripElectronSeedGenerator_H
00176 
00177