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

Constructor & Destructor Documentation

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

Definition at line 326 of file GsfElectronAlgo.cc.

328  : coreRef(core),
329  gsfTrackRef(coreRef->gsfTrack()),
330  superClusterRef(coreRef->superCluster()),
331  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
332  beamSpot(bs)
333  {}
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot
GsfElectronAlgo::ElectronData::~ElectronData ( )

Definition at line 335 of file GsfElectronAlgo.cc.

336  {}

Member Function Documentation

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

Definition at line 516 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

517  {
531  }
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 533 of file GsfElectronAlgo.cc.

References pileupReCalc_HLTpaths::scale.

Referenced by GsfElectronAlgo::createElectron().

534  {
535  double scale = superClusterRef->energy()/vtxMom.mag() ;
537  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
538  superClusterRef->energy() ) ;
539  }
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 ( const MultiTrajectoryStateTransform mtsTransform,
GsfConstraintAtVertex constraintAtVtx 
)

Definition at line 482 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::completeElectrons().

483  {
484  //at innermost point
485  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
486  if (!innTSOS.isValid()) return false;
487 
488  //at vertex
489  // innermost state propagation to the beam spot position
490  GlobalPoint bsPos ;
491  ele_convert(beamSpot.position(),bsPos) ;
492  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
493  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
494 
495  //at seed
496  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
497  if (!outTSOS.isValid()) return false;
498 
499  // TrajectoryStateOnSurface seedTSOS
500  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
501  GlobalPoint(superClusterRef->seed()->position().x(),
502  superClusterRef->seed()->position().y(),
503  superClusterRef->seed()->position().z()));
505 
506  // at scl
508  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
509 
510  // constrained momentum
512 
513  return true ;
514  }
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:62
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot
void GsfElectronAlgo::ElectronData::checkCtfTrack ( edm::Handle< reco::TrackCollection currentCtfTracks)

Definition at line 338 of file GsfElectronAlgo.cc.

References funct::abs(), TrackingRecHit::all, counter, dPhi(), reco::HitPattern::getHitPattern(), reco::HitPattern::hitPattern, bookConverter::min, pi, edm::Handle< T >::product(), and mathSSE::sqrt().

Referenced by GsfElectronAlgo::createElectron().

339 {
340  if (!ctfTrackRef.isNull()) return ;
341 
342  // Code below from Puneeth Kalavase
343 
344  shFracInnerHits = 0 ;
345  const TrackCollection * ctfTrackCollection = currentCtfTracks.product() ;
346 
347  // get the Hit Pattern for the gsfTrack
348  const HitPattern &gsfHitPattern = gsfTrackRef->hitPattern() ;
349 
350  unsigned int counter ;
351  TrackCollection::const_iterator ctfTkIter ;
352  for (ctfTkIter = ctfTrackCollection->begin(), counter = 0;
353  ctfTkIter != ctfTrackCollection->end(); ctfTkIter++, counter++)
354  {
355  double dEta = gsfTrackRef->eta() - ctfTkIter->eta() ;
356  double dPhi = gsfTrackRef->phi() - ctfTkIter->phi() ;
357  double pi = acos(-1.);
358  if(std::abs(dPhi) > pi) dPhi = 2*pi - std::abs(dPhi) ;
359 
360  // dont want to look at every single track in the event!
361  if (sqrt(dEta*dEta + dPhi*dPhi) > 0.3) continue ;
362 
363  unsigned int shared = 0 ;
364  int gsfHitCounter = 0 ;
365  int numGsfInnerHits = 0 ;
366  int numCtfInnerHits = 0 ;
367 
368  // get the CTF Track Hit Pattern
369  const HitPattern &ctfHitPattern = ctfTkIter->hitPattern() ;
370 
371  trackingRecHit_iterator elHitsIt;
372  for (elHitsIt = gsfTrackRef->recHitsBegin();
373  elHitsIt != gsfTrackRef->recHitsEnd();
374  elHitsIt++, gsfHitCounter++)
375  {
376  if (!((**elHitsIt).isValid())) //count only valid Hits
377  { continue ; }
378 
379  // look only in the pixels/TIB/TID
380  uint32_t gsfHit = gsfHitPattern.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter) ;
381  if (!(HitPattern::pixelHitFilter(gsfHit)
382  || HitPattern::stripTIBHitFilter(gsfHit)
383  || HitPattern::stripTIDHitFilter(gsfHit))){
384  continue;
385  }
386 
387  numGsfInnerHits++ ;
388 
389  int ctfHitsCounter = 0 ;
390  numCtfInnerHits = 0 ;
391  trackingRecHit_iterator ctfHitsIt ;
392  for (ctfHitsIt = ctfTkIter->recHitsBegin();
393  ctfHitsIt != ctfTkIter->recHitsEnd();
394  ctfHitsIt++, ctfHitsCounter++ )
395  {
396  if(!((**ctfHitsIt).isValid())) //count only valid Hits!
397  { continue; }
398 
399  uint32_t ctfHit = ctfHitPattern.getHitPattern(HitPattern::TRACK_HITS, ctfHitsCounter);
400  if(!(HitPattern::pixelHitFilter(ctfHit)
401  || HitPattern::stripTIBHitFilter(ctfHit)
402  || HitPattern::stripTIDHitFilter(ctfHit)))
403  {
404  continue;
405  }
406 
407  numCtfInnerHits++ ;
408 
409  if((**elHitsIt).sharesInput(&(**ctfHitsIt), TrackingRecHit::all))
410  {
411  shared++ ;
412  break ;
413  }
414 
415  } //ctfHits iterator
416 
417  } //gsfHits iterator
418 
419  if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
420  { continue ; }
421 
422  if ( static_cast<float>(shared)/min(numGsfInnerHits,numCtfInnerHits) > shFracInnerHits )
423  {
424  shFracInnerHits = static_cast<float>(shared)/min(numGsfInnerHits, numCtfInnerHits);
425  ctfTrackRef = TrackRef(currentCtfTracks,counter);
426  }
427  } //ctfTrack iterator
428 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
const Double_t pi
uint16_t hitPattern[ARRAY_LENGTH]
Definition: HitPattern.h:410
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isNull() const
Checks for null.
Definition: Ref.h:247
T const * product() const
Definition: Handle.h:81
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:19
const reco::GsfTrackRef gsfTrackRef
static std::atomic< unsigned int > counter
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:448
void GsfElectronAlgo::ElectronData::computeCharge ( int &  charge,
reco::GsfElectron::ChargeInfo info 
)

Definition at line 431 of file GsfElectronAlgo.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, 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().

432  {
433  // determine charge from SC
434  GlobalPoint orig, scpos ;
435  ele_convert(beamSpot.position(),orig) ;
436  ele_convert(superClusterRef->position(),scpos) ;
437  GlobalVector scvect(scpos-orig) ;
438  GlobalPoint inntkpos = innTSOS.globalPosition() ;
439  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
440  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
441  if(dPhiInnEle>0) info.scPixCharge = -1 ;
442  else info.scPixCharge = 1 ;
443 
444  // flags
445  int chargeGsf = gsfTrackRef->charge() ;
446  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
447  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
449 
450  // default charge
452  { charge = info.scPixCharge ; }
453  else
454  { charge = ctfTrackRef->charge() ; }
455  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
RealType normalized_phi(RealType phi)
bool isNull() const
Checks for null.
Definition: Ref.h:247
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 ( const MultiTrajectoryStateTransform mtsTransform)

Definition at line 458 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

459  {
460  CaloClusterPtr eleRef ;
461  TrajectoryStateOnSurface tempTSOS ;
463  float dphimin = 1.e30 ;
464  for (CaloCluster_iterator bc=superClusterRef->clustersBegin(); bc!=superClusterRef->clustersEnd(); bc++)
465  {
466  GlobalPoint posclu((*bc)->position().x(),(*bc)->position().y(),(*bc)->position().z()) ;
467  tempTSOS = mtsTransform->extrapolatedState(outTSOS,posclu) ;
468  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
469  GlobalPoint extrap = tempTSOS.globalPosition() ;
470  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
471  if (std::abs(dphi)<dphimin)
472  {
473  dphimin = std::abs(dphi) ;
474  eleRef = (*bc);
475  eleTSOS = tempTSOS ;
476  }
477  }
478  return eleRef ;
479  }
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
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 294 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 317 of file GsfElectronAlgo.cc.

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

Definition at line 289 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 292 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 321 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 316 of file GsfElectronAlgo.cc.

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

Definition at line 290 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 321 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 311 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 321 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 312 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 321 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 314 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 321 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 315 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 293 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 291 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 321 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().