26 if (lx->pid() != rx->pid())
return (lx->pid() < rx->pid());
27 if (lx->status() != rx->status())
return (lx->status() < rx->status());
29 return (lx->momentum().e() < rx->momentum().e());
36 if (lx.second != rx.second)
return (lx.second < rx.second);
37 if (lx.first->particles_in().size() != rx.first->particles_in().size())
return (lx.first->particles_in().size() < rx.first->particles_in().size());
38 if (lx.first->particles_out().size() != rx.first->particles_out().size())
return (lx.first->particles_out().size() < rx.first->particles_out().size());
40 std::vector<int> lx_id_in;
41 std::vector<int> rx_id_in;
42 for (ConstGenParticlePtr pp: lx.first->particles_in()) lx_id_in.push_back(pp->pid());
43 for (ConstGenParticlePtr pp: rx.first->particles_in()) rx_id_in.push_back(pp->pid());
44 std::sort(lx_id_in.begin(), lx_id_in.end());
45 std::sort(rx_id_in.begin(), rx_id_in.end());
46 for (
unsigned int i = 0; i < lx_id_in.size(); i++)
if (lx_id_in[i] != rx_id_in[i])
return (lx_id_in[i] < rx_id_in[i]);
48 std::vector<int> lx_id_out;
49 std::vector<int> rx_id_out;
50 for (ConstGenParticlePtr pp: lx.first->particles_in()) lx_id_out.push_back(pp->pid());
51 for (ConstGenParticlePtr pp: rx.first->particles_in()) rx_id_out.push_back(pp->pid());
52 std::sort(lx_id_out.begin(), lx_id_out.end());
53 std::sort(rx_id_out.begin(), rx_id_out.end());
54 for (
unsigned int i = 0; i < lx_id_out.size(); i++)
if (lx_id_out[i] != rx_id_out[i])
return (lx_id_out[i] < rx_id_out[i]);
56 std::vector<double> lx_mom_in;
57 std::vector<double> rx_mom_in;
58 for (ConstGenParticlePtr pp: lx.first->particles_in()) lx_mom_in.push_back(pp->momentum().e());
59 for (ConstGenParticlePtr pp: rx.first->particles_in()) rx_mom_in.push_back(pp->momentum().e());
60 std::sort(lx_mom_in.begin(), lx_mom_in.end());
61 std::sort(rx_mom_in.begin(), rx_mom_in.end());
62 for (
unsigned int i = 0; i < lx_mom_in.size(); i++)
if (lx_mom_in[i] != rx_mom_in[i])
return (lx_mom_in[i] < rx_mom_in[i]);
64 std::vector<double> lx_mom_out;
65 std::vector<double> rx_mom_out;
66 for (ConstGenParticlePtr pp: lx.first->particles_in()) lx_mom_out.push_back(pp->momentum().e());
67 for (ConstGenParticlePtr pp: rx.first->particles_in()) rx_mom_out.push_back(pp->momentum().e());
68 std::sort(lx_mom_out.begin(), lx_mom_out.end());
69 std::sort(rx_mom_out.begin(), rx_mom_out.end());
70 for (
unsigned int i = 0; i < lx_mom_out.size(); i++)
if (lx_mom_out[i] != rx_mom_out[i])
return (lx_mom_out[i] < rx_mom_out[i]);
73 return (lx.first < lx.first);
79 for (ConstGenParticlePtr pp: v->particles_in()) {
80 ConstGenVertexPtr v2 = pp->production_vertex();
81 if (v2 == v)
continue;
82 if (!v2) p = std::max(p, 1);
96 m_hepevtptr = std::make_shared<struct HEPEVT_Pointers<double> >();
118 ostr <<
" Event No.: " << *(
m_hepevtptr->nevhep) << std::endl;
119 ostr <<
" Nr Type Parent(s) Daughter(s) Px Py Pz E Inv. M." << std::endl;
131 sprintf(buf,
"%5i %6i", index,
m_hepevtptr->idhep[index-1]);
138 ostr << buf << std::endl;
147 memset(
m_hepevtptr->idhep, 0,
sizeof(
int)*m_max_particles);
148 memset(
m_hepevtptr->jmohep, 0,
sizeof(
int)*m_max_particles*2);
149 memset(
m_hepevtptr->jdahep, 0,
sizeof(
int)*m_max_particles*2);
150 memset(
m_hepevtptr->phep, 0,
sizeof(
double)*m_max_particles*5);
151 memset(
m_hepevtptr->vhep, 0,
sizeof(
double)*m_max_particles*4);
224 bool is_fixed =
true;
242 memcpy(dest, src, 2*
sizeof(
int));
243 src += 2*
sizeof(int);
244 dest += 2*
sizeof(int);
245 memcpy(dest, src, N*
sizeof(
int));
246 src += N*
sizeof(int);
247 dest += m_max_particles*
sizeof(int);
248 memcpy(dest, src, N*
sizeof(
int));
249 src += N*
sizeof(int);
250 dest += m_max_particles*
sizeof(int);
251 memcpy(dest, src, 2*N*
sizeof(
int));
252 src += 2*N*
sizeof(int);
253 dest += 2*m_max_particles*
sizeof(int);
254 memcpy(dest, src, 2*N*
sizeof(
int));
255 src += 2*N*
sizeof(int);
256 dest += 2*m_max_particles*
sizeof(int);
257 memcpy(dest, src, 5*N*
sizeof(
double));
258 src += 5*N*
sizeof(double);
259 dest += 5*m_max_particles*
sizeof(double);
260 memcpy(dest, src, 4*N*
sizeof(
double));
bool operator()(ConstGenParticlePtr lx, ConstGenParticlePtr rx) const
comparison of two particles
int number_entries() const
Get number of entries.
void allocate_internal_storage()
Allocates m_internal_storage storage in smart pointer to hold HEPEVT of fixed size.
int number_children(const int index) const
Get number of children from the range of daughters.
std::shared_ptr< struct HEPEVT_Pointers< double > > m_hepevtptr
Fortran common block HEPEVT.
int number_parents(const int index) const
Get number of parents.
void set_children(const int index, const int firstchild, const int lastchild)
Set children.
Helper functions used to manipulate with HEPEVT block.
void print_hepevt(std::ostream &ostr=std::cout) const
Print information from HEPEVT common block.
void print_hepevt_particle(int index, std::ostream &ostr=std::cout) const
Print particle information.
void set_momentum(const int index, const double px, const double py, const double pz, const double e)
Set 4-momentum.
void set_mass(const int index, double mass)
Set mass.
int m_max_particles
Block size.
void set_parents(const int index, const int firstparent, const int lastparent)
Set parents.
void set_position(const int index, const double x, const double y, const double z, const double t)
Set position in time-space.
bool fix_daughters()
Tries to fix list of daughters.
int last_child(const int index) const
Get index of last daughter.
void zero_everything()
Set all entries in HEPEVT to zero.
bool operator()(const std::pair< ConstGenVertexPtr, int > &lx, const std::pair< ConstGenVertexPtr, int > &rx) const
Order vertices with equal paths. If the paths are equal, order in other quantities. We cannot use id, as it can be assigned in different way.
double x(const int index) const
Get X Production vertex.
int number_children_exact(const int index) const
Get number of children by counting.
int first_parent(const int index) const
Get index of 1st mother.
int first_child(const int index) const
Get index of 1st daughter.
static HEPMC3_EXPORT_API int m_max_particles
Block size.
std::vector< char > m_internal_storage
Internalstorage storage. Optional.
void calculate_longest_path_to_top(ConstGenVertexPtr v, std::map< ConstGenVertexPtr, int > &pathl)
Calculates the path to the top (beam) particles.
Fortran common block HEPEVT.
static HEPMC3_EXPORT_API std::shared_ptr< struct HEPEVT_Pointers< double > > m_hepevtptr
Fortran common block HEPEVT.
HEPMC3_EXPORT_API struct HEPEVT * hepevtptr
Pointer to HEPEVT common block.
void set_hepevt_address(char *c)
Set Fortran block address.
Definition of class HEPEVT_Wrapper_Runtime_Static.
Definition of class HEPEVT_Wrapper_Runtime.
void copy_to_internal_storage(char *c, int N)
Copies the content of foreight common block into the internal storage.
int last_parent(const int index) const
Get index of last mother.
Definition of class HEPEVT_Wrapper.