CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
GsfElectronAlgo::ElectronData Struct Reference

Public Member Functions

void calculateMode ()
 
reco::Candidate::LorentzVector calculateMomentum ()
 
bool calculateTSOS (MultiTrajectoryStateTransform const &, GsfConstraintAtVertex const &)
 
void computeCharge (int &charge, reco::GsfElectron::ChargeInfo &info)
 
 ElectronData (const reco::GsfElectronCoreRef &core, const reco::BeamSpot &bs)
 
reco::CaloClusterPtr getEleBasicCluster (MultiTrajectoryStateTransform const &)
 

Public Attributes

const reco::BeamSpot beamSpot
 
TrajectoryStateOnSurface constrainedVtxTSOS
 
const reco::GsfElectronCoreRef coreRef
 
reco::TrackRef ctfTrackRef
 
GlobalVector eleMom
 
GlobalPoint elePos
 
TrajectoryStateOnSurface eleTSOS
 
const reco::GsfTrackRef gsfTrackRef
 
GlobalVector innMom
 
GlobalPoint innPos
 
TrajectoryStateOnSurface innTSOS
 
GlobalVector outMom
 
GlobalPoint outPos
 
TrajectoryStateOnSurface outTSOS
 
GlobalVector sclMom
 
GlobalPoint sclPos
 
TrajectoryStateOnSurface sclTSOS
 
GlobalVector seedMom
 
GlobalPoint seedPos
 
TrajectoryStateOnSurface seedTSOS
 
float shFracInnerHits
 
const reco::SuperClusterRef superClusterRef
 
GlobalVector vtxMom
 
GlobalVector vtxMomWithConstraint
 
GlobalPoint vtxPos
 
TrajectoryStateOnSurface vtxTSOS
 

Detailed Description

Definition at line 88 of file GsfElectronAlgo.cc.

Constructor & Destructor Documentation

◆ ElectronData()

GsfElectronAlgo::ElectronData::ElectronData ( const reco::GsfElectronCoreRef core,
const reco::BeamSpot bs 
)

Definition at line 134 of file GsfElectronAlgo.cc.

135  : coreRef(core),
136  gsfTrackRef(coreRef->gsfTrack()),
137  superClusterRef(coreRef->superCluster()),
138  ctfTrackRef(coreRef->ctfTrack()),
139  shFracInnerHits(coreRef->ctfGsfOverlap()),
140  beamSpot(bs) {}

Member Function Documentation

◆ calculateMode()

void GsfElectronAlgo::ElectronData::calculateMode ( )

◆ calculateMomentum()

Candidate::LorentzVector GsfElectronAlgo::ElectronData::calculateMomentum ( )

Definition at line 247 of file GsfElectronAlgo.cc.

247  {
248  double scale = superClusterRef->energy() / vtxMom.mag();
250  vtxMom.x() * scale, vtxMom.y() * scale, vtxMom.z() * scale, superClusterRef->energy());
251 }

References Scenarios_cff::scale.

Referenced by GsfElectronAlgo::createElectron().

◆ calculateTSOS()

bool GsfElectronAlgo::ElectronData::calculateTSOS ( MultiTrajectoryStateTransform const &  mtsTransform,
GsfConstraintAtVertex const &  constraintAtVtx 
)

Definition at line 191 of file GsfElectronAlgo.cc.

192  {
193  //at innermost point
194  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
195  if (!innTSOS.isValid())
196  return false;
197 
198  //at vertex
199  // innermost state propagation to the beam spot position
202  vtxTSOS = mtsTransform.extrapolatedState(innTSOS, bsPos);
203  if (!vtxTSOS.isValid())
204  vtxTSOS = innTSOS;
205 
206  //at seed
207  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
208  if (!outTSOS.isValid())
209  return false;
210 
211  // TrajectoryStateOnSurface seedTSOS
212  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
213  GlobalPoint(superClusterRef->seed()->position().x(),
214  superClusterRef->seed()->position().y(),
215  superClusterRef->seed()->position().z()));
216  if (!seedTSOS.isValid())
217  seedTSOS = outTSOS;
218 
219  // at scl
220  sclTSOS = mtsTransform.extrapolatedState(
222  if (!sclTSOS.isValid())
223  sclTSOS = outTSOS;
224 
225  // constrained momentum
226  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef, beamSpot);
227 
228  return true;
229 }

References pwdgSkimBPark_cfi::beamSpot, qcdUeDQM_cfi::bsPos, GsfConstraintAtVertex::constrainAtBeamSpot(), ele_convert(), MultiTrajectoryStateTransform::extrapolatedState(), MultiTrajectoryStateTransform::innerStateOnSurface(), and MultiTrajectoryStateTransform::outerStateOnSurface().

Referenced by GsfElectronAlgo::completeElectrons().

◆ computeCharge()

void GsfElectronAlgo::ElectronData::computeCharge ( int &  charge,
reco::GsfElectron::ChargeInfo info 
)

Definition at line 142 of file GsfElectronAlgo.cc.

142  {
143  // determine charge from SC
144  GlobalPoint orig, scpos;
145  ele_convert(beamSpot.position(), orig);
146  ele_convert(superClusterRef->position(), scpos);
147  GlobalVector scvect(scpos - orig);
148  GlobalPoint inntkpos = innTSOS.globalPosition();
149  GlobalVector inntkvect = GlobalVector(inntkpos - orig);
150  float dPhiInnEle = normalizedPhi(scvect.barePhi() - inntkvect.barePhi());
151  if (dPhiInnEle > 0)
152  info.scPixCharge = -1;
153  else
154  info.scPixCharge = 1;
155 
156  // flags
157  int chargeGsf = gsfTrackRef->charge();
158  info.isGsfScPixConsistent = ((chargeGsf * info.scPixCharge) > 0);
159  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull() && ((chargeGsf * ctfTrackRef->charge()) > 0));
160  info.isGsfCtfScPixConsistent = (info.isGsfScPixConsistent && info.isGsfCtfConsistent);
161 
162  // default charge
163  if (info.isGsfScPixConsistent || ctfTrackRef.isNull()) {
164  charge = info.scPixCharge;
165  } else {
166  charge = ctfTrackRef->charge();
167  }
168 }

References PV3DBase< T, PVType, FrameType >::barePhi(), pwdgSkimBPark_cfi::beamSpot, ALCARECOTkAlJpsiMuMu_cff::charge, ele_convert(), info(), and normalizedPhi().

Referenced by GsfElectronAlgo::createElectron().

◆ getEleBasicCluster()

CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( MultiTrajectoryStateTransform const &  mtsTransform)

Definition at line 170 of file GsfElectronAlgo.cc.

170  {
171  CaloClusterPtr eleRef;
172  TrajectoryStateOnSurface tempTSOS;
173  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
174  float dphimin = 1.e30;
175  for (auto const& bc : superClusterRef->clusters()) {
176  GlobalPoint posclu(bc->position().x(), bc->position().y(), bc->position().z());
177  tempTSOS = mtsTransform.extrapolatedState(outTSOS, posclu);
178  if (!tempTSOS.isValid())
179  tempTSOS = outTSOS;
180  GlobalPoint extrap = tempTSOS.globalPosition();
181  float dphi = EleRelPointPair(posclu, extrap, beamSpot.position()).dPhi();
182  if (std::abs(dphi) < dphimin) {
183  dphimin = std::abs(dphi);
184  eleRef = bc;
185  eleTSOS = tempTSOS;
186  }
187  }
188  return eleRef;
189 }

References funct::abs(), pwdgSkimBPark_cfi::beamSpot, HLT_2018_cff::dPhi, MultiTrajectoryStateTransform::extrapolatedState(), and MultiTrajectoryStateTransform::outerStateOnSurface().

Referenced by GsfElectronAlgo::createElectron().

Member Data Documentation

◆ beamSpot

const reco::BeamSpot GsfElectronAlgo::ElectronData::beamSpot

Definition at line 95 of file GsfElectronAlgo.cc.

◆ constrainedVtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 114 of file GsfElectronAlgo.cc.

◆ coreRef

const reco::GsfElectronCoreRef GsfElectronAlgo::ElectronData::coreRef

Definition at line 90 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ ctfTrackRef

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 93 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleMom

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ elePos

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 113 of file GsfElectronAlgo.cc.

◆ gsfTrackRef

const reco::GsfTrackRef GsfElectronAlgo::ElectronData::gsfTrackRef

Definition at line 91 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innMom

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innPos

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 118 of file GsfElectronAlgo.cc.

◆ innTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 108 of file GsfElectronAlgo.cc.

◆ outMom

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ outPos

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 118 of file GsfElectronAlgo.cc.

◆ outTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 109 of file GsfElectronAlgo.cc.

◆ sclMom

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclPos

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 111 of file GsfElectronAlgo.cc.

◆ seedMom

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedPos

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 112 of file GsfElectronAlgo.cc.

◆ shFracInnerHits

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 94 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ superClusterRef

const reco::SuperClusterRef GsfElectronAlgo::ElectronData::superClusterRef

Definition at line 92 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMom

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMomWithConstraint

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 119 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxPos

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 110 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

Vector3DBase
Definition: Vector3DBase.h:8
GsfElectronAlgo::ElectronData::seedMom
GlobalVector seedMom
Definition: GsfElectronAlgo.cc:117
ele_convert
void ele_convert(const Type1 &obj1, Type2 &obj2)
Definition: ElectronUtilities.h:16
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GsfElectronAlgo::ElectronData::shFracInnerHits
float shFracInnerHits
Definition: GsfElectronAlgo.cc:94
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
GsfElectronAlgo::ElectronData::vtxMomWithConstraint
GlobalVector vtxMomWithConstraint
Definition: GsfElectronAlgo.cc:119
GsfElectronAlgo::ElectronData::sclMom
GlobalVector sclMom
Definition: GsfElectronAlgo.cc:117
GsfElectronAlgo::ElectronData::vtxPos
GlobalPoint vtxPos
Definition: GsfElectronAlgo.cc:118
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
GsfElectronAlgo::ElectronData::ctfTrackRef
reco::TrackRef ctfTrackRef
Definition: GsfElectronAlgo.cc:93
GsfElectronAlgo::ElectronData::innTSOS
TrajectoryStateOnSurface innTSOS
Definition: GsfElectronAlgo.cc:108
multiTrajectoryStateMode::momentumFromModeCartesian
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
Definition: MultiTrajectoryStateMode.cc:16
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GsfElectronAlgo::ElectronData::outTSOS
TrajectoryStateOnSurface outTSOS
Definition: GsfElectronAlgo.cc:109
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
cms::cuda::bs
bs
Definition: HistoContainer.h:127
GsfElectronAlgo::ElectronData::outPos
GlobalPoint outPos
Definition: GsfElectronAlgo.cc:118
GsfElectronAlgo::ElectronData::innMom
GlobalVector innMom
Definition: GsfElectronAlgo.cc:117
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
GsfElectronAlgo::ElectronData::beamSpot
const reco::BeamSpot beamSpot
Definition: GsfElectronAlgo.cc:95
normalizedPhi
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
Point3DBase< float, GlobalTag >
qcdUeDQM_cfi.bsPos
bsPos
Definition: qcdUeDQM_cfi.py:39
GsfElectronAlgo::ElectronData::elePos
GlobalPoint elePos
Definition: GsfElectronAlgo.cc:118
GsfElectronAlgo::ElectronData::constrainedVtxTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
Definition: GsfElectronAlgo.cc:114
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
core
Definition: __init__.py:1
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
GsfElectronAlgo::ElectronData::vtxMom
GlobalVector vtxMom
Definition: GsfElectronAlgo.cc:117
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GsfElectronAlgo::ElectronData::eleTSOS
TrajectoryStateOnSurface eleTSOS
Definition: GsfElectronAlgo.cc:113
multiTrajectoryStateMode::positionFromModeCartesian
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
Definition: MultiTrajectoryStateMode.cc:63
GsfElectronAlgo::ElectronData::sclTSOS
TrajectoryStateOnSurface sclTSOS
Definition: GsfElectronAlgo.cc:111
GsfElectronAlgo::ElectronData::outMom
GlobalVector outMom
Definition: GsfElectronAlgo.cc:117
GsfElectronAlgo::ElectronData::seedTSOS
TrajectoryStateOnSurface seedTSOS
Definition: GsfElectronAlgo.cc:112
EleRelPointPair
Definition: ElectronUtilities.h:43
GsfElectronAlgo::ElectronData::gsfTrackRef
const reco::GsfTrackRef gsfTrackRef
Definition: GsfElectronAlgo.cc:91
GsfElectronAlgo::ElectronData::eleMom
GlobalVector eleMom
Definition: GsfElectronAlgo.cc:117
edm::Ptr< CaloCluster >
GsfElectronAlgo::ElectronData::superClusterRef
const reco::SuperClusterRef superClusterRef
Definition: GsfElectronAlgo.cc:92
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
GsfElectronAlgo::ElectronData::coreRef
const reco::GsfElectronCoreRef coreRef
Definition: GsfElectronAlgo.cc:90
GsfElectronAlgo::ElectronData::sclPos
GlobalPoint sclPos
Definition: GsfElectronAlgo.cc:118
GsfElectronAlgo::ElectronData::seedPos
GlobalPoint seedPos
Definition: GsfElectronAlgo.cc:118
GsfElectronAlgo::ElectronData::innPos
GlobalPoint innPos
Definition: GsfElectronAlgo.cc:118
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GsfElectronAlgo::ElectronData::vtxTSOS
TrajectoryStateOnSurface vtxTSOS
Definition: GsfElectronAlgo.cc:110
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54