ATLAS Offline Software
Loading...
Searching...
No Matches
GenParticle.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4/* Author: Andrii Verbytskyi andrii.verbytskyi@mpp.mpg.de */
5
6#ifndef ATLASHEPMC_GENPARTICLE_H
7#define ATLASHEPMC_GENPARTICLE_H
8#include "HepMC3/GenParticle.h"
9#include "HepMC3/PrintStreams.h"
10#include "AtlasHepMC/Barcode.h"
12#include "AtlasHepMC/Flow.h"
13namespace HepMC3 {
16inline std::ostream& operator << (std::ostream& os, GenParticlePtr p) {ConstGenParticlePtr cp = p; Print::line(os, std::move(cp)); return os; }
17}
18namespace HepMC {
19typedef HepMC3::GenParticlePtr GenParticlePtr;
20typedef HepMC3::ConstGenParticlePtr ConstGenParticlePtr;
21inline GenParticlePtr newGenParticlePtr(const HepMC3::FourVector &mom = HepMC3::FourVector::ZERO_VECTOR(), int pid = 0, int status = 0) {
22 return std::make_shared<HepMC3::GenParticle>(mom, pid, status);
23}
24inline ConstGenParticlePtr newConstGenParticlePtr(const HepMC3::FourVector &mom = HepMC3::FourVector::ZERO_VECTOR(), int pid = 0, int status = 0) {
25 return std::make_shared<const HepMC3::GenParticle>(mom, pid, status);
26}
27inline int barcode_or_id(const ConstGenParticlePtr& p) { return p->id(); }
28
29using HepMC3::GenParticle;
30}
31#endif
std::ostream & operator<<(std::ostream &os, GenParticlePtr p)
Print one-line info with idiomatic C++ printing.
Definition GenParticle.h:16
ConstGenParticlePtr newConstGenParticlePtr(const HepMC3::FourVector &mom=HepMC3::FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Definition GenParticle.h:24
GenParticlePtr newGenParticlePtr(const HepMC3::FourVector &mom=HepMC3::FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Definition GenParticle.h:21
int barcode_or_id(const ConstGenParticlePtr &p)
Definition GenParticle.h:27
int status(const T &p)
HepMC3::GenParticlePtr GenParticlePtr
Definition GenParticle.h:19
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition GenParticle.h:20