test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GenParticleCustomSelector Class Reference

#include <GenParticleCustomSelector.h>

Public Member Functions

 GenParticleCustomSelector ()
 
 GenParticleCustomSelector (double ptMin, double minRapidity, double maxRapidity, double tip, double lip, bool chargedOnly, int status, const std::vector< int > &pdgId=std::vector< int >())
 
bool operator() (const reco::GenParticle &tp) const
 Operator() performs the selection: e.g. if (tPSelector(tp)) {...}. More...
 

Private Attributes

bool chargedOnly_
 
double lip_
 
double maxRapidity_
 
double minRapidity_
 
std::vector< int > pdgId_
 
double ptMin_
 
int status_
 
double tip_
 

Detailed Description

Definition at line 11 of file GenParticleCustomSelector.h.

Constructor & Destructor Documentation

GenParticleCustomSelector::GenParticleCustomSelector ( )
inline

Definition at line 14 of file GenParticleCustomSelector.h.

14 {}
GenParticleCustomSelector::GenParticleCustomSelector ( double  ptMin,
double  minRapidity,
double  maxRapidity,
double  tip,
double  lip,
bool  chargedOnly,
int  status,
const std::vector< int > &  pdgId = std::vector<int>() 
)
inline

Definition at line 15 of file GenParticleCustomSelector.h.

Member Function Documentation

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().

22  {
23 
24  if (chargedOnly_ && tp.charge()==0) return false;//select only if charge!=0
25  bool testId = false;
26  unsigned int idSize = pdgId_.size();
27  if (idSize==0) testId = true;
28  else for (unsigned int it=0;it!=idSize;++it){
29  if (tp.pdgId()==pdgId_[it]) testId = true;
30  }
31 
32  return (
33  tp.pt() >= ptMin_ &&
34  tp.eta() >= minRapidity_ && tp.eta() <= maxRapidity_ &&
35  sqrt(tp.vertex().perp2()) <= tip_ &&
36  fabs(tp.vertex().z()) <= lip_ &&
37  tp.status() == status_ &&
38  testId
39  );
40  }
virtual const Point & vertex() const
vertex position (overwritten by PF...)
virtual int status() const final
status word
T sqrt(T t)
Definition: SSEVec.h:18
virtual int charge() const final
electric charge
Definition: LeafCandidate.h:91
virtual int pdgId() const final
PDG identifier.
virtual double eta() const final
momentum pseudorapidity
virtual double pt() const final
transverse momentum

Member Data Documentation

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()().