| 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 |
|
| 24 |
namespace HepMC3 { |
| 25 |
using namespace std; |
| 26 |
|
| 27 |
class GenHeavyIon : public Attribute { |
| 28 |
|
| 29 |
public: |
| 30 |
|
| 31 |
/// Empty default constructor. |
| 32 |
GenHeavyIon() |
| 33 |
: Ncoll_hard(-1), Npart_proj(-1), Npart_targ(-1), Ncoll(-1), |
| 34 |
#ifndef HEPMC3_NO_DEPRECATED |
| 35 |
spectator_neutrons(-1), spectator_protons(-1), |
| 36 |
#endif |
| 37 |
N_Nwounded_collisions(-1), Nwounded_N_collisions(-1), |
| 38 |
Nwounded_Nwounded_collisions(-1), impact_parameter(-1.0), |
| 39 |
event_plane_angle(-1.0), |
| 40 |
#ifndef HEPMC3_NO_DEPRECATED |
| 41 |
eccentricity(-1.0), |
| 42 |
#endif |
| 43 |
sigma_inel_NN(-1.0), centrality(-1.0), user_cent_estimate(-1.0), |
| 44 |
Nspec_proj_n(-1), Nspec_targ_n(-1), |
| 45 |
Nspec_proj_p(-1), Nspec_targ_p(-1), forceoldformat(false) {} |
| 46 |
|
| 47 |
// |
| 48 |
// Fields |
| 49 |
// |
| 50 |
public: |
| 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. |
| 58 |
int Ncoll_hard; |
| 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. |
| 65 |
int Npart_proj; |
| 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. |
| 72 |
int Npart_targ; |
| 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.") |
| 87 |
int spectator_neutrons; |
| 88 |
|
| 89 |
/// @brief Total number of spectator protons. |
| 90 |
/// |
| 91 |
/// HEPMC3_DEPRECATED("Use Nspec_proj_p and Nspec_targ_p instead.") |
| 92 |
int spectator_protons; |
| 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. |
| 100 |
int N_Nwounded_collisions; |
| 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. |
| 107 |
int Nwounded_N_collisions; |
| 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. |
| 114 |
int Nwounded_Nwounded_collisions; |
| 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. |
| 120 |
double impact_parameter; |
| 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. |
| 128 |
double event_plane_angle; |
| 129 |
|
| 130 |
#ifndef HEPMC3_NO_DEPRECATED |
| 131 |
/// @brief The eccentricity. |
| 132 |
/// |
| 133 |
/// HEPMC3_DEPRECATED("Use eccentricities insted.") |
| 134 |
double eccentricity; |
| 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. |
| 142 |
double sigma_inel_NN; |
| 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. |
| 149 |
double centrality; |
| 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. |
| 158 |
double user_cent_estimate; |
| 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. |
| 166 |
int Nspec_proj_n; |
| 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. |
| 173 |
int Nspec_targ_n; |
| 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. |
| 180 |
int Nspec_proj_p; |
| 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. |
| 187 |
int Nspec_targ_p; |
| 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. |
| 194 |
map<int,double> participant_plane_angles; |
| 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 |
// |
| 205 |
public: |
| 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"); |
| 239 |
bool forceoldformat; |
| 240 |
|
| 241 |
#endif |
| 242 |
|
| 243 |
}; |
| 244 |
|
| 245 |
|
| 246 |
#ifndef HEPMC3_NO_DEPRECATED |
| 247 |
typedef GenHeavyIon HeavyIon; ///< Backward compatibility typedef |
| 248 |
#endif |
| 249 |
|
| 250 |
|
| 251 |
} // namespace HepMC3 |
| 252 |
|
| 253 |
#endif |