CMS 3D CMS Logo

TrackingParticleSelector Class Reference

#include <PhysicsTools/RecoAlgos/interface/TrackingParticleSelector.h>

List of all members.

Public Member Functions

bool operator() (const TrackingParticle &tp) const
 Operator() performs the selection: e.g. if (tPSelector(tp)) {...}.
 TrackingParticleSelector (double ptMin, double minRapidity, double maxRapidity, double tip, double lip, int minHit, bool signalOnly, bool chargedOnly, std::vector< int > pdgId=std::vector< int >())
 TrackingParticleSelector ()

Private Attributes

bool chargedOnly_
double lip_
double maxRapidity_
int minHit_
double minRapidity_
std::vector< intpdgId_
double ptMin_
bool signalOnly_
double tip_


Detailed Description

Definition at line 13 of file TrackingParticleSelector.h.


Constructor & Destructor Documentation

TrackingParticleSelector::TrackingParticleSelector (  )  [inline]

Definition at line 16 of file TrackingParticleSelector.h.

00016 {}

TrackingParticleSelector::TrackingParticleSelector ( double  ptMin,
double  minRapidity,
double  maxRapidity,
double  tip,
double  lip,
int  minHit,
bool  signalOnly,
bool  chargedOnly,
std::vector< int pdgId = std::vector<int>() 
) [inline]

Definition at line 17 of file TrackingParticleSelector.h.

00019                                                                       :
00020     ptMin_( ptMin ), minRapidity_( minRapidity ), maxRapidity_( maxRapidity ),
00021     tip_( tip ), lip_( lip ), minHit_( minHit ), signalOnly_(signalOnly), chargedOnly_(chargedOnly), pdgId_( pdgId ) { }


Member Function Documentation

bool TrackingParticleSelector::operator() ( const TrackingParticle tp  )  const [inline]

Operator() performs the selection: e.g. if (tPSelector(tp)) {...}.

Definition at line 24 of file TrackingParticleSelector.h.

References EncodedEventId::bunchCrossing(), reco::Particle::charge(), chargedOnly_, EncodedEventId::event(), TrackingParticle::eventId(), it, lip_, TrackingParticle::matchedHit(), maxRapidity_, minHit_, minRapidity_, reco::Particle::momentum(), TrackingParticle::pdgId(), pdgId_, ptMin_, signal, signalOnly_, funct::sqrt(), tip_, and reco::Particle::vertex().

00024                                                        { 
00025     if (chargedOnly_ && tp.charge()==0) return false;//select only if charge!=0
00026     bool testId = false;
00027     unsigned int idSize = pdgId_.size();
00028     if (idSize==0) testId = true;
00029     else for (unsigned int it=0;it!=idSize;++it){
00030       if (tp.pdgId()==pdgId_[it]) testId = true;
00031     }
00032     bool signal = true;
00033     if (signalOnly_) signal = (tp.eventId().bunchCrossing()== 0 && tp.eventId().event() == 0);
00034     return (
00035             tp.matchedHit() >= minHit_ &&
00036             sqrt(tp.momentum().perp2()) >= ptMin_ && 
00037             tp.momentum().eta() >= minRapidity_ && tp.momentum().eta() <= maxRapidity_ && 
00038             sqrt(tp.vertex().perp2()) <= tip_ &&
00039             fabs(tp.vertex().z()) <= lip_ &&
00040             testId &&
00041             signal
00042             );
00043   }


Member Data Documentation

bool TrackingParticleSelector::chargedOnly_ [private]

Definition at line 53 of file TrackingParticleSelector.h.

Referenced by operator()().

double TrackingParticleSelector::lip_ [private]

Definition at line 50 of file TrackingParticleSelector.h.

Referenced by operator()().

double TrackingParticleSelector::maxRapidity_ [private]

Definition at line 48 of file TrackingParticleSelector.h.

Referenced by operator()().

int TrackingParticleSelector::minHit_ [private]

Definition at line 51 of file TrackingParticleSelector.h.

Referenced by operator()().

double TrackingParticleSelector::minRapidity_ [private]

Definition at line 47 of file TrackingParticleSelector.h.

Referenced by operator()().

std::vector<int> TrackingParticleSelector::pdgId_ [private]

Definition at line 54 of file TrackingParticleSelector.h.

Referenced by operator()().

double TrackingParticleSelector::ptMin_ [private]

Definition at line 46 of file TrackingParticleSelector.h.

Referenced by operator()().

bool TrackingParticleSelector::signalOnly_ [private]

Definition at line 52 of file TrackingParticleSelector.h.

Referenced by operator()().

double TrackingParticleSelector::tip_ [private]

Definition at line 49 of file TrackingParticleSelector.h.

Referenced by operator()().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:34:12 2009 for CMSSW by  doxygen 1.5.4