CMS 3D CMS Logo

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

Constructor & Destructor Documentation

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

Definition at line 328 of file GsfElectronAlgo.cc.

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

Definition at line 337 of file GsfElectronAlgo.cc.

338  {}

Member Function Documentation

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

Definition at line 518 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

References Scenarios_cff::scale.

Referenced by GsfElectronAlgo::createElectron().

536  {
537  double scale = superClusterRef->energy()/vtxMom.mag() ;
539  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
540  superClusterRef->energy() ) ;
541  }
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 484 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().

485  {
486  //at innermost point
487  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
488  if (!innTSOS.isValid()) return false;
489 
490  //at vertex
491  // innermost state propagation to the beam spot position
492  GlobalPoint bsPos ;
493  ele_convert(beamSpot.position(),bsPos) ;
494  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
495  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
496 
497  //at seed
498  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
499  if (!outTSOS.isValid()) return false;
500 
501  // TrajectoryStateOnSurface seedTSOS
502  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
503  GlobalPoint(superClusterRef->seed()->position().x(),
504  superClusterRef->seed()->position().y(),
505  superClusterRef->seed()->position().z()));
507 
508  // at scl
510  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
511 
512  // constrained momentum
514 
515  return true ;
516  }
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 340 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 433 of file GsfElectronAlgo.cc.

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

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

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

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

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

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

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 319 of file GsfElectronAlgo.cc.

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

Definition at line 291 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 294 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 323 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 318 of file GsfElectronAlgo.cc.

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

Definition at line 292 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 323 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 313 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 323 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 314 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 323 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 316 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 323 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 317 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 295 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 293 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 322 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 324 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 323 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 315 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().