Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtCPUtil.cpp
Show All 36 Lines | |||||
EvtCPUtil::EvtCPUtil( int mixingType ) | EvtCPUtil::EvtCPUtil( int mixingType ) | ||||
{ | { | ||||
_enableFlip = false; | _enableFlip = false; | ||||
_mixingType = mixingType; | _mixingType = mixingType; | ||||
} | } | ||||
EvtCPUtil* EvtCPUtil::getInstance() | EvtCPUtil* EvtCPUtil::getInstance() | ||||
{ | { | ||||
static EvtCPUtil* theCPUtil = 0; | static EvtCPUtil* theCPUtil = nullptr; | ||||
if ( theCPUtil == 0 ) { | if ( theCPUtil == nullptr ) { | ||||
theCPUtil = new EvtCPUtil( 1 ); | theCPUtil = new EvtCPUtil( 1 ); | ||||
} | } | ||||
return theCPUtil; | return theCPUtil; | ||||
} | } | ||||
//added two functions for finding the fraction of B0 tags for decays into | //added two functions for finding the fraction of B0 tags for decays into | ||||
//both CP eigenstates and non-CP eigenstates -- NK, Jan. 27th, 1998 | //both CP eigenstates and non-CP eigenstates -- NK, Jan. 27th, 1998 | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | void EvtCPUtil::OtherCoherentB( EvtParticle* p, double& t, EvtId& otherb, | ||||
// now get the time between the decay of this B and the other B! | // now get the time between the decay of this B and the other B! | ||||
EvtParticle* parent = p->getParent(); | EvtParticle* parent = p->getParent(); | ||||
EvtParticle* other; | EvtParticle* other; | ||||
bool incoherentmix = false; | bool incoherentmix = false; | ||||
if ( ( parent != 0 ) && ( parent->getId() == B0 || parent->getId() == B0B || | if ( ( parent != nullptr ) && | ||||
( parent->getId() == B0 || parent->getId() == B0B || | |||||
parent->getId() == BS || parent->getId() == BSB ) ) { | parent->getId() == BS || parent->getId() == BSB ) ) { | ||||
incoherentmix = true; | incoherentmix = true; | ||||
} | } | ||||
if ( incoherentmix ) | if ( incoherentmix ) | ||||
parent = parent->getParent(); | parent = parent->getParent(); | ||||
if ( parent == 0 || parent->getId() != UPS4S ) { | if ( parent == nullptr || parent->getId() != UPS4S ) { | ||||
//Need to make this more general, but for now | //Need to make this more general, but for now | ||||
//assume no parent. If we have parent of B we | //assume no parent. If we have parent of B we | ||||
//need to charge conj. full decay tree. | //need to charge conj. full decay tree. | ||||
if ( parent != 0 ) { | if ( parent != nullptr ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "p=" << EvtPDL::name( p->getId() ) | << "p=" << EvtPDL::name( p->getId() ) | ||||
<< " parent=" << EvtPDL::name( parent->getId() ) << endl; | << " parent=" << EvtPDL::name( parent->getId() ) << endl; | ||||
} | } | ||||
assert( parent == 0 ); | assert( parent == 0 ); | ||||
p->setLifetime(); | p->setLifetime(); | ||||
t = p->getLifetime(); | t = p->getLifetime(); | ||||
bool needToChargeConj = false; | bool needToChargeConj = false; | ||||
Show All 22 Lines | if ( parent == nullptr || parent->getId() != UPS4S ) { | ||||
other = parent->getDaug( 0 ); | other = parent->getDaug( 0 ); | ||||
idaug = 0; | idaug = 0; | ||||
} else { | } else { | ||||
other = parent->getDaug( 1 ); | other = parent->getDaug( 1 ); | ||||
idaug = 1; | idaug = 1; | ||||
} | } | ||||
} | } | ||||
if ( parent != 0 ) { | if ( parent != nullptr ) { | ||||
//if (entryCount>1){ | //if (entryCount>1){ | ||||
// EvtGenReport(EVTGEN_INFO,"EvtGen") << "Double CP decay:"<<entryCount<<endl; | // EvtGenReport(EVTGEN_INFO,"EvtGen") << "Double CP decay:"<<entryCount<<endl; | ||||
//} | //} | ||||
//kludge!! Lange Mar21, 2003 | //kludge!! Lange Mar21, 2003 | ||||
// if the other B is an alias... don't change the flavor.. | // if the other B is an alias... don't change the flavor.. | ||||
if ( other->getId().isAlias() ) { | if ( other->getId().isAlias() ) { | ||||
OtherB( p, t, otherb ); | OtherB( p, t, otherb ); | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | void EvtCPUtil::OtherB( EvtParticle* p, double& t, EvtId& otherb ) | ||||
static EvtId UPS4 = EvtPDL::getId( "Upsilon(4S)" ); | static EvtId UPS4 = EvtPDL::getId( "Upsilon(4S)" ); | ||||
if ( p->getId() == BS0 || p->getId() == BSB ) { | if ( p->getId() == BS0 || p->getId() == BSB ) { | ||||
static double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) ); | static double ctauL = EvtPDL::getctau( EvtPDL::getId( "B_s0L" ) ); | ||||
static double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) ); | static double ctauH = EvtPDL::getctau( EvtPDL::getId( "B_s0H" ) ); | ||||
static double ctau = ctauL < ctauH ? ctauH : ctauL; | static double ctau = ctauL < ctauH ? ctauH : ctauL; | ||||
t = -log( EvtRandom::Flat() ) * ctau; | t = -log( EvtRandom::Flat() ) * ctau; | ||||
EvtParticle* parent = p->getParent(); | EvtParticle* parent = p->getParent(); | ||||
if ( parent != 0 && ( parent->getId() == BS0 || parent->getId() == BSB ) ) { | if ( parent != nullptr && | ||||
( parent->getId() == BS0 || parent->getId() == BSB ) ) { | |||||
if ( parent->getId() == BS0 ) | if ( parent->getId() == BS0 ) | ||||
otherb = BSB; | otherb = BSB; | ||||
if ( parent->getId() == BSB ) | if ( parent->getId() == BSB ) | ||||
otherb = BS0; | otherb = BS0; | ||||
parent->setLifetime( t ); | parent->setLifetime( t ); | ||||
return; | return; | ||||
} | } | ||||
if ( p->getId() == BS0 ) | if ( p->getId() == BS0 ) | ||||
otherb = BSB; | otherb = BSB; | ||||
if ( p->getId() == BSB ) | if ( p->getId() == BSB ) | ||||
otherb = BS0; | otherb = BS0; | ||||
p->setLifetime( t ); | p->setLifetime( t ); | ||||
return; | return; | ||||
} | } | ||||
if ( p->getId() == D0 || p->getId() == D0B ) { | if ( p->getId() == D0 || p->getId() == D0B ) { | ||||
static double ctauL = EvtPDL::getctau( EvtPDL::getId( "D0L" ) ); | static double ctauL = EvtPDL::getctau( EvtPDL::getId( "D0L" ) ); | ||||
static double ctauH = EvtPDL::getctau( EvtPDL::getId( "D0H" ) ); | static double ctauH = EvtPDL::getctau( EvtPDL::getId( "D0H" ) ); | ||||
static double ctau = ctauL < ctauH ? ctauH : ctauL; | static double ctau = ctauL < ctauH ? ctauH : ctauL; | ||||
t = -log( EvtRandom::Flat() ) * ctau; | t = -log( EvtRandom::Flat() ) * ctau; | ||||
EvtParticle* parent = p->getParent(); | EvtParticle* parent = p->getParent(); | ||||
if ( parent != 0 && ( parent->getId() == D0 || parent->getId() == D0B ) ) { | if ( parent != nullptr && | ||||
( parent->getId() == D0 || parent->getId() == D0B ) ) { | |||||
if ( parent->getId() == D0 ) | if ( parent->getId() == D0 ) | ||||
otherb = D0B; | otherb = D0B; | ||||
if ( parent->getId() == D0B ) | if ( parent->getId() == D0B ) | ||||
otherb = D0; | otherb = D0; | ||||
parent->setLifetime( t ); | parent->setLifetime( t ); | ||||
return; | return; | ||||
} | } | ||||
if ( p->getId() == D0 ) | if ( p->getId() == D0 ) | ||||
otherb = D0B; | otherb = D0B; | ||||
if ( p->getId() == D0B ) | if ( p->getId() == D0B ) | ||||
otherb = D0; | otherb = D0; | ||||
p->setLifetime( t ); | p->setLifetime( t ); | ||||
return; | return; | ||||
} | } | ||||
p->setLifetime(); | p->setLifetime(); | ||||
// now get the time between the decay of this B and the other B! | // now get the time between the decay of this B and the other B! | ||||
EvtParticle* parent = p->getParent(); | EvtParticle* parent = p->getParent(); | ||||
if ( parent == 0 || parent->getId() != UPS4 ) { | if ( parent == nullptr || parent->getId() != UPS4 ) { | ||||
//EvtGenReport(EVTGEN_ERROR,"EvtGen") << | //EvtGenReport(EVTGEN_ERROR,"EvtGen") << | ||||
// "Warning CP violation with B having no parent!"<<endl; | // "Warning CP violation with B having no parent!"<<endl; | ||||
t = p->getLifetime(); | t = p->getLifetime(); | ||||
if ( p->getId() == B0 ) | if ( p->getId() == B0 ) | ||||
otherb = B0B; | otherb = B0B; | ||||
if ( p->getId() == B0B ) | if ( p->getId() == B0B ) | ||||
otherb = B0; | otherb = B0; | ||||
if ( p->getId() == BS0 ) | if ( p->getId() == BS0 ) | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |