Go to the documentation of this file.00001
00002 #ifndef GsfElectronAlgo_H
00003 #define GsfElectronAlgo_H
00004
00005 class MultiTrajectoryStateTransform ;
00006 class MultiTrajectoryStateMode ;
00007 class EcalClusterFunctionBaseClass ;
00008
00009 #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h"
00010
00011 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h"
00012 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaRecHitIsolation.h"
00013 #include "RecoEgamma/EgammaIsolationAlgos/interface/ElectronTkIsolation.h"
00014
00015 #include "MagneticField/Engine/interface/MagneticField.h"
00016 #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
00017 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00018 #include "TrackingTools/GsfTracking/interface/GsfConstraintAtVertex.h"
00019
00020 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00021 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00022 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00023
00024 #include "FWCore/Framework/interface/ESHandle.h"
00025 #include "FWCore/Framework/interface/EventSetup.h"
00026 #include "FWCore/Framework/interface/Event.h"
00027
00028 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00029 #include "DataFormats/EgammaCandidates/interface/GsfElectronCoreFwd.h"
00030 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
00031 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00032 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00033 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00034 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00035 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00036 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00037 #include "DataFormats/TrackReco/interface/HitPattern.h"
00038 #include "DataFormats/Common/interface/ValueMap.h"
00039 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00040 #include "DataFormats/Provenance/interface/ParameterSetID.h"
00041
00042 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
00043 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
00044 #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h"
00045
00046 #include <list>
00047 #include <string>
00048
00049 class GsfElectronAlgo {
00050
00051 public:
00052
00053 struct InputTagsConfiguration
00054 {
00055 edm::InputTag previousGsfElectrons ;
00056 edm::InputTag pflowGsfElectronsTag ;
00057 edm::InputTag gsfElectronCores ;
00058 edm::InputTag hcalTowersTag ;
00059 edm::InputTag barrelSuperClusters ;
00060 edm::InputTag endcapSuperClusters ;
00061
00062 edm::InputTag reducedBarrelRecHitCollection ;
00063 edm::InputTag reducedEndcapRecHitCollection ;
00064 edm::InputTag pfMVA ;
00065 edm::InputTag seedsTag ;
00066 edm::InputTag ctfTracks ;
00067 edm::InputTag beamSpotTag ;
00068 edm::InputTag gsfPfRecTracksTag ;
00069 } ;
00070
00071 struct StrategyConfiguration
00072 {
00073 bool useGsfPfRecTracks ;
00074
00075 bool applyPreselection ;
00076
00077
00078 bool applyEtaCorrection ;
00079
00080 bool applyAmbResolution ;
00081 unsigned ambSortingStrategy ;
00082 unsigned ambClustersOverlapStrategy ;
00083
00084 bool addPflowElectrons ;
00085
00086 bool ctfTracksCheck ;
00087 } ;
00088
00089 struct CutsConfiguration
00090 {
00091
00092 double minSCEtBarrel ;
00093 double minSCEtEndcaps ;
00094
00095 double maxEOverPBarrel ;
00096 double maxEOverPEndcaps ;
00097
00098 double minEOverPBarrel ;
00099 double minEOverPEndcaps ;
00100
00101
00102 double maxHOverEBarrel ;
00103 double maxHOverEEndcaps ;
00104 double maxHBarrel ;
00105 double maxHEndcaps ;
00106
00107
00108 double maxDeltaEtaBarrel ;
00109 double maxDeltaEtaEndcaps ;
00110
00111
00112
00113 double maxDeltaPhiBarrel ;
00114 double maxDeltaPhiEndcaps ;
00115
00116
00117 double maxSigmaIetaIetaBarrel ;
00118 double maxSigmaIetaIetaEndcaps ;
00119
00120
00121 double maxFbremBarrel ;
00122 double maxFbremEndcaps ;
00123
00124
00125 bool isBarrel ;
00126 bool isEndcaps ;
00127 bool isFiducial ;
00128
00129
00130 double minMVA ;
00131
00132
00133 double maxTIP ;
00134
00135
00136 bool seedFromTEC ;
00137 } ;
00138
00139
00140 struct IsolationConfiguration
00141 {
00142 double intRadiusBarrelTk ;
00143 double intRadiusEndcapTk ;
00144 double stripBarrelTk ;
00145 double stripEndcapTk ;
00146 double ptMinTk ;
00147 double maxVtxDistTk ;
00148 double maxDrbTk ;
00149 double intRadiusHcal ;
00150 double etMinHcal ;
00151 double intRadiusEcalBarrel ;
00152 double intRadiusEcalEndcaps ;
00153 double jurassicWidth ;
00154 double etMinBarrel ;
00155 double eMinBarrel ;
00156 double etMinEndcaps ;
00157 double eMinEndcaps ;
00158 bool vetoClustered ;
00159 bool useNumCrystals ;
00160 } ;
00161
00162
00163 struct SpikeConfiguration
00164 {
00165 int severityLevelCut ;
00166
00167
00168
00169 std::vector<int> recHitFlagsToBeExcluded ;
00170 } ;
00171
00172 GsfElectronAlgo
00173 (
00174 const InputTagsConfiguration &,
00175 const StrategyConfiguration &,
00176 const CutsConfiguration & cutsCfg,
00177 const CutsConfiguration & cutsCfgPflow,
00178 const ElectronHcalHelper::Configuration & hcalCfg,
00179 const ElectronHcalHelper::Configuration & hcalCfgPflow,
00180 const IsolationConfiguration &,
00181 const SpikeConfiguration &,
00182 EcalClusterFunctionBaseClass * superClusterErrorFunction
00183 ) ;
00184
00185 ~GsfElectronAlgo() ;
00186
00187
00188 typedef std::list<reco::GsfElectron *> GsfElectronPtrCollection ;
00189
00190
00191 void checkSetup( const edm::EventSetup & ) ;
00192 void beginEvent( edm::Event & ) ;
00193 void displayInternalElectrons( const std::string & title ) const ;
00194 void clonePreviousElectrons() ;
00195 void completeElectrons() ;
00196 void addPflowInfo() ;
00197 void setAmbiguityData( bool ignoreNotPreselected = true ) ;
00198 void removeNotPreselectedElectrons() ;
00199 void removeAmbiguousElectrons() ;
00200 void copyElectrons( reco::GsfElectronCollection & ) ;
00201 void endEvent() ;
00202
00203
00204 private :
00205
00206
00207 struct GeneralData ;
00208 struct EventSetupData ;
00209 struct EventData ;
00210 struct ElectronData ;
00211 GeneralData * generalData_ ;
00212 EventSetupData * eventSetupData_ ;
00213 EventData * eventData_ ;
00214 ElectronData * electronData_ ;
00215
00216 void createElectron() ;
00217
00218 void setCutBasedPreselectionFlag( reco::GsfElectron * ele, const reco::BeamSpot & ) ;
00219 void setMvaPreselectionFlag( reco::GsfElectron * ele ) ;
00220 bool isPreselected( reco::GsfElectron * ele ) ;
00221 void calculateShowerShape( const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape & ) ;
00222
00223
00224 const reco::SuperClusterRef getTrSuperCluster( const reco::GsfTrackRef & trackRef ) ;
00225
00226 } ;
00227
00228 #endif // GsfElectronAlgo_H
00229
00230