本文整理汇总了C++中Particle_Vector::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ Particle_Vector::erase方法的具体用法?C++ Particle_Vector::erase怎么用?C++ Particle_Vector::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Particle_Vector
的用法示例。
在下文中一共展示了Particle_Vector::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sum
void Signal_Process_FS_QED_Correction::FillBlob
(Blob * blob, const Flavour& resflav, Particle_Vector& pv)
{
Vec4D sum(MomentumSum(pv));
for (Particle_Vector::iterator it=pv.begin();it!=pv.end();) {
blob->AddToOutParticles(*it);
pv.erase(it);
}
blob->AddToInParticles(new Particle(-1,resflav,sum,'R'));
blob->InParticle(0)->SetFinalMass(blob->InParticle(0)->Momentum().Mass());
}
示例2: onlyleptons
void Signal_Process_FS_QED_Correction::FillBlob
(Blob * blob, const Subprocess_Info& spi, Particle_Vector& pv)
{
// find the leptons owned by this subprocess
Particle_Vector localpv;
bool onlyleptons(true);
for (size_t i=0;i<spi.m_ps.size();++i) {
if (spi.m_ps[i].m_fl.Strong()) onlyleptons=false;
for (Particle_Vector::iterator it=pv.begin();it!=pv.end();) {
if ((*it)->Flav()==spi.m_ps[i].m_fl) {
localpv.push_back(*it);
pv.erase(it);
}
else ++it;
}
}
if (onlyleptons) FillBlob(blob,spi.m_fl,localpv);
else FillBlob(blob,DetermineGenericResonance(localpv),localpv);
}
示例3: mdist
bool Signal_Process_FS_QED_Correction::FindResonances
(Particle_Vector& pv,std::vector<Particle_Vector>& rpvs,Flavour_Vector& rfl,
const Vertex_List& vlist)
{
if (vlist.empty()) return false;
DEBUG_FUNC("find resonances in "<<pv.size()<<" particles");
// find a combination in pv for which a vertex exists such that the
// IS flavour is on-shell within m_resdist times its width
// book-keep first to later disentangle competing resonances
// need to book-keep i,j,k,abs(mij-mk)/wk
std::map<double,std::vector<size_t> > restab;
for (size_t i(0);i<pv.size();++i) {
for (size_t j(i+1);j<pv.size();++j) {
for (size_t k(0);k<vlist.size();++k) {
double mdist(abs((pv[i]->Momentum()+pv[j]->Momentum()).Mass()
-vlist[k]->in[0].Mass())/vlist[k]->in[0].Width());
if (vlist[k]->nleg==3 &&
((pv[i]->Flav()==vlist[k]->in[1] &&
pv[j]->Flav()==vlist[k]->in[2]) ||
(pv[i]->Flav()==vlist[k]->in[2] &&
pv[j]->Flav()==vlist[k]->in[1])) &&
mdist<m_resdist) {
size_t ida[3]={i,j,k};
restab[mdist]=std::vector<size_t>(ida,ida+3);
}
}
}
}
if (restab.empty()) {
msg_Debugging()<<"no resonances found"<<std::endl;
return false;
}
if (msg_LevelIsDebugging()) {
msg_Debugging()<<"resonances found:\n";
for (std::map<double,std::vector<size_t> >::const_iterator
it=restab.begin();it!=restab.end();++it)
msg_Debugging()<<it->second[0]<<it->second[1]<<it->second[2]<<": "
<<vlist[it->second[2]]->in[0]<<" -> "
<<vlist[it->second[2]]->in[1]<<" "
<<vlist[it->second[2]]->in[2]
<<", |m-M|/W="<<it->first<<std::endl;
}
Particle_Vector usedparts;
for (std::map<double,std::vector<size_t> >::const_iterator it=restab.begin();
it!=restab.end();++it) {
bool valid(true);
for (size_t i(0);i<usedparts.size();++i)
if (pv[it->second[0]]==usedparts[i] ||
pv[it->second[1]]==usedparts[i]) { valid=false; break; }
if (!valid) continue;
usedparts.push_back(pv[it->second[0]]);
usedparts.push_back(pv[it->second[1]]);
msg_Debugging()<<"constructing decay: "<<vlist[it->second[2]]->in[0]<<" -> "
<<vlist[it->second[2]]->in[1]<<" "
<<vlist[it->second[2]]->in[2]<<"\n";
rfl.push_back(vlist[it->second[2]]->in[0]);
Particle_Vector parts;
parts.push_back(pv[it->second[0]]);
parts.push_back(pv[it->second[1]]);
rpvs.push_back(parts);
}
for (Particle_Vector::iterator it=usedparts.begin();it!=usedparts.end();++it)
for (Particle_Vector::iterator pit=pv.begin();pit!=pv.end();++pit)
if (*it==*pit) { pv.erase(pit); break; }
return true;
}