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 
12  passPflowPreselection_ = false;
13  passMvaPreslection_ = false;
14  ambiguous_ = true;
15  class_ = UNKNOWN;
16 }
17 
19 
21 
23  const ChargeInfo& chargeInfo,
24  const GsfElectronCoreRef& core,
25  const TrackClusterMatching& tcm,
26  const TrackExtrapolations& te,
27  const ClosestCtfTrack& ctfInfo,
28  const FiducialFlags& ff,
29  const ShowerShape& ss,
30  const ConversionRejection& crv)
31  : chargeInfo_(chargeInfo),
32  core_(core),
35  //closestCtfTrack_(ctfInfo),
36  fiducialFlags_(ff),
37  showerShape_(ss),
39  init();
40  setCharge(charge);
42  setPdgId(-11 * charge);
43  /*if (ecalDrivenSeed())*/ corrections_.correctedEcalEnergy = superCluster()->energy();
44  // assert(ctfInfo.ctfTrack==(GsfElectron::core()->ctfTrack())) ;
45  // assert(ctfInfo.shFracInnerHits==(GsfElectron::core()->ctfGsfOverlap())) ;
46 }
47 
49  const ChargeInfo& chargeInfo,
50  const GsfElectronCoreRef& core,
51  const TrackClusterMatching& tcm,
52  const TrackExtrapolations& te,
53  const ClosestCtfTrack& ctfInfo,
54  const FiducialFlags& ff,
55  const ShowerShape& ss,
56  const ShowerShape& full5x5_ss,
57  const ConversionRejection& crv,
58  const SaturationInfo& si)
59  : chargeInfo_(chargeInfo),
60  core_(core),
63  fiducialFlags_(ff),
64  showerShape_(ss),
65  full5x5_showerShape_(full5x5_ss),
66  saturationInfo_(si),
68  init();
69  setCharge(charge);
71  setPdgId(-11 * charge);
73 }
74 
76  : RecoCandidate(electron),
77  chargeInfo_(electron.chargeInfo_),
78  core_(core),
81  //closestCtfTrack_(electron.closestCtfTrack_),
83  showerShape_(electron.showerShape_),
86  dr03_(electron.dr03_),
87  dr04_(electron.dr04_),
89  pfIso_(electron.pfIso_),
90  mvaInput_(electron.mvaInput_),
91  mvaOutput_(electron.mvaOutput_),
95  ambiguous_(electron.ambiguous_),
98  class_(electron.class_),
99  corrections_(electron.corrections_),
101  //assert(electron.core()->ctfTrack()==core->ctfTrack()) ;
102  //assert(electron.core()->ctfGsfOverlap()==core->ctfGsfOverlap()) ;
103 }
104 
106  const GsfElectronCoreRef& core,
108  const TrackRef& closestCtfTrack,
109  const TrackBaseRef& conversionPartner,
110  const GsfTrackRefVector& ambiguousTracks)
111  : RecoCandidate(electron),
112  chargeInfo_(electron.chargeInfo_),
113  core_(core),
116  //closestCtfTrack_(electron.closestCtfTrack_),
117  fiducialFlags_(electron.fiducialFlags_),
118  showerShape_(electron.showerShape_),
121  dr03_(electron.dr03_),
122  dr04_(electron.dr04_),
124  pfIso_(electron.pfIso_),
125  mvaInput_(electron.mvaInput_),
126  mvaOutput_(electron.mvaOutput_),
130  ambiguous_(electron.ambiguous_),
131  ambiguousGsfTracks_(ambiguousTracks),
132  //mva_(electron.mva_),
134  class_(electron.class_),
135  corrections_(electron.corrections_),
138  //closestCtfTrack_.ctfTrack = closestCtfTrack ;
139  conversionRejection_.partner = conversionPartner;
140  //assert(closestCtfTrack==core->ctfTrack()) ;
141  //assert(electron.core()->ctfGsfOverlap()==core->ctfGsfOverlap()) ;
142  // TO BE DONE
143  // Check that the new edm references are really
144  // the clones of the former references, and therefore other attributes
145  // stay valid :
146  // * electron.core_ ~ core ?
147  // * electron.trackClusterMatching_.electronCluster ~ electronCluster ?
148  // * electron.closestCtfTrack_.ctfTrack ~ closestCtfTrack ?
149  // * electron.ambiguousGsfTracks_ ~ ambiguousTracks ?
150 }
151 
152 bool GsfElectron::overlap(const Candidate& c) const {
153  const RecoCandidate* o = dynamic_cast<const RecoCandidate*>(&c);
154  return (o != nullptr && (checkOverlap(gsfTrack(), o->gsfTrack()) || checkOverlap(superCluster(), o->superCluster())));
155  //?? return false;
156 }
157 
158 GsfElectron* GsfElectron::clone() const { return new GsfElectron(*this); }
159 
162  const TrackRef& closestCtfTrack,
163  const TrackBaseRef& conversionPartner,
164  const GsfTrackRefVector& ambiguousTracks) const {
165  return new GsfElectron(*this, core, electronCluster, closestCtfTrack, conversionPartner, ambiguousTracks);
166 }
167 
169 
172 }
173 
174 void GsfElectron::setCorrectedEcalEnergy(float newEnergy) {
176  momentum *= newEnergy / momentum.e();
177  setP4(momentum);
182  corrections_.correctedEcalEnergy = newEnergy;
184 }
185 
187 
188 void GsfElectron::setP4(P4Kind kind, const reco::Candidate::LorentzVector& p4, float error, bool setCandidate) {
189  switch (kind) {
193  break;
194  case P4_COMBINATION:
197  break;
201  break;
202  default:
203  throw cms::Exception("GsfElectron") << "unexpected p4 kind: " << kind;
204  }
205  if (setCandidate) {
206  setP4(p4);
208  }
209 }
210 
212  switch (kind) {
215  case P4_COMBINATION:
216  return corrections_.combinedP4;
218  return corrections_.pflowP4;
219  default:
220  throw cms::Exception("GsfElectron") << "unexpected p4 kind: " << kind;
221  }
222 }
223 
225  switch (kind) {
228  case P4_COMBINATION:
231  return corrections_.pflowP4Error;
232  default:
233  throw cms::Exception("GsfElectron") << "unexpected p4 kind: " << kind;
234  }
235 }
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:220
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
bool checkOverlap(const R &r1, const R &r2) const
check if two components overlap
Definition: RecoCandidate.h:67
MvaInput mvaInput_
Definition: GsfElectron.h:669
PixelMatchVariables pixelMatchVariables_
Definition: GsfElectron.h:859
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:188
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
GsfElectron * clone() const override
returns a clone of the Candidate object
Definition: GsfElectron.cc:158
bool overlap(const Candidate &) const override
check overlap with another candidate
Definition: GsfElectron.cc:152
Classification class_
Definition: GsfElectron.h:737
ConversionRejection conversionRejection_
Definition: GsfElectron.h:591
Definition: __init__.py:1
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:224
Corrections corrections_
Definition: GsfElectron.h:828
SaturationInfo saturationInfo_
Definition: GsfElectron.h:495
int charge() const final
electric charge
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:679
GsfTrackRefVector ambiguousGsfTracks_
Definition: GsfElectron.h:703
ChargeInfo chargeInfo_
Definition: GsfElectron.h:139
void setVertex(const Point &vertex) override
set vertex
void setCharge(Charge q) final
set electric charge
PflowIsolationVariables pfIso_
Definition: GsfElectron.h:668
Vector momentum() const final
spatial momentum vector
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:170
MvaOutput mvaOutput_
Definition: GsfElectron.h:670
FiducialFlags fiducialFlags_
Definition: GsfElectron.h:351
ShowerShape showerShape_
Definition: GsfElectron.h:474
const LorentzVector & p4() const final
four-momentum Lorentz vector
IsolationVariables dr04_
Definition: GsfElectron.h:557
void setTrackMomentumError(float trackMomentumError)
Definition: GsfElectron.cc:186
ClassificationVariables classVariables_
Definition: GsfElectron.h:736
GsfElectronCoreRef core_
Definition: GsfElectron.h:187
ShowerShape full5x5_showerShape_
Definition: GsfElectron.h:475
const ChargeInfo & chargeInfo() const
Definition: GsfElectron.h:131
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:174
fixed size matrix
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
TrackClusterMatching trackClusterMatching_
Definition: GsfElectron.h:245
bool passCutBasedPreselection_
Definition: GsfElectron.h:699
IsolationVariables dr03_
Definition: GsfElectron.h:556
TrackExtrapolations trackExtrapolations_
Definition: GsfElectron.h:286
bool ecalDriven() const
Definition: GsfElectron.cc:168
void setPdgId(int pdgId) final
bool passPflowPreselection_
Definition: GsfElectron.h:700
virtual ClosestCtfTrack closestCtfTrack() const
Definition: GsfElectron.h:181
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
bool ecalDrivenSeed() const
Definition: GsfElectron.h:158