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