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)
 
bool calculateTSOS (const MultiTrajectoryStateTransform *, GsfConstraintAtVertex *)
 
void checkCtfTrack (edm::Handle< reco::TrackCollection > currentCtfTracks)
 
void computeCharge (int &charge, reco::GsfElectron::ChargeInfo &info)
 
Candidate::LorentzVector computeMomemtum ()
 
 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 268 of file GsfElectronAlgo.cc.

Constructor & Destructor Documentation

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

Definition at line 308 of file GsfElectronAlgo.cc.

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

Definition at line 317 of file GsfElectronAlgo.cc.

318  {}

Member Function Documentation

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

Definition at line 496 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

497  {
511  }
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
bool GsfElectronAlgo::ElectronData::calculateTSOS ( const MultiTrajectoryStateTransform mtsTransform,
GsfConstraintAtVertex constraintAtVtx 
)

Definition at line 462 of file GsfElectronAlgo.cc.

References ExpressReco_HICollisions_FallBack::beamSpot, GsfConstraintAtVertex::constrainAtBeamSpot(), ele_convert(), MultiTrajectoryStateTransform::extrapolatedState(), MultiTrajectoryStateTransform::innerStateOnSurface(), MultiTrajectoryStateTransform::outerStateOnSurface(), and funct::true.

Referenced by GsfElectronAlgo::completeElectrons().

463  {
464  //at innermost point
465  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
466  if (!innTSOS.isValid()) return false;
467 
468  //at vertex
469  // innermost state propagation to the beam spot position
470  GlobalPoint bsPos ;
471  ele_convert(beamSpot.position(),bsPos) ;
472  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
473  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
474 
475  //at seed
476  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
477  if (!outTSOS.isValid()) return false;
478 
479  // TrajectoryStateOnSurface seedTSOS
480  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
481  GlobalPoint(superClusterRef->seed()->position().x(),
482  superClusterRef->seed()->position().y(),
483  superClusterRef->seed()->position().z()));
485 
486  // at scl
488  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
489 
490  // constrained momentum
492 
493  return true ;
494  }
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 320 of file GsfElectronAlgo.cc.

References abs, TrackingRecHit::all, cmsDriverOptions::counter, 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().

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

Definition at line 411 of file GsfElectronAlgo.cc.

References ExpressReco_HICollisions_FallBack::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().

412  {
413  // determine charge from SC
414  GlobalPoint orig, scpos ;
415  ele_convert(beamSpot.position(),orig) ;
416  ele_convert(superClusterRef->position(),scpos) ;
417  GlobalVector scvect(scpos-orig) ;
418  GlobalPoint inntkpos = innTSOS.globalPosition() ;
419  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
420  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
421  if(dPhiInnEle>0) info.scPixCharge = -1 ;
422  else info.scPixCharge = 1 ;
423 
424  // flags
425  int chargeGsf = gsfTrackRef->charge() ;
426  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
427  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
429 
430  // default charge
432  { charge = info.scPixCharge ; }
433  else
434  { charge = ctfTrackRef->charge() ; }
435  }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
TrajectoryStateOnSurface innTSOS
double charge(const std::vector< uint8_t > &Ampls)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
bool isNull() const
Checks for null.
Definition: Ref.h:244
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
Candidate::LorentzVector GsfElectronAlgo::ElectronData::computeMomemtum ( )

Definition at line 513 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

514  {
515  double scale = superClusterRef->energy()/vtxMom.mag() ;
517  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
518  superClusterRef->energy() ) ;
519  }
T y() const
Definition: PV3DBase.h:57
T mag() const
Definition: PV3DBase.h:61
T z() const
Definition: PV3DBase.h:58
const reco::SuperClusterRef superClusterRef
T x() const
Definition: PV3DBase.h:56
math::PtEtaPhiELorentzVectorF LorentzVector
CaloClusterPtr GsfElectronAlgo::ElectronData::getEleBasicCluster ( const MultiTrajectoryStateTransform mtsTransform)

Definition at line 438 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronAlgo::createElectron().

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

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::constrainedVtxTSOS

Definition at line 299 of file GsfElectronAlgo.cc.

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

Definition at line 271 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

reco::TrackRef GsfElectronAlgo::ElectronData::ctfTrackRef

Definition at line 274 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::eleMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::elePos

Definition at line 303 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::eleTSOS

Definition at line 298 of file GsfElectronAlgo.cc.

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

Definition at line 272 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::innMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::innPos

Definition at line 303 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::innTSOS

Definition at line 293 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::outMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::outPos

Definition at line 303 of file GsfElectronAlgo.cc.

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::outTSOS

Definition at line 294 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::sclMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::sclPos

Definition at line 303 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::sclTSOS

Definition at line 296 of file GsfElectronAlgo.cc.

GlobalVector GsfElectronAlgo::ElectronData::seedMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::seedPos

Definition at line 303 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::seedTSOS

Definition at line 297 of file GsfElectronAlgo.cc.

float GsfElectronAlgo::ElectronData::shFracInnerHits

Definition at line 275 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

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

Definition at line 273 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMom

Definition at line 302 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalVector GsfElectronAlgo::ElectronData::vtxMomWithConstraint

Definition at line 304 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

GlobalPoint GsfElectronAlgo::ElectronData::vtxPos

Definition at line 303 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().

TrajectoryStateOnSurface GsfElectronAlgo::ElectronData::vtxTSOS

Definition at line 295 of file GsfElectronAlgo.cc.

Referenced by GsfElectronAlgo::createElectron().