HepMC3 event record library: GenHeavyIon.h Source File

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
26 class GenHeavyIon : public Attribute {
27
28public:
29
30 /// Empty default constructor.
31 GenHeavyIon()
32 : Ncoll_hard(-1), Npart_proj(-1), Npart_targ(-1), Ncoll(-1),
33#ifndef HEPMC3_NO_DEPRECATED
34 spectator_neutrons(-1), spectator_protons(-1),
35#endif
36 N_Nwounded_collisions(-1), Nwounded_N_collisions(-1),
37 Nwounded_Nwounded_collisions(-1), impact_parameter(-1.0),
38 event_plane_angle(-1.0),
39#ifndef HEPMC3_NO_DEPRECATED
40 eccentricity(-1.0),
41#endif
42 sigma_inel_NN(-1.0), centrality(-1.0), user_cent_estimate(-1.0),
43 Nspec_proj_n(-1), Nspec_targ_n(-1),
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.
57 int Ncoll_hard;
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.
64 int Npart_proj;
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.
71 int Npart_targ;
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.")
86 int spectator_neutrons;
87
88 /// @brief Total number of spectator protons.
89 ///
90 /// HEPMC3_DEPRECATED("Use Nspec_proj_p and Nspec_targ_p instead.")
91 int spectator_protons;
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.
99 int N_Nwounded_collisions;
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.
106 int Nwounded_N_collisions;
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.
113 int Nwounded_Nwounded_collisions;
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.
119 double impact_parameter;
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.
127 double event_plane_angle;
128
129#ifndef HEPMC3_NO_DEPRECATED
130 /// @brief The eccentricity.
131 ///
132 /// HEPMC3_DEPRECATED("Use eccentricities insted.")
133 double eccentricity;
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.
141 double sigma_inel_NN;
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.
148 double centrality;
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.
157 double user_cent_estimate;
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.
165 int Nspec_proj_n;
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.
172 int Nspec_targ_n;
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.
179 int Nspec_proj_p;
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.
186 int Nspec_targ_p;
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");
237 bool forceoldformat;
238
239#endif
240
241};
242
243#ifndef HEPMC3_NO_DEPRECATED
244 typedef GenHeavyIon HeavyIon; ///< Backward compatibility typedef
245#endif
246
247
248} // namespace HepMC3
249
250#endif
Attribute.h
Definition of class Attribute, class IntAttribute and class StringAttribute.
HepMC3::Attribute::Attribute
Attribute()
Default constructor.
Definition Attribute.h:51
HepMC3::GenHeavyIon
Stores additional information about Heavy Ion generator.
Definition GenHeavyIon.h:26
HepMC3::GenHeavyIon::Nspec_targ_p
int Nspec_targ_p
The number of spectator protons in the target.
Definition GenHeavyIon.h:186
HepMC3::GenHeavyIon::Nwounded_Nwounded_collisions
int Nwounded_Nwounded_collisions
Non-diffractive or doubly diffractive collisions.
Definition GenHeavyIon.h:113
HepMC3::GenHeavyIon::Nwounded_N_collisions
int Nwounded_N_collisions
Collisions with a diffractively excited projectile nucleon.
Definition GenHeavyIon.h:106
HepMC3::GenHeavyIon::Nspec_proj_n
int Nspec_proj_n
The number of spectator neutrons in the projectile.
Definition GenHeavyIon.h:165
HepMC3::GenHeavyIon::impact_parameter
double impact_parameter
The impact parameter.
Definition GenHeavyIon.h:119
HepMC3::GenHeavyIon::forceoldformat
bool forceoldformat
force writing in old format for compatibility purposes.
Definition GenHeavyIon.h:237
HepMC3::GenHeavyIon::eccentricities
std::map< int, double > eccentricities
Eccentricities.
Definition GenHeavyIon.h:199
HepMC3::GenHeavyIon::Nspec_proj_p
int Nspec_proj_p
The number of spectator protons in the projectile.
Definition GenHeavyIon.h:179
HepMC3::GenHeavyIon::event_plane_angle
double event_plane_angle
The event plane angle.
Definition GenHeavyIon.h:127
HepMC3::GenHeavyIon::participant_plane_angles
std::map< int, double > participant_plane_angles
Participant plane angles.
Definition GenHeavyIon.h:193
HepMC3::GenHeavyIon::Npart_proj
int Npart_proj
the number of participating nucleons in the projectile.
Definition GenHeavyIon.h:64
HepMC3::GenHeavyIon::operator==
bool operator==(const GenHeavyIon &) const
Operator ==.
Definition GenHeavyIon.cc:109
HepMC3::GenHeavyIon::eccentricity
double eccentricity
The eccentricity.
Definition GenHeavyIon.h:133
HepMC3::GenHeavyIon::user_cent_estimate
double user_cent_estimate
A user defined centrality estimator.
Definition GenHeavyIon.h:157
HepMC3::GenHeavyIon::spectator_protons
int spectator_protons
Total number of spectator protons.
Definition GenHeavyIon.h:91
HepMC3::GenHeavyIon::N_Nwounded_collisions
int N_Nwounded_collisions
Collisions with a diffractively excited target nucleon.
Definition GenHeavyIon.h:99
HepMC3::GenHeavyIon::centrality
double centrality
The centrality.
Definition GenHeavyIon.h:148
HepMC3::GenHeavyIon::is_valid
bool is_valid() const
Verify that the instance contains non-zero information.
Definition GenHeavyIon.cc:137
HepMC3::GenHeavyIon::Nspec_targ_n
int Nspec_targ_n
The number of spectator neutrons in the target.
Definition GenHeavyIon.h:172
HepMC3::GenHeavyIon::from_string
bool from_string(const std::string &att) override
Implementation of Attribute::from_string.
Definition GenHeavyIon.cc:20
HepMC3::GenHeavyIon::Ncoll_hard
int Ncoll_hard
the number of hard nucleon-nucleon collisions.
Definition GenHeavyIon.h:57
HepMC3::GenHeavyIon::set
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
HepMC3::GenHeavyIon::operator!=
bool operator!=(const GenHeavyIon &) const
Operator !=.
Definition GenHeavyIon.cc:113
HepMC3::GenHeavyIon::Ncoll
int Ncoll
the number of inelastic nucleon-nucleon collisions.
Definition GenHeavyIon.h:80
HepMC3::GenHeavyIon::GenHeavyIon
GenHeavyIon()
Empty default constructor.
Definition GenHeavyIon.h:31
HepMC3::GenHeavyIon::Npart_targ
int Npart_targ
the number of participating nucleons in the target.
Definition GenHeavyIon.h:71
HepMC3::GenHeavyIon::spectator_neutrons
int spectator_neutrons
Total number of spectator neutrons.
Definition GenHeavyIon.h:86
HepMC3::GenHeavyIon::to_string
bool to_string(std::string &att) const override
Implementation of Attribute::to_string.
Definition GenHeavyIon.cc:68
HepMC3::GenHeavyIon::sigma_inel_NN
double sigma_inel_NN
The assumed inelastic nucleon-nucleon cross section.
Definition GenHeavyIon.h:141
HepMC3
HepMC3 main namespace.
Definition AnalysisExample.h:24
HepMC3::HeavyIon
GenHeavyIon HeavyIon
Backward compatibility typedef.
Definition GenHeavyIon.h:244