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

Constructor & Destructor Documentation

◆ ElectronData()

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

Definition at line 160 of file GsfElectronAlgo.cc.

161  : coreRef(core),
162  gsfTrackRef(coreRef->gsfTrack()),
163  superClusterRef(coreRef->superCluster()),
164  ctfTrackRef(coreRef->ctfTrack()),
165  shFracInnerHits(coreRef->ctfGsfOverlap()),
166  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 257 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

257  {
271 }
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 273 of file GsfElectronAlgo.cc.

References pfClustersFromCombinedCaloHF_cfi::scale.

Referenced by GsfElectronAlgo::createElectron().

273  {
274  double scale = superClusterRef->energy() / vtxMom.mag();
276  vtxMom.x() * scale, vtxMom.y() * scale, vtxMom.z() * scale, superClusterRef->energy());
277 }
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 217 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().

218  {
219  //at innermost point
220  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
221  if (!innTSOS.isValid())
222  return false;
223 
224  //at vertex
225  // innermost state propagation to the beam spot position
228  vtxTSOS = mtsTransform.extrapolatedState(innTSOS, bsPos);
229  if (!vtxTSOS.isValid())
230  vtxTSOS = innTSOS;
231 
232  //at seed
233  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
234  if (!outTSOS.isValid())
235  return false;
236 
237  // TrajectoryStateOnSurface seedTSOS
238  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
239  GlobalPoint(superClusterRef->seed()->position().x(),
240  superClusterRef->seed()->position().y(),
241  superClusterRef->seed()->position().z()));
242  if (!seedTSOS.isValid())
243  seedTSOS = outTSOS;
244 
245  // at scl
246  sclTSOS = mtsTransform.extrapolatedState(
248  if (!sclTSOS.isValid())
249  sclTSOS = outTSOS;
250 
251  // constrained momentum
252  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef, beamSpot);
253 
254  return true;
255 }
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 168 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().

168  {
169  // determine charge from SC
170  GlobalPoint orig, scpos;
171  ele_convert(beamSpot.position(), orig);
172  ele_convert(superClusterRef->position(), scpos);
173  GlobalVector scvect(scpos - orig);
174  GlobalPoint inntkpos = innTSOS.globalPosition();
175  GlobalVector inntkvect = GlobalVector(inntkpos - orig);
176  float dPhiInnEle = normalizedPhi(scvect.barePhi() - inntkvect.barePhi());
177  if (dPhiInnEle > 0)
178  info.scPixCharge = -1;
179  else
180  info.scPixCharge = 1;
181 
182  // flags
183  int chargeGsf = gsfTrackRef->charge();
184  info.isGsfScPixConsistent = ((chargeGsf * info.scPixCharge) > 0);
185  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull() && ((chargeGsf * ctfTrackRef->charge()) > 0));
186  info.isGsfCtfScPixConsistent = (info.isGsfScPixConsistent && info.isGsfCtfConsistent);
187 
188  // default charge
189  if (info.isGsfScPixConsistent || ctfTrackRef.isNull()) {
190  charge = info.scPixCharge;
191  } else {
192  charge = ctfTrackRef->charge();
193  }
194 }
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 196 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

196  {
197  CaloClusterPtr eleRef;
198  TrajectoryStateOnSurface tempTSOS;
199  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
200  float dphimin = 1.e30;
201  for (auto const& bc : superClusterRef->clusters()) {
202  GlobalPoint posclu(bc->position().x(), bc->position().y(), bc->position().z());
203  tempTSOS = mtsTransform.extrapolatedState(outTSOS, posclu);
204  if (!tempTSOS.isValid())
205  tempTSOS = outTSOS;
206  GlobalPoint extrap = tempTSOS.globalPosition();
207  float dphi = EleRelPointPair(posclu, extrap, beamSpot.position()).dPhi();
208  if (std::abs(dphi) < dphimin) {
209  dphimin = std::abs(dphi);
210  eleRef = bc;
211  eleTSOS = tempTSOS;
212  }
213  }
214  return eleRef;
215 }
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 121 of file GsfElectronAlgo.cc.

◆ constrainedVtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

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

Referenced by GsfElectronAlgo::createElectron().

◆ elePos

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 144 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ eleTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 139 of file GsfElectronAlgo.cc.

◆ gsfTrackRef

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

Definition at line 117 of file GsfElectronAlgo.cc.

◆ innMom

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 143 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ innPos

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 144 of file GsfElectronAlgo.cc.

◆ innTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 134 of file GsfElectronAlgo.cc.

◆ outMom

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 143 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ outPos

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 144 of file GsfElectronAlgo.cc.

◆ outTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 135 of file GsfElectronAlgo.cc.

◆ sclMom

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 143 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclPos

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 144 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ sclTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 137 of file GsfElectronAlgo.cc.

◆ seedMom

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 143 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedPos

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 144 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ seedTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 138 of file GsfElectronAlgo.cc.

◆ shFracInnerHits

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 120 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ superClusterRef

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

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMom

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 143 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxMomWithConstraint

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 145 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxPos

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 144 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

◆ vtxTSOS

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 136 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().