CMS 3D CMS Logo

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),
33  trackClusterMatching_(tcm),
34  trackExtrapolations_(te),
35  //closestCtfTrack_(ctfInfo),
36  fiducialFlags_(ff),
37  showerShape_(ss),
38  conversionRejection_(crv) {
39  init();
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),
61  trackClusterMatching_(tcm),
62  trackExtrapolations_(te),
63  fiducialFlags_(ff),
64  showerShape_(ss),
65  full5x5_showerShape_(full5x5_ss),
66  saturationInfo_(si),
67  conversionRejection_(crv) {
68  init();
71  setPdgId(-11 * charge);
73 }
74 
77  chargeInfo_(electron.chargeInfo_),
78  core_(core),
79  trackClusterMatching_(electron.trackClusterMatching_),
80  trackExtrapolations_(electron.trackExtrapolations_),
81  //closestCtfTrack_(electron.closestCtfTrack_),
82  fiducialFlags_(electron.fiducialFlags_),
83  showerShape_(electron.showerShape_),
84  full5x5_showerShape_(electron.full5x5_showerShape_),
85  saturationInfo_(electron.saturationInfo_),
86  dr03_(electron.dr03_),
87  dr04_(electron.dr04_),
88  conversionRejection_(electron.conversionRejection_),
89  pfIso_(electron.pfIso_),
90  mvaInput_(electron.mvaInput_),
91  mvaOutput_(electron.mvaOutput_),
92  passCutBasedPreselection_(electron.passCutBasedPreselection_),
93  passPflowPreselection_(electron.passPflowPreselection_),
94  passMvaPreslection_(electron.passMvaPreslection_),
95  ambiguous_(electron.ambiguous_),
96  ambiguousGsfTracks_(electron.ambiguousGsfTracks_),
97  classVariables_(electron.classVariables_),
98  class_(electron.class_),
99  corrections_(electron.corrections_),
100  pixelMatchVariables_(electron.pixelMatchVariables_) {
101  //assert(electron.core()->ctfTrack()==core->ctfTrack()) ;
102  //assert(electron.core()->ctfGsfOverlap()==core->ctfGsfOverlap()) ;
103 }
104 
106  const GsfElectronCoreRef& core,
107  const CaloClusterPtr& electronCluster,
108  const TrackRef& closestCtfTrack,
109  const TrackBaseRef& conversionPartner,
110  const GsfTrackRefVector& ambiguousTracks)
112  chargeInfo_(electron.chargeInfo_),
113  core_(core),
114  trackClusterMatching_(electron.trackClusterMatching_),
115  trackExtrapolations_(electron.trackExtrapolations_),
116  //closestCtfTrack_(electron.closestCtfTrack_),
117  fiducialFlags_(electron.fiducialFlags_),
118  showerShape_(electron.showerShape_),
119  full5x5_showerShape_(electron.full5x5_showerShape_),
120  saturationInfo_(electron.saturationInfo_),
121  dr03_(electron.dr03_),
122  dr04_(electron.dr04_),
123  conversionRejection_(electron.conversionRejection_),
124  pfIso_(electron.pfIso_),
125  mvaInput_(electron.mvaInput_),
126  mvaOutput_(electron.mvaOutput_),
127  passCutBasedPreselection_(electron.passCutBasedPreselection_),
128  passPflowPreselection_(electron.passPflowPreselection_),
129  passMvaPreslection_(electron.passMvaPreslection_),
130  ambiguous_(electron.ambiguous_),
131  ambiguousGsfTracks_(ambiguousTracks),
132  //mva_(electron.mva_),
133  classVariables_(electron.classVariables_),
134  class_(electron.class_),
135  corrections_(electron.corrections_),
136  pixelMatchVariables_(electron.pixelMatchVariables_) {
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 
161  const CaloClusterPtr& electronCluster,
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 }
reco::LeafCandidate::setPdgId
void setPdgId(int pdgId) final
Definition: LeafCandidate.h:178
reco::GsfElectron::trackClusterMatching_
TrackClusterMatching trackClusterMatching_
Definition: GsfElectron.h:252
reco::LeafCandidate::momentum
Vector momentum() const final
spatial momentum vector
Definition: LeafCandidate.h:118
reco::GsfElectron::ClosestCtfTrack
Definition: GsfElectron.h:180
reco::GsfElectron::TrackClusterMatching::electronCluster
CaloClusterPtr electronCluster
Definition: GsfElectron.h:202
reco::GsfElectron::Corrections::combinedP4Error
float combinedP4Error
Definition: GsfElectron.h:779
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:163
reco::GsfElectron::Corrections::correctedEcalEnergy
float correctedEcalEnergy
Definition: GsfElectron.h:771
reco::GsfElectron::Corrections::candidateP4Kind
P4Kind candidateP4Kind
Definition: GsfElectron.h:782
reco::GsfElectron::Corrections::pflowP4Error
float pflowP4Error
Definition: GsfElectron.h:781
reco::GsfElectron::ShowerShape::hcalDepth1OverEcal
float hcalDepth1OverEcal
Definition: GsfElectron.h:373
reco::GsfElectron::ChargeInfo
Definition: GsfElectron.h:122
reco::GsfElectron::corrections_
Corrections corrections_
Definition: GsfElectron.h:834
reco::RecoCandidate::checkOverlap
bool checkOverlap(const R &r1, const R &r2) const
check if two components overlap
Definition: RecoCandidate.h:67
reco::GsfElectron::conversionRejection_
ConversionRejection conversionRejection_
Definition: GsfElectron.h:598
BasicCluster.h
reco::GsfElectron::core_
GsfElectronCoreRef core_
Definition: GsfElectron.h:194
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
reco::GsfElectron::P4_COMBINATION
Definition: GsfElectron.h:767
reco::GsfElectron::passCutBasedPreselection_
bool passCutBasedPreselection_
Definition: GsfElectron.h:705
reco::GsfElectron::p4Error
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:224
reco::GsfElectron::Corrections::correctedEcalEnergyError
float correctedEcalEnergyError
Definition: GsfElectron.h:772
edm::RefVector< GsfTrackCollection >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
relativeConstraints.error
error
Definition: relativeConstraints.py:53
BasicClusterFwd.h
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
edm::Ref< GsfElectronCoreCollection >
reco::GsfElectron::GsfElectron
GsfElectron()
Definition: GsfElectron.cc:18
reco::GsfElectron::Corrections::combinedP4
LorentzVector combinedP4
Definition: GsfElectron.h:778
reco::GsfElectron::core
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
reco::GsfElectron::setTrackMomentumError
void setTrackMomentumError(float trackMomentumError)
Definition: GsfElectron.cc:186
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
reco::GsfElectron::setP4
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:188
reco::GsfElectron::Corrections::fromSuperClusterP4Error
float fromSuperClusterP4Error
Definition: GsfElectron.h:777
reco::GsfElectron::ConversionRejection
Definition: GsfElectron.h:571
reco::GsfElectron::ShowerShape
Definition: GsfElectron.h:365
alignCSCRings.ff
ff
Definition: alignCSCRings.py:148
reco::GsfElectron::ecalDrivenSeed
bool ecalDrivenSeed() const
Definition: GsfElectron.h:165
metsig::electron
Definition: SignAlgoResolutions.h:48
reco::GsfElectron::FiducialFlags
Definition: GsfElectron.h:316
reco::GsfElectron
Definition: GsfElectron.h:34
reco::GsfElectron::P4_FROM_SUPER_CLUSTER
Definition: GsfElectron.h:767
GsfElectron.h
reco::LeafCandidate::setVertex
void setVertex(const Point &vertex) override
set vertex
Definition: LeafCandidate.h:173
reco::GsfElectron::Corrections::pflowP4
LorentzVector pflowP4
Definition: GsfElectron.h:780
reco::GsfElectron::UNKNOWN
Definition: GsfElectron.h:722
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::GsfElectron::showerShape_
ShowerShape showerShape_
Definition: GsfElectron.h:481
reco::GsfElectron::P4Kind
P4Kind
Definition: GsfElectron.h:767
reco::GsfElectron::setCorrectedEcalEnergyError
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:170
core
Definition: __init__.py:1
reco::GsfElectron::TrackClusterMatching
Definition: GsfElectron.h:201
reco::GsfElectron::TrackClusterMatching::eSuperClusterOverP
float eSuperClusterOverP
Definition: GsfElectron.h:203
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::GsfElectron::clone
GsfElectron * clone() const override
returns a clone of the Candidate object
Definition: GsfElectron.cc:158
reco::GsfElectron::TrackExtrapolations
Definition: GsfElectron.h:259
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
reco::GsfElectron::passPflowPreselection_
bool passPflowPreselection_
Definition: GsfElectron.h:706
p4
double p4[4]
Definition: TauolaWrapper.h:92
GsfTrack.h
reco::GsfElectron::passingCutBasedPreselection
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:686
reco::GsfElectron::ecalDriven
bool ecalDriven() const
Definition: GsfElectron.cc:168
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
reco::GsfElectron::class_
Classification class_
Definition: GsfElectron.h:743
reco::RecoCandidate
Definition: RecoCandidate.h:20
reco::GsfElectron::closestCtfTrack
virtual ClosestCtfTrack closestCtfTrack() const
Definition: GsfElectron.h:188
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
edm::Ptr< CaloCluster >
reco::Candidate
Definition: Candidate.h:27
reco::GsfElectron::electronCluster
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:227
reco::GsfElectron::Corrections::trackMomentumError
float trackMomentumError
Definition: GsfElectron.h:774
reco::GsfElectron::ConversionRejection::partner
TrackBaseRef partner
Definition: GsfElectron.h:573
reco::GsfElectron::P4_PFLOW_COMBINATION
Definition: GsfElectron.h:767
reco::GsfElectron::overlap
bool overlap(const Candidate &) const override
check overlap with another candidate
Definition: GsfElectron.cc:152
reco::GsfElectron::Corrections::fromSuperClusterP4
LorentzVector fromSuperClusterP4
Definition: GsfElectron.h:776
Exception
Definition: hltDiff.cc:245
reco::LeafCandidate::setCharge
void setCharge(Charge q) final
set electric charge
Definition: LeafCandidate.h:108
reco::GsfElectron::init
void init()
Definition: GsfElectron.cc:10
edm::RefToBase< reco::Track >
reco::GsfElectron::superCluster
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:162
reco::GsfElectron::setCorrectedEcalEnergy
void setCorrectedEcalEnergy(float newEnergy)
Definition: GsfElectron.cc:174
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
reco::GsfElectron::Corrections::isEcalEnergyCorrected
bool isEcalEnergyCorrected
Definition: GsfElectron.h:770
reco::GsfElectron::SaturationInfo
Definition: GsfElectron.h:489
reco::GsfElectron::passMvaPreslection_
bool passMvaPreslection_
Definition: GsfElectron.h:707
reco::GsfElectron::ambiguous_
bool ambiguous_
Definition: GsfElectron.h:708
reco::GsfElectron::TrackExtrapolations::positionAtVtx
math::XYZPointF positionAtVtx
Definition: GsfElectron.h:260
reco::GsfElectron::ShowerShape::hcalDepth2OverEcal
float hcalDepth2OverEcal
Definition: GsfElectron.h:374