1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 // Class: AliDpmJetRndm
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
26 //-----------------------------------------------------------------------------
30 #include "AliDpmJetRndm.h"
32 TRandom * AliDpmJetRndm::fgDpmJetRandom=0;
34 ClassImp(AliDpmJetRndm)
37 //_______________________________________________________________________
38 void AliDpmJetRndm::SetDpmJetRandom(TRandom *ran) {
40 // Sets the pointer to an existing random numbers generator
42 if(ran) fgDpmJetRandom=ran;
43 else fgDpmJetRandom=gRandom;
46 //_______________________________________________________________________
47 TRandom * AliDpmJetRndm::GetDpmJetRandom() {
49 // Retrieves the pointer to the random numbers generator
51 return fgDpmJetRandom;
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_
61 # define dt_rndm_dpmjet DT_RNDM_DPMJET_
62 # define dt_rndmst_dpmjet DT_RNDMST_DPMJET
63 # define dt_rndmin_dpmjet DT_RNDMIN_DPMJET
64 # define dt_rndmou_dpmjet DT_RNDMOU_DPMJET
65 # define type_of_call _stdcall
70 void type_of_call dt_rndmst_(Int_t &, Int_t &, Int_t &, Int_t &)
71 {printf("Dummy version of dt_rndmst reached\n");}
73 void type_of_call dt_rndmin_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
74 {printf("Dummy version of dt_rndmin reached\n");}
76 void type_of_call dt_rndmou_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
77 {printf("Dummy version of dt_rndmou reached\n");}
79 void type_of_call dt_rndmte_(Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &)
80 {printf("Dummy version of dt_rndmou reached\n");}
82 Double_t type_of_call dt_rndm_(Int_t &)
84 // Wrapper to static method which retrieves the
85 // pointer to the Root (C++) generator
87 do r = AliDpmJetRndm::GetDpmJetRandom()->Rndm();
88 while(0 >= r || r >= 1);