//-------------------------------------------------------------------------
#include <TParticle.h>
+#include <TFormula.h>
#include "AliGenPileup.h"
#include "AliLog.h"
AliGenPileup::AliGenPileup():
AliGenCocktail(),
fBCMask("bcm","3564H"),
- fGenTrig(kFALSE)
+ fGenTrig(kFALSE),
+ fFlag(kFALSE)
{
// Constructor
// The pileup time window is by default
// 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.
}
}
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.
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;
// Store the interaction header in the container of the headers
((AliGenEventHeader*) fHeader->GetHeaders()->Last())->SetPrimaryVertex(eventVertex);
+ ((AliGenEventHeader*) fHeader->GetHeaders()->Last())->SetInteractionTime(vTime);
}
}
delete [] nIntBC;