X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenHIJINGpara.cxx;h=f3fa75d35735d40182a8c69b1d5ce9c8d1b1ee4b;hb=70292245a90765aac70df0e43871cb206a483f74;hp=2a462bdf88c1c0da60e572e24d4e3194bc8fe39f;hpb=cc692c802d01e82c8dc08372bce7e60565198e51;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenHIJINGpara.cxx b/EVGEN/AliGenHIJINGpara.cxx index 2a462bdf88c..f3fa75d3573 100644 --- a/EVGEN/AliGenHIJINGpara.cxx +++ b/EVGEN/AliGenHIJINGpara.cxx @@ -38,33 +38,29 @@ /////////////////////////////////////////////////////////////////// #include +#include #include #include #include #include -#include #include -#include +#include +#include #include #include "AliConst.h" #include "AliDecayer.h" #include "AliGenEventHeader.h" #include "AliGenHIJINGpara.h" +#include "AliLog.h" #include "AliRun.h" ClassImp(AliGenHIJINGpara) -AliGenHIJINGpara::AliGenHIJINGpara(const AliGenHIJINGpara & para): - AliGenerator(para) -{ -// Copy constructor - para.Copy(*this); -} //_____________________________________________________________________________ -static Double_t ptpi(Double_t *px, Double_t *) +static Double_t ptpi(const Double_t *px, const Double_t *) { // // PT-PARAMETERIZATION CDF, PRL 61(88) 1819 @@ -162,40 +158,46 @@ static Double_t etakac( Double_t *py, Double_t *) //_____________________________________________________________________________ AliGenHIJINGpara::AliGenHIJINGpara() - :AliGenerator() + :AliGenerator(), + fNt(-1), + fNpartProd(0), + fPi0Decays(kFALSE), + fPtWgtPi(0.), + fPtWgtKa(0.), + fPtpi(0), + fPtka(0), + fETApic(0), + fETAkac(0), + fDecayer(0) { // // Default constructor // - fPtpi = 0; - fPtka = 0; - fETApic = 0; - fETAkac = 0; - fDecayer = 0; - fNt = -1; SetCutVertexZ(); SetPtRange(); - SetPi0Decays(); } //_____________________________________________________________________________ AliGenHIJINGpara::AliGenHIJINGpara(Int_t npart) - :AliGenerator(npart) + :AliGenerator(npart), + fNt(-1), + fNpartProd(npart), + fPi0Decays(kFALSE), + fPtWgtPi(0.), + fPtWgtKa(0.), + fPtpi(0), + fPtka(0), + fETApic(0), + fETAkac(0), + fDecayer(0) { // // Standard constructor // fName="HIJINGpara"; fTitle="HIJING Parametrisation Particle Generator"; - fPtpi = 0; - fPtka = 0; - fETApic = 0; - fETAkac = 0; - fDecayer = 0; - fNt = -1; SetCutVertexZ(); SetPtRange(); - SetPi0Decays(); } //_____________________________________________________________________________ @@ -221,11 +223,15 @@ void AliGenHIJINGpara::Init() Float_t etaMax = -TMath::Log(TMath::Tan( TMath::Max((Double_t)fThetaMin/2,1.e-10))); fPtpi = new TF1("ptpi",&ptpi,0,20,0); + gROOT->GetListOfFunctions()->Remove(fPtpi); fPtka = new TF1("ptka",&ptka,0,20,0); + gROOT->GetListOfFunctions()->Remove(fPtka); fPtpi->SetNpx(1000); fPtka->SetNpx(1000); fETApic = new TF1("etapic",&etapic,etaMin,etaMax,0); + gROOT->GetListOfFunctions()->Remove(fETApic); fETAkac = new TF1("etakac",&etakac,etaMin,etaMax,0); + gROOT->GetListOfFunctions()->Remove(fETAkac); TF1 etaPic0("etaPic0",&etapic,-7,7,0); TF1 etaKac0("etaKac0",&etakac,-7,7,0); @@ -252,30 +258,36 @@ void AliGenHIJINGpara::Init() Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi(); - fParentWeight = Float_t(fNpart)/(intETASel*ptFrac*phiFrac); + fParentWeight = (intETASel*ptFrac*phiFrac) / Float_t(fNpart); if (fAnalog != 0) { fPtWgtPi = (fPtMax - fPtMin) / fPtpi->Integral(0., 20.); fPtWgtKa = (fPtMax - fPtMin) / fPtka->Integral(0., 20.); - fParentWeight = Float_t(fNpart)/(intETASel*phiFrac); + fParentWeight = (intETASel*phiFrac) / Float_t(fNpart); } - printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", - ClassName(),100.*fParentWeight); + AliInfo(Form("The number of particles in the selected kinematic region corresponds to %f percent of a full event", + 100./ fParentWeight)); // Issue warning message if etaMin or etaMax are outside the alowed range // of the parametrization if (etaMin < -8.001 || etaMax > 8.001) { - printf("\n \n WARNING FROM AliGenHIJINGPara !"); - printf("\n YOU ARE USING THE PARAMETERISATION OUTSIDE "); - printf("\n THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)"); - printf("\n YOUR LIMITS: %f %f \n \n ", etaMin, etaMax); + AliWarning("\nYOU ARE USING THE PARAMETERISATION OUTSIDE "); + AliWarning("THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)"); + AliWarning(Form("YOUR LIMITS: %f %f \n ", etaMin, etaMax)); } // // if (fPi0Decays && gMC) fDecayer = gMC->GetDecayer(); + + if (fPi0Decays) + { + fDecayer->SetForceDecay(kNeutralPion); + fDecayer->Init(); + } + } @@ -295,6 +307,7 @@ void AliGenHIJINGpara::Generate() const Int_t kKaons[4] = {kK0Long, kK0Short, kKPlus, kKMinus}; // Float_t origin[3]; + Float_t time; Float_t pt, pl, ptot, wgt; Float_t phi, theta; Float_t p[3]; @@ -306,16 +319,19 @@ void AliGenHIJINGpara::Generate() Float_t random[6]; // for (j=0;j<3;j++) origin[j]=fOrigin[j]; + time = fTimeOrigin; if(fVertexSmear == kPerEvent) { Vertex(); for (j=0; j < 3; j++) origin[j] = fVertex[j]; + time = fTime; } // if kPerEvent TArrayF eventVertex; eventVertex.Set(3); eventVertex[0] = origin[0]; eventVertex[1] = origin[1]; eventVertex[2] = origin[2]; + Float_t eventTime = time; for(i=0;iSetPrimaryVertex(eventVertex); - gAlice->SetGenEventHeader(header); + header->SetInteractionTime(eventTime); + header->SetNProduced(fNpartProd); + if (fContainer) { + header->SetName(fName); + fContainer->AddHeader(header); + } else { + gAlice->SetGenEventHeader(header); + } } void AliGenHIJINGpara::SetPtRange(Float_t ptmin, Float_t ptmax) { AliGenerator::SetPtRange(ptmin, ptmax); } -void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p) +void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p, Float_t time) { // // Decay the pi0 @@ -412,7 +441,8 @@ void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p) // Float_t polar[3] = {0., 0., 0.}; Int_t np = fDecayer->ImportParticles(particles); - Int_t nt; + fNpartProd += (np-1); + Int_t nt = 0; for (Int_t i = 1; i < np; i++) { TParticle* iParticle = (TParticle *) particles->At(i); @@ -421,18 +451,12 @@ void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p) p[2] = iParticle->Pz(); Int_t part = iParticle->GetPdgCode(); - PushTrack(fTrackIt, fNt, part, p, orig, polar, 0, kPDecay, nt, fParentWeight); + PushTrack(fTrackIt, fNt, part, p, orig, polar, time, kPDecay, nt, fParentWeight); KeepTrack(nt); } fNt = nt; } -void AliGenHIJINGpara::Copy(TObject &) const -{ - Fatal("Copy","Not implemented!\n"); -} - - void AliGenHIJINGpara::Draw( const char * /*opt*/) { //