CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/RecoEgamma/EgammaElectronAlgos/interface/GsfElectronAlgo.h

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       //edm::InputTag tracks ;
00062       edm::InputTag barrelRecHitCollection ;
00063       edm::InputTag endcapRecHitCollection ;
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       // if true, electron preselection is applied
00075       bool applyPreselection ;
00076       // if true, electron level escale corrections are
00077       // used on top of the cluster level corrections
00078       bool ecalDrivenEcalEnergyFromClassBasedParameterization ;
00079       bool ecalDrivenEcalErrorFromClassBasedParameterization ;
00080       bool pureTrackerDrivenEcalErrorFromSimpleParameterization ;
00081       // ambiguity solving
00082       bool applyAmbResolution  ; // if not true, ambiguity solving is not applied
00083       unsigned ambSortingStrategy  ; // 0:isBetter, 1:isInnerMost
00084       unsigned ambClustersOverlapStrategy  ; // 0:sc adresses, 1:bc shared energy
00085       // if true, trackerDriven electrons are added
00086       bool addPflowElectrons ;
00087       // for backward compatibility
00088       bool ctfTracksCheck ;
00089      } ;
00090 
00091     struct CutsConfiguration
00092      {
00093       // minimum SC Et
00094       double minSCEtBarrel ;
00095       double minSCEtEndcaps ;
00096       // maximum E/p where E is the supercluster corrected energy and p the track momentum at innermost state
00097       double maxEOverPBarrel ;
00098       double maxEOverPEndcaps ;
00099       // minimum E/p where E is the supercluster corrected energy and p the track momentum at innermost state
00100       double minEOverPBarrel ;
00101       double minEOverPEndcaps ;
00102 
00103       // H/E
00104       double maxHOverEBarrel ;
00105       double maxHOverEEndcaps ;
00106       double maxHBarrel ;
00107       double maxHEndcaps ;
00108 
00109       // maximum eta difference between the supercluster position and the track position at the closest impact to the supercluster
00110       double maxDeltaEtaBarrel ;
00111       double maxDeltaEtaEndcaps ;
00112 
00113       // maximum phi difference between the supercluster position and the track position at the closest impact to the supercluster
00114       // position to the supercluster
00115       double maxDeltaPhiBarrel ;
00116       double maxDeltaPhiEndcaps ;
00117 
00118       // maximum sigma ieta ieta
00119       double maxSigmaIetaIetaBarrel ;
00120       double maxSigmaIetaIetaEndcaps ;
00121       // maximum fbrem
00122 
00123       double maxFbremBarrel ;
00124       double maxFbremEndcaps ;
00125 
00126       // fiducial regions
00127       bool isBarrel ;
00128       bool isEndcaps ;
00129       bool isFiducial ;
00130 
00131       // BDT output (if available)
00132       double minMVA ;
00133       double minMvaByPassForIsolated ;
00134 
00135       // transverse impact parameter wrt beam spot
00136       double maxTIP ;
00137 
00138       // only make sense for ecal driven electrons
00139       bool seedFromTEC ;
00140      } ;
00141 
00142     // Ecal rec hits
00143     struct EcalRecHitsConfiguration
00144      {
00145       std::vector<int> recHitFlagsToBeExcludedBarrel ;
00146       std::vector<int> recHitFlagsToBeExcludedEndcaps ;
00147       std::vector<int> recHitSeverityToBeExcludedBarrel ;
00148       std::vector<int> recHitSeverityToBeExcludedEndcaps ;
00149       //int severityLevelCut ;
00150      } ;
00151 
00152     // isolation variables parameters
00153     struct IsolationConfiguration
00154      {
00155       double intRadiusBarrelTk ;
00156       double intRadiusEndcapTk ;
00157       double stripBarrelTk ;
00158       double stripEndcapTk ;
00159       double ptMinTk ;
00160       double maxVtxDistTk ;
00161       double maxDrbTk ;
00162       double intRadiusHcal ;
00163       double etMinHcal ;
00164       double intRadiusEcalBarrel ;
00165       double intRadiusEcalEndcaps ;
00166       double jurassicWidth ;
00167       double etMinBarrel ;
00168       double eMinBarrel ;
00169       double etMinEndcaps ;
00170       double eMinEndcaps ;
00171       bool vetoClustered ;
00172       bool useNumCrystals ;
00173      } ;
00174 
00175     GsfElectronAlgo
00176      (
00177       const InputTagsConfiguration &,
00178       const StrategyConfiguration &,
00179       const CutsConfiguration & cutsCfg,
00180       const CutsConfiguration & cutsCfgPflow,
00181       const ElectronHcalHelper::Configuration & hcalCfg,
00182       const ElectronHcalHelper::Configuration & hcalCfgPflow,
00183       const IsolationConfiguration &,
00184       const EcalRecHitsConfiguration &,
00185       EcalClusterFunctionBaseClass * superClusterErrorFunction,
00186       EcalClusterFunctionBaseClass * crackCorrectionFunction
00187      ) ;
00188 
00189     ~GsfElectronAlgo() ;
00190 
00191     // typedefs
00192     typedef std::list<reco::GsfElectron *> GsfElectronPtrCollection ; // for temporary collections
00193 
00194     // main methods
00195     void checkSetup( const edm::EventSetup & ) ;
00196     void beginEvent( edm::Event & ) ;
00197     void displayInternalElectrons( const std::string & title ) const ;
00198     void clonePreviousElectrons() ;
00199     void completeElectrons() ; // do not redo cloned electrons done previously
00200     void addPflowInfo() ;
00201     void setAmbiguityData( bool ignoreNotPreselected = true ) ;
00202     void removeNotPreselectedElectrons() ;
00203     void removeAmbiguousElectrons() ;
00204     void copyElectrons( reco::GsfElectronCollection & ) ;
00205     void endEvent() ;
00206 
00207 
00208   private :
00209 
00210     // internal structures
00211     struct GeneralData ;
00212     struct EventSetupData ;
00213     struct EventData ;
00214     struct ElectronData ;
00215     GeneralData * generalData_ ;
00216     EventSetupData * eventSetupData_ ;
00217     EventData * eventData_ ;
00218     ElectronData * electronData_ ;
00219 
00220     void createElectron() ;
00221 
00222     void setCutBasedPreselectionFlag( reco::GsfElectron * ele, const reco::BeamSpot & ) ;
00223     void setPflowPreselectionFlag( reco::GsfElectron * ele ) ;
00224     bool isPreselected( reco::GsfElectron * ele ) ;
00225     void calculateShowerShape( const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape & ) ;
00226 
00227     // associations
00228     const reco::SuperClusterRef getTrSuperCluster( const reco::GsfTrackRef & trackRef ) ;
00229  } ;
00230 
00231 #endif // GsfElectronAlgo_H
00232 
00233