StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HeavyIon.h
1 //--------------------------------------------------------------------------
2 #ifndef HEPMC_HEAVY_ION_H
3 #define HEPMC_HEAVY_ION_H
4 
6 // garren@fnal.gov, February 2006
7 //
8 // Additional information storage for Heavy Ion generators
10 //
11 // int Ncoll_hard // Number of hard scatterings
12 // int Npart_proj // Number of projectile participants
13 // int Npart_targ // Number of target participants
14 // int Ncoll // Number of NN (nucleon-nucleon) collisions
15 // int N_Nwounded_collisions // Number of N-Nwounded collisions
16 // int Nwounded_N_collisions // Number of Nwounded-N collisons
17 // int Nwounded_Nwounded_collisions // Number of Nwounded-Nwounded collisions
18 // int spectator_neutrons // Number of spectator neutrons
19 // int spectator_protons // Number of spectator protons
20 // float impact_parameter // Impact Parameter(fm) of collision
21 // float event_plane_angle // Azimuthal angle of event plane
22 // float eccentricity // eccentricity of participating nucleons
23 // in the transverse plane
24 // (as in phobos nucl-ex/0510031)
25 // float sigma_inel_NN // nucleon-nucleon inelastic
26 // (including diffractive) cross-section
27 //
29 // Feb. 17, 2006: adjust names according to suggestions from Heavy Ion users
30 // Feb. 7, 2006: first pass at making method names consistent with existing
31 // HepMC code
33 
34 namespace HepMC {
35 
36 
38 
45 class HeavyIon {
46 
47 public:
48  // --- birth/death:
49  //
52  : m_Ncoll_hard(0),
53  m_Npart_proj(0),
54  m_Npart_targ(0),
55  m_Ncoll(0),
56  m_spectator_neutrons(0),
57  m_spectator_protons(0),
58  m_N_Nwounded_collisions(0),
59  m_Nwounded_N_collisions(0),
60  m_Nwounded_Nwounded_collisions(0),
61  m_impact_parameter(0),
62  m_event_plane_angle(0),
63  m_eccentricity(0),
64  m_sigma_inel_NN(0)
65  {}
66 
68  HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
69  int nnw=0, int nwn=0, int nwnw=0,
70  float im=0., float pl=0., float ec=0., float s=0. );
71 
72  ~HeavyIon() {}
73 
74  // --- copying:
75  //
76  HeavyIon( HeavyIon const & orig );
77  HeavyIon & operator = ( HeavyIon const & rhs );
78  void swap( HeavyIon & other );
79 
80  // --- equivalence:
81  //
82  bool operator==( const HeavyIon& ) const;
83  bool operator!=( const HeavyIon& ) const;
84 
85  // --- accessors:
87  int Ncoll_hard() const { return m_Ncoll_hard; }
89  int Npart_proj() const { return m_Npart_proj; }
91  int Npart_targ() const { return m_Npart_targ; }
93  int Ncoll() const { return m_Ncoll; }
95  int spectator_neutrons() const { return m_spectator_neutrons; }
97  int spectator_protons() const { return m_spectator_protons; }
99  int N_Nwounded_collisions() const { return m_N_Nwounded_collisions; }
101  int Nwounded_N_collisions() const { return m_Nwounded_N_collisions; }
103  int Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
105  float impact_parameter() const { return m_impact_parameter; }
107  float event_plane_angle() const { return m_event_plane_angle; }
110  float eccentricity() const { return m_eccentricity; }
112  float sigma_inel_NN() const { return m_sigma_inel_NN; }
113 
115  bool is_valid() const;
116 
117  // --- mutators:
119  void set_Ncoll_hard(const int &i) { m_Ncoll_hard=i; }
121  void set_Npart_proj(const int &i) { m_Npart_proj=i; }
123  void set_Npart_targ(const int &i) { m_Npart_targ=i; }
125  void set_Ncoll(const int &i) { m_Ncoll=i; }
127  void set_spectator_neutrons(const int &i) { m_spectator_neutrons=i; }
129  void set_spectator_protons(const int &i) { m_spectator_protons=i; }
131  void set_N_Nwounded_collisions(const int &i) { m_N_Nwounded_collisions=i; }
133  void set_Nwounded_N_collisions(const int &i) { m_Nwounded_N_collisions=i; }
136  { m_Nwounded_Nwounded_collisions=i; }
138  void set_impact_parameter(const float &f) { m_impact_parameter=f; }
140  void set_event_plane_angle(const float &f) { m_event_plane_angle=f; }
142  void set_eccentricity(const float &f) { m_eccentricity=f; }
144  void set_sigma_inel_NN(const float &f) { m_sigma_inel_NN=f; }
145 
146 private: // data members
147  int m_Ncoll_hard;
148  int m_Npart_proj;
149  int m_Npart_targ;
150  int m_Ncoll;
151  int m_spectator_neutrons;
152  int m_spectator_protons;
153  int m_N_Nwounded_collisions;
154  int m_Nwounded_N_collisions;
155  int m_Nwounded_Nwounded_collisions;
156  float m_impact_parameter;
157  float m_event_plane_angle;
158  float m_eccentricity;
159  float m_sigma_inel_NN;
160 
161 };
162 
163 // Free Functions
164 
166 std::ostream & operator << (std::ostream &, HeavyIon const *);
168 std::istream & operator >> (std::istream &, HeavyIon *);
169 
170 // inline operators
178 inline HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
179  int nnw, int nwn, int nwnw,
180  float im, float pl, float ec, float s )
181  : m_Ncoll_hard(nh),
182  m_Npart_proj(np),
183  m_Npart_targ(nt),
184  m_Ncoll(nc),
185  m_spectator_neutrons(ns),
186  m_spectator_protons(nsp),
187  m_N_Nwounded_collisions(nnw),
188  m_Nwounded_N_collisions(nwn),
189  m_Nwounded_Nwounded_collisions(nwnw),
190  m_impact_parameter(im),
191  m_event_plane_angle(pl),
192  m_eccentricity(ec),
193  m_sigma_inel_NN(s)
194  {}
195 
196 inline HeavyIon::HeavyIon( HeavyIon const & orig )
197  : m_Ncoll_hard(orig.m_Ncoll_hard),
198  m_Npart_proj(orig.m_Npart_proj),
199  m_Npart_targ(orig.m_Npart_targ),
200  m_Ncoll(orig.m_Ncoll),
201  m_spectator_neutrons(orig.m_spectator_neutrons),
202  m_spectator_protons(orig.m_spectator_protons),
203  m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
204  m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
205  m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
206  m_impact_parameter(orig.m_impact_parameter),
207  m_event_plane_angle(orig.m_event_plane_angle),
208  m_eccentricity(orig.m_eccentricity),
209  m_sigma_inel_NN(orig.m_sigma_inel_NN)
210  {}
211 
212 inline HeavyIon & HeavyIon::operator = ( HeavyIon const & rhs )
213 {
214  HeavyIon temp( rhs );
215  swap( temp );
216  return *this;
217 }
218 
219 inline void HeavyIon::swap( HeavyIon & other )
220 {
221  std::swap(m_Ncoll_hard, other.m_Ncoll_hard);
222  std::swap(m_Npart_proj, other.m_Npart_proj);
223  std::swap(m_Npart_targ, other.m_Npart_targ);
224  std::swap(m_Ncoll, other.m_Ncoll);
225  std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
226  std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
227  std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
228  std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
229  std::swap(m_spectator_protons, other.m_spectator_protons);
230  std::swap(m_impact_parameter, other.m_impact_parameter);
231  std::swap(m_event_plane_angle, other.m_event_plane_angle);
232  std::swap(m_eccentricity, other.m_eccentricity);
233  std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
234 }
235 
236 inline bool HeavyIon::operator==( const HeavyIon& a ) const
237 {
239  return ( a.Ncoll_hard() == this->Ncoll_hard()
240  && a.Npart_proj() == this->Npart_proj()
241  && a.Npart_targ() == this->Npart_targ()
242  && a.Ncoll() == this->Ncoll()
246  && a.spectator_neutrons() == this->spectator_neutrons()
247  && a.spectator_protons() == this->spectator_protons()
248  && a.impact_parameter() == this->impact_parameter()
249  && a.event_plane_angle() == this->event_plane_angle()
250  && a.eccentricity() == this->eccentricity()
251  && a.sigma_inel_NN() == this->sigma_inel_NN() );
252 }
253 
254 inline bool HeavyIon::operator!=( const HeavyIon& a ) const
255 {
257  return !( a == *this );
258 }
259 
260 inline bool HeavyIon::is_valid() const
261 {
262  if( m_Ncoll_hard != 0 ) return true;
263  if( m_Npart_proj != 0 ) return true;
264  if( m_Npart_targ != 0 ) return true;
265  if( m_Ncoll != 0 ) return true;
266  if( m_spectator_neutrons != 0 ) return true;
267  if( m_spectator_protons != 0 ) return true;
268  if( m_N_Nwounded_collisions != 0 ) return true;
269  if( m_Nwounded_N_collisions != 0 ) return true;
270  if( m_Nwounded_Nwounded_collisions != 0 ) return true;
271  if( m_impact_parameter != 0 ) return true;
272  if( m_event_plane_angle != 0 ) return true;
273  if( m_eccentricity != 0 ) return true;
274  if( m_sigma_inel_NN != 0 ) return true;
275  return false;
276 }
277 
278 } // HepMC
279 
280 #endif // HEPMC_HEAVY_ION_H
void set_N_Nwounded_collisions(const int &i)
set number of N-Nwounded collisions
Definition: HeavyIon.h:131
float impact_parameter() const
Impact Parameter(in fm) of collision.
Definition: HeavyIon.h:105
void set_Nwounded_Nwounded_collisions(const int &i)
set number of Nwounded-Nwounded collisions
Definition: HeavyIon.h:135
float event_plane_angle() const
Azimuthal angle of event plane.
Definition: HeavyIon.h:107
void set_impact_parameter(const float &f)
set Impact Parameter in fm
Definition: HeavyIon.h:138
void set_Npart_proj(const int &i)
set number of projectile participants
Definition: HeavyIon.h:121
bool operator==(const HeavyIon &) const
check for equality
Definition: HeavyIon.h:236
int Npart_targ() const
Number of target participants.
Definition: HeavyIon.h:91
void set_sigma_inel_NN(const float &f)
set nucleon-nucleon inelastic cross-section
Definition: HeavyIon.h:144
bool operator!=(const HeavyIon &) const
check for inequality
Definition: HeavyIon.h:254
void set_event_plane_angle(const float &f)
set azimuthal angle of event plane
Definition: HeavyIon.h:140
void set_Npart_targ(const int &i)
set number of target participants
Definition: HeavyIon.h:123
void set_Ncoll(const int &i)
set number of NN (nucleon-nucleon) collisions
Definition: HeavyIon.h:125
int N_Nwounded_collisions() const
Number of N-Nwounded collisions.
Definition: HeavyIon.h:99
bool is_valid() const
verify that the instance contains non-zero information
Definition: HeavyIon.h:260
int Ncoll_hard() const
Number of hard scatterings.
Definition: HeavyIon.h:87
int Ncoll() const
Number of NN (nucleon-nucleon) collisions.
Definition: HeavyIon.h:93
void set_eccentricity(const float &f)
set eccentricity of participating nucleons in the transverse plane
Definition: HeavyIon.h:142
HeavyIon & operator=(HeavyIon const &rhs)
make a copy
Definition: HeavyIon.h:212
float eccentricity() const
Definition: HeavyIon.h:110
int spectator_neutrons() const
Number of spectator neutrons.
Definition: HeavyIon.h:95
int Npart_proj() const
Number of projectile participants.
Definition: HeavyIon.h:89
void set_Ncoll_hard(const int &i)
set number of hard scatterings
Definition: HeavyIon.h:119
void swap(HeavyIon &other)
swap two HeavyIon objects
Definition: HeavyIon.h:219
int spectator_protons() const
Number of spectator protons.
Definition: HeavyIon.h:97
HeavyIon()
default constructor
Definition: HeavyIon.h:51
int Nwounded_Nwounded_collisions() const
Number of Nwounded-Nwounded collisions.
Definition: HeavyIon.h:103
int Nwounded_N_collisions() const
Number of Nwounded-N collisons.
Definition: HeavyIon.h:101
The HeavyIon class stores information about heavy ions.
Definition: HeavyIon.h:45
void set_Nwounded_N_collisions(const int &i)
set number of Nwounded-N collisons
Definition: HeavyIon.h:133
void set_spectator_neutrons(const int &i)
set number of spectator neutrons
Definition: HeavyIon.h:127
float sigma_inel_NN() const
nucleon-nucleon inelastic (including diffractive) cross-section
Definition: HeavyIon.h:112
void set_spectator_protons(const int &i)
set number of spectator protons
Definition: HeavyIon.h:129