Fork me on GitHub

source: svn/trunk/Utilities/HepMC/interface/HeavyIon.h@ 349

Last change on this file since 349 was 349, checked in by severine ovyn, 15 years ago

first test

File size: 10.4 KB
Line 
1//--------------------------------------------------------------------------
2#ifndef HEPMC_HEAVY_ION_H
3#define HEPMC_HEAVY_ION_H
4
5//////////////////////////////////////////////////////////////////////////
6// garren@fnal.gov, February 2006
7//
8// Additional information storage for Heavy Ion generators
9//////////////////////////////////////////////////////////////////////////
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//
28//////////////////////////////////////////////////////////////////////////
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
32//////////////////////////////////////////////////////////////////////////
33
34namespace HepMC {
35
36
37//! The HeavyIon class stores information about heavy ions
38
39///
40/// \class HeavyIon
41/// HepMC::HeavyIon provides
42/// additional information storage for Heavy Ion generators in GenEvent.
43/// Creation and use of this information is optional.
44///
45class HeavyIon {
46
47public:
48 // --- birth/death:
49 //
50 /// default constructor
51 HeavyIon()
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
67 /// The first 6 values must be provided.
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 ); //!< copy constructor
77 HeavyIon & operator = ( HeavyIon const & rhs ); //!< make a copy
78 void swap( HeavyIon & other ); //!< swap two HeavyIon objects
79
80 // --- equivalence:
81 //
82 bool operator==( const HeavyIon& ) const; //!< check for equality
83 bool operator!=( const HeavyIon& ) const; //!< check for inequality
84
85 // --- accessors:
86 /// Number of hard scatterings
87 int Ncoll_hard() const { return m_Ncoll_hard; }
88 /// Number of projectile participants
89 int Npart_proj() const { return m_Npart_proj; }
90 /// Number of target participants
91 int Npart_targ() const { return m_Npart_targ; }
92 /// Number of NN (nucleon-nucleon) collisions
93 int Ncoll() const { return m_Ncoll; }
94 /// Number of spectator neutrons
95 int spectator_neutrons() const { return m_spectator_neutrons; }
96 /// Number of spectator protons
97 int spectator_protons() const { return m_spectator_protons; }
98 /// Number of N-Nwounded collisions
99 int N_Nwounded_collisions() const { return m_N_Nwounded_collisions; }
100 /// Number of Nwounded-N collisons
101 int Nwounded_N_collisions() const { return m_Nwounded_N_collisions; }
102 /// Number of Nwounded-Nwounded collisions
103 int Nwounded_Nwounded_collisions() const { return m_Nwounded_Nwounded_collisions; }
104 /// Impact Parameter(in fm) of collision
105 float impact_parameter() const { return m_impact_parameter; }
106 /// Azimuthal angle of event plane
107 float event_plane_angle() const { return m_event_plane_angle; }
108 /// eccentricity of participating nucleons in the transverse plane
109 /// (as in phobos nucl-ex/0510031)
110 float eccentricity() const { return m_eccentricity; }
111 /// nucleon-nucleon inelastic (including diffractive) cross-section
112 float sigma_inel_NN() const { return m_sigma_inel_NN; }
113
114 // --- mutators:
115 /// set number of hard scatterings
116 void set_Ncoll_hard(const int &i) { m_Ncoll_hard=i; }
117 /// set number of projectile participants
118 void set_Npart_proj(const int &i) { m_Npart_proj=i; }
119 /// set number of target participants
120 void set_Npart_targ(const int &i) { m_Npart_targ=i; }
121 /// set number of NN (nucleon-nucleon) collisions
122 void set_Ncoll(const int &i) { m_Ncoll=i; }
123 /// set number of spectator neutrons
124 void set_spectator_neutrons(const int &i) { m_spectator_neutrons=i; }
125 /// set number of spectator protons
126 void set_spectator_protons(const int &i) { m_spectator_protons=i; }
127 /// set number of N-Nwounded collisions
128 void set_N_Nwounded_collisions(const int &i) { m_N_Nwounded_collisions=i; }
129 /// set number of Nwounded-N collisons
130 void set_Nwounded_N_collisions(const int &i) { m_Nwounded_N_collisions=i; }
131 /// set number of Nwounded-Nwounded collisions
132 void set_Nwounded_Nwounded_collisions(const int &i)
133 { m_Nwounded_Nwounded_collisions=i; }
134 /// set Impact Parameter in fm
135 void set_impact_parameter(const float &f) { m_impact_parameter=f; }
136 /// set azimuthal angle of event plane
137 void set_event_plane_angle(const float &f) { m_event_plane_angle=f; }
138 /// set eccentricity of participating nucleons in the transverse plane
139 void set_eccentricity(const float &f) { m_eccentricity=f; }
140 /// set nucleon-nucleon inelastic cross-section
141 void set_sigma_inel_NN(const float &f) { m_sigma_inel_NN=f; }
142
143private: // data members
144 int m_Ncoll_hard;
145 int m_Npart_proj;
146 int m_Npart_targ;
147 int m_Ncoll;
148 int m_spectator_neutrons;
149 int m_spectator_protons;
150 int m_N_Nwounded_collisions;
151 int m_Nwounded_N_collisions;
152 int m_Nwounded_Nwounded_collisions;
153 float m_impact_parameter;
154 float m_event_plane_angle;
155 float m_eccentricity;
156 float m_sigma_inel_NN;
157
158};
159
160// inline operators
161 /// Required members are
162 /// the number of hard scatterings,
163 /// the number of projectile participants.
164 /// the number of target participants.
165 /// the number of nucleon-nucleon collisions,
166 /// the number of spectator neutrons, and
167 /// the number of spectator protons.
168inline HeavyIon::HeavyIon( int nh, int np, int nt, int nc, int ns, int nsp,
169 int nnw, int nwn, int nwnw,
170 float im, float pl, float ec, float s )
171 : m_Ncoll_hard(nh),
172 m_Npart_proj(np),
173 m_Npart_targ(nt),
174 m_Ncoll(nc),
175 m_spectator_neutrons(ns),
176 m_spectator_protons(nsp),
177 m_N_Nwounded_collisions(nnw),
178 m_Nwounded_N_collisions(nwn),
179 m_Nwounded_Nwounded_collisions(nwnw),
180 m_impact_parameter(im),
181 m_event_plane_angle(pl),
182 m_eccentricity(ec),
183 m_sigma_inel_NN(s)
184 {}
185
186inline HeavyIon::HeavyIon( HeavyIon const & orig )
187 : m_Ncoll_hard(orig.m_Ncoll_hard),
188 m_Npart_proj(orig.m_Npart_proj),
189 m_Npart_targ(orig.m_Npart_targ),
190 m_Ncoll(orig.m_Ncoll),
191 m_spectator_neutrons(orig.m_spectator_neutrons),
192 m_spectator_protons(orig.m_spectator_protons),
193 m_N_Nwounded_collisions(orig.m_N_Nwounded_collisions),
194 m_Nwounded_N_collisions(orig.m_Nwounded_N_collisions),
195 m_Nwounded_Nwounded_collisions(orig.m_Nwounded_Nwounded_collisions),
196 m_impact_parameter(orig.m_impact_parameter),
197 m_event_plane_angle(orig.m_event_plane_angle),
198 m_eccentricity(orig.m_eccentricity),
199 m_sigma_inel_NN(orig.m_sigma_inel_NN)
200 {}
201
202inline HeavyIon & HeavyIon::operator = ( HeavyIon const & rhs )
203{
204 HeavyIon temp( rhs );
205 swap( temp );
206 return *this;
207}
208
209inline void HeavyIon::swap( HeavyIon & other )
210{
211 std::swap(m_Ncoll_hard, other.m_Ncoll_hard);
212 std::swap(m_Npart_proj, other.m_Npart_proj);
213 std::swap(m_Npart_targ, other.m_Npart_targ);
214 std::swap(m_Ncoll, other.m_Ncoll);
215 std::swap(m_N_Nwounded_collisions, other.m_N_Nwounded_collisions);
216 std::swap(m_Nwounded_N_collisions, other.m_Nwounded_N_collisions);
217 std::swap(m_Nwounded_Nwounded_collisions, other.m_Nwounded_Nwounded_collisions);
218 std::swap(m_spectator_neutrons, other.m_spectator_neutrons);
219 std::swap(m_spectator_protons, other.m_spectator_protons);
220 std::swap(m_impact_parameter, other.m_impact_parameter);
221 std::swap(m_event_plane_angle, other.m_event_plane_angle);
222 std::swap(m_eccentricity, other.m_eccentricity);
223 std::swap(m_sigma_inel_NN, other.m_sigma_inel_NN);
224}
225
226inline bool HeavyIon::operator==( const HeavyIon& a ) const
227{
228 /// equality requires that each member match
229 return ( a.Ncoll_hard() == this->Ncoll_hard()
230 && a.Npart_proj() == this->Npart_proj()
231 && a.Npart_targ() == this->Npart_targ()
232 && a.Ncoll() == this->Ncoll()
233 && a.N_Nwounded_collisions() == this->N_Nwounded_collisions()
234 && a.Nwounded_N_collisions() == this->Nwounded_N_collisions()
235 && a.Nwounded_Nwounded_collisions() == this->Nwounded_Nwounded_collisions()
236 && a.spectator_neutrons() == this->spectator_neutrons()
237 && a.spectator_protons() == this->spectator_protons()
238 && a.impact_parameter() == this->impact_parameter()
239 && a.event_plane_angle() == this->event_plane_angle()
240 && a.eccentricity() == this->eccentricity()
241 && a.sigma_inel_NN() == this->sigma_inel_NN() );
242}
243
244inline bool HeavyIon::operator!=( const HeavyIon& a ) const
245{
246 /// any nonmatching member generates inequality
247 return !( a == *this );
248}
249
250} // HepMC
251
252#endif // HEPMC_HEAVY_ION_H
Note: See TracBrowser for help on using the repository browser.