CMS 3D CMS Logo

GsfElectronAlgo.h

Go to the documentation of this file.
00001 #ifndef GsfElectronAlgo_H
00002 #define GsfElectronAlgo_H
00003 
00015 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00016 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00017 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00018 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00019 
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "FWCore/Framework/interface/Event.h"
00023 
00024 #include "MagneticField/Engine/interface/MagneticField.h"
00025 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
00026 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00027 #include "RecoCaloTools/MetaCollections/interface/CaloRecHitMetaCollections.h"
00028 
00029 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00030 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00031 
00032 class MultiTrajectoryStateTransform;
00033 class GsfPropagatorAdapter;
00034  
00035 class GsfElectronAlgo {
00036 
00037 public:
00038 
00039   GsfElectronAlgo(const edm::ParameterSet& conf,
00040                          double maxEOverPBarrel, double maxEOverPEndcaps, 
00041                          double minEOverPBarrel, double minEOverPEndcaps,
00042                          double maxDeltaEta, double maxDeltaPhi, 
00043                          bool highPtPresel, double highPtMin,
00044                          bool applyEtaCorrection, bool applyAmbResolution);
00045   ~GsfElectronAlgo();
00046 
00047   void setupES(const edm::EventSetup& setup);
00048   void run(edm::Event&, reco::GsfElectronCollection&);
00049 
00050  private:
00051 
00052   // create electrons from superclusters, tracks and Hcal rechits
00053   void process(edm::Handle<reco::GsfTrackCollection> tracksH,
00054                const math::XYZPoint &bs,
00055                reco::GsfElectronCollection & outEle);
00056   
00057   // preselection method
00058   bool preSelection(const reco::SuperCluster& clus);
00059 
00060   // interface to be improved...
00061   void createElectron(const reco::SuperClusterRef & scRef,
00062                       const reco::GsfTrackRef &trackRef,
00063                       reco::GsfElectronCollection & outEle);  
00064 
00065   void resolveElectrons(std::vector<reco::GsfElectron> &, reco::GsfElectronCollection & outEle);
00066   
00067   //Gsf mode calculations
00068   GlobalVector computeMode(const TrajectoryStateOnSurface &tsos);
00069 
00070   // associations
00071   const reco::SuperClusterRef getTrSuperCluster(const reco::GsfTrackRef & trackRef);
00072 
00073   // intermediate calculations
00074   bool calculateTSOS(const reco::GsfTrack &t,const reco::SuperCluster & theClus, const math::XYZPoint & bs);
00075 
00076   // preselection parameters
00077   // maximum E/p where E is the supercluster corrected energy and p the track momentum at innermost state  
00078   double maxEOverPBarrel_;   
00079   double maxEOverPEndcaps_;   
00080   // minimum E/p where E is the supercluster corrected energy and p the track momentum at innermost state  
00081   double minEOverPBarrel_;   
00082   double minEOverPEndcaps_;     
00083   // maximum eta difference between the supercluster position and the track position at the closest impact to the supercluster 
00084   double maxDeltaEta_;
00085   // maximum phi difference between the supercluster position and the track position at the closest impact to the supercluster
00086   // position to the supercluster
00087   double maxDeltaPhi_;
00088 
00089   // high pt preselection parameters
00090   bool highPtPreselection_;
00091   double highPtMin_;
00092   
00093   // if this parameter is false, only SC level Escale correctoins are applied
00094   bool applyEtaCorrection_;
00095   
00096   // if this parameter is true, "double" electrons are resolved
00097   bool applyAmbResolution_;
00098 
00099   // input configuration
00100   edm::InputTag barrelSuperClusters_;
00101   edm::InputTag endcapSuperClusters_;
00102   edm::InputTag tracks_;
00103   edm::InputTag hcalRecHits_;
00104 
00105   edm::ESHandle<MagneticField>                theMagField;
00106   edm::ESHandle<CaloGeometry>                 theCaloGeom;
00107   edm::ESHandle<TrackerGeometry>              trackerHandle_;
00108 
00109   const MultiTrajectoryStateTransform *mtsTransform_;
00110   const GsfPropagatorAdapter *geomPropBw_;
00111   const GsfPropagatorAdapter *geomPropFw_;
00112 
00113   // internal variables 
00114   int subdet_; //subdetector for this cluster
00115   GlobalPoint sclPos_;
00116   GlobalVector vtxMom_;
00117   TrajectoryStateOnSurface innTSOS_;
00118   TrajectoryStateOnSurface outTSOS_;
00119   TrajectoryStateOnSurface vtxTSOS_;
00120   TrajectoryStateOnSurface sclTSOS_;
00121   TrajectoryStateOnSurface seedTSOS_;
00122 
00123   HBHERecHitMetaCollection *mhbhe_;
00124 
00125   unsigned long long cacheIDGeom_;
00126   unsigned long long cacheIDTDGeom_;
00127   unsigned long long cacheIDMagField_;
00128 };
00129 
00130 #endif // GsfElectronAlgo_H
00131 
00132 

Generated on Tue Jun 9 17:43:17 2009 for CMSSW by  doxygen 1.5.4