本文整理汇总了C++中hepmc::GenEvent::signal_process_vertex方法的典型用法代码示例。如果您正苦于以下问题:C++ GenEvent::signal_process_vertex方法的具体用法?C++ GenEvent::signal_process_vertex怎么用?C++ GenEvent::signal_process_vertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hepmc::GenEvent
的用法示例。
在下文中一共展示了GenEvent::signal_process_vertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process_event
int HFMLTriggerHepMCTrigger::process_event(PHCompositeNode* topNode)
{
assert(m_Geneventmap);
PHHepMCGenEvent* genevt = m_Geneventmap->get(_embedding_id);
if (!genevt)
{
std::cout << PHWHERE << " - Fatal error - node PHHepMCGenEventMap missing subevent with embedding ID " << _embedding_id;
std::cout << ". Print PHHepMCGenEventMap:";
m_Geneventmap->identify();
return Fun4AllReturnCodes::ABORTRUN;
}
HepMC::GenEvent* theEvent = genevt->getEvent();
assert(theEvent);
if (Verbosity() >= VERBOSITY_MORE)
{
cout << "HFMLTriggerHepMCTrigger::process_event - process HepMC::GenEvent with signal_process_id = "
<< theEvent->signal_process_id();
if (theEvent->signal_process_vertex())
{
cout << " and signal_process_vertex : ";
theEvent->signal_process_vertex()->print();
}
cout << " - Event record:" << endl;
theEvent->print();
}
TDatabasePDG* pdg = TDatabasePDG::Instance();
int targetPID = std::abs(pdg->GetParticle("D0")->PdgCode());
int daughter1PID = std::abs(pdg->GetParticle("pi+")->PdgCode());
int daughter2PID = std::abs(pdg->GetParticle("K+")->PdgCode());
bool acceptEvent = false;
assert(m_hNorm);
m_hNorm->Fill("Event", 1);
unsigned int nD0(0);
unsigned int nD0PiK(0);
auto range = theEvent->particle_range();
for (HepMC::GenEvent::particle_const_iterator piter = range.begin(); piter != range.end(); ++piter)
{
const HepMC::GenParticle* p = *piter;
assert(p);
if (std::abs(p->pdg_id()) == targetPID)
{
if (Verbosity())
{
cout << "HFMLTriggerHepMCTrigger::process_event - Accept signal particle : ";
p->print();
cout << endl;
}
m_hNorm->Fill("D0", 1);
++nD0;
assert(m_DRapidity);
const double rapidity = 0.5 * log((p->momentum().e() + p->momentum().z()) /
(p->momentum().e() - p->momentum().z()));
m_DRapidity->Fill(rapidity, 0);
const HepMC::GenVertex* decayVertex = p->end_vertex();
int hasDecay1(0);
int hasDecay2(0);
int hasDecayOther(0);
if (decayVertex)
{
for (auto diter = decayVertex->particles_out_const_begin();
diter != decayVertex->particles_out_const_end();
++diter)
{
const HepMC::GenParticle* pd = *diter;
assert(pd);
if (Verbosity())
{
cout << "HFMLTriggerHepMCTrigger::process_event - Testing daughter particle: ";
pd->print();
cout << endl;
}
if (std::abs(pd->pdg_id()) == daughter1PID)
{
const double eta = pd->momentum().eta();
if (eta > _eta_min and eta < _eta_max)
++hasDecay1;
}
else if (std::abs(pd->pdg_id()) == daughter2PID)
{
const double eta = pd->momentum().eta();
//.........这里部分代码省略.........