/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/GenAnalysisTools/TruthHelper/TruthHelper-00-00-01/src/IsGenType.cxx

Go to the documentation of this file.
00001 #include <vector>
00002 
00003 #include "TruthHelper/IsGenType.h"
00004 #include "HepMC/GenParticle.h"
00005 using std::vector;
00006 using std::abs;
00007 
00008 //****************************************************************
00009 //*                    IsGenType                             *
00010 //****************************************************************
00011 IsGenType::IsGenType(int ParticleType){
00012   m_TypeList.push_back(ParticleType); 
00013 }
00014 IsGenType::IsGenType(std::vector<int> ParticleTypeList){
00015   vector<int>::const_iterator itype = ParticleTypeList.begin();
00016   for(; itype !=ParticleTypeList.end(); ++itype ){ 
00017     m_TypeList.push_back((*itype));
00018   }
00019 }
00020 IsGenType::IsGenType(const IsGenType& rhs):GenIMCselector(),m_TypeList(rhs.m_TypeList){}
00021 
00022 bool IsGenType::operator()( const Particle* const p ) const {
00023   vector<int>::const_iterator itype = m_TypeList.begin();
00024   for(; itype != m_TypeList.end(); ++itype ){ 
00025     if( abs(p->pdg_id()) == (*itype) ) return true ;
00026   }
00027   return false;
00028 }
00029 
00030 bool IsGenType::operator() ( const Particle& p ) const {
00031   return this->operator()(&p);
00032 } 
00033 GenIMCselector* IsGenType::create() const {return new IsGenType(*this);}

Generated on Tue Nov 29 23:12:39 2016 for BOSS_7.0.2 by  doxygen 1.4.7