Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:12

0001 // -*- C++ -*-
0002 //
0003 // This file is part of HepMC
0004 // Copyright (C) 2014-2023 The HepMC collaboration (see AUTHORS for details)
0005 //
0006 #ifndef HEPMC3_HEAVYION_H
0007 #define HEPMC3_HEAVYION_H
0008 /**
0009  *  @file GenHeavyIon.h
0010  *  @brief Definition of attribute \b class GenHeavyIon
0011  *
0012  *  @class HepMC3::GenHeavyIon
0013  *  @brief Stores additional information about Heavy Ion generator
0014  *
0015  *  This is an example of event attribute used to store Heavy Ion information
0016  *
0017  *  @ingroup attributes
0018  *
0019  */
0020 #include <iostream>
0021 #include <map>
0022 #include "HepMC3/Attribute.h"
0023 
0024 namespace HepMC3 {
0025 
0026 class GenHeavyIon : public Attribute {
0027 
0028 public:
0029 
0030     /// Empty default constructor.
0031     GenHeavyIon()
0032         : Ncoll_hard(-1), Npart_proj(-1), Npart_targ(-1), Ncoll(-1),
0033 #ifndef HEPMC3_NO_DEPRECATED
0034           spectator_neutrons(-1), spectator_protons(-1),
0035 #endif
0036           N_Nwounded_collisions(-1), Nwounded_N_collisions(-1),
0037           Nwounded_Nwounded_collisions(-1), impact_parameter(-1.0),
0038           event_plane_angle(-1.0),
0039 #ifndef HEPMC3_NO_DEPRECATED
0040           eccentricity(-1.0),
0041 #endif
0042           sigma_inel_NN(-1.0), centrality(-1.0), user_cent_estimate(-1.0),
0043           Nspec_proj_n(-1), Nspec_targ_n(-1),
0044           Nspec_proj_p(-1), Nspec_targ_p(-1), forceoldformat(false) {}
0045 
0046 //
0047 // Fields
0048 //
0049 public:
0050 
0051     ///
0052     /// @brief the number of hard nucleon-nucleon collisions.
0053     ///
0054     /// Model-dependent. Usually the number of nucleon-nucleon
0055     /// collisions containing a special signal process. A negative
0056     /// value means that the information is not available.
0057     int    Ncoll_hard;
0058 
0059     /// @brief the number of participating nucleons in the projectile.
0060     ///
0061     /// The number of nucleons in the projectile participating in an
0062     /// inelastic collision (see Ncoll). A negative value means that
0063     /// the information is not available.
0064     int    Npart_proj;
0065 
0066     /// @brief the number of participating nucleons in the target.
0067     ///
0068     /// The number of nucleons in the target participating in an
0069     /// inelastic collision (see Ncoll). A negative value means that
0070     /// the information is not available.
0071     int    Npart_targ;
0072 
0073     /// @brief the number of inelastic nucleon-nucleon collisions.
0074     ///
0075     /// Note that a one participating nucleon can be involved in many
0076     /// inelastic collisions, and that inelastic also includes
0077     /// diffractive excitation. A negative value means that the
0078     /// information is not available.
0079     ///
0080     int    Ncoll;
0081 
0082 #ifndef HEPMC3_NO_DEPRECATED
0083     /// @brief Total number of spectator neutrons.
0084     ///
0085     /// HEPMC3_DEPRECATED("Use Nspec_proj_n and Nspec_targ_n instead.")
0086     int    spectator_neutrons;
0087 
0088     /// @brief Total number of spectator protons.
0089     ///
0090     /// HEPMC3_DEPRECATED("Use Nspec_proj_p and Nspec_targ_p instead.")
0091     int    spectator_protons;
0092 #endif
0093 
0094     /// @brief Collisions with a diffractively excited target nucleon.
0095     ///
0096     /// The number of single diffractive nucleon-nucleon collisions
0097     /// where the target nucleon is excited. A negative value means
0098     /// that the information is not available.
0099     int    N_Nwounded_collisions;
0100 
0101     /// @brief Collisions with a diffractively excited projectile nucleon.
0102     ///
0103     /// The number of single diffractive nucleon-nucleon collisions
0104     /// where the projectile nucleon is excited. A negative value
0105     /// means that the information is not available.
0106     int    Nwounded_N_collisions;
0107 
0108     /// @brief Non-diffractive or doubly diffractive collisions.
0109     ///
0110     /// The number of nucleon-nucleon collisions where both projectile
0111     /// and target nucleons are wounded. A negative value means that
0112     /// the information is not available.
0113     int    Nwounded_Nwounded_collisions;
0114 
0115     /// @brief The impact parameter.
0116     ///
0117     /// The impact parameter given in units of femtometer. A negative
0118     /// value means that the information is not available.
0119     double impact_parameter;
0120 
0121     /// @brief The event plane angle.
0122     ///
0123     /// The angle wrt. the x-axix of the impact parameter vector
0124     /// (pointing frm the target to the projectile). A positive number
0125     /// between 0 and two pi. A negative value means that the
0126     /// information is not available.
0127     double event_plane_angle;
0128 
0129 #ifndef HEPMC3_NO_DEPRECATED
0130     /// @brief The eccentricity.
0131     ///
0132     /// HEPMC3_DEPRECATED("Use eccentricities insted.")
0133     double eccentricity;
0134 #endif
0135 
0136     /// @brief The assumed inelastic nucleon-nucleon cross section
0137     ///
0138     /// in units of millibarn. As used in a Glauber calculation to
0139     /// simulate the distribution in Ncoll. A negative value means
0140     /// that the information is not available.
0141     double sigma_inel_NN;
0142 
0143     /// @brief The centrality.
0144     ///
0145     /// The generated centrality in percentiles, where 0 is the
0146     /// maximally central and 100 is the minimally central. A negative
0147     /// value means that the information is not available.
0148     double centrality;
0149 
0150     /// @brief A user defined centrality estimator.
0151     ///
0152     /// This variable may contain anything a generator feels is
0153     /// reasonable for estimating centrality. The value should be
0154     /// non-negative, and a low value corresponds to a low
0155     /// centrality. A negative value indicatess that the information
0156     /// is not available.
0157     double user_cent_estimate;
0158 
0159 
0160     /// @brief The number of spectator neutrons in the projectile
0161     ///
0162     /// ie. those that thave not participated in any inelastic
0163     /// nucleon-nucleon collision. A negative value indicatess that
0164     /// the information is not available.
0165     int Nspec_proj_n;
0166 
0167     /// @brief The number of spectator neutrons in the target
0168     ///
0169     /// ie. those that thave not participated in any inelastic
0170     /// nucleon-nucleon collision. A negative value indicatess that
0171     /// the information is not available.
0172     int Nspec_targ_n;
0173 
0174     /// @brief The number of spectator protons in the projectile
0175     ///
0176     /// ie. those that thave not participated in any inelastic
0177     /// nucleon-nucleon collision. A negative value indicatess that
0178     /// the information is not available.
0179     int Nspec_proj_p;
0180 
0181     /// @brief The number of spectator protons in the target
0182     ///
0183     /// ie. those that thave not participated in any inelastic
0184     /// nucleon-nucleon collision. A negative value indicatess that
0185     /// the information is not available.
0186     int Nspec_targ_p;
0187 
0188     /// @brief Participant plane angles
0189     ///
0190     /// calculated to different orders. The key of the map specifies
0191     /// the order, and the value gives to the angle wrt. the
0192     /// event plane.
0193     std::map<int,double> participant_plane_angles;
0194 
0195     /// @brief Eccentricities
0196     ///
0197     /// Calculated to different orders. The key of the map specifies
0198     /// the order, and the value gives the corresponding eccentricity.
0199     std::map<int,double> eccentricities;
0200 
0201 //
0202 // Functions
0203 //
0204 public:
0205 
0206     /// @brief Implementation of Attribute::from_string.
0207     bool from_string(const std::string &att) override;
0208 
0209     /// @brief Implementation of Attribute::to_string.
0210     bool to_string(std::string &att) const  override;
0211 
0212 #ifndef HEPMC3_NO_DEPRECATED
0213 
0214     /// @brief Operator ==
0215     ///
0216     bool operator==( const GenHeavyIon& ) const;
0217     /// @brief Operator !=
0218     ///
0219     bool operator!=( const GenHeavyIon& ) const;
0220 
0221     /// @brief Set all fields.
0222     ///
0223     /// HEPMC3_DEPRECATED("Set individual fields directly instead.")
0224     /** @brief Set all fields */
0225     void set( const int&nh, const int&np, const int&nt, const int&nc, const int&ns, const int&nsp,
0226               const int&nnw=0, const int&nwn=0, const int&nwnw=0,
0227               const double& im=0., const double& pl=0., const double& ec=0., const double& s=0., const double& cent=0., const double& usrcent=0. );
0228     /// @brief Verify that the instance contains non-zero information.
0229     ///
0230     /// HEPMC3_DEPRECATED("Each filed now have default values meaning
0231     /// that they have not been set")
0232     bool is_valid() const;
0233 
0234     /// @brief force writing in old format for compatibility purposes.
0235     ///
0236     /// HEPMC3_DEPRECATED("This should really not be needed");
0237     bool forceoldformat;
0238 
0239 #endif
0240 
0241 };
0242 
0243 #ifndef HEPMC3_NO_DEPRECATED
0244 typedef GenHeavyIon HeavyIon; ///< Backward compatibility typedef
0245 #endif
0246 
0247 
0248 } // namespace HepMC3
0249 
0250 #endif