File indexing completed on 2025-01-18 10:01:09
0001
0002 #ifndef HEPMC_HEAVY_ION_H
0003 #define HEPMC_HEAVY_ION_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #include <ostream>
0037 #include <istream>
0038 #include <utility>
0039
0040 namespace HepMC {
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 class HeavyIon {
0052 public:
0053
0054
0055
0056 HeavyIon()
0057 : m_Ncoll_hard(0),
0058 m_Npart_proj(0),
0059 m_Npart_targ(0),
0060 m_Ncoll(0),
0061 m_spectator_neutrons(0),
0062 m_spectator_protons(0),
0063 m_N_Nwounded_collisions(0),
0064 m_Nwounded_N_collisions(0),
0065 m_Nwounded_Nwounded_collisions(0),
0066 m_impact_parameter(0),
0067 m_event_plane_angle(0),
0068 m_eccentricity(0),
0069 m_sigma_inel_NN(0),
0070 m_centrality(-1.0)
0071 {}
0072
0073
0074 HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
0075 int nnw=0, int nwn=0, int nwnw=0,
0076 float im=0., float pl=0., float ec=0., float s=0.,
0077 float fc=0. );
0078
0079 ~HeavyIon() {}
0080
0081
0082
0083 HeavyIon( HeavyIon const & orig );
0084 HeavyIon & operator = ( HeavyIon const & rhs );
0085 void swap( HeavyIon & other );
0086
0087
0088
0089 bool operator==( const HeavyIon& ) const;
0090 bool operator!=( const HeavyIon& ) const;
0091
0092
0093
0094 int Ncoll_hard() const { return m_Ncoll_hard; }
0095
0096 int Npart_proj() const { return m_Npart_proj; }
0097
0098 int Npart_targ() const { return m_Npart_targ; }
0099
0100 int Ncoll() const { return m_Ncoll; }
0101
0102 int spectator_neutrons() const { return m_spectator_neutrons; }
0103
0104 int spectator_protons() const { return m_spectator_protons; }
0105
0106 int N_Nwounded_collisions() const { return m_N_Nwounded_collisions; }
0107
0108 int Nwounded_N_collisions() const { return m_Nwounded_N_collisions; }
0109
0110 int Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
0111
0112 float impact_parameter() const { return m_impact_parameter; }
0113
0114 float event_plane_angle() const { return m_event_plane_angle; }
0115
0116
0117 float eccentricity() const { return m_eccentricity; }
0118
0119 float sigma_inel_NN() const { return m_sigma_inel_NN; }
0120
0121 float centrality() const { return m_centrality; }
0122
0123
0124 bool is_valid() const;
0125
0126
0127
0128 void set_Ncoll_hard(const int &i) { m_Ncoll_hard=i; }
0129
0130 void set_Npart_proj(const int &i) { m_Npart_proj=i; }
0131
0132 void set_Npart_targ(const int &i) { m_Npart_targ=i; }
0133
0134 void set_Ncoll(const int &i) { m_Ncoll=i; }
0135
0136 void set_spectator_neutrons(const int &i) { m_spectator_neutrons=i; }
0137
0138 void set_spectator_protons(const int &i) { m_spectator_protons=i; }
0139
0140 void set_N_Nwounded_collisions(const int &i) { m_N_Nwounded_collisions=i; }
0141
0142 void set_Nwounded_N_collisions(const int &i) { m_Nwounded_N_collisions=i; }
0143
0144 void set_Nwounded_Nwounded_collisions(const int &i)
0145 { m_Nwounded_Nwounded_collisions=i; }
0146
0147 void set_impact_parameter(const float &f) { m_impact_parameter=f; }
0148
0149 void set_event_plane_angle(const float &f) { m_event_plane_angle=f; }
0150
0151 void set_eccentricity(const float &f) { m_eccentricity=f; }
0152
0153 void set_sigma_inel_NN(const float &f) { m_sigma_inel_NN=f; }
0154
0155 void set_centrality(const float &f) { m_centrality=f; }
0156
0157 private:
0158 int m_Ncoll_hard;
0159 int m_Npart_proj;
0160 int m_Npart_targ;
0161 int m_Ncoll;
0162 int m_spectator_neutrons;
0163 int m_spectator_protons;
0164 int m_N_Nwounded_collisions;
0165 int m_Nwounded_N_collisions;
0166 int m_Nwounded_Nwounded_collisions;
0167 float m_impact_parameter;
0168 float m_event_plane_angle;
0169 float m_eccentricity;
0170 float m_sigma_inel_NN;
0171 float m_centrality;
0172
0173 };
0174
0175
0176
0177
0178 std::ostream & operator << (std::ostream &, HeavyIon const *);
0179
0180 std::istream & operator >> (std::istream &, HeavyIon *);
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190 inline HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
0191 int nnw, int nwn, int nwnw,
0192 float im, float pl, float ec, float s, float c )
0193 : m_Ncoll_hard(nh),
0194 m_Npart_proj(np),
0195 m_Npart_targ(nt),
0196 m_Ncoll(nc),
0197 m_spectator_neutrons(ns),
0198 m_spectator_protons(nsp),
0199 m_N_Nwounded_collisions(nnw),
0200 m_Nwounded_N_collisions(nwn),
0201 m_Nwounded_Nwounded_collisions(nwnw),
0202 m_impact_parameter(im),
0203 m_event_plane_angle(pl),
0204 m_eccentricity(ec),
0205 m_sigma_inel_NN(s),
0206 m_centrality(c)
0207 {}
0208
0209 inline HeavyIon::HeavyIon( HeavyIon const & orig )
0210 : m_Ncoll_hard(orig.m_Ncoll_hard),
0211 m_Npart_proj(orig.m_Npart_proj),
0212 m_Npart_targ(orig.m_Npart_targ),
0213 m_Ncoll(orig.m_Ncoll),
0214 m_spectator_neutrons(orig.m_spectator_neutrons),
0215 m_spectator_protons(orig.m_spectator_protons),
0216 m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
0217 m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
0218 m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
0219 m_impact_parameter(orig.m_impact_parameter),
0220 m_event_plane_angle(orig.m_event_plane_angle),
0221 m_eccentricity(orig.m_eccentricity),
0222 m_sigma_inel_NN(orig.m_sigma_inel_NN),
0223 m_centrality(orig.m_centrality)
0224 {}
0225
0226 inline HeavyIon & HeavyIon::operator = ( HeavyIon const & rhs )
0227 {
0228 HeavyIon temp( rhs );
0229 swap( temp );
0230 return *this;
0231 }
0232
0233 inline void HeavyIon::swap( HeavyIon & other )
0234 {
0235 std::swap(m_Ncoll_hard, other.m_Ncoll_hard);
0236 std::swap(m_Npart_proj, other.m_Npart_proj);
0237 std::swap(m_Npart_targ, other.m_Npart_targ);
0238 std::swap(m_Ncoll, other.m_Ncoll);
0239 std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
0240 std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
0241 std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
0242 std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
0243 std::swap(m_spectator_protons, other.m_spectator_protons);
0244 std::swap(m_impact_parameter, other.m_impact_parameter);
0245 std::swap(m_event_plane_angle, other.m_event_plane_angle);
0246 std::swap(m_eccentricity, other.m_eccentricity);
0247 std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
0248 std::swap(m_centrality, other.m_centrality);
0249 }
0250
0251 inline bool HeavyIon::operator==( const HeavyIon& a ) const {
0252
0253 return ( a.Ncoll_hard() == this->Ncoll_hard()
0254 && a.Npart_proj() == this->Npart_proj()
0255 && a.Npart_targ() == this->Npart_targ()
0256 && a.Ncoll() == this->Ncoll()
0257 && a.N_Nwounded_collisions() == this->N_Nwounded_collisions()
0258 && a.Nwounded_N_collisions() == this->Nwounded_N_collisions()
0259 && a.Nwounded_Nwounded_collisions() == this->Nwounded_Nwounded_collisions()
0260 && a.spectator_neutrons() == this->spectator_neutrons()
0261 && a.spectator_protons() == this->spectator_protons()
0262 && a.impact_parameter() == this->impact_parameter()
0263 && a.event_plane_angle() == this->event_plane_angle()
0264 && a.eccentricity() == this->eccentricity()
0265 && a.sigma_inel_NN() == this->sigma_inel_NN()
0266 && a.centrality() == this->centrality() );
0267 }
0268
0269 inline bool HeavyIon::operator!=( const HeavyIon& a ) const
0270 {
0271
0272 return !( a == *this );
0273 }
0274
0275 inline bool HeavyIon::is_valid() const
0276 {
0277 if( m_Ncoll_hard != 0 ) return true;
0278 if( m_Npart_proj != 0 ) return true;
0279 if( m_Npart_targ != 0 ) return true;
0280 if( m_Ncoll != 0 ) return true;
0281 if( m_spectator_neutrons != 0 ) return true;
0282 if( m_spectator_protons != 0 ) return true;
0283 if( m_N_Nwounded_collisions != 0 ) return true;
0284 if( m_Nwounded_N_collisions != 0 ) return true;
0285 if( m_Nwounded_Nwounded_collisions != 0 ) return true;
0286 if( m_impact_parameter != 0 ) return true;
0287 if( m_event_plane_angle != 0 ) return true;
0288 if( m_eccentricity != 0 ) return true;
0289 if( m_sigma_inel_NN != 0 ) return true;
0290 if( m_centrality >= 0 ) return true;
0291 return false;
0292 }
0293
0294 }
0295
0296 #endif