/************************************************************************** * Copyright(c) 1998-1999, 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. * **************************************************************************/ /* $Id$ */ //----------------------------------------------------------------------------- // Class: AliHijingRndm // Random Number Interface to Fortran (FINCTION RLU_HIJING from HIJING) // Since AliGenHijing belongs to another module (THijing) one cannot // pass the ponter to the generator via static variable // Author: //----------------------------------------------------------------------------- #include #include "AliHijingRndm.h" TRandom * AliHijingRndm::fgHijingRandom=0; ClassImp(AliHijingRndm) //_______________________________________________________________________ AliHijingRndm::AliHijingRndm() { // // Default ctor // } //_______________________________________________________________________ AliHijingRndm::AliHijingRndm(const AliHijingRndm& rn) { // // Copy constructor // rn.Copy(*this); } //_______________________________________________________________________ AliHijingRndm::~AliHijingRndm() { // // Destructor // fgHijingRandom=0; } //_______________________________________________________________________ void AliHijingRndm::Copy(AliHijingRndm&) const { // // No copy is allowed // ::Fatal("Copy","Not implemented\n"); } //_______________________________________________________________________ void AliHijingRndm::SetHijingRandom(TRandom *ran) { // // Sets the pointer to an existing random numbers generator // if(ran) fgHijingRandom=ran; else fgHijingRandom=gRandom; } //_______________________________________________________________________ TRandom * AliHijingRndm::GetHijingRandom() { // // Retrieves the pointer to the random numbers generator // return fgHijingRandom; } //_______________________________________________________________________ # define rluget_hijing rluget_hijing_ # define rluset_hijing rluset_hijing_ # define rlu_hijing rlu_hijing_ extern "C" { void rluget_hijing(Int_t & /*lfn*/, Int_t & /*move*/) {printf("Dummy version of rluget_hijing reached\n");} void rluset_hijing(Int_t & /*lfn*/, Int_t & /*move*/) {printf("Dummy version of rluset_hijing reached\n");} Double_t rlu_hijing(Int_t & /*idum*/) { // Wrapper to FINCTION RLU_HIJING from HIJING // Uses static method to retrieve the pointer to the (C++) generator Double_t r; do r=AliHijingRndm::GetHijingRandom()->Rndm(); while(0 >= r || r >= 1); return r; } }