From 7acacb8b4c071e9f9fe85fb46d34241fd4b551c7 Mon Sep 17 00:00:00 2001 From: iarsene Date: Mon, 19 Dec 2022 09:56:44 +0100 Subject: [PATCH] Removed some barrel and MUON detectors from DetectorInitFOCAL; Added more Generators in FOCAL_Generators.C --- .../Upgrade/FOCAL_Generators.C | 123 ++++++++++++++++-- MC/DetectorInitFOCAL.C | 12 +- 2 files changed, 115 insertions(+), 20 deletions(-) diff --git a/MC/CustomGenerators/Upgrade/FOCAL_Generators.C b/MC/CustomGenerators/Upgrade/FOCAL_Generators.C index 0581c9da..dab9c54e 100644 --- a/MC/CustomGenerators/Upgrade/FOCAL_Generators.C +++ b/MC/CustomGenerators/Upgrade/FOCAL_Generators.C @@ -8,6 +8,7 @@ enum GenTypes { gun=0, gunJpsi, box, + boxMonocromatic, boxWithDecay, pythia, pythia_MBtrig, @@ -21,6 +22,7 @@ enum GenTypes { PA_cocktail_EPOS_MBtrig, PA_cocktail_EPOS_dirgam, jpsiAndPythiaMB, + pi0WithPileup, kNGenTypes }; @@ -28,6 +30,7 @@ TString gGenTypeNames[kNGenTypes] = { "gun", "gunJpsi", "box", + "boxMonocromatic", "boxWithDecay", "pythia", "pythia_MBtrig", @@ -40,7 +43,8 @@ TString gGenTypeNames[kNGenTypes] = { "PA_cocktail_MBtrig", "PA_cocktail_EPOS_MBtrig", "PA_cocktail_EPOS_dirgam", - "jpsiAndPythiaMB" + "jpsiAndPythiaMB", + "pi0WithPileup" }; @@ -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) { @@ -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 @@ -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")); @@ -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 @@ -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")); @@ -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; @@ -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")); @@ -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"); @@ -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(); @@ -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); @@ -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; diff --git a/MC/DetectorInitFOCAL.C b/MC/DetectorInitFOCAL.C index bc8d2c45..a9027f08 100644 --- a/MC/DetectorInitFOCAL.C +++ b/MC/DetectorInitFOCAL.C @@ -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;