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

Constructor & Destructor Documentation

◆ ElectronData()

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

Definition at line 141 of file GsfElectronAlgo.cc.

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

Member Function Documentation

◆ calculateMode()

void GsfElectronAlgo::ElectronData::calculateMode ( )

◆ calculateMomentum()

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

Definition at line 254 of file GsfElectronAlgo.cc.

254  {
255  double scale = superClusterRef->energy() / vtxMom.mag();
257  vtxMom.x() * scale, vtxMom.y() * scale, vtxMom.z() * scale, superClusterRef->energy());
258 }

References L1EGammaCrystalsEmulatorProducer_cfi::scale.

Referenced by GsfElectronAlgo::createElectron().

◆ calculateTSOS()

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

Definition at line 198 of file GsfElectronAlgo.cc.

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

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

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

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

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

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

◆ constrainedVtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 121 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 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ elePos

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 125 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 120 of file GsfElectronAlgo.cc.

◆ gsfTrackRef

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

Definition at line 98 of file GsfElectronAlgo.cc.

◆ innMom

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innPos

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 125 of file GsfElectronAlgo.cc.

◆ innTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 115 of file GsfElectronAlgo.cc.

◆ outMom

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ outPos

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 125 of file GsfElectronAlgo.cc.

◆ outTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 116 of file GsfElectronAlgo.cc.

◆ sclMom

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclPos

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 125 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 118 of file GsfElectronAlgo.cc.

◆ seedMom

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedPos

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 125 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 119 of file GsfElectronAlgo.cc.

◆ shFracInnerHits

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 101 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ superClusterRef

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

Definition at line 99 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMom

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 124 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMomWithConstraint

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxPos

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 125 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

Vector3DBase
Definition: Vector3DBase.h:8
GsfElectronAlgo::ElectronData::seedMom
GlobalVector seedMom
Definition: GsfElectronAlgo.cc:124
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:101
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:126
GsfElectronAlgo::ElectronData::sclMom
GlobalVector sclMom
Definition: GsfElectronAlgo.cc:124
GsfElectronAlgo::ElectronData::vtxPos
GlobalPoint vtxPos
Definition: GsfElectronAlgo.cc:125
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
GsfElectronAlgo::ElectronData::ctfTrackRef
reco::TrackRef ctfTrackRef
Definition: GsfElectronAlgo.cc:100
GsfElectronAlgo::ElectronData::innTSOS
TrajectoryStateOnSurface innTSOS
Definition: GsfElectronAlgo.cc:115
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:13703
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GsfElectronAlgo::ElectronData::outTSOS
TrajectoryStateOnSurface outTSOS
Definition: GsfElectronAlgo.cc:116
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
cms::cuda::bs
bs
Definition: HistoContainer.h:127
GsfElectronAlgo::ElectronData::outPos
GlobalPoint outPos
Definition: GsfElectronAlgo.cc:125
GsfElectronAlgo::ElectronData::innMom
GlobalVector innMom
Definition: GsfElectronAlgo.cc:124
GsfElectronAlgo::ElectronData::beamSpot
const reco::BeamSpot beamSpot
Definition: GsfElectronAlgo.cc:102
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:125
GsfElectronAlgo::ElectronData::constrainedVtxTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
Definition: GsfElectronAlgo.cc:121
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:124
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GsfElectronAlgo::ElectronData::eleTSOS
TrajectoryStateOnSurface eleTSOS
Definition: GsfElectronAlgo.cc:120
multiTrajectoryStateMode::positionFromModeCartesian
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
Definition: MultiTrajectoryStateMode.cc:63
GsfElectronAlgo::ElectronData::sclTSOS
TrajectoryStateOnSurface sclTSOS
Definition: GsfElectronAlgo.cc:118
GsfElectronAlgo::ElectronData::outMom
GlobalVector outMom
Definition: GsfElectronAlgo.cc:124
GsfElectronAlgo::ElectronData::seedTSOS
TrajectoryStateOnSurface seedTSOS
Definition: GsfElectronAlgo.cc:119
EleRelPointPair
Definition: ElectronUtilities.h:43
GsfElectronAlgo::ElectronData::gsfTrackRef
const reco::GsfTrackRef gsfTrackRef
Definition: GsfElectronAlgo.cc:98
GsfElectronAlgo::ElectronData::eleMom
GlobalVector eleMom
Definition: GsfElectronAlgo.cc:124
edm::Ptr< CaloCluster >
GsfElectronAlgo::ElectronData::superClusterRef
const reco::SuperClusterRef superClusterRef
Definition: GsfElectronAlgo.cc:99
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:97
GsfElectronAlgo::ElectronData::sclPos
GlobalPoint sclPos
Definition: GsfElectronAlgo.cc:125
GsfElectronAlgo::ElectronData::seedPos
GlobalPoint seedPos
Definition: GsfElectronAlgo.cc:125
GsfElectronAlgo::ElectronData::innPos
GlobalPoint innPos
Definition: GsfElectronAlgo.cc:125
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GsfElectronAlgo::ElectronData::vtxTSOS
TrajectoryStateOnSurface vtxTSOS
Definition: GsfElectronAlgo.cc:117
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54