/*
$Log$
+Revision 1.6 2000/11/30 07:12:50 alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.5 2000/06/29 21:08:27 morsch
+All paramatrisation libraries derive from the pure virtual base class AliGenLib.
+This allows to pass a pointer to a library directly to AliGenParam and avoids the
+use of function pointers in Config.C.
+
+Revision 1.4 2000/06/14 15:21:05 morsch
+Include clean-up (IH)
+
+Revision 1.3 2000/06/09 20:32:54 morsch
+All coding rule violations except RS3 corrected
+
Revision 1.2 1999/11/04 11:30:48 fca
Improve comments
// martinez@subatech.in2p3.fr
//======================================================================
-#include "AliGenPHOSlib.h"
#include "TMath.h"
-#include "AliRun.h"
+#include "TRandom.h"
+
+#include "AliGenPHOSlib.h"
ClassImp(AliGenPHOSlib)
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpPion()
+ Int_t AliGenPHOSlib::IpPion(TRandom *ran)
{
// particle composition pi+, pi0, pi-
//
- Float_t random[1];
- gMC->Rndm(random,1);
+ Float_t random = ran->Rndm();
- if ( (3.*random[0]) < 1. )
+ if ( (3.*random) < 1. )
{
return 211 ;
}
else
{
- if ( (3.*random[0]) >= 2.)
+ if ( (3.*random) >= 2.)
{
return -211 ;
}
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpKaon()
+ Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
{
// particle composition
//
- Float_t random[1],random2[1];
- gMC->Rndm(random,1);
- gMC->Rndm(random2,1);
- if (random2[0] < 0.5)
+ Float_t random = ran->Rndm();
+ Float_t random2 = ran->Rndm();
+ if (random2 < 0.5)
{
- if (random[0] < 0.5) {
+ if (random < 0.5) {
return 321; // K+
} else {
return -321; // K-
}
else
{
- if (random[0] < 0.5) {
+ if (random < 0.5) {
return 130; // K^0 short
} else {
return 310; // K^0 long
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpEta()
+ Int_t AliGenPHOSlib::IpEta(TRandom *)
{
// particle composition
//
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpOmega()
+ Int_t AliGenPHOSlib::IpOmega(TRandom *)
{
// particle composition
//
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpEtaprime()
+ Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
{
// particle composition
//
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpPhi()
+ Int_t AliGenPHOSlib::IpPhi(TRandom *)
{
// particle composition
//
return ka*TMath::Exp(-ex);
}
- Int_t AliGenPHOSlib::IpBaryon()
+ Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
{
// particle composition
//
- Float_t random[1],random2[1];
- gMC->Rndm(random,1);
- gMC->Rndm(random2,1);
- if (random2[0] < 0.5)
+ Float_t random = ran->Rndm();
+ Float_t random2 = ran->Rndm();
+ if (random2 < 0.5)
{
- if (random[0] < 0.5) {
+ if (random < 0.5) {
return 2212; // p
} else {
return -2212; // pbar
}
else
{
- if (random[0] < 0.5) {
+ if (random < 0.5) {
return 2112; // n
} else {
return -2112; // n bar
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
- GenFunc AliGenPHOSlib::GetPt(Param_t param)
+ GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* tname)
{
// Return pinter to pT parameterisation
GenFunc func;
switch (param)
{
- case Pion:
+ case kPion:
func=PtPion;
break;
- case Kaon:
+ case kKaon:
func=PtKaon;
break;
- case Eta:
+ case kEta:
func=PtEta;
break;
- case Omega:
+ case kOmega:
func=PtOmega;
break;
- case Etaprime:
+ case kEtaPrime:
func=PtEtaprime;
break;
- case Baryon:
+ case kBaryon:
func=PtBaryon;
break;
default:
return func;
}
- GenFunc AliGenPHOSlib::GetY(Param_t param)
+ GenFunc AliGenPHOSlib::GetY(Int_t param, const char* tname)
{
// Return pointer to Y parameterisation
GenFunc func;
switch (param)
{
- case Pion:
+ case kPion:
func=YPion;
break;
- case Kaon:
+ case kKaon:
func=YKaon;
break;
- case Eta:
+ case kEta:
func=YEta;
break;
- case Omega:
+ case kOmega:
func=YOmega;
break;
- case Etaprime:
+ case kEtaPrime:
func=YEtaprime;
break;
- case Phi:
+ case kPhi:
func=YPhi;
break;
- case Baryon:
+ case kBaryon:
func=YBaryon;
break;
default:
}
return func;
}
-typedef Int_t (*GenFuncIp) ();
- GenFuncIp AliGenPHOSlib::GetIp(Param_t param)
+typedef Int_t (*GenFuncIp) (TRandom *);
+ GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* tname)
{
// Return pointer to particle composition
GenFuncIp func;
switch (param)
{
- case Pion:
+ case kPion:
func=IpPion;
break;
- case Kaon:
+ case kKaon:
func=IpKaon;
break;
- case Eta:
+ case kEta:
func=IpEta;
break;
- case Omega:
+ case kOmega:
func=IpOmega;
break;
- case Etaprime:
+ case kEtaPrime:
func=IpEtaprime;
break;
- case Phi:
+ case kPhi:
func=IpPhi;
break;
- case Baryon:
+ case kBaryon:
func=IpBaryon;
break;
default: