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