CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
GsfElectronAlgo::ElectronData Struct Reference

Public Member Functions

void calculateMode (const MultiTrajectoryStateMode *mtsMode)
 
Candidate::LorentzVector calculateMomentum ()
 
bool calculateTSOS (const MultiTrajectoryStateTransform *, GsfConstraintAtVertex *)
 
void checkCtfTrack (edm::Handle< reco::TrackCollection > currentCtfTracks)
 
void computeCharge (int &charge, reco::GsfElectron::ChargeInfo &info)
 
 ElectronData (const reco::GsfElectronCoreRef &core, const reco::BeamSpot &bs)
 
CaloClusterPtr getEleBasicCluster (const MultiTrajectoryStateTransform *)
 
 ~ElectronData ()
 

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

Constructor & Destructor Documentation

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

Definition at line 312 of file GsfElectronAlgo.cc.

314  : coreRef(core),
315  gsfTrackRef(coreRef->gsfTrack()),
316  superClusterRef(coreRef->superCluster()),
317  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
318  beamSpot(bs)
319  {}
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot
GsfElectronAlgo::ElectronData::~ElectronData ( )

Definition at line 321 of file GsfElectronAlgo.cc.

322  {}

Member Function Documentation

void GsfElectronAlgo::ElectronData::calculateMode ( const MultiTrajectoryStateMode mtsMode)

Definition at line 500 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

501  {
515  }
bool positionFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalPoint &position) const
TrajectoryStateOnSurface sclTSOS
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
TrajectoryStateOnSurface innTSOS
TrajectoryStateOnSurface constrainedVtxTSOS
TrajectoryStateOnSurface seedTSOS
TrajectoryStateOnSurface eleTSOS
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
Candidate::LorentzVector GsfElectronAlgo::ElectronData::calculateMomentum ( )

Definition at line 517 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

518  {
519  double scale = superClusterRef->energy()/vtxMom.mag() ;
521  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
522  superClusterRef->energy() ) ;
523  }
T y() const
Definition: PV3DBase.h:57
T mag() const
Definition: PV3DBase.h:61
T z() const
Definition: PV3DBase.h:58
const reco::SuperClusterRef superClusterRef
T x() const
Definition: PV3DBase.h:56
math::PtEtaPhiELorentzVectorF LorentzVector
bool GsfElectronAlgo::ElectronData::calculateTSOS ( const MultiTrajectoryStateTransform mtsTransform,
GsfConstraintAtVertex constraintAtVtx 
)

Definition at line 466 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::completeElectrons().

467  {
468  //at innermost point
469  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
470  if (!innTSOS.isValid()) return false;
471 
472  //at vertex
473  // innermost state propagation to the beam spot position
474  GlobalPoint bsPos ;
475  ele_convert(beamSpot.position(),bsPos) ;
476  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
477  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
478 
479  //at seed
480  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
481  if (!outTSOS.isValid()) return false;
482 
483  // TrajectoryStateOnSurface seedTSOS
484  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
485  GlobalPoint(superClusterRef->seed()->position().x(),
486  superClusterRef->seed()->position().y(),
487  superClusterRef->seed()->position().z()));
489 
490  // at scl
492  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
493 
494  // constrained momentum
496 
497  return true ;
498  }
TrajectoryStateOnSurface constrainAtBeamSpot(const reco::GsfTrack &, const reco::BeamSpot &) const
(multi)TSOS after including the beamspot
TrajectoryStateOnSurface sclTSOS
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
TrajectoryStateOnSurface innTSOS
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface constrainedVtxTSOS
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface seedTSOS
const reco::SuperClusterRef superClusterRef
const Point & position() const
position
Definition: BeamSpot.h:63
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot
void GsfElectronAlgo::ElectronData::checkCtfTrack ( edm::Handle< reco::TrackCollection currentCtfTracks)

Definition at line 324 of file GsfElectronAlgo.cc.

References abs, TrackingRecHit::all, cmsDriverOptions::counter, dPhi(), reco::HitPattern::getHitPattern(), min, pi, reco::HitPattern::pixelHitFilter(), edm::Handle< T >::product(), mathSSE::sqrt(), reco::HitPattern::stripTIBHitFilter(), and reco::HitPattern::stripTIDHitFilter().

Referenced by GsfElectronAlgo::createElectron().

325  {
326  if (!ctfTrackRef.isNull()) return ;
327 
328  // Code below from Puneeth Kalavase
329 
330  shFracInnerHits = 0 ;
331  const TrackCollection * ctfTrackCollection = currentCtfTracks.product() ;
332 
333  // get the Hit Pattern for the gsfTrack
334  const HitPattern & gsfHitPattern = gsfTrackRef->hitPattern() ;
335 
336  unsigned int counter ;
337  TrackCollection::const_iterator ctfTkIter ;
338  for ( ctfTkIter = ctfTrackCollection->begin() , counter = 0 ;
339  ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ )
340  {
341 
342  double dEta = gsfTrackRef->eta() - ctfTkIter->eta() ;
343  double dPhi = gsfTrackRef->phi() - ctfTkIter->phi() ;
344  double pi = acos(-1.);
345  if(std::abs(dPhi) > pi) dPhi = 2*pi - std::abs(dPhi) ;
346 
347  // dont want to look at every single track in the event!
348  if (sqrt(dEta*dEta + dPhi*dPhi) > 0.3) continue ;
349 
350  unsigned int shared = 0 ;
351  int gsfHitCounter = 0 ;
352  int numGsfInnerHits = 0 ;
353  int numCtfInnerHits = 0 ;
354 
355  // get the CTF Track Hit Pattern
356  const HitPattern & ctfHitPattern = ctfTkIter->hitPattern() ;
357 
358  trackingRecHit_iterator elHitsIt ;
359  for ( elHitsIt = gsfTrackRef->recHitsBegin() ;
360  elHitsIt != gsfTrackRef->recHitsEnd() ;
361  elHitsIt++, gsfHitCounter++ )
362  {
363  if (!((**elHitsIt).isValid())) //count only valid Hits
364  { continue ; }
365 
366  // look only in the pixels/TIB/TID
367  uint32_t gsfHit = gsfHitPattern.getHitPattern(gsfHitCounter) ;
368  if (!(gsfHitPattern.pixelHitFilter(gsfHit) ||
369  gsfHitPattern.stripTIBHitFilter(gsfHit) ||
370  gsfHitPattern.stripTIDHitFilter(gsfHit) ) )
371  { continue ; }
372 
373  numGsfInnerHits++ ;
374 
375  int ctfHitsCounter = 0 ;
376  numCtfInnerHits = 0 ;
377  trackingRecHit_iterator ctfHitsIt ;
378  for ( ctfHitsIt = ctfTkIter->recHitsBegin() ;
379  ctfHitsIt != ctfTkIter->recHitsEnd() ;
380  ctfHitsIt++, ctfHitsCounter++ )
381  {
382  if(!((**ctfHitsIt).isValid())) //count only valid Hits!
383  { continue ; }
384 
385  uint32_t ctfHit = ctfHitPattern.getHitPattern(ctfHitsCounter);
386  if( !(ctfHitPattern.pixelHitFilter(ctfHit) ||
387  ctfHitPattern.stripTIBHitFilter(ctfHit) ||
388  ctfHitPattern.stripTIDHitFilter(ctfHit) ) )
389  { continue ; }
390 
391  numCtfInnerHits++ ;
392 
393  if( (**elHitsIt).sharesInput(&(**ctfHitsIt),TrackingRecHit::all) )
394  {
395  shared++ ;
396  break ;
397  }
398 
399  } //ctfHits iterator
400 
401  } //gsfHits iterator
402 
403  if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
404  { continue ; }
405 
406  if ( static_cast<float>(shared)/min(numGsfInnerHits,numCtfInnerHits) > shFracInnerHits )
407  {
408  shFracInnerHits = static_cast<float>(shared)/min(numGsfInnerHits, numCtfInnerHits);
409  ctfTrackRef = TrackRef(currentCtfTracks,counter);
410  }
411  } //ctfTrack iterator
412  }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
#define abs(x)
Definition: mlp_lapack.h:159
bool stripTIBHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:170
#define min(a, b)
Definition: mlp_lapack.h:161
bool isNull() const
Checks for null.
Definition: Ref.h:246
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T sqrt(T t)
Definition: SSEVec.h:28
bool pixelHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:138
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
const reco::GsfTrackRef gsfTrackRef
T const * product() const
Definition: Handle.h:74
double pi
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:86
bool stripTIDHitFilter(uint32_t pattern) const
Definition: HitPattern.cc:177
void GsfElectronAlgo::ElectronData::computeCharge ( int &  charge,
reco::GsfElectron::ChargeInfo info 
)

Definition at line 415 of file GsfElectronAlgo.cc.

References ele_convert(), reco::GsfElectron::ChargeInfo::isGsfCtfConsistent, reco::GsfElectron::ChargeInfo::isGsfCtfScPixConsistent, reco::GsfElectron::ChargeInfo::isGsfScPixConsistent, normalized_phi(), PV3DBase< T, PVType, FrameType >::phi(), and reco::GsfElectron::ChargeInfo::scPixCharge.

Referenced by GsfElectronAlgo::createElectron().

416  {
417  // determine charge from SC
418  GlobalPoint orig, scpos ;
419  ele_convert(beamSpot.position(),orig) ;
420  ele_convert(superClusterRef->position(),scpos) ;
421  GlobalVector scvect(scpos-orig) ;
422  GlobalPoint inntkpos = innTSOS.globalPosition() ;
423  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
424  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
425  if(dPhiInnEle>0) info.scPixCharge = -1 ;
426  else info.scPixCharge = 1 ;
427 
428  // flags
429  int chargeGsf = gsfTrackRef->charge() ;
430  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
431  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
433 
434  // default charge
436  { charge = info.scPixCharge ; }
437  else
438  { charge = ctfTrackRef->charge() ; }
439  }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
double charge(const std::vector< uint8_t > &Ampls)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:249
bool isNull() const
Checks for null.
Definition: Ref.h:246
RealType normalized_phi(RealType phi)
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
const reco::SuperClusterRef superClusterRef
const Point & position() const
position
Definition: BeamSpot.h:63
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( const MultiTrajectoryStateTransform mtsTransform)

Definition at line 442 of file GsfElectronAlgo.cc.

References abs, dPhi(), MultiTrajectoryStateTransform::extrapolatedState(), and MultiTrajectoryStateTransform::outerStateOnSurface().

Referenced by GsfElectronAlgo::createElectron().

443  {
444  CaloClusterPtr eleRef ;
445  TrajectoryStateOnSurface tempTSOS ;
447  float dphimin = 1.e30 ;
448  for (CaloCluster_iterator bc=superClusterRef->clustersBegin(); bc!=superClusterRef->clustersEnd(); bc++)
449  {
450  GlobalPoint posclu((*bc)->position().x(),(*bc)->position().y(),(*bc)->position().z()) ;
451  tempTSOS = mtsTransform->extrapolatedState(outTSOS,posclu) ;
452  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
453  GlobalPoint extrap = tempTSOS.globalPosition() ;
454  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
455  if (std::abs(dphi)<dphimin)
456  {
457  dphimin = std::abs(dphi) ;
458  eleRef = (*bc);
459  eleTSOS = tempTSOS ;
460  }
461  }
462  return eleRef ;
463  }
#define abs(x)
Definition: mlp_lapack.h:159
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
const reco::GsfTrackRef gsfTrackRef
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface eleTSOS
const Point & position() const
position
Definition: BeamSpot.h:63
TrajectoryStateOnSurface outTSOS
const reco::BeamSpot beamSpot

Member Data Documentation

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

Definition at line 280 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 303 of file GsfElectronAlgo.cc.

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

Definition at line 275 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 278 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 307 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 302 of file GsfElectronAlgo.cc.

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

Definition at line 276 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 307 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 297 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 307 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 298 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 307 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 300 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 307 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 301 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 279 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 277 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 307 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 299 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().