本文整理汇总了C++中Particle_Vector::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Particle_Vector::end方法的具体用法?C++ Particle_Vector::end怎么用?C++ Particle_Vector::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Particle_Vector
的用法示例。
在下文中一共展示了Particle_Vector::end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetermineMixingTime
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;
}
示例2: 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());
}
示例3: 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);
}
示例4: 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;
}
示例5: fslep
Return_Value::code Signal_Process_FS_QED_Correction::Treat
(Blob_List * bloblist, double & weight)
{
if (!m_on) return Return_Value::Nothing;
if (bloblist->empty()) {
msg_Error()<<"Signal_Process_FS_QED_Correction::Treat"
<<"("<<bloblist<<","<<weight<<"): "<<endl
<<" Blob list contains "<<bloblist->size()<<" entries."<<endl
<<" Continue and hope for the best."<<endl;
return Return_Value::Error;
}
// look for QCD corrected hard process in need for QED
Blob * sigblob(bloblist->FindLast(btp::Shower));
if (!sigblob) return Return_Value::Nothing;
// if already treated -> nothing to do
if (sigblob->TypeSpec()=="YFS-type_QED_Corrections_to_ME")
return Return_Value::Nothing;
if (sigblob->TypeSpec()=="setting_leptons_on-shell")
return Return_Value::Nothing;
// extract FS leptons
// two vectors -> the ones from the blob and the ones to be massive
DEBUG_FUNC(m_qed);
Particle_Vector fslep(sigblob->GetOutParticles());
Particle_Vector mfslep;
for (Particle_Vector::iterator it=fslep.begin();it!=fslep.end();) {
if ((*it)->Flav().Strong() || (*it)->Flav().IsDiQuark() ||
(*it)->DecayBlob()!=NULL) {
fslep.erase(it);
}
else {
mfslep.push_back(new Particle(-1,(*it)->Flav(),(*it)->Momentum(),'F'));
(*mfslep.rbegin())->SetNumber(0);
(*mfslep.rbegin())->SetOriginalPart(*it);
(*mfslep.rbegin())->SetFinalMass((*it)->FinalMass());
++it;
}
}
// if no leptons, nothing to do
// if only one lepton, cannot do anything
if (fslep.size()<2) {
sigblob->UnsetStatus(blob_status::needs_extraQED);
for (Particle_Vector::iterator it=mfslep.begin();it!=mfslep.end();++it)
delete *it;
return Return_Value::Nothing;
}
// if switched off or no need for QED stop here and build a blob
if (!m_qed || !sigblob->Has(blob_status::needs_extraQED)) {
Blob * onshellblob = bloblist->AddBlob(btp::QED_Radiation);
onshellblob->SetTypeSpec("setting_leptons_on-shell");
if (sigblob->Has(blob_status::needs_extraQED))
sigblob->UnsetStatus(blob_status::needs_extraQED);
for (Particle_Vector::iterator it=fslep.begin();it!=fslep.end();++it) {
(*it)->SetInfo('H');
(*it)->SetStatus(part_status::decayed);
onshellblob->AddToInParticles(*it);
}
for (Particle_Vector::iterator it=mfslep.begin();it!=mfslep.end();++it) {
onshellblob->AddToOutParticles(*it);
}
onshellblob->SetStatus(blob_status::needs_hadronization);
return Return_Value::Success;
}
// put them on-shell (spoils consistency of pertubative calculation,
// but necessary for YFS)
if (!PutOnMassShell(mfslep)) {
msg_Error()<<"Signal_Process_FS_QED_Correction::Treat("
<<bloblist<<","<<weight<<"): \n"
<<" Leptons could not be put on their mass shell.\n"
<<" Trying new event.\n"
<<" The event contained a ";
for (Particle_Vector::iterator it=mfslep.begin();it!=mfslep.end();++it)
msg_Error()<<(*it)->Flav().ShellName()<<"-";
if (mfslep.size()==2) msg_Error()<<"pair";
else msg_Error()<<"set";
msg_Error()<<" of too little invariant mass to be put\n"
<<" on their mass shell. If you are sensitive to this specific"
<<" signature consider\n to set the respective particles"
<<" massive in the perturbative calculation using\n"
<<" 'MASSIVE[<id>]=1' to avoid this problem.\n";
for (Particle_Vector::iterator it=mfslep.begin();it!=mfslep.end();++it)
delete *it;
return Return_Value::New_Event;
}
// build effective verteces for resonant production
// use subprocess infos if possible
Blob_Vector blobs = BuildResonantBlobs(mfslep);
// add radiation
for (Blob_Vector::iterator it=blobs.begin();it!=blobs.end();++it) {
// do nothing if no resonance determined
if ((*it)->InParticle(0)->Flav().Kfcode()!=kf_none) {
(*it)->SetStatus(blob_status::needs_extraQED);
if (!p_sphotons->AddRadiation(*it)) {
msg_Error()<<"Signal_Process_FS_QED_Correction::Treat("<<bloblist
<<","<<weight<<"): "<<endl
<<" Higher order QED corrections failed."<<endl
<<" Retrying event."<<endl;
for (Particle_Vector::iterator it=mfslep.begin();it!=mfslep.end();++it)
delete *it;
for (Blob_Vector::iterator it=blobs.begin();it!=blobs.end();++it)
delete *it;
//.........这里部分代码省略.........