CMS 3D CMS Logo

GlobalGsfElectronAlgo.h

Go to the documentation of this file.
00001 #ifndef GlobalGsfElectronAlgo_H
00002 #define GlobalGsfElectronAlgo_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 GlobalGsfElectronAlgo {
00036 
00037 public:
00038 
00039   GlobalGsfElectronAlgo(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   ~GlobalGsfElectronAlgo();
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                edm::Handle<reco::SuperClusterCollection> superClustersBarrelH,
00055                edm::Handle<reco::SuperClusterCollection> superClustersEndcapH,
00056                const math::XYZPoint &bs,
00057                reco::GsfElectronCollection & outEle);
00058   
00059   
00060   // preselection method
00061   bool preSelection(const reco::SuperCluster& clus);
00062 
00063   // interface to be improved...
00064   void createElectron(const reco::SuperClusterRef & scRef,
00065                       const reco::GsfTrackRef &trackRef,
00066                       reco::GsfElectronCollection & outEle);  
00067 
00068   void resolveElectrons(std::vector<reco::GsfElectron> &, reco::GsfElectronCollection & outEle);
00069   
00070   //Gsf mode calculations
00071   GlobalVector computeMode(const TrajectoryStateOnSurface &tsos);
00072 
00073   const reco::GsfTrackRef
00074     superClusterMatching(reco::SuperClusterRef sc, edm::Handle<reco::GsfTrackCollection> tracks);
00075 
00076   // intermediate calculations
00077   bool calculateTSOS(const reco::GsfTrack &t,const reco::SuperCluster & theClus, const math::XYZPoint & bs);
00078 
00079   // preselection parameters
00080   // maximum E/p where E is the supercluster corrected energy and p the track momentum at innermost state  
00081   double maxEOverPBarrel_;   
00082   double maxEOverPEndcaps_;   
00083   // minimum E/p where E is the supercluster corrected energy and p the track momentum at innermost state  
00084   double minEOverPBarrel_;   
00085   double minEOverPEndcaps_;     
00086   // maximum eta difference between the supercluster position and the track position at the closest impact to the supercluster 
00087   double maxDeltaEta_;
00088   // maximum phi difference between the supercluster position and the track position at the closest impact to the supercluster
00089   // position to the supercluster
00090   double maxDeltaPhi_;
00091 
00092   // high pt preselection parameters
00093   bool highPtPreselection_;
00094   double highPtMin_;
00095   
00096   // if this parameter is false, only SC level Escale correctoins are applied
00097   bool applyEtaCorrection_;
00098   
00099   // if this parameter is true, "double" electrons are resolved
00100   bool applyAmbResolution_;
00101 
00102   // input configuration
00103   edm::InputTag barrelSuperClusters_;
00104   edm::InputTag endcapSuperClusters_;
00105   edm::InputTag tracks_;
00106   edm::InputTag hcalRecHits_;
00107 
00108   edm::ESHandle<MagneticField>                theMagField;
00109   edm::ESHandle<CaloGeometry>                 theCaloGeom;
00110   edm::ESHandle<TrackerGeometry>              trackerHandle_;
00111 
00112   const MultiTrajectoryStateTransform *mtsTransform_;
00113   const GsfPropagatorAdapter *geomPropBw_;
00114   const GsfPropagatorAdapter *geomPropFw_;
00115 
00116   // internal variables 
00117   int subdet_; //subdetector for this cluster
00118   GlobalPoint sclPos_;
00119   GlobalVector vtxMom_;
00120   TrajectoryStateOnSurface innTSOS_;
00121   TrajectoryStateOnSurface outTSOS_;
00122   TrajectoryStateOnSurface vtxTSOS_;
00123   TrajectoryStateOnSurface sclTSOS_;
00124   TrajectoryStateOnSurface seedTSOS_;
00125 
00126   HBHERecHitMetaCollection *mhbhe_;
00127 
00128   unsigned long long cacheIDGeom_;
00129   unsigned long long cacheIDTDGeom_;
00130   unsigned long long cacheIDMagField_;
00131 };
00132 
00133 #endif // GlobalGsfElectronAlgo_H
00134 
00135 

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