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

Constructor & Destructor Documentation

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

Definition at line 307 of file GsfElectronAlgo.cc.

309  : coreRef(core),
310  gsfTrackRef(coreRef->gsfTrack()),
311  superClusterRef(coreRef->superCluster()),
312  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
313  beamSpot(bs)
314  {}
const reco::GsfTrackRef gsfTrackRef
const reco::GsfElectronCoreRef coreRef
const reco::SuperClusterRef superClusterRef
const reco::BeamSpot beamSpot
GsfElectronAlgo::ElectronData::~ElectronData ( )

Definition at line 316 of file GsfElectronAlgo.cc.

317  {}

Member Function Documentation

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

Definition at line 495 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

496  {
510  }
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 512 of file GsfElectronAlgo.cc.

References pileupReCalc_HLTpaths::scale.

Referenced by GsfElectronAlgo::createElectron().

513  {
514  double scale = superClusterRef->energy()/vtxMom.mag() ;
516  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
517  superClusterRef->energy() ) ;
518  }
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 461 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().

462  {
463  //at innermost point
464  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
465  if (!innTSOS.isValid()) return false;
466 
467  //at vertex
468  // innermost state propagation to the beam spot position
469  GlobalPoint bsPos ;
470  ele_convert(beamSpot.position(),bsPos) ;
471  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
472  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
473 
474  //at seed
475  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
476  if (!outTSOS.isValid()) return false;
477 
478  // TrajectoryStateOnSurface seedTSOS
479  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
480  GlobalPoint(superClusterRef->seed()->position().x(),
481  superClusterRef->seed()->position().y(),
482  superClusterRef->seed()->position().z()));
484 
485  // at scl
487  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
488 
489  // constrained momentum
491 
492  return true ;
493  }
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:63
TrajectoryStateOnSurface outTSOS
TrajectoryStateOnSurface vtxTSOS
const reco::BeamSpot beamSpot
void GsfElectronAlgo::ElectronData::checkCtfTrack ( edm::Handle< reco::TrackCollection currentCtfTracks)

Definition at line 319 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

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

411  {
412  // determine charge from SC
413  GlobalPoint orig, scpos ;
414  ele_convert(beamSpot.position(),orig) ;
415  ele_convert(superClusterRef->position(),scpos) ;
416  GlobalVector scvect(scpos-orig) ;
417  GlobalPoint inntkpos = innTSOS.globalPosition() ;
418  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
419  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
420  if(dPhiInnEle>0) info.scPixCharge = -1 ;
421  else info.scPixCharge = 1 ;
422 
423  // flags
424  int chargeGsf = gsfTrackRef->charge() ;
425  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
426  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
428 
429  // default charge
431  { charge = info.scPixCharge ; }
432  else
433  { charge = ctfTrackRef->charge() ; }
434  }
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:63
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const reco::BeamSpot beamSpot
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( const MultiTrajectoryStateTransform mtsTransform)

Definition at line 437 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

438  {
439  CaloClusterPtr eleRef ;
440  TrajectoryStateOnSurface tempTSOS ;
442  float dphimin = 1.e30 ;
443  for (CaloCluster_iterator bc=superClusterRef->clustersBegin(); bc!=superClusterRef->clustersEnd(); bc++)
444  {
445  GlobalPoint posclu((*bc)->position().x(),(*bc)->position().y(),(*bc)->position().z()) ;
446  tempTSOS = mtsTransform->extrapolatedState(outTSOS,posclu) ;
447  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
448  GlobalPoint extrap = tempTSOS.globalPosition() ;
449  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
450  if (std::abs(dphi)<dphimin)
451  {
452  dphimin = std::abs(dphi) ;
453  eleRef = (*bc);
454  eleTSOS = tempTSOS ;
455  }
456  }
457  return eleRef ;
458  }
#define abs(x)
Definition: mlp_lapack.h:159
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
const reco::GsfTrackRef gsfTrackRef
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface eleTSOS
const Point & position() const
position
Definition: BeamSpot.h:63
TrajectoryStateOnSurface outTSOS
const reco::BeamSpot beamSpot

Member Data Documentation

const reco::BeamSpot GsfElectronAlgo::ElectronData::beamSpot

Definition at line 275 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 298 of file GsfElectronAlgo.cc.

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

Definition at line 270 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 273 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 297 of file GsfElectronAlgo.cc.

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

Definition at line 271 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 302 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 292 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 302 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 293 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 295 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 296 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 274 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 272 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 301 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 303 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 294 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().