/************************************************************************** * Copyright(c) 1998-2002, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * * * **************************************************************************/ //------------------------------------------------------------------------ // TPHICgen is an interface class to fortran event generator of // two-photon processes in ultra-peripheral ion collisions //% // Yuri.Kharlov@cern.ch // 15 April 2003 //------------------------------------------------------------------------ #include "TRandom.h" #include "TPHICgen.h" //#include "TClonesArray.h" //#include "TParticle.h" #define IN_TPHICGEN_CXX #include "TPHICcommon.h" #ifndef WIN32 # define gginit gginit_ # define ggrun ggrun_ # define ggexit ggexit_ # define ggrnd ggrnd_ #else # define gginit gginit # define ggrun ggrun # define ggexit ggexit # define ggrnd ggrnd #endif extern "C" { void gginit(); void ggrun() ; void ggexit(); // Double_t pyr_(Int_t*); Double_t ggrnd(Int_t*) { Double_t r; do r=gRandom->Rndm(); while(0 >= r || r >= 1); return r; // return pyr_(0); } } ClassImp(TPHICgen) //------------------------------------------------------------------------------ TPHICgen::TPHICgen() : TGenerator("TPHIC","TPHIC") { // TPHIC constructor } //------------------------------------------------------------------------------ TPHICgen::~TPHICgen() { // Destructor } //______________________________________________________________________________ void TPHICgen::Initialize() { // Initialize TPHIC const Float_t kNucleonMass = 0.931494; SetAMAS(GGINI.ia*kNucleonMass); gginit(); } //______________________________________________________________________________ void TPHICgen::GenerateEvent() { //produce one event ggrun(); } //______________________________________________________________________________ void TPHICgen::Finish() { // calculate cross section and print out cross section and related variables ggexit(); } //______________________________________________________________________________ // Setters void TPHICgen::SetIPROC (Int_t iproc ) const { GGINI.iproc = iproc; } //______________________________________________________________________________ void TPHICgen::SetNEVENT (Int_t nevent ) const { GGINI.nevent = nevent; } //______________________________________________________________________________ void TPHICgen::SetILUMF (Int_t ilumf ) const { GGINI.ilumf = ilumf; } //______________________________________________________________________________ void TPHICgen::SetLUMFIL (TString lumfil ) const { for (Int_t i=0; i