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
00053 void process(edm::Handle<reco::GsfTrackCollection> tracksH,
00054 const math::XYZPoint &bs,
00055 reco::GsfElectronCollection & outEle);
00056
00057
00058 bool preSelection(const reco::SuperCluster& clus);
00059
00060
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
00068 GlobalVector computeMode(const TrajectoryStateOnSurface &tsos);
00069
00070
00071 const reco::SuperClusterRef getTrSuperCluster(const reco::GsfTrackRef & trackRef);
00072
00073
00074 bool calculateTSOS(const reco::GsfTrack &t,const reco::SuperCluster & theClus, const math::XYZPoint & bs);
00075
00076
00077
00078 double maxEOverPBarrel_;
00079 double maxEOverPEndcaps_;
00080
00081 double minEOverPBarrel_;
00082 double minEOverPEndcaps_;
00083
00084 double maxDeltaEta_;
00085
00086
00087 double maxDeltaPhi_;
00088
00089
00090 bool highPtPreselection_;
00091 double highPtMin_;
00092
00093
00094 bool applyEtaCorrection_;
00095
00096
00097 bool applyAmbResolution_;
00098
00099
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
00114 int subdet_;
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