// //
///////////////////////////////////////////////////////////
-#include "TNamed.h"
-#include "TF1.h"
-#include "TArrayF.h"
-#include "TTree.h"
#include "AliGenerator.h"
+
#include <TClass.h>
+#include <TNamed.h>
+#include <TF1.h>
+#include <TArrayF.h>
+#include <TTree.h>
class AliGenCocktailEntry : public TObject
{
/*
$Log$
+Revision 1.6 1999/09/29 09:24:12 fca
+Introduction of the Copyright and cvs Log
+
*/
#include "AliGenFLUKAsource.h"
#include "AliMC.h"
#include "AliRun.h"
#include "AliPDG.h"
-
#include <TDirectory.h>
#include <TFile.h>
#include <TTree.h>
fFileName="flukasource.root";
fTreeFluka=0;
+ fTreeChain = new TChain("h1");
//
// Read all particles
fNpart=-1;
fFileName="flukasource.root";
fTreeFluka=0;
-
+ fTreeChain = new TChain("h1");
}
//____________________________________________________________
AliGenFLUKAsource::~AliGenFLUKAsource()
{
- delete fTreeFluka;
+ if (fTreeFluka) delete fTreeFluka;
+ if (fTreeChain) delete fTreeChain;
+ // if (fFileName) delete fFileName;
}
-//____________________________________________________________
-void AliGenFLUKAsource::FlukaInit()
+void AliGenFLUKAsource::AddFile(const Text_t *filename)
{
-//
-// reset the existing file environment and open a new root file if
-// the pointer to the Fluka tree is null
+ fTreeChain->Add(filename);
- TFile *File=0;
- if (fTreeFluka==0) {
- if (!File) {
- File = new TFile(fFileName);
- File->cd();
- cout<<"I have opened "<<fFileName<<" file "<<endl;
- }
-// get the tree address in the Fluka boundary source file
- fTreeFluka = (TTree*)gDirectory->Get("h1");
- } else {
- File = fTreeFluka->GetCurrentFile();
- File->cd();
- }
+}
+
- TTree *h2=fTreeFluka;
+//____________________________________________________________
+void AliGenFLUKAsource::FlukaInit()
+{
+ TChain *h2=fTreeChain;
//Set branch addresses
h2->SetBranchAddress("Ip",&Ip);
h2->SetBranchAddress("Ipp",&Ipp);
//____________________________________________________________
void AliGenFLUKAsource::Generate()
-{
+{
+ AliMC* gMC = AliMC::GetMC();
- const Int_t ifluge[28]={kProton, kProtonBar, kElectron, kPositron,
+ const Int_t ifluge[28]={kProton, kProtonBar, kElectron, kPositron,
kNuE, kNuEBar, kGamma, kNeutron, kNeutronBar,
kMuonPlus, kMuonMinus, kK0Long , kPiPlus, kPiMinus,
kKPlus, kKMinus, kLambda0, kLambda0Bar, kK0Short,
kSigmaMinus, kSigmaPlus, kSigma0, kPi0, kK0, kK0Bar,
0,kNuMu,kNuMuBar};
- Float_t polar[3]= {0,0,0};
+ Float_t polar[3]= {0,0,0};
//
- Float_t origin[3];
- Float_t p[3];
- Float_t prwn;
- Float_t wgt, fwgt;
- Float_t phi;
- char name[100];
- Float_t amass, charge, tlife;
- Int_t itrtyp;
- Int_t iwgt;
- Int_t i, j, part, nt;
- static Int_t irwn;
- //
- Float_t random[2];
+ Float_t origin[3];
+ Float_t p[3];
+ Float_t prwn;
+ Float_t wgt, fwgt;
+ Float_t phi;
+ char name[100];
+ Float_t amass, charge, tlife;
+ Int_t itrtyp;
+ Int_t iwgt;
+ Int_t i, j, part, nt;
+ static Int_t irwn;
+ //
+ Float_t random[2];
//
- FlukaInit();
- TTree *h2=fTreeFluka;
- Int_t nentries = (Int_t) h2->GetEntries();
- if (fNpart == -1) fNpart=Int_t(nentries*fFrac);
+ FlukaInit();
+ TChain *h2=fTreeChain;
+ Int_t nentries = (Int_t) h2->GetEntries();
+ if (fNpart == -1) fNpart=Int_t(nentries*fFrac);
// loop over number of particles
- Int_t nb=0;
- for (i=0; i<fNpart;i++) {
+ Int_t nb=0;
Int_t ev=gMC->CurrentEvent();
- Int_t entry=fNpart*(ev-1)+i;
- nb = (Int_t)h2->GetEvent(entry);
- if (irwn > nentries) {
- printf("No more entries in the FLUKA boundary source file\n");
- TFile *File=0;
- // Get AliRun object or create it
- if (!gAlice) {
- gAlice = (AliRun*)File->Get("gAlice");
- if (gAlice) printf("AliRun object found on file\n");
- if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
- }
- TTree *fAli=gAlice->TreeK();
- if (fAli) File =fAli->GetCurrentFile();
- File->cd();
- printf("Generate - I'm out \n");
- return;
- }
- if (Ip > 28 || Ip < 0) {
- irwn++;
- continue;
- }
-
- if ((Ip != fIkine && fIkine != 6 && fIkine != 9) || Age > fAgeMax){
- irwn++;
- continue;
- } else if (fIkine == 9) {
- if (Ip == 7 || Ip == 8 || Age > fAgeMax) {
- irwn++;
- continue;
- }
- }
-
-
- irwn++;
- printf("\n Particle type: %f \n \n ", Ip);
+ for (i=0; i<fNpart;i++) {
+ Int_t entry=fNpart*(ev-1)+i;
+ nb = (Int_t)h2->GetEvent(entry);
+ if (irwn > nentries) {
+ printf("No more entries in the FLUKA boundary source file\n");
+ TFile *File=0;
+ // Get AliRun object or create it
+ if (!gAlice) {
+ gAlice = (AliRun*)File->Get("gAlice");
+ if (gAlice) printf("AliRun object found on file\n");
+ if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
+ }
+ TTree *fAli=gAlice->TreeK();
+ if (fAli) File =fAli->GetCurrentFile();
+ File->cd();
+ printf("Generate - I'm out \n");
+ return;
+ }
+ if (Ip > 28 || Ip < 0) {
+ irwn++;
+ continue;
+ }
+
+ if ((Ip != fIkine && fIkine != 6 && fIkine != 9 && fIkine != 10) || Age > fAgeMax){
+ irwn++;
+ continue;
+ } else if (fIkine == 9) {
+ if (Ip == 7 || Ip == 8 || Age > fAgeMax) {
+ irwn++;
+ continue;
+ }
+ } else if (fIkine == 10) {
+ if (Ip == 8 || Age > fAgeMax) {
+ irwn++;
+ continue;
+ }
+ }
- if (Ip ==7){
- prwn=Ekin;
- part=1;
- } else if (Ip == 8) {
- prwn=sqrt(Ekin*Ekin + 2.*0.93956563);
- part=13;
- } else {
- part=ifluge[int(Ip)-1];
- gMC->Gfpart(part, name, itrtyp,
- amass, charge, tlife);
- prwn=sqrt(Ekin*Ekin + 2.*amass);
- }
- origin[0]=Xi;
- origin[1]=Yi;
- origin[2]=Zi;
- p[0]=Px*prwn;
- p[1]=Py*prwn;
- p[2]=Pz*prwn;
+ irwn++;
+ printf("\n Particle type: %f \n \n ", Ip);
+
+ if (Ip ==7){
+ prwn=Ekin;
+ part=1;
+ } else if (Ip == 8) {
+ prwn=Ekin*sqrt(1. + 2.*0.93956563/Ekin);
+ part=13;
+ } else {
+ part=ifluge[int(Ip)-1];
+ gMC->Gfpart(part, name, itrtyp,
+ amass, charge, tlife);
+ prwn=Ekin*sqrt(1. + 2.*amass/Ekin);
+ }
+ origin[0]=Yi;
+ origin[1]=Xi;
+ origin[2]=Zi;
+
+ p[0]=Py*prwn;
+ p[1]=Px*prwn;
+ p[2]=Pz*prwn;
- //handle particle weight correctly
- wgt = (part == 13) ? Wgt*fAddWeight : Wgt;
- iwgt=Int_t(wgt);
- fwgt=wgt-Float_t(iwgt);
- gMC->Rndm(random,2);
- if (random[0] < fwgt) iwgt++;
- if (part==1 && iwgt>100) iwgt=100;
- Int_t nstack=0;
- for (j=0; j<iwgt; j++) {
- gAlice->SetTrack(1,-1,part,p,origin,polar,0,"Primary",nt);
+ //handle particle weight correctly
+ wgt = (part == 13) ? Wgt*fAddWeight : Wgt;
+ iwgt=Int_t(wgt);
+ fwgt=wgt-Float_t(iwgt);
gMC->Rndm(random,2);
- phi=2*random[1]*TMath::Pi();
- Float_t pn1=p[0]*TMath::Sin(phi) - p[1]*TMath::Cos(phi);
- Float_t pn2=p[0]*TMath::Cos(phi) + p[1]*TMath::Sin(phi);
- p[0]=pn1;
- p[1]=pn2;
- Float_t on1=origin[0]*TMath::Sin(phi)-origin[1]*TMath::Cos(phi);
- Float_t on2=origin[0]*TMath::Cos(phi)+origin[1]*TMath::Sin(phi);
- origin[0]=on1;
- origin[1]=on2;
- nstack++;
+ if (random[0] < fwgt) iwgt++;
+ if (part==1 && iwgt>100) iwgt=100;
+ Int_t nstack=0;
+ for (j=0; j<iwgt; j++) {
+ gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,Age,"Primary",nt);
+ gMC->Rndm(random,2);
+ phi=2*random[1]*TMath::Pi();
+ Float_t pn1=p[0]*TMath::Sin(phi) - p[1]*TMath::Cos(phi);
+ Float_t pn2=p[0]*TMath::Cos(phi) + p[1]*TMath::Sin(phi);
+ p[0]=pn1;
+ p[1]=pn2;
+ Float_t on1=origin[0]*TMath::Sin(phi)-origin[1]*TMath::Cos(phi);
+ Float_t on2=origin[0]*TMath::Cos(phi)+origin[1]*TMath::Sin(phi);
+ origin[0]=on1;
+ origin[1]=on2;
+ nstack++;
+ }
+ if (nstack == 0) continue;
}
- if (nstack == 0) continue;
- }
-
+
TFile *File=0;
// Get AliRun object or create it
if (!gAlice) {
#include "TF1.h"
#include "TArrayF.h"
#include "TTree.h"
-
+#include "TChain.h"
// Read background particles from a FLUKA boundary source file
class AliGenFLUKAsource : public AliGenerator
Float_t fZshift; //Shift the Z of impact point by this quantity
Float_t fFrac;
- const Text_t *fFileName; //!Choose the file
-
+ const Text_t *fFileName; //!Choose the file
+ TChain *fTreeChain;
TTree *fTreeFluka; //pointer to the TTree
//Declaration of variables read from the file -- TTree type
Float_t Ip;
virtual void SetZshift(Float_t zshift) {fZshift=zshift;}
// set file name of data file
virtual void SetFileName(const Text_t *filname) {fFileName=filname;}
+ virtual void AddFile(const Text_t *filname) ;
// read only fraction of data
virtual void SetFraction(Float_t frac=1.){fFrac=frac;}
// generate event
/*
$Log$
+Revision 1.4 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
+
*/
#include "AliGenHalo.h"
p[1]=p0*ty;
p[2]=p0*tz;
fParentWeight=wgt;
- gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
+ gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
origin[2]=-origin[2];
p[2]=-p[2];
- gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
+ gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
origin[2]=-origin[2];
p[2]=-p[2];
}
#include <TROOT.h>
#include "GenTypeDefs.h"
+
class AliGenMUONlib :
public TObject
{
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+//======================================================================
+// AliGenPHOSlib class contains parameterizations of the
+// pion, kaon, eta, omega, etaprime, phi and baryon (proton,
+// antiproton, neutron and anti-neutron) particles for the
+// study of the neutral background in PHOS detector.
+// These parameterizations are used by the
+// AliGenParam class:
+// AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
+// AliGenPHOSlib::GetY(param),
+// AliGenPHOSlib::GetIp(param) )
+// param represents the particle to be simulated :
+// Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
+// Pt distributions are calculated from the transverse mass scaling
+// with Pions, using the PtScal fonction taken from AliGenMUONlib
+// version aliroot 3.01
+//
+// Gines MARTINEZ GPS @ SUBATECH, Nantes , France
+// http://www-subatech.in2p3.fr/~photons/subatech
+// martinez@subatech.in2p3.fr
+//======================================================================
+
+#include "AliGenPHOSlib.h"
+#include "AliRun.h"
+
+ClassImp(AliGenPHOSlib)
+
+//======================================================================
+// P I O N S
+// (From GetPt, GetY and GetIp as param = Pion)
+// Transverse momentum distribution" PtPion
+// Rapidity distribution YPion
+// Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
+//
+ Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
+{
+// Pion transverse momentum distribtuion taken
+// from AliGenMUONlib class, version 3.01 of alirrot
+// PT-PARAMETERIZATION CDF, PRL 61(88) 1819
+// POWER LAW FOR PT > 500 MEV
+// MT SCALING BELOW (T=160 MEV)
+//
+ const Double_t p0 = 1.3;
+ const Double_t xn = 8.28;
+ const Double_t xlim=0.5;
+ const Double_t t=0.160;
+ const Double_t xmpi=0.139;
+ const Double_t b=1.;
+ Double_t y, y1, xmpi2, ynorm, a;
+ Double_t x=*px;
+ //
+ y1=TMath::Power(p0/(p0+xlim),xn);
+ xmpi2=xmpi*xmpi;
+ ynorm=b*(TMath::Exp(-sqrt(xlim*xlim+xmpi2)/t));
+ a=ynorm/y1;
+ if (x > xlim)
+ y=a*TMath::Power(p0/(p0+x),xn);
+ else
+ y=b*TMath::Exp(-sqrt(x*x+xmpi2)/t);
+ return y*x;
+}
+//
+// y-distribution
+//
+ Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
+{
+ const Double_t a = 7000.;
+ const Double_t dy = 4.;
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+// particle composition pi+, pi0, pi-
+//
+ Int_t AliGenPHOSlib::IpPion()
+{
+ Float_t random[1];
+ gMC->Rndm(random,1);
+
+ if ( (3.*random[0]) < 1. )
+ {
+ return 211 ;
+ }
+ else
+ {
+ if ( (3.*random[0]) >= 2.)
+ {
+ return -211 ;
+ }
+ else
+ {
+ return 111 ;
+ }
+ }
+}
+// End Pions
+//=============================================================
+//
+// Mt-scaling
+// Fonction for the calculation of the Pt distribution for a
+// given particle np, from the pion Pt distribution using the
+// mt scaling. This function was taken from AliGenMUONlib
+// aliroot version 3.01, and was extended for baryons
+// np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
+// 7=>BARYONS-BARYONBARS
+ Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
+{
+ // SCALING EN MASSE PAR RAPPORT A PTPI
+ // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
+ const Double_t hm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
+ // MASS 7=>BARYON-BARYONBAR
+ 0.938, 0. , 0., 0.};
+ // VALUE MESON/PI AT 5 GEV
+ const Double_t fmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
+ np--;
+ Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+hm[np]*hm[np])+2.0)),12.3);
+ Double_t fmax2=f5/fmax[np];
+ // PIONS
+ Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
+ Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
+ (sqrt(pt*pt+hm[np]*hm[np])+2.0)),12.3)/ fmax2;
+ return fmtscal*ptpion;
+}
+// End Scaling
+//============================================================================
+// K A O N S
+// kaon
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
+{
+ return PtScal(*px,2); // 2==> Kaon in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpKaon()
+{
+ Float_t random[1],random2[1];
+ gMC->Rndm(random,1);
+ gMC->Rndm(random2,1);
+ if (random2[0] < 0.5)
+ {
+ if (random[0] < 0.5) {
+ return 321; // K+
+ } else {
+ return -321; // K-
+ }
+ }
+ else
+ {
+ if (random[0] < 0.5) {
+ return 311; // K^0
+ } else {
+ return -311; // K^0 bar
+ }
+ }
+}
+// End Kaons
+//============================================================================
+//============================================================================
+// E T A S
+// etas
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
+{
+ return PtScal(*px,3); // 3==> Eta in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpEta()
+{
+ return 221; // eta
+}
+// End Etas
+//============================================================================
+//============================================================================
+// O M E G A S
+// omegas
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
+{
+ return PtScal(*px,4); // 4==> Omega in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpOmega()
+{
+ return 223; // Omega
+}
+// End Omega
+//============================================================================
+//============================================================================
+// E T A P R I M E
+// etaprime
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
+{
+ return PtScal(*px,5); // 5==> Etaprime in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpEtaprime()
+{
+ return 331; // Etaprime
+}
+// End EtaPrime
+//===================================================================
+//============================================================================
+// P H I S
+// phi
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
+{
+ return PtScal(*px,6); // 6==> Phi in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpPhi()
+{
+ return 333; // Phi
+}
+// End Phis
+//===================================================================
+//============================================================================
+// B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
+// baryons
+// pt-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
+{
+ return PtScal(*px,7); // 7==> Baryon in the PtScal function
+}
+
+// y-distribution
+//____________________________________________________________
+ Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
+{
+ const Double_t a = 1000.;
+ const Double_t dy = 4.;
+
+
+ Double_t y=TMath::Abs(*py);
+ //
+ Double_t ex = y*y/(2*dy*dy);
+ return a*TMath::Exp(-ex);
+}
+
+// particle composition
+//
+ Int_t AliGenPHOSlib::IpBaryon()
+{
+ Float_t random[1],random2[1];
+ gMC->Rndm(random,1);
+ gMC->Rndm(random2,1);
+ if (random2[0] < 0.5)
+ {
+ if (random[0] < 0.5) {
+ return 2212; // p
+ } else {
+ return -2212; // pbar
+ }
+ }
+ else
+ {
+ if (random[0] < 0.5) {
+ return 2112; // n
+ } else {
+ return -2112; // n bar
+ }
+ }
+}
+// End Baryons
+//===================================================================
+
+
+typedef Double_t (*GenFunc) (Double_t*, Double_t*);
+ GenFunc AliGenPHOSlib::GetPt(Param_t param)
+{
+ GenFunc func;
+
+ switch (param)
+ {
+ case Pion:
+ func=PtPion;
+ break;
+ case Kaon:
+ func=PtKaon;
+ break;
+ case Eta:
+ func=PtEta;
+ break;
+ case Omega:
+ func=PtOmega;
+ break;
+ case Etaprime:
+ func=PtEtaprime;
+ break;
+ case Baryon:
+ func=PtBaryon;
+ break;
+ default:
+ func=0;
+ printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
+ }
+ return func;
+}
+
+ GenFunc AliGenPHOSlib::GetY(Param_t param)
+{
+ GenFunc func;
+ switch (param)
+ {
+ case Pion:
+ func=YPion;
+ break;
+ case Kaon:
+ func=YKaon;
+ break;
+ case Eta:
+ func=YEta;
+ break;
+ case Omega:
+ func=YOmega;
+ break;
+ case Etaprime:
+ func=YEtaprime;
+ break;
+ case Phi:
+ func=YPhi;
+ break;
+ case Baryon:
+ func=YBaryon;
+ break;
+ default:
+ func=0;
+ printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
+ }
+ return func;
+}
+typedef Int_t (*GenFuncIp) ();
+ GenFuncIp AliGenPHOSlib::GetIp(Param_t param)
+{
+ GenFuncIp func;
+ switch (param)
+ {
+ case Pion:
+
+ func=IpPion;
+ break;
+ case Kaon:
+ func=IpKaon;
+ break;
+ case Eta:
+ func=IpEta;
+ break;
+ case Omega:
+ func=IpOmega;
+ break;
+ case Etaprime:
+ func=IpEtaprime;
+ break;
+ case Phi:
+ func=IpPhi;
+ break;
+ case Baryon:
+ func=IpBaryon;
+ break;
+ default:
+ func=0;
+ printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");
+ }
+ return func;
+}
+
--- /dev/null
+#ifndef _AliGenPHOSlib_H
+#define _AliGenPHOSlib_H
+#include <TROOT.h>
+#include "GenTypeDefs.h"
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+class AliGenPHOSlib :
+public TObject
+{
+ public:
+// pions
+ static Double_t PtPion(Double_t *px, Double_t *);
+ static Double_t PtScal(Double_t pt, Int_t np);
+ static Double_t YPion( Double_t *py, Double_t *);
+ static Int_t IpPion();
+// kaons
+ static Double_t PtKaon(Double_t *px, Double_t *);
+ static Double_t YKaon( Double_t *py, Double_t *);
+ static Int_t IpKaon();
+// etas
+ static Double_t PtEta(Double_t *px, Double_t *);
+ static Double_t YEta( Double_t *py, Double_t *);
+ static Int_t IpEta();
+// omegas
+ static Double_t PtOmega(Double_t *px, Double_t *);
+ static Double_t YOmega( Double_t *py, Double_t *);
+ static Int_t IpOmega();
+// etaprime
+ static Double_t PtEtaprime(Double_t *px, Double_t *);
+ static Double_t YEtaprime( Double_t *py, Double_t *);
+ static Int_t IpEtaprime();
+// phis
+ static Double_t PtPhi(Double_t *px, Double_t *);
+ static Double_t YPhi( Double_t *py, Double_t *);
+ static Int_t IpPhi();
+// baryons
+ static Double_t PtBaryon(Double_t *px, Double_t *);
+ static Double_t YBaryon( Double_t *py, Double_t *);
+ static Int_t IpBaryon();
+
+ typedef Double_t (*GenFunc) (Double_t *, Double_t *);
+ typedef Int_t (*GenFuncIp)();
+ static GenFunc GetPt(Param_t param);
+ static GenFunc GetY(Param_t param);
+ static GenFuncIp GetIp(Param_t param);
+ ClassDef(AliGenPHOSlib,1)
+};
+#endif
+
+
+
+
+
+
+
/*
$Log$
+Revision 1.11 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
+
*/
#include "AliGenParam.h"
#include "AliGenMUONlib.h"
+#include "AliGenPHOSlib.h"
#include "AliRun.h"
#include "AliPythia.h"
#include <TDirectory.h>
}
//____________________________________________________________
-AliGenParam::AliGenParam(Int_t npart, Param_t param)
-// Double_t (*PtPara)(Double_t*, Double_t*),
-// Double_t (*YPara) (Double_t* ,Double_t*))
- :AliGenerator(npart)
+
+AliGenParam::AliGenParam(Int_t npart, Param_t param) :AliGenerator(npart)
{
//
// fName="HMESONpara";
fAnalog = analog;
fChildSelect.Set(5);
for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
- ForceDecay();
+ SetForceDecay();
SetCutOnChild();
}
+AliGenParam::AliGenParam(Int_t npart, Param_t param,
+ Double_t (*PtPara) (Double_t*, Double_t*),
+ Double_t (*YPara ) (Double_t* ,Double_t*),
+ Int_t (*IpPara) ())
+ :AliGenerator(npart)
+{
+// Gines Martinez 1/10/99
+ fPtParaFunc = PtPara;
+ fYParaFunc = YPara;
+ fIpParaFunc = IpPara;
+//
+
+ fPtPara = 0;
+ fYPara = 0;
+ fParam = param;
+ fAnalog = analog;
+ fChildSelect.Set(5);
+ for (Int_t i=0; i<5; i++) fChildSelect[i]=0;
+ SetForceDecay();
+ SetCutOnChild();
+}
+
//____________________________________________________________
AliGenParam::~AliGenParam()
{
case katomu:
fChildSelect[0]=13;
break;
+ case nodecay:
+ break;
+ case all:
+ break;
}
-
}
//____________________________________________________________
Float_t polar[3]= {0,0,0};
//
- Float_t origin[3], origin0[3];
+ Float_t origin0[3];
Float_t pt, pl, ptot;
Float_t phi, theta;
Float_t p[3], pc[3], och[3], pch[10][3];
}
//
// use lujet to decay particle
-
- Float_t energy=TMath::Sqrt(ptot*ptot+am*am);
- fPythia->DecayParticle(Ipart,energy,theta,phi);
- // fPythia->LuList(1);
-
-
- //printf("origin0 %f %f %f\n",origin0[0],origin0[1],origin0[2]);
- //printf("fCutOnChild %d \n",fCutOnChild);
+ if (fForceDecay != nodecay) {
+ Float_t energy=TMath::Sqrt(ptot*ptot+am*am);
+ fPythia->DecayParticle(Ipart,energy,theta,phi);
+ // fPythia->LuList(1);
+ //printf("origin0 %f %f %f\n",origin0[0],origin0[1],origin0[2]);
+ //printf("fCutOnChild %d \n",fCutOnChild);
//
// select muons
- Int_t np=fPythia->ImportParticles(particles,"All");
- //printf("np %d \n",np);
- Int_t ncsel=0;
- for (i = 1; i<np; i++) {
- TParticle * iparticle = (TParticle *) particles->At(i);
- Int_t kf = iparticle->GetPdgCode();
- //printf("kf %d\n",kf);
+ Int_t np=fPythia->ImportParticles(particles,"All");
+ //printf("np %d \n",np);
+ Int_t ncsel=0;
+ for (i = 1; i<np; i++) {
+ TParticle * iparticle = (TParticle *) particles->At(i);
+ Int_t kf = iparticle->GetPdgCode();
//
// children
- if (ChildSelected(TMath::Abs(kf)))
- {
- pc[0]=iparticle->Px();
- pc[1]=iparticle->Py();
- pc[2]=iparticle->Pz();
- och[0]=origin0[0]+iparticle->Vx()/10;
- och[1]=origin0[1]+iparticle->Vy()/10;
- och[2]=origin0[2]+iparticle->Vz()/10;
- if (fCutOnChild) {
- Float_t PtChild=TMath::Sqrt(pc[0]*pc[0]+pc[1]*pc[1]);
- Float_t PChild=TMath::Sqrt(PtChild*PtChild+pc[2]*pc[2]);
- Float_t ThetaChild=TMath::ATan2(PtChild,pc[2]);
- Float_t PhiChild=TMath::ATan2(pc[1],pc[0])+TMath::Pi();
- Bool_t childok =
- ((PtChild > fPtMin && PtChild <fPtMax) &&
- (PChild > fPMin && PChild <fPMax) &&
- (ThetaChild>fThetaMin && ThetaChild<fThetaMax) &&
- (PhiChild > fPhiMin && PhiChild <fPhiMax));
- if(childok)
- {
- pch[ncsel][0]=pc[0];
- pch[ncsel][1]=pc[1];
- pch[ncsel][2]=pc[2];
- kfch[ncsel]=kf;
- ncsel++;
+ if (ChildSelected(TMath::Abs(kf)))
+ {
+ pc[0]=iparticle->Px();
+ pc[1]=iparticle->Py();
+ pc[2]=iparticle->Pz();
+ och[0]=origin0[0]+iparticle->Vx()/10;
+ och[1]=origin0[1]+iparticle->Vy()/10;
+ och[2]=origin0[2]+iparticle->Vz()/10;
+ if (fCutOnChild) {
+ Float_t PtChild=TMath::Sqrt(pc[0]*pc[0]+pc[1]*pc[1]);
+ Float_t PChild=TMath::Sqrt(PtChild*PtChild+pc[2]*pc[2]);
+ Float_t ThetaChild=TMath::ATan2(PtChild,pc[2]);
+ Float_t PhiChild=TMath::ATan2(pc[1],pc[0])+TMath::Pi();
+ Bool_t childok =
+ ((PtChild > fPtMin && PtChild <fPtMax) &&
+ (PChild > fPMin && PChild <fPMax) &&
+ (ThetaChild>fThetaMin && ThetaChild<fThetaMax) &&
+ (PhiChild > fPhiMin && PhiChild <fPhiMax));
+ if(childok)
+ {
+ pch[ncsel][0]=pc[0];
+ pch[ncsel][1]=pc[1];
+ pch[ncsel][2]=pc[2];
+ kfch[ncsel]=kf;
+ ncsel++;
+ } else {
+ ncsel=-1;
+ break;
+ } // child kine cuts
} else {
- ncsel=-1;
- break;
- } // child kine cuts
- } else {
- pch[ncsel][0]=pc[0];
- pch[ncsel][1]=pc[1];
- pch[ncsel][2]=pc[2];
- kfch[ncsel]=kf;
- ncsel++;
- } // if child selection
- } // select muon
- } // decay particle loop
- Int_t iparent;
- if ((fCutOnChild && ncsel >0) || !fCutOnChild){
- ipa++;
+ pch[ncsel][0]=pc[0];
+ pch[ncsel][1]=pc[1];
+ pch[ncsel][2]=pc[2];
+ kfch[ncsel]=kf;
+ ncsel++;
+ } // if child selection
+ } // select muon
+ } // decay particle loop
+ Int_t iparent;
+ if ((fCutOnChild && ncsel >0) || !fCutOnChild){
+ ipa++;
//
// parent
- gAlice->
- SetTrack(0,-1,Ipart,p,origin,polar,0,"Primary",nt,wgtp);
- iparent=nt;
+ gAlice->
+ SetTrack(0,-1,Ipart,p,origin0,polar,0,"Primary",nt,wgtp);
+ iparent=nt;
- for (i=0; i< ncsel; i++) {
- gAlice->SetTrack(fTrackIt,iparent,kfch[i],
- &pch[i][0],och,polar,
- 0,"Decay",nt,wgtch);
- gAlice->KeepTrack(nt);
- }
-
+ for (i=0; i< ncsel; i++) {
+ gAlice->SetTrack(fTrackIt,iparent,kfch[i],
+ &pch[i][0],och,polar,
+ 0,"Decay",nt,wgtch);
+ gAlice->KeepTrack(nt);
+ }
+ } else {
+ gAlice->
+ SetTrack(fTrackIt,-1,Ipart,p,origin0,polar,0,"Primary",nt,wgtp);
+ } // Decays by Lujet
} // kinematic selection
break;
} // while
public:
AliGenParam();
AliGenParam(Int_t npart, Param_t param);
-// Double_t (*PtPara)(Double_t*, Double_t*),
-// Double_t (*YPara )(Double_t*, Double_t*));
+ AliGenParam(Int_t npart, Param_t param,
+ Double_t (*PtPara)(Double_t*, Double_t*),
+ Double_t (*YPara )(Double_t*, Double_t*),
+ Int_t (*IpPara)() );
virtual ~AliGenParam();
virtual void Generate();
virtual void Init();
// select particle type
virtual void SetParam(Param_t param=jpsi_p) {fParam=param;}
// force decay type
- virtual void ForceDecay(Decay_t decay=dimuon) {fForceDecay=decay;}
+ 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;}
ClassDef(AliGenParam,1) // Generator using parameterised pt- and y-distribution
/*
$Log$
+Revision 1.11 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
*/
#include "AliGenerator.h"
for (Int_t i=0; i<5; i++) fParentSelect[i]=fChildSelect[i]=0;
SetProcess();
SetStrucFunc();
- ForceDecay();
+ SetForceDecay();
SetPtHard();
SetEnergyCMS();
}
case katomu:
fChildSelect[0]=13;
break;
+ case all:
+ case nodecay:
+ break;
}
}
// set centre of mass energy
virtual void SetEnergyCMS(Float_t energy=5500) {fEnergyCMS=energy;}
// force decay type
- virtual void ForceDecay(Decay_t decay=semimuonic) {fForceDecay=decay;}
+ virtual void SetForceDecay(Decay_t decay=semimuonic) {fForceDecay=decay;}
// get cross section of process
virtual Float_t GetXsection() {return fXsection;}
// Check PDG code
/*
$Log$
+Revision 1.3 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
+
*/
#include "AliGenScan.h"
p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta);
p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta);
p[2] = pmom*TMath::Cos(theta);
- gAlice->SetTrack(1,-1,fIpart,p,origin,polar,0,"Primary",nt);
+ gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
}
}
}
/*
$Log$
+Revision 1.4 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
+
*/
case katomu:
ForceParticleDecay(321,13,1); // K->mu
break;
+ case all:
+ case nodecay:
+ break;
}
}
/*
$Log$
+Revision 1.5 1999/09/29 09:24:14 fca
+Introduction of the Copyright and cvs Log
+
*/
///////////////////////////////////////////////////////////////////
ptf=fPtka;
etaf=fETAkac;
}
- phi=2*random[2]*TMath::Pi();
- if(phi<fPhiMin || phi>fPhiMax) continue;
+ phi=fPhiMin+random[2]*(fPhiMax-fPhiMin);
theta=2*TMath::ATan(TMath::Exp(-etaf->GetRandom()));
if(theta<fThetaMin || theta>fThetaMax) continue;
pt=ptf->GetRandom();
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
- gAlice->SetTrack(1,-1,part,p,origin,polar,0,"Primary",nt,fParentWeight);
+ gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,0,"Primary",nt,fParentWeight);
break;
}
}
Int_t i, nt;
//
for(i=0;i<fNpart;i++) {
- gAlice->SetTrack(1,-1,fIpart,p,fOrigin.GetArray(),polar,0,"Primary",nt);
+ gAlice->SetTrack(fTrackIt,-1,fIpart,p,fOrigin.GetArray(),polar,0,"Primary",nt);
}
}
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
- gAlice->SetTrack(1,-1,fIpart,p,origin,polar,0,"Primary",nt);
+ gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
}
}
/* $Id$ */
-typedef enum {pion_p, kaon_p, phi_p, jpsi_p, upsilon_p, charm_p, beauty_p}
+typedef enum {Pion, Kaon, Eta, Omega, Etaprime, Phi, Baryon, pion_p, kaon_p, phi_p, jpsi_p, upsilon_p, charm_p, beauty_p}
Param_t;
typedef enum
typedef enum
{ semielectronic, dielectron, semimuonic, dimuon,
b_jpsi_dimuon, b_jpsi_dielectron,
- b_psip_dimuon, b_psip_dielectron, pitomu, katomu }
+ b_psip_dimuon, b_psip_dielectron, pitomu, katomu, nodecay, all}
Decay_t;
typedef enum
SRCS = AliSimpleGen.cxx AliGenCocktail.cxx AliGenFLUKAsource.cxx \
AliGenMUONlib.cxx AliGenParam.cxx AliGenPythia.cxx \
AliPythia.cxx AliDimuCombinator.cxx AliGenHalo.cxx \
- AliGenExtFile.cxx AliGenScan.cxx
+ AliGenExtFile.cxx AliGenScan.cxx AliGenPHOSlib.cxx
# C++ Headers
HDRS = $(SRCS:.cxx=.h) EVGENLinkDef.h