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  float eMax;
391  float e2nd;
392  float eTop;
393  float eLeft;
394  float eRight;
395  float eBottom;
397  : sigmaEtaEta(std::numeric_limits<float>::max()),
398  sigmaIetaIeta(std::numeric_limits<float>::max()),
399  sigmaIphiIphi(std::numeric_limits<float>::max()),
400  e1x5(0.), e2x5Max(0.), e5x5(0.),
401  r9(-std::numeric_limits<float>::max()),
404  sigmaIetaIphi(0.f),
405  eMax(0.f),
406  e2nd(0.f),
407  eTop(0.f),
408  eLeft(0.f),
409  eRight(0.f),
410  eBottom(0.f)
411  {}
412  } ;
413 
414  // accessors
415  float sigmaEtaEta() const { return showerShape_.sigmaEtaEta ; }
416  float sigmaIetaIeta() const { return showerShape_.sigmaIetaIeta ; }
417  float sigmaIphiIphi() const { return showerShape_.sigmaIphiIphi ; }
418  float e1x5() const { return showerShape_.e1x5 ; }
419  float e2x5Max() const { return showerShape_.e2x5Max ; }
420  float e5x5() const { return showerShape_.e5x5 ; }
421  float r9() const { return showerShape_.r9 ; }
424  float hcalOverEcal() const { return hcalDepth1OverEcal() + hcalDepth2OverEcal() ; }
425  const std::vector<CaloTowerDetId> & hcalTowersBehindClusters() const { return showerShape_.hcalTowersBehindClusters ; }
429  const ShowerShape & showerShape() const { return showerShape_ ; }
430  // non-zero-suppressed and no-fractions shower shapes
431  // ecal energy is always that from the full 5x5
435  float full5x5_e1x5() const { return full5x5_showerShape_.e1x5 ; }
436  float full5x5_e2x5Max() const { return full5x5_showerShape_.e2x5Max ; }
437  float full5x5_e5x5() const { return full5x5_showerShape_.e5x5 ; }
438  float full5x5_r9() const { return full5x5_showerShape_.r9 ; }
446 
447  // setters (if you know what you're doing)
450 
451  // for backward compatibility (this will only ever be the ZS shapes!)
452  float scSigmaEtaEta() const { return sigmaEtaEta() ; }
453  float scSigmaIEtaIEta() const { return sigmaIetaIeta() ; }
454  float scE1x5() const { return e1x5() ; }
455  float scE2x5Max() const { return e2x5Max() ; }
456  float scE5x5() const { return e5x5() ; }
457  float hadronicOverEm() const {return hcalOverEcal();}
458  float hadronicOverEm1() const {return hcalDepth1OverEcal();}
459  float hadronicOverEm2() const {return hcalDepth2OverEcal();}
460 
461 
462  private:
463 
464  // attributes
467 
468 
469  //=======================================================
470  // Isolation Variables
471  //=======================================================
472 
473  public :
474 
476  {
477  float tkSumPt ; // track iso deposit with electron footprint removed
478  float ecalRecHitSumEt ; // ecal iso deposit with electron footprint removed
479  float hcalDepth1TowerSumEt ; // hcal depht 1 iso deposit with electron footprint removed
480  float hcalDepth2TowerSumEt ; // hcal depht 2 iso deposit with electron footprint removed
481  float hcalDepth1TowerSumEtBc ; // hcal depht 1 iso deposit without towers behind clusters
482  float hcalDepth2TowerSumEtBc ; // hcal depht 2 iso deposit without towers behind clusters
484  : tkSumPt(0.), ecalRecHitSumEt(0.),
487  {}
488  } ;
489 
490  // 03 accessors
491  float dr03TkSumPt() const { return dr03_.tkSumPt ; }
492  float dr03EcalRecHitSumEt() const { return dr03_.ecalRecHitSumEt ; }
499  const IsolationVariables & dr03IsolationVariables() const { return dr03_ ; }
500 
501  // 04 accessors
502  float dr04TkSumPt() const { return dr04_.tkSumPt ; }
503  float dr04EcalRecHitSumEt() const { return dr04_.ecalRecHitSumEt ; }
510  const IsolationVariables & dr04IsolationVariables() const { return dr04_ ; }
511 
512  // setters ?!?
513  void setDr03Isolation( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
514  void setDr04Isolation( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
515 
516  // for backward compatibility
517  void setIsolation03( const IsolationVariables & dr03 ) { dr03_ = dr03 ; }
518  void setIsolation04( const IsolationVariables & dr04 ) { dr04_ = dr04 ; }
519  const IsolationVariables & isolationVariables03() const { return dr03_ ; }
520  const IsolationVariables & isolationVariables04() const { return dr04_ ; }
521 
522  private:
523 
524  // attributes
527 
528 
529  //=======================================================
530  // Conversion Rejection Information
531  //=======================================================
532 
533  public :
534 
536  {
537  int flags ; // -max:not-computed, other: as computed by Puneeth conversion code
538  TrackBaseRef partner ; // conversion partner
539  float dist ; // distance to the conversion partner
540  float dcot ; // difference of cot(angle) with the conversion partner track
541  float radius ; // signed conversion radius
543  : flags(-1),
544  dist(std::numeric_limits<float>::max()),
545  dcot(std::numeric_limits<float>::max()),
546  radius(std::numeric_limits<float>::max())
547  {}
548  } ;
549 
550  // accessors
551  int convFlags() const { return conversionRejection_.flags ; }
553  float convDist() const { return conversionRejection_.dist ; }
554  float convDcot() const { return conversionRejection_.dcot ; }
555  float convRadius() const { return conversionRejection_.radius ; }
557 
558  private:
559 
560  // attributes
562 
563 
564  //=======================================================
565  // Pflow Information
566  //=======================================================
567 
568  public:
569 
571  {
572  //first three data members that changed names, according to DataFormats/MuonReco/interface/MuonPFIsolation.h
575  float sumPhotonEt;
576  //then four new data members, corresponding to DataFormats/MuonReco/interface/MuonPFIsolation.h
580  float sumPUPt;
581 
585  } ;
586 
587  struct MvaInput
588  {
589  int earlyBrem ; // Early Brem detected (-2=>unknown,-1=>could not be evaluated,0=>wrong,1=>true)
590  int lateBrem ; // Late Brem detected (-2=>unknown,-1=>could not be evaluated,0=>wrong,1=>true)
591  float sigmaEtaEta ; // Sigma-eta-eta with the PF cluster
592  float hadEnergy ; // Associated PF Had Cluster energy
593  float deltaEta ; // PF-cluster GSF track delta-eta
594  int nClusterOutsideMustache ; // -2 => unknown, -1 =>could not be evaluated, 0 and more => number of clusters
597  : earlyBrem(-2), lateBrem(-2),
598  sigmaEtaEta(std::numeric_limits<float>::max()),
599  hadEnergy(0.),
600  deltaEta(std::numeric_limits<float>::max()),
602  etOutsideMustache(-std::numeric_limits<float>::max())
603  {}
604  } ;
605 
606  struct MvaOutput
607  {
608  int status ; // see PFCandidateElectronExtra::StatusFlag
609  float mva_Isolated ;
610  float mva_e_pi ;
611  float mvaByPassForIsolated ; // complementary MVA used in preselection
613  : status(-1), mva_Isolated(-999999999.),mva_e_pi(-999999999.), mvaByPassForIsolated(-999999999.)
614  {}
615  } ;
616 
617  // accessors
619  const MvaInput & mvaInput() const { return mvaInput_ ; }
620  const MvaOutput & mvaOutput() const { return mvaOutput_ ; }
621 
622  // setters
624  void setMvaInput( const MvaInput & mi ) { mvaInput_ = mi ; }
625  void setMvaOutput( const MvaOutput & mo ) { mvaOutput_ = mo ; }
626 
627  // for backward compatibility
628  float mva_Isolated() const { return mvaOutput_.mva_Isolated ; }
629  float mva_e_pi() const { return mvaOutput_.mva_e_pi ; }
630 
631  private:
632 
636 
637 
638  //=======================================================
639  // Preselection and Ambiguity
640  //=======================================================
641 
642  public :
643 
644  // accessors
645  bool ecalDriven() const ; // return true if ecalDrivenSeed() and passingCutBasedPreselection()
648  bool ambiguous() const { return ambiguous_ ; }
652 
653  // setters
655  void setPassPflowPreselection( bool flag ) { passPflowPreselection_ = flag ; }
656  void setAmbiguous( bool flag ) { ambiguous_ = flag ; }
659 
660  // backward compatibility
661  void setPassMvaPreselection( bool flag ) { passMvaPreslection_ = flag ; }
662  bool passingMvaPreselection() const { return passMvaPreslection_ ; }
663 
664  private:
665 
666  // attributes
669  bool passMvaPreslection_ ; // to be removed : passPflowPreslection_
670  bool ambiguous_ ;
671  GsfTrackRefVector ambiguousGsfTracks_ ; // ambiguous gsf tracks
672 
673 
674  //=======================================================
675  // Brem Fractions and Classification
676  //=======================================================
677 
678  public :
679 
681  {
682  float trackFbrem ; // the brem fraction from gsf fit: (track momentum in - track momentum out) / track momentum in
683  float superClusterFbrem ; // the brem fraction from supercluster: (supercluster energy - electron cluster energy) / supercluster energy
685  : trackFbrem(-1.e30), superClusterFbrem(-1.e30)
686  {}
687  } ;
689 
690  // accessors
691  float trackFbrem() const { return classVariables_.trackFbrem ; }
694  Classification classification() const { return class_ ; }
695 
696  // utilities
697  int numberOfBrems() const { return basicClustersSize()-1 ; }
698  float fbrem() const { return trackFbrem() ; }
699 
700  // setters
704  void setClassification( Classification myclass ) { class_ = myclass ; }
705 
706  private:
707 
708  // attributes
710  Classification class_ ; // fbrem and number of clusters based electron classification
711 
712 
713  //=======================================================
714  // Corrections
715  //
716  // The only methods, with classification, which modify
717  // the electrons after they have been constructed.
718  // They change a given characteristic, such as the super-cluster
719  // energy, and propagate the change consistently
720  // to all the depending attributes.
721  // We expect the methods to be called in a given order
722  // and so to store specific kind of corrections
723  // 1) classify()
724  // 2) correctEcalEnergy() : depending on classification and eta
725  // 3) correctMomemtum() : depending on classification and ecal energy and tracker momentum errors
726  //
727  // Beware that correctEcalEnergy() is modifying few attributes which
728  // were potentially used for preselection, whose value used in
729  // preselection will not be available any more :
730  // hcalDepth1OverEcal, hcalDepth2OverEcal, eSuperClusterOverP,
731  // eSeedClusterOverP, eEleClusterOverPout.
732  //=======================================================
733 
734  public :
735 
737 
738  struct Corrections
739  {
740  bool isEcalEnergyCorrected ; // true if ecal energy has been corrected
741  float correctedEcalEnergy ; // corrected energy (if !isEcalEnergyCorrected this value is identical to the supercluster energy)
742  float correctedEcalEnergyError ; // error on energy
743  //bool isMomentumCorrected ; // DEPRECATED
744  float trackMomentumError ; // track momentum error from gsf fit
745  //
746  LorentzVector fromSuperClusterP4 ; // for P4_FROM_SUPER_CLUSTER
747  float fromSuperClusterP4Error ; // for P4_FROM_SUPER_CLUSTER
748  LorentzVector combinedP4 ; // for P4_COMBINATION
749  float combinedP4Error ; // for P4_COMBINATION
750  LorentzVector pflowP4 ; // for P4_PFLOW_COMBINATION
751  float pflowP4Error ; // for P4_PFLOW_COMBINATION
752  P4Kind candidateP4Kind ; // say which momentum has been stored in reco::Candidate
753  //
756  /*isMomentumCorrected(false),*/ trackMomentumError(999.),
759  {}
760  } ;
761 
762  // setters
763  void setCorrectedEcalEnergyError( float newEnergyError ) ;
764  void setCorrectedEcalEnergy( float newEnergy ) ;
766  void setP4( P4Kind kind, const LorentzVector & p4, float p4Error, bool setCandidate ) ;
767  using RecoCandidate::setP4 ;
768 
769  // accessors
774  const LorentzVector & p4( P4Kind kind ) const ;
775  using RecoCandidate::p4 ;
776  float p4Error( P4Kind kind ) const ;
778  const Corrections & corrections() const { return corrections_ ; }
779 
780  // bare setter (if you know what you're doing)
782 
783  // for backward compatibility
785  float ecalEnergy() const { return correctedEcalEnergy() ; }
786  float ecalEnergyError() const { return correctedEcalEnergyError() ; }
787  //bool isMomentumCorrected() const { return corrections_.isMomentumCorrected ; }
788  float caloEnergy() const { return correctedEcalEnergy() ; }
789  bool isEnergyScaleCorrected() const { return isEcalEnergyCorrected() ; }
790  void correctEcalEnergy( float newEnergy, float newEnergyError )
791  {
792  setCorrectedEcalEnergy(newEnergy) ;
793  setEcalEnergyError(newEnergyError) ;
794  }
796  { setTrackMomentumError(trackMomentumError) ; setP4(P4_COMBINATION,p4,p4Error,true) ; }
797 
798 
799  private:
800 
801  // attributes
803 
804  public:
807  float dPhi1 ;
809  float dPhi2 ;
811  float dRz1 ;
813  float dRz2 ;
815  unsigned char subdetectors ;
817  dPhi1(-999),
818  dPhi2(-999),
819  dRz1(-999),
820  dRz2(-999),
821  subdetectors(0)
822  {}
824  };
825  void setPixelMatchSubdetectors(int sd1, int sd2){ pixelMatchVariables_.subdetectors = 10*sd1+sd2 ; }
826  void setPixelMatchDPhi1(float dPhi1){ pixelMatchVariables_.dPhi1 = dPhi1 ; }
827  void setPixelMatchDPhi2(float dPhi2){ pixelMatchVariables_.dPhi2 = dPhi2 ; }
828  void setPixelMatchDRz1 (float dRz1 ){ pixelMatchVariables_.dRz1 = dRz1 ; }
829  void setPixelMatchDRz2 (float dRz2 ){ pixelMatchVariables_.dRz2 = dRz2 ; }
830 
833  float pixelMatchDPhi1() const { return pixelMatchVariables_.dPhi1 ; }
834  float pixelMatchDPhi2() const { return pixelMatchVariables_.dPhi2 ; }
835  float pixelMatchDRz1 () const { return pixelMatchVariables_.dRz1 ; }
836  float pixelMatchDRz2 () const { return pixelMatchVariables_.dRz2 ; }
837  private:
839  } ;
840 
841  } // namespace reco
842 
843 #endif
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:618
CaloCluster_iterator basicClustersEnd() const
Definition: GsfElectron.h:320
float sigmaIphiIphi() const
Definition: GsfElectron.h:417
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:242
bool isEEGap() const
Definition: GsfElectron.h:357
void setDr04Isolation(const IsolationVariables &dr04)
Definition: GsfElectron.h:514
const ShowerShape & showerShape() const
Definition: GsfElectron.h:429
float dPhi1
Pixel match variable: deltaPhi for innermost hit.
Definition: GsfElectron.h:807
float dr04HcalTowerSumEt() const
Definition: GsfElectron.h:506
unsigned char subdetectors
Subdetectors for first and second pixel hit.
Definition: GsfElectron.h:815
void correctEcalEnergy(float newEnergy, float newEnergyError)
Definition: GsfElectron.h:790
void setTrackFbrem(float fbrem)
Definition: GsfElectron.h:701
MvaInput mvaInput_
Definition: GsfElectron.h:634
PixelMatchVariables pixelMatchVariables_
Definition: GsfElectron.h:838
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:654
float trackMomentumError() const
Definition: GsfElectron.h:773
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
GsfTrackRefVector::const_iterator ambiguousGsfTracksBegin() const
Definition: GsfElectron.h:650
void setPixelMatchDRz2(float dRz2)
Definition: GsfElectron.h:829
SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:188
float scSigmaEtaEta() const
Definition: GsfElectron.h:452
void setCore(const reco::GsfElectronCoreRef &core)
Definition: GsfElectron.h:179
const Corrections & corrections() const
Definition: GsfElectron.h:778
bool isEBEtaGap() const
Definition: GsfElectron.h:355
float dr03HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:496
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
float dRz2
Pixel match variable: deltaRz for second hit.
Definition: GsfElectron.h:813
P4Kind candidateP4Kind() const
Definition: GsfElectron.h:777
const TrackExtrapolations & trackExtrapolations() const
Definition: GsfElectron.h:294
float full5x5_e5x5() const
Definition: GsfElectron.h:437
float full5x5_hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:442
void setPixelMatchDPhi1(float dPhi1)
Definition: GsfElectron.h:826
math::XYZVectorF trackMomentumAtVtxWithConstraint() const
Definition: GsfElectron.h:293
const IsolationVariables & isolationVariables03() const
Definition: GsfElectron.h:519
bool isEBEEGap() const
Definition: GsfElectron.h:353
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:504
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:423
float full5x5_e1x5() const
Definition: GsfElectron.h:435
float pixelMatchDRz2() const
Definition: GsfElectron.h:836
float hadronicOverEm1() const
Definition: GsfElectron.h:458
Classification class_
Definition: GsfElectron.h:710
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:795
float full5x5_hcalDepth2OverEcal() const
Definition: GsfElectron.h:440
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:289
ConversionRejection conversionRejection_
Definition: GsfElectron.h:561
math::XYZTLorentzVector LorentzVector
void setMvaInput(const MvaInput &mi)
Definition: GsfElectron.h:624
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
Definition: GsfElectron.h:580
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:235
float full5x5_sigmaIphiIphi() const
Definition: GsfElectron.h:434
void setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:448
float dr04TkSumPt() const
Definition: GsfElectron.h:502
Corrections corrections_
Definition: GsfElectron.h:802
float pixelMatchDPhi2() const
Definition: GsfElectron.h:834
float sumNeutralHadronEtHighThreshold
sum pt of neutral hadrons with a higher threshold
Definition: GsfElectron.h:578
bool isEERingGap() const
Definition: GsfElectron.h:359
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:646
bool passingMvaPreselection() const
Definition: GsfElectron.h:662
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:494
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
Definition: GsfElectron.h:577
float fbrem() const
Definition: GsfElectron.h:698
const std::vector< CaloTowerDetId > & hcalTowersBehindClusters() const
Definition: GsfElectron.h:425
void setAmbiguous(bool flag)
Definition: GsfElectron.h:656
GsfTrackRefVector ambiguousGsfTracks_
Definition: GsfElectron.h:671
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:455
float e2x5Max() const
Definition: GsfElectron.h:419
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:255
int basicClustersSize() const
Definition: GsfElectron.h:318
float convDist() const
Definition: GsfElectron.h:553
ChargeInfo chargeInfo_
Definition: GsfElectron.h:164
float convRadius() const
Definition: GsfElectron.h:555
void setPfIsolationVariables(const PflowIsolationVariables &iso)
Definition: GsfElectron.h:623
math::XYZPointF TrackPositionAtVtx() const
Definition: GsfElectron.h:300
void setDr03Isolation(const IsolationVariables &dr03)
Definition: GsfElectron.h:513
bool isEEDeeGap() const
Definition: GsfElectron.h:358
void setMvaOutput(const MvaOutput &mo)
Definition: GsfElectron.h:625
float dr04HcalTowerSumEtBc() const
Definition: GsfElectron.h:509
bool ambiguous() const
Definition: GsfElectron.h:648
const IsolationVariables & dr04IsolationVariables() const
Definition: GsfElectron.h:510
const ClassificationVariables & classificationVariables() const
Definition: GsfElectron.h:693
float superClusterFbrem() const
Definition: GsfElectron.h:692
bool isEcalEnergyCorrected() const
Definition: GsfElectron.h:770
bool isEE() const
Definition: GsfElectron.h:351
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:250
bool isEB() const
Definition: GsfElectron.h:350
void setPixelMatchSubdetectors(int sd1, int sd2)
Definition: GsfElectron.h:825
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
virtual reco::TrackRef track() const
reference to a Track
GsfTrackRefVector::const_iterator ambiguousGsfTracksEnd() const
Definition: GsfElectron.h:651
void setSuperClusterFbrem(float fbrem)
Definition: GsfElectron.h:702
float convDcot() const
Definition: GsfElectron.h:554
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:433
void clearAmbiguousGsfTracks()
Definition: GsfElectron.h:657
bool isGsfScPixChargeConsistent() const
Definition: GsfElectron.h:153
int pixelMatchSubdetector1() const
Definition: GsfElectron.h:831
const IsolationVariables & isolationVariables04() const
Definition: GsfElectron.h:520
PflowIsolationVariables pfIso_
Definition: GsfElectron.h:633
bool isGap() const
Definition: GsfElectron.h:352
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:505
math::XYZVectorF trackMomentumAtCalo() const
Definition: GsfElectron.h:290
bool isGsfCtfChargeConsistent() const
Definition: GsfElectron.h:154
float pixelMatchDPhi1() const
Definition: GsfElectron.h:833
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float dPhi2
Pixel match variable: deltaPhi for second hit.
Definition: GsfElectron.h:809
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:177
virtual bool isElectron() const
Definition: GsfElectron.h:158
float sigmaIetaIeta() const
Definition: GsfElectron.h:416
float hadronicOverEm() const
Definition: GsfElectron.h:457
float dr03HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:497
float eSeedClusterOverP() const
Definition: GsfElectron.h:244
MvaOutput mvaOutput_
Definition: GsfElectron.h:635
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:503
FiducialFlags fiducialFlags_
Definition: GsfElectron.h:366
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:251
const MvaInput & mvaInput() const
Definition: GsfElectron.h:619
float sumPhotonEtHighThreshold
sum pt of PF photons with a higher threshold
Definition: GsfElectron.h:579
float full5x5_sigmaEtaEta() const
Definition: GsfElectron.h:432
ShowerShape showerShape_
Definition: GsfElectron.h:465
float trackFbrem() const
Definition: GsfElectron.h:691
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:575
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
int numberOfBrems() const
Definition: GsfElectron.h:697
virtual int charge() const final
electric charge
Definition: LeafCandidate.h:91
float hcalOverEcal() const
Definition: GsfElectron.h:424
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:661
float dr04HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:507
float dr03TkSumPt() const
Definition: GsfElectron.h:491
math::XYZPointF trackPositionAtCalo() const
Definition: GsfElectron.h:288
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:386
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:493
double f[11][100]
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:574
float eSeedClusterOverPout() const
Definition: GsfElectron.h:245
float full5x5_hcalOverEcalBc() const
Definition: GsfElectron.h:444
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
float hadronicOverEm2() const
Definition: GsfElectron.h:459
int pixelMatchSubdetector2() const
Definition: GsfElectron.h:832
float hcalOverEcalBc() const
Definition: GsfElectron.h:428
int scPixCharge() const
Definition: GsfElectron.h:151
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:453
float pixelMatchDRz1() const
Definition: GsfElectron.h:835
void setIsolation04(const IsolationVariables &dr04)
Definition: GsfElectron.h:518
IsolationVariables dr04_
Definition: GsfElectron.h:526
float ecalEnergyError() const
Definition: GsfElectron.h:786
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:252
void setDeltaPhiSuperClusterAtVtx(float dphi)
Definition: GsfElectron.h:260
bool isEnergyScaleCorrected() const
Definition: GsfElectron.h:789
void setEcalEnergyError(float energyError)
Definition: GsfElectron.h:784
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:439
float deltaEtaSeedClusterTrackAtVtx() const
Definition: GsfElectron.h:253
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:422
float shFracInnerHits() const
Definition: GsfElectron.h:198
float correctedEcalEnergy() const
Definition: GsfElectron.h:771
void setPixelMatchDPhi2(float dPhi2)
Definition: GsfElectron.h:827
ClassificationVariables classVariables_
Definition: GsfElectron.h:709
bool isEBGap() const
Definition: GsfElectron.h:354
GsfElectronCoreRef core_
Definition: GsfElectron.h:205
ShowerShape full5x5_showerShape_
Definition: GsfElectron.h:466
virtual ~GsfElectron()
Definition: GsfElectron.h:112
TrackBaseRef convPartner() const
Definition: GsfElectron.h:552
const ChargeInfo & chargeInfo() const
Definition: GsfElectron.h:155
float full5x5_e2x5Max() const
Definition: GsfElectron.h:436
CaloCluster_iterator basicClustersBegin() const
Definition: GsfElectron.h:319
void clear()
Clear the vector.
Definition: RefVector.h:139
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:249
void setClassification(Classification myclass)
Definition: GsfElectron.h:704
float e1x5() const
Definition: GsfElectron.h:418
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Classification classification() const
Definition: GsfElectron.h:694
float hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:427
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:620
float full5x5_hcalOverEcal() const
Definition: GsfElectron.h:441
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:649
float dr04HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:508
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
float full5x5_hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:443
float ecalEnergy() const
Definition: GsfElectron.h:785
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
float mva_Isolated() const
Definition: GsfElectron.h:628
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
math::XYZVectorF trackMomentumAtEleClus() const
Definition: GsfElectron.h:292
float mva_e_pi() const
Definition: GsfElectron.h:629
float e5x5() const
Definition: GsfElectron.h:420
float dr03HcalTowerSumEtBc() const
Definition: GsfElectron.h:498
float full5x5_r9() const
Definition: GsfElectron.h:438
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:283
float correctedEcalEnergyError() const
Definition: GsfElectron.h:772
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:180
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:517
float r9() const
Definition: GsfElectron.h:421
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
const ShowerShape & full5x5_showerShape() const
Definition: GsfElectron.h:445
void setTrackExtrapolations(const TrackExtrapolations &te)
Definition: GsfElectron.h:297
const IsolationVariables & dr03IsolationVariables() const
Definition: GsfElectron.h:499
int convFlags() const
Definition: GsfElectron.h:551
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:655
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:62
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:495
const ConversionRejection & conversionRejectionVariables() const
Definition: GsfElectron.h:556
void setDeltaEtaSuperClusterAtVtx(float de)
Definition: GsfElectron.h:259
float dRz1
Pixel match variable: deltaRz for innermost hit.
Definition: GsfElectron.h:811
void setCorrections(const Corrections &c)
Definition: GsfElectron.h:781
void setClassificationVariables(const ClassificationVariables &cv)
Definition: GsfElectron.h:703
float scE5x5() const
Definition: GsfElectron.h:456
volatile std::atomic< bool > shutdown_flag false
TrackClusterMatching trackClusterMatching_
Definition: GsfElectron.h:266
bool passCutBasedPreselection_
Definition: GsfElectron.h:667
float hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:426
IsolationVariables dr03_
Definition: GsfElectron.h:525
void addAmbiguousGsfTrack(const reco::GsfTrackRef &t)
Definition: GsfElectron.h:658
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:573
void full5x5_setShowerShape(const ShowerShape &s)
Definition: GsfElectron.h:449
TrackExtrapolations trackExtrapolations_
Definition: GsfElectron.h:307
float caloEnergy() const
Definition: GsfElectron.h:788
bool ecalDriven() const
Definition: GsfElectron.cc:172
bool passPflowPreselection_
Definition: GsfElectron.h:668
float ctfGsfOverlap() const
Definition: GsfElectron.h:185
const FiducialFlags & fiducialFlags() const
Definition: GsfElectron.h:360
void setPixelMatchDRz1(float dRz1)
Definition: GsfElectron.h:828
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
float sigmaEtaEta() const
Definition: GsfElectron.h:415
float scE1x5() const
Definition: GsfElectron.h:454
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:647