]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPHIC/TPHICgen.cxx
Messages on a single line for easy parsing
[u/mrichter/AliRoot.git] / TPHIC / TPHICgen.cxx
CommitLineData
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"
27#include "TClonesArray.h"
28#include "TParticle.h"
29#include "TPHICcommon.h"
30
31#ifndef WIN32
32# define gginit gginit_
33# define ggrun ggrun_
34# define ggexit ggexit_
35# define ggrnd ggrnd_
36#else
37# define gginit gginit
38# define ggrun ggrun
39# define ggexit ggexit
40# define ggrnd ggrnd
41#endif
42
43extern "C" {
44 void gginit();
45 void ggrun() ;
46 void ggexit();
47// Double_t pyr_(Int_t*);
48 Double_t ggrnd(Int_t*) {
49 Double_t r;
50 do r=gRandom->Rndm(); while(0 >= r || r >= 1);
51 return r;
52// return pyr_(0);
53 }
54}
55
56ClassImp(TPHICgen)
57
58//------------------------------------------------------------------------------
59TPHICgen::TPHICgen() : TGenerator("TPHIC","TPHIC")
60{
61 // TPHIC constructor
62}
63
64//------------------------------------------------------------------------------
65TPHICgen::~TPHICgen()
66{
67 // Destructor
68}
69
70//______________________________________________________________________________
71void TPHICgen::Initialize()
72{
73 // Initialize TPHIC
74 const Float_t kNucleonMass = 0.931494;
75 SetAMAS(GGINI.ia*kNucleonMass);
76 gginit();
77}
78
79//______________________________________________________________________________
80void TPHICgen::GenerateEvent()
81{
82 //produce one event
83 ggrun();
84}
85
86//______________________________________________________________________________
87void TPHICgen::Finish()
88{
89 // calculate cross section and print out cross section and related variables
90 ggexit();
91}
92
93//______________________________________________________________________________
94
95// Setters
96void TPHICgen::SetIPROC (const Int_t iproc )
97{
98 GGINI.iproc = iproc;
99}
100//______________________________________________________________________________
101void TPHICgen::SetNEVENT (const Int_t nevent )
102{
103 GGINI.nevent = nevent;
104}
105//______________________________________________________________________________
106void TPHICgen::SetILUMF (const Int_t ilumf )
107{
108 GGINI.ilumf = ilumf;
109}
110//______________________________________________________________________________
111void TPHICgen::SetLUMFIL (const TString lumfil )
112{
113 for (Int_t i=0; i<lumfil.Length(); i++)
114 GGINI.lumfil[i] = lumfil[i];
115}
116//______________________________________________________________________________
117void TPHICgen::SetEBMN (const Float_t ebmn )
118{
119 GGINI.ebmn = ebmn;
120}
121//______________________________________________________________________________
122void TPHICgen::SetIZ (const Int_t iz )
123{
124 GGINI.iz = iz;
125}
126//______________________________________________________________________________
127void TPHICgen::SetIA (const Int_t ia )
128{
129 GGINI.ia = ia;
130}
131//______________________________________________________________________________
132void TPHICgen::SetAMAS (const Float_t amas )
133{
134 GGINI.amas = amas;
135}
136//______________________________________________________________________________
137void TPHICgen::SetAMIN (const Float_t amin )
138{
139 GGINI.amin = amin;
140}
141//______________________________________________________________________________
142void TPHICgen::SetAMAX (const Float_t amax )
143{
144 GGINI.amax = amax;
145}
146//______________________________________________________________________________
147void TPHICgen::SetYMIN (const Float_t ymin )
148{
149 GGINI.ymin = ymin;
150}
151//______________________________________________________________________________
152void TPHICgen::SetYMAX (const Float_t ymax )
153{
154 GGINI.ymax = ymax;
155}
156//______________________________________________________________________________
157void TPHICgen::SetNMAS (const Int_t nmas )
158{
159 GGINI.nmas = nmas;
160}
161//______________________________________________________________________________
162void TPHICgen::SetNY (const Int_t ny )
163{
164 GGINI.ny = ny;
165}
166//______________________________________________________________________________
167void TPHICgen::SetKFERM (const Int_t kferm )
168{
169 GGINI.kferm = kferm;
170}
171//______________________________________________________________________________
172void TPHICgen::SetKFONIUM (const Int_t kfonium )
173{
174 GGINI.kfonium = kfonium;
175}
176//______________________________________________________________________________
177void TPHICgen::SetXMRES (const Float_t xmres )
178{
179 GGINI.xmres = xmres;
180}
181//______________________________________________________________________________
182void TPHICgen::SetXGTRES (const Float_t xgtres )
183{
184 GGINI.xgtres = xgtres;
185}
186//______________________________________________________________________________
187void TPHICgen::SetXGGRES (const Float_t xggres )
188{
189 GGINI.xggres = xggres;
190}
191//______________________________________________________________________________
192void TPHICgen::SetMODDCY (const Int_t moddcy )
193{
194 GGINI.moddcy = moddcy;
195}
196//______________________________________________________________________________
197void TPHICgen::SetTHETAMIN (const Float_t thetamin)
198{
199 GGINI.thetamin = thetamin;
200}
201//______________________________________________________________________________
202void TPHICgen::SetKV1 (const Int_t kv1 )
203{
204 GGINI.kv1 = kv1;
205}
206//______________________________________________________________________________
207void TPHICgen::SetKV2 (const Int_t kv2 )
208{
209 GGINI.kv2 = kv2;
210}
211
212//______________________________________________________________________________
213// Getters for COMMON /GGEVNT/
214Float_t TPHICgen::GetWSQ()
215{
216 return GGEVNT.wsq;
217}
218//______________________________________________________________________________
219Float_t TPHICgen::GetYGG()
220{
221 return GGEVNT.ygg;
222}
223//______________________________________________________________________________
224Float_t TPHICgen::GetXMG1()
225{
226 return GGEVNT.xmg1;
227}
228//______________________________________________________________________________
229Float_t TPHICgen::GetXMG2()
230{
231 return GGEVNT.xmg2;
232}
233//______________________________________________________________________________
234Float_t TPHICgen::GetP2G(const Int_t i)
235{
236 return GGEVNT.p2g[i];
237}
238//______________________________________________________________________________
239Float_t TPHICgen::GetPTAG1(const Int_t i)
240{
241 return GGEVNT.ptag1[i];
242}
243//______________________________________________________________________________
244Float_t TPHICgen::GetPTAG2(const Int_t i)
245{
246 return GGEVNT.ptag2[i];
247}
248//______________________________________________________________________________
249Int_t TPHICgen::GetNGG()
250{
251 return GGEVNT.ngg;
252}
253//______________________________________________________________________________
254Int_t TPHICgen::GetKGG(const Int_t i)
255{
256 return GGEVNT.kgg[i];
257}
258//______________________________________________________________________________
259Float_t TPHICgen::GetPGG(const Int_t i, const Int_t j)
260{
261 return GGEVNT.pgg[i][j];
262}
263
264//______________________________________________________________________________
265// Getters for COMMON /GGXS/
266Float_t TPHICgen::GetXSMAX0()
267{
268 return GGXS.xsmax0;
269}
270//______________________________________________________________________________
271Float_t TPHICgen::GetXSCUR0()
272{
273 return GGXS.xscur0;
274}
275//______________________________________________________________________________
276Float_t TPHICgen::GetXSCUR ()
277{
278 return GGXS.xscur;
279}
280//______________________________________________________________________________
281Float_t TPHICgen::GetXSTOT ()
282{
283 return GGXS.xstot;
284}
285//______________________________________________________________________________
286Float_t TPHICgen::GetXSTOTE()
287{
288 return GGXS.xstote;
289}