Skip to content

Commit

Permalink
Merge pull request #453 from gconesab/master
Browse files Browse the repository at this point in the history
New Pythia8 pileup generation macros and root6 compilation fixes in ExtractEmbeddedWrapper.C
  • Loading branch information
gconesab authored Jan 14, 2021
2 parents 6995e03 + eb16822 commit 16acddb
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
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;

}
8 changes: 7 additions & 1 deletion MC/ExtractEmbeddedWrapper.C
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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");
Expand Down

0 comments on commit 16acddb

Please sign in to comment.