Skip to content

Commit

Permalink
add new generator for material budget systematics study
Browse files Browse the repository at this point in the history
  • Loading branch information
maciacco authored and gconesab committed Feb 7, 2022
1 parent feafd08 commit c76dbb2
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions MC/CustomGenerators/PWGLF/Hijing_muB_pileup_002.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#if !defined(__CINT__) || defined(__MAKECINT__)
//For ROOT6
R__ADD_INCLUDE_PATH($ALIDPG_ROOT)
#include "Utils/GetTriggerBCMaskAndMu.C"
#endif

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("Hijing_muB_pileup_002");

const Int_t pdgcodes[3] = {
2212,
1000010020,
1000020030};

const Char_t *names[3] = {
"Proton",
"Deuteron"
"He3"};

int npart[3] = {40, 10, 10};

double maxpt[3] = {3.5, 10.0, 10.0}; /// large pt range for Lambda for the mass measurement

for (Int_t ipart = 0; ipart < 3; ++ipart)
{
for (Int_t negative = 0; negative < 2; negative++)
{

AliGenBox *box = new AliGenBox(npart[ipart]);
Int_t pdg = pdgcodes[ipart];
if (negative)
pdg = -pdg;
box->SetPart(pdg);
box->SetPtRange(0.2, maxpt[ipart]);
box->SetPhiRange(0., 360.);
box->SetYRange(-1., 1.);
ctl->AddGenerator(box, Form("%s%i", names[ipart], negative), 1);
}
}

// this is the Hijing generator for the trigger event,
// which could contain an impact parameter cut
TString simulation = gSystem->Getenv("CONFIG_SIMULATION");
if (!simulation.Contains("Embed"))
{
AliGenHijing *hijingC = (AliGenHijing *)GeneratorHijing();

AliGenPileup *genpil = new AliGenPileup();
// this is the Hijing generator for the pileup events,
// which is configured wihtout impact parameter cuts
AliGenHijing *hijing = (AliGenHijing *)GeneratorHijing();
hijing->SetImpactParameterRange(0., 15.);
genpil->SetGenerator(hijing, 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(hijingC, "Hijing", 1.);
}

return ctl;
}

0 comments on commit c76dbb2

Please sign in to comment.