#include <GenParticleCustomSelector.h>
Public Member Functions | |
GenParticleCustomSelector () | |
GenParticleCustomSelector (double ptMin, double minRapidity, double maxRapidity, double tip, double lip, bool chargedOnly, int status, std::vector< int > pdgId=std::vector< int >()) | |
bool | operator() (const reco::GenParticle &tp) const |
Operator() performs the selection: e.g. if (tPSelector(tp)) {...}. | |
Private Attributes | |
bool | chargedOnly_ |
double | lip_ |
double | maxRapidity_ |
double | minRapidity_ |
std::vector< int > | pdgId_ |
double | ptMin_ |
int | status_ |
double | tip_ |
Definition at line 11 of file GenParticleCustomSelector.h.
GenParticleCustomSelector::GenParticleCustomSelector | ( | ) | [inline] |
Definition at line 14 of file GenParticleCustomSelector.h.
{}
GenParticleCustomSelector::GenParticleCustomSelector | ( | double | ptMin, |
double | minRapidity, | ||
double | maxRapidity, | ||
double | tip, | ||
double | lip, | ||
bool | chargedOnly, | ||
int | status, | ||
std::vector< int > | pdgId = std::vector<int>() |
||
) | [inline] |
Definition at line 15 of file GenParticleCustomSelector.h.
: ptMin_( ptMin ), minRapidity_( minRapidity ), maxRapidity_( maxRapidity ), tip_( tip ), lip_( lip ), chargedOnly_(chargedOnly), status_(status), pdgId_( pdgId ) { }
bool GenParticleCustomSelector::operator() | ( | const reco::GenParticle & | tp | ) | const [inline] |
Operator() performs the selection: e.g. if (tPSelector(tp)) {...}.
Definition at line 22 of file GenParticleCustomSelector.h.
References reco::LeafCandidate::charge(), chargedOnly_, reco::LeafCandidate::eta(), lip_, maxRapidity_, minRapidity_, reco::LeafCandidate::pdgId(), pdgId_, reco::LeafCandidate::pt(), ptMin_, mathSSE::sqrt(), reco::LeafCandidate::status(), status_, tip_, and reco::LeafCandidate::vertex().
{ if (chargedOnly_ && tp.charge()==0) return false;//select only if charge!=0 bool testId = false; unsigned int idSize = pdgId_.size(); if (idSize==0) testId = true; else for (unsigned int it=0;it!=idSize;++it){ if (tp.pdgId()==pdgId_[it]) testId = true; } return ( tp.pt() >= ptMin_ && tp.eta() >= minRapidity_ && tp.eta() <= maxRapidity_ && sqrt(tp.vertex().perp2()) <= tip_ && fabs(tp.vertex().z()) <= lip_ && tp.status() == status_ && testId ); }
bool GenParticleCustomSelector::chargedOnly_ [private] |
Definition at line 48 of file GenParticleCustomSelector.h.
Referenced by operator()().
double GenParticleCustomSelector::lip_ [private] |
Definition at line 47 of file GenParticleCustomSelector.h.
Referenced by operator()().
double GenParticleCustomSelector::maxRapidity_ [private] |
Definition at line 45 of file GenParticleCustomSelector.h.
Referenced by operator()().
double GenParticleCustomSelector::minRapidity_ [private] |
Definition at line 44 of file GenParticleCustomSelector.h.
Referenced by operator()().
std::vector<int> GenParticleCustomSelector::pdgId_ [private] |
Definition at line 50 of file GenParticleCustomSelector.h.
Referenced by operator()().
double GenParticleCustomSelector::ptMin_ [private] |
Definition at line 43 of file GenParticleCustomSelector.h.
Referenced by operator()().
int GenParticleCustomSelector::status_ [private] |
Definition at line 49 of file GenParticleCustomSelector.h.
Referenced by operator()().
double GenParticleCustomSelector::tip_ [private] |
Definition at line 46 of file GenParticleCustomSelector.h.
Referenced by operator()().