From eb16822e760c056ad15579343fb0d90d09f73399 Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Balbastre Date: Wed, 13 Jan 2021 14:49:10 +0100 Subject: [PATCH] add pile-up pythia8 macros --- MC/CustomGenerators/DPG/Pythia8_Pileup.C | 48 ++++++++++++++++++++ MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C | 38 ++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 MC/CustomGenerators/DPG/Pythia8_Pileup.C create mode 100644 MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C diff --git a/MC/CustomGenerators/DPG/Pythia8_Pileup.C b/MC/CustomGenerators/DPG/Pythia8_Pileup.C new file mode 100644 index 00000000..c7919ad9 --- /dev/null +++ b/MC/CustomGenerators/DPG/Pythia8_Pileup.C @@ -0,0 +1,48 @@ +#if !defined(__CINT__) || defined(__MAKECINT__) +//For ROOT6 +R__ADD_INCLUDE_PATH($ALIDPG_ROOT) +#include "Utils/GetTriggerBCMaskAndMu.C" +#endif + +/// Standalone macro to generate MB Pythia8 events signal+pile-up background +AliGenerator *GeneratorCustom(){ + +#if defined(__CINT__) + // For ROOT5 + gROOT->LoadMacro("$ALIDPG_ROOT/Utils/GetTriggerBCMaskAndMu.C++"); +#endif + + Double_t mu=0.001; + TString bcm=GetTriggerBCMaskAndMu(mu); + + //printf(" BC mask = %s\n",bcm.Data()); + //printf(" mu = %f\n",mu); + //printf(" Energy = %f\n",energyConfig); + + // Set the pileup interaction generator + // The second argument is the pileup rate + // in terms of event rate per bunch crossing + AliGenCocktail *ctl = (AliGenCocktail*)GeneratorCocktail("Pythia8_Pileup"); + + // this is the Pythia8 generator for the trigger event, + // which could contain an impact parameter cut + AliGenerator *pythia = GeneratorPythia8(); + + AliGenPileup *genpil = new AliGenPileup(); + // this is the Pythia8 generator for the pileup events, + // which is configured wihtout impact parameter cuts + AliGenerator * pythiaPU = GeneratorPythia8(); + genpil->SetGenerator(pythiaPU,mu); + // Set the beam time structure + // Details on the syntax in STEER/AliTriggerBCMask + genpil->SetBCMask(bcm.Data()); + // Do not generate the trigger interaction! + genpil->GenerateTrigInteraction(kFALSE); + genpil->Print(); + + ctl->AddGenerator(genpil, "Pileup" , 1.); + ctl->AddGenerator(pythia, "Pythia8", 1.); + + return ctl; + +} diff --git a/MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C b/MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C new file mode 100644 index 00000000..18b3cee1 --- /dev/null +++ b/MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C @@ -0,0 +1,38 @@ +#if !defined(__CINT__) || defined(__MAKECINT__) +//For ROOT6 +R__ADD_INCLUDE_PATH($ALIDPG_ROOT) +#include "Utils/GetTriggerBCMaskAndMu.C" +#endif + +AliGenerator *GeneratorCustom(){ + + // This is the pp MB Pythia8 pileup generator for pileup background for embedded productions + // The trigger event is the signal that will be added on top, generated with other macro + +#if defined(__CINT__) + // For ROOT5 + gROOT->LoadMacro("$ALIDPG_ROOT/Utils/GetTriggerBCMaskAndMu.C++"); +#endif + + Double_t mu = 0.001; + TString bcm = GetTriggerBCMaskAndMu(mu); + + //printf(" BC mask = %s\n",bcm.Data()); + //printf(" mu = %f\n",mu); + //printf(" Energy = %f\n",energyConfig); + + AliGenPileup *genpil = new AliGenPileup(); + // this is the Pythia8 generator for the pileup events, + // which is configured wihtout impact parameter cuts + AliGenerator * pythia = GeneratorPythia8(); + genpil->SetGenerator(pythia, mu); + // Set the beam time structure + // Details on the syntax in STEER/AliTriggerBCMask + genpil->SetBCMask(bcm.Data()); + // Do not generate the trigger interaction! This will go in the signal + genpil->GenerateTrigInteraction(kFALSE); + genpil->Print(); + + return genpil; + +}