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

Constructor & Destructor Documentation

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

Definition at line 314 of file GsfElectronAlgo.cc.

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

Definition at line 323 of file GsfElectronAlgo.cc.

324  {}

Member Function Documentation

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

Definition at line 502 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

References pileupReCalc_HLTpaths::scale.

Referenced by GsfElectronAlgo::createElectron().

520  {
521  double scale = superClusterRef->energy()/vtxMom.mag() ;
523  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
524  superClusterRef->energy() ) ;
525  }
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 468 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().

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

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

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

418  {
419  // determine charge from SC
420  GlobalPoint orig, scpos ;
421  ele_convert(beamSpot.position(),orig) ;
422  ele_convert(superClusterRef->position(),scpos) ;
423  GlobalVector scvect(scpos-orig) ;
424  GlobalPoint inntkpos = innTSOS.globalPosition() ;
425  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
426  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
427  if(dPhiInnEle>0) info.scPixCharge = -1 ;
428  else info.scPixCharge = 1 ;
429 
430  // flags
431  int chargeGsf = gsfTrackRef->charge() ;
432  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
433  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
435 
436  // default charge
438  { charge = info.scPixCharge ; }
439  else
440  { charge = ctfTrackRef->charge() ; }
441  }
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 444 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 305 of file GsfElectronAlgo.cc.

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

Definition at line 277 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 280 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 309 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 304 of file GsfElectronAlgo.cc.

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

Definition at line 278 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 309 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 299 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 309 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 300 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 309 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 302 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 309 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 303 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 281 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 279 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 308 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 310 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 309 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().