X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=EVGEN%2FAliGenPileup.cxx;h=d9c03d1494124e1736b17e79d5600098b2675c60;hb=e2223fde7f20cfe92fb7cdfb7bdd5de512184843;hp=0d973159bebe5c7a4fb7e44e43717ba577e18382;hpb=660b9a45d49031bd331822f574749682f303bff8;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenPileup.cxx b/EVGEN/AliGenPileup.cxx index 0d973159beb..d9c03d14941 100644 --- a/EVGEN/AliGenPileup.cxx +++ b/EVGEN/AliGenPileup.cxx @@ -48,6 +48,7 @@ //------------------------------------------------------------------------- #include +#include #include "AliGenPileup.h" #include "AliLog.h" @@ -61,7 +62,8 @@ ClassImp(AliGenPileup) AliGenPileup::AliGenPileup(): AliGenCocktail(), fBCMask("bcm","3564H"), - fGenTrig(kFALSE) + fGenTrig(kFALSE), + fFlag(kFALSE) { // Constructor // The pileup time window is by default @@ -77,7 +79,7 @@ AliGenPileup::~AliGenPileup() // Destructor } -void AliGenPileup::SetGenerator(AliGenerator *generator, Float_t rate) +void AliGenPileup::SetGenerator(AliGenerator *generator, Float_t rate, Bool_t flag) { // The method sets the geenrator to be used // for pileup simulation. @@ -91,11 +93,12 @@ void AliGenPileup::SetGenerator(AliGenerator *generator, Float_t rate) } } AddGenerator(generator,"pileup generator",rate); + fFlag = flag; } void AliGenPileup::AddGenerator(AliGenerator *Generator, const char* Name, - Float_t RateExp ) + Float_t RateExp , TFormula* /*form*/) { // The method used to add the pileup generator // in the cocktail list. @@ -155,7 +158,13 @@ void AliGenPileup::Generate() if (!fBCMask.GetMask(iBC)) continue; - Int_t nInteractions = gRandom->Poisson(rate); + // Int_t nInteractions = gRandom->Poisson(rate); + Int_t nInteractions; + if (!fFlag) + nInteractions = gRandom->Poisson(rate); + else + nInteractions = TMath::Nint(rate) + 1; + if (nInteractions == 0) continue; nIntBC[nTotBC] = nInteractions; @@ -236,6 +245,7 @@ void AliGenPileup::Generate() // Store the interaction header in the container of the headers ((AliGenEventHeader*) fHeader->GetHeaders()->Last())->SetPrimaryVertex(eventVertex); + ((AliGenEventHeader*) fHeader->GetHeaders()->Last())->SetInteractionTime(vTime); } } delete [] nIntBC;