BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
IsGenType.cxx
Go to the documentation of this file.
1#include <vector>
2
4#include "HepMC/GenParticle.h"
5using std::vector;
6using std::abs;
7
8//****************************************************************
9//* IsGenType *
10//****************************************************************
11IsGenType::IsGenType(int ParticleType){
12 m_TypeList.push_back(ParticleType);
13}
14IsGenType::IsGenType(std::vector<int> ParticleTypeList){
15 vector<int>::const_iterator itype = ParticleTypeList.begin();
16 for(; itype !=ParticleTypeList.end(); ++itype ){
17 m_TypeList.push_back((*itype));
18 }
19}
20IsGenType::IsGenType(const IsGenType& rhs):GenIMCselector(),m_TypeList(rhs.m_TypeList){}
21
22bool IsGenType::operator()( const Particle* const p ) const {
23 vector<int>::const_iterator itype = m_TypeList.begin();
24 for(; itype != m_TypeList.end(); ++itype ){
25 if( abs(p->pdg_id()) == (*itype) ) return true ;
26 }
27 return false;
28}
29
30bool IsGenType::operator() ( const Particle& p ) const {
31 return this->operator()(&p);
32}
33GenIMCselector* IsGenType::create() const {return new IsGenType(*this);}
HepMC::GenParticle Particle
virtual bool operator()(const Particle *const p) const
Definition: IsGenType.cxx:22
IsGenType(int ParticleType)
Definition: IsGenType.cxx:11
GenIMCselector * create() const
Definition: IsGenType.cxx:33