]> git.uio.no Git - u/mrichter/AliRoot.git/blame - DPMJET/AliDpmJetRndm.cxx
corrected initialisation of NCP, NCT
[u/mrichter/AliRoot.git] / DPMJET / AliDpmJetRndm.cxx
CommitLineData
6ceb0b46 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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/* $Id$ */
17
18//-----------------------------------------------------------------------------
19// Class: AliDpmJetRndm
20f580b7 20// Responsibilities: Interface to Root random number generator
21// from Fortran (re-implements FINCTION dt_rndm_dpmjet)
22// Very similar to AliHijingRndm
23// Note: Since AliGenDpmJet belongs to another module (TDPMjet) one cannot
24// pass the ponter to the generator via static variable
25// Collaborators: AliGenDPMjet class
6ceb0b46 26//-----------------------------------------------------------------------------
27
20f580b7 28#include <TRandom.h>
6ceb0b46 29
30#include "AliDpmJetRndm.h"
31
32TRandom * AliDpmJetRndm::fgDpmJetRandom=0;
33
34ClassImp(AliDpmJetRndm)
35
6ceb0b46 36
37//_______________________________________________________________________
38void AliDpmJetRndm::SetDpmJetRandom(TRandom *ran) {
39 //
40 // Sets the pointer to an existing random numbers generator
41 //
42 if(ran) fgDpmJetRandom=ran;
43 else fgDpmJetRandom=gRandom;
44}
45
46//_______________________________________________________________________
47TRandom * AliDpmJetRndm::GetDpmJetRandom() {
48 //
49 // Retrieves the pointer to the random numbers generator
50 //
51 return fgDpmJetRandom;
52}
53
54#ifndef WIN32
55# define dt_rndm_dpmjet dt_rndm_dpmjet_
56# define dt_rndmst_dpmjet dt_rndmst_dpmjet_
57# define dt_rndmin_dpmjet dt_rndmin_dpmjet_
58# define dt_rndmou_dpmjet dt_rndmou_dpmjet_
3f1688cf 59# define rninit_dpmjet rninit_dpmjet_
6ceb0b46 60# define type_of_call
61#else
62# define dt_rndm_dpmjet DT_RNDM_DPMJET_
63# define dt_rndmst_dpmjet DT_RNDMST_DPMJET
64# define dt_rndmin_dpmjet DT_RNDMIN_DPMJET
65# define dt_rndmou_dpmjet DT_RNDMOU_DPMJET
3f1688cf 66# define rninit_dpmjet RNINIT_DPMJET
6ceb0b46 67# define type_of_call _stdcall
68#endif
69
70
71extern "C" {
839efe5b 72 void type_of_call dt_rndmst_(Int_t &, Int_t &, Int_t &, Int_t &)
6ceb0b46 73 {printf("Dummy version of dt_rndmst reached\n");}
74
839efe5b 75 void type_of_call dt_rndmin_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
6ceb0b46 76 {printf("Dummy version of dt_rndmin reached\n");}
77
839efe5b 78 void type_of_call dt_rndmou_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
6ceb0b46 79 {printf("Dummy version of dt_rndmou reached\n");}
80
839efe5b 81 void type_of_call dt_rndmte_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
82 {printf("Dummy version of dt_rndmou reached\n");}
83
3f1688cf 84 void type_of_call rninit_(Int_t &, Int_t &, Int_t &, Int_t &)
85 {printf("Dummy version of rninit reached\n");}
86
839efe5b 87 Double_t type_of_call dt_rndm_(Int_t &)
6ceb0b46 88 {
20f580b7 89 // Wrapper to static method which retrieves the
90 // pointer to the Root (C++) generator
6ceb0b46 91 Float_t r;
92 do r = AliDpmJetRndm::GetDpmJetRandom()->Rndm();
93 while(0 >= r || r >= 1);
94 return r;
95 }
96}
97
98