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; + +} diff --git a/MC/ExtractEmbeddedWrapper.C b/MC/ExtractEmbeddedWrapper.C index 3a8054ff..9870cf58 100644 --- a/MC/ExtractEmbeddedWrapper.C +++ b/MC/ExtractEmbeddedWrapper.C @@ -8,7 +8,10 @@ /*****************************************************************/ /*****************************************************************/ -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) +//#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) +#if !defined(__CINT__) || defined(__MAKECINT__) +#include "TSystem.h" +#include "TROOT.h" #include "ExtractEmbedded.C" #endif @@ -18,11 +21,14 @@ void ExtractEmbeddedWrapper(Bool_t keepMixed = kFALSE) Printf("Run the extraction of embedded signal (keepMixed = %d)",keepMixed); gSystem->Exec("ln -s $ALIDPG_ROOT/MC/ExtractEmbedded.C ExtractEmbedded.C"); +#if defined(__CINT__) + // for root5 if(gROOT->LoadMacro("ExtractEmbedded.C+") != 0) { Printf("ERROR: Problem when loading ExtractEmbedded.C"); abort(); return; } +#endif if(ExtractEmbedded(keepMixed,"AliESDs_EMB.root","AliESDs.root", "AliESDfriends_EMB.root", "AliESDfriends.root") == kFALSE){ Printf("ERROR: Problem when running ExtractEmbedded");