CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

egammaisolation::EgammaTrackSelector Class Reference

#include <EgammaTrackSelector.h>

List of all members.

Classes

struct  Parameters
 config parameters More...

Public Types

enum  { dz = 0, vz, bs, vtx }
typedef reco::TrackBase::Point BeamPoint
typedef edm::View< reco::Trackinput_type
typedef
egammaisolation::EgammaRange
< float > 
Range
typedef std::list< const
reco::Track * > 
result_type

Public Member Functions

 EgammaTrackSelector (const Parameters &pars)
result_type operator() (const input_type &tracks) const

Private Attributes

Parameters thePars

Detailed Description

Definition at line 14 of file EgammaTrackSelector.h.


Member Typedef Documentation

Definition at line 20 of file EgammaTrackSelector.h.

Definition at line 19 of file EgammaTrackSelector.h.

Definition at line 17 of file EgammaTrackSelector.h.

Definition at line 18 of file EgammaTrackSelector.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
dz 
vz 
bs 
vtx 

Definition at line 22 of file EgammaTrackSelector.h.

{ dz = 0, vz, bs, vtx };

Constructor & Destructor Documentation

egammaisolation::EgammaTrackSelector::EgammaTrackSelector ( const Parameters pars) [inline]

Definition at line 46 of file EgammaTrackSelector.h.

: thePars(pars) { } 

Member Function Documentation

EgammaTrackSelector::result_type EgammaTrackSelector::operator() ( const input_type tracks) const

pick/read variables in order to cut down on unnecessary calls someone will have some fun reading the log if Debug is on the biggest reason is the numberOfValidHits call (the rest are not as costly)

access to the remaining vars is slow

skip if min Hits == 0; assumes any track has at least one valid hit

similarly here

Definition at line 8 of file EgammaTrackSelector.cc.

References edm::View< T >::begin(), ChiSquaredProbability(), edm::View< T >::end(), metname, and query::result.

{
  static std::string metname = "EgammaIsolationAlgos|EgammaTrackSelector";
  result_type result;
  for (input_type::const_iterator it = tracks.begin(); it != tracks.end(); it++) {


    float tZ;
    switch(thePars.dzOption) {
        case dz : tZ = it->dz();                  break;
        case vz : tZ = it->vz();                  break;
        case bs : tZ = it->dz(thePars.beamPoint); break;
        default : tZ = it->vz();                  break;
    }

    float tPt = it->pt();
    //float tD0 = fabs(it->d0());  //currently not used.  
    float tD0Cor = fabs(it->dxy(thePars.beamPoint));
    float tEta = it->eta();
    float tPhi = it->phi();
    float tChi2Ndof = it->normalizedChi2();
  

    if ( !thePars.zRange.inside( tZ ) ) continue; 
    if ( tPt < thePars.ptMin ) continue;
    if ( !thePars.rRange.inside( tD0Cor) ) continue;
    if ( thePars.dir.deltaR( reco::isodeposit::Direction(tEta, tPhi) ) > thePars.drMax ) continue;
    if ( tChi2Ndof > thePars.chi2NdofMax ) continue;

    if (thePars.nHitsMin > 0 ){
      unsigned int tHits = it->numberOfValidHits();
      if ( tHits < thePars.nHitsMin ) continue;
    }

    if(thePars.chi2ProbMin > 0){
      float tChi2Prob = ChiSquaredProbability(it->chi2(), it->ndof());
      if ( tChi2Prob < thePars.chi2ProbMin ) continue;
    }
    result.push_back(&*it);
  } 
  return result;
}

Member Data Documentation

Definition at line 52 of file EgammaTrackSelector.h.