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

Constructor & Destructor Documentation

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

Definition at line 143 of file GsfElectronAlgo.cc.

144  : coreRef(core),
145  gsfTrackRef(coreRef->gsfTrack()),
146  superClusterRef(coreRef->superCluster()),
147  ctfTrackRef(coreRef->ctfTrack()),
148  shFracInnerHits(coreRef->ctfGsfOverlap()),
149  beamSpot(bs) {}
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot

Member Function Documentation

void GsfElectronAlgo::ElectronData::calculateMode ( )

Definition at line 240 of file GsfElectronAlgo.cc.

References constrainedVtxTSOS, eleMom, elePos, eleTSOS, innMom, innPos, innTSOS, multiTrajectoryStateMode::momentumFromModeCartesian(), outMom, outPos, outTSOS, multiTrajectoryStateMode::positionFromModeCartesian(), sclMom, sclPos, sclTSOS, seedMom, seedPos, seedTSOS, vtxMom, vtxMomWithConstraint, vtxPos, and vtxTSOS.

Referenced by GsfElectronAlgo::createElectron().

240  {
254 }
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
Candidate::LorentzVector GsfElectronAlgo::ElectronData::calculateMomentum ( )
bool GsfElectronAlgo::ElectronData::calculateTSOS ( MultiTrajectoryStateTransform const &  mtsTransform,
GsfConstraintAtVertex const &  constraintAtVtx 
)

Definition at line 200 of file GsfElectronAlgo.cc.

References beamSpot, qcdUeDQM_cfi::bsPos, GsfConstraintAtVertex::constrainAtBeamSpot(), constrainedVtxTSOS, ele_convert(), MultiTrajectoryStateTransform::extrapolatedState(), gsfTrackRef, MultiTrajectoryStateTransform::innerStateOnSurface(), innTSOS, TrajectoryStateOnSurface::isValid(), MultiTrajectoryStateTransform::outerStateOnSurface(), outTSOS, reco::BeamSpot::position(), sclTSOS, seedTSOS, superClusterRef, and vtxTSOS.

Referenced by GsfElectronAlgo::completeElectrons().

201  {
202  //at innermost point
203  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
204  if (!innTSOS.isValid())
205  return false;
206 
207  //at vertex
208  // innermost state propagation to the beam spot position
211  vtxTSOS = mtsTransform.extrapolatedState(innTSOS, bsPos);
212  if (!vtxTSOS.isValid())
213  vtxTSOS = innTSOS;
214 
215  //at seed
216  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
217  if (!outTSOS.isValid())
218  return false;
219 
220  // TrajectoryStateOnSurface seedTSOS
221  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
222  GlobalPoint(superClusterRef->seed()->position().x(),
223  superClusterRef->seed()->position().y(),
224  superClusterRef->seed()->position().z()));
225  if (!seedTSOS.isValid())
226  seedTSOS = outTSOS;
227 
228  // at scl
229  sclTSOS = mtsTransform.extrapolatedState(
231  if (!sclTSOS.isValid())
232  sclTSOS = outTSOS;
233 
234  // constrained momentum
235  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef, beamSpot);
236 
237  return true;
238 }
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
const Point & position() const
position
Definition: BeamSpot.h:59
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot
void GsfElectronAlgo::ElectronData::computeCharge ( int &  charge,
reco::GsfElectron::ChargeInfo info 
)

Definition at line 151 of file GsfElectronAlgo.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), beamSpot, ctfTrackRef, ele_convert(), TrajectoryStateOnSurface::globalPosition(), gsfTrackRef, innTSOS, reco::GsfElectron::ChargeInfo::isGsfCtfConsistent, reco::GsfElectron::ChargeInfo::isGsfCtfScPixConsistent, reco::GsfElectron::ChargeInfo::isGsfScPixConsistent, edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), normalizedPhi(), reco::BeamSpot::position(), reco::GsfElectron::ChargeInfo::scPixCharge, and superClusterRef.

Referenced by GsfElectronAlgo::createElectron().

151  {
152  // determine charge from SC
153  GlobalPoint orig, scpos;
154  ele_convert(beamSpot.position(), orig);
155  ele_convert(superClusterRef->position(), scpos);
156  GlobalVector scvect(scpos - orig);
157  GlobalPoint inntkpos = innTSOS.globalPosition();
158  GlobalVector inntkvect = GlobalVector(inntkpos - orig);
159  float dPhiInnEle = normalizedPhi(scvect.barePhi() - inntkvect.barePhi());
160  if (dPhiInnEle > 0)
161  info.scPixCharge = -1;
162  else
163  info.scPixCharge = 1;
164 
165  // flags
166  int chargeGsf = gsfTrackRef->charge();
167  info.isGsfScPixConsistent = ((chargeGsf * info.scPixCharge) > 0);
168  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull() && ((chargeGsf * ctfTrackRef->charge()) > 0));
170 
171  // default charge
172  if (info.isGsfScPixConsistent || ctfTrackRef.isNull()) {
173  charge = info.scPixCharge;
174  } else {
175  charge = ctfTrackRef->charge();
176  }
177 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
T barePhi() const
Definition: PV3DBase.h:65
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
const Point & position() const
position
Definition: BeamSpot.h:59
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( MultiTrajectoryStateTransform const &  mtsTransform)

Definition at line 179 of file GsfElectronAlgo.cc.

References funct::abs(), beamSpot, HLT_2018_cff::dPhi, eleTSOS, MultiTrajectoryStateTransform::extrapolatedState(), gsfTrackRef, MultiTrajectoryStateTransform::outerStateOnSurface(), outTSOS, reco::BeamSpot::position(), and superClusterRef.

Referenced by GsfElectronAlgo::createElectron().

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

Member Data Documentation

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

Definition at line 104 of file GsfElectronAlgo.cc.

Referenced by calculateTSOS(), computeCharge(), and getEleBasicCluster().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 123 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and calculateTSOS().

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

Definition at line 99 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 102 of file GsfElectronAlgo.cc.

Referenced by computeCharge(), and GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 122 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and getEleBasicCluster().

const reco::GsfTrackRef GsfElectronAlgo::ElectronData::gsfTrackRef
GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 117 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), calculateTSOS(), and computeCharge().

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 118 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), calculateTSOS(), and getEleBasicCluster().

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 120 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and calculateTSOS().

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 126 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 121 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and calculateTSOS().

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 103 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

const reco::SuperClusterRef GsfElectronAlgo::ElectronData::superClusterRef
GlobalVector GsfElectronAlgo::ElectronData::vtxMom
GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 128 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 127 of file GsfElectronAlgo.cc.

Referenced by calculateMode(), and GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS