Static data member fgTop replaced with the static function GetTop();
[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
a6778119 96void TPHICgen::SetIPROC (Int_t iproc )
0b5dd071 97{
98 GGINI.iproc = iproc;
99}
100//______________________________________________________________________________
a6778119 101void TPHICgen::SetNEVENT (Int_t nevent )
0b5dd071 102{
103 GGINI.nevent = nevent;
104}
105//______________________________________________________________________________
a6778119 106void TPHICgen::SetILUMF (Int_t ilumf )
0b5dd071 107{
108 GGINI.ilumf = ilumf;
109}
110//______________________________________________________________________________
a6778119 111void TPHICgen::SetLUMFIL (TString lumfil )
0b5dd071 112{
113 for (Int_t i=0; i<lumfil.Length(); i++)
114 GGINI.lumfil[i] = lumfil[i];
115}
116//______________________________________________________________________________
a6778119 117void TPHICgen::SetEBMN (Float_t ebmn )
0b5dd071 118{
119 GGINI.ebmn = ebmn;
120}
121//______________________________________________________________________________
a6778119 122void TPHICgen::SetIZ (Int_t iz )
0b5dd071 123{
124 GGINI.iz = iz;
125}
126//______________________________________________________________________________
a6778119 127void TPHICgen::SetIA (Int_t ia )
0b5dd071 128{
129 GGINI.ia = ia;
130}
131//______________________________________________________________________________
a6778119 132void TPHICgen::SetAMAS (Float_t amas )
0b5dd071 133{
134 GGINI.amas = amas;
135}
136//______________________________________________________________________________
a6778119 137void TPHICgen::SetAMIN (Float_t amin )
0b5dd071 138{
139 GGINI.amin = amin;
140}
141//______________________________________________________________________________
a6778119 142void TPHICgen::SetAMAX (Float_t amax )
0b5dd071 143{
144 GGINI.amax = amax;
145}
146//______________________________________________________________________________
a6778119 147void TPHICgen::SetYMIN (Float_t ymin )
0b5dd071 148{
149 GGINI.ymin = ymin;
150}
151//______________________________________________________________________________
a6778119 152void TPHICgen::SetYMAX (Float_t ymax )
0b5dd071 153{
154 GGINI.ymax = ymax;
155}
156//______________________________________________________________________________
a6778119 157void TPHICgen::SetNMAS (Int_t nmas )
0b5dd071 158{
159 GGINI.nmas = nmas;
160}
161//______________________________________________________________________________
a6778119 162void TPHICgen::SetNY (Int_t ny )
0b5dd071 163{
164 GGINI.ny = ny;
165}
166//______________________________________________________________________________
a6778119 167void TPHICgen::SetKFERM (Int_t kferm )
0b5dd071 168{
169 GGINI.kferm = kferm;
170}
171//______________________________________________________________________________
a6778119 172void TPHICgen::SetKFONIUM (Int_t kfonium )
0b5dd071 173{
174 GGINI.kfonium = kfonium;
175}
176//______________________________________________________________________________
a6778119 177void TPHICgen::SetXMRES (Float_t xmres )
0b5dd071 178{
179 GGINI.xmres = xmres;
180}
181//______________________________________________________________________________
a6778119 182void TPHICgen::SetXGTRES (Float_t xgtres )
0b5dd071 183{
184 GGINI.xgtres = xgtres;
185}
186//______________________________________________________________________________
a6778119 187void TPHICgen::SetXGGRES (Float_t xggres )
0b5dd071 188{
189 GGINI.xggres = xggres;
190}
191//______________________________________________________________________________
a6778119 192void TPHICgen::SetMODDCY (Int_t moddcy )
0b5dd071 193{
194 GGINI.moddcy = moddcy;
195}
196//______________________________________________________________________________
a6778119 197void TPHICgen::SetTHETAMIN (Float_t thetamin)
0b5dd071 198{
199 GGINI.thetamin = thetamin;
200}
201//______________________________________________________________________________
a6778119 202void TPHICgen::SetKV1 (Int_t kv1 )
0b5dd071 203{
204 GGINI.kv1 = kv1;
205}
206//______________________________________________________________________________
a6778119 207void TPHICgen::SetKV2 (Int_t kv2 )
0b5dd071 208{
209 GGINI.kv2 = kv2;
210}
211
212//______________________________________________________________________________
213// Getters for COMMON /GGEVNT/
a6778119 214Float_t TPHICgen::GetWSQ() const
0b5dd071 215{
216 return GGEVNT.wsq;
217}
218//______________________________________________________________________________
a6778119 219Float_t TPHICgen::GetYGG() const
0b5dd071 220{
221 return GGEVNT.ygg;
222}
223//______________________________________________________________________________
a6778119 224Float_t TPHICgen::GetXMG1() const
0b5dd071 225{
226 return GGEVNT.xmg1;
227}
228//______________________________________________________________________________
a6778119 229Float_t TPHICgen::GetXMG2() const
0b5dd071 230{
231 return GGEVNT.xmg2;
232}
233//______________________________________________________________________________
a6778119 234Float_t TPHICgen::GetP2G(Int_t i) const
0b5dd071 235{
236 return GGEVNT.p2g[i];
237}
238//______________________________________________________________________________
a6778119 239Float_t TPHICgen::GetPTAG1(Int_t i) const
0b5dd071 240{
241 return GGEVNT.ptag1[i];
242}
243//______________________________________________________________________________
a6778119 244Float_t TPHICgen::GetPTAG2(Int_t i) const
0b5dd071 245{
246 return GGEVNT.ptag2[i];
247}
248//______________________________________________________________________________
a6778119 249Int_t TPHICgen::GetNGG() const
0b5dd071 250{
251 return GGEVNT.ngg;
252}
253//______________________________________________________________________________
a6778119 254Int_t TPHICgen::GetKGG(Int_t i) const
0b5dd071 255{
256 return GGEVNT.kgg[i];
257}
258//______________________________________________________________________________
a6778119 259Float_t TPHICgen::GetPGG(Int_t i, Int_t j) const
0b5dd071 260{
261 return GGEVNT.pgg[i][j];
262}
263
264//______________________________________________________________________________
265// Getters for COMMON /GGXS/
a6778119 266Float_t TPHICgen::GetXSMAX0() const
0b5dd071 267{
268 return GGXS.xsmax0;
269}
270//______________________________________________________________________________
a6778119 271Float_t TPHICgen::GetXSCUR0() const
0b5dd071 272{
273 return GGXS.xscur0;
274}
275//______________________________________________________________________________
a6778119 276Float_t TPHICgen::GetXSCUR () const
0b5dd071 277{
278 return GGXS.xscur;
279}
280//______________________________________________________________________________
a6778119 281Float_t TPHICgen::GetXSTOT () const
0b5dd071 282{
283 return GGXS.xstot;
284}
285//______________________________________________________________________________
a6778119 286Float_t TPHICgen::GetXSTOTE() const
0b5dd071 287{
288 return GGXS.xstote;
289}