double Mixing_Handler::DetermineMixingTime(Particle* decayer, bool checkforpartstatus) const { double time = decayer->Time(); Blob* motherblob = decayer->ProductionBlob(); if(motherblob->Type()==btp::Hadron_Mixing) { decayer = motherblob->InParticle(0); motherblob = decayer->ProductionBlob(); } Particle* sister = NULL; if(motherblob->Type()!=btp::Fragmentation || (motherblob->NInP()==2 && motherblob->NOutP()==2 && motherblob->InParticle(0)->Flav()==motherblob->OutParticle(0)->Flav() && motherblob->InParticle(1)->Flav()==motherblob->OutParticle(1)->Flav())) { // check if particle was produced coherently Particle_Vector sisters = motherblob->GetOutParticles(); for(Particle_Vector::const_iterator it=sisters.begin(); it!=sisters.end(); it++) { if((*it)!=decayer && decayer->Flav()==(*it)->Flav().Bar()) { sister = (*it); break; } } } // in coherent production, special rules apply: if(sister) { if((checkforpartstatus && sister->Status()==part_status::decayed) || (!checkforpartstatus && sister->DecayBlob())) { time = time - sister->Time(); } else time = 0.0; } return time; }
void Hadron_Decay_Handler::SetPosition(ATOOLS::Blob* blob) { Particle* inpart = blob->InParticle(0); if(inpart->Flav().Kfcode()==kf_K) { blob->SetPosition(inpart->XProd()); return; } // boost lifetime into lab double gamma = 1./rpa->gen.Accu(); if (inpart->Flav().HadMass()>rpa->gen.Accu()) { gamma = inpart->E()/inpart->Flav().HadMass(); } else { double q2 = dabs(inpart->Momentum().Abs2()); if (q2>rpa->gen.Accu()) gamma = inpart->E()/sqrt(q2); } double lifetime_boosted = gamma * inpart->Time(); Vec3D spatial = inpart->Distance( lifetime_boosted ); Vec4D position = Vec4D( lifetime_boosted*rpa->c(), spatial ); blob->SetPosition( inpart->XProd() + position ); // in mm }