CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfElectron.h
Go to the documentation of this file.
1 #ifndef GsfElectron_h
2 #define GsfElectron_h
3 
8 //#include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
14 //#include "DataFormats/Math/interface/LorentzVector.h"
18 #include <vector>
19 #include <limits>
20 
21 namespace reco
22  {
23 
24 
25 /****************************************************************************
26  * \class reco::GsfElectron
27  *
28  * An Electron with a GsfTrack seeded from an ElectronSeed.
29  * Renamed from PixelMatchGsfElectron.
30  * Originally adapted from the TRecElectron class in ORCA.
31  *
32  * \author Claude Charlot - Laboratoire Leprince-Ringuet - École polytechnique, CNRS/IN2P3
33  * \author David Chamont - Laboratoire Leprince-Ringuet - École polytechnique, CNRS/IN2P3
34  *
35  ****************************************************************************/
36 
37 class GsfElectron : public RecoCandidate
38  {
39 
40  //=======================================================
41  // Constructors
42  //
43  // The clone() method with arguments, and the copy
44  // constructor with edm references is designed for
45  // someone which want to duplicates all
46  // collections.
47  //=======================================================
48 
49  public :
50 
51  // some nested structures defined later on
52  struct ChargeInfo ;
53  struct TrackClusterMatching ;
54  struct TrackExtrapolations ;
55  struct ClosestCtfTrack ;
56  struct FiducialFlags ;
57  struct ShowerShape ;
58  struct IsolationVariables ;
59  struct ConversionRejection ;
61 
62  GsfElectron() ;
63  GsfElectron( const GsfElectronCoreRef & ) ;
65  (
66  const GsfElectron &,
67  const GsfElectronCoreRef &
68  ) ;
70  (
71  const GsfElectron & electron,
72  const GsfElectronCoreRef & core,
74  const TrackRef & closestCtfTrack,
75  const TrackBaseRef & conversionPartner,
76  const GsfTrackRefVector & ambiguousTracks
77  ) ;
79  (
80  int charge,
81  const ChargeInfo &,
82  const GsfElectronCoreRef &,
83  const TrackClusterMatching &,
84  const TrackExtrapolations &,
85  const ClosestCtfTrack &,
86  const FiducialFlags &,
87  const ShowerShape &,
88  const ConversionRejection &
89  ) ;
91  (
92  int charge,
93  const ChargeInfo &,
94  const GsfElectronCoreRef &,
95  const TrackClusterMatching &,
96  const TrackExtrapolations &,
97  const ClosestCtfTrack &,
98  const FiducialFlags &,
99  const ShowerShape &,
100  const ShowerShape &,
101  const ConversionRejection &
102  ) ;
103  GsfElectron * clone() const ;
105  (
106  const GsfElectronCoreRef & core,
107  const CaloClusterPtr & electronCluster,
108  const TrackRef & closestCtfTrack,
109  const TrackBaseRef & conversionPartner,
110  const GsfTrackRefVector & ambiguousTracks
111  ) const ;
112  virtual ~GsfElectron() {} ;
113 
114  private:
115 
116  void init() ;
117 
118 
119  //=======================================================
120  // Candidate methods and complementary information
121  //
122  // The gsf electron producer has tried to best evaluate
123  // the four momentum and charge and given those values to
124  // the GsfElectron constructor, which forwarded them to
125  // the Candidate constructor. Those values can be retreived
126  // with getters inherited from Candidate : p4() and charge().
127  //=======================================================
128 
129  public:
130 
131  // Inherited from Candidate
132  // const LorentzVector & charge() const ;
133  // const LorentzVector & p4() const ;
134 
135  // Complementary struct
136  struct ChargeInfo
137  {
145  {}
146  } ;
147 
148  // Charge info accessors
149  // to get gsf track charge: gsfTrack()->charge()
150  // to get ctf track charge, if closestCtfTrackRef().isNonnull(): closestCtfTrackRef()->charge()
151  int scPixCharge() const { return chargeInfo_.scPixCharge ; }
155  const ChargeInfo & chargeInfo() const { return chargeInfo_ ; }
156 
157  // Candidate redefined methods
158  virtual bool isElectron() const { return true ; }
159  virtual bool overlap( const Candidate & ) const ;
160 
161  private:
162 
163  // Complementary attributes
165 
166 
167  //=======================================================
168  // Core Attributes
169  //
170  // They all have been computed before, when building the
171  // collection of GsfElectronCore instances. Each GsfElectron
172  // has a reference toward a GsfElectronCore.
173  //=======================================================
174 
175  public:
176 
177  // accessors
178  virtual GsfElectronCoreRef core() const ;
179  void setCore(const reco::GsfElectronCoreRef &core) { core_ = core; }
180 
181  // forward core methods
182  virtual SuperClusterRef superCluster() const { return core()->superCluster() ; }
183  virtual GsfTrackRef gsfTrack() const { return core()->gsfTrack() ; }
184  virtual TrackRef closestTrack() const { return core()->ctfTrack() ; }
185  float ctfGsfOverlap() const { return core()->ctfGsfOverlap() ; }
186  bool ecalDrivenSeed() const { return core()->ecalDrivenSeed() ; }
187  bool trackerDrivenSeed() const { return core()->trackerDrivenSeed() ; }
188  SuperClusterRef parentSuperCluster() const { return core()->parentSuperCluster() ; }
189 
190  // backward compatibility
192  {
193  TrackRef ctfTrack ; // best matching ctf track
194  float shFracInnerHits ; // fraction of common hits between the ctf and gsf tracks
196  ClosestCtfTrack( TrackRef track, float sh ) : ctfTrack(track), shFracInnerHits(sh) {}
197  } ;
198  float shFracInnerHits() const { return core()->ctfGsfOverlap() ; }
199  TrackRef closestCtfTrackRef() const { return core()->ctfTrack() ; }
200  ClosestCtfTrack closestCtfTrack() const { return ClosestCtfTrack(core()->ctfTrack(),core()->ctfGsfOverlap()) ; }
201 
202  private:
203 
204  // attributes
206 
207 
208  //=======================================================
209  // Track-Cluster Matching Attributes
210  //=======================================================
211 
212  public:
213 
215  {
216  CaloClusterPtr electronCluster ; // basic cluster best matching gsf track
217  float eSuperClusterOverP ; // the supercluster energy / track momentum at the PCA to the beam spot
218  float eSeedClusterOverP ; // the seed cluster energy / track momentum at the PCA to the beam spot
219  float eSeedClusterOverPout ; // the seed cluster energy / track momentum at calo extrapolated from the outermost track state
220  float eEleClusterOverPout ; // the electron cluster energy / track momentum at calo extrapolated from the outermost track state
221  float deltaEtaSuperClusterAtVtx ; // the supercluster eta - track eta position at calo extrapolated from innermost track state
222  float deltaEtaSeedClusterAtCalo ; // the seed cluster eta - track eta position at calo extrapolated from the outermost track state
223  float deltaEtaEleClusterAtCalo ; // the electron cluster eta - track eta position at calo extrapolated from the outermost state
224  float deltaPhiEleClusterAtCalo ; // the electron cluster phi - track phi position at calo extrapolated from the outermost track state
225  float deltaPhiSuperClusterAtVtx ; // the supercluster phi - track phi position at calo extrapolated from the innermost track state
226  float deltaPhiSeedClusterAtCalo ; // the seed cluster phi - track phi position at calo extrapolated from the outermost track state
228  : eSuperClusterOverP(0.),
229  eSeedClusterOverP(0.),
232  deltaEtaSuperClusterAtVtx(std::numeric_limits<float>::max()),
233  deltaEtaSeedClusterAtCalo(std::numeric_limits<float>::max()),
234  deltaEtaEleClusterAtCalo(std::numeric_limits<float>::max()),
235  deltaPhiEleClusterAtCalo(std::numeric_limits<float>::max()),
236  deltaPhiSuperClusterAtVtx(std::numeric_limits<float>::max()),
237  deltaPhiSeedClusterAtCalo(std::numeric_limits<float>::max())
238  {}
239  } ;
240 
241  // accessors
253  float deltaEtaSeedClusterTrackAtVtx() const { return superCluster().isNonnull() && superCluster()->seed().isNonnull() ?
255  }
257 
258  // for backward compatibility, usefull ?
261 
262 
263  private:
264 
265  // attributes
267 
268 
269  //=======================================================
270  // Track extrapolations
271  //=======================================================
272 
273  public :
274 
276  {
277  math::XYZPointF positionAtVtx ; // the track PCA to the beam spot
278  math::XYZPointF positionAtCalo ; // the track PCA to the supercluster position
279  math::XYZVectorF momentumAtVtx ; // the track momentum at the PCA to the beam spot
280  math::XYZVectorF momentumAtCalo ; // the track momentum extrapolated at the supercluster position from the innermost track state
281  math::XYZVectorF momentumOut ; // the track momentum extrapolated at the seed cluster position from the outermost track state
282  math::XYZVectorF momentumAtEleClus ; // the track momentum extrapolated at the ele cluster position from the outermost track state
283  math::XYZVectorF momentumAtVtxWithConstraint ; // the track momentum at the PCA to the beam spot using bs constraint
284  } ;
285 
286  // accessors
295 
296  // setter (if you know what you're doing)
298 
299  // for backward compatibility
302 
303 
304  private:
305 
306  // attributes
308 
309 
310  //=======================================================
311  // SuperCluster direct access
312  //=======================================================
313 
314  public :
315 
316  // direct accessors
317  math::XYZPoint superClusterPosition() const { return superCluster()->position() ; } // the super cluster position
318  int basicClustersSize() const { return superCluster()->clustersSize() ; } // number of basic clusters inside the supercluster
319  CaloCluster_iterator basicClustersBegin() const { return superCluster()->clustersBegin() ; }
320  CaloCluster_iterator basicClustersEnd() const { return superCluster()->clustersEnd() ; }
321 
322  // for backward compatibility
323  math::XYZPoint caloPosition() const { return superCluster()->position() ; }
324 
325 
326 
327  //=======================================================
328  // Fiducial Flags
329  //=======================================================
330 
331  public :
332 
334  {
335  bool isEB ; // true if particle is in ECAL Barrel
336  bool isEE ; // true if particle is in ECAL Endcaps
337  bool isEBEEGap ; // true if particle is in the crack between EB and EE
338  bool isEBEtaGap ; // true if particle is in EB, and inside the eta gaps between modules
339  bool isEBPhiGap ; // true if particle is in EB, and inside the phi gaps between modules
340  bool isEEDeeGap ; // true if particle is in EE, and inside the gaps between dees
341  bool isEERingGap ; // true if particle is in EE, and inside the gaps between rings
346  {}
347  } ;
348 
349  // accessors
350  bool isEB() const { return fiducialFlags_.isEB ; }
351  bool isEE() const { return fiducialFlags_.isEE ; }
352  bool isGap() const { return ((isEBEEGap())||(isEBGap())||(isEEGap())) ; }
353  bool isEBEEGap() const { return fiducialFlags_.isEBEEGap ; }
354  bool isEBGap() const { return (isEBEtaGap()||isEBPhiGap()) ; }
355  bool isEBEtaGap() const { return fiducialFlags_.isEBEtaGap ; }
356  bool isEBPhiGap() const { return fiducialFlags_.isEBPhiGap ; }
357  bool isEEGap() const { return (isEEDeeGap()||isEERingGap()) ; }
358  bool isEEDeeGap() const { return fiducialFlags_.isEEDeeGap ; }
359  bool isEERingGap() const { return fiducialFlags_.isEERingGap ; }
360  const FiducialFlags & fiducialFlags() const { return fiducialFlags_ ; }
361 
362 
363  private:
364 
365  // attributes
367 
368 
369  //=======================================================
370  // Shower Shape Variables
371  //=======================================================
372 
373  public :
374 
375  struct ShowerShape
376  {
377  float sigmaEtaEta ; // weighted cluster rms along eta and inside 5x5 (absolute eta)
378  float sigmaIetaIeta ; // weighted cluster rms along eta and inside 5x5 (Xtal eta)
379  float sigmaIphiIphi ; // weighted cluster rms along phi and inside 5x5 (Xtal phi)
380  float e1x5 ; // energy inside 1x5 in etaxphi around the seed Xtal
381  float e2x5Max ; // energy inside 2x5 in etaxphi around the seed Xtal (max bwt the 2 possible sums)
382  float e5x5 ; // energy inside 5x5 in etaxphi around the seed Xtal
383  float r9 ; // ratio of the 3x3 energy and supercluster energy
384  float hcalDepth1OverEcal ; // hcal over ecal seed cluster energy using 1st hcal depth (using hcal towers within a cone)
385  float hcalDepth2OverEcal ; // hcal over ecal seed cluster energy using 2nd hcal depth (using hcal towers within a cone)
386  std::vector<CaloTowerDetId> hcalTowersBehindClusters ; //
387  float hcalDepth1OverEcalBc ; // hcal over ecal seed cluster energy using 1st hcal depth (using hcal towers behind clusters)
388  float hcalDepth2OverEcalBc ; // hcal over ecal seed cluster energy using 2nd hcal depth (using hcal towers behind clusters)
390  : sigmaEtaEta(std::numeric_limits<float>::max()),
391  sigmaIetaIeta(std::numeric_limits<float>::max()),
392  sigmaIphiIphi(std::numeric_limits<float>::max()),
393  e1x5(0.), e2x5Max(0.), e5x5(0.),
394  r9(-std::numeric_limits<float>::max()),
397  {}
398  } ;
399 
400  // accessors
401  float sigmaEtaEta() const { return showerShape_.sigmaEtaEta ; }
402  float sigmaIetaIeta() const { return showerShape_.sigmaIetaIeta ; }
403  float sigmaIphiIphi() const { return showerShape_.sigmaIphiIphi ; }
404  float e1x5() const { return showerShape_.e1x5 ; }
405  float e2x5Max() const { return showerShape_.e2x5Max ; }
406  float e5x5() const { return showerShape_.e5x5 ; }
407  float r9() const { return showerShape_.r9 ; }
410  float hcalOverEcal() const { return hcalDepth1OverEcal() + hcalDepth2OverEcal() ; }
411  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShape_.hcalTowersBehindClusters ; }
415  const ShowerShape & showerShape() const { return showerShape_ ; }
416  // non-zero-suppressed and no-fractions shower shapes
417  // ecal energy is always that from the full 5x5
421  float full5x5_e1x5() const { return full5x5_showerShape_.e1x5 ; }
422  float full5x5_e2x5Max() const { return full5x5_showerShape_.e2x5Max ; }
423  float full5x5_e5x5() const { return full5x5_showerShape_.e5x5 ; }
424  float full5x5_r9() const { return full5x5_showerShape_.r9 ; }
432 
433  // setters (if you know what you're doing)
436 
437  // for backward compatibility (this will only ever be the ZS shapes!)
438  float scSigmaEtaEta() const { return sigmaEtaEta() ; }
439  float scSigmaIEtaIEta() const { return sigmaIetaIeta() ; }
440  float scE1x5() const { return e1x5() ; }
441  float scE2x5Max() const { return e2x5Max() ; }
442  float scE5x5() const { return e5x5() ; }
443  float hadronicOverEm() const {return hcalOverEcal();}
444  float hadronicOverEm1() const {return hcalDepth1OverEcal();}
445  float hadronicOverEm2() const {return hcalDepth2OverEcal();}
446 
447 
448  private:
449 
450  // attributes
453 
454 
455  //=======================================================
456  // Isolation Variables
457  //=======================================================
458 
459  public :
460 
462  {
463  float tkSumPt ; // track iso deposit with electron footprint removed
464  float ecalRecHitSumEt ; // ecal iso deposit with electron footprint removed
465  float hcalDepth1TowerSumEt ; // hcal depht 1 iso deposit with electron footprint removed
466  float hcalDepth2TowerSumEt ; // hcal depht 2 iso deposit with electron footprint removed
467  float hcalDepth1TowerSumEtBc ; // hcal depht 1 iso deposit without towers behind clusters
468  float hcalDepth2TowerSumEtBc ; // hcal depht 2 iso deposit without towers behind clusters
470  : tkSumPt(0.), ecalRecHitSumEt(0.),
473  {}
474  } ;
475 
476  // 03 accessors
477  float dr03TkSumPt() const { return dr03_.tkSumPt ; }
478  float dr03EcalRecHitSumEt() const { return dr03_.ecalRecHitSumEt ; }
485  const IsolationVariables & dr03IsolationVariables() const { return dr03_ ; }
486 
487  // 04 accessors
488  float dr04TkSumPt() const { return dr04_.tkSumPt ; }
489  float dr04EcalRecHitSumEt() const { return dr04_.ecalRecHitSumEt ; }
496  const IsolationVariables & dr04IsolationVariables() const { return dr04_ ; }
497 
498  // setters ?!?
499  void setDr03Isolation( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
500  void setDr04Isolation( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
501 
502  // for backward compatibility
503  void setIsolation03( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
504  void setIsolation04( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
505  const IsolationVariables & isolationVariables03() const { return dr03_ ; }
506  const IsolationVariables & isolationVariables04() const { return dr04_ ; }
507 
508  private:
509 
510  // attributes
513 
514 
515  //=======================================================
516  // Conversion Rejection Information
517  //=======================================================
518 
519  public :
520 
522  {
523  int flags ; // -max:not-computed, other: as computed by Puneeth conversion code
524  TrackBaseRef partner ; // conversion partner
525  float dist ; // distance to the conversion partner
526  float dcot ; // difference of cot(angle) with the conversion partner track
527  float radius ; // signed conversion radius
529  : flags(-1),
530  dist(std::numeric_limits<float>::max()),
531  dcot(std::numeric_limits<float>::max()),
532  radius(std::numeric_limits<float>::max())
533  {}
534  } ;
535 
536  // accessors
537  int convFlags() const { return conversionRejection_.flags ; }
539  float convDist() const { return conversionRejection_.dist ; }
540  float convDcot() const { return conversionRejection_.dcot ; }
541  float convRadius() const { return conversionRejection_.radius ; }
543 
544  private:
545 
546  // attributes
548 
549 
550  //=======================================================
551  // Pflow Information
552  //=======================================================
553 
554  public:
555 
557  {
558  //first three data members that changed names, according to DataFormats/MuonReco/interface/MuonPFIsolation.h
561  float sumPhotonEt;
562  //then four new data members, corresponding to DataFormats/MuonReco/interface/MuonPFIsolation.h
566  float sumPUPt;
567 
571  } ;
572 
573  struct MvaInput
574  {
575  int earlyBrem ; // Early Brem detected (-2=>unknown,-1=>could not be evaluated,0=>wrong,1=>true)
576  int lateBrem ; // Late Brem detected (-2=>unknown,-1=>could not be evaluated,0=>wrong,1=>true)
577  float sigmaEtaEta ; // Sigma-eta-eta with the PF cluster
578  float hadEnergy ; // Associated PF Had Cluster energy
579  float deltaEta ; // PF-cluster GSF track delta-eta
580  int nClusterOutsideMustache ; // -2 => unknown, -1 =>could not be evaluated, 0 and more => number of clusters
583  : earlyBrem(-2), lateBrem(-2),
584  sigmaEtaEta(std::numeric_limits<float>::max()),
585  hadEnergy(0.),
586  deltaEta(std::numeric_limits<float>::max()),
588  etOutsideMustache(-std::numeric_limits<float>::max())
589  {}
590  } ;
591 
592  struct MvaOutput
593  {
594  int status ; // see PFCandidateElectronExtra::StatusFlag
595  float mva_Isolated ;
596  float mva_e_pi ;
597  float mvaByPassForIsolated ; // complementary MVA used in preselection
599  : status(-1), mva_Isolated(-999999999.),mva_e_pi(-999999999.), mvaByPassForIsolated(-999999999.)
600  {}
601  } ;
602 
603  // accessors
605  const MvaInput & mvaInput() const { return mvaInput_ ; }
606  const MvaOutput & mvaOutput() const { return mvaOutput_ ; }
607 
608  // setters
610  void setMvaInput( const MvaInput & mi ) { mvaInput_ = mi ; }
611  void setMvaOutput( const MvaOutput & mo ) { mvaOutput_ = mo ; }
612 
613  // for backward compatibility
614  float mva_Isolated() const { return mvaOutput_.mva_Isolated ; }
615  float mva_e_pi() const { return mvaOutput_.mva_e_pi ; }
616 
617  private:
618 
622 
623 
624  //=======================================================
625  // Preselection and Ambiguity
626  //=======================================================
627 
628  public :
629 
630  // accessors
631  bool ecalDriven() const ; // return true if ecalDrivenSeed() and passingCutBasedPreselection()
634  bool ambiguous() const { return ambiguous_ ; }
638 
639  // setters
642  void setAmbiguous( bool flag ) { ambiguous_ = flag ; }
645 
646  // backward compatibility
648  bool passingMvaPreselection() const { return passMvaPreslection_ ; }
649 
650  private:
651 
652  // attributes
655  bool passMvaPreslection_ ; // to be removed : passPflowPreslection_
656  bool ambiguous_ ;
657  GsfTrackRefVector ambiguousGsfTracks_ ; // ambiguous gsf tracks
658 
659 
660  //=======================================================
661  // Brem Fractions and Classification
662  //=======================================================
663 
664  public :
665 
667  {
668  float trackFbrem ; // the brem fraction from gsf fit: (track momentum in - track momentum out) / track momentum in
669  float superClusterFbrem ; // the brem fraction from supercluster: (supercluster energy - electron cluster energy) / supercluster energy
671  : trackFbrem(-1.e30), superClusterFbrem(-1.e30)
672  {}
673  } ;
675 
676  // accessors
677  float trackFbrem() const { return classVariables_.trackFbrem ; }
680  Classification classification() const { return class_ ; }
681 
682  // utilities
683  int numberOfBrems() const { return basicClustersSize()-1 ; }
684  float fbrem() const { return trackFbrem() ; }
685 
686  // setters
690  void setClassification( Classification myclass ) { class_ = myclass ; }
691 
692  private:
693 
694  // attributes
696  Classification class_ ; // fbrem and number of clusters based electron classification
697 
698 
699  //=======================================================
700  // Corrections
701  //
702  // The only methods, with classification, which modify
703  // the electrons after they have been constructed.
704  // They change a given characteristic, such as the super-cluster
705  // energy, and propagate the change consistently
706  // to all the depending attributes.
707  // We expect the methods to be called in a given order
708  // and so to store specific kind of corrections
709  // 1) classify()
710  // 2) correctEcalEnergy() : depending on classification and eta
711  // 3) correctMomemtum() : depending on classification and ecal energy and tracker momentum errors
712  //
713  // Beware that correctEcalEnergy() is modifying few attributes which
714  // were potentially used for preselection, whose value used in
715  // preselection will not be available any more :
716  // hcalDepth1OverEcal, hcalDepth2OverEcal, eSuperClusterOverP,
717  // eSeedClusterOverP, eEleClusterOverPout.
718  //=======================================================
719 
720  public :
721 
723 
724  struct Corrections
725  {
726  bool isEcalEnergyCorrected ; // true if ecal energy has been corrected
727  float correctedEcalEnergy ; // corrected energy (if !isEcalEnergyCorrected this value is identical to the supercluster energy)
728  float correctedEcalEnergyError ; // error on energy
729  //bool isMomentumCorrected ; // DEPRECATED
730  float trackMomentumError ; // track momentum error from gsf fit
731  //
732  LorentzVector fromSuperClusterP4 ; // for P4_FROM_SUPER_CLUSTER
733  float fromSuperClusterP4Error ; // for P4_FROM_SUPER_CLUSTER
734  LorentzVector combinedP4 ; // for P4_COMBINATION
735  float combinedP4Error ; // for P4_COMBINATION
736  LorentzVector pflowP4 ; // for P4_PFLOW_COMBINATION
737  float pflowP4Error ; // for P4_PFLOW_COMBINATION
738  P4Kind candidateP4Kind ; // say which momentum has been stored in reco::Candidate
739  //
742  /*isMomentumCorrected(false),*/ trackMomentumError(999.),
745  {}
746  } ;
747 
748  // setters
749  void setCorrectedEcalEnergyError( float newEnergyError ) ;
750  void setCorrectedEcalEnergy( float newEnergy ) ;
752  void setP4( P4Kind kind, const LorentzVector & p4, float p4Error, bool setCandidate ) ;
753  using RecoCandidate::setP4 ;
754 
755  // accessors
760  const LorentzVector & p4( P4Kind kind ) const ;
761  using RecoCandidate::p4 ;
762  float p4Error( P4Kind kind ) const ;
764  const Corrections & corrections() const { return corrections_ ; }
765 
766  // bare setter (if you know what you're doing)
768 
769  // for backward compatibility
771  float ecalEnergy() const { return correctedEcalEnergy() ; }
772  float ecalEnergyError() const { return correctedEcalEnergyError() ; }
773  //bool isMomentumCorrected() const { return corrections_.isMomentumCorrected ; }
774  float caloEnergy() const { return correctedEcalEnergy() ; }
775  bool isEnergyScaleCorrected() const { return isEcalEnergyCorrected() ; }
776  void correctEcalEnergy( float newEnergy, float newEnergyError )
777  {
778  setCorrectedEcalEnergy(newEnergy) ;
779  setEcalEnergyError(newEnergyError) ;
780  }
782  { setTrackMomentumError(trackMomentumError) ; setP4(P4_COMBINATION,p4,p4Error,true) ; }
783 
784 
785  private:
786 
787  // attributes
789 
790  public:
793  float dPhi1 ;
795  float dPhi2 ;
797  float dRz1 ;
799  float dRz2 ;
801  unsigned char subdetectors ;
803  dPhi1(-999),
804  dPhi2(-999),
805  dRz1(-999),
806  dRz2(-999),
807  subdetectors(0)
808  {}
810  };
811  void setPixelMatchSubdetectors(int sd1, int sd2){ pixelMatchVariables_.subdetectors = 10*sd1+sd2 ; }
812  void setPixelMatchDPhi1(float dPhi1){ pixelMatchVariables_.dPhi1 = dPhi1 ; }
813  void setPixelMatchDPhi2(float dPhi2){ pixelMatchVariables_.dPhi2 = dPhi2 ; }
814  void setPixelMatchDRz1 (float dRz1 ){ pixelMatchVariables_.dRz1 = dRz1 ; }
815  void setPixelMatchDRz2 (float dRz2 ){ pixelMatchVariables_.dRz2 = dRz2 ; }
816 
819  float pixelMatchDPhi1() const { return pixelMatchVariables_.dPhi1 ; }
820  float pixelMatchDPhi2() const { return pixelMatchVariables_.dPhi2 ; }
821  float pixelMatchDRz1 () const { return pixelMatchVariables_.dRz1 ; }
822  float pixelMatchDRz2 () const { return pixelMatchVariables_.dRz2 ; }
823  private:
825  } ;
826 
827  } // namespace reco
828 
829 #endif
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:604
CaloCluster_iterator basicClustersEnd() const
Definition: GsfElectron.h:320
float sigmaIphiIphi() const
Definition: GsfElectron.h:403
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:242
bool isEEGap() const
Definition: GsfElectron.h:357
void setDr04Isolation(const IsolationVariables &dr04)
Definition: GsfElectron.h:500
const ShowerShape & showerShape() const
Definition: GsfElectron.h:415
float dPhi1
Pixel match variable: deltaPhi for innermost hit.
Definition: GsfElectron.h:793
float dr04HcalTowerSumEt() const
Definition: GsfElectron.h:492
unsigned char subdetectors
Subdetectors for first and second pixel hit.
Definition: GsfElectron.h:801
void correctEcalEnergy(float newEnergy, float newEnergyError)
Definition: GsfElectron.h:776
void setTrackFbrem(float fbrem)
Definition: GsfElectron.h:687
MvaInput mvaInput_
Definition: GsfElectron.h:620
PixelMatchVariables pixelMatchVariables_
Definition: GsfElectron.h:824
ClosestCtfTrack closestCtfTrack() const
Definition: GsfElectron.h:200
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:197
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:640
float trackMomentumError() const
Definition: GsfElectron.h:759
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
GsfTrackRefVector::const_iterator ambiguousGsfTracksBegin() const
Definition: GsfElectron.h:636
void setPixelMatchDRz2(float dRz2)
Definition: GsfElectron.h:815
SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:188
float scSigmaEtaEta() const
Definition: GsfElectron.h:438
void setCore(const reco::GsfElectronCoreRef &core)
Definition: GsfElectron.h:179
const Corrections & corrections() const
Definition: GsfElectron.h:764
bool isEBEtaGap() const
Definition: GsfElectron.h:355
float dr03HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:482
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
float dRz2
Pixel match variable: deltaRz for second hit.
Definition: GsfElectron.h:799
P4Kind candidateP4Kind() const
Definition: GsfElectron.h:763
const TrackExtrapolations & trackExtrapolations() const
Definition: GsfElectron.h:294
float full5x5_e5x5() const
Definition: GsfElectron.h:423
float full5x5_hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:428
void setPixelMatchDPhi1(float dPhi1)
Definition: GsfElectron.h:812
math::XYZVectorF trackMomentumAtVtxWithConstraint() const
Definition: GsfElectron.h:293
const IsolationVariables & isolationVariables03() const
Definition: GsfElectron.h:505
bool isEBEEGap() const
Definition: GsfElectron.h:353
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:490
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:409
float full5x5_e1x5() const
Definition: GsfElectron.h:421
float pixelMatchDRz2() const
Definition: GsfElectron.h:822
float hadronicOverEm1() const
Definition: GsfElectron.h:444
Classification class_
Definition: GsfElectron.h:696
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:781
float full5x5_hcalDepth2OverEcal() const
Definition: GsfElectron.h:426
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:289
ConversionRejection conversionRejection_
Definition: GsfElectron.h:547
void setMvaInput(const MvaInput &mi)
Definition: GsfElectron.h:610
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
Definition: GsfElectron.h:566
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:235
float full5x5_sigmaIphiIphi() const
Definition: GsfElectron.h:420
void setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:434
virtual void setP4(const LorentzVector &p4)
set 4-momentum
float dr04TkSumPt() const
Definition: GsfElectron.h:488
Corrections corrections_
Definition: GsfElectron.h:788
float pixelMatchDPhi2() const
Definition: GsfElectron.h:820
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
Definition: GsfElectron.h:564
bool isEERingGap() const
Definition: GsfElectron.h:359
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:632
bool passingMvaPreselection() const
Definition: GsfElectron.h:648
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:480
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: GsfElectron.h:563
float fbrem() const
Definition: GsfElectron.h:684
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: GsfElectron.h:411
void setAmbiguous(bool flag)
Definition: GsfElectron.h:642
GsfTrackRefVector ambiguousGsfTracks_
Definition: GsfElectron.h:657
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
float scE2x5Max() const
Definition: GsfElectron.h:441
float e2x5Max() const
Definition: GsfElectron.h:405
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
int basicClustersSize() const
Definition: GsfElectron.h:318
float convDist() const
Definition: GsfElectron.h:539
ChargeInfo chargeInfo_
Definition: GsfElectron.h:164
float convRadius() const
Definition: GsfElectron.h:541
void setPfIsolationVariables(const PflowIsolationVariables &iso)
Definition: GsfElectron.h:609
math::XYZPointF TrackPositionAtVtx() const
Definition: GsfElectron.h:300
void setDr03Isolation(const IsolationVariables &dr03)
Definition: GsfElectron.h:499
bool isEEDeeGap() const
Definition: GsfElectron.h:358
void setMvaOutput(const MvaOutput &mo)
Definition: GsfElectron.h:611
float dr04HcalTowerSumEtBc() const
Definition: GsfElectron.h:495
bool ambiguous() const
Definition: GsfElectron.h:634
const IsolationVariables & dr04IsolationVariables() const
Definition: GsfElectron.h:496
const ClassificationVariables & classificationVariables() const
Definition: GsfElectron.h:679
float superClusterFbrem() const
Definition: GsfElectron.h:678
bool isEcalEnergyCorrected() const
Definition: GsfElectron.h:756
bool isEE() const
Definition: GsfElectron.h:351
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
bool isEB() const
Definition: GsfElectron.h:350
void setPixelMatchSubdetectors(int sd1, int sd2)
Definition: GsfElectron.h:811
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
virtual reco::TrackRef track() const
reference to a Track
GsfTrackRefVector::const_iterator ambiguousGsfTracksEnd() const
Definition: GsfElectron.h:637
void setSuperClusterFbrem(float fbrem)
Definition: GsfElectron.h:688
float convDcot() const
Definition: GsfElectron.h:540
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:419
void clearAmbiguousGsfTracks()
Definition: GsfElectron.h:643
bool isGsfScPixChargeConsistent() const
Definition: GsfElectron.h:153
int pixelMatchSubdetector1() const
Definition: GsfElectron.h:817
const IsolationVariables & isolationVariables04() const
Definition: GsfElectron.h:506
PflowIsolationVariables pfIso_
Definition: GsfElectron.h:619
bool isGap() const
Definition: GsfElectron.h:352
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:491
math::XYZVectorF trackMomentumAtCalo() const
Definition: GsfElectron.h:290
bool isGsfCtfChargeConsistent() const
Definition: GsfElectron.h:154
float pixelMatchDPhi1() const
Definition: GsfElectron.h:819
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float dPhi2
Pixel match variable: deltaPhi for second hit.
Definition: GsfElectron.h:795
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:177
virtual bool isElectron() const
Definition: GsfElectron.h:158
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
float dr03HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:483
float eSeedClusterOverP() const
Definition: GsfElectron.h:244
MvaOutput mvaOutput_
Definition: GsfElectron.h:621
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:489
FiducialFlags fiducialFlags_
Definition: GsfElectron.h:366
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:251
const MvaInput & mvaInput() const
Definition: GsfElectron.h:605
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: GsfElectron.h:565
float full5x5_sigmaEtaEta() const
Definition: GsfElectron.h:418
ShowerShape showerShape_
Definition: GsfElectron.h:451
float trackFbrem() const
Definition: GsfElectron.h:677
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:291
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:561
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
int numberOfBrems() const
Definition: GsfElectron.h:683
virtual int charge() const
electric charge
Definition: LeafCandidate.h:91
float hcalOverEcal() const
Definition: GsfElectron.h:410
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:647
float dr04HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:493
float dr03TkSumPt() const
Definition: GsfElectron.h:477
math::XYZPointF trackPositionAtCalo() const
Definition: GsfElectron.h:288
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:386
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:479
math::XYZPointF TrackPositionAtCalo() const
Definition: GsfElectron.h:301
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:560
float eSeedClusterOverPout() const
Definition: GsfElectron.h:245
float full5x5_hcalOverEcalBc() const
Definition: GsfElectron.h:430
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
float hadronicOverEm2() const
Definition: GsfElectron.h:445
int pixelMatchSubdetector2() const
Definition: GsfElectron.h:818
float hcalOverEcalBc() const
Definition: GsfElectron.h:414
int scPixCharge() const
Definition: GsfElectron.h:151
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:439
float pixelMatchDRz1() const
Definition: GsfElectron.h:821
void setIsolation04(const IsolationVariables &dr04)
Definition: GsfElectron.h:504
IsolationVariables dr04_
Definition: GsfElectron.h:512
float ecalEnergyError() const
Definition: GsfElectron.h:772
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:252
void setDeltaPhiSuperClusterAtVtx(float dphi)
Definition: GsfElectron.h:260
bool isEnergyScaleCorrected() const
Definition: GsfElectron.h:775
void setEcalEnergyError(float energyError)
Definition: GsfElectron.h:770
dictionary cv
Definition: cuy.py:362
void setTrackMomentumError(float trackMomentumError)
Definition: GsfElectron.cc:193
math::XYZPoint superClusterPosition() const
Definition: GsfElectron.h:317
float full5x5_hcalDepth1OverEcal() const
Definition: GsfElectron.h:425
float deltaEtaSeedClusterTrackAtVtx() const
Definition: GsfElectron.h:253
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:408
float shFracInnerHits() const
Definition: GsfElectron.h:198
float correctedEcalEnergy() const
Definition: GsfElectron.h:757
void setPixelMatchDPhi2(float dPhi2)
Definition: GsfElectron.h:813
ClassificationVariables classVariables_
Definition: GsfElectron.h:695
bool isEBGap() const
Definition: GsfElectron.h:354
GsfElectronCoreRef core_
Definition: GsfElectron.h:205
ShowerShape full5x5_showerShape_
Definition: GsfElectron.h:452
virtual ~GsfElectron()
Definition: GsfElectron.h:112
TrackBaseRef convPartner() const
Definition: GsfElectron.h:538
const ChargeInfo & chargeInfo() const
Definition: GsfElectron.h:155
float full5x5_e2x5Max() const
Definition: GsfElectron.h:422
CaloCluster_iterator basicClustersBegin() const
Definition: GsfElectron.h:319
void clear()
Clear the vector.
Definition: RefVector.h:133
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:249
void setClassification(Classification myclass)
Definition: GsfElectron.h:690
float e1x5() const
Definition: GsfElectron.h:404
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Classification classification() const
Definition: GsfElectron.h:680
float hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:413
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:606
float full5x5_hcalOverEcal() const
Definition: GsfElectron.h:427
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition: GsfElectron.cc:150
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:323
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:635
float dr04HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:494
float full5x5_hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:429
float ecalEnergy() const
Definition: GsfElectron.h:771
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
float mva_Isolated() const
Definition: GsfElectron.h:614
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:478
math::XYZVectorF trackMomentumAtEleClus() const
Definition: GsfElectron.h:292
float mva_e_pi() const
Definition: GsfElectron.h:615
float e5x5() const
Definition: GsfElectron.h:406
float dr03HcalTowerSumEtBc() const
Definition: GsfElectron.h:484
float full5x5_r9() const
Definition: GsfElectron.h:424
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:283
float correctedEcalEnergyError() const
Definition: GsfElectron.h:758
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
Definition: analysisEnums.h:9
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:180
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:503
float r9() const
Definition: GsfElectron.h:407
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
const ShowerShape & full5x5_showerShape() const
Definition: GsfElectron.h:431
void setTrackExtrapolations(const TrackExtrapolations &te)
Definition: GsfElectron.h:297
const IsolationVariables & dr03IsolationVariables() const
Definition: GsfElectron.h:485
int convFlags() const
Definition: GsfElectron.h:537
math::XYZPointF trackPositionAtVtx() const
Definition: GsfElectron.h:287
bool isEBPhiGap() const
Definition: GsfElectron.h:356
bool isGsfCtfScPixChargeConsistent() const
Definition: GsfElectron.h:152
ClosestCtfTrack(TrackRef track, float sh)
Definition: GsfElectron.h:196
const TrackClusterMatching & trackClusterMatching() const
Definition: GsfElectron.h:256
bool trackerDrivenSeed() const
Definition: GsfElectron.h:187
void setPassPflowPreselection(bool flag)
Definition: GsfElectron.h:641
GsfElectron * clone() const
returns a clone of the Candidate object
Definition: GsfElectron.cc:159
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:481
const ConversionRejection & conversionRejectionVariables() const
Definition: GsfElectron.h:542
void setDeltaEtaSuperClusterAtVtx(float de)
Definition: GsfElectron.h:259
float dRz1
Pixel match variable: deltaRz for innermost hit.
Definition: GsfElectron.h:797
void setCorrections(const Corrections &c)
Definition: GsfElectron.h:767
void setClassificationVariables(const ClassificationVariables &cv)
Definition: GsfElectron.h:689
float scE5x5() const
Definition: GsfElectron.h:442
volatile std::atomic< bool > shutdown_flag false
TrackClusterMatching trackClusterMatching_
Definition: GsfElectron.h:266
bool passCutBasedPreselection_
Definition: GsfElectron.h:653
float hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:412
IsolationVariables dr03_
Definition: GsfElectron.h:511
void addAmbiguousGsfTrack(const reco::GsfTrackRef &t)
Definition: GsfElectron.h:644
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:559
void full5x5_setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:435
TrackExtrapolations trackExtrapolations_
Definition: GsfElectron.h:307
float caloEnergy() const
Definition: GsfElectron.h:774
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
bool ecalDriven() const
Definition: GsfElectron.cc:172
bool passPflowPreselection_
Definition: GsfElectron.h:654
float ctfGsfOverlap() const
Definition: GsfElectron.h:185
const FiducialFlags & fiducialFlags() const
Definition: GsfElectron.h:360
void setPixelMatchDRz1(float dRz1)
Definition: GsfElectron.h:814
float sigmaEtaEta() const
Definition: GsfElectron.h:401
float scE1x5() const
Definition: GsfElectron.h:440
virtual TrackRef closestTrack() const
Definition: GsfElectron.h:184
float energyError(float E, float *par)
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
bool ecalDrivenSeed() const
Definition: GsfElectron.h:186
bool passingPflowPreselection() const
Definition: GsfElectron.h:633