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

Constructor & Destructor Documentation

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

Definition at line 319 of file GsfElectronAlgo.cc.

321  : coreRef(core),
322  gsfTrackRef(coreRef->gsfTrack()),
323  superClusterRef(coreRef->superCluster()),
324  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
325  beamSpot(bs)
326  {}
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot
GsfElectronAlgo::ElectronData::~ElectronData ( )

Definition at line 328 of file GsfElectronAlgo.cc.

329  {}

Member Function Documentation

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

Definition at line 507 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

508  {
522  }
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 524 of file GsfElectronAlgo.cc.

References pileupReCalc_HLTpaths::scale.

Referenced by GsfElectronAlgo::createElectron().

525  {
526  double scale = superClusterRef->energy()/vtxMom.mag() ;
528  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
529  superClusterRef->energy() ) ;
530  }
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 473 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().

474  {
475  //at innermost point
476  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
477  if (!innTSOS.isValid()) return false;
478 
479  //at vertex
480  // innermost state propagation to the beam spot position
481  GlobalPoint bsPos ;
482  ele_convert(beamSpot.position(),bsPos) ;
483  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
484  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
485 
486  //at seed
487  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
488  if (!outTSOS.isValid()) return false;
489 
490  // TrajectoryStateOnSurface seedTSOS
491  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
492  GlobalPoint(superClusterRef->seed()->position().x(),
493  superClusterRef->seed()->position().y(),
494  superClusterRef->seed()->position().z()));
496 
497  // at scl
499  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
500 
501  // constrained momentum
503 
504  return true ;
505  }
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 331 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 422 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().

423  {
424  // determine charge from SC
425  GlobalPoint orig, scpos ;
426  ele_convert(beamSpot.position(),orig) ;
427  ele_convert(superClusterRef->position(),scpos) ;
428  GlobalVector scvect(scpos-orig) ;
429  GlobalPoint inntkpos = innTSOS.globalPosition() ;
430  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
431  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
432  if(dPhiInnEle>0) info.scPixCharge = -1 ;
433  else info.scPixCharge = 1 ;
434 
435  // flags
436  int chargeGsf = gsfTrackRef->charge() ;
437  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
438  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
440 
441  // default charge
443  { charge = info.scPixCharge ; }
444  else
445  { charge = ctfTrackRef->charge() ; }
446  }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
double charge(const std::vector< uint8_t > &Ampls)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
bool isNull() const
Checks for null.
Definition: Ref.h:247
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:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( const MultiTrajectoryStateTransform mtsTransform)

Definition at line 449 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

450  {
451  CaloClusterPtr eleRef ;
452  TrajectoryStateOnSurface tempTSOS ;
454  float dphimin = 1.e30 ;
455  for (CaloCluster_iterator bc=superClusterRef->clustersBegin(); bc!=superClusterRef->clustersEnd(); bc++)
456  {
457  GlobalPoint posclu((*bc)->position().x(),(*bc)->position().y(),(*bc)->position().z()) ;
458  tempTSOS = mtsTransform->extrapolatedState(outTSOS,posclu) ;
459  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
460  GlobalPoint extrap = tempTSOS.globalPosition() ;
461  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
462  if (std::abs(dphi)<dphimin)
463  {
464  dphimin = std::abs(dphi) ;
465  eleRef = (*bc);
466  eleTSOS = tempTSOS ;
467  }
468  }
469  return eleRef ;
470  }
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 287 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 310 of file GsfElectronAlgo.cc.

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

Definition at line 282 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 285 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 314 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 309 of file GsfElectronAlgo.cc.

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

Definition at line 283 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 314 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 304 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 314 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 305 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 314 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 307 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 314 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 308 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 286 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 284 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 313 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 315 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 314 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 306 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().