Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtCPUtil.cpp
Show All 30 Lines | |||||
#include <assert.h> | #include <assert.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
using std::endl; | using std::endl; | ||||
EvtCPUtil::EvtCPUtil( int mixingType ) | EvtCPUtil::EvtCPUtil( int mixingType ) | ||||
{ | { | ||||
_enableFlip = false; | m_enableFlip = false; | ||||
_mixingType = mixingType; | m_mixingType = mixingType; | ||||
} | } | ||||
EvtCPUtil* EvtCPUtil::getInstance() | EvtCPUtil* EvtCPUtil::getInstance() | ||||
{ | { | ||||
static EvtCPUtil* theCPUtil = 0; | static EvtCPUtil* theCPUtil = 0; | ||||
if ( theCPUtil == 0 ) { | if ( theCPUtil == 0 ) { | ||||
theCPUtil = new EvtCPUtil( 1 ); | theCPUtil = new EvtCPUtil( 1 ); | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | void EvtCPUtil::fractB0nonCP( EvtComplex Af, EvtComplex Abarf, EvtComplex Afbar, | ||||
fract = IAbarf / ( IAbarf + IAf ) + flip * IAbarfbar / ( IAfbar + IAbarfbar ); | fract = IAbarf / ( IAbarf + IAf ) + flip * IAbarfbar / ( IAfbar + IAbarfbar ); | ||||
return; | return; | ||||
} | } | ||||
void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb, double probB0 ) | void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb, double probB0 ) | ||||
{ | { | ||||
if ( _mixingType == EvtCPUtil::Coherent ) { | if ( m_mixingType == EvtCPUtil::Coherent ) { | ||||
OtherCoherentB( p, t, otherb, probB0 ); | OtherCoherentB( p, t, otherb, probB0 ); | ||||
} else if ( _mixingType == EvtCPUtil::Incoherent ) { | } else if ( m_mixingType == EvtCPUtil::Incoherent ) { | ||||
OtherIncoherentB( p, t, otherb, probB0 ); | OtherIncoherentB( p, t, otherb, probB0 ); | ||||
} | } | ||||
} | } | ||||
void EvtCPUtil::OtherCoherentB( EvtParticle* p, double& t, EvtId& otherb, | void EvtCPUtil::OtherCoherentB( EvtParticle* p, double& t, EvtId& otherb, | ||||
double probB0 ) | double probB0 ) | ||||
{ | { | ||||
//Can not call this recursively!!! | //Can not call this recursively!!! | ||||
▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | double EvtCPUtil::getDeltaM( const EvtId id ) | ||||
int ierr; | int ierr; | ||||
double dM = atof( EvtSymTable::get( parmName, ierr ).c_str() ); | double dM = atof( EvtSymTable::get( parmName, ierr ).c_str() ); | ||||
return dM; | return dM; | ||||
} | } | ||||
bool EvtCPUtil::flipIsEnabled() | bool EvtCPUtil::flipIsEnabled() | ||||
{ | { | ||||
return _enableFlip; | return m_enableFlip; | ||||
} | } | ||||
void EvtCPUtil::enableFlip() | void EvtCPUtil::enableFlip() | ||||
{ | { | ||||
_enableFlip = true; | m_enableFlip = true; | ||||
} | } | ||||
void EvtCPUtil::disableFlip() | void EvtCPUtil::disableFlip() | ||||
{ | { | ||||
_enableFlip = false; | m_enableFlip = false; | ||||
} | } |