]>
Commit | Line | Data |
---|---|---|
0b5dd071 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2002, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | * * | |
15 | **************************************************************************/ | |
16 | //------------------------------------------------------------------------ | |
17 | // TPHICgen is an interface class to fortran event generator of | |
18 | // two-photon processes in ultra-peripheral ion collisions | |
19 | //% | |
20 | // Yuri.Kharlov@cern.ch | |
21 | // 15 April 2003 | |
22 | //------------------------------------------------------------------------ | |
23 | ||
24 | #include "TRandom.h" | |
25 | ||
26 | #include "TPHICgen.h" | |
f893d4a5 | 27 | //#include "TClonesArray.h" |
28 | //#include "TParticle.h" | |
32f7fd11 | 29 | #define IN_TPHICGEN_CXX |
0b5dd071 | 30 | #include "TPHICcommon.h" |
31 | ||
32 | #ifndef WIN32 | |
33 | # define gginit gginit_ | |
34 | # define ggrun ggrun_ | |
35 | # define ggexit ggexit_ | |
36 | # define ggrnd ggrnd_ | |
37 | #else | |
38 | # define gginit gginit | |
39 | # define ggrun ggrun | |
40 | # define ggexit ggexit | |
41 | # define ggrnd ggrnd | |
42 | #endif | |
43 | ||
44 | extern "C" { | |
45 | void gginit(); | |
46 | void ggrun() ; | |
47 | void ggexit(); | |
48 | // Double_t pyr_(Int_t*); | |
49 | Double_t ggrnd(Int_t*) { | |
50 | Double_t r; | |
51 | do r=gRandom->Rndm(); while(0 >= r || r >= 1); | |
52 | return r; | |
53 | // return pyr_(0); | |
54 | } | |
55 | } | |
56 | ||
57 | ClassImp(TPHICgen) | |
58 | ||
59 | //------------------------------------------------------------------------------ | |
60 | TPHICgen::TPHICgen() : TGenerator("TPHIC","TPHIC") | |
61 | { | |
62 | // TPHIC constructor | |
63 | } | |
64 | ||
65 | //------------------------------------------------------------------------------ | |
66 | TPHICgen::~TPHICgen() | |
67 | { | |
68 | // Destructor | |
69 | } | |
70 | ||
71 | //______________________________________________________________________________ | |
72 | void TPHICgen::Initialize() | |
73 | { | |
74 | // Initialize TPHIC | |
75 | const Float_t kNucleonMass = 0.931494; | |
76 | SetAMAS(GGINI.ia*kNucleonMass); | |
77 | gginit(); | |
78 | } | |
79 | ||
80 | //______________________________________________________________________________ | |
81 | void TPHICgen::GenerateEvent() | |
82 | { | |
83 | //produce one event | |
84 | ggrun(); | |
85 | } | |
86 | ||
87 | //______________________________________________________________________________ | |
88 | void TPHICgen::Finish() | |
89 | { | |
90 | // calculate cross section and print out cross section and related variables | |
91 | ggexit(); | |
92 | } | |
93 | ||
94 | //______________________________________________________________________________ | |
95 | ||
96 | // Setters | |
f893d4a5 | 97 | void TPHICgen::SetIPROC (Int_t iproc ) const |
0b5dd071 | 98 | { |
99 | GGINI.iproc = iproc; | |
100 | } | |
101 | //______________________________________________________________________________ | |
f893d4a5 | 102 | void TPHICgen::SetNEVENT (Int_t nevent ) const |
0b5dd071 | 103 | { |
104 | GGINI.nevent = nevent; | |
105 | } | |
106 | //______________________________________________________________________________ | |
f893d4a5 | 107 | void TPHICgen::SetILUMF (Int_t ilumf ) const |
0b5dd071 | 108 | { |
109 | GGINI.ilumf = ilumf; | |
110 | } | |
111 | //______________________________________________________________________________ | |
f893d4a5 | 112 | void TPHICgen::SetLUMFIL (TString lumfil ) const |
0b5dd071 | 113 | { |
114 | for (Int_t i=0; i<lumfil.Length(); i++) | |
115 | GGINI.lumfil[i] = lumfil[i]; | |
116 | } | |
117 | //______________________________________________________________________________ | |
f893d4a5 | 118 | void TPHICgen::SetEBMN (Float_t ebmn ) const |
0b5dd071 | 119 | { |
120 | GGINI.ebmn = ebmn; | |
121 | } | |
122 | //______________________________________________________________________________ | |
f893d4a5 | 123 | void TPHICgen::SetIZ (Int_t iz ) const |
0b5dd071 | 124 | { |
125 | GGINI.iz = iz; | |
126 | } | |
127 | //______________________________________________________________________________ | |
f893d4a5 | 128 | void TPHICgen::SetIA (Int_t ia ) const |
0b5dd071 | 129 | { |
130 | GGINI.ia = ia; | |
131 | } | |
132 | //______________________________________________________________________________ | |
f893d4a5 | 133 | void TPHICgen::SetAMAS (Float_t amas ) const |
0b5dd071 | 134 | { |
135 | GGINI.amas = amas; | |
136 | } | |
137 | //______________________________________________________________________________ | |
f893d4a5 | 138 | void TPHICgen::SetAMIN (Float_t amin ) const |
0b5dd071 | 139 | { |
140 | GGINI.amin = amin; | |
141 | } | |
142 | //______________________________________________________________________________ | |
f893d4a5 | 143 | void TPHICgen::SetAMAX (Float_t amax ) const |
0b5dd071 | 144 | { |
145 | GGINI.amax = amax; | |
146 | } | |
147 | //______________________________________________________________________________ | |
f893d4a5 | 148 | void TPHICgen::SetYMIN (Float_t ymin ) const |
0b5dd071 | 149 | { |
150 | GGINI.ymin = ymin; | |
151 | } | |
152 | //______________________________________________________________________________ | |
f893d4a5 | 153 | void TPHICgen::SetYMAX (Float_t ymax ) const |
0b5dd071 | 154 | { |
155 | GGINI.ymax = ymax; | |
156 | } | |
157 | //______________________________________________________________________________ | |
f893d4a5 | 158 | void TPHICgen::SetNMAS (Int_t nmas ) const |
0b5dd071 | 159 | { |
160 | GGINI.nmas = nmas; | |
161 | } | |
162 | //______________________________________________________________________________ | |
f893d4a5 | 163 | void TPHICgen::SetNY (Int_t ny ) const |
0b5dd071 | 164 | { |
165 | GGINI.ny = ny; | |
166 | } | |
167 | //______________________________________________________________________________ | |
f893d4a5 | 168 | void TPHICgen::SetKFERM (Int_t kferm ) const |
0b5dd071 | 169 | { |
170 | GGINI.kferm = kferm; | |
171 | } | |
172 | //______________________________________________________________________________ | |
f893d4a5 | 173 | void TPHICgen::SetKFONIUM (Int_t kfonium ) const |
0b5dd071 | 174 | { |
175 | GGINI.kfonium = kfonium; | |
176 | } | |
177 | //______________________________________________________________________________ | |
f893d4a5 | 178 | void TPHICgen::SetXMRES (Float_t xmres ) const |
0b5dd071 | 179 | { |
180 | GGINI.xmres = xmres; | |
181 | } | |
182 | //______________________________________________________________________________ | |
f893d4a5 | 183 | void TPHICgen::SetXGTRES (Float_t xgtres ) const |
0b5dd071 | 184 | { |
185 | GGINI.xgtres = xgtres; | |
186 | } | |
187 | //______________________________________________________________________________ | |
f893d4a5 | 188 | void TPHICgen::SetXGGRES (Float_t xggres ) const |
0b5dd071 | 189 | { |
190 | GGINI.xggres = xggres; | |
191 | } | |
192 | //______________________________________________________________________________ | |
f893d4a5 | 193 | void TPHICgen::SetMODDCY (Int_t moddcy ) const |
0b5dd071 | 194 | { |
195 | GGINI.moddcy = moddcy; | |
196 | } | |
197 | //______________________________________________________________________________ | |
f893d4a5 | 198 | void TPHICgen::SetTHETAMIN (Float_t thetamin) const |
0b5dd071 | 199 | { |
200 | GGINI.thetamin = thetamin; | |
201 | } | |
202 | //______________________________________________________________________________ | |
f893d4a5 | 203 | void TPHICgen::SetKV1 (Int_t kv1 ) const |
0b5dd071 | 204 | { |
205 | GGINI.kv1 = kv1; | |
206 | } | |
207 | //______________________________________________________________________________ | |
f893d4a5 | 208 | void TPHICgen::SetKV2 (Int_t kv2 ) const |
0b5dd071 | 209 | { |
210 | GGINI.kv2 = kv2; | |
211 | } | |
212 | ||
213 | //______________________________________________________________________________ | |
214 | // Getters for COMMON /GGEVNT/ | |
a6778119 | 215 | Float_t TPHICgen::GetWSQ() const |
0b5dd071 | 216 | { |
217 | return GGEVNT.wsq; | |
218 | } | |
219 | //______________________________________________________________________________ | |
a6778119 | 220 | Float_t TPHICgen::GetYGG() const |
0b5dd071 | 221 | { |
222 | return GGEVNT.ygg; | |
223 | } | |
224 | //______________________________________________________________________________ | |
a6778119 | 225 | Float_t TPHICgen::GetXMG1() const |
0b5dd071 | 226 | { |
227 | return GGEVNT.xmg1; | |
228 | } | |
229 | //______________________________________________________________________________ | |
a6778119 | 230 | Float_t TPHICgen::GetXMG2() const |
0b5dd071 | 231 | { |
232 | return GGEVNT.xmg2; | |
233 | } | |
234 | //______________________________________________________________________________ | |
a6778119 | 235 | Float_t TPHICgen::GetP2G(Int_t i) const |
0b5dd071 | 236 | { |
237 | return GGEVNT.p2g[i]; | |
238 | } | |
239 | //______________________________________________________________________________ | |
a6778119 | 240 | Float_t TPHICgen::GetPTAG1(Int_t i) const |
0b5dd071 | 241 | { |
242 | return GGEVNT.ptag1[i]; | |
243 | } | |
244 | //______________________________________________________________________________ | |
a6778119 | 245 | Float_t TPHICgen::GetPTAG2(Int_t i) const |
0b5dd071 | 246 | { |
247 | return GGEVNT.ptag2[i]; | |
248 | } | |
249 | //______________________________________________________________________________ | |
a6778119 | 250 | Int_t TPHICgen::GetNGG() const |
0b5dd071 | 251 | { |
252 | return GGEVNT.ngg; | |
253 | } | |
254 | //______________________________________________________________________________ | |
a6778119 | 255 | Int_t TPHICgen::GetKGG(Int_t i) const |
0b5dd071 | 256 | { |
257 | return GGEVNT.kgg[i]; | |
258 | } | |
259 | //______________________________________________________________________________ | |
a6778119 | 260 | Float_t TPHICgen::GetPGG(Int_t i, Int_t j) const |
0b5dd071 | 261 | { |
262 | return GGEVNT.pgg[i][j]; | |
263 | } | |
264 | ||
265 | //______________________________________________________________________________ | |
266 | // Getters for COMMON /GGXS/ | |
a6778119 | 267 | Float_t TPHICgen::GetXSMAX0() const |
0b5dd071 | 268 | { |
269 | return GGXS.xsmax0; | |
270 | } | |
271 | //______________________________________________________________________________ | |
a6778119 | 272 | Float_t TPHICgen::GetXSCUR0() const |
0b5dd071 | 273 | { |
274 | return GGXS.xscur0; | |
275 | } | |
276 | //______________________________________________________________________________ | |
a6778119 | 277 | Float_t TPHICgen::GetXSCUR () const |
0b5dd071 | 278 | { |
279 | return GGXS.xscur; | |
280 | } | |
281 | //______________________________________________________________________________ | |
a6778119 | 282 | Float_t TPHICgen::GetXSTOT () const |
0b5dd071 | 283 | { |
284 | return GGXS.xstot; | |
285 | } | |
286 | //______________________________________________________________________________ | |
a6778119 | 287 | Float_t TPHICgen::GetXSTOTE() const |
0b5dd071 | 288 | { |
289 | return GGXS.xstote; | |
290 | } |