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 93 of file GsfElectronAlgo.cc.

Constructor & Destructor Documentation

◆ ElectronData()

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

Definition at line 139 of file GsfElectronAlgo.cc.

140  : coreRef(core),
141  gsfTrackRef(coreRef->gsfTrack()),
142  superClusterRef(coreRef->superCluster()),
143  ctfTrackRef(coreRef->ctfTrack()),
144  shFracInnerHits(coreRef->ctfGsfOverlap()),
145  beamSpot(bs) {}

Member Function Documentation

◆ calculateMode()

void GsfElectronAlgo::ElectronData::calculateMode ( )

◆ calculateMomentum()

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

Definition at line 252 of file GsfElectronAlgo.cc.

252  {
253  double scale = superClusterRef->energy() / vtxMom.mag();
255  vtxMom.x() * scale, vtxMom.y() * scale, vtxMom.z() * scale, superClusterRef->energy());
256 }

References L1EGammaCrystalsEmulatorProducer_cfi::scale.

Referenced by GsfElectronAlgo::createElectron().

◆ calculateTSOS()

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

Definition at line 196 of file GsfElectronAlgo.cc.

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

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 147 of file GsfElectronAlgo.cc.

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

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 175 of file GsfElectronAlgo.cc.

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

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

Referenced by GsfElectronAlgo::createElectron().

Member Data Documentation

◆ beamSpot

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

Definition at line 100 of file GsfElectronAlgo.cc.

◆ constrainedVtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 119 of file GsfElectronAlgo.cc.

◆ coreRef

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

◆ ctfTrackRef

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

◆ eleMom

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ elePos

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 123 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 118 of file GsfElectronAlgo.cc.

◆ gsfTrackRef

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

Definition at line 96 of file GsfElectronAlgo.cc.

◆ innMom

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innPos

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 123 of file GsfElectronAlgo.cc.

◆ innTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 113 of file GsfElectronAlgo.cc.

◆ outMom

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ outPos

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 123 of file GsfElectronAlgo.cc.

◆ outTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 114 of file GsfElectronAlgo.cc.

◆ sclMom

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclPos

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 123 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 116 of file GsfElectronAlgo.cc.

◆ seedMom

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedPos

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 123 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 117 of file GsfElectronAlgo.cc.

◆ shFracInnerHits

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 99 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ superClusterRef

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

Definition at line 97 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMom

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMomWithConstraint

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxPos

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 123 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 115 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

Vector3DBase
Definition: Vector3DBase.h:8
GsfElectronAlgo::ElectronData::seedMom
GlobalVector seedMom
Definition: GsfElectronAlgo.cc:122
ele_convert
void ele_convert(const Type1 &obj1, Type2 &obj2)
Definition: ElectronUtilities.h:16
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GsfElectronAlgo::ElectronData::shFracInnerHits
float shFracInnerHits
Definition: GsfElectronAlgo.cc:99
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:124
GsfElectronAlgo::ElectronData::sclMom
GlobalVector sclMom
Definition: GsfElectronAlgo.cc:122
GsfElectronAlgo::ElectronData::vtxPos
GlobalPoint vtxPos
Definition: GsfElectronAlgo.cc:123
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
GsfElectronAlgo::ElectronData::ctfTrackRef
reco::TrackRef ctfTrackRef
Definition: GsfElectronAlgo.cc:98
GsfElectronAlgo::ElectronData::innTSOS
TrajectoryStateOnSurface innTSOS
Definition: GsfElectronAlgo.cc:113
multiTrajectoryStateMode::momentumFromModeCartesian
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
Definition: MultiTrajectoryStateMode.cc:16
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13702
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GsfElectronAlgo::ElectronData::outTSOS
TrajectoryStateOnSurface outTSOS
Definition: GsfElectronAlgo.cc:114
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
cms::cuda::bs
bs
Definition: HistoContainer.h:127
GsfElectronAlgo::ElectronData::outPos
GlobalPoint outPos
Definition: GsfElectronAlgo.cc:123
GsfElectronAlgo::ElectronData::innMom
GlobalVector innMom
Definition: GsfElectronAlgo.cc:122
GsfElectronAlgo::ElectronData::beamSpot
const reco::BeamSpot beamSpot
Definition: GsfElectronAlgo.cc:100
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:123
GsfElectronAlgo::ElectronData::constrainedVtxTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
Definition: GsfElectronAlgo.cc:119
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
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:122
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GsfElectronAlgo::ElectronData::eleTSOS
TrajectoryStateOnSurface eleTSOS
Definition: GsfElectronAlgo.cc:118
multiTrajectoryStateMode::positionFromModeCartesian
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
Definition: MultiTrajectoryStateMode.cc:63
GsfElectronAlgo::ElectronData::sclTSOS
TrajectoryStateOnSurface sclTSOS
Definition: GsfElectronAlgo.cc:116
GsfElectronAlgo::ElectronData::outMom
GlobalVector outMom
Definition: GsfElectronAlgo.cc:122
GsfElectronAlgo::ElectronData::seedTSOS
TrajectoryStateOnSurface seedTSOS
Definition: GsfElectronAlgo.cc:117
EleRelPointPair
Definition: ElectronUtilities.h:43
GsfElectronAlgo::ElectronData::gsfTrackRef
const reco::GsfTrackRef gsfTrackRef
Definition: GsfElectronAlgo.cc:96
GsfElectronAlgo::ElectronData::eleMom
GlobalVector eleMom
Definition: GsfElectronAlgo.cc:122
edm::Ptr< CaloCluster >
GsfElectronAlgo::ElectronData::superClusterRef
const reco::SuperClusterRef superClusterRef
Definition: GsfElectronAlgo.cc:97
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:95
GsfElectronAlgo::ElectronData::sclPos
GlobalPoint sclPos
Definition: GsfElectronAlgo.cc:123
GsfElectronAlgo::ElectronData::seedPos
GlobalPoint seedPos
Definition: GsfElectronAlgo.cc:123
GsfElectronAlgo::ElectronData::innPos
GlobalPoint innPos
Definition: GsfElectronAlgo.cc:123
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GsfElectronAlgo::ElectronData::vtxTSOS
TrajectoryStateOnSurface vtxTSOS
Definition: GsfElectronAlgo.cc:115
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54