本文整理汇总了C++中hepmc::GenEvent::particles_size方法的典型用法代码示例。如果您正苦于以下问题:C++ GenEvent::particles_size方法的具体用法?C++ GenEvent::particles_size怎么用?C++ GenEvent::particles_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hepmc::GenEvent
的用法示例。
在下文中一共展示了GenEvent::particles_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Output_Delphes::AnalyseEvent
(ExRootTreeBranch *branch,const HepMC::GenEvent& evt,
const Long64_t eventNumber,const double weight)
{
TRootLHEFEvent *element;
element = static_cast<TRootLHEFEvent*>(branch->NewEntry());
element->Number = eventNumber;
element->Nparticles = evt.particles_size();
element->ProcessID = evt.signal_process_id();
element->Weight = weight;
element->ScalePDF = evt.event_scale();
element->CouplingQED = evt.alphaQED();
element->CouplingQCD = evt.alphaQCD();
}
示例2: AnalyseParticles
void Output_Delphes::AnalyseParticles(ExRootTreeBranch *branch, const HepMC::GenEvent& evt)
{
TRootC::GenParticle *element;
TLorentzVector momentum;
Double_t signPz;
ReadStats();
for(int n=1; n<=evt.particles_size(); n++) {
int mo1, mo2, da1, da2, status, pid;
getStatsFromTuple(mo1,mo2,da1,da2,status,pid,n);
element = static_cast<TRootC::GenParticle*>(branch->NewEntry());
element->PID = pid;
element->Status = status;
element->M1 = mo1 - 1; // added -1 as the numbering in the tree starts from 0
element->M2 = mo2 - 1;
element->D1 = da1 - 1;
element->D2 = da2 - 1;
element->E = index_to_particle[n]->momentum().e();
element->Px = index_to_particle[n]->momentum().px();
element->Py = index_to_particle[n]->momentum().py();
element->Pz = index_to_particle[n]->momentum().pz();
element->PT = sqrt(pow(element->Px,2)+pow(element->Py,2));
momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E);
signPz = (element->Pz >= 0.0) ? 1.0 : -1.0;
element->Eta = element->PT < 1e-6 ? signPz*999.9 : momentum.Eta();
element->Phi = index_to_particle[n]->momentum().phi();
HepMC::GenVertex* vrtI = (index_to_particle[n])->production_vertex();
HepMC::GenVertex::particles_in_const_iterator partI;
if(vrtI) {
element->T = vrtI->position().t();
element->X = vrtI->position().x();
element->Y = vrtI->position().y();
element->Z = vrtI->position().z();
}
else {
element->T = 0.;
element->X = 0.;
element->Y = 0.;
element->Z = 0.;
}
}
}