1 #include "marlin/MarlinConfig.h"
3 #ifdef MARLIN_CLHEP // only if CLHEP is available !
22 #if ! LCIO_PATCHVERSION_GE( 1,51,3 )
24 #define USE_CLHEP // to activate code from LCIO header <UTIL/LCFourVector.h>
29 using namespace lcio ;
34 SimpleParticleFactory::SimpleParticleFactory() :
39 void SimpleParticleFactory::setMomentumCut(
double mCut ) {
43 void SimpleParticleFactory::registerIFourVectorSmearer( IFourVectorSmearer* sm ,
45 _smearingVec[ type ] = sm ;
50 FastMCParticleType SimpleParticleFactory::getParticleType(
const lcio::MCParticle* mcp ) {
61 float charge = mcp->getCharge() ;
66 if( charge > 1e-10 || charge < -1e-10 ){
70 }
else if( mcp->getPDG() == 22 ) {
74 }
else if( std::abs( mcp->getPDG() ) == 12 || std::abs( mcp->getPDG() ) == 14 ||
75 std::abs( mcp->getPDG() ) == 16 || std::abs( mcp->getPDG() ) == 18 ) {
104 #ifdef LCIO_PATCHVERSION_GE // has been defined in 1.4.1 which has a bug fix in LCFourVector<T>
105 LCFourVector<MCParticle> mc4V( mcp ) ;
108 mcp->getMomentum()[2], mcp->getEnergy() ) ;
116 IFourVectorSmearer* sm = _smearingVec[ type ] ;
126 reco4v = sm->smearedFourVector( mc4V , mcp->getPDG() ) ;
129 ReconstructedParticleImpl* rec = 0 ;
131 if( reco4v.vect().mag() > _momentumCut ) {
133 rec =
new ReconstructedParticleImpl ;
140 rec->setMomentum( p ) ;
141 rec->setEnergy( reco4v.e() ) ;
142 rec->setMass( reco4v.m() ) ;
144 rec->setCharge( mcp->getCharge() ) ;
147 vtx[0] = mcp->getVertex()[0] ;
148 vtx[1] = mcp->getVertex()[1] ;
149 vtx[2] = mcp->getVertex()[2] ;
150 rec->setReferencePoint( vtx ) ;
152 rec->setType( type ) ;
161 #endif // MARLIN_CLHEP
FastMCParticleType
Enumeration that defines integer constants for various particle types used in the fast Monte Carlo...
#define NUMBER_OF_FASTMCPARTICLETYPES