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 315 of file GsfElectronAlgo.h.

Constructor & Destructor Documentation

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

Definition at line 67 of file GsfElectronAlgo.cc.

References computeCharge().

Referenced by GsfElectronAlgo::EventData::retreiveOriginalTrackCollections().

69  : coreRef(core),
70  gsfTrackRef(coreRef->gsfTrack()),
71  superClusterRef(coreRef->superCluster()),
72  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
73  beamSpot(bs)
74  {}
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 162 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

163  {
177  }
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 ( )

Definition at line 179 of file GsfElectronAlgo.cc.

References Scenarios_cff::scale.

Referenced by GsfElectronAlgo::createElectron().

180  {
181  double scale = superClusterRef->energy()/vtxMom.mag() ;
183  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
184  superClusterRef->energy() ) ;
185  }
T y() const
Definition: PV3DBase.h:63
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
const reco::SuperClusterRef superClusterRef
T x() const
Definition: PV3DBase.h:62
math::PtEtaPhiELorentzVectorF LorentzVector
bool GsfElectronAlgo::ElectronData::calculateTSOS ( MultiTrajectoryStateTransform const &  mtsTransform,
GsfConstraintAtVertex const &  constraintAtVtx 
)

Definition at line 128 of file GsfElectronAlgo.cc.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, GsfConstraintAtVertex::constrainAtBeamSpot(), ele_convert(), MultiTrajectoryStateTransform::extrapolatedState(), MultiTrajectoryStateTransform::innerStateOnSurface(), MultiTrajectoryStateTransform::outerStateOnSurface(), and funct::true.

Referenced by GsfElectronAlgo::completeElectrons(), and getEleBasicCluster().

129  {
130  //at innermost point
131  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
132  if (!innTSOS.isValid()) return false;
133 
134  //at vertex
135  // innermost state propagation to the beam spot position
136  GlobalPoint bsPos ;
137  ele_convert(beamSpot.position(),bsPos) ;
138  vtxTSOS = mtsTransform.extrapolatedState(innTSOS,bsPos) ;
139  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
140 
141  //at seed
142  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
143  if (!outTSOS.isValid()) return false;
144 
145  // TrajectoryStateOnSurface seedTSOS
146  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
147  GlobalPoint(superClusterRef->seed()->position().x(),
148  superClusterRef->seed()->position().y(),
149  superClusterRef->seed()->position().z()));
151 
152  // at scl
153  sclTSOS = mtsTransform.extrapolatedState(innTSOS,GlobalPoint(superClusterRef->x(),superClusterRef->y(),superClusterRef->z()));
154  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
155 
156  // constrained momentum
157  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef,beamSpot);
158 
159  return true ;
160  }
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:62
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot
void GsfElectronAlgo::ElectronData::computeCharge ( int &  charge,
reco::GsfElectron::ChargeInfo info 
)

Definition at line 78 of file GsfElectronAlgo.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), ecalDrivenElectronSeedsParameters_cff::beamSpot, ele_convert(), reco::GsfElectron::ChargeInfo::isGsfCtfConsistent, reco::GsfElectron::ChargeInfo::isGsfCtfScPixConsistent, reco::GsfElectron::ChargeInfo::isGsfScPixConsistent, normalizedPhi(), and reco::GsfElectron::ChargeInfo::scPixCharge.

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

79  {
80  // determine charge from SC
81  GlobalPoint orig, scpos ;
82  ele_convert(beamSpot.position(),orig) ;
83  ele_convert(superClusterRef->position(),scpos) ;
84  GlobalVector scvect(scpos-orig) ;
85  GlobalPoint inntkpos = innTSOS.globalPosition() ;
86  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
87  float dPhiInnEle=normalizedPhi(scvect.barePhi()-inntkvect.barePhi()) ;
88  if(dPhiInnEle>0) info.scPixCharge = -1 ;
89  else info.scPixCharge = 1 ;
90 
91  // flags
92  int chargeGsf = gsfTrackRef->charge() ;
93  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
94  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
96 
97  // default charge
99  { charge = info.scPixCharge ; }
100  else
101  { charge = ctfTrackRef->charge() ; }
102  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:9
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
T barePhi() const
Definition: PV3DBase.h:68
bool isNull() const
Checks for null.
Definition: Ref.h:248
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
const reco::SuperClusterRef superClusterRef
const Point & position() const
position
Definition: BeamSpot.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( MultiTrajectoryStateTransform const &  mtsTransform)

Definition at line 104 of file GsfElectronAlgo.cc.

References funct::abs(), ecalDrivenElectronSeedsParameters_cff::beamSpot, calculateTSOS(), particleFlow_cfi::dPhi, MultiTrajectoryStateTransform::extrapolatedState(), and MultiTrajectoryStateTransform::outerStateOnSurface().

Referenced by GsfElectronAlgo::createElectron().

105  {
106  CaloClusterPtr eleRef ;
107  TrajectoryStateOnSurface tempTSOS ;
108  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef) ;
109  float dphimin = 1.e30 ;
110  for(auto const& bc : superClusterRef->clusters())
111  {
112  GlobalPoint posclu(bc->position().x(),bc->position().y(),bc->position().z()) ;
113  tempTSOS = mtsTransform.extrapolatedState(outTSOS,posclu) ;
114  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
115  GlobalPoint extrap = tempTSOS.globalPosition() ;
116  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
117  if (std::abs(dphi)<dphimin)
118  {
119  dphimin = std::abs(dphi) ;
120  eleRef = bc;
121  eleTSOS = tempTSOS ;
122  }
123  }
124  return eleRef ;
125  }
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:62
TrajectoryStateOnSurface outTSOS
const reco::BeamSpot beamSpot

Member Data Documentation

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

Definition at line 323 of file GsfElectronAlgo.h.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 344 of file GsfElectronAlgo.h.

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

Definition at line 318 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 321 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 348 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 343 of file GsfElectronAlgo.h.

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

Definition at line 319 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 348 of file GsfElectronAlgo.h.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 338 of file GsfElectronAlgo.h.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 348 of file GsfElectronAlgo.h.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 339 of file GsfElectronAlgo.h.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 348 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 341 of file GsfElectronAlgo.h.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 348 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 342 of file GsfElectronAlgo.h.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 322 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 320 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 347 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 349 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 348 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 340 of file GsfElectronAlgo.h.

Referenced by GsfElectronAlgo::createElectron().