CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/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 
00051 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00052 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00053 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorBase.h"
00054 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
00055 
00056 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00057 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00058 
00059 class PropagatorWithMaterial;
00060 class KFUpdator;
00061 class MeasurementTracker;
00062 class NavigationSchool;
00063 
00064 class SiStripElectronSeedGenerator
00065 {
00066 public:
00067 
00068   typedef edm::OwnVector<TrackingRecHit> PRecHitContainer;
00069   typedef TransientTrackingRecHit::ConstRecHitPointer  ConstRecHitPointer;
00070   typedef TransientTrackingRecHit::RecHitPointer       RecHitPointer;
00071   typedef TransientTrackingRecHit::RecHitContainer     RecHitContainer;
00072 
00073   SiStripElectronSeedGenerator(const edm::ParameterSet&);
00074 
00075   ~SiStripElectronSeedGenerator();
00076 
00077   void setupES(const edm::EventSetup& setup);
00078   void run(edm::Event&, const edm::EventSetup& setup,
00079            const edm::Handle<reco::SuperClusterCollection>&,
00080            reco::ElectronSeedCollection&);
00081 
00082 private:
00083   double normalPhi(double phi) const {
00084     while (phi > 2.* M_PI) { phi -= 2.*M_PI; }
00085     while (phi < 0) { phi += 2.*M_PI; }
00086     return phi;
00087   }
00088 
00089   double phiDiff(double phi1, double phi2){
00090     double result = normalPhi(phi1) - normalPhi(phi2);
00091     if(result > M_PI) result -= 2*M_PI;
00092     if(result < -M_PI) result += 2*M_PI;
00093     return result;
00094   }
00095 
00096   double unwrapPhi(double phi) const {
00097     while (phi > M_PI) { phi -= 2.*M_PI; }
00098     while (phi < -M_PI) { phi += 2.*M_PI; }
00099     return phi;
00100   }
00101 
00102   void findSeedsFromCluster(edm::Ref<reco::SuperClusterCollection>, edm::Handle<reco::BeamSpot>,
00103                             reco::ElectronSeedCollection&);
00104 
00105   int whichSubdetector(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit);
00106 
00107   bool preselection(GlobalPoint position,GlobalPoint superCluster,double phiVsRSlope, int hitLayer);
00108   //hitLayer: 1 = TIB, 2 = TID, 3 = TEC, 4 = Mono
00109 
00110   bool checkHitsAndTSOS(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1,
00111                         std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit2,
00112                         double scr,double scz,double pT,double scEta);
00113 
00114   bool altCheckHitsAndTSOS(std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1,
00115                            std::vector<const SiStripRecHit2D*>::const_iterator hit2,
00116                            double scr,double scz,double pT,double scEta);
00117 
00118   const SiStripMatchedRecHit2D* matchedHitConverter(ConstRecHitPointer crhp);
00119   const SiStripRecHit2D* backupHitConverter(ConstRecHitPointer crhp);
00120 
00121   std::vector<bool> useDetLayer(double scEta);
00122 
00123   edm::ESHandle<MeasurementTracker> measurementTrackerHandle;
00124   edm::ESHandle<MagneticField> theMagField;
00125   edm::ESHandle<TrackerGeometry> trackerGeometryHandle;
00126   edm::Handle<reco::BeamSpot> theBeamSpot;
00127   edm::InputTag beamSpotTag_;
00128 
00129   KFUpdator* theUpdator;
00130   PropagatorWithMaterial* thePropagator;
00131   Chi2MeasurementEstimator* theEstimator;
00132 
00133   std::string theMeasurementTrackerName;
00134   const MeasurementTracker* theMeasurementTracker;
00135   const edm::EventSetup *theSetup;
00136   
00137   PRecHitContainer recHits_;
00138   PTrajectoryStateOnDet pts_;
00139 
00140   // member vectors to hold the good hits found between hit selection and combinatorics
00141   std::vector<const SiStripMatchedRecHit2D*> layer1Hits_;
00142   std::vector<const SiStripMatchedRecHit2D*> layer2Hits_;
00143   std::vector<const SiStripRecHit2D*> backupLayer2Hits_;
00144 
00145   const SiStripRecHitMatcher* theMatcher_;
00146 
00147   unsigned long long cacheIDMagField_;
00148   unsigned long long cacheIDCkfComp_;
00149   unsigned long long cacheIDTrkGeom_;
00150 
00151   double tibOriginZCut_;
00152   double tidOriginZCut_;
00153   double tecOriginZCut_;
00154   double monoOriginZCut_;
00155   double tibDeltaPsiCut_;
00156   double tidDeltaPsiCut_;
00157   double tecDeltaPsiCut_;
00158   double monoDeltaPsiCut_;
00159   double tibPhiMissHit2Cut_;
00160   double tidPhiMissHit2Cut_;
00161   double tecPhiMissHit2Cut_;
00162   double monoPhiMissHit2Cut_;
00163   double tibZMissHit2Cut_;
00164   double tidRMissHit2Cut_;
00165   double tecRMissHit2Cut_;
00166   double tidEtaUsage_;
00167   int tidMaxHits_;
00168   int tecMaxHits_;
00169   int monoMaxHits_;
00170   int maxSeeds_;
00171 
00172 };
00173 
00174 #endif // SiStripElectronSeedGenerator_H
00175 
00176