diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index e369142c3cad4..a7ea61e986e18 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -344,7 +344,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1010010030; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiHyperTriton", "AntiHyperTriton", 2.991134, kFALSE, - 2.5e-15, 3, "Ion", ionCode); + 2.5e-15, -3, "Ion", ionCode); } //hyper hydrogen 4 ground state @@ -357,7 +357,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1010010040; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiHyperhydrog4", "AntiHyperhydrog4", 3.922434, kFALSE, - 2.5e-15, 3, "Ion", ionCode); + 2.5e-15, -3, "Ion", ionCode); } //hyper helium 4 ground state ionCode = 1010020040; @@ -369,7 +369,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1010020040; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiHyperhelium4", "AntiHyperhelium4", 3.921728, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + 2.5e-15, -6, "Ion", ionCode); } // Lithium 4 ground state @@ -382,7 +382,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1000030040; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiLithium4", "AntiLithium4", 3.7513, kFALSE, - 0.003, 9, "Ion", ionCode); + 0.003, -9, "Ion", ionCode); } ionCode = 1010020050; @@ -394,19 +394,19 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1010020050; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiHyperhelium5", "AntiHyperhelium5", 4.839961, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + 2.5e-15, -6, "Ion", ionCode); } ionCode = 1020010040; if (!db->GetParticle(ionCode)) { db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + 2.5e-15, 3, "Ion", ionCode); } ionCode = -1020010040; if (!db->GetParticle(ionCode)) { db->AddParticle("DoubleAntiHyperhydrogen4", "DoubleAntiHyperhydrogen4", 4.106, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + 2.5e-15, -3, "Ion", ionCode); } // 4-Xi-He @@ -433,7 +433,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1110020040; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiHyperhelium4sigma", "AntiHyperhelium4sigma", 3.995, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + 2.5e-15, -6, "Ion", ionCode); } ionCode = 1010000020; @@ -481,7 +481,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1020010020; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiXi0Proton", "AntiXi0Proton", 2.248, kFALSE, - 5e-15, 3, "Ion", ionCode); + 5e-15, -3, "Ion", ionCode); } ionCode = 1030000020; @@ -505,13 +505,13 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1030010020; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiOmegaNeutron", "AntiOmegaNeutron", 2.472, kFALSE, - 0.003, 3, "Special", ionCode); + 0.003, -3, "Special", ionCode); } ionCode = 1060020020; if (!db->GetParticle(ionCode)) { db->AddParticle("OmegaOmega", "OmegaOmega", 3.343, kFALSE, - 8.01e-15, 6, "Special", ionCode); + 8.01e-15, -6, "Special", ionCode); } ionCode = -1060020020; @@ -529,7 +529,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db, double monopoleMa ionCode = -1010010021; if (!db->GetParticle(ionCode)) { db->AddParticle("AntiLambda1405Proton", "AntiLambda1405Proton", 2.295, kFALSE, - 0.05, 3, "Special", ionCode); + 0.05, -3, "Special", ionCode); } ionCode = 1020000021; diff --git a/Detectors/gconfig/g4Config.C b/Detectors/gconfig/g4Config.C index 2dc6af4947c13..0b5b0cd110d2b 100644 --- a/Detectors/gconfig/g4Config.C +++ b/Detectors/gconfig/g4Config.C @@ -80,6 +80,7 @@ R__LOAD_LIBRARY(libgeant4vmc) #include "G4UImanager.hh" #include "G4RegionStore.hh" #include "G4ProductionCuts.hh" +#include "G4HadronicParameters.hh" #endif #include "commonConfig.C" @@ -184,6 +185,11 @@ void Config() const char* nthreads = getenv("ALICE_NSIMWORKERS"); setenv("G4FORCENUMBEROFTHREADS", nthreads ? nthreads : "1", 1); } + // Geant4 gives its light hypernuclei and their antiparticles (3LH, 4LH, 4LHe, 5LHe, ...) + // ionisation, multiple scattering and hadronic interactions only when enabled; otherwise they + // cross the detectors without depositing energy. It must be set before the physics is built. + G4HadronicParameters::Instance()->SetEnableHyperNuclei(true); + /// Create the G4 VMC TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration); std::cout << "Geant4 has been created." << std::endl; diff --git a/Steer/include/Steer/O2MCApplicationBase.h b/Steer/include/Steer/O2MCApplicationBase.h index 42c39c1275777..6a07292be51f8 100644 --- a/Steer/include/Steer/O2MCApplicationBase.h +++ b/Steer/include/Steer/O2MCApplicationBase.h @@ -67,6 +67,7 @@ class O2MCApplicationBase : public FairMCApplication void InitGeometry() override; bool MisalignGeometry() override; void AddParticles() override; + void AddIons() override; // specific implementation of our hard geometry limits double TrackingRmax() const override { return mCutParams.maxRTracking; } diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index 8db7dd3c54b12..dfac0a11b37a3 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -502,46 +502,46 @@ void addSpecialParticles() //Hypertriton TVirtualMC::GetMC()->DefineParticle(1010010030, "HyperTriton", kPTHadron, 2.991134, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); //Anti-Hypertriton - TVirtualMC::GetMC()->DefineParticle(-1010010030, "AntiHyperTriton", kPTHadron, 2.991134, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1010010030, "AntiHyperTriton", kPTHadron, 2.991134, -1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); //Hyper hydrogen 4 ground state TVirtualMC::GetMC()->DefineParticle(1010010040, "Hyperhydrog4", kPTHadron, 3.922434, 1.0, 2.08e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Anti-Hyper hydrogen 4 ground state - TVirtualMC::GetMC()->DefineParticle(-1010010040, "AntiHyperhydrog4", kPTHadron, 3.922434, 1.0, 2.08e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1010010040, "AntiHyperhydrog4", kPTHadron, 3.922434, -1.0, 2.08e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Hyper helium 4 ground state TVirtualMC::GetMC()->DefineParticle(1010020040, "Hyperhelium4", kPTHadron, 3.921728, 2.0, 2.50e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Anti-Hyper helium 4 ground state - TVirtualMC::GetMC()->DefineParticle(-1010020040, "AntiHyperhelium4", kPTHadron, 3.921728, 2.0, 2.50e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1010020040, "AntiHyperhelium4", kPTHadron, 3.921728, -2.0, 2.50e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Lithium 4 ground state TVirtualMC::GetMC()->DefineParticle(1000030040, "Lithium4", kPTHadron, 3.7513, 3.0, 9.1e-23, "Ion", 0.003, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Anti-Lithium 4 ground state - TVirtualMC::GetMC()->DefineParticle(-1000030040, "AntiLithium4", kPTHadron, 3.7513, 3.0, 9.1e-23, "Ion", 0.003, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1000030040, "AntiLithium4", kPTHadron, 3.7513, -3.0, 9.1e-23, "Ion", 0.003, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Hyper helium 5 TVirtualMC::GetMC()->DefineParticle(1010020050, "Hyperhelium5", kPTHadron, 4.839961, 2.0, 2.74e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE); //Anti-Hyper helium 5 - TVirtualMC::GetMC()->DefineParticle(-1010020050, "AntiHyperhelium5", kPTHadron, 4.839961, 2.0, 2.74e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1010020050, "AntiHyperhelium5", kPTHadron, 4.839961, -2.0, 2.74e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE); //Double Hyper hydrogen 4 TVirtualMC::GetMC()->DefineParticle(1020010040, "DoubleHyperhydrogen4", kPTHadron, 4.106, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Double Anti-Hyper hydrogen 4 - TVirtualMC::GetMC()->DefineParticle(-1020010040, "DoubleAntiHyperhydrogen4", kPTHadron, 4.106, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1020010040, "DoubleAntiHyperhydrogen4", kPTHadron, 4.106, -1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // 4Xi(-)H TVirtualMC::GetMC()->DefineParticle(1120010040, "4XiH", kPTHadron, 4.128, 1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Anti-4Xi(-)H - TVirtualMC::GetMC()->DefineParticle(-1120010040, "Anti4XiH", kPTHadron, 4.128, 1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1120010040, "Anti4XiH", kPTHadron, 4.128, -1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // 4Xi(-)He TVirtualMC::GetMC()->DefineParticle(1120020040, "4XiHe", kPTHadron, 4.128, 1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Anti-4Xi(-)He - TVirtualMC::GetMC()->DefineParticle(-1120020040, "Anti4XiHe", kPTHadron, 4.128, 1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1120020040, "Anti4XiHe", kPTHadron, 4.128, -1.0, 1.639e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Hyper helium 4 sigma TVirtualMC::GetMC()->DefineParticle(1110020040, "Hyperhelium4sigma", kPTHadron, 3.995, 2.0, 8.018e-11, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); // Anti-Hyper helium 4 sigma - TVirtualMC::GetMC()->DefineParticle(-1110020040, "AntiHyperhelium4sigma", kPTHadron, 3.995, 2.0, 8.018e-11, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1110020040, "AntiHyperhelium4sigma", kPTHadron, 3.995, -2.0, 8.018e-11, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); //Lambda-Neutron TVirtualMC::GetMC()->DefineParticle(1010000020, "LambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); @@ -559,7 +559,7 @@ void addSpecialParticles() TVirtualMC::GetMC()->DefineParticle(1020010020, "Xi0Proton", kPTHadron, 2.248, 1.0, 1.333e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Anti-Xi-Proton - TVirtualMC::GetMC()->DefineParticle(-1020010020, "AntiXi0Proton", kPTHadron, 2.248, 1.0, 1.333e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1020010020, "AntiXi0Proton", kPTHadron, 2.248, -1.0, 1.333e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Lambda-Neutron-Neutron TVirtualMC::GetMC()->DefineParticle(1010000030, "LambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); @@ -577,7 +577,7 @@ void addSpecialParticles() TVirtualMC::GetMC()->DefineParticle(1030010020, "OmegaNeutron", kPTHadron, 2.472, 1.0, 2.190e-22, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Anti-Omega-Neutron - TVirtualMC::GetMC()->DefineParticle(-1030010020, "AntiOmegaNeutron", kPTHadron, 2.472, 1.0, 2.190e-22, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1030010020, "AntiOmegaNeutron", kPTHadron, 2.472, -1.0, 2.190e-22, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Omega-Omega TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.343, -2.0, 8.21e-11, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); @@ -589,7 +589,7 @@ void addSpecialParticles() TVirtualMC::GetMC()->DefineParticle(1010010021, "Lambda1405Proton", kPTHadron, 2.295, 1.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Anti-Lambda(1405)-Proton - TVirtualMC::GetMC()->DefineParticle(-1010010021, "AntiLambda1405Proton", kPTHadron, 2.295, 1.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-1010010021, "AntiLambda1405Proton", kPTHadron, 2.295, -1.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Lambda(1405)-Lambda(1405) TVirtualMC::GetMC()->DefineParticle(1020000021, "Lambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); @@ -600,12 +600,12 @@ void addSpecialParticles() //c-deuteron TVirtualMC::GetMC()->DefineParticle(2010010020, "CDeuteron", kPTHadron, 3.226, 1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); //Anti-c-deuteron - TVirtualMC::GetMC()->DefineParticle(-2010010020, "AntiCDeuteron", kPTHadron, 3.226, 1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-2010010020, "AntiCDeuteron", kPTHadron, 3.226, -1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); //c-triton TVirtualMC::GetMC()->DefineParticle(2010010030, "CTriton", kPTHadron, 4.162, 1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Anti-c-Hypertriton - TVirtualMC::GetMC()->DefineParticle(-2010010030, "AntiCTriton", kPTHadron, 4.162, 1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + TVirtualMC::GetMC()->DefineParticle(-2010010030, "AntiCTriton", kPTHadron, 4.162, -1.0, 2.0e-13, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); //Resonances not in Generators // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) @@ -1814,6 +1814,29 @@ void addSpecialParticles() TVirtualMC::GetMC()->DefineParticle(-4120000, "AntiMonopole_asymm", kPTUndefined, monopoleMass, 0.0, 1e10, "BSM", 0.0, 0, 0, 0, 0, 0, 0, 0, 0, kTRUE); } +void O2MCApplicationBase::AddIons() +{ + // dispatch first to function in FairRoot + FairMCApplication::AddIons(); + + // Geant4 VMC looks a primary up in Geant4's particle table, which holds d, t, 3He and alpha from + // the start but a heavier ion only once it is created (by Z and A); an unknown primary is + // skipped. These are the stable ions beyond alpha that generators make (coalescence, + // injection). Only for Geant4: Geant3's DefineIon gives an ion already in TDatabasePDG a new + // isomer code. + if (std::strcmp(TVirtualMC::GetMC()->GetName(), "TGeant4") != 0) { + return; + } + struct Ion { + const char* name; // TDatabasePDG's: Geant4 VMC finds the ion's charge by the particle's name + int z; + int a; + }; + for (const auto& ion : {Ion{"Li6", 3, 6}, Ion{"Li7", 3, 7}}) { + TVirtualMC::GetMC()->DefineIon(ion.name, ion.z, ion.a, ion.z, 0., 0.); + } +} + void O2MCApplicationBase::AddParticles() { // dispatch first to function in FairRoot