CMS 3D CMS Logo

GsfElectronAlgo.h
Go to the documentation of this file.
1 #ifndef GsfElectronAlgo_H
2 #define GsfElectronAlgo_H
3 
45 
46 #include <list>
47 #include <string>
48 
49 
51 
52  public:
53 
55  {
62  //edm::EDGetTokenT tracks ;
71 
72  //IsoVals (PF and EcalDriven)
75 
76  } ;
77 
79  {
81  // if true, electron preselection is applied
83  // if true, electron level escale corrections are
84  // used on top of the cluster level corrections
88  // ambiguity solving
89  bool applyAmbResolution ; // if not true, ambiguity solving is not applied
90  unsigned ambSortingStrategy ; // 0:isBetter, 1:isInnerMost
91  unsigned ambClustersOverlapStrategy ; // 0:sc adresses, 1:bc shared energy
92  // if true, trackerDriven electrons are added
94  // for backward compatibility
97  float PreSelectMVA;
99  // GED-Regression (ECAL and combination)
102  //heavy ion in 2015 has no conversions and so cant fill conv vtx fit prob so this bool
103  //stops it from being filled
105  } ;
106 
108  {
109  // minimum SC Et
110  double minSCEtBarrel ;
111  double minSCEtEndcaps ;
112  // maximum E/p where E is the supercluster corrected energy and p the track momentum at innermost state
115  // minimum E/p where E is the supercluster corrected energy and p the track momentum at innermost state
118 
119  // H/E
122  double maxHBarrelCone ;
128 
129  // maximum eta difference between the supercluster position and the track position at the closest impact to the supercluster
132 
133  // maximum phi difference between the supercluster position and the track position at the closest impact to the supercluster
134  // position to the supercluster
137 
138  // maximum sigma ieta ieta
141  // maximum fbrem
142 
143  double maxFbremBarrel ;
145 
146  // fiducial regions
147  bool isBarrel ;
148  bool isEndcaps ;
149  bool isFiducial ;
150 
151  // BDT output (if available)
152  double minMVA ;
154 
155  // transverse impact parameter wrt beam spot
156  double maxTIP ;
157 
158  // only make sense for ecal driven electrons
159  bool seedFromTEC ;
160  } ;
161 
162  // Ecal rec hits
164  {
165  std::vector<int> recHitFlagsToBeExcludedBarrel ;
169  //int severityLevelCut ;
170  } ;
171 
172  // isolation variables parameters
174  {
175  double intRadiusHcal ;
176  double etMinHcal ;
179  double jurassicWidth ;
180  double etMinBarrel ;
181  double eMinBarrel ;
182  double etMinEndcaps ;
183  double eMinEndcaps ;
186  } ;
187 
189  (
190  const InputTagsConfiguration &,
191  const StrategyConfiguration &,
192  const CutsConfiguration & cutsCfg,
193  const CutsConfiguration & cutsCfgPflow,
194  const ElectronHcalHelper::Configuration & hcalCfg,
195  const ElectronHcalHelper::Configuration & hcalCfgPflow,
196  const IsolationConfiguration &,
197  const EcalRecHitsConfiguration &,
198  EcalClusterFunctionBaseClass * superClusterErrorFunction,
199  EcalClusterFunctionBaseClass * crackCorrectionFunction,
200  const RegressionHelper::Configuration & regCfg,
201  const edm::ParameterSet& tkIsol03Cfg,
202  const edm::ParameterSet& tkIsol04Cfg,
203  const edm::ParameterSet& tkIsolHEEP03Cfg,
204  const edm::ParameterSet& tkIsolHEEP04Cfg
205 
206  ) ;
207 
208  // main methods
209  void completeElectrons( reco::GsfElectronCollection & electrons, // do not redo cloned electrons done previously
210  edm::Event const& event,
211  edm::EventSetup const& eventSetup,
213 
214  private :
215 
216  // internal structures
217 
218  //===================================================================
219  // GsfElectronAlgo::GeneralData
220  //===================================================================
221 
222  // general data and helpers
223  struct GeneralData
224  {
225  // configurables
232 
233  // additional configuration and helpers
239  } ;
240 
241  //===================================================================
242  // GsfElectronAlgo::EventSetupData
243  //===================================================================
244 
246  {
247  EventSetupData() ;
248 
249  unsigned long long cacheIDGeom ;
250  unsigned long long cacheIDTopo ;
251  unsigned long long cacheIDTDGeom ;
252  unsigned long long cacheIDMagField ;
253  unsigned long long cacheSevLevel ;
254 
260 
261  std::unique_ptr<const MultiTrajectoryStateTransform> mtsTransform ;
262  std::unique_ptr<GsfConstraintAtVertex> constraintAtVtx ;
263  } ;
264 
265  //===================================================================
266  // GsfElectronAlgo::EventData
267  //===================================================================
268 
269  struct EventData
270  {
271  // utilities
272  void retreiveOriginalTrackCollections
273  ( const reco::TrackRef &, const reco::GsfTrackRef & ) ;
274 
275  // general
276  edm::Event const* event ;
278 
279  // input collections
290 
291  // isolation helpers
298 
299  //Isolation Value Maps for PF and EcalDriven electrons
300  typedef std::vector< edm::Handle< edm::ValueMap<double> > > IsolationValueMaps;
301  IsolationValueMaps pfIsolationValues;
302  IsolationValueMaps edIsolationValues;
303 
306 
307  bool originalCtfTrackCollectionRetreived = false ;
308  bool originalGsfTrackCollectionRetreived = false ;
309  } ;
310 
311  //===================================================================
312  // GsfElectronAlgo::ElectronData
313  //===================================================================
314 
316  {
317  // Refs to subproducts
324 
325  // constructors
327  ( const reco::GsfElectronCoreRef & core,
328  const reco::BeamSpot & bs ) ;
329 
330  // utilities
331  void computeCharge( int & charge, reco::GsfElectron::ChargeInfo & info ) ;
332  reco::CaloClusterPtr getEleBasicCluster( MultiTrajectoryStateTransform const& ) ;
333  bool calculateTSOS( MultiTrajectoryStateTransform const&, GsfConstraintAtVertex const& ) ;
334  void calculateMode() ;
335  reco::Candidate::LorentzVector calculateMomentum() ;
336 
337  // TSOS
345 
346  // mode
347  GlobalVector innMom, seedMom, eleMom, sclMom, vtxMom, outMom ;
348  GlobalPoint innPos, seedPos, elePos, sclPos, vtxPos, outPos ;
350  } ;
351 
354 
359 
360  void checkSetup( edm::EventSetup const& eventSetup ) ;
362 
364 
367 
368  template<bool full5x5>
370  ElectronHcalHelper const& hcalHelper,
372  EventData const& eventData );
374  EventData const& eventData);
375 
376  // associations
377  const reco::SuperClusterRef getTrSuperCluster( const reco::GsfTrackRef & trackRef ) ;
378 
379  // Pixel match variables
381 
382  } ;
383 
384 #endif // GsfElectronAlgo_H
edm::Handle< reco::TrackCollection > originalCtfTracks
EgammaRecHitIsolation ecalEndcapIsol04
edm::Handle< reco::ElectronSeedCollection > seeds
const CutsConfiguration cutsCfgPflow
static const TGPicture * info(bool iBackgroundIsBlack)
void calculateSaturationInfo(const reco::SuperClusterRef &, reco::GsfElectron::SaturationInfo &, EventData const &eventData)
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
std::unique_ptr< const MultiTrajectoryStateTransform > mtsTransform
void createElectron(reco::GsfElectronCollection &electrons, ElectronData &electronData, EventData &eventData, const gsfAlgoHelpers::HeavyObjectCache *)
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
const IsolationConfiguration isoCfg
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
Definition: __init__.py:1
TrajectoryStateOnSurface sclTSOS
const EcalRecHitsConfiguration recHitsCfg
EgammaTowerIsolation hadDepth1Isolation04Bc
edm::Handle< EcalRecHitCollection > endcapRecHits
edm::Event const * event
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
const InputTagsConfiguration inputCfg
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
TrajectoryStateOnSurface innTSOS
void calculateShowerShape(const reco::SuperClusterRef &, ElectronHcalHelper const &hcalHelper, reco::GsfElectron::ShowerShape &, EventData const &eventData)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::EDGetTokenT< reco::GsfElectronCollection > pflowGsfElectronsTag
const StrategyConfiguration strategyCfg
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
edm::ESHandle< CaloTopology > caloTopo
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
edm::EDGetTokenT< reco::ConversionCollection > conversions
TrajectoryStateOnSurface constrainedVtxTSOS
void completeElectrons(reco::GsfElectronCollection &electrons, edm::Event const &event, edm::EventSetup const &eventSetup, const gsfAlgoHelpers::HeavyObjectCache *hoc)
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
EventSetupData eventSetupData_
EleTkIsolFromCands tkIsolHEEP03Calc_
EgammaTowerIsolation hadDepth1Isolation04
void checkSetup(edm::EventSetup const &eventSetup)
edm::Handle< EcalRecHitCollection > barrelRecHits
IsolationValueMaps pfIsolationValues
const CutsConfiguration cutsCfg
edm::EDGetTokenT< reco::SuperClusterCollection > barrelSuperClusters
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
const reco::BeamSpot * beamspot
edm::ESHandle< MagneticField > magField
EgammaTowerIsolation hadDepth2Isolation04Bc
std::unique_ptr< GsfConstraintAtVertex > constraintAtVtx
edm::Handle< reco::ConversionCollection > conversions
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
unsigned long long cacheIDMagField
edm::EDGetTokenT< reco::SuperClusterCollection > endcapSuperClusters
ElectronHcalHelper hcalHelperPflow
void setMVAepiBasedPreselectionFlag(reco::GsfElectron &ele)
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
edm::Handle< reco::GsfElectronCollection > previousElectrons
GsfElectronAlgo(const InputTagsConfiguration &, const StrategyConfiguration &, const CutsConfiguration &cutsCfg, const CutsConfiguration &cutsCfgPflow, const ElectronHcalHelper::Configuration &hcalCfg, const ElectronHcalHelper::Configuration &hcalCfgPflow, const IsolationConfiguration &, const EcalRecHitsConfiguration &, EcalClusterFunctionBaseClass *superClusterErrorFunction, EcalClusterFunctionBaseClass *crackCorrectionFunction, const RegressionHelper::Configuration &regCfg, const edm::ParameterSet &tkIsol03Cfg, const edm::ParameterSet &tkIsol04Cfg, const edm::ParameterSet &tkIsolHEEP03Cfg, const edm::ParameterSet &tkIsolHEEP04Cfg)
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
edm::Handle< reco::VertexCollection > vertices
edm::Handle< reco::GsfElectronCollection > pflowElectrons
EgammaRecHitIsolation ecalBarrelIsol04
void setPixelMatchInfomation(reco::GsfElectron &)
const reco::SuperClusterRef getTrSuperCluster(const reco::GsfTrackRef &trackRef)
EcalClusterFunctionBaseClass * superClusterErrorFunction
const reco::GsfTrackRef gsfTrackRef
GeneralData generalData_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
TrajectoryStateOnSurface seedTSOS
edm::Handle< reco::GsfTrackCollection > originalGsfTracks
const reco::GsfElectronCoreRef coreRef
edm::Handle< reco::TrackCollection > currentCtfTracks
EleTkIsolFromCands tkIsol04Calc_
edm::ESHandle< CaloGeometry > caloGeom
EcalClusterFunctionBaseClass * crackCorrectionFunction
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface eleTSOS
TrajectoryStateOnSurface outTSOS
ElectronHcalHelper hcalHelper
edm::ESHandle< TrackerGeometry > trackerHandle
IsolationValueMaps edIsolationValues
EleTkIsolFromCands tkIsolHEEP04Calc_
EventData beginEvent(edm::Event const &event)
EleTkIsolFromCands tkIsol03Calc_
edm::Handle< reco::GsfElectronCoreCollection > coreElectrons
EgammaTowerIsolation hadDepth2Isolation04
void setCutBasedPreselectionFlag(reco::GsfElectron &ele, const reco::BeamSpot &)
Definition: event.py:1
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot