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;
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);
248 memcpy(dest, src, N*
sizeof(
int));
249 src += N*
sizeof(int);
251 memcpy(dest, src, 2*N*
sizeof(
int));
252 src += 2*N*
sizeof(int);
254 memcpy(dest, src, 2*N*
sizeof(
int));
255 src += 2*N*
sizeof(int);
257 memcpy(dest, src, 5*N*
sizeof(
double));
258 src += 5*N*
sizeof(double);
260 memcpy(dest, src, 4*N*
sizeof(
double));
Helper functions used to manipulate with HEPEVT block.
Definition of class HEPEVT_Wrapper.
HEPMC3_EXPORT_API struct HEPEVT * hepevtptr
Pointer to HEPEVT common block.
Definition of class HEPEVT_Wrapper_Runtime.
Definition of class HEPEVT_Wrapper_Runtime_Static.
static HEPMC3_EXPORT_API int m_max_particles
Block size.
static HEPMC3_EXPORT_API std::shared_ptr< struct HEPEVT_Pointers< double > > m_hepevtptr
Fortran common block HEPEVT.
int first_child(const int index) const
Get index of 1st daughter.
int last_parent(const int index) const
Get index of last mother.
int last_child(const int index) const
Get index of last daughter.
void allocate_internal_storage()
Allocates m_internal_storage storage in smart pointer to hold HEPEVT of fixed size.
int first_parent(const int index) const
Get index of 1st mother.
double pz(const int index) const
Get Z momentum.
void zero_everything()
Set all entries in HEPEVT to zero.
double py(const int index) const
Get Y momentum.
void set_parents(const int index, const int firstparent, const int lastparent)
Set parents.
int number_children_exact(const int index) const
Get number of children by counting.
void print_hepevt_particle(int index, std::ostream &ostr=std::cout) const
Print particle information.
double t(const int index) const
Get production time.
void set_momentum(const int index, const double px, const double py, const double pz, const double e)
Set 4-momentum.
void set_children(const int index, const int firstchild, const int lastchild)
Set children.
int number_parents(const int index) const
Get number of parents.
void set_position(const int index, const double x, const double y, const double z, const double t)
Set position in time-space.
double y(const int index) const
Get Y Production vertex.
bool fix_daughters()
Tries to fix list of daughters.
int number_entries() const
Get number of entries.
void set_hepevt_address(char *c)
Set Fortran block address.
int m_max_particles
Block size.
double px(const int index) const
Get X momentum.
std::vector< char > m_internal_storage
Internalstorage storage. Optional.
int number_children(const int index) const
Get number of children from the range of daughters.
double z(const int index) const
Get Z Production vertex.
void print_hepevt(std::ostream &ostr=std::cout) const
Print information from HEPEVT common block.
void set_mass(const int index, double mass)
Set mass.
double x(const int index) const
Get X Production vertex.
void copy_to_internal_storage(char *c, int N)
Copies the content of foreight common block into the internal storage.
std::shared_ptr< struct HEPEVT_Pointers< double > > m_hepevtptr
Fortran common block HEPEVT.
double e(const int index) const
Get Energy.
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.
bool operator()(ConstGenParticlePtr lx, ConstGenParticlePtr rx) const
comparison of two particles
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....