CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfElectron.cc
Go to the documentation of this file.
5 
6 using namespace reco ;
7 
9  : passCutBasedPreselection_(false), passMvaPreslection_(false), ambiguous_(true), mva_(-999999999), fbrem_(0), class_(UNKNOWN)
10  {}
11 
13  : core_(core), passCutBasedPreselection_(false), passMvaPreslection_(false), ambiguous_(true), mva_(-999999999), fbrem_(0), class_(UNKNOWN)
14  {}
15 
17  ( const LorentzVector & p4,
18  int charge, const ChargeInfo & chargeInfo,
19  const GsfElectronCoreRef & core,
20  const TrackClusterMatching & tcm, const TrackExtrapolations & te,
21  const ClosestCtfTrack & ctfInfo,
22  const FiducialFlags & ff, const ShowerShape & ss,
23  const ConversionRejection & crv,
24  float fbrem
25  )
26  : chargeInfo_(chargeInfo),
27  core_(core),
28  trackClusterMatching_(tcm), trackExtrapolations_(te),
29  closestCtfTrack_(ctfInfo),
30  fiducialFlags_(ff), showerShape_(ss), conversionRejection_(crv),
31  passCutBasedPreselection_(false), passMvaPreslection_(false), ambiguous_(true),
32  mva_(-999999999), fbrem_(fbrem), class_(UNKNOWN)
33  {
34  setCharge(charge) ;
35  setP4(p4) ;
36  setVertex(te.positionAtVtx) ;
37  setPdgId(-11*charge) ;
38  /*if (ecalDrivenSeed())*/ corrections_.ecalEnergy = superCluster()->energy() ;
39 }
40 
42  ( const GsfElectron & electron,
43  const GsfElectronCoreRef & core )
44  : RecoCandidate(electron),
45  chargeInfo_(electron.chargeInfo_),
46  core_(core),
47  trackClusterMatching_(electron.trackClusterMatching_),
48  trackExtrapolations_(electron.trackExtrapolations_),
49  closestCtfTrack_(electron.closestCtfTrack_),
50  ambiguousGsfTracks_(electron.ambiguousGsfTracks_),
51  fiducialFlags_(electron.fiducialFlags_),
52  showerShape_(electron.showerShape_),
53  dr03_(electron.dr03_), dr04_(electron.dr04_),
54  conversionRejection_(electron.conversionRejection_),
55  passCutBasedPreselection_(electron.passCutBasedPreselection_),
56  passMvaPreslection_(electron.passMvaPreslection_),
57  ambiguous_(electron.ambiguous_),
58  mva_(electron.mva_),
59  fbrem_(electron.fbrem_),
60  class_(electron.class_),
61  corrections_(electron.corrections_)
62  {
63  }
64 
66  ( const GsfElectron & electron,
67  const GsfElectronCoreRef & core,
68  const CaloClusterPtr & electronCluster,
69  const TrackRef & closestCtfTrack,
70  const TrackBaseRef & conversionPartner,
71  const GsfTrackRefVector & ambiguousTracks )
72  : RecoCandidate(electron),
73  chargeInfo_(electron.chargeInfo_),
74  core_(core),
75  trackClusterMatching_(electron.trackClusterMatching_),
76  trackExtrapolations_(electron.trackExtrapolations_),
77  closestCtfTrack_(electron.closestCtfTrack_),
78  ambiguousGsfTracks_(ambiguousTracks),
79  fiducialFlags_(electron.fiducialFlags_),
80  showerShape_(electron.showerShape_),
81  dr03_(electron.dr03_), dr04_(electron.dr04_),
82  conversionRejection_(electron.conversionRejection_),
83  passCutBasedPreselection_(electron.passCutBasedPreselection_),
84  passMvaPreslection_(electron.passMvaPreslection_),
85  ambiguous_(electron.ambiguous_),
86  mva_(electron.mva_),
87  fbrem_(electron.fbrem_),
88  class_(electron.class_),
89  corrections_(electron.corrections_)
90  {
91  trackClusterMatching_.electronCluster = electronCluster ;
92  closestCtfTrack_.ctfTrack = closestCtfTrack ;
93  conversionRejection_.partner = conversionPartner ;
94  // TO BE DONE
95  // Check that the new edm references are really
96  // to clones of the former references, and therefore other attributes
97  // stay valid :
98  // * electron.core_ ~ core ?
99  // * electron.trackClusterMatching_.electronCluster ~ electronCluster ?
100  // * electron.closestCtfTrack_.ctfTrack ~ closestCtfTrack ?
101  // * electron.ambiguousGsfTracks_ ~ ambiguousTracks ?
102  }
103 
104 bool GsfElectron::overlap( const Candidate & c ) const {
105  const RecoCandidate * o = dynamic_cast<const RecoCandidate *>( & c );
106  return ( o != 0 &&
107  ( checkOverlap( gsfTrack(), o->gsfTrack() ) ||
109  );
110  //?? return false;
111 }
112 
114  { return new GsfElectron(*this) ; }
115 
117  (
118  const GsfElectronCoreRef & core,
119  const CaloClusterPtr & electronCluster,
120  const TrackRef & closestCtfTrack,
121  const TrackBaseRef & conversionPartner,
122  const GsfTrackRefVector & ambiguousTracks
123  ) const
124  { return new GsfElectron(*this,core,electronCluster,closestCtfTrack,conversionPartner,ambiguousTracks) ; }
125 
127  {
129  {
130  edm::LogWarning("GsfElectronAlgo|UndefinedPreselectionInfo")
131  <<"All preselection flags are false,"
132  <<" either the data is too old or electrons were not preselected." ;
133  }
135  }
136 
137 void GsfElectron::correctEcalEnergy( float newEnergy, float newEnergyError )
138  {
140  momentum *= newEnergy/momentum.e() ;
141  setP4(momentum) ;
147  corrections_.ecalEnergy = newEnergy ;
148  corrections_.ecalEnergyError = newEnergyError ;
150  }
151 
153  ( const reco::Candidate::LorentzVector & momentum,
154  float trackErr, float electronErr )
155  {
156  setP4(momentum) ;
157  corrections_.trackMomentumError = trackErr ;
158  corrections_.electronMomentumError = electronErr ;
159  corrections_.isMomentumCorrected = true ;
160  }
161 
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
bool checkOverlap(const R &r1, const R &r2) const
check if two components overlap
Definition: RecoCandidate.h:67
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:15
Classification class_
Definition: GsfElectron.h:539
0: Unidentified isolated particle
Definition: ParticleCode.h:19
ConversionRejection conversionRejection_
Definition: GsfElectron.h:486
virtual Vector momentum() const
spatial momentum vector
virtual void setP4(const LorentzVector &p4)
set 4-momentum
Corrections corrections_
Definition: GsfElectron.h:607
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:497
bool passingMvaPreselection() const
Definition: GsfElectron.h:498
SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:166
GsfTrackRefVector ambiguousGsfTracks_
Definition: GsfElectron.h:308
ChargeInfo chargeInfo_
Definition: GsfElectron.h:149
double charge(const std::vector< uint8_t > &Ampls)
ClosestCtfTrack closestCtfTrack_
Definition: GsfElectron.h:307
FiducialFlags fiducialFlags_
Definition: GsfElectron.h:350
ShowerShape showerShape_
Definition: GsfElectron.h:401
void correctMomentum(const LorentzVector &momentum, float trackMomentumError, float electronMomentumError)
Definition: GsfElectron.cc:153
double p4[4]
Definition: TauolaWrapper.h:92
IsolationVariables dr04_
Definition: GsfElectron.h:451
GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:167
tuple ff
Definition: createTree.py:204
void correctEcalEnergy(float newEnergy, float newEnergyError)
Definition: GsfElectron.cc:137
virtual bool overlap(const Candidate &) const
check overlap with another candidate
Definition: GsfElectron.cc:104
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:39
GsfElectron * clone() const
returns a clone of the Candidate object
Definition: GsfElectron.cc:113
TrackClusterMatching trackClusterMatching_
Definition: GsfElectron.h:221
bool passCutBasedPreselection_
Definition: GsfElectron.h:511
IsolationVariables dr03_
Definition: GsfElectron.h:450
TrackExtrapolations trackExtrapolations_
Definition: GsfElectron.h:259
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
bool ecalDriven() const
Definition: GsfElectron.cc:126
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
bool ecalDrivenSeed() const
Definition: GsfElectron.h:168