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

Constructor & Destructor Documentation

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

Definition at line 324 of file GsfElectronAlgo.cc.

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

Definition at line 333 of file GsfElectronAlgo.cc.

334  {}

Member Function Documentation

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

Definition at line 514 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

References Scenarios_cff::scale.

Referenced by GsfElectronAlgo::createElectron().

532  {
533  double scale = superClusterRef->energy()/vtxMom.mag() ;
535  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
536  superClusterRef->energy() ) ;
537  }
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 480 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().

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

337 {
338  if (!ctfTrackRef.isNull()) return ;
339 
340  // Code below from Puneeth Kalavase
341 
342  shFracInnerHits = 0 ;
343  const TrackCollection * ctfTrackCollection = currentCtfTracks.product() ;
344 
345  // get the Hit Pattern for the gsfTrack
346  const HitPattern &gsfHitPattern = gsfTrackRef->hitPattern() ;
347 
348  unsigned int counter ;
349  TrackCollection::const_iterator ctfTkIter ;
350  for (ctfTkIter = ctfTrackCollection->begin(), counter = 0;
351  ctfTkIter != ctfTrackCollection->end(); ctfTkIter++, counter++)
352  {
353  double dEta = gsfTrackRef->eta() - ctfTkIter->eta() ;
354  double dPhi = gsfTrackRef->phi() - ctfTkIter->phi() ;
355  double pi = acos(-1.);
356  if(std::abs(dPhi) > pi) dPhi = 2*pi - std::abs(dPhi) ;
357 
358  // dont want to look at every single track in the event!
359  if (sqrt(dEta*dEta + dPhi*dPhi) > 0.3) continue ;
360 
361  unsigned int shared = 0 ;
362  int gsfHitCounter = 0 ;
363  int numGsfInnerHits = 0 ;
364  int numCtfInnerHits = 0 ;
365 
366  // get the CTF Track Hit Pattern
367  const HitPattern &ctfHitPattern = ctfTkIter->hitPattern() ;
368 
369  trackingRecHit_iterator elHitsIt;
370  for (elHitsIt = gsfTrackRef->recHitsBegin();
371  elHitsIt != gsfTrackRef->recHitsEnd();
372  elHitsIt++, gsfHitCounter++)
373  {
374  if (!((**elHitsIt).isValid())) //count only valid Hits
375  { continue ; }
376 
377  // look only in the pixels/TIB/TID
378  uint32_t gsfHit = gsfHitPattern.getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter) ;
379  if (!(HitPattern::pixelHitFilter(gsfHit)
380  || HitPattern::stripTIBHitFilter(gsfHit)
381  || HitPattern::stripTIDHitFilter(gsfHit))){
382  continue;
383  }
384 
385  numGsfInnerHits++ ;
386 
387  int ctfHitsCounter = 0 ;
388  numCtfInnerHits = 0 ;
389  trackingRecHit_iterator ctfHitsIt ;
390  for (ctfHitsIt = ctfTkIter->recHitsBegin();
391  ctfHitsIt != ctfTkIter->recHitsEnd();
392  ctfHitsIt++, ctfHitsCounter++ )
393  {
394  if(!((**ctfHitsIt).isValid())) //count only valid Hits!
395  { continue; }
396 
397  uint32_t ctfHit = ctfHitPattern.getHitPattern(HitPattern::TRACK_HITS, ctfHitsCounter);
398  if(!(HitPattern::pixelHitFilter(ctfHit)
399  || HitPattern::stripTIBHitFilter(ctfHit)
400  || HitPattern::stripTIDHitFilter(ctfHit)))
401  {
402  continue;
403  }
404 
405  numCtfInnerHits++ ;
406 
407  if((**elHitsIt).sharesInput(&(**ctfHitsIt), TrackingRecHit::all))
408  {
409  shared++ ;
410  break ;
411  }
412 
413  } //ctfHits iterator
414 
415  } //gsfHits iterator
416 
417  if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
418  { continue ; }
419 
420  if ( static_cast<float>(shared)/min(numGsfInnerHits,numCtfInnerHits) > shFracInnerHits )
421  {
422  shFracInnerHits = static_cast<float>(shared)/min(numGsfInnerHits, numCtfInnerHits);
423  ctfTrackRef = TrackRef(currentCtfTracks,counter);
424  }
425  } //ctfTrack iterator
426 }
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 429 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().

430  {
431  // determine charge from SC
432  GlobalPoint orig, scpos ;
433  ele_convert(beamSpot.position(),orig) ;
434  ele_convert(superClusterRef->position(),scpos) ;
435  GlobalVector scvect(scpos-orig) ;
436  GlobalPoint inntkpos = innTSOS.globalPosition() ;
437  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
438  float dPhiInnEle=normalized_phi(scvect.barePhi()-inntkvect.barePhi()) ;
439  if(dPhiInnEle>0) info.scPixCharge = -1 ;
440  else info.scPixCharge = 1 ;
441 
442  // flags
443  int chargeGsf = gsfTrackRef->charge() ;
444  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
445  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
447 
448  // default charge
450  { charge = info.scPixCharge ; }
451  else
452  { charge = ctfTrackRef->charge() ; }
453  }
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 456 of file GsfElectronAlgo.cc.

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

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

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

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 315 of file GsfElectronAlgo.cc.

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

Definition at line 287 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 290 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 319 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 314 of file GsfElectronAlgo.cc.

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

Definition at line 288 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 319 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 309 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 319 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 310 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 319 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 312 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 319 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 313 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 291 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 289 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 318 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 320 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 319 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 311 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().