From d5615b854bf8ee5e415ab704b26e677df71461b5 Mon Sep 17 00:00:00 2001 From: morsch Date: Thu, 13 Dec 2012 09:13:25 +0000 Subject: [PATCH] bug #99301: Consolidating headers for AliGenCocktail https://savannah.cern.ch/bugs/?99301 Marco van Leeuwen --- EVGEN/AliGenBox.cxx | 18 ++++++++++++++---- EVGEN/AliGenBox.h | 1 + EVGEN/AliGenCocktail.cxx | 2 +- EVGEN/AliGenParam.cxx | 13 +++++++++++-- EVGEN/AliGenParam.h | 1 + STEER/STEER/AliGenerator.cxx | 14 ++++++++++++++ STEER/STEER/AliGenerator.h | 1 + 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/EVGEN/AliGenBox.cxx b/EVGEN/AliGenBox.cxx index c3ae3ad504f..34cbeaccc51 100644 --- a/EVGEN/AliGenBox.cxx +++ b/EVGEN/AliGenBox.cxx @@ -62,10 +62,19 @@ AliGenBox::AliGenBox(Int_t npart) //_____________________________________________________________________________ -void AliGenBox::Generate() +void AliGenBox::Generate() { + // + // Generate one trigger (fNpart particles) + // + GenerateN(1); +} + +//_____________________________________________________________________________ +void AliGenBox::GenerateN(Int_t ntimes) { // - // Generate one trigger + // Generate ntimes triggers + // total ntimes*fNpart particles // Float_t polar[3]= {0,0,0}; @@ -89,7 +98,8 @@ void AliGenBox::Generate() Double_t m = TDatabasePDG::Instance()->GetParticle(fIpart)->Mass(); - for(i=0;iSetPrimaryVertex(fVertex); - header->SetNProduced(fNpart); + header->SetNProduced(mult); header->SetInteractionTime(fTime); // Passes header either to the container or to gAlice diff --git a/EVGEN/AliGenBox.h b/EVGEN/AliGenBox.h index 07b277b6773..6996b9f83c8 100644 --- a/EVGEN/AliGenBox.h +++ b/EVGEN/AliGenBox.h @@ -19,6 +19,7 @@ class AliGenBox : public AliGenerator AliGenBox(); AliGenBox(Int_t npart); virtual ~AliGenBox() {} + virtual void GenerateN(Int_t ntimes); virtual void Generate(); virtual void Init(); virtual void SetEtaRange(Float_t etamin, Float_t etamax) diff --git a/EVGEN/AliGenCocktail.cxx b/EVGEN/AliGenCocktail.cxx index 800602ed8df..ec044f9c63e 100644 --- a/EVGEN/AliGenCocktail.cxx +++ b/EVGEN/AliGenCocktail.cxx @@ -233,7 +233,7 @@ AddGenerator(AliGenerator *Generator, const char* Name, Float_t RateExp, TFormul } gen->SetVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2), fTime); - for (Int_t i = 0; i < ntimes; i++) gen->Generate(); + gen->GenerateN(ntimes); entry->SetLast(partArray->GetEntriesFast()); preventry = entry; } diff --git a/EVGEN/AliGenParam.cxx b/EVGEN/AliGenParam.cxx index 2c78f83af1b..717dae0f7d8 100644 --- a/EVGEN/AliGenParam.cxx +++ b/EVGEN/AliGenParam.cxx @@ -273,8 +273,16 @@ void AliGenParam::Init() //____________________________________________________________ void AliGenParam::Generate() { + // + // Generate 1 event (see Generate(Int_t ntimes) for details // - // Generate 'npart' of light and heavy mesons (J/Psi, upsilon or phi, Pion, + GenerateN(1); +} +//____________________________________________________________ +void AliGenParam::GenerateN(Int_t ntimes) +{ + // + // Generate ntimes*'npart' light and heavy mesons (J/Psi, upsilon or phi, Pion, // Kaons, Etas, Omegas) and Baryons (proton, antiprotons, neutrons and // antineutrons in the the desired theta, phi and momentum windows; // Gaussian smearing on the vertex is done if selected. @@ -322,7 +330,8 @@ void AliGenParam::Generate() // Generating fNpart particles fNprimaries = 0; - while (ipa