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

Constructor & Destructor Documentation

◆ ElectronData()

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

Definition at line 157 of file GsfElectronAlgo.cc.

158  : coreRef(core),
159  gsfTrackRef(coreRef->gsfTrack()),
160  superClusterRef(coreRef->superCluster()),
161  ctfTrackRef(coreRef->ctfTrack()),
162  shFracInnerHits(coreRef->ctfGsfOverlap()),
163  beamSpot(bs) {}
Definition: __init__.py:1
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot

Member Function Documentation

◆ calculateMode()

void GsfElectronAlgo::ElectronData::calculateMode ( )

Definition at line 254 of file GsfElectronAlgo.cc.

References multiTrajectoryStateMode::momentumFromModeCartesian(), and multiTrajectoryStateMode::positionFromModeCartesian().

Referenced by GsfElectronAlgo::createElectron().

254  {
268 }
TrajectoryStateOnSurface sclTSOS
TrajectoryStateOnSurface innTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
TrajectoryStateOnSurface seedTSOS
TrajectoryStateOnSurface eleTSOS
TrajectoryStateOnSurface outTSOS
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
TrajectoryStateOnSurface vtxTSOS

◆ calculateMomentum()

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

Definition at line 270 of file GsfElectronAlgo.cc.

References L1EGammaClusterEmuProducer_cfi::scale.

Referenced by GsfElectronAlgo::createElectron().

270  {
271  double scale = superClusterRef->energy() / vtxMom.mag();
273  vtxMom.x() * scale, vtxMom.y() * scale, vtxMom.z() * scale, superClusterRef->energy());
274 }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T mag() const
Definition: PV3DBase.h:64
const reco::SuperClusterRef superClusterRef
math::PtEtaPhiELorentzVectorF LorentzVector

◆ calculateTSOS()

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

Definition at line 214 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::completeElectrons().

215  {
216  //at innermost point
217  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
218  if (!innTSOS.isValid())
219  return false;
220 
221  //at vertex
222  // innermost state propagation to the beam spot position
225  vtxTSOS = mtsTransform.extrapolatedState(innTSOS, bsPos);
226  if (!vtxTSOS.isValid())
227  vtxTSOS = innTSOS;
228 
229  //at seed
230  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
231  if (!outTSOS.isValid())
232  return false;
233 
234  // TrajectoryStateOnSurface seedTSOS
235  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
236  GlobalPoint(superClusterRef->seed()->position().x(),
237  superClusterRef->seed()->position().y(),
238  superClusterRef->seed()->position().z()));
239  if (!seedTSOS.isValid())
240  seedTSOS = outTSOS;
241 
242  // at scl
243  sclTSOS = mtsTransform.extrapolatedState(
245  if (!sclTSOS.isValid())
246  sclTSOS = outTSOS;
247 
248  // constrained momentum
249  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef, beamSpot);
250 
251  return true;
252 }
const Point & position() const
position
Definition: BeamSpot.h:59
TrajectoryStateOnSurface sclTSOS
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
TrajectoryStateOnSurface innTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
TrajectoryStateOnSurface seedTSOS
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot

◆ computeCharge()

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

Definition at line 165 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

165  {
166  // determine charge from SC
167  GlobalPoint orig, scpos;
168  ele_convert(beamSpot.position(), orig);
169  ele_convert(superClusterRef->position(), scpos);
170  GlobalVector scvect(scpos - orig);
171  GlobalPoint inntkpos = innTSOS.globalPosition();
172  GlobalVector inntkvect = GlobalVector(inntkpos - orig);
173  float dPhiInnEle = normalizedPhi(scvect.barePhi() - inntkvect.barePhi());
174  if (dPhiInnEle > 0)
175  info.scPixCharge = -1;
176  else
177  info.scPixCharge = 1;
178 
179  // flags
180  int chargeGsf = gsfTrackRef->charge();
181  info.isGsfScPixConsistent = ((chargeGsf * info.scPixCharge) > 0);
182  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull() && ((chargeGsf * ctfTrackRef->charge()) > 0));
183  info.isGsfCtfScPixConsistent = (info.isGsfScPixConsistent && info.isGsfCtfConsistent);
184 
185  // default charge
186  if (info.isGsfScPixConsistent || ctfTrackRef.isNull()) {
187  charge = info.scPixCharge;
188  } else {
189  charge = ctfTrackRef->charge();
190  }
191 }
static const TGPicture * info(bool iBackgroundIsBlack)
const Point & position() const
position
Definition: BeamSpot.h:59
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
TrajectoryStateOnSurface innTSOS
T barePhi() const
Definition: PV3DBase.h:65
GlobalPoint globalPosition() const
bool isNull() const
Checks for null.
Definition: Ref.h:235
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
const reco::SuperClusterRef superClusterRef
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot

◆ getEleBasicCluster()

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

Definition at line 193 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

193  {
194  CaloClusterPtr eleRef;
195  TrajectoryStateOnSurface tempTSOS;
196  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
197  float dphimin = 1.e30;
198  for (auto const& bc : superClusterRef->clusters()) {
199  GlobalPoint posclu(bc->position().x(), bc->position().y(), bc->position().z());
200  tempTSOS = mtsTransform.extrapolatedState(outTSOS, posclu);
201  if (!tempTSOS.isValid())
202  tempTSOS = outTSOS;
203  GlobalPoint extrap = tempTSOS.globalPosition();
204  float dphi = EleRelPointPair(posclu, extrap, beamSpot.position()).dPhi();
205  if (std::abs(dphi) < dphimin) {
206  dphimin = std::abs(dphi);
207  eleRef = bc;
208  eleTSOS = tempTSOS;
209  }
210  }
211  return eleRef;
212 }
const Point & position() const
position
Definition: BeamSpot.h:59
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const reco::GsfTrackRef gsfTrackRef
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface eleTSOS
TrajectoryStateOnSurface outTSOS
const reco::BeamSpot beamSpot

Member Data Documentation

◆ beamSpot

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

Definition at line 118 of file GsfElectronAlgo.cc.

◆ constrainedVtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

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

Referenced by GsfElectronAlgo::createElectron().

◆ elePos

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 141 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 136 of file GsfElectronAlgo.cc.

◆ gsfTrackRef

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

Definition at line 114 of file GsfElectronAlgo.cc.

◆ innMom

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 140 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innPos

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 141 of file GsfElectronAlgo.cc.

◆ innTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 131 of file GsfElectronAlgo.cc.

◆ outMom

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 140 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ outPos

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 141 of file GsfElectronAlgo.cc.

◆ outTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 132 of file GsfElectronAlgo.cc.

◆ sclMom

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 140 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclPos

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 141 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 134 of file GsfElectronAlgo.cc.

◆ seedMom

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 140 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedPos

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 141 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 135 of file GsfElectronAlgo.cc.

◆ shFracInnerHits

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ superClusterRef

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

Definition at line 115 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMom

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 140 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMomWithConstraint

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 142 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxPos

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 141 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 133 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().