X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenHIJINGpara.cxx;h=e630b8ee74a37b6684af27ea9952ee9d2523e310;hb=d8e3340cff237fb4a672db059e38bdd78b15c2ac;hp=caa8ebe185d19ea0a828c06f703e7b30ef174862;hpb=e087ab36d56da6d6242b84a77e0a73a1c22855d7;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenHIJINGpara.cxx b/EVGEN/AliGenHIJINGpara.cxx index caa8ebe185d..e630b8ee74a 100644 --- a/EVGEN/AliGenHIJINGpara.cxx +++ b/EVGEN/AliGenHIJINGpara.cxx @@ -58,15 +58,9 @@ 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 @@ -164,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(); } //_____________________________________________________________________________ @@ -258,17 +258,17 @@ 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); } AliInfo(Form("The number of particles in the selected kinematic region corresponds to %f percent of a full event", - 100.*fParentWeight)); + 100./ fParentWeight)); // Issue warning message if etaMin or etaMax are outside the alowed range // of the parametrization @@ -281,6 +281,13 @@ void AliGenHIJINGpara::Init() // if (fPi0Decays && gMC) fDecayer = gMC->GetDecayer(); + + if (fPi0Decays) + { + fDecayer->SetForceDecay(kNeutralPion); + fDecayer->Init(); + } + } @@ -360,7 +367,7 @@ void AliGenHIJINGpara::Generate() TMath::Sqrt(-2*TMath::Log(random[2*j+1])); } } - + if (fAnalog == 0) { wgt = fParentWeight; } else { @@ -371,11 +378,13 @@ void AliGenHIJINGpara::Generate() if (part == kPi0 && fPi0Decays){ // // Decay pi0 if requested - PushTrack(0,-1,part,p,origin,polar,0,kPPrimary,fNt,fParentWeight); + PushTrack(0,-1,part,p,origin,polar,0,kPPrimary,fNt,wgt); KeepTrack(fNt); DecayPi0(origin, p); } else { - PushTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,fNt,fParentWeight); + // printf("fNt %d", fNt); + PushTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,fNt,wgt); + KeepTrack(fNt); } @@ -389,6 +398,7 @@ void AliGenHIJINGpara::Generate() AliGenEventHeader* header = new AliGenEventHeader("HIJINGparam"); // Event Vertex header->SetPrimaryVertex(eventVertex); + header->SetNProduced(fNpartProd); gAlice->SetGenEventHeader(header); } @@ -417,7 +427,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); @@ -432,12 +443,6 @@ void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p) fNt = nt; } -void AliGenHIJINGpara::Copy(TObject &) const -{ - Fatal("Copy","Not implemented!\n"); -} - - void AliGenHIJINGpara::Draw( const char * /*opt*/) { //