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