HepMC3 event record library
GenHeavyIon.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_HEAVYION_H
7#define HEPMC3_HEAVYION_H
8/**
9 * @file GenHeavyIon.h
10 * @brief Definition of attribute \b class GenHeavyIon
11 *
12 * @class HepMC3::GenHeavyIon
13 * @brief Stores additional information about Heavy Ion generator
14 *
15 * This is an example of event attribute used to store Heavy Ion information
16 *
17 * @ingroup attributes
18 *
19 */
20#include <iostream>
21#include <map>
22#include "HepMC3/Attribute.h"
23
24namespace HepMC3 {
25
26class GenHeavyIon : public Attribute {
27
28public:
29
30 /// Empty default constructor.
32 : Ncoll_hard(-1), Npart_proj(-1), Npart_targ(-1), Ncoll(-1),
33#ifndef HEPMC3_NO_DEPRECATED
35#endif
39#ifndef HEPMC3_NO_DEPRECATED
40 eccentricity(-1.0),
41#endif
44 Nspec_proj_p(-1), Nspec_targ_p(-1), forceoldformat(false) {}
45
46//
47// Fields
48//
49public:
50
51 ///
52 /// @brief the number of hard nucleon-nucleon collisions.
53 ///
54 /// Model-dependent. Usually the number of nucleon-nucleon
55 /// collisions containing a special signal process. A negative
56 /// value means that the information is not available.
58
59 /// @brief the number of participating nucleons in the projectile.
60 ///
61 /// The number of nucleons in the projectile participating in an
62 /// inelastic collision (see Ncoll). A negative value means that
63 /// the information is not available.
65
66 /// @brief the number of participating nucleons in the target.
67 ///
68 /// The number of nucleons in the target participating in an
69 /// inelastic collision (see Ncoll). A negative value means that
70 /// the information is not available.
72
73 /// @brief the number of inelastic nucleon-nucleon collisions.
74 ///
75 /// Note that a one participating nucleon can be involved in many
76 /// inelastic collisions, and that inelastic also includes
77 /// diffractive excitation. A negative value means that the
78 /// information is not available.
79 ///
80 int Ncoll;
81
82#ifndef HEPMC3_NO_DEPRECATED
83 /// @brief Total number of spectator neutrons.
84 ///
85 /// HEPMC3_DEPRECATED("Use Nspec_proj_n and Nspec_targ_n instead.")
87
88 /// @brief Total number of spectator protons.
89 ///
90 /// HEPMC3_DEPRECATED("Use Nspec_proj_p and Nspec_targ_p instead.")
92#endif
93
94 /// @brief Collisions with a diffractively excited target nucleon.
95 ///
96 /// The number of single diffractive nucleon-nucleon collisions
97 /// where the target nucleon is excited. A negative value means
98 /// that the information is not available.
100
101 /// @brief Collisions with a diffractively excited projectile nucleon.
102 ///
103 /// The number of single diffractive nucleon-nucleon collisions
104 /// where the projectile nucleon is excited. A negative value
105 /// means that the information is not available.
107
108 /// @brief Non-diffractive or doubly diffractive collisions.
109 ///
110 /// The number of nucleon-nucleon collisions where both projectile
111 /// and target nucleons are wounded. A negative value means that
112 /// the information is not available.
114
115 /// @brief The impact parameter.
116 ///
117 /// The impact parameter given in units of femtometer. A negative
118 /// value means that the information is not available.
120
121 /// @brief The event plane angle.
122 ///
123 /// The angle wrt. the x-axix of the impact parameter vector
124 /// (pointing frm the target to the projectile). A positive number
125 /// between 0 and two pi. A negative value means that the
126 /// information is not available.
128
129#ifndef HEPMC3_NO_DEPRECATED
130 /// @brief The eccentricity.
131 ///
132 /// HEPMC3_DEPRECATED("Use eccentricities insted.")
134#endif
135
136 /// @brief The assumed inelastic nucleon-nucleon cross section
137 ///
138 /// in units of millibarn. As used in a Glauber calculation to
139 /// simulate the distribution in Ncoll. A negative value means
140 /// that the information is not available.
142
143 /// @brief The centrality.
144 ///
145 /// The generated centrality in percentiles, where 0 is the
146 /// maximally central and 100 is the minimally central. A negative
147 /// value means that the information is not available.
149
150 /// @brief A user defined centrality estimator.
151 ///
152 /// This variable may contain anything a generator feels is
153 /// reasonable for estimating centrality. The value should be
154 /// non-negative, and a low value corresponds to a low
155 /// centrality. A negative value indicatess that the information
156 /// is not available.
158
159
160 /// @brief The number of spectator neutrons in the projectile
161 ///
162 /// ie. those that thave not participated in any inelastic
163 /// nucleon-nucleon collision. A negative value indicatess that
164 /// the information is not available.
166
167 /// @brief The number of spectator neutrons in the target
168 ///
169 /// ie. those that thave not participated in any inelastic
170 /// nucleon-nucleon collision. A negative value indicatess that
171 /// the information is not available.
173
174 /// @brief The number of spectator protons in the projectile
175 ///
176 /// ie. those that thave not participated in any inelastic
177 /// nucleon-nucleon collision. A negative value indicatess that
178 /// the information is not available.
180
181 /// @brief The number of spectator protons in the target
182 ///
183 /// ie. those that thave not participated in any inelastic
184 /// nucleon-nucleon collision. A negative value indicatess that
185 /// the information is not available.
187
188 /// @brief Participant plane angles
189 ///
190 /// calculated to different orders. The key of the map specifies
191 /// the order, and the value gives to the angle wrt. the
192 /// event plane.
193 std::map<int,double> participant_plane_angles;
194
195 /// @brief Eccentricities
196 ///
197 /// Calculated to different orders. The key of the map specifies
198 /// the order, and the value gives the corresponding eccentricity.
199 std::map<int,double> eccentricities;
200
201//
202// Functions
203//
204public:
205
206 /// @brief Implementation of Attribute::from_string.
207 bool from_string(const std::string &att) override;
208
209 /// @brief Implementation of Attribute::to_string.
210 bool to_string(std::string &att) const override;
211
212#ifndef HEPMC3_NO_DEPRECATED
213
214 /// @brief Operator ==
215 ///
216 bool operator==( const GenHeavyIon& ) const;
217 /// @brief Operator !=
218 ///
219 bool operator!=( const GenHeavyIon& ) const;
220
221 /// @brief Set all fields.
222 ///
223 /// HEPMC3_DEPRECATED("Set individual fields directly instead.")
224 /** @brief Set all fields */
225 void set( const int&nh, const int&np, const int&nt, const int&nc, const int&ns, const int&nsp,
226 const int&nnw=0, const int&nwn=0, const int&nwnw=0,
227 const double& im=0., const double& pl=0., const double& ec=0., const double& s=0., const double& cent=0., const double& usrcent=0. );
228 /// @brief Verify that the instance contains non-zero information.
229 ///
230 /// HEPMC3_DEPRECATED("Each filed now have default values meaning
231 /// that they have not been set")
232 bool is_valid() const;
233
234 /// @brief force writing in old format for compatibility purposes.
235 ///
236 /// HEPMC3_DEPRECATED("This should really not be needed");
238
239#endif
240
241};
242
243#ifndef HEPMC3_NO_DEPRECATED
244typedef GenHeavyIon HeavyIon; ///< Backward compatibility typedef
245#endif
246
247
248} // namespace HepMC3
249
250#endif
Definition of class Attribute, class IntAttribute and class StringAttribute.
Base attribute class.
Definition: Attribute.h:44
Stores additional information about Heavy Ion generator.
Definition: GenHeavyIon.h:26
int Nspec_targ_p
The number of spectator protons in the target.
Definition: GenHeavyIon.h:186
int Nwounded_Nwounded_collisions
Non-diffractive or doubly diffractive collisions.
Definition: GenHeavyIon.h:113
int Nwounded_N_collisions
Collisions with a diffractively excited projectile nucleon.
Definition: GenHeavyIon.h:106
int Nspec_proj_n
The number of spectator neutrons in the projectile.
Definition: GenHeavyIon.h:165
double impact_parameter
The impact parameter.
Definition: GenHeavyIon.h:119
bool forceoldformat
force writing in old format for compatibility purposes.
Definition: GenHeavyIon.h:237
std::map< int, double > eccentricities
Eccentricities.
Definition: GenHeavyIon.h:199
int Nspec_proj_p
The number of spectator protons in the projectile.
Definition: GenHeavyIon.h:179
double event_plane_angle
The event plane angle.
Definition: GenHeavyIon.h:127
std::map< int, double > participant_plane_angles
Participant plane angles.
Definition: GenHeavyIon.h:193
int Npart_proj
the number of participating nucleons in the projectile.
Definition: GenHeavyIon.h:64
bool operator==(const GenHeavyIon &) const
Operator ==.
Definition: GenHeavyIon.cc:109
double eccentricity
The eccentricity.
Definition: GenHeavyIon.h:133
double user_cent_estimate
A user defined centrality estimator.
Definition: GenHeavyIon.h:157
int spectator_protons
Total number of spectator protons.
Definition: GenHeavyIon.h:91
int N_Nwounded_collisions
Collisions with a diffractively excited target nucleon.
Definition: GenHeavyIon.h:99
double centrality
The centrality.
Definition: GenHeavyIon.h:148
bool is_valid() const
Verify that the instance contains non-zero information.
Definition: GenHeavyIon.cc:137
int Nspec_targ_n
The number of spectator neutrons in the target.
Definition: GenHeavyIon.h:172
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition: GenHeavyIon.cc:20
int Ncoll_hard
the number of hard nucleon-nucleon collisions.
Definition: GenHeavyIon.h:57
void set(const int &nh, const int &np, const int &nt, const int &nc, const int &ns, const int &nsp, const int &nnw=0, const int &nwn=0, const int &nwnw=0, const double &im=0., const double &pl=0., const double &ec=0., const double &s=0., const double &cent=0., const double &usrcent=0.)
Set all fields.
Definition: GenHeavyIon.cc:117
bool operator!=(const GenHeavyIon &) const
Operator !=.
Definition: GenHeavyIon.cc:113
int Ncoll
the number of inelastic nucleon-nucleon collisions.
Definition: GenHeavyIon.h:80
GenHeavyIon()
Empty default constructor.
Definition: GenHeavyIon.h:31
int Npart_targ
the number of participating nucleons in the target.
Definition: GenHeavyIon.h:71
int spectator_neutrons
Total number of spectator neutrons.
Definition: GenHeavyIon.h:86
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition: GenHeavyIon.cc:68
double sigma_inel_NN
The assumed inelastic nucleon-nucleon cross section.
Definition: GenHeavyIon.h:141
HepMC3 main namespace.
GenHeavyIon HeavyIon
Backward compatibility typedef.
Definition: GenHeavyIon.h:244