Skip to content

Commit

Permalink
add pile-up pythia8 macros
Browse files Browse the repository at this point in the history
  • Loading branch information
gconesab committed Jan 13, 2021
1 parent 6fa9653 commit eb16822
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
48 changes: 48 additions & 0 deletions MC/CustomGenerators/DPG/Pythia8_Pileup.C
Original file line number Diff line number Diff line change
@@ -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;

}
38 changes: 38 additions & 0 deletions MC/CustomGenerators/DPG/Pythia8_Pileup_bkg.C
Original file line number Diff line number Diff line change
@@ -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;

}

0 comments on commit eb16822

Please sign in to comment.