Bug fix: AliHLTComponent::ConfigureFromArgumentString
[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"
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
44extern "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
57ClassImp(TPHICgen)
58
59//------------------------------------------------------------------------------
60TPHICgen::TPHICgen() : TGenerator("TPHIC","TPHIC")
61{
62 // TPHIC constructor
63}
64
65//------------------------------------------------------------------------------
66TPHICgen::~TPHICgen()
67{
68 // Destructor
69}
70
71//______________________________________________________________________________
72void TPHICgen::Initialize()
73{
74 // Initialize TPHIC
75 const Float_t kNucleonMass = 0.931494;
76 SetAMAS(GGINI.ia*kNucleonMass);
77 gginit();
78}
79
80//______________________________________________________________________________
81void TPHICgen::GenerateEvent()
82{
83 //produce one event
84 ggrun();
85}
86
87//______________________________________________________________________________
88void TPHICgen::Finish()
89{
90 // calculate cross section and print out cross section and related variables
91 ggexit();
92}
93
94//______________________________________________________________________________
95
96// Setters
f893d4a5 97void TPHICgen::SetIPROC (Int_t iproc ) const
0b5dd071 98{
99 GGINI.iproc = iproc;
100}
101//______________________________________________________________________________
f893d4a5 102void TPHICgen::SetNEVENT (Int_t nevent ) const
0b5dd071 103{
104 GGINI.nevent = nevent;
105}
106//______________________________________________________________________________
f893d4a5 107void TPHICgen::SetILUMF (Int_t ilumf ) const
0b5dd071 108{
109 GGINI.ilumf = ilumf;
110}
111//______________________________________________________________________________
f893d4a5 112void 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 118void TPHICgen::SetEBMN (Float_t ebmn ) const
0b5dd071 119{
120 GGINI.ebmn = ebmn;
121}
122//______________________________________________________________________________
f893d4a5 123void TPHICgen::SetIZ (Int_t iz ) const
0b5dd071 124{
125 GGINI.iz = iz;
126}
127//______________________________________________________________________________
f893d4a5 128void TPHICgen::SetIA (Int_t ia ) const
0b5dd071 129{
130 GGINI.ia = ia;
131}
132//______________________________________________________________________________
f893d4a5 133void TPHICgen::SetAMAS (Float_t amas ) const
0b5dd071 134{
135 GGINI.amas = amas;
136}
137//______________________________________________________________________________
f893d4a5 138void TPHICgen::SetAMIN (Float_t amin ) const
0b5dd071 139{
140 GGINI.amin = amin;
141}
142//______________________________________________________________________________
f893d4a5 143void TPHICgen::SetAMAX (Float_t amax ) const
0b5dd071 144{
145 GGINI.amax = amax;
146}
147//______________________________________________________________________________
f893d4a5 148void TPHICgen::SetYMIN (Float_t ymin ) const
0b5dd071 149{
150 GGINI.ymin = ymin;
151}
152//______________________________________________________________________________
f893d4a5 153void TPHICgen::SetYMAX (Float_t ymax ) const
0b5dd071 154{
155 GGINI.ymax = ymax;
156}
157//______________________________________________________________________________
f893d4a5 158void TPHICgen::SetNMAS (Int_t nmas ) const
0b5dd071 159{
160 GGINI.nmas = nmas;
161}
162//______________________________________________________________________________
f893d4a5 163void TPHICgen::SetNY (Int_t ny ) const
0b5dd071 164{
165 GGINI.ny = ny;
166}
167//______________________________________________________________________________
f893d4a5 168void TPHICgen::SetKFERM (Int_t kferm ) const
0b5dd071 169{
170 GGINI.kferm = kferm;
171}
172//______________________________________________________________________________
f893d4a5 173void TPHICgen::SetKFONIUM (Int_t kfonium ) const
0b5dd071 174{
175 GGINI.kfonium = kfonium;
176}
177//______________________________________________________________________________
f893d4a5 178void TPHICgen::SetXMRES (Float_t xmres ) const
0b5dd071 179{
180 GGINI.xmres = xmres;
181}
182//______________________________________________________________________________
f893d4a5 183void TPHICgen::SetXGTRES (Float_t xgtres ) const
0b5dd071 184{
185 GGINI.xgtres = xgtres;
186}
187//______________________________________________________________________________
f893d4a5 188void TPHICgen::SetXGGRES (Float_t xggres ) const
0b5dd071 189{
190 GGINI.xggres = xggres;
191}
192//______________________________________________________________________________
f893d4a5 193void TPHICgen::SetMODDCY (Int_t moddcy ) const
0b5dd071 194{
195 GGINI.moddcy = moddcy;
196}
197//______________________________________________________________________________
f893d4a5 198void TPHICgen::SetTHETAMIN (Float_t thetamin) const
0b5dd071 199{
200 GGINI.thetamin = thetamin;
201}
202//______________________________________________________________________________
f893d4a5 203void TPHICgen::SetKV1 (Int_t kv1 ) const
0b5dd071 204{
205 GGINI.kv1 = kv1;
206}
207//______________________________________________________________________________
f893d4a5 208void TPHICgen::SetKV2 (Int_t kv2 ) const
0b5dd071 209{
210 GGINI.kv2 = kv2;
211}
212
213//______________________________________________________________________________
214// Getters for COMMON /GGEVNT/
a6778119 215Float_t TPHICgen::GetWSQ() const
0b5dd071 216{
217 return GGEVNT.wsq;
218}
219//______________________________________________________________________________
a6778119 220Float_t TPHICgen::GetYGG() const
0b5dd071 221{
222 return GGEVNT.ygg;
223}
224//______________________________________________________________________________
a6778119 225Float_t TPHICgen::GetXMG1() const
0b5dd071 226{
227 return GGEVNT.xmg1;
228}
229//______________________________________________________________________________
a6778119 230Float_t TPHICgen::GetXMG2() const
0b5dd071 231{
232 return GGEVNT.xmg2;
233}
234//______________________________________________________________________________
a6778119 235Float_t TPHICgen::GetP2G(Int_t i) const
0b5dd071 236{
237 return GGEVNT.p2g[i];
238}
239//______________________________________________________________________________
a6778119 240Float_t TPHICgen::GetPTAG1(Int_t i) const
0b5dd071 241{
242 return GGEVNT.ptag1[i];
243}
244//______________________________________________________________________________
a6778119 245Float_t TPHICgen::GetPTAG2(Int_t i) const
0b5dd071 246{
247 return GGEVNT.ptag2[i];
248}
249//______________________________________________________________________________
a6778119 250Int_t TPHICgen::GetNGG() const
0b5dd071 251{
252 return GGEVNT.ngg;
253}
254//______________________________________________________________________________
a6778119 255Int_t TPHICgen::GetKGG(Int_t i) const
0b5dd071 256{
257 return GGEVNT.kgg[i];
258}
259//______________________________________________________________________________
a6778119 260Float_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 267Float_t TPHICgen::GetXSMAX0() const
0b5dd071 268{
269 return GGXS.xsmax0;
270}
271//______________________________________________________________________________
a6778119 272Float_t TPHICgen::GetXSCUR0() const
0b5dd071 273{
274 return GGXS.xscur0;
275}
276//______________________________________________________________________________
a6778119 277Float_t TPHICgen::GetXSCUR () const
0b5dd071 278{
279 return GGXS.xscur;
280}
281//______________________________________________________________________________
a6778119 282Float_t TPHICgen::GetXSTOT () const
0b5dd071 283{
284 return GGXS.xstot;
285}
286//______________________________________________________________________________
a6778119 287Float_t TPHICgen::GetXSTOTE() const
0b5dd071 288{
289 return GGXS.xstote;
290}