Skip to content

Commit

Permalink
Merge pull request #528 from iarsene/master
Browse files Browse the repository at this point in the history
Added a few more generators in FOCAL_generators; removed some central barrel detectors and MUON from DetectorInitFOCAL
  • Loading branch information
gconesab authored Dec 19, 2022
2 parents 5e45ce4 + 9c6d8aa commit 06b2187
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 20 deletions.
123 changes: 109 additions & 14 deletions MC/CustomGenerators/Upgrade/FOCAL_Generators.C
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum GenTypes {
gun=0,
gunJpsi,
box,
boxMonocromatic,
boxWithDecay,
pythia,
pythia_MBtrig,
Expand All @@ -21,13 +22,15 @@ enum GenTypes {
PA_cocktail_EPOS_MBtrig,
PA_cocktail_EPOS_dirgam,
jpsiAndPythiaMB,
pi0WithPileup,
kNGenTypes
};

TString gGenTypeNames[kNGenTypes] = {
"gun",
"gunJpsi",
"box",
"boxMonocromatic",
"boxWithDecay",
"pythia",
"pythia_MBtrig",
Expand All @@ -40,7 +43,8 @@ TString gGenTypeNames[kNGenTypes] = {
"PA_cocktail_MBtrig",
"PA_cocktail_EPOS_MBtrig",
"PA_cocktail_EPOS_dirgam",
"jpsiAndPythiaMB"
"jpsiAndPythiaMB",
"pi0WithPileup"
};


Expand Down Expand Up @@ -190,6 +194,46 @@ AliGenerator* GeneratorCustom(TString opt = "") {
}
break;

case boxMonocromatic:
// Example for Moving Particle Gun
{
float pmom = 500.0;
if (gSystem->Getenv("CONFIG_PMOM")) {
pmom = atof(gSystem->Getenv("CONFIG_PMOM"));
}
float etamin = 3.0;
if (gSystem->Getenv("CONFIG_ETAMIN")) {
etamin = atof(gSystem->Getenv("CONFIG_ETAMIN"));
}
float etamax = 6.0;
if (gSystem->Getenv("CONFIG_ETAMAX")) {
etamax = atof(gSystem->Getenv("CONFIG_ETAMAX"));
}
float phimin = 0.0;
if (gSystem->Getenv("CONFIG_PHIMIN")) {
phimin = atof(gSystem->Getenv("CONFIG_PHIMIN"));
}
float phimax = 360.0;
if (gSystem->Getenv("CONFIG_PHIMAX")) {
phimax = atof(gSystem->Getenv("CONFIG_PHIMAX"));
}
int pdg = kGamma;
if (gSystem->Getenv("CONFIG_PDG")) {
pdg = atoi(gSystem->Getenv("CONFIG_PDG"));
}

AliGenBox *gener = new AliGenBox(1);
gener->SetMomentumRange(0.9999*pmom, 1.0001*pmom);
gener->SetPhiRange(phimin, phimax); // full polar angle around beam axis
gener->SetEtaRange(etamin, etamax);
gener->SetOrigin(0,0,0);
//vertex position
gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
gener->SetPart(pdg);
generator = gener;
}
break;

case boxWithDecay:
// Example for Moving Particle Gun (with decays enabled)
{
Expand Down Expand Up @@ -302,7 +346,7 @@ AliGenerator* GeneratorCustom(TString opt = "") {

AliGenPythiaFOCAL *gener = new AliGenPythiaFOCAL(-1);
gener->SetMomentumRange(0,999999);
gener->SetThetaRange(0., 45.);
//gener->SetThetaRange(0., 45.);
gener->SetYRange(-12,12);
gener->SetPtRange(0,1000);
gener->SetEnergyCMS(energy); // LHC energy
Expand All @@ -322,7 +366,7 @@ AliGenerator* GeneratorCustom(TString opt = "") {
gener->SetFragPhotonInFOCAL(kTRUE);
}
gener->SetCheckFOCAL(kTRUE);
gener->SetFOCALEta(3.5, 6.2);
gener->SetFOCALEta(3.0, 6.2);
float ptmin = 4.0;
if (gSystem->Getenv("CONFIG_PTMIN")) {
ptmin = atof(gSystem->Getenv("CONFIG_PTMIN"));
Expand All @@ -342,7 +386,7 @@ AliGenerator* GeneratorCustom(TString opt = "") {

AliGenPythiaFOCAL *gener = new AliGenPythiaFOCAL(-1);
gener->SetMomentumRange(0,999999);
gener->SetThetaRange(0., 45.);
//gener->SetThetaRange(0., 45.);
gener->SetYRange(-12,12);
gener->SetPtRange(0,1000);
gener->SetEnergyCMS(energy); // LHC energy
Expand All @@ -357,7 +401,7 @@ AliGenerator* GeneratorCustom(TString opt = "") {
gener->SetDirPhotonInFOCAL(kTRUE);

gener->SetCheckFOCAL(kTRUE);
gener->SetFOCALEta(3.5, 6.2);
gener->SetFOCALEta(3.0, 6.2);
float ptmin = 4.0;
if (gSystem->Getenv("CONFIG_PTMIN")) {
ptmin = atof(gSystem->Getenv("CONFIG_PTMIN"));
Expand Down Expand Up @@ -481,8 +525,8 @@ AliGenerator* GeneratorCustom(TString opt = "") {
pythia->SetDecayPhotonInFOCAL(kTRUE);
}
pythia->SetCheckFOCAL(kTRUE);
pythia->SetFOCALEta(3.5, 5.9);
pythia->SetTriggerParticleMinPt(4.0);
pythia->SetFOCALEta(3.0, 6.2);
pythia->SetTriggerParticleMinPt(5.0);
cocktail->AddGenerator(pythia,"Pythia",1.);

generator = cocktail;
Expand Down Expand Up @@ -565,7 +609,6 @@ AliGenerator* GeneratorCustom(TString opt = "") {

case jpsiAndPythiaMB:
{
cout << "+++++++++++++++++++++++ jpsiAndPythiaMB ++++++++++++++++++++++" << endl;
float energy = 14000; // GeV, used for the pythia MB event
if (gSystem->Getenv("CONFIG_ENERGY")) {
energy = atof(gSystem->Getenv("CONFIG_ENERGY"));
Expand Down Expand Up @@ -595,7 +638,6 @@ AliGenerator* GeneratorCustom(TString opt = "") {
if (gSystem->Getenv("CONFIG_PHIMAX")) {
phimax = atof(gSystem->Getenv("CONFIG_PHIMAX"));
}
cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 1" << endl;
// load libraries to use Evtgen
gSystem->Load("libPhotos");
//gSystem->Load("libEvtGenBase");
Expand All @@ -604,14 +646,12 @@ AliGenerator* GeneratorCustom(TString opt = "") {
gSystem->Load("libEvtGenExternal");
gSystem->Load("libTEvtGen");
//
cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 2" << endl;
// set external decayer
TVirtualMCDecayer* decayer = new AliDecayerPythia();
decayer->SetForceDecay(kAll);
decayer->Init();
gMC->SetExternalDecayer(decayer);

cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 3" << endl;
// Create the cocktail generator
AliGenCocktail *gener = new AliGenCocktail();
gener->UsePerEventRates();
Expand All @@ -630,7 +670,6 @@ AliGenerator* GeneratorCustom(TString opt = "") {
myPythia->SetTrackingFlag(1); // Particle transport
//gener->AddGenerator(myPythia, "pythiaMB", 1.0);

cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 4" << endl;
// Add the jpsi generator (parameterization based on previous forward measurements)
AliGenParam *jpsi = new AliGenParam(1, AliGenMUONlib::kJpsi, "pp 8", "Jpsi"); // flat pt distribution
jpsi->SetPtRange(ptmin, ptmax);
Expand All @@ -639,16 +678,72 @@ AliGenerator* GeneratorCustom(TString opt = "") {
jpsi->SetForceDecay(kNoDecay);
gener->AddGenerator(jpsi, "jpsi", 1.0);

cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 5" << endl;
//add the EVTGEN generator (purpose is just to decay the jpsi)
AliGenEvtGen *gene = new AliGenEvtGen();
gene->SetForceDecay(kBJpsiDiElectron);
gene->SetParticleSwitchedOff(AliGenEvtGen::kCharmPart);
gener->AddGenerator(gene, "EvtGen", 1.);
cout << "+++++++++++++++++++++++ jpsiAndPythiaMB 6" << endl;
generator = gener;
};
break;

case pi0WithPileup:
{
float energy = 14000; // GeV, used for the pythia MB event
if (gSystem->Getenv("CONFIG_ENERGY")) {
energy = atof(gSystem->Getenv("CONFIG_ENERGY"));
}

float ptmin = 4.0;
if (gSystem->Getenv("CONFIG_PTMIN")) {
ptmin = atof(gSystem->Getenv("CONFIG_PTMIN"));
}
int nbkg = 0;
if (gSystem->Getenv("CONFIG_NBKG")) {
nbkg = atoi(gSystem->Getenv("CONFIG_NBKG"));
}

// Create the cocktail generator
AliGenCocktail *cocktail = new AliGenCocktail();
cocktail->UsePerEventRates();

AliGenPythiaFOCAL *gener = new AliGenPythiaFOCAL(-1);
gener->SetMomentumRange(0,999999);
gener->SetThetaRange(0., 45.);
gener->SetYRange(-12,12);
gener->SetPtRange(0,1000);
gener->SetEnergyCMS(energy); // LHC energy
//gener->SetOrigin(0, 0, 0); // Vertex position
gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
gener->SetCutVertexZ(1.); // Truncate at 1 sigma
gener->SetVertexSmear(kPerEvent); // Smear per event
gener->SetTrackingFlag(1); // Particle transport
gener->SetProcess(kPyMb); // Min. bias events
gener->SetDecayPhotonInFOCAL(kTRUE); // trigger mostly on pi0
gener->SetCheckFOCAL(kTRUE);
gener->SetFOCALEta(3.0, 6.2);
gener->SetTriggerParticleMinPt(ptmin);
cocktail->AddGenerator(gener, "PythiaTriggered", 1.0);

AliGenPythia *pythiaMB = new AliGenPythia(-1);
pythiaMB->SetMomentumRange(0,999999);
pythiaMB->SetThetaRange(0., 45.);
pythiaMB->SetYRange(-12,12);
pythiaMB->SetPtRange(0,1000);
pythiaMB->SetProcess(kPyMb); // Min. bias events
pythiaMB->SetEnergyCMS(energy); // LHC energy
//pythiaMB->SetOrigin(0, 0, 0); // Vertex position
pythiaMB->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
pythiaMB->SetCutVertexZ(1.); // Truncate at 1 sigma
pythiaMB->SetVertexSmear(kPerEvent); // Smear per event
pythiaMB->SetTrackingFlag(1); // Particle transport
if (nbkg>0) {
cocktail->AddGenerator(pythiaMB, "PythiaMB", 1.0, 0, nbkg);
}

generator = cocktail;
};
break;
} // end switch

return generator;
Expand Down
12 changes: 6 additions & 6 deletions MC/DetectorInitFOCAL.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ Special FOCAL simulations detector init
Int_t iACORDE = 1;
Int_t iAD = 0;
Int_t iDIPO = 1;
Int_t iEMCAL = 1;
Int_t iEMCAL = 0;
Int_t iFMD = 0;
Int_t iFRAME = 1;
Int_t iHALL = 1;
Int_t iITS = 1;
Int_t iMAG = 1;
Int_t iMUON = 1;
Int_t iMUON = 0;
Int_t iPHOS = 0;
Int_t iPIPE = 1;
Int_t iHMPID = 1;
Int_t iHMPID = 0;
Int_t iSHIL = 1;
Int_t iT0 = 0;
Int_t iTOF = 1;
Int_t iTPC = 1;
Int_t iTRD = 1;
Int_t iTOF = 0;
Int_t iTPC = 0;
Int_t iTRD = 0;
Int_t iVZERO = 0;
Int_t iZDC = 0;
Int_t iFIT = 1;
Expand Down

0 comments on commit 06b2187

Please sign in to comment.