Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtParticle.cpp
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void EvtParticle::initDecay( bool useMinMass ) | void EvtParticle::initDecay( bool useMinMass ) | ||||
{ | { | ||||
EvtParticle* p = this; | EvtParticle* p = this; | ||||
// carefull - the parent mass might be fixed in stone.. | // carefull - the parent mass might be fixed in stone.. | ||||
EvtParticle* par = p->getParent(); | EvtParticle* par = p->getParent(); | ||||
double parMass = -1.; | double parMass = -1.; | ||||
if ( par != nullptr ) { | if ( par ) { | ||||
if ( par->hasValidP4() ) | if ( par->hasValidP4() ) | ||||
parMass = par->mass(); | parMass = par->mass(); | ||||
for ( size_t i = 0; i < par->getNDaug(); i++ ) { | for ( size_t i = 0; i < par->getNDaug(); i++ ) { | ||||
EvtParticle* tDaug = par->getDaug( i ); | EvtParticle* tDaug = par->getDaug( i ); | ||||
if ( p != tDaug ) | if ( p != tDaug ) | ||||
parMass -= EvtPDL::getMinMass( tDaug->getId() ); | parMass -= EvtPDL::getMinMass( tDaug->getId() ); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | void EvtParticle::initDecay( bool useMinMass ) | ||||
//added by Lange Jan4,2000 | //added by Lange Jan4,2000 | ||||
static EvtId BS0 = EvtPDL::getId( "B_s0" ); | static EvtId BS0 = EvtPDL::getId( "B_s0" ); | ||||
static EvtId BSB = EvtPDL::getId( "anti-B_s0" ); | static EvtId BSB = EvtPDL::getId( "anti-B_s0" ); | ||||
static EvtId BD0 = EvtPDL::getId( "B0" ); | static EvtId BD0 = EvtPDL::getId( "B0" ); | ||||
static EvtId BDB = EvtPDL::getId( "anti-B0" ); | static EvtId BDB = EvtPDL::getId( "anti-B0" ); | ||||
static EvtId D0 = EvtPDL::getId( "D0" ); | static EvtId D0 = EvtPDL::getId( "D0" ); | ||||
static EvtId D0B = EvtPDL::getId( "anti-D0" ); | static EvtId D0B = EvtPDL::getId( "anti-D0" ); | ||||
static EvtId U4S = EvtPDL::getId( "Upsilon(4S)" ); | static EvtId U4S = EvtPDL::getId( "Upsilon(4S)" ); | ||||
static EvtIdSet borUps( BS0, BSB, BD0, BDB, U4S ); | static EvtIdSet borUps{ BS0, BSB, BD0, BDB, U4S }; | ||||
//only makes sense if there is no parent particle which is a B or an Upsilon | //only makes sense if there is no parent particle which is a B or an Upsilon | ||||
bool hasBorUps = false; | bool hasBorUps = false; | ||||
if ( getParent() && borUps.contains( getParent()->getId() ) ) | if ( getParent() && borUps.contains( getParent()->getId() ) ) | ||||
hasBorUps = true; | hasBorUps = true; | ||||
// if ( (getNDaug()==0)&&(getParent()==0) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){ | // if ( (getNDaug()==0)&&(getParent()==0) && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB)){ | ||||
EvtId thisId = getId(); | EvtId thisId = getId(); | ||||
// remove D0 mixing for now. | // remove D0 mixing for now. | ||||
▲ Show 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | |||||
EvtVector4R EvtParticle::getP4Lab() const | EvtVector4R EvtParticle::getP4Lab() const | ||||
{ | { | ||||
EvtVector4R temp, mom; | EvtVector4R temp, mom; | ||||
const EvtParticle* ptemp; | const EvtParticle* ptemp; | ||||
temp = this->getP4(); | temp = this->getP4(); | ||||
ptemp = this; | ptemp = this; | ||||
while ( ptemp->getParent() != nullptr ) { | while ( ptemp->getParent() ) { | ||||
ptemp = ptemp->getParent(); | ptemp = ptemp->getParent(); | ||||
mom = ptemp->getP4(); | mom = ptemp->getP4(); | ||||
temp = boostTo( temp, mom ); | temp = boostTo( temp, mom ); | ||||
} | } | ||||
return temp; | return temp; | ||||
} | } | ||||
EvtVector4R EvtParticle::getP4LabBeforeFSR() | EvtVector4R EvtParticle::getP4LabBeforeFSR() | ||||
{ | { | ||||
EvtVector4R temp, mom; | EvtVector4R temp, mom; | ||||
EvtParticle* ptemp; | EvtParticle* ptemp; | ||||
temp = this->_pBeforeFSR; | temp = this->_pBeforeFSR; | ||||
ptemp = this; | ptemp = this; | ||||
while ( ptemp->getParent() != nullptr ) { | while ( ptemp->getParent() ) { | ||||
ptemp = ptemp->getParent(); | ptemp = ptemp->getParent(); | ||||
mom = ptemp->getP4(); | mom = ptemp->getP4(); | ||||
temp = boostTo( temp, mom ); | temp = boostTo( temp, mom ); | ||||
} | } | ||||
return temp; | return temp; | ||||
} | } | ||||
EvtVector4R EvtParticle::getP4Restframe() const | EvtVector4R EvtParticle::getP4Restframe() const | ||||
{ | { | ||||
return EvtVector4R( mass(), 0.0, 0.0, 0.0 ); | return EvtVector4R( mass(), 0.0, 0.0, 0.0 ); | ||||
} | } | ||||
EvtVector4R EvtParticle::get4Pos() const | EvtVector4R EvtParticle::get4Pos() const | ||||
{ | { | ||||
EvtVector4R temp, mom; | EvtVector4R temp, mom; | ||||
EvtParticle* ptemp; | EvtParticle* ptemp; | ||||
temp.set( 0.0, 0.0, 0.0, 0.0 ); | temp.set( 0.0, 0.0, 0.0, 0.0 ); | ||||
ptemp = getParent(); | ptemp = getParent(); | ||||
if ( ptemp == nullptr ) | if ( !ptemp ) { | ||||
return temp; | return temp; | ||||
} | |||||
temp = ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() ); | temp = ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() ); | ||||
while ( ptemp->getParent() != nullptr ) { | while ( ptemp->getParent() ) { | ||||
ptemp = ptemp->getParent(); | ptemp = ptemp->getParent(); | ||||
mom = ptemp->getP4(); | mom = ptemp->getP4(); | ||||
temp = boostTo( temp, mom ); | temp = boostTo( temp, mom ); | ||||
temp = temp + ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() ); | temp = temp + ( ptemp->_t / ptemp->mass() ) * ( ptemp->getP4() ); | ||||
} | } | ||||
return temp; | return temp; | ||||
} | } | ||||
EvtParticle* EvtParticle::nextIter( EvtParticle* rootOfTree ) | EvtParticle* EvtParticle::nextIter( EvtParticle* rootOfTree ) | ||||
{ | { | ||||
EvtParticle* bpart; | EvtParticle* bpart; | ||||
EvtParticle* current; | EvtParticle* current; | ||||
current = this; | current = this; | ||||
size_t i; | size_t i; | ||||
if ( _ndaug != 0 ) | if ( _ndaug != 0 ) | ||||
return _daug[0]; | return _daug[0]; | ||||
do { | do { | ||||
bpart = current->_parent; | bpart = current->_parent; | ||||
if ( bpart == nullptr ) | if ( !bpart ) { | ||||
return nullptr; | return nullptr; | ||||
} | |||||
i = 0; | i = 0; | ||||
while ( bpart->_daug[i] != current ) { | while ( bpart->_daug[i] != current ) { | ||||
i++; | i++; | ||||
} | } | ||||
if ( bpart == rootOfTree ) { | if ( bpart == rootOfTree ) { | ||||
if ( i + 1 == bpart->_ndaug ) | if ( i + 1 == bpart->_ndaug ) { | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
} | |||||
i++; | i++; | ||||
current = bpart; | current = bpart; | ||||
} while ( i >= bpart->_ndaug ); | } while ( i >= bpart->_ndaug ); | ||||
return bpart->_daug[i]; | return bpart->_daug[i]; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |