/*
$Log$
+Revision 1.3 2000/12/21 16:24:06 morsch
+Coding convention clean-up
+
Revision 1.2 2000/11/30 07:12:50 alibrary
Introducing new Rndm and QA classes
-GenFunc AliGenGSIlib::GetPt(Param_t param, const char * tname)
+GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname)
{
// Return pointer to pT parameterisation
GenFunc func=0;
TString sname(tname);
switch (param)
{
- case upsilon_p:
+ case kUpsilon:
if (sname=="MUON"){
func= PtUpsilonMUON;
break;
-GenFunc AliGenGSIlib::GetY(Param_t param, const char * tname)
+GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname)
{
// Return pointer to y- parameterisation
GenFunc func=0;
TString sname(tname);
switch (param)
{
- case upsilon_p:
+ case kUpsilon:
if (sname=="MUON"){
func= YUpsilonMUON;
break;
-GenFuncIp AliGenGSIlib::GetIp(Param_t param, const char * tname)
+GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname)
{
// Return pointer to particle type parameterisation
GenFuncIp func=0;
TString sname(tname);
switch (param)
{
- case upsilon_p:
+ case kUpsilon:
if (sname=="MUON"){
func=IpUpsilonMUON;
break;
class AliGenGSIlib :public AliGenLib {
public:
-
+ enum constants{kUpsilon};
// Upsilon RITMAN
static Double_t PtUpsilonRitman( Double_t *px, Double_t *dummy );
static Double_t YUpsilonRitman(Double_t *py, Double_t *dummy);
typedef Double_t (*GenFunc) (Double_t *, Double_t *);
typedef Int_t (*GenFuncIp)(TRandom *ran);
- GenFunc GetPt(Param_t param, const char * tname=0);
- GenFunc GetY(Param_t param, const char * tname=0);
- GenFuncIp GetIp(Param_t param, const char * tname=0);
+ GenFunc GetPt(Int_t param, const char * tname=0);
+ GenFunc GetY(Int_t param, const char * tname=0);
+ GenFuncIp GetIp(Int_t param, const char * tname=0);
static void SetDebug(Bool_t debug){fgDebug=debug;}
private:
static Bool_t fgDebug; // Debug flag
#include <TObject.h>
-#include "GenTypeDefs.h"
class TRandom;
class AliGenLib :
virtual ~AliGenLib(){}
typedef Double_t (*GenFunc) (Double_t *, Double_t *);
typedef Int_t (*GenFuncIp)(TRandom *);
- virtual GenFunc GetPt(Param_t param, const char *tname) = 0;
- virtual GenFunc GetY (Param_t param, const char *tname) = 0;
- virtual GenFuncIp GetIp(Param_t param, const char *tname) = 0;
+ virtual GenFunc GetPt(Int_t param, const char *tname) = 0;
+ virtual GenFunc GetY (Int_t param, const char *tname) = 0;
+ virtual GenFuncIp GetIp(Int_t param, const char *tname) = 0;
ClassDef(AliGenLib,0) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.11 2000/11/30 07:12:50 alibrary
+Introducing new Rndm and QA classes
+
Revision 1.10 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
}
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
-GenFunc AliGenMUONlib::GetPt(Param_t param, const char* tname)
+GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname)
{
// Return pointer to pT parameterisation
GenFunc func;
switch (param)
{
- case phi_p:
+ case kPhi:
func=PtPhi;
break;
- case jpsi_p:
+ case kJpsi:
func=PtJpsi;
break;
- case upsilon_p:
+ case kUpsilon:
func=PtUpsilon;
break;
- case charm_p:
+ case kCharm:
func=PtCharm;
break;
- case beauty_p:
+ case kBeauty:
func=PtBeauty;
break;
- case pion_p:
+ case kPion:
func=PtPion;
break;
- case kaon_p:
+ case kKaon:
func=PtKaon;
break;
default:
return func;
}
-GenFunc AliGenMUONlib::GetY(Param_t param, const char* tname)
+GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname)
{
// Return pointer to y- parameterisation
GenFunc func;
switch (param)
{
- case phi_p:
+ case kPhi:
func=YPhi;
break;
- case jpsi_p:
+ case kJpsi:
func=YJpsi;
break;
- case upsilon_p:
+ case kUpsilon:
func=YUpsilon;
break;
- case charm_p:
+ case kCharm:
func=YCharm;
break;
- case beauty_p:
+ case kBeauty:
func=YBeauty;
break;
- case pion_p:
+ case kPion:
func=YPion;
break;
- case kaon_p:
+ case kKaon:
func=YKaon;
break;
default:
return func;
}
typedef Int_t (*GenFuncIp) (TRandom *);
-GenFuncIp AliGenMUONlib::GetIp(Param_t param, const char* tname)
+GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* tname)
{
// Return pointer to particle type parameterisation
GenFuncIp func;
switch (param)
{
- case phi_p:
+ case kPhi:
func=IpPhi;
break;
- case jpsi_p:
+ case kJpsi:
func=IpJpsi;
break;
- case upsilon_p:
+ case kUpsilon:
func=IpUpsilon;
break;
- case charm_p:
+ case kCharm:
func=IpCharm;
break;
- case beauty_p:
+ case kBeauty:
func=IpBeauty;
break;
- case pion_p:
+ case kPion:
func=IpPion;
break;
- case kaon_p:
+ case kKaon:
func=IpKaon;
break;
default:
public AliGenLib
{
public:
+ enum constants{kPhi, kJpsi, kUpsilon, kCharm, kBeauty, kPion, kKaon};
+
+
// pions
static Double_t PtPion(Double_t *px, Double_t *dummy);
static Double_t PtScal(Double_t pt, Int_t np);
static Double_t YBeauty(Double_t *py, Double_t *dummy);
static Int_t IpBeauty(TRandom *ran);
//
- GenFunc GetPt(Param_t param, const char* tname=0);
- GenFunc GetY (Param_t param, const char* tname=0);
- GenFuncIp GetIp(Param_t param, const char* tname=0);
+ GenFunc GetPt(Int_t param, const char* tname=0);
+ GenFunc GetY (Int_t param, const char* tname=0);
+ GenFuncIp GetIp(Int_t param, const char* tname=0);
ClassDef(AliGenMUONlib,0) // Library providing y and pT parameterisations
};
#endif
/*
$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
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
- GenFunc AliGenPHOSlib::GetPt(Param_t param, const char* tname)
+ 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, const char* tname)
+ 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) (TRandom *);
- GenFuncIp AliGenPHOSlib::GetIp(Param_t param, const char* tname)
+ 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:
public AliGenLib
{
public:
+ enum constants{kPion, kKaon, kEta, kOmega, kEtaPrime, kPhi, kBaryon};
// pions
static Double_t PtPion(Double_t *px, Double_t *dummy);
static Double_t PtScal(Double_t pt, Int_t np);
static Double_t YBaryon( Double_t *py, Double_t *dummy);
static Int_t IpBaryon(TRandom *ran);
- GenFunc GetPt(Param_t param, const char* tname=0);
- GenFunc GetY (Param_t param, const char* tname=0);
- GenFuncIp GetIp(Param_t param, const char* tname=0);
+ GenFunc GetPt(Int_t param, const char* tname=0);
+ GenFunc GetY (Int_t param, const char* tname=0);
+ GenFuncIp GetIp(Int_t param, const char* tname=0);
ClassDef(AliGenPHOSlib,0) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.2 2000/11/30 07:12:50 alibrary
+Introducing new Rndm and QA classes
+
Revision 1.1 2000/09/08 15:37:58 morsch
pt and y-parameterisations for PMD physics simulation.
THIS VERSION IS JUST A TEMPLATE THE PT AND Y DISTRIBUTIONS HAVE TO BE CORRECTED !!!!.
typedef Double_t (*GenFunc) (Double_t*, Double_t*);
-GenFunc AliGenPMDlib::GetPt(Param_t param, const char* tname)
+GenFunc AliGenPMDlib::GetPt(Int_t param, const char* tname)
{
// Return pointer to pT parameterisation
GenFunc func=NULL;
switch (param)
{
- case Pion:
+ case kPion:
func=PtPi0;
break;
- case Eta:
+ case kEta:
func=PtEta;
break;
default:
return func;
}
-GenFunc AliGenPMDlib::GetY(Param_t param, const char* tname)
+GenFunc AliGenPMDlib::GetY(Int_t param, const char* tname)
{
// Return pointer to y- parameterisation
GenFunc func=NULL;
switch (param)
{
- case Pion:
+ case kPion:
func=YPi0;
break;
- case Eta:
+ case kEta:
func=YEta;
break;
default:
}
typedef Int_t (*GenFuncIp) (TRandom *);
-GenFuncIp AliGenPMDlib::GetIp(Param_t param, const char* tname)
+GenFuncIp AliGenPMDlib::GetIp(Int_t param, const char* tname)
{
// Return pointer to particle type parameterisation
GenFuncIp func=NULL;
switch (param)
{
- case Pion:
+ case kPion:
func=IpPi0;
break;
- case Eta:
+ case kEta:
func=IpEta;
break;
default:
public AliGenLib
{
public:
+ enum constants{kPion, kEta};
// Neutral pions
static Double_t PtPi0(Double_t *px, Double_t *dummy);
static Double_t PtScal(Double_t pt, Int_t np);
static Double_t YEta( Double_t *py, Double_t *dummy);
static Int_t IpEta(TRandom *ran);
//
- GenFunc GetPt(Param_t param, const char* tname=0);
- GenFunc GetY (Param_t param, const char* tname=0);
- GenFuncIp GetIp(Param_t param, const char* tname=0);
+ GenFunc GetPt(Int_t param, const char* tname=0);
+ GenFunc GetY (Int_t param, const char* tname=0);
+ GenFuncIp GetIp(Int_t param, const char* tname=0);
ClassDef(AliGenPMDlib,0) // Library providing y and pT parameterisations
};
#endif
/*
$Log$
+Revision 1.27 2001/02/02 15:21:10 morsch
+Set high water mark after last particle.
+Use Vertex() method for Vertex.
+
Revision 1.26 2000/12/21 16:24:06 morsch
Coding convention clean-up
// Deafault constructor
fPtPara = 0;
fYPara = 0;
- fParam = jpsi_p;
- fAnalog = analog;
+ fParam = 0;
+ fAnalog = kAnalog;
SetCutOnChild();
SetChildMomentumRange();
SetChildPtRange();
sRandom = fRandom;
}
-AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname):AliGenerator(npart)
+AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library, Int_t param, char* tname):AliGenerator(npart)
{
// Constructor using number of particles parameterisation id and library
fPtPara = 0;
fYPara = 0;
fParam = param;
- fAnalog = analog;
+ fAnalog = kAnalog;
fChildSelect.Set(5);
for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
SetForceDecay();
//____________________________________________________________
-AliGenParam::AliGenParam(Int_t npart, Param_t param, char* tname):AliGenerator(npart)
+AliGenParam::AliGenParam(Int_t npart, Int_t param, char* tname):AliGenerator(npart)
{
// Constructor using parameterisation id and number of particles
//
fPtPara = 0;
fYPara = 0;
fParam = param;
- fAnalog = analog;
+ fAnalog = kAnalog;
fChildSelect.Set(5);
for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
SetForceDecay();
SetDeltaPt();
}
-AliGenParam::AliGenParam(Int_t npart, Param_t param,
+AliGenParam::AliGenParam(Int_t npart, Int_t param,
Double_t (*PtPara) (Double_t*, Double_t*),
Double_t (*YPara ) (Double_t* ,Double_t*),
Int_t (*IpPara) (TRandom *))
fPtPara = 0;
fYPara = 0;
fParam = param;
- fAnalog = analog;
+ fAnalog = kAnalog;
fChildSelect.Set(5);
for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
SetForceDecay();
Float_t intPt0 = ptPara->Integral(0,15);
Float_t intPtS = ptPara->Integral(fPtMin,fPtMax);
Float_t phiWgt=(fPhiMax-fPhiMin)/2./TMath::Pi();
- if (fAnalog == analog) {
+ if (fAnalog == kAnalog) {
fYWgt = intYS/fdNdy0;
fPtWgt = intPtS/intPt0;
fParentWeight = fYWgt*fPtWgt*phiWgt/fNpart;
//
switch (fForceDecay)
{
- case semielectronic:
- case dielectron:
- case b_jpsi_dielectron:
- case b_psip_dielectron:
+ case kSemiElectronic:
+ case kDiElectron:
+ case kBJpsiDiElectron:
+ case kBPsiPrimeDiElectron:
fChildSelect[0]=11;
break;
- case semimuonic:
- case dimuon:
- case b_jpsi_dimuon:
- case b_psip_dimuon:
+ case kSemiMuonic:
+ case kDiMuon:
+ case kBJpsiDiMuon:
+ case kBPsiPrimeDiMuon:
fChildSelect[0]=13;
break;
- case pitomu:
+ case kPiToMu:
fChildSelect[0]=13;
break;
- case katomu:
+ case kKaToMu:
fChildSelect[0]=13;
break;
- case hadronicD:
+ case kHadronicD:
// Implement me !!
break;
- case nodecay:
+ case kNoDecay:
break;
- case all:
+ case kAll:
break;
}
}
ty=Float_t(TMath::TanH(fYPara->GetRandom()));
//
// pT
- if (fAnalog == analog) {
+ if (fAnalog == kAnalog) {
pt=fPtPara->GetRandom();
wgtp=fParentWeight;
wgtch=fChildWeight;
// if fForceDecay == none Primary particle is tracked by GEANT
// (In the latest, make sure that GEANT actually does all the decays you want)
//
- if (fForceDecay != nodecay) {
+ if (fForceDecay != kNoDecay) {
// Using lujet to decay particle
Float_t energy=TMath::Sqrt(ptot*ptot+am*am);
TLorentzVector pmom(p[0], p[1], p[2], energy);
Int_t kf = iparticle->GetPdgCode();
//
// children
- if (ChildSelected(TMath::Abs(kf)) || fForceDecay==all)
+ if (ChildSelected(TMath::Abs(kf)) || fForceDecay == kAll)
{
pc[0]=iparticle->Px();
pc[1]=iparticle->Py();
/* $Id$ */
#include "AliGenerator.h"
-#include "GenTypeDefs.h"
+#include "AliDecayer.h"
#include <TArrayI.h>
-class AliDecayer;
class AliPythia;
class TParticle;
class AliGenLib;
class TF1;
+typedef enum { kAnalog, kNonAnalog} Weighting_t;
//-------------------------------------------------------------
class AliGenParam : public AliGenerator
{
public:
AliGenParam();
- AliGenParam(Int_t npart, AliGenLib * Library, Param_t param, char* tname=0);
- AliGenParam(Int_t npart, Param_t param, char* tname=0);
- AliGenParam(Int_t npart, Param_t param,
+ AliGenParam(Int_t npart, AliGenLib * Library, Int_t param, char* tname = 0);
+ AliGenParam(Int_t npart, Int_t param, char* tname = 0);
+ AliGenParam(Int_t npart, Int_t param,
Double_t (*PtPara)(Double_t*, Double_t*),
Double_t (*YPara )(Double_t*, Double_t*),
Int_t (*IpPara)(TRandom*) );
virtual void Generate();
virtual void Init();
// select particle type
- virtual void SetParam(Param_t param=jpsi_p) {fParam=param;}
+ virtual void SetParam(Int_t param) {fParam = param;}
// force decay type
- virtual void SetForceDecay(Decay_t decay=dimuon) {fForceDecay=decay;}
- virtual void SetWeighting(Weighting_t flag=analog) {fAnalog=flag;}
- virtual void SetCutOnChild(Int_t flag=0) {fCutOnChild=flag;}
- virtual void SetChildMomentumRange(Float_t pmin=0, Float_t pmax=1.e10)
+ virtual void SetForceDecay(Decay_t decay = kDiMuon) {fForceDecay = decay;}
+ virtual void SetWeighting(Weighting_t flag = kAnalog) {fAnalog = flag;}
+ virtual void SetCutOnChild(Int_t flag = 0) {fCutOnChild = flag;}
+ virtual void SetChildMomentumRange(Float_t pmin = 0, Float_t pmax = 1.e10)
{fChildPMin = pmin; fChildPMax = pmax;}
- virtual void SetChildPtRange(Float_t ptmin=0, Float_t ptmax=20.)
+ virtual void SetChildPtRange(Float_t ptmin = 0, Float_t ptmax = 20.)
{fChildPtMin = ptmin; fChildPtMax = ptmax;}
- virtual void SetChildPhiRange(Float_t phimin=-180., Float_t phimax=180)
+ virtual void SetChildPhiRange(Float_t phimin = -180., Float_t phimax = 180)
{fChildPhiMin = TMath::Pi()*phimin/180;
- fChildPhiMax = TMath::Pi()*phimax/180;}
- virtual void SetChildThetaRange(Float_t thetamin=0, Float_t thetamax=180)
+ fChildPhiMax = TMath::Pi()*phimax/180;}
+ virtual void SetChildThetaRange(Float_t thetamin = 0, Float_t thetamax = 180)
{fChildThetaMin = TMath::Pi()*thetamin/180;
- fChildThetaMax = TMath::Pi()*thetamax/180;}
- virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt=delta;}
+ fChildThetaMax = TMath::Pi()*thetamax/180;}
+ virtual void SetDeltaPt(Float_t delta=0.01) {fDeltaPt = delta;}
AliGenParam & operator=(const AliGenParam & rhs);
protected:
Int_t (*fIpParaFunc )(TRandom*); //! Pointer to particle type parametrisation function
TF1* fPtPara; // Transverse momentum parameterisation
TF1* fYPara; // Rapidity parameterisation
- Param_t fParam; // Parameterisation type
+ Int_t fParam; // Parameterisation type
Float_t fdNdy0; // central multiplicity per event
Float_t fYWgt; // Y-weight
Float_t fPtWgt; // Pt-weight