From 37492b748d1782896b988cbd0080713bf62f2d17 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:15:18 +0100 Subject: [PATCH 01/15] Update O2DatabasePDG.h Adding correct implementations of hypernuclei --- .../SimulationDataFormat/O2DatabasePDG.h | 80 +++++++++---------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index 229a1a7a8a535..b6e008ae11e80 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -235,63 +235,57 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) //Hyper nuclei and exotica ionCode = 1010010030; if (!db->GetParticle(ionCode)) { - db->AddParticle("HyperTriton", "HyperTriton", 2.99131, kFALSE, - 2.5e-15, 3, "Ion", ionCode); + db->AddParticle("HyperTriton", "HyperTriton", 2.991134, kFALSE, + 2.5e-15, 3, "Ion", ionCode); + db->AddAntiParticle("AntiHyperTriton", -ionCode); } - ionCode = -1010010030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperTriton", "AntiHyperTriton", 2.99131, kFALSE, - 2.5e-15, 3, "Ion", ionCode); - } - - //hyper hydrogen 4 ground state + //hyper hydrogen 4 ionCode = 1010010040; if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.9226, kFALSE, - 2.5e-15, 3, "Ion", ionCode); - } - //anti hyper hydrogen 4 ground state - ionCode = -1010010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhydrog4", "AntiHyperhydrog4", 3.9226, kFALSE, - 2.5e-15, 3, "Ion", ionCode); - } - //hyper hydrogen 4 excited state - ionCode = 1010010041; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhydrog4*", "Hyperhydrog4*", 3.9237, kFALSE, - 2.5e-15, 3, "Ion", ionCode); + db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.922434, kFALSE, + 2.5e-15, 3, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhydrog4", -ionCode); } - //anti hyper hydrogen 4 excited state - ionCode = -1010010041; + + //hyper helium 4 + ionCode = 1010020040; if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhydrog4*", "AntiHyperhydrog4*", 3.9237, kFALSE, - 2.5e-15, 3, "Ion", ionCode); + db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.921728, kFALSE, + 2.5e-15, 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium4", -ionCode); } - //hyper helium 4 ground state - ionCode = 1010020040; + + //hyper helium 5 + ionCode = 1010020050; if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.9217, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.839961, kFALSE, + 2.5e-15, 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium5", -ionCode); } - //anti hyper helium 4 ground state - ionCode = -1010020040; + + //double hyper hydrogen 4 + ionCode = 1020010040; if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium4", "AntiHyperhelium4", 3.9217, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, kFALSE, + 2.5e-15, 6, "Ion", ionCode); + db->AddAntiParticle("AntiDoubleHyperhydrogen4", -ionCode); } - //hyper helium 4 excited state - ionCode = 1010020041; + + //4-Xi-He + ionCode = 1120020040; if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4*", "Hyperhelium4*", 3.9231, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + db->AddParticle("4XiHe", "4XiHe", 4.128, kFALSE, + 4.04e-15, 3, "Ion", ionCode); + db->AddAntiParticle("Anti4XiHe", -ionCode); } - //anti hyper helium 4 excited state - ionCode = -1010020041; + + //4-Xi-H + ionCode = 1120010040; if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium4*", "AntiHyperhelium4*", 3.9231, kFALSE, - 2.5e-15, 6, "Ion", ionCode); + db->AddParticle("4XiH", "4XiH", 4.128, kFALSE, + 4.04e-15, 3, "Ion", ionCode); + db->AddAntiParticle("Anti4XiH", -ionCode); } // Lithium 4 ground state From 56977ccb8b1d047ce2a897900a75ce38b12c8726 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:17:50 +0100 Subject: [PATCH 02/15] Update O2MCApplication.cxx Inserting the correct implementation for hypernuclei, their masses, lifetimes and decay channels --- Steer/src/O2MCApplication.cxx | 3019 +++++++++++++++++---------------- 1 file changed, 1568 insertions(+), 1451 deletions(-) diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index 96cc2f2e969db..cfef2a25b9ce2 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -40,1455 +40,1572 @@ namespace o2 { -namespace steer -{ -// helper function to send trivial data -template -void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts) -{ - static auto mgr = FairRootManager::Instance(); - auto vector = mgr->InitObjectAs*>(name); - if (vector) { - auto buffer = (char*)&(*vector)[0]; - auto buffersize = vector->size() * sizeof(T); - fair::mq::MessagePtr message(channel.NewMessage( - buffer, buffersize, - [](void* data, void* hint) {}, buffer)); - parts.AddPart(std::move(message)); - } -} - -void O2MCApplicationBase::Stepping() -{ - mStepCounter++; - - // check the max time of flight condition - const auto tof = fMC->TrackTime(); - auto& params = o2::GlobalProcessCutSimParam::Instance(); - if (tof > params.TOFMAX) { - fMC->StopTrack(); - return; - } - - mLongestTrackTime = std::max((double)mLongestTrackTime, tof); - - if (mCutParams.stepFiltering) { - // we can kill tracks here based on our - // custom detector specificities - - // Note that this is done in addition to the generic - // R + Z-cut mechanism at VMC level. - - float x, y, z; - fMC->TrackPosition(x, y, z); - - // this function is implementing a basic z-dependent R cut - // can be generalized later on - auto outOfR = [x, y, this](float z) { - // for the moment for cases when we have ZDC enabled - if (std::abs(z) > mCutParams.tunnelZ) { - if ((x * x + y * y) > mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { - return true; - } - } - return false; - }; - - if (z > mCutParams.ZmaxA || - -z > mCutParams.ZmaxC || - outOfR(z)) { - fMC->StopTrack(); - return; - } - } - - if (mCutParams.stepTrackRefHook) { - mTrackRefFcn(fMC); - } - - // dispatch now to stepping function in FairRoot - FairMCApplication::Stepping(); -} - -void O2MCApplicationBase::PreTrack() -{ - // dispatch first to function in FairRoot - FairMCApplication::PreTrack(); -} - -void O2MCApplicationBase::ConstructGeometry() -{ - // fill the mapping - mModIdToName.clear(); - o2::detectors::DetID::mask_t dmask{}; - for (int i = 0; i < fModules->GetEntries(); ++i) { - auto mod = static_cast(fModules->At(i)); - if (mod) { - mModIdToName[mod->GetModId()] = mod->GetName(); - int did = o2::detectors::DetID::nameToID(mod->GetName()); - if (did >= 0) { - dmask |= o2::detectors::DetID::getMask(did); - } - } - } - gGeoManager->SetUniqueID(dmask.to_ulong()); - FairMCApplication::ConstructGeometry(); - - std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); - // construct the volume name to module name mapping useful for StepAnalysis - auto vollist = gGeoManager->GetListOfVolumes(); - for (int i = 0; i < vollist->GetEntries(); ++i) { - auto vol = static_cast(vollist->At(i)); - auto iter = fModVolMap.find(vol->GetNumber()); - voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; - } -} - -void O2MCApplicationBase::InitGeometry() -{ - // load special cuts which might be given from the outside first. - auto& matMgr = o2::base::MaterialManager::Instance(); - matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); - matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); - // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module - FairMCApplication::InitGeometry(); - matMgr.writeCutsAndProcessesToJSON(); - // now the sensitive volumes are set up in fVolMap and we can query them - for (auto e : fVolMap) { - // since fVolMap contains multiple entries (if multiple copies), this may - // write to the same entry multiple times - mSensitiveVolumes[e.first] = e.second->GetName(); - } - std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); - for (auto e : mSensitiveVolumes) { - sensvolfile << e.first << ":" << e.second << "\n"; - } -} - -bool O2MCApplicationBase::MisalignGeometry() -{ - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->addAlignableVolumes(); - } - } - - // we stream out both unaligned geometry (to allow for - // dynamic post-alignment) as well as the aligned version - // which can be used by digitization etc. immediately - auto& confref = o2::conf::SimConfig::Instance(); - auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); - // since in general the geometry is a CCDB object, it must be exported under the standard name - gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); - gGeoManager->Export(geomfile.c_str()); - - // apply alignment for included detectors AFTER exporting ideal geometry - auto& aligner = o2::base::Aligner::Instance(); - aligner.applyAlignment(confref.getTimestamp()); - - // export aligned geometry into different file - auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); - gGeoManager->Export(alignedgeomfile.c_str()); - - auto& param = o2::GeometryManagerParam::Instance(); - - // fill parallel world geometry if activated - if (param.useParallelWorld) { - TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors"); - if (param.usePwGeoBVH) { - pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); - } - if (param.usePwCaching) { - TGeoNavigator::SetPWSafetyCaching(true); - } - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->fillParallelWorld(); - } - } - gGeoManager->SetUseParallelWorldNav(true); - } - - // return original return value of misalignment procedure - return true; -} - -void O2MCApplicationBase::finishEventCommon() -{ - LOG(info) << "This event/chunk did " << mStepCounter << " steps"; - LOG(info) << "Longest track time is " << mLongestTrackTime; - - auto header = static_cast(fMCEventHeader); - header->getMCEventStats().setNSteps(mStepCounter); - header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); - - static_cast(GetStack())->updateEventStats(); -} - -void O2MCApplicationBase::FinishEvent() -{ - finishEventCommon(); - - auto header = static_cast(fMCEventHeader); - auto& confref = o2::conf::SimConfig::Instance(); - - if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { - LOG(info) << "Discarding current event due to no hits"; - SetSaveCurrentEvent(false); - } - - // dispatch to function in FairRoot - FairMCApplication::FinishEvent(); -} - -void O2MCApplicationBase::BeginEvent() -{ - // dispatch first to function in FairRoot - FairMCApplication::BeginEvent(); - - // register event header with our stack - auto header = static_cast(fMCEventHeader); - static_cast(GetStack())->setMCEventStats(&header->getMCEventStats()); - - mStepCounter = 0; - mLongestTrackTime = 0; -} - -void addSpecialParticles() -{ - // - // Add particles needed for ALICE (not present in Geant3 or Geant4) - // Code ported 1-1 from AliRoot - // - - LOG(info) << "Adding custom particles to VMC"; - - //Hypertriton - TVirtualMC::GetMC()->DefineParticle(1010010030, "HyperTriton", kPTHadron, 2.99131, 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.99131, 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.9226, 1.0, 2.632e-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.9226, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); - - //Hyper hydrogen 4 excited state - TVirtualMC::GetMC()->DefineParticle(1010010041, "Hyperhydrog4*", kPTHadron, 3.9237, 1.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); - //Anti-Hyper hydrogen 4 excited state - TVirtualMC::GetMC()->DefineParticle(-1010010041, "AntiHyperhydrog4*", kPTHadron, 3.9237, 1.0, 2.632e-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.9217, 2.0, 2.632e-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.9217, 2.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); - - //Hyper helium 4 excited state - TVirtualMC::GetMC()->DefineParticle(1010020041, "Hyperhelium4*", kPTHadron, 3.9231, 2.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 4, kFALSE); - //Anti-Hyper helium 4 excited state - TVirtualMC::GetMC()->DefineParticle(-1010020041, "AntiHyperhelium4*", kPTHadron, 3.9231, 2.0, 2.632e-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); - - //Hyper helium 5 - TVirtualMC::GetMC()->DefineParticle(1010020050, "Hyperhelium5", kPTHadron, 4.841, 2.0, 2.632e-10, "Ion", 0.0, 0, 1, 0, 0, 0, 0, 0, 5, kFALSE); - //Anti-Hyper helium 5 - TVirtualMC::GetMC()->DefineParticle(-1010020050, "AntiHyperhelium5", kPTHadron, 4.841, 2.0, 2.632e-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); - - // 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); - - //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); - - //Anti-Lambda-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Xi-Proton - 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); - - //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); - - //Anti-Lambda-Neutron-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); - - //Omega-Proton - TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Proton - TVirtualMC::GetMC()->DefineParticle(-1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Omega-Neutron - 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); - - //Omega-Omega - TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Omega - TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Lambda(1405)-Proton - 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); - - //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); - - //Anti-Lambda(1405)-Lambda(1405) - TVirtualMC::GetMC()->DefineParticle(-1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //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); - - //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); - - //Resonances not in Generators - // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) - TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f2(1270) (PDG: width = 185 MeV) - TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - // Glueball hunting family - // Their life times are not known, so we set them to 1e-24 - // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) - TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, 0, 0, kTRUE); - // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // Xi_0(1820) - TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); - - int xi_0_1820_mode[6][3] = {{0}}; - float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - xi_0_1820_mode[0][0] = 3122; // Lambda - xi_0_1820_mode[0][1] = 310; // K0s - TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); - xi_0_1820_mode[0][0] = -3122; // Lambda-bar - TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); - - // Xi-+(1820) - TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, 1.8234, -1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, 1.8234, 1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); - - int xi_charged_1820_mode[6][3] = {{0}}; - float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - xi_charged_1820_mode[0][0] = 3122; // Lambda - xi_charged_1820_mode[0][1] = -321; // K- - TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode); - xi_charged_1820_mode[0][0] = -3122; // Lambda-bar - xi_charged_1820_mode[0][1] = 321; // K+ - TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode); - - // Ps - hidden strange (s-sbar) pentaquarks - TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE); - - Int_t psmode[6][3] = {0}; - Float_t psratio[6] = {0.f}; - psratio[0] = 100.; - - psmode[0][0] = 333; // phi - psmode[0][1] = 2212; // proton - TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); - - psmode[0][1] = -2212; // anti-proton - TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); - - //Omega(2012) - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - - TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - psmode[0][0] = 3312; // Xi- - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); - - TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, 0, 0, 0, 0, 0, -1, kTRUE); - psmode[0][0] = -3312; // anti-Xi+ - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); - - // d*(2380) - dibaryon resonance - TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE); - - Int_t dstmode[6][3] = {0}; - Float_t dstratio[6] = {0.f}; - dstratio[0] = 100; // For now we implement only the mode of interest - // d* -> d pi+ pi- - dstmode[0][0] = 1000010020; // deuteron - dstmode[0][1] = -211; // negative pion - dstmode[0][2] = 211; // positive pion - TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); - - dstmode[0][0] = -1000010020; // anti-deuteron - TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); - - // Heavy vector mesons - // D*+ - TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*- - TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0 - TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0bar - TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s+ - TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s- - TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0 - TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0bar - TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*+ - TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*- - TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0 - TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0bar - TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c+ - TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c- - TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - - // Charm pentaquarks - // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) - TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - psmode[0][0] = 413; // D*+ - psmode[0][1] = -2212; // anti-p - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); - psmode[0][0] = -413; // D*- - psmode[0][1] = 2212; // p - TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); - - // Define the 2- and 3-body phase space decay for the Hyper-Triton - Int_t mode[6][3]; - Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 50.; - mode[0][0] = 1000020030; // Helium3 - mode[0][1] = -211; // negative pion - - bratio[1] = 50.; - mode[1][0] = 1000010020; // deuteron - mode[1][1] = 2212; // proton - mode[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); - - // Define the 2- and 3-body phase space decay for the Anti-Hyper-Triton - Int_t amode[6][3]; - Float_t abratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio[kz] = 0.; - amode[kz][0] = 0; - amode[kz][1] = 0; - amode[kz][2] = 0; - } - abratio[0] = 50.; - amode[0][0] = -1000020030; // anti- Helium3 - amode[0][1] = 211; // positive pion - abratio[1] = 50.; - amode[1][0] = -1000010020; // anti-deuteron - amode[1][1] = -2212; // anti-proton - amode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); - - ////// ----------Hypernuclei with Mass=4 ----------- ////////// - - // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4 - - Int_t mode3[6][3]; - Float_t bratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio3[kz] = 0.; - mode3[kz][0] = 0; - mode3[kz][1] = 0; - mode3[kz][2] = 0; - } - bratio3[0] = 50.; - mode3[0][0] = 1000020040; // Helium4 - mode3[0][1] = -211; // negative pion - - bratio3[1] = 50.; - mode3[1][0] = 1000010030; // tritium - mode3[1][1] = 2212; // proton - mode3[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); - //Decay for the excited state (after em transition) - TVirtualMC::GetMC()->SetDecayMode(1010010041, bratio3, mode3); - - // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4 - Int_t amode3[6][3]; - Float_t abratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio3[kz] = 0.; - amode3[kz][0] = 0; - amode3[kz][1] = 0; - amode3[kz][2] = 0; - } - abratio3[0] = 50.; - amode3[0][0] = -1000020040; // anti- Helium4 - amode3[0][1] = 211; // positive pion - abratio3[1] = 50.; - amode3[1][0] = -1000010030; // anti-tritium - amode3[1][1] = -2212; // anti-proton - amode3[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); - //Decay for the excited state (after em transition) - TVirtualMC::GetMC()->SetDecayMode(-1010010041, abratio3, amode3); - - // Define the 3-body phase space decay for the Hyper Helium 4 - Int_t mode4[6][3]; - Float_t bratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4[kz] = 0.; - mode4[kz][0] = 0; - mode4[kz][1] = 0; - mode4[kz][2] = 0; - } - bratio4[0] = 100.; - mode4[0][0] = 1000020030; // Helium3 - mode4[0][1] = -211; // negative pion - mode4[0][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); - //Decay for the excited state (after em transition) - TVirtualMC::GetMC()->SetDecayMode(1010020041, bratio4, mode4); - - // Define the 2-body phase space decay for the Anti-Hyper Helium 4 - Int_t amode4[6][3]; - Float_t abratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4[kz] = 0.; - amode4[kz][0] = 0; - amode4[kz][1] = 0; - amode4[kz][2] = 0; - } - abratio4[0] = 100.; - amode4[0][0] = -1000020030; // anti-Helium 3 - amode4[0][1] = 211; // positive pion - amode4[0][2] = -2212; // anti proton - - TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); - //Decay for the excited state (after em transition) - TVirtualMC::GetMC()->SetDecayMode(-1010020041, abratio4, amode4); - - // Define the 2-body phase space decay for the Lithium 4 - Int_t model4[6][3]; - Float_t bratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratiol4[kz] = 0.; - model4[kz][0] = 0; - model4[kz][1] = 0; - model4[kz][2] = 0; - } - bratiol4[0] = 100.; - model4[0][0] = 1000020030; // Helium3 - model4[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); - - // Define the 2-body phase space decay for the Anti-Lithium 4 - Int_t amodel4[6][3]; - Float_t abratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratiol4[kz] = 0.; - amodel4[kz][0] = 0; - amodel4[kz][1] = 0; - amodel4[kz][2] = 0; - } - abratiol4[0] = 100.; - amodel4[0][0] = -1000020030; // Anti-Helium3 - amodel4[0][1] = -2212; // Anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); - - // Define the 3-body phase space decay for the Hyper Helium 5 - Int_t mode41[6][3]; - Float_t bratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio41[kz] = 0.; - mode41[kz][0] = 0; - mode41[kz][1] = 0; - mode41[kz][2] = 0; - } - bratio41[0] = 50.; - mode41[0][0] = 1000020040; // Helium4 - mode41[0][1] = -211; // negative pion - mode41[0][2] = 2212; // proton - bratio41[1] = 50.; - mode41[1][0] = 1000020030; // Helium3 - mode41[1][1] = -211; // negative pion - mode41[1][2] = 1000010020; // Deuteron - - TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); - - // Define the 2-body phase space decay for the Anti-Hyper Helium 5 - Int_t amode41[6][3]; - Float_t abratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio41[kz] = 0.; - amode41[kz][0] = 0; - amode41[kz][1] = 0; - amode41[kz][2] = 0; - } - abratio41[0] = 50.; - amode41[0][0] = -1000020040; // anti-Helium 4 - amode41[0][1] = 211; // positive pion - amode41[0][2] = -2212; // anti proton - abratio41[1] = 50.; - amode41[1][0] = -1000020030; // anti-Helium 3 - amode41[1][1] = 211; // positive pion - amode41[1][2] = -1000010020; // anti deuteron - - TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); - - // Define the 3-body phase space decay for the Double Hyper Hydrogen 4 - Int_t mode42[6][3]; - Float_t bratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio42[kz] = 0.; - mode42[kz][0] = 0; - mode42[kz][1] = 0; - mode42[kz][2] = 0; - } - bratio42[0] = 100.; - mode42[0][0] = 1010020040; // Hyper-Helium4 - mode42[0][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); - - // Define the 2-body phase space decay for the Anti Double Hyper Hydrogen 4 - Int_t amode42[6][3]; - Float_t abratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio42[kz] = 0.; - amode42[kz][0] = 0; - amode42[kz][1] = 0; - amode42[kz][2] = 0; - } - abratio42[0] = 100.; - amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 - amode42[0][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); - - // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma - Int_t mode4s[6][3]; - Float_t bratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4s[kz] = 0.; - mode4s[kz][0] = 0; - mode4s[kz][1] = 0; - mode4s[kz][2] = 0; - } - bratio4s[0] = 20.; - mode4s[0][0] = 1000020040; // Helium4 - mode4s[0][1] = 111; // pion0 - bratio4s[1] = 40.; - mode4s[1][0] = 1000010030; // tritium - mode4s[1][2] = 2212; // proton - mode4s[1][1] = 111; // pion0 - bratio4s[2] = 40.; - mode4s[2][0] = 1000010030; // tritium - mode4s[2][2] = 2212; // pion+ - mode4s[2][1] = 2112; // neutron - - TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); - - // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma - Int_t amode4s[6][3]; - Float_t abratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4s[kz] = 0.; - amode4s[kz][0] = 0; - amode4s[kz][1] = 0; - amode4s[kz][2] = 0; - } - abratio4s[0] = 50.; - amode4s[0][0] = -1000020040; // anti-Helium4 - amode4s[0][1] = 111; // pion0 - abratio4s[1] = 50.; - amode4s[1][0] = -1000010030; // anti-tritium - amode4s[1][2] = -2212; // anti-proton - amode4s[1][1] = 111; // pion0 - abratio4s[2] = 50.; - amode4s[2][0] = -1000010030; // anti-tritium - amode4s[2][2] = -211; // pion- - amode4s[2][1] = -2112; // anti-neutron - - TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); - - // Define the 2-body phase space decay for the Lambda-neutron boundstate - Int_t mode1[6][3]; - Float_t bratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio1[kz] = 0.; - mode1[kz][0] = 0; - mode1[kz][1] = 0; - mode1[kz][2] = 0; - } - bratio1[0] = 100.; - mode1[0][0] = 1000010020; // deuteron - mode1[0][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); - - // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate - Int_t amode1[6][3]; - Float_t abratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio1[kz] = 0.; - amode1[kz][0] = 0; - amode1[kz][1] = 0; - amode1[kz][2] = 0; - } - abratio1[0] = 100.; - amode1[0][0] = -1000010020; // anti-deuteron - amode1[0][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); - - // Define the 2-body phase space decay for the H-Dibaryon - Int_t mode2[6][3]; - Float_t bratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio2[kz] = 0.; - mode2[kz][0] = 0; - mode2[kz][1] = 0; - mode2[kz][2] = 0; - } - bratio2[0] = 100.; - mode2[0][0] = 3122; // Lambda - mode2[0][1] = 2212; // proton - mode2[0][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); - - // Define the 2-body phase space decay for the Anti-H-Dibaryon - Int_t amode2[6][3]; - Float_t abratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio2[kz] = 0.; - amode2[kz][0] = 0; - amode2[kz][1] = 0; - amode2[kz][2] = 0; - } - abratio2[0] = 100.; - amode2[0][0] = -3122; // anti-deuteron - amode2[0][1] = -2212; // anti-proton - amode2[0][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); - - // Define the 2-body phase space decay for the Xi0P - Int_t mode5[6][3]; - Float_t bratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio5[kz] = 0.; - mode5[kz][0] = 0; - mode5[kz][1] = 0; - mode5[kz][2] = 0; - } - bratio5[0] = 100.; - mode5[0][0] = 3122; // Lambda - mode5[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); - - // Define the 2-body phase space decay for the Anti-Xi0P - Int_t amode5[6][3]; - Float_t abratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio5[kz] = 0.; - amode5[kz][0] = 0; - amode5[kz][1] = 0; - amode5[kz][2] = 0; - } - abratio5[0] = 100.; - amode5[0][0] = -3122; // anti-Lambda - amode5[0][1] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); - - // Define the 2-body phase space decay for the Lambda-Neutron-Neutron - Int_t mode6[6][3]; - Float_t bratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio6[kz] = 0.; - mode6[kz][0] = 0; - mode6[kz][1] = 0; - mode6[kz][2] = 0; - } - bratio6[0] = 100.; - mode6[0][0] = 1000010030; // triton - mode6[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); - - // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron - Int_t amode6[6][3]; - Float_t abratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio6[kz] = 0.; - amode6[kz][0] = 0; - amode6[kz][1] = 0; - amode6[kz][2] = 0; - } - abratio6[0] = 100.; - amode6[0][0] = -1000010030; // anti-triton - amode6[0][1] = 211; // pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); - - // Define the 3-body phase space decay for the Omega-Proton - Int_t mode7[6][3]; - Float_t bratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio7[kz] = 0.; - mode7[kz][0] = 0; - mode7[kz][1] = 0; - mode7[kz][2] = 0; - } - bratio7[0] = 100.; - mode7[0][0] = 3122; // Lambda - mode7[0][1] = -321; // negative Kaon - mode7[0][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); - - // Define the 3-body phase space decay for the Anti-Omega-Proton - Int_t amode7[6][3]; - Float_t abratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio7[kz] = 0.; - amode7[kz][0] = 0; - amode7[kz][1] = 0; - amode7[kz][2] = 0; - } - abratio7[0] = 100.; - amode7[0][0] = -3122; // anti-Lambda - amode7[0][1] = 321; // positive kaon - amode7[0][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); - - // Define the 2-body phase space decay for the Omega-Neutron - Int_t mode8[6][3]; - Float_t bratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio8[kz] = 0.; - mode8[kz][0] = 0; - mode8[kz][1] = 0; - mode8[kz][2] = 0; - } - bratio8[0] = 100.; - mode8[0][0] = 3122; // Lambda - mode8[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); - - // Define the 2-body phase space decay for the Anti-Omega-Neutron - Int_t amode8[6][3]; - Float_t abratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio8[kz] = 0.; - amode8[kz][0] = 0; - amode8[kz][1] = 0; - amode8[kz][2] = 0; - } - abratio8[0] = 100.; - amode8[0][0] = -3122; // anti-Lambda - amode8[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); - - // Define the 3-body phase space decay for the Omega-Omega - Int_t mode9[6][3]; - Float_t bratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio9[kz] = 0.; - mode9[kz][0] = 0; - mode9[kz][1] = 0; - mode9[kz][2] = 0; - } - bratio9[0] = 100.; - mode9[0][0] = 3334; // negative Omega - mode9[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); - - // Define the 3-body phase space decay for the Anti-Omega-Omega - Int_t amode9[6][3]; - Float_t abratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio9[kz] = 0.; - amode9[kz][0] = 0; - amode9[kz][1] = 0; - amode9[kz][2] = 0; - } - abratio9[0] = 100.; - amode9[0][0] = -3334; // positive Omega - amode9[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); - - // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton - Int_t mode10[6][3]; - Float_t bratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio10[kz] = 0.; - mode10[kz][0] = 0; - mode10[kz][1] = 0; - mode10[kz][2] = 0; - } - bratio10[0] = 50.; - mode10[0][0] = 3122; // Lambda - mode10[0][1] = 2212; // proton - bratio10[1] = 50.; - mode10[1][0] = 2212; // proton - mode10[1][1] = -321; // negative kaon - mode10[1][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); - - // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton - Int_t amode10[6][3]; - Float_t abratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio10[kz] = 0.; - amode10[kz][0] = 0; - amode10[kz][1] = 0; - amode10[kz][2] = 0; - } - abratio10[0] = 50.; - amode10[0][0] = -3122; // anti-Lambda - amode10[0][1] = -2212; // anti-proton - abratio10[1] = 50.; - amode10[1][0] = -2212; // anti-proton - amode10[1][1] = 321; // positive kaon - amode10[1][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); - - // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) - Int_t mode11[6][3]; - Float_t bratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio11[kz] = 0.; - mode11[kz][0] = 0; - mode11[kz][1] = 0; - mode11[kz][2] = 0; - } - bratio11[0] = 50.; - mode11[0][0] = 3122; // Lambda - mode11[0][1] = 3122; // Lambda - bratio11[1] = 50.; - mode11[1][0] = 3122; // Lambda - mode11[1][1] = 2212; // proton - mode11[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); - - // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) - Int_t amode11[6][3]; - Float_t abratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio11[kz] = 0.; - amode11[kz][0] = 0; - amode11[kz][1] = 0; - amode11[kz][2] = 0; - } - abratio11[0] = 50.; - amode11[0][0] = -3122; // anti-Lambda - amode11[0][1] = -3122; // anti-Lambda - abratio11[1] = 50.; - amode11[1][0] = -3122; // anti-Lambda - amode11[1][1] = -2212; // anti-proton - amode11[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); - - // Define the decays for the c-triton - Int_t ctmode[6][3]; - Float_t ctbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - ctbratio[kz] = 0.; - ctmode[kz][0] = 0; - ctmode[kz][1] = 0; - ctmode[kz][2] = 0; - } - ctbratio[0] = 50.; - ctmode[0][0] = 1000020030; // Helium3 - ctmode[0][1] = 310; // K0s - - ctbratio[1] = 50.; - ctmode[1][0] = 1000020030; // Helium3 - ctmode[1][1] = -321; // negative kaon - ctmode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); - - // Define the decays for the anti-c-triton - Int_t actmode[6][3]; - Float_t actbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - actbratio[kz] = 0.; - actmode[kz][0] = 0; - actmode[kz][1] = 0; - actmode[kz][2] = 0; - } - actbratio[0] = 50.; - actmode[0][0] = -1000020030; // Helium3 - actmode[0][1] = 310; // K0s - - actbratio[1] = 50.; - actmode[1][0] = -1000020030; // Helium3 - actmode[1][1] = 321; // negative kaon - actmode[1][2] = -211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); - - // Define the decays for the c-deuteron - Int_t cdmode[6][3]; - Float_t cdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - cdbratio[kz] = 0.; - cdmode[kz][0] = 0; - cdmode[kz][1] = 0; - cdmode[kz][2] = 0; - } - cdbratio[0] = 50.; - cdmode[0][0] = 1000010020; // deuteron - cdmode[0][1] = -321; // negative kaon - cdmode[0][2] = 211; // positive pion - - cdbratio[1] = 50.; - cdmode[1][0] = 1000010020; // deuteron - cdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); - - // Define the decays for the anti-c-deuteron - Int_t acdmode[6][3]; - Float_t acdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - acdbratio[kz] = 0.; - acdmode[kz][0] = 0; - acdmode[kz][1] = 0; - acdmode[kz][2] = 0; - } - acdbratio[0] = 50.; - acdmode[0][0] = -1000010020; // deuteron - acdmode[0][1] = 321; // negative kaon - acdmode[0][2] = -211; // positive pion - - acdbratio[1] = 50.; - acdmode[1][0] = -1000010020; // deuteron - acdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); - - /////////////////////////////////////////////////////////////////// - - // Define the 2-body phase space decay for the f0(980) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); - - // Define the 2-body phase space decay for the f2(1270) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); - - // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710 - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 310; // K0s - mode[0][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) - TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) - TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) - TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) - TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) - - // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - - bratio2[0] = 50.; - mode[0][0] = 310; // K0s - mode[0][1] = -321; // anti-K - mode[0][2] = 211; // pion+ - - bratio2[1] = 50.; - mode[1][0] = 310; // K0s - mode[1][1] = 321; // K - mode[1][2] = -211; // pion- - - TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) - TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) - - // Lambda1520/Lambda1520bar - - TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - - // Lambda1520 decay modes - Int_t lmode[9][3]; - Float_t lbratio[9]; - for (Int_t kz = 0; kz < 9; kz++) { - lbratio[kz] = 0.; - lmode[kz][0] = 0; - lmode[kz][1] = 0; - lmode[kz][2] = 0; - } - - // L(1520) -> p K- - lbratio[0] = 0.229944; - lmode[0][0] = 2212; - lmode[0][1] = -321; - - // L(1520) -> n K0 - lbratio[1] = 0.229944; - lmode[1][0] = 2112; - lmode[1][1] = -311; - - // L(1520) -> Sigma+ pi- - lbratio[2] = 0.143076; - lmode[2][0] = 3222; - lmode[2][1] = -211; - - // L(1520) -> Sigma0 pi0 - lbratio[3] = 0.143076; - lmode[3][0] = 3212; - lmode[3][1] = 111; - - // L(1520) -> Sigma- pi+ - lbratio[4] = 0.143076; - lmode[4][0] = 3112; - lmode[4][1] = 211; - - // L(1520) -> Sigma*- pi+ - lbratio[5] = 0.034066; - lmode[5][0] = 3114; - lmode[5][1] = 211; - - // L(1520) -> Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = 3214; - lmode[6][1] = 111; - - // L(1520) -> Sigma*+ pi- - lbratio[7] = 0.034066; - lmode[7][0] = 3224; - lmode[7][1] = -211; - - // L(1520) -> Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = 3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); - - // Lambda1520bar decay modes - - // L(1520)bar -> p- K+ - lbratio[0] = 0.229944; - lmode[0][0] = -2212; - lmode[0][1] = 321; - - // L(1520)bar -> nbar K0bar - lbratio[1] = 0.229944; - lmode[1][0] = -2112; - lmode[1][1] = 311; - - // L(1520)bar -> Sigmabar- pi+ - lbratio[2] = 0.143076; - lmode[2][0] = -3222; - lmode[2][1] = 211; - - // L(1520)bar -> Sigma0bar pi0 - lbratio[3] = 0.143076; - lmode[3][0] = -3212; - lmode[3][1] = 111; - - // L(1520)bar -> Sigmabar+ pi- - lbratio[4] = 0.143076; - lmode[4][0] = -3112; - lmode[4][1] = -211; - - // L(1520)bar -> anti-Sigma*- pi- - lbratio[5] = 0.034066; - lmode[5][0] = -3114; - lmode[5][1] = -211; - - // L(1520)bar -> anti-Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = -3214; - lmode[6][1] = 111; - - // L(1520)bar -> anti-Sigma*+ pi+ - lbratio[7] = 0.034066; - lmode[7][0] = -3224; - lmode[7][1] = 211; - - // L(1520)bar -> Anti-Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = -3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); - - // -------------------------------------------------------------------- - - //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) - TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, -2, kTRUE); -} - -void O2MCApplicationBase::AddParticles() -{ - // dispatch first to function in FairRoot - FairMCApplication::AddParticles(); - - // register special particles for ALICE - // TODO: try to make use of FairRoot if easier or more customizable - addSpecialParticles(); - - auto& param = o2::conf::SimUserDecay::Instance(); - LOG(info) << "Printing \'SimUserDecay\' parameters"; - LOG(info) << param; - - // check if there are PDG codes requested for user decay - if (param.pdglist.empty()) { - return; - } - - // loop over PDG codes in the string - std::stringstream ss(param.pdglist); - int pdg; - while (ss >> pdg) { - LOG(info) << "Setting user decay for PDG " << pdg; - TVirtualMC::GetMC()->SetUserDecay(pdg); - } -} - -void O2MCApplicationBase::initTrackRefHook() -{ - if (mCutParams.stepTrackRefHook) { - LOG(info) << "Initializing the hook for TrackReferences during stepping"; - auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); - if (std::filesystem::exists(expandedTrackRefHookFileName)) { - // if this file exists we will compile the hook on the fly - mTrackRefFcn = o2::conf::GetFromMacro(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook"); - LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; - } else { - LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; - mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing - } - } -} - -void O2MCApplication::initLate() -{ - o2::utils::ShmManager::Instance().occupySegment(); - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->initializeLate(); - } - } -} - -void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const -{ - // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); - o2::base::attachTMessage(info, *mSimDataChannel, parts); -} - -// helper function to fetch data from FairRootManager branch and serialize it -// returns handle to container -template -const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts) -{ - auto mgr = FairRootManager::Instance(); - // check if branch is present - if (mgr->GetBranchId(name) == -1) { - LOG(error) << "Branch " << name << " not found"; - return nullptr; - } - auto data = mgr->InitObjectAs(name.c_str()); - if (data) { - o2::base::attachTMessage(*data, channel, parts); - } - return data; -} - -void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) -{ - mSubEventInfo = i; - // being communicated a SubEventInfo also means we get a FairMCEventHeader - fMCEventHeader = &mSubEventInfo->mMCEventHeader; -} - -void O2MCApplication::SendData() -{ - fair::mq::Parts simdataparts; - - // fill these parts ... the receiver has to unpack similary - // TODO: actually we could just loop over branches in FairRootManager at this moment? - mSubEventInfo->npersistenttracks = static_cast(GetStack())->getMCTracks()->size(); - mSubEventInfo->nprimarytracks = static_cast(GetStack())->GetNprimary(); - attachSubEventInfo(simdataparts, *mSubEventInfo); - auto tracks = attachBranch>("MCTrack", *mSimDataChannel, simdataparts); - attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); - assert(tracks->size() == mSubEventInfo->npersistenttracks); - - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); - } - } - LOG(info) << "sending message with " << simdataparts.Size() << " parts"; - mSimDataChannel->Send(simdataparts); -} -} // namespace steer + namespace steer + { + // helper function to send trivial data + template + void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts) + { + static auto mgr = FairRootManager::Instance(); + auto vector = mgr->InitObjectAs*>(name); + if (vector) { + auto buffer = (char*)&(*vector)[0]; + auto buffersize = vector->size() * sizeof(T); + fair::mq::MessagePtr message(channel.NewMessage( + buffer, buffersize, + [](void* data, void* hint) {}, buffer)); + parts.AddPart(std::move(message)); + } + } + + void O2MCApplicationBase::Stepping() + { + mStepCounter++; + + // check the max time of flight condition + const auto tof = fMC->TrackTime(); + auto& params = o2::GlobalProcessCutSimParam::Instance(); + if (tof > params.TOFMAX) { + fMC->StopTrack(); + return; + } + + mLongestTrackTime = std::max((double)mLongestTrackTime, tof); + + if (mCutParams.stepFiltering) { + // we can kill tracks here based on our + // custom detector specificities + + // Note that this is done in addition to the generic + // R + Z-cut mechanism at VMC level. + + float x, y, z; + fMC->TrackPosition(x, y, z); + + // this function is implementing a basic z-dependent R cut + // can be generalized later on + auto outOfR = [x, y, this](float z) { + // for the moment for cases when we have ZDC enabled + if (std::abs(z) > mCutParams.tunnelZ) { + if ((x * x + y * y) > mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { + return true; + } + } + return false; + }; + + if (z > mCutParams.ZmaxA || + -z > mCutParams.ZmaxC || + outOfR(z)) { + fMC->StopTrack(); + return; + } + } + + if (mCutParams.stepTrackRefHook) { + mTrackRefFcn(fMC); + } + + // dispatch now to stepping function in FairRoot + FairMCApplication::Stepping(); + } + + void O2MCApplicationBase::PreTrack() + { + // dispatch first to function in FairRoot + FairMCApplication::PreTrack(); + } + + void O2MCApplicationBase::ConstructGeometry() + { + // fill the mapping + mModIdToName.clear(); + o2::detectors::DetID::mask_t dmask{}; + for (int i = 0; i < fModules->GetEntries(); ++i) { + auto mod = static_cast(fModules->At(i)); + if (mod) { + mModIdToName[mod->GetModId()] = mod->GetName(); + int did = o2::detectors::DetID::nameToID(mod->GetName()); + if (did >= 0) { + dmask |= o2::detectors::DetID::getMask(did); + } + } + } + gGeoManager->SetUniqueID(dmask.to_ulong()); + FairMCApplication::ConstructGeometry(); + + std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); + // construct the volume name to module name mapping useful for StepAnalysis + auto vollist = gGeoManager->GetListOfVolumes(); + for (int i = 0; i < vollist->GetEntries(); ++i) { + auto vol = static_cast(vollist->At(i)); + auto iter = fModVolMap.find(vol->GetNumber()); + voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; + } + } + + void O2MCApplicationBase::InitGeometry() + { + // load special cuts which might be given from the outside first. + auto& matMgr = o2::base::MaterialManager::Instance(); + matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); + matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); + // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module + FairMCApplication::InitGeometry(); + matMgr.writeCutsAndProcessesToJSON(); + // now the sensitive volumes are set up in fVolMap and we can query them + for (auto e : fVolMap) { + // since fVolMap contains multiple entries (if multiple copies), this may + // write to the same entry multiple times + mSensitiveVolumes[e.first] = e.second->GetName(); + } + std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); + for (auto e : mSensitiveVolumes) { + sensvolfile << e.first << ":" << e.second << "\n"; + } + } + + bool O2MCApplicationBase::MisalignGeometry() + { + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->addAlignableVolumes(); + } + } + + // we stream out both unaligned geometry (to allow for + // dynamic post-alignment) as well as the aligned version + // which can be used by digitization etc. immediately + auto& confref = o2::conf::SimConfig::Instance(); + auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); + // since in general the geometry is a CCDB object, it must be exported under the standard name + gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); + gGeoManager->Export(geomfile.c_str()); + + // apply alignment for included detectors AFTER exporting ideal geometry + auto& aligner = o2::base::Aligner::Instance(); + aligner.applyAlignment(confref.getTimestamp()); + + // export aligned geometry into different file + auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); + gGeoManager->Export(alignedgeomfile.c_str()); + + auto& param = o2::GeometryManagerParam::Instance(); + + // fill parallel world geometry if activated + if (param.useParallelWorld) { + TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors"); + if (param.usePwGeoBVH) { + pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); + } + if (param.usePwCaching) { + TGeoNavigator::SetPWSafetyCaching(true); + } + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->fillParallelWorld(); + } + } + gGeoManager->SetUseParallelWorldNav(true); + } + + // return original return value of misalignment procedure + return true; + } + + void O2MCApplicationBase::finishEventCommon() + { + LOG(info) << "This event/chunk did " << mStepCounter << " steps"; + LOG(info) << "Longest track time is " << mLongestTrackTime; + + auto header = static_cast(fMCEventHeader); + header->getMCEventStats().setNSteps(mStepCounter); + header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); + + static_cast(GetStack())->updateEventStats(); + } + + void O2MCApplicationBase::FinishEvent() + { + finishEventCommon(); + + auto header = static_cast(fMCEventHeader); + auto& confref = o2::conf::SimConfig::Instance(); + + if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { + LOG(info) << "Discarding current event due to no hits"; + SetSaveCurrentEvent(false); + } + + // dispatch to function in FairRoot + FairMCApplication::FinishEvent(); + } + + void O2MCApplicationBase::BeginEvent() + { + // dispatch first to function in FairRoot + FairMCApplication::BeginEvent(); + + // register event header with our stack + auto header = static_cast(fMCEventHeader); + static_cast(GetStack())->setMCEventStats(&header->getMCEventStats()); + + mStepCounter = 0; + mLongestTrackTime = 0; + } + + void addSpecialParticles() + { + // + // Add particles needed for ALICE (not present in Geant3 or Geant4) + // Code ported 1-1 from AliRoot + // + + LOG(info) << "Adding custom particles to VMC"; + + // ### NUCLEI ### + // 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); + + // ### HYPER NUCLEI (|S| = 1) ### + //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); + + //Hyper hydrogen 4 + 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 + 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 + 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 + 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); + + //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); + + // ### HYPER NUCLEI (|S| = 2) ### + //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); + + //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); + //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); + + // 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); + + // ### EXOTICA ### + //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); + + //Anti-Lambda-Neutron + TVirtualMC::GetMC()->DefineParticle(-1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Xi-Proton + 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); + + //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); + + //Anti-Lambda-Neutron-Neutron + TVirtualMC::GetMC()->DefineParticle(-1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + + //Omega-Proton + TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-Omega-Proton + TVirtualMC::GetMC()->DefineParticle(-1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Omega-Neutron + 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); + + //Omega-Omega + TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-Omega-Omega + TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Lambda(1405)-Proton + 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); + + //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); + + //Anti-Lambda(1405)-Lambda(1405) + TVirtualMC::GetMC()->DefineParticle(-1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //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); + + //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); + + //Resonances not in Generators + // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) + TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // f2(1270) (PDG: width = 185 MeV) + TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); + // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); + + // Glueball hunting family + // Their life times are not known, so we set them to 1e-24 + // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) + TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, 0, 0, kTRUE); + // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // Xi_0(1820) + TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); + + int xi_0_1820_mode[6][3] = { {0} }; + float xi_0_1820_ratio[6] = { 100.f, 0.f, 0.f, 0.f, 0.f, 0.f }; + xi_0_1820_mode[0][0] = 3122; // Lambda + xi_0_1820_mode[0][1] = 310; // K0s + TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); + xi_0_1820_mode[0][0] = -3122; // Lambda-bar + TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); + + // Xi-+(1820) + TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, 1.8234, -1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, 1.8234, 1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); + + int xi_charged_1820_mode[6][3] = { {0} }; + float xi_charged_1820_ratio[6] = { 100.f, 0.f, 0.f, 0.f, 0.f, 0.f }; + xi_charged_1820_mode[0][0] = 3122; // Lambda + xi_charged_1820_mode[0][1] = -321; // K- + TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode); + xi_charged_1820_mode[0][0] = -3122; // Lambda-bar + xi_charged_1820_mode[0][1] = 321; // K+ + TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode); + + // Ps - hidden strange (s-sbar) pentaquarks + TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE); + + Int_t psmode[6][3] = { 0 }; + Float_t psratio[6] = { 0.f }; + psratio[0] = 100.; + + psmode[0][0] = 333; // phi + psmode[0][1] = 2212; // proton + TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); + + psmode[0][1] = -2212; // anti-proton + TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); + + //Omega(2012) + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + + TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + psmode[0][0] = 3312; // Xi- + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); + + TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, 0, 0, 0, 0, 0, -1, kTRUE); + psmode[0][0] = -3312; // anti-Xi+ + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); + + // d*(2380) - dibaryon resonance + TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE); + + Int_t dstmode[6][3] = { 0 }; + Float_t dstratio[6] = { 0.f }; + dstratio[0] = 100; // For now we implement only the mode of interest + // d* -> d pi+ pi- + dstmode[0][0] = 1000010020; // deuteron + dstmode[0][1] = -211; // negative pion + dstmode[0][2] = 211; // positive pion + TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); + + dstmode[0][0] = -1000010020; // anti-deuteron + TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); + + // Heavy vector mesons + // D*+ + TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*- + TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*0 + TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*0bar + TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*_s+ + TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*_s- + TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*0 + TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*0bar + TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*+ + TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*- + TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_s0 + TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_s0bar + TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_c+ + TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_c- + TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + + // Charm pentaquarks + // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) + TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, 1, kTRUE); + + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + psmode[0][0] = 413; // D*+ + psmode[0][1] = -2212; // anti-p + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); + psmode[0][0] = -413; // D*- + psmode[0][1] = 2212; // p + TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); + + // Define the 2-body phase space decay for the Lithium 4 + Int_t model4[6][3]; + Float_t bratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratiol4[kz] = 0.; + model4[kz][0] = 0; + model4[kz][1] = 0; + model4[kz][2] = 0; + } + bratiol4[0] = 100.; + model4[0][0] = 1000020030; // Helium3 + model4[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); + + // Define the 2-body phase space decay for the Anti-Lithium 4 + Int_t amodel4[6][3]; + Float_t abratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratiol4[kz] = 0.; + amodel4[kz][0] = 0; + amodel4[kz][1] = 0; + amodel4[kz][2] = 0; + } + abratiol4[0] = 100.; + amodel4[0][0] = -1000020030; // Anti-Helium3 + amodel4[0][1] = -2212; // Anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); + + // Define the 2- and 3-body phase space decay for the Hypertriton + Int_t mode[6][3]; + Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 50.; + mode[0][0] = 1000020030; // Helium3 + mode[0][1] = -211; // negative pion + + bratio[1] = 50.; + mode[1][0] = 1000010020; // deuteron + mode[1][1] = 2212; // proton + mode[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); + + // Define the 2- and 3-body phase space decay for the Anti-Hypertriton + Int_t amode[6][3]; + Float_t abratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio[kz] = 0.; + amode[kz][0] = 0; + amode[kz][1] = 0; + amode[kz][2] = 0; + } + abratio[0] = 50.; + amode[0][0] = -1000020030; // anti- Helium3 + amode[0][1] = 211; // positive pion + abratio[1] = 50.; + amode[1][0] = -1000010020; // anti-deuteron + amode[1][1] = -2212; // anti-proton + amode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); + + ////// ----------Hypernuclei with Mass=4 ----------- ////////// + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + + Int_t mode3[6][3]; + Float_t bratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio3[kz] = 0.; + mode3[kz][0] = 0; + mode3[kz][1] = 0; + mode3[kz][2] = 0; + } + bratio3[0] = 50.; + mode3[0][0] = 1000020040; // Helium4 + mode3[0][1] = -211; // negative pion + + bratio3[1] = 50.; + mode3[1][0] = 1000010030; // tritium + mode3[1][1] = 2212; // proton + mode3[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + Int_t amode3[6][3]; + Float_t abratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio3[kz] = 0.; + amode3[kz][0] = 0; + amode3[kz][1] = 0; + amode3[kz][2] = 0; + } + abratio3[0] = 50.; + amode3[0][0] = -1000020040; // anti- Helium4 + amode3[0][1] = 211; // positive pion + abratio3[1] = 50.; + amode3[1][0] = -1000010030; // anti-tritium + amode3[1][1] = -2212; // anti-proton + amode3[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); + + // Define the 3-body phase space decay for the Hyperhelium 4 + Int_t mode4[6][3]; + Float_t bratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4[kz] = 0.; + mode4[kz][0] = 0; + mode4[kz][1] = 0; + mode4[kz][2] = 0; + } + bratio4[0] = 50.; + mode4[0][0] = 1000020030; // Helium3 + mode4[0][1] = -211; // negative pion + mode4[0][2] = 2212; // proton + + bratio4[1] = 50.; + mode4[1][0] = 1000030040; // lithium-4 + mode4[1][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 4 + Int_t amode4[6][3]; + Float_t abratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4[kz] = 0.; + amode4[kz][0] = 0; + amode4[kz][1] = 0; + amode4[kz][2] = 0; + } + abratio4[0] = 50.; + amode4[0][0] = -1000020030; // anti-Helium 3 + amode4[0][1] = 211; // positive pion + amode4[0][2] = -2212; // anti proton + + abratio4[1] = 50.; + amode4[1][0] = -1000030040; // antilithium-4 + amode4[1][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); + + // Define the 3-body phase space decay for the Hyperhelium 5 + Int_t mode41[6][3]; + Float_t bratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio41[kz] = 0.; + mode41[kz][0] = 0; + mode41[kz][1] = 0; + mode41[kz][2] = 0; + } + bratio41[0] = 50.; + mode41[0][0] = 1000020040; // Helium4 + mode41[0][1] = -211; // negative pion + mode41[0][2] = 2212; // proton + bratio41[1] = 50.; + mode41[1][0] = 1000020030; // Helium3 + mode41[1][1] = -211; // negative pion + mode41[1][2] = 1000010020; // Deuteron + + TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 5 + Int_t amode41[6][3]; + Float_t abratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio41[kz] = 0.; + amode41[kz][0] = 0; + amode41[kz][1] = 0; + amode41[kz][2] = 0; + } + abratio41[0] = 50.; + amode41[0][0] = -1000020040; // anti-Helium 4 + amode41[0][1] = 211; // positive pion + amode41[0][2] = -2212; // anti proton + abratio41[1] = 50.; + amode41[1][0] = -1000020030; // anti-Helium 3 + amode41[1][1] = 211; // positive pion + amode41[1][2] = -1000010020; // anti deuteron + + TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); + + // Define the 3-body phase space decay for the Doublehyperhydrogen 4 + Int_t mode42[6][3]; + Float_t bratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio42[kz] = 0.; + mode42[kz][0] = 0; + mode42[kz][1] = 0; + mode42[kz][2] = 0; + } + bratio42[0] = 50.; + mode42[0][0] = 1010020040; // Hyper-Helium4 + mode42[0][1] = -211; // negative pion + bratio42[1] = 50.; + mode42[1][0] = 1010010030; // Hypertriton + mode42[1][1] = 2212; // proton + mode42[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); + + + // Define the 2-body phase space decay for the Anti-Doublehyperhydrogen 4 + Int_t amode42[6][3]; + Float_t abratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio42[kz] = 0.; + amode42[kz][0] = 0; + amode42[kz][1] = 0; + amode42[kz][2] = 0; + } + abratio42[0] = 100.; + amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 + amode42[0][1] = 211; // positive pion + abratio42[1] = 50.; + amode42[1][0] = -1010010030; // anti-Hypertriton + amode42[1][1] = -2212; // antiproton + amode42[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); + + // Define the decay for the 4Xi(-)He + Int_t mode4XiHe[6][3]; + Float_t bratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiHe[kz] = 0.; + mode4XiHe[kz][0] = 0; + mode4XiHe[kz][1] = 0; + mode4XiHe[kz][2] = 0; + } + bratio4XiHe[0] = 33.; + mode4XiHe[0][0] = 1010020040; // HyperHelium4 + mode4XiHe[0][1] = -211; // negative pion + + bratio4XiHe[1] = 33.; + mode4XiHe[1][0] = 3122; // lambda + mode4XiHe[1][1] = 1000020030; // helium-3 + mode4XiHe[1][2] = -211; // negative pion + + bratio4XiHe[2] = 33.; + mode4XiHe[2][0] = 1000030040; // lithium-4 + mode4XiHe[2][1] = -211; // negative pion + mode4XiHe[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe); + + // Define the decay for the Anti-4Xi(-)He + Int_t amode4XiHe[6][3]; + Float_t abratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiHe[kz] = 0.; + amode4XiHe[kz][0] = 0; + amode4XiHe[kz][1] = 0; + amode4XiHe[kz][2] = 0; + } + abratio4XiHe[0] = 33.; + amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4 + amode4XiHe[0][1] = 211; // positive pion + + abratio4XiHe[1] = 33.; + amode4XiHe[1][0] = -3122; // antilambda + amode4XiHe[1][1] = -1000020030; // antihelium-3 + amode4XiHe[1][2] = 211; // positive pion + + abratio4XiHe[2] = 33.; + amode4XiHe[2][0] = -1000030040; // antilithium-4 + amode4XiHe[2][1] = 211; // positive pion + amode4XiHe[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe); + + // Define the decay for the 4Xi(-)H + Int_t mode4XiH[6][3]; + Float_t bratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiH[kz] = 0.; + mode4XiH[kz][0] = 0; + mode4XiH[kz][1] = 0; + mode4XiH[kz][2] = 0; + } + bratio4XiH[0] = 33.; + mode4XiH[0][0] = 1010010040; // HyperHydrogen4 + mode4XiH[0][1] = -211; // negative pion + + bratio4XiH[1] = 33.; + mode4XiH[1][0] = 3122; // lambda + mode4XiH[1][1] = 1000010030; // triton + mode4XiH[1][2] = -211; // negative pion + + bratio4XiH[2] = 33.; + mode4XiH[2][0] = 1000020040; // alpha + mode4XiH[2][1] = -211; // negative pion + mode4XiH[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH); + + // Define the decay for the Anti-4Xi(-)H + Int_t amode4XiH[6][3]; + Float_t abratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiH[kz] = 0.; + amode4XiH[kz][0] = 0; + amode4XiH[kz][1] = 0; + amode4XiH[kz][2] = 0; + } + abratio4XiH[0] = 33.; + amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4 + amode4XiH[0][1] = 211; // positive pion + + abratio4XiH[1] = 33.; + amode4XiH[1][0] = -3122; // antilambda + amode4XiH[1][1] = -1000010030; // antitriton + amode4XiH[1][2] = 211; // positive pion + + abratio4XiH[2] = 33.; + amode4XiH[2][0] = -1000020040; // antialpha + amode4XiH[2][1] = 211; // positive pion + amode4XiH[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH); + + // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma + Int_t mode4s[6][3]; + Float_t bratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4s[kz] = 0.; + mode4s[kz][0] = 0; + mode4s[kz][1] = 0; + mode4s[kz][2] = 0; + } + bratio4s[0] = 20.; + mode4s[0][0] = 1000020040; // Helium4 + mode4s[0][1] = 111; // pion0 + bratio4s[1] = 40.; + mode4s[1][0] = 1000010030; // tritium + mode4s[1][2] = 2212; // proton + mode4s[1][1] = 111; // pion0 + bratio4s[2] = 40.; + mode4s[2][0] = 1000010030; // tritium + mode4s[2][2] = 2212; // pion+ + mode4s[2][1] = 2112; // neutron + + TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); + + // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma + Int_t amode4s[6][3]; + Float_t abratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4s[kz] = 0.; + amode4s[kz][0] = 0; + amode4s[kz][1] = 0; + amode4s[kz][2] = 0; + } + abratio4s[0] = 50.; + amode4s[0][0] = -1000020040; // anti-Helium4 + amode4s[0][1] = 111; // pion0 + abratio4s[1] = 50.; + amode4s[1][0] = -1000010030; // anti-tritium + amode4s[1][2] = -2212; // anti-proton + amode4s[1][1] = 111; // pion0 + abratio4s[2] = 50.; + amode4s[2][0] = -1000010030; // anti-tritium + amode4s[2][2] = -211; // pion- + amode4s[2][1] = -2112; // anti-neutron + + TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); + + // Define the 2-body phase space decay for the Lambda-neutron boundstate + Int_t mode1[6][3]; + Float_t bratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio1[kz] = 0.; + mode1[kz][0] = 0; + mode1[kz][1] = 0; + mode1[kz][2] = 0; + } + bratio1[0] = 100.; + mode1[0][0] = 1000010020; // deuteron + mode1[0][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); + + // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate + Int_t amode1[6][3]; + Float_t abratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio1[kz] = 0.; + amode1[kz][0] = 0; + amode1[kz][1] = 0; + amode1[kz][2] = 0; + } + abratio1[0] = 100.; + amode1[0][0] = -1000010020; // anti-deuteron + amode1[0][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); + + // Define the 2-body phase space decay for the H-Dibaryon + Int_t mode2[6][3]; + Float_t bratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio2[kz] = 0.; + mode2[kz][0] = 0; + mode2[kz][1] = 0; + mode2[kz][2] = 0; + } + bratio2[0] = 100.; + mode2[0][0] = 3122; // Lambda + mode2[0][1] = 2212; // proton + mode2[0][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); + + // Define the 2-body phase space decay for the Anti-H-Dibaryon + Int_t amode2[6][3]; + Float_t abratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio2[kz] = 0.; + amode2[kz][0] = 0; + amode2[kz][1] = 0; + amode2[kz][2] = 0; + } + abratio2[0] = 100.; + amode2[0][0] = -3122; // anti-deuteron + amode2[0][1] = -2212; // anti-proton + amode2[0][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); + + // Define the 2-body phase space decay for the Xi0P + Int_t mode5[6][3]; + Float_t bratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio5[kz] = 0.; + mode5[kz][0] = 0; + mode5[kz][1] = 0; + mode5[kz][2] = 0; + } + bratio5[0] = 100.; + mode5[0][0] = 3122; // Lambda + mode5[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); + + // Define the 2-body phase space decay for the Anti-Xi0P + Int_t amode5[6][3]; + Float_t abratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio5[kz] = 0.; + amode5[kz][0] = 0; + amode5[kz][1] = 0; + amode5[kz][2] = 0; + } + abratio5[0] = 100.; + amode5[0][0] = -3122; // anti-Lambda + amode5[0][1] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); + + // Define the 2-body phase space decay for the Lambda-Neutron-Neutron + Int_t mode6[6][3]; + Float_t bratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio6[kz] = 0.; + mode6[kz][0] = 0; + mode6[kz][1] = 0; + mode6[kz][2] = 0; + } + bratio6[0] = 100.; + mode6[0][0] = 1000010030; // triton + mode6[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); + + // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron + Int_t amode6[6][3]; + Float_t abratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio6[kz] = 0.; + amode6[kz][0] = 0; + amode6[kz][1] = 0; + amode6[kz][2] = 0; + } + abratio6[0] = 100.; + amode6[0][0] = -1000010030; // anti-triton + amode6[0][1] = 211; // pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); + + // Define the 3-body phase space decay for the Omega-Proton + Int_t mode7[6][3]; + Float_t bratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio7[kz] = 0.; + mode7[kz][0] = 0; + mode7[kz][1] = 0; + mode7[kz][2] = 0; + } + bratio7[0] = 100.; + mode7[0][0] = 3122; // Lambda + mode7[0][1] = -321; // negative Kaon + mode7[0][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); + + // Define the 3-body phase space decay for the Anti-Omega-Proton + Int_t amode7[6][3]; + Float_t abratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio7[kz] = 0.; + amode7[kz][0] = 0; + amode7[kz][1] = 0; + amode7[kz][2] = 0; + } + abratio7[0] = 100.; + amode7[0][0] = -3122; // anti-Lambda + amode7[0][1] = 321; // positive kaon + amode7[0][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); + + // Define the 2-body phase space decay for the Omega-Neutron + Int_t mode8[6][3]; + Float_t bratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio8[kz] = 0.; + mode8[kz][0] = 0; + mode8[kz][1] = 0; + mode8[kz][2] = 0; + } + bratio8[0] = 100.; + mode8[0][0] = 3122; // Lambda + mode8[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); + + // Define the 2-body phase space decay for the Anti-Omega-Neutron + Int_t amode8[6][3]; + Float_t abratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio8[kz] = 0.; + amode8[kz][0] = 0; + amode8[kz][1] = 0; + amode8[kz][2] = 0; + } + abratio8[0] = 100.; + amode8[0][0] = -3122; // anti-Lambda + amode8[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); + + // Define the 3-body phase space decay for the Omega-Omega + Int_t mode9[6][3]; + Float_t bratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio9[kz] = 0.; + mode9[kz][0] = 0; + mode9[kz][1] = 0; + mode9[kz][2] = 0; + } + bratio9[0] = 100.; + mode9[0][0] = 3334; // negative Omega + mode9[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); + + // Define the 3-body phase space decay for the Anti-Omega-Omega + Int_t amode9[6][3]; + Float_t abratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio9[kz] = 0.; + amode9[kz][0] = 0; + amode9[kz][1] = 0; + amode9[kz][2] = 0; + } + abratio9[0] = 100.; + amode9[0][0] = -3334; // positive Omega + amode9[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); + + // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton + Int_t mode10[6][3]; + Float_t bratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio10[kz] = 0.; + mode10[kz][0] = 0; + mode10[kz][1] = 0; + mode10[kz][2] = 0; + } + bratio10[0] = 50.; + mode10[0][0] = 3122; // Lambda + mode10[0][1] = 2212; // proton + bratio10[1] = 50.; + mode10[1][0] = 2212; // proton + mode10[1][1] = -321; // negative kaon + mode10[1][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); + + // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton + Int_t amode10[6][3]; + Float_t abratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio10[kz] = 0.; + amode10[kz][0] = 0; + amode10[kz][1] = 0; + amode10[kz][2] = 0; + } + abratio10[0] = 50.; + amode10[0][0] = -3122; // anti-Lambda + amode10[0][1] = -2212; // anti-proton + abratio10[1] = 50.; + amode10[1][0] = -2212; // anti-proton + amode10[1][1] = 321; // positive kaon + amode10[1][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); + + // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) + Int_t mode11[6][3]; + Float_t bratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio11[kz] = 0.; + mode11[kz][0] = 0; + mode11[kz][1] = 0; + mode11[kz][2] = 0; + } + bratio11[0] = 50.; + mode11[0][0] = 3122; // Lambda + mode11[0][1] = 3122; // Lambda + bratio11[1] = 50.; + mode11[1][0] = 3122; // Lambda + mode11[1][1] = 2212; // proton + mode11[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); + + // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) + Int_t amode11[6][3]; + Float_t abratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio11[kz] = 0.; + amode11[kz][0] = 0; + amode11[kz][1] = 0; + amode11[kz][2] = 0; + } + abratio11[0] = 50.; + amode11[0][0] = -3122; // anti-Lambda + amode11[0][1] = -3122; // anti-Lambda + abratio11[1] = 50.; + amode11[1][0] = -3122; // anti-Lambda + amode11[1][1] = -2212; // anti-proton + amode11[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); + + // Define the decays for the c-triton + Int_t ctmode[6][3]; + Float_t ctbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + ctbratio[kz] = 0.; + ctmode[kz][0] = 0; + ctmode[kz][1] = 0; + ctmode[kz][2] = 0; + } + ctbratio[0] = 50.; + ctmode[0][0] = 1000020030; // Helium3 + ctmode[0][1] = 310; // K0s + + ctbratio[1] = 50.; + ctmode[1][0] = 1000020030; // Helium3 + ctmode[1][1] = -321; // negative kaon + ctmode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); + + // Define the decays for the anti-c-triton + Int_t actmode[6][3]; + Float_t actbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + actbratio[kz] = 0.; + actmode[kz][0] = 0; + actmode[kz][1] = 0; + actmode[kz][2] = 0; + } + actbratio[0] = 50.; + actmode[0][0] = -1000020030; // Helium3 + actmode[0][1] = 310; // K0s + + actbratio[1] = 50.; + actmode[1][0] = -1000020030; // Helium3 + actmode[1][1] = 321; // negative kaon + actmode[1][2] = -211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); + + // Define the decays for the c-deuteron + Int_t cdmode[6][3]; + Float_t cdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + cdbratio[kz] = 0.; + cdmode[kz][0] = 0; + cdmode[kz][1] = 0; + cdmode[kz][2] = 0; + } + cdbratio[0] = 50.; + cdmode[0][0] = 1000010020; // deuteron + cdmode[0][1] = -321; // negative kaon + cdmode[0][2] = 211; // positive pion + + cdbratio[1] = 50.; + cdmode[1][0] = 1000010020; // deuteron + cdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); + + // Define the decays for the anti-c-deuteron + Int_t acdmode[6][3]; + Float_t acdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + acdbratio[kz] = 0.; + acdmode[kz][0] = 0; + acdmode[kz][1] = 0; + acdmode[kz][2] = 0; + } + acdbratio[0] = 50.; + acdmode[0][0] = -1000010020; // deuteron + acdmode[0][1] = 321; // negative kaon + acdmode[0][2] = -211; // positive pion + + acdbratio[1] = 50.; + acdmode[1][0] = -1000010020; // deuteron + acdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); + + /////////////////////////////////////////////////////////////////// + + // Define the 2-body phase space decay for the f0(980) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); + + // Define the 2-body phase space decay for the f2(1270) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); + + // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710 + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 310; // K0s + mode[0][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) + TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) + TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) + TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) + TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) + + // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + + bratio2[0] = 50.; + mode[0][0] = 310; // K0s + mode[0][1] = -321; // anti-K + mode[0][2] = 211; // pion+ + + bratio2[1] = 50.; + mode[1][0] = 310; // K0s + mode[1][1] = 321; // K + mode[1][2] = -211; // pion- + + TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) + TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) + + // Lambda1520/Lambda1520bar + + TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); + + // Lambda1520 decay modes + Int_t lmode[9][3]; + Float_t lbratio[9]; + for (Int_t kz = 0; kz < 9; kz++) { + lbratio[kz] = 0.; + lmode[kz][0] = 0; + lmode[kz][1] = 0; + lmode[kz][2] = 0; + } + + // L(1520) -> p K- + lbratio[0] = 0.229944; + lmode[0][0] = 2212; + lmode[0][1] = -321; + + // L(1520) -> n K0 + lbratio[1] = 0.229944; + lmode[1][0] = 2112; + lmode[1][1] = -311; + + // L(1520) -> Sigma+ pi- + lbratio[2] = 0.143076; + lmode[2][0] = 3222; + lmode[2][1] = -211; + + // L(1520) -> Sigma0 pi0 + lbratio[3] = 0.143076; + lmode[3][0] = 3212; + lmode[3][1] = 111; + + // L(1520) -> Sigma- pi+ + lbratio[4] = 0.143076; + lmode[4][0] = 3112; + lmode[4][1] = 211; + + // L(1520) -> Sigma*- pi+ + lbratio[5] = 0.034066; + lmode[5][0] = 3114; + lmode[5][1] = 211; + + // L(1520) -> Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = 3214; + lmode[6][1] = 111; + + // L(1520) -> Sigma*+ pi- + lbratio[7] = 0.034066; + lmode[7][0] = 3224; + lmode[7][1] = -211; + + // L(1520) -> Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = 3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); + + // Lambda1520bar decay modes + + // L(1520)bar -> p- K+ + lbratio[0] = 0.229944; + lmode[0][0] = -2212; + lmode[0][1] = 321; + + // L(1520)bar -> nbar K0bar + lbratio[1] = 0.229944; + lmode[1][0] = -2112; + lmode[1][1] = 311; + + // L(1520)bar -> Sigmabar- pi+ + lbratio[2] = 0.143076; + lmode[2][0] = -3222; + lmode[2][1] = 211; + + // L(1520)bar -> Sigma0bar pi0 + lbratio[3] = 0.143076; + lmode[3][0] = -3212; + lmode[3][1] = 111; + + // L(1520)bar -> Sigmabar+ pi- + lbratio[4] = 0.143076; + lmode[4][0] = -3112; + lmode[4][1] = -211; + + // L(1520)bar -> anti-Sigma*- pi- + lbratio[5] = 0.034066; + lmode[5][0] = -3114; + lmode[5][1] = -211; + + // L(1520)bar -> anti-Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = -3214; + lmode[6][1] = 111; + + // L(1520)bar -> anti-Sigma*+ pi+ + lbratio[7] = 0.034066; + lmode[7][0] = -3224; + lmode[7][1] = 211; + + // L(1520)bar -> Anti-Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = -3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); + + // -------------------------------------------------------------------- + + //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) + TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, -2, kTRUE); + } + + void O2MCApplicationBase::AddParticles() + { + // dispatch first to function in FairRoot + FairMCApplication::AddParticles(); + + // register special particles for ALICE + // TODO: try to make use of FairRoot if easier or more customizable + addSpecialParticles(); + + auto& param = o2::conf::SimUserDecay::Instance(); + LOG(info) << "Printing \'SimUserDecay\' parameters"; + LOG(info) << param; + + // check if there are PDG codes requested for user decay + if (param.pdglist.empty()) { + return; + } + + // loop over PDG codes in the string + std::stringstream ss(param.pdglist); + int pdg; + while (ss >> pdg) { + LOG(info) << "Setting user decay for PDG " << pdg; + TVirtualMC::GetMC()->SetUserDecay(pdg); + } + } + + void O2MCApplicationBase::initTrackRefHook() + { + if (mCutParams.stepTrackRefHook) { + LOG(info) << "Initializing the hook for TrackReferences during stepping"; + auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); + if (std::filesystem::exists(expandedTrackRefHookFileName)) { + // if this file exists we will compile the hook on the fly + mTrackRefFcn = o2::conf::GetFromMacro(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook"); + LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; + } + else { + LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; + mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing + } + } + } + + void O2MCApplication::initLate() + { + o2::utils::ShmManager::Instance().occupySegment(); + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->initializeLate(); + } + } + } + + void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const + { + // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); + o2::base::attachTMessage(info, *mSimDataChannel, parts); + } + + // helper function to fetch data from FairRootManager branch and serialize it + // returns handle to container + template + const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts) + { + auto mgr = FairRootManager::Instance(); + // check if branch is present + if (mgr->GetBranchId(name) == -1) { + LOG(error) << "Branch " << name << " not found"; + return nullptr; + } + auto data = mgr->InitObjectAs(name.c_str()); + if (data) { + o2::base::attachTMessage(*data, channel, parts); + } + return data; + } + + void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) + { + mSubEventInfo = i; + // being communicated a SubEventInfo also means we get a FairMCEventHeader + fMCEventHeader = &mSubEventInfo->mMCEventHeader; + } + + void O2MCApplication::SendData() + { + fair::mq::Parts simdataparts; + + // fill these parts ... the receiver has to unpack similary + // TODO: actually we could just loop over branches in FairRootManager at this moment? + mSubEventInfo->npersistenttracks = static_cast(GetStack())->getMCTracks()->size(); + mSubEventInfo->nprimarytracks = static_cast(GetStack())->GetNprimary(); + attachSubEventInfo(simdataparts, *mSubEventInfo); + auto tracks = attachBranch>("MCTrack", *mSimDataChannel, simdataparts); + attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); + assert(tracks->size() == mSubEventInfo->npersistenttracks); + + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); + } + } + LOG(info) << "sending message with " << simdataparts.Size() << " parts"; + mSimDataChannel->Send(simdataparts); + } + } // namespace steer } // namespace o2 From 496d6f13a971ac28d0ef4aa7e0c995c4b3196b23 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:42:18 +0100 Subject: [PATCH 03/15] Update O2MCApplication.cxx Update Intendations --- Steer/src/O2MCApplication.cxx | 3135 ++++++++++++++++----------------- 1 file changed, 1567 insertions(+), 1568 deletions(-) diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index cfef2a25b9ce2..426b3734fdd22 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -40,1572 +40,1571 @@ namespace o2 { - namespace steer - { - // helper function to send trivial data - template - void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts) - { - static auto mgr = FairRootManager::Instance(); - auto vector = mgr->InitObjectAs*>(name); - if (vector) { - auto buffer = (char*)&(*vector)[0]; - auto buffersize = vector->size() * sizeof(T); - fair::mq::MessagePtr message(channel.NewMessage( - buffer, buffersize, - [](void* data, void* hint) {}, buffer)); - parts.AddPart(std::move(message)); - } - } - - void O2MCApplicationBase::Stepping() - { - mStepCounter++; - - // check the max time of flight condition - const auto tof = fMC->TrackTime(); - auto& params = o2::GlobalProcessCutSimParam::Instance(); - if (tof > params.TOFMAX) { - fMC->StopTrack(); - return; - } - - mLongestTrackTime = std::max((double)mLongestTrackTime, tof); - - if (mCutParams.stepFiltering) { - // we can kill tracks here based on our - // custom detector specificities - - // Note that this is done in addition to the generic - // R + Z-cut mechanism at VMC level. - - float x, y, z; - fMC->TrackPosition(x, y, z); - - // this function is implementing a basic z-dependent R cut - // can be generalized later on - auto outOfR = [x, y, this](float z) { - // for the moment for cases when we have ZDC enabled - if (std::abs(z) > mCutParams.tunnelZ) { - if ((x * x + y * y) > mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { - return true; - } - } - return false; - }; - - if (z > mCutParams.ZmaxA || - -z > mCutParams.ZmaxC || - outOfR(z)) { - fMC->StopTrack(); - return; - } - } - - if (mCutParams.stepTrackRefHook) { - mTrackRefFcn(fMC); - } - - // dispatch now to stepping function in FairRoot - FairMCApplication::Stepping(); - } - - void O2MCApplicationBase::PreTrack() - { - // dispatch first to function in FairRoot - FairMCApplication::PreTrack(); - } - - void O2MCApplicationBase::ConstructGeometry() - { - // fill the mapping - mModIdToName.clear(); - o2::detectors::DetID::mask_t dmask{}; - for (int i = 0; i < fModules->GetEntries(); ++i) { - auto mod = static_cast(fModules->At(i)); - if (mod) { - mModIdToName[mod->GetModId()] = mod->GetName(); - int did = o2::detectors::DetID::nameToID(mod->GetName()); - if (did >= 0) { - dmask |= o2::detectors::DetID::getMask(did); - } - } - } - gGeoManager->SetUniqueID(dmask.to_ulong()); - FairMCApplication::ConstructGeometry(); - - std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); - // construct the volume name to module name mapping useful for StepAnalysis - auto vollist = gGeoManager->GetListOfVolumes(); - for (int i = 0; i < vollist->GetEntries(); ++i) { - auto vol = static_cast(vollist->At(i)); - auto iter = fModVolMap.find(vol->GetNumber()); - voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; - } - } - - void O2MCApplicationBase::InitGeometry() - { - // load special cuts which might be given from the outside first. - auto& matMgr = o2::base::MaterialManager::Instance(); - matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); - matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); - // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module - FairMCApplication::InitGeometry(); - matMgr.writeCutsAndProcessesToJSON(); - // now the sensitive volumes are set up in fVolMap and we can query them - for (auto e : fVolMap) { - // since fVolMap contains multiple entries (if multiple copies), this may - // write to the same entry multiple times - mSensitiveVolumes[e.first] = e.second->GetName(); - } - std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); - for (auto e : mSensitiveVolumes) { - sensvolfile << e.first << ":" << e.second << "\n"; - } - } - - bool O2MCApplicationBase::MisalignGeometry() - { - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->addAlignableVolumes(); - } - } - - // we stream out both unaligned geometry (to allow for - // dynamic post-alignment) as well as the aligned version - // which can be used by digitization etc. immediately - auto& confref = o2::conf::SimConfig::Instance(); - auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); - // since in general the geometry is a CCDB object, it must be exported under the standard name - gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); - gGeoManager->Export(geomfile.c_str()); - - // apply alignment for included detectors AFTER exporting ideal geometry - auto& aligner = o2::base::Aligner::Instance(); - aligner.applyAlignment(confref.getTimestamp()); - - // export aligned geometry into different file - auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); - gGeoManager->Export(alignedgeomfile.c_str()); - - auto& param = o2::GeometryManagerParam::Instance(); - - // fill parallel world geometry if activated - if (param.useParallelWorld) { - TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors"); - if (param.usePwGeoBVH) { - pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); - } - if (param.usePwCaching) { - TGeoNavigator::SetPWSafetyCaching(true); - } - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->fillParallelWorld(); - } - } - gGeoManager->SetUseParallelWorldNav(true); - } - - // return original return value of misalignment procedure - return true; - } - - void O2MCApplicationBase::finishEventCommon() - { - LOG(info) << "This event/chunk did " << mStepCounter << " steps"; - LOG(info) << "Longest track time is " << mLongestTrackTime; - - auto header = static_cast(fMCEventHeader); - header->getMCEventStats().setNSteps(mStepCounter); - header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); - - static_cast(GetStack())->updateEventStats(); - } - - void O2MCApplicationBase::FinishEvent() - { - finishEventCommon(); - - auto header = static_cast(fMCEventHeader); - auto& confref = o2::conf::SimConfig::Instance(); - - if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { - LOG(info) << "Discarding current event due to no hits"; - SetSaveCurrentEvent(false); - } - - // dispatch to function in FairRoot - FairMCApplication::FinishEvent(); - } - - void O2MCApplicationBase::BeginEvent() - { - // dispatch first to function in FairRoot - FairMCApplication::BeginEvent(); - - // register event header with our stack - auto header = static_cast(fMCEventHeader); - static_cast(GetStack())->setMCEventStats(&header->getMCEventStats()); - - mStepCounter = 0; - mLongestTrackTime = 0; - } - - void addSpecialParticles() - { - // - // Add particles needed for ALICE (not present in Geant3 or Geant4) - // Code ported 1-1 from AliRoot - // - - LOG(info) << "Adding custom particles to VMC"; - - // ### NUCLEI ### - // 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); - - // ### HYPER NUCLEI (|S| = 1) ### - //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); - - //Hyper hydrogen 4 - 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 - 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 - 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 - 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); - - //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); - - // ### HYPER NUCLEI (|S| = 2) ### - //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); - - //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); - //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); - - // 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); - - // ### EXOTICA ### - //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); - - //Anti-Lambda-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Xi-Proton - 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); - - //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); - - //Anti-Lambda-Neutron-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); - - //Omega-Proton - TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Proton - TVirtualMC::GetMC()->DefineParticle(-1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Omega-Neutron - 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); - - //Omega-Omega - TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Omega - TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Lambda(1405)-Proton - 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); - - //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); - - //Anti-Lambda(1405)-Lambda(1405) - TVirtualMC::GetMC()->DefineParticle(-1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //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); - - //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); - - //Resonances not in Generators - // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) - TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f2(1270) (PDG: width = 185 MeV) - TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - // Glueball hunting family - // Their life times are not known, so we set them to 1e-24 - // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) - TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, 0, 0, kTRUE); - // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // Xi_0(1820) - TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); - - int xi_0_1820_mode[6][3] = { {0} }; - float xi_0_1820_ratio[6] = { 100.f, 0.f, 0.f, 0.f, 0.f, 0.f }; - xi_0_1820_mode[0][0] = 3122; // Lambda - xi_0_1820_mode[0][1] = 310; // K0s - TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); - xi_0_1820_mode[0][0] = -3122; // Lambda-bar - TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); - - // Xi-+(1820) - TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, 1.8234, -1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, 1.8234, 1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); - - int xi_charged_1820_mode[6][3] = { {0} }; - float xi_charged_1820_ratio[6] = { 100.f, 0.f, 0.f, 0.f, 0.f, 0.f }; - xi_charged_1820_mode[0][0] = 3122; // Lambda - xi_charged_1820_mode[0][1] = -321; // K- - TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode); - xi_charged_1820_mode[0][0] = -3122; // Lambda-bar - xi_charged_1820_mode[0][1] = 321; // K+ - TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode); - - // Ps - hidden strange (s-sbar) pentaquarks - TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE); - - Int_t psmode[6][3] = { 0 }; - Float_t psratio[6] = { 0.f }; - psratio[0] = 100.; - - psmode[0][0] = 333; // phi - psmode[0][1] = 2212; // proton - TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); - - psmode[0][1] = -2212; // anti-proton - TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); - - //Omega(2012) - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - - TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - psmode[0][0] = 3312; // Xi- - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); - - TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, 0, 0, 0, 0, 0, -1, kTRUE); - psmode[0][0] = -3312; // anti-Xi+ - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); - - // d*(2380) - dibaryon resonance - TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE); - - Int_t dstmode[6][3] = { 0 }; - Float_t dstratio[6] = { 0.f }; - dstratio[0] = 100; // For now we implement only the mode of interest - // d* -> d pi+ pi- - dstmode[0][0] = 1000010020; // deuteron - dstmode[0][1] = -211; // negative pion - dstmode[0][2] = 211; // positive pion - TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); - - dstmode[0][0] = -1000010020; // anti-deuteron - TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); - - // Heavy vector mesons - // D*+ - TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*- - TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0 - TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0bar - TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s+ - TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s- - TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0 - TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0bar - TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*+ - TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*- - TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0 - TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0bar - TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c+ - TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c- - TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - - // Charm pentaquarks - // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) - TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - psmode[0][0] = 413; // D*+ - psmode[0][1] = -2212; // anti-p - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); - psmode[0][0] = -413; // D*- - psmode[0][1] = 2212; // p - TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); - - // Define the 2-body phase space decay for the Lithium 4 - Int_t model4[6][3]; - Float_t bratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratiol4[kz] = 0.; - model4[kz][0] = 0; - model4[kz][1] = 0; - model4[kz][2] = 0; - } - bratiol4[0] = 100.; - model4[0][0] = 1000020030; // Helium3 - model4[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); - - // Define the 2-body phase space decay for the Anti-Lithium 4 - Int_t amodel4[6][3]; - Float_t abratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratiol4[kz] = 0.; - amodel4[kz][0] = 0; - amodel4[kz][1] = 0; - amodel4[kz][2] = 0; - } - abratiol4[0] = 100.; - amodel4[0][0] = -1000020030; // Anti-Helium3 - amodel4[0][1] = -2212; // Anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); - - // Define the 2- and 3-body phase space decay for the Hypertriton - Int_t mode[6][3]; - Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 50.; - mode[0][0] = 1000020030; // Helium3 - mode[0][1] = -211; // negative pion - - bratio[1] = 50.; - mode[1][0] = 1000010020; // deuteron - mode[1][1] = 2212; // proton - mode[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); - - // Define the 2- and 3-body phase space decay for the Anti-Hypertriton - Int_t amode[6][3]; - Float_t abratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio[kz] = 0.; - amode[kz][0] = 0; - amode[kz][1] = 0; - amode[kz][2] = 0; - } - abratio[0] = 50.; - amode[0][0] = -1000020030; // anti- Helium3 - amode[0][1] = 211; // positive pion - abratio[1] = 50.; - amode[1][0] = -1000010020; // anti-deuteron - amode[1][1] = -2212; // anti-proton - amode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); - - ////// ----------Hypernuclei with Mass=4 ----------- ////////// - - // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 - - Int_t mode3[6][3]; - Float_t bratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio3[kz] = 0.; - mode3[kz][0] = 0; - mode3[kz][1] = 0; - mode3[kz][2] = 0; - } - bratio3[0] = 50.; - mode3[0][0] = 1000020040; // Helium4 - mode3[0][1] = -211; // negative pion - - bratio3[1] = 50.; - mode3[1][0] = 1000010030; // tritium - mode3[1][1] = 2212; // proton - mode3[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); - - // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 - Int_t amode3[6][3]; - Float_t abratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio3[kz] = 0.; - amode3[kz][0] = 0; - amode3[kz][1] = 0; - amode3[kz][2] = 0; - } - abratio3[0] = 50.; - amode3[0][0] = -1000020040; // anti- Helium4 - amode3[0][1] = 211; // positive pion - abratio3[1] = 50.; - amode3[1][0] = -1000010030; // anti-tritium - amode3[1][1] = -2212; // anti-proton - amode3[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); - - // Define the 3-body phase space decay for the Hyperhelium 4 - Int_t mode4[6][3]; - Float_t bratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4[kz] = 0.; - mode4[kz][0] = 0; - mode4[kz][1] = 0; - mode4[kz][2] = 0; - } - bratio4[0] = 50.; - mode4[0][0] = 1000020030; // Helium3 - mode4[0][1] = -211; // negative pion - mode4[0][2] = 2212; // proton - - bratio4[1] = 50.; - mode4[1][0] = 1000030040; // lithium-4 - mode4[1][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); - - // Define the 2-body phase space decay for the Anti-Hyperhelium 4 - Int_t amode4[6][3]; - Float_t abratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4[kz] = 0.; - amode4[kz][0] = 0; - amode4[kz][1] = 0; - amode4[kz][2] = 0; - } - abratio4[0] = 50.; - amode4[0][0] = -1000020030; // anti-Helium 3 - amode4[0][1] = 211; // positive pion - amode4[0][2] = -2212; // anti proton - - abratio4[1] = 50.; - amode4[1][0] = -1000030040; // antilithium-4 - amode4[1][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); - - // Define the 3-body phase space decay for the Hyperhelium 5 - Int_t mode41[6][3]; - Float_t bratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio41[kz] = 0.; - mode41[kz][0] = 0; - mode41[kz][1] = 0; - mode41[kz][2] = 0; - } - bratio41[0] = 50.; - mode41[0][0] = 1000020040; // Helium4 - mode41[0][1] = -211; // negative pion - mode41[0][2] = 2212; // proton - bratio41[1] = 50.; - mode41[1][0] = 1000020030; // Helium3 - mode41[1][1] = -211; // negative pion - mode41[1][2] = 1000010020; // Deuteron - - TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); - - // Define the 2-body phase space decay for the Anti-Hyperhelium 5 - Int_t amode41[6][3]; - Float_t abratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio41[kz] = 0.; - amode41[kz][0] = 0; - amode41[kz][1] = 0; - amode41[kz][2] = 0; - } - abratio41[0] = 50.; - amode41[0][0] = -1000020040; // anti-Helium 4 - amode41[0][1] = 211; // positive pion - amode41[0][2] = -2212; // anti proton - abratio41[1] = 50.; - amode41[1][0] = -1000020030; // anti-Helium 3 - amode41[1][1] = 211; // positive pion - amode41[1][2] = -1000010020; // anti deuteron - - TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); - - // Define the 3-body phase space decay for the Doublehyperhydrogen 4 - Int_t mode42[6][3]; - Float_t bratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio42[kz] = 0.; - mode42[kz][0] = 0; - mode42[kz][1] = 0; - mode42[kz][2] = 0; - } - bratio42[0] = 50.; - mode42[0][0] = 1010020040; // Hyper-Helium4 - mode42[0][1] = -211; // negative pion - bratio42[1] = 50.; - mode42[1][0] = 1010010030; // Hypertriton - mode42[1][1] = 2212; // proton - mode42[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); - - - // Define the 2-body phase space decay for the Anti-Doublehyperhydrogen 4 - Int_t amode42[6][3]; - Float_t abratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio42[kz] = 0.; - amode42[kz][0] = 0; - amode42[kz][1] = 0; - amode42[kz][2] = 0; - } - abratio42[0] = 100.; - amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 - amode42[0][1] = 211; // positive pion - abratio42[1] = 50.; - amode42[1][0] = -1010010030; // anti-Hypertriton - amode42[1][1] = -2212; // antiproton - amode42[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); - - // Define the decay for the 4Xi(-)He - Int_t mode4XiHe[6][3]; - Float_t bratio4XiHe[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4XiHe[kz] = 0.; - mode4XiHe[kz][0] = 0; - mode4XiHe[kz][1] = 0; - mode4XiHe[kz][2] = 0; - } - bratio4XiHe[0] = 33.; - mode4XiHe[0][0] = 1010020040; // HyperHelium4 - mode4XiHe[0][1] = -211; // negative pion - - bratio4XiHe[1] = 33.; - mode4XiHe[1][0] = 3122; // lambda - mode4XiHe[1][1] = 1000020030; // helium-3 - mode4XiHe[1][2] = -211; // negative pion - - bratio4XiHe[2] = 33.; - mode4XiHe[2][0] = 1000030040; // lithium-4 - mode4XiHe[2][1] = -211; // negative pion - mode4XiHe[2][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe); - - // Define the decay for the Anti-4Xi(-)He - Int_t amode4XiHe[6][3]; - Float_t abratio4XiHe[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4XiHe[kz] = 0.; - amode4XiHe[kz][0] = 0; - amode4XiHe[kz][1] = 0; - amode4XiHe[kz][2] = 0; - } - abratio4XiHe[0] = 33.; - amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4 - amode4XiHe[0][1] = 211; // positive pion - - abratio4XiHe[1] = 33.; - amode4XiHe[1][0] = -3122; // antilambda - amode4XiHe[1][1] = -1000020030; // antihelium-3 - amode4XiHe[1][2] = 211; // positive pion - - abratio4XiHe[2] = 33.; - amode4XiHe[2][0] = -1000030040; // antilithium-4 - amode4XiHe[2][1] = 211; // positive pion - amode4XiHe[2][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe); - - // Define the decay for the 4Xi(-)H - Int_t mode4XiH[6][3]; - Float_t bratio4XiH[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4XiH[kz] = 0.; - mode4XiH[kz][0] = 0; - mode4XiH[kz][1] = 0; - mode4XiH[kz][2] = 0; - } - bratio4XiH[0] = 33.; - mode4XiH[0][0] = 1010010040; // HyperHydrogen4 - mode4XiH[0][1] = -211; // negative pion - - bratio4XiH[1] = 33.; - mode4XiH[1][0] = 3122; // lambda - mode4XiH[1][1] = 1000010030; // triton - mode4XiH[1][2] = -211; // negative pion - - bratio4XiH[2] = 33.; - mode4XiH[2][0] = 1000020040; // alpha - mode4XiH[2][1] = -211; // negative pion - mode4XiH[2][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH); - - // Define the decay for the Anti-4Xi(-)H - Int_t amode4XiH[6][3]; - Float_t abratio4XiH[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4XiH[kz] = 0.; - amode4XiH[kz][0] = 0; - amode4XiH[kz][1] = 0; - amode4XiH[kz][2] = 0; - } - abratio4XiH[0] = 33.; - amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4 - amode4XiH[0][1] = 211; // positive pion - - abratio4XiH[1] = 33.; - amode4XiH[1][0] = -3122; // antilambda - amode4XiH[1][1] = -1000010030; // antitriton - amode4XiH[1][2] = 211; // positive pion - - abratio4XiH[2] = 33.; - amode4XiH[2][0] = -1000020040; // antialpha - amode4XiH[2][1] = 211; // positive pion - amode4XiH[2][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH); - - // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma - Int_t mode4s[6][3]; - Float_t bratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4s[kz] = 0.; - mode4s[kz][0] = 0; - mode4s[kz][1] = 0; - mode4s[kz][2] = 0; - } - bratio4s[0] = 20.; - mode4s[0][0] = 1000020040; // Helium4 - mode4s[0][1] = 111; // pion0 - bratio4s[1] = 40.; - mode4s[1][0] = 1000010030; // tritium - mode4s[1][2] = 2212; // proton - mode4s[1][1] = 111; // pion0 - bratio4s[2] = 40.; - mode4s[2][0] = 1000010030; // tritium - mode4s[2][2] = 2212; // pion+ - mode4s[2][1] = 2112; // neutron - - TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); - - // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma - Int_t amode4s[6][3]; - Float_t abratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4s[kz] = 0.; - amode4s[kz][0] = 0; - amode4s[kz][1] = 0; - amode4s[kz][2] = 0; - } - abratio4s[0] = 50.; - amode4s[0][0] = -1000020040; // anti-Helium4 - amode4s[0][1] = 111; // pion0 - abratio4s[1] = 50.; - amode4s[1][0] = -1000010030; // anti-tritium - amode4s[1][2] = -2212; // anti-proton - amode4s[1][1] = 111; // pion0 - abratio4s[2] = 50.; - amode4s[2][0] = -1000010030; // anti-tritium - amode4s[2][2] = -211; // pion- - amode4s[2][1] = -2112; // anti-neutron - - TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); - - // Define the 2-body phase space decay for the Lambda-neutron boundstate - Int_t mode1[6][3]; - Float_t bratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio1[kz] = 0.; - mode1[kz][0] = 0; - mode1[kz][1] = 0; - mode1[kz][2] = 0; - } - bratio1[0] = 100.; - mode1[0][0] = 1000010020; // deuteron - mode1[0][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); - - // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate - Int_t amode1[6][3]; - Float_t abratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio1[kz] = 0.; - amode1[kz][0] = 0; - amode1[kz][1] = 0; - amode1[kz][2] = 0; - } - abratio1[0] = 100.; - amode1[0][0] = -1000010020; // anti-deuteron - amode1[0][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); - - // Define the 2-body phase space decay for the H-Dibaryon - Int_t mode2[6][3]; - Float_t bratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio2[kz] = 0.; - mode2[kz][0] = 0; - mode2[kz][1] = 0; - mode2[kz][2] = 0; - } - bratio2[0] = 100.; - mode2[0][0] = 3122; // Lambda - mode2[0][1] = 2212; // proton - mode2[0][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); - - // Define the 2-body phase space decay for the Anti-H-Dibaryon - Int_t amode2[6][3]; - Float_t abratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio2[kz] = 0.; - amode2[kz][0] = 0; - amode2[kz][1] = 0; - amode2[kz][2] = 0; - } - abratio2[0] = 100.; - amode2[0][0] = -3122; // anti-deuteron - amode2[0][1] = -2212; // anti-proton - amode2[0][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); - - // Define the 2-body phase space decay for the Xi0P - Int_t mode5[6][3]; - Float_t bratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio5[kz] = 0.; - mode5[kz][0] = 0; - mode5[kz][1] = 0; - mode5[kz][2] = 0; - } - bratio5[0] = 100.; - mode5[0][0] = 3122; // Lambda - mode5[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); - - // Define the 2-body phase space decay for the Anti-Xi0P - Int_t amode5[6][3]; - Float_t abratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio5[kz] = 0.; - amode5[kz][0] = 0; - amode5[kz][1] = 0; - amode5[kz][2] = 0; - } - abratio5[0] = 100.; - amode5[0][0] = -3122; // anti-Lambda - amode5[0][1] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); - - // Define the 2-body phase space decay for the Lambda-Neutron-Neutron - Int_t mode6[6][3]; - Float_t bratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio6[kz] = 0.; - mode6[kz][0] = 0; - mode6[kz][1] = 0; - mode6[kz][2] = 0; - } - bratio6[0] = 100.; - mode6[0][0] = 1000010030; // triton - mode6[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); - - // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron - Int_t amode6[6][3]; - Float_t abratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio6[kz] = 0.; - amode6[kz][0] = 0; - amode6[kz][1] = 0; - amode6[kz][2] = 0; - } - abratio6[0] = 100.; - amode6[0][0] = -1000010030; // anti-triton - amode6[0][1] = 211; // pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); - - // Define the 3-body phase space decay for the Omega-Proton - Int_t mode7[6][3]; - Float_t bratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio7[kz] = 0.; - mode7[kz][0] = 0; - mode7[kz][1] = 0; - mode7[kz][2] = 0; - } - bratio7[0] = 100.; - mode7[0][0] = 3122; // Lambda - mode7[0][1] = -321; // negative Kaon - mode7[0][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); - - // Define the 3-body phase space decay for the Anti-Omega-Proton - Int_t amode7[6][3]; - Float_t abratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio7[kz] = 0.; - amode7[kz][0] = 0; - amode7[kz][1] = 0; - amode7[kz][2] = 0; - } - abratio7[0] = 100.; - amode7[0][0] = -3122; // anti-Lambda - amode7[0][1] = 321; // positive kaon - amode7[0][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); - - // Define the 2-body phase space decay for the Omega-Neutron - Int_t mode8[6][3]; - Float_t bratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio8[kz] = 0.; - mode8[kz][0] = 0; - mode8[kz][1] = 0; - mode8[kz][2] = 0; - } - bratio8[0] = 100.; - mode8[0][0] = 3122; // Lambda - mode8[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); - - // Define the 2-body phase space decay for the Anti-Omega-Neutron - Int_t amode8[6][3]; - Float_t abratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio8[kz] = 0.; - amode8[kz][0] = 0; - amode8[kz][1] = 0; - amode8[kz][2] = 0; - } - abratio8[0] = 100.; - amode8[0][0] = -3122; // anti-Lambda - amode8[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); - - // Define the 3-body phase space decay for the Omega-Omega - Int_t mode9[6][3]; - Float_t bratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio9[kz] = 0.; - mode9[kz][0] = 0; - mode9[kz][1] = 0; - mode9[kz][2] = 0; - } - bratio9[0] = 100.; - mode9[0][0] = 3334; // negative Omega - mode9[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); - - // Define the 3-body phase space decay for the Anti-Omega-Omega - Int_t amode9[6][3]; - Float_t abratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio9[kz] = 0.; - amode9[kz][0] = 0; - amode9[kz][1] = 0; - amode9[kz][2] = 0; - } - abratio9[0] = 100.; - amode9[0][0] = -3334; // positive Omega - amode9[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); - - // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton - Int_t mode10[6][3]; - Float_t bratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio10[kz] = 0.; - mode10[kz][0] = 0; - mode10[kz][1] = 0; - mode10[kz][2] = 0; - } - bratio10[0] = 50.; - mode10[0][0] = 3122; // Lambda - mode10[0][1] = 2212; // proton - bratio10[1] = 50.; - mode10[1][0] = 2212; // proton - mode10[1][1] = -321; // negative kaon - mode10[1][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); - - // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton - Int_t amode10[6][3]; - Float_t abratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio10[kz] = 0.; - amode10[kz][0] = 0; - amode10[kz][1] = 0; - amode10[kz][2] = 0; - } - abratio10[0] = 50.; - amode10[0][0] = -3122; // anti-Lambda - amode10[0][1] = -2212; // anti-proton - abratio10[1] = 50.; - amode10[1][0] = -2212; // anti-proton - amode10[1][1] = 321; // positive kaon - amode10[1][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); - - // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) - Int_t mode11[6][3]; - Float_t bratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio11[kz] = 0.; - mode11[kz][0] = 0; - mode11[kz][1] = 0; - mode11[kz][2] = 0; - } - bratio11[0] = 50.; - mode11[0][0] = 3122; // Lambda - mode11[0][1] = 3122; // Lambda - bratio11[1] = 50.; - mode11[1][0] = 3122; // Lambda - mode11[1][1] = 2212; // proton - mode11[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); - - // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) - Int_t amode11[6][3]; - Float_t abratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio11[kz] = 0.; - amode11[kz][0] = 0; - amode11[kz][1] = 0; - amode11[kz][2] = 0; - } - abratio11[0] = 50.; - amode11[0][0] = -3122; // anti-Lambda - amode11[0][1] = -3122; // anti-Lambda - abratio11[1] = 50.; - amode11[1][0] = -3122; // anti-Lambda - amode11[1][1] = -2212; // anti-proton - amode11[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); - - // Define the decays for the c-triton - Int_t ctmode[6][3]; - Float_t ctbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - ctbratio[kz] = 0.; - ctmode[kz][0] = 0; - ctmode[kz][1] = 0; - ctmode[kz][2] = 0; - } - ctbratio[0] = 50.; - ctmode[0][0] = 1000020030; // Helium3 - ctmode[0][1] = 310; // K0s - - ctbratio[1] = 50.; - ctmode[1][0] = 1000020030; // Helium3 - ctmode[1][1] = -321; // negative kaon - ctmode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); - - // Define the decays for the anti-c-triton - Int_t actmode[6][3]; - Float_t actbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - actbratio[kz] = 0.; - actmode[kz][0] = 0; - actmode[kz][1] = 0; - actmode[kz][2] = 0; - } - actbratio[0] = 50.; - actmode[0][0] = -1000020030; // Helium3 - actmode[0][1] = 310; // K0s - - actbratio[1] = 50.; - actmode[1][0] = -1000020030; // Helium3 - actmode[1][1] = 321; // negative kaon - actmode[1][2] = -211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); - - // Define the decays for the c-deuteron - Int_t cdmode[6][3]; - Float_t cdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - cdbratio[kz] = 0.; - cdmode[kz][0] = 0; - cdmode[kz][1] = 0; - cdmode[kz][2] = 0; - } - cdbratio[0] = 50.; - cdmode[0][0] = 1000010020; // deuteron - cdmode[0][1] = -321; // negative kaon - cdmode[0][2] = 211; // positive pion - - cdbratio[1] = 50.; - cdmode[1][0] = 1000010020; // deuteron - cdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); - - // Define the decays for the anti-c-deuteron - Int_t acdmode[6][3]; - Float_t acdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - acdbratio[kz] = 0.; - acdmode[kz][0] = 0; - acdmode[kz][1] = 0; - acdmode[kz][2] = 0; - } - acdbratio[0] = 50.; - acdmode[0][0] = -1000010020; // deuteron - acdmode[0][1] = 321; // negative kaon - acdmode[0][2] = -211; // positive pion - - acdbratio[1] = 50.; - acdmode[1][0] = -1000010020; // deuteron - acdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); - - /////////////////////////////////////////////////////////////////// - - // Define the 2-body phase space decay for the f0(980) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); - - // Define the 2-body phase space decay for the f2(1270) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); - - // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710 - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 310; // K0s - mode[0][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) - TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) - TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) - TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) - TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) - - // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - - bratio2[0] = 50.; - mode[0][0] = 310; // K0s - mode[0][1] = -321; // anti-K - mode[0][2] = 211; // pion+ - - bratio2[1] = 50.; - mode[1][0] = 310; // K0s - mode[1][1] = 321; // K - mode[1][2] = -211; // pion- - - TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) - TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) - - // Lambda1520/Lambda1520bar - - TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - - // Lambda1520 decay modes - Int_t lmode[9][3]; - Float_t lbratio[9]; - for (Int_t kz = 0; kz < 9; kz++) { - lbratio[kz] = 0.; - lmode[kz][0] = 0; - lmode[kz][1] = 0; - lmode[kz][2] = 0; - } - - // L(1520) -> p K- - lbratio[0] = 0.229944; - lmode[0][0] = 2212; - lmode[0][1] = -321; - - // L(1520) -> n K0 - lbratio[1] = 0.229944; - lmode[1][0] = 2112; - lmode[1][1] = -311; - - // L(1520) -> Sigma+ pi- - lbratio[2] = 0.143076; - lmode[2][0] = 3222; - lmode[2][1] = -211; - - // L(1520) -> Sigma0 pi0 - lbratio[3] = 0.143076; - lmode[3][0] = 3212; - lmode[3][1] = 111; - - // L(1520) -> Sigma- pi+ - lbratio[4] = 0.143076; - lmode[4][0] = 3112; - lmode[4][1] = 211; - - // L(1520) -> Sigma*- pi+ - lbratio[5] = 0.034066; - lmode[5][0] = 3114; - lmode[5][1] = 211; - - // L(1520) -> Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = 3214; - lmode[6][1] = 111; - - // L(1520) -> Sigma*+ pi- - lbratio[7] = 0.034066; - lmode[7][0] = 3224; - lmode[7][1] = -211; - - // L(1520) -> Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = 3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); - - // Lambda1520bar decay modes - - // L(1520)bar -> p- K+ - lbratio[0] = 0.229944; - lmode[0][0] = -2212; - lmode[0][1] = 321; - - // L(1520)bar -> nbar K0bar - lbratio[1] = 0.229944; - lmode[1][0] = -2112; - lmode[1][1] = 311; - - // L(1520)bar -> Sigmabar- pi+ - lbratio[2] = 0.143076; - lmode[2][0] = -3222; - lmode[2][1] = 211; - - // L(1520)bar -> Sigma0bar pi0 - lbratio[3] = 0.143076; - lmode[3][0] = -3212; - lmode[3][1] = 111; - - // L(1520)bar -> Sigmabar+ pi- - lbratio[4] = 0.143076; - lmode[4][0] = -3112; - lmode[4][1] = -211; - - // L(1520)bar -> anti-Sigma*- pi- - lbratio[5] = 0.034066; - lmode[5][0] = -3114; - lmode[5][1] = -211; - - // L(1520)bar -> anti-Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = -3214; - lmode[6][1] = 111; - - // L(1520)bar -> anti-Sigma*+ pi+ - lbratio[7] = 0.034066; - lmode[7][0] = -3224; - lmode[7][1] = 211; - - // L(1520)bar -> Anti-Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = -3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); - - // -------------------------------------------------------------------- - - //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) - TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, -2, kTRUE); - } - - void O2MCApplicationBase::AddParticles() - { - // dispatch first to function in FairRoot - FairMCApplication::AddParticles(); - - // register special particles for ALICE - // TODO: try to make use of FairRoot if easier or more customizable - addSpecialParticles(); - - auto& param = o2::conf::SimUserDecay::Instance(); - LOG(info) << "Printing \'SimUserDecay\' parameters"; - LOG(info) << param; - - // check if there are PDG codes requested for user decay - if (param.pdglist.empty()) { - return; - } - - // loop over PDG codes in the string - std::stringstream ss(param.pdglist); - int pdg; - while (ss >> pdg) { - LOG(info) << "Setting user decay for PDG " << pdg; - TVirtualMC::GetMC()->SetUserDecay(pdg); - } - } - - void O2MCApplicationBase::initTrackRefHook() - { - if (mCutParams.stepTrackRefHook) { - LOG(info) << "Initializing the hook for TrackReferences during stepping"; - auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); - if (std::filesystem::exists(expandedTrackRefHookFileName)) { - // if this file exists we will compile the hook on the fly - mTrackRefFcn = o2::conf::GetFromMacro(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook"); - LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; - } - else { - LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; - mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing - } - } - } - - void O2MCApplication::initLate() - { - o2::utils::ShmManager::Instance().occupySegment(); - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->initializeLate(); - } - } - } - - void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const - { - // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); - o2::base::attachTMessage(info, *mSimDataChannel, parts); - } - - // helper function to fetch data from FairRootManager branch and serialize it - // returns handle to container - template - const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts) - { - auto mgr = FairRootManager::Instance(); - // check if branch is present - if (mgr->GetBranchId(name) == -1) { - LOG(error) << "Branch " << name << " not found"; - return nullptr; - } - auto data = mgr->InitObjectAs(name.c_str()); - if (data) { - o2::base::attachTMessage(*data, channel, parts); - } - return data; - } - - void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) - { - mSubEventInfo = i; - // being communicated a SubEventInfo also means we get a FairMCEventHeader - fMCEventHeader = &mSubEventInfo->mMCEventHeader; - } - - void O2MCApplication::SendData() - { - fair::mq::Parts simdataparts; - - // fill these parts ... the receiver has to unpack similary - // TODO: actually we could just loop over branches in FairRootManager at this moment? - mSubEventInfo->npersistenttracks = static_cast(GetStack())->getMCTracks()->size(); - mSubEventInfo->nprimarytracks = static_cast(GetStack())->GetNprimary(); - attachSubEventInfo(simdataparts, *mSubEventInfo); - auto tracks = attachBranch>("MCTrack", *mSimDataChannel, simdataparts); - attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); - assert(tracks->size() == mSubEventInfo->npersistenttracks); - - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); - } - } - LOG(info) << "sending message with " << simdataparts.Size() << " parts"; - mSimDataChannel->Send(simdataparts); - } - } // namespace steer +namespace steer +{ +// helper function to send trivial data +template +void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts) +{ + static auto mgr = FairRootManager::Instance(); + auto vector = mgr->InitObjectAs*>(name); + if (vector) { + auto buffer = (char*)&(*vector)[0]; + auto buffersize = vector->size() * sizeof(T); + fair::mq::MessagePtr message(channel.NewMessage( + buffer, buffersize, + [](void* data, void* hint) {}, buffer)); + parts.AddPart(std::move(message)); + } +} + +void O2MCApplicationBase::Stepping() +{ + mStepCounter++; + + // check the max time of flight condition + const auto tof = fMC->TrackTime(); + auto& params = o2::GlobalProcessCutSimParam::Instance(); + if (tof > params.TOFMAX) { + fMC->StopTrack(); + return; + } + + mLongestTrackTime = std::max((double)mLongestTrackTime, tof); + + if (mCutParams.stepFiltering) { + // we can kill tracks here based on our + // custom detector specificities + + // Note that this is done in addition to the generic + // R + Z-cut mechanism at VMC level. + + float x, y, z; + fMC->TrackPosition(x, y, z); + + // this function is implementing a basic z-dependent R cut + // can be generalized later on + auto outOfR = [x, y, this](float z) { + // for the moment for cases when we have ZDC enabled + if (std::abs(z) > mCutParams.tunnelZ) { + if ((x * x + y * y) > mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { + return true; + } + } + return false; + }; + + if (z > mCutParams.ZmaxA || + -z > mCutParams.ZmaxC || + outOfR(z)) { + fMC->StopTrack(); + return; + } + } + + if (mCutParams.stepTrackRefHook) { + mTrackRefFcn(fMC); + } + + // dispatch now to stepping function in FairRoot + FairMCApplication::Stepping(); +} + +void O2MCApplicationBase::PreTrack() +{ + // dispatch first to function in FairRoot + FairMCApplication::PreTrack(); +} + +void O2MCApplicationBase::ConstructGeometry() +{ + // fill the mapping + mModIdToName.clear(); + o2::detectors::DetID::mask_t dmask{}; + for (int i = 0; i < fModules->GetEntries(); ++i) { + auto mod = static_cast(fModules->At(i)); + if (mod) { + mModIdToName[mod->GetModId()] = mod->GetName(); + int did = o2::detectors::DetID::nameToID(mod->GetName()); + if (did >= 0) { + dmask |= o2::detectors::DetID::getMask(did); + } + } + } + gGeoManager->SetUniqueID(dmask.to_ulong()); + FairMCApplication::ConstructGeometry(); + + std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); + // construct the volume name to module name mapping useful for StepAnalysis + auto vollist = gGeoManager->GetListOfVolumes(); + for (int i = 0; i < vollist->GetEntries(); ++i) { + auto vol = static_cast(vollist->At(i)); + auto iter = fModVolMap.find(vol->GetNumber()); + voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; + } +} + +void O2MCApplicationBase::InitGeometry() +{ + // load special cuts which might be given from the outside first. + auto& matMgr = o2::base::MaterialManager::Instance(); + matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); + matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); + // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module + FairMCApplication::InitGeometry(); + matMgr.writeCutsAndProcessesToJSON(); + // now the sensitive volumes are set up in fVolMap and we can query them + for (auto e : fVolMap) { + // since fVolMap contains multiple entries (if multiple copies), this may + // write to the same entry multiple times + mSensitiveVolumes[e.first] = e.second->GetName(); + } + std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); + for (auto e : mSensitiveVolumes) { + sensvolfile << e.first << ":" << e.second << "\n"; + } +} + +bool O2MCApplicationBase::MisalignGeometry() +{ + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->addAlignableVolumes(); + } + } + + // we stream out both unaligned geometry (to allow for + // dynamic post-alignment) as well as the aligned version + // which can be used by digitization etc. immediately + auto& confref = o2::conf::SimConfig::Instance(); + auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); + // since in general the geometry is a CCDB object, it must be exported under the standard name + gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); + gGeoManager->Export(geomfile.c_str()); + + // apply alignment for included detectors AFTER exporting ideal geometry + auto& aligner = o2::base::Aligner::Instance(); + aligner.applyAlignment(confref.getTimestamp()); + + // export aligned geometry into different file + auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); + gGeoManager->Export(alignedgeomfile.c_str()); + + auto& param = o2::GeometryManagerParam::Instance(); + + // fill parallel world geometry if activated + if (param.useParallelWorld) { + TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors"); + if (param.usePwGeoBVH) { + pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); + } + if (param.usePwCaching) { + TGeoNavigator::SetPWSafetyCaching(true); + } + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->fillParallelWorld(); + } + } + gGeoManager->SetUseParallelWorldNav(true); + } + + // return original return value of misalignment procedure + return true; +} + +void O2MCApplicationBase::finishEventCommon() +{ + LOG(info) << "This event/chunk did " << mStepCounter << " steps"; + LOG(info) << "Longest track time is " << mLongestTrackTime; + + auto header = static_cast(fMCEventHeader); + header->getMCEventStats().setNSteps(mStepCounter); + header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); + + static_cast(GetStack())->updateEventStats(); +} + +void O2MCApplicationBase::FinishEvent() +{ + finishEventCommon(); + + auto header = static_cast(fMCEventHeader); + auto& confref = o2::conf::SimConfig::Instance(); + + if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { + LOG(info) << "Discarding current event due to no hits"; + SetSaveCurrentEvent(false); + } + + // dispatch to function in FairRoot + FairMCApplication::FinishEvent(); +} + +void O2MCApplicationBase::BeginEvent() +{ + // dispatch first to function in FairRoot + FairMCApplication::BeginEvent(); + + // register event header with our stack + auto header = static_cast(fMCEventHeader); + static_cast(GetStack())->setMCEventStats(&header->getMCEventStats()); + + mStepCounter = 0; + mLongestTrackTime = 0; +} + +void addSpecialParticles() +{ + // + // Add particles needed for ALICE (not present in Geant3 or Geant4) + // Code ported 1-1 from AliRoot + // + + LOG(info) << "Adding custom particles to VMC"; + + // ### NUCLEI ### + // 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); + + // ### HYPER NUCLEI (|S| = 1) ### + //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); + + //Hyper hydrogen 4 + 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 + 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 + 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 + 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); + + //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); + + // ### HYPER NUCLEI (|S| = 2) ### + //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); + + //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); + //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); + + // 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); + + // ### EXOTICA ### + //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); + + //Anti-Lambda-Neutron + TVirtualMC::GetMC()->DefineParticle(-1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Xi-Proton + 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); + + //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); + + //Anti-Lambda-Neutron-Neutron + TVirtualMC::GetMC()->DefineParticle(-1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + + //Omega-Proton + TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-Omega-Proton + TVirtualMC::GetMC()->DefineParticle(-1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Omega-Neutron + 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); + + //Omega-Omega + TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Anti-Omega-Omega + TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //Lambda(1405)-Proton + 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); + + //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); + + //Anti-Lambda(1405)-Lambda(1405) + TVirtualMC::GetMC()->DefineParticle(-1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + //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); + + //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); + + //Resonances not in Generators + // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) + TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // f2(1270) (PDG: width = 185 MeV) + TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); + // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); + + // Glueball hunting family + // Their life times are not known, so we set them to 1e-24 + // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) + TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, 0, 0, kTRUE); + // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); + // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, 0, 0, kTRUE); + + // Xi_0(1820) + TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); + + int xi_0_1820_mode[6][3] = {{0}}; + float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + xi_0_1820_mode[0][0] = 3122; // Lambda + xi_0_1820_mode[0][1] = 310; // K0s + TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); + xi_0_1820_mode[0][0] = -3122; // Lambda-bar + TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); + + // Xi-+(1820) + TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, 1.8234, -1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, 1.8234, 1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); + + int xi_charged_1820_mode[6][3] = {{0}}; + float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + xi_charged_1820_mode[0][0] = 3122; // Lambda + xi_charged_1820_mode[0][1] = -321; // K- + TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode); + xi_charged_1820_mode[0][0] = -3122; // Lambda-bar + xi_charged_1820_mode[0][1] = 321; // K+ + TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode); + + // Ps - hidden strange (s-sbar) pentaquarks + TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE); + + Int_t psmode[6][3] = {0}; + Float_t psratio[6] = {0.f}; + psratio[0] = 100.; + + psmode[0][0] = 333; // phi + psmode[0][1] = 2212; // proton + TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); + + psmode[0][1] = -2212; // anti-proton + TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); + + //Omega(2012) + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + + TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + psmode[0][0] = 3312; // Xi- + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); + + TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, 0, 0, 0, 0, 0, -1, kTRUE); + psmode[0][0] = -3312; // anti-Xi+ + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); + + // d*(2380) - dibaryon resonance + TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE); + + Int_t dstmode[6][3] = {0}; + Float_t dstratio[6] = {0.f}; + dstratio[0] = 100; // For now we implement only the mode of interest + // d* -> d pi+ pi- + dstmode[0][0] = 1000010020; // deuteron + dstmode[0][1] = -211; // negative pion + dstmode[0][2] = 211; // positive pion + TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); + + dstmode[0][0] = -1000010020; // anti-deuteron + TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); + + // Heavy vector mesons + // D*+ + TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*- + TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*0 + TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*0bar + TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*_s+ + TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // D*_s- + TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*0 + TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*0bar + TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*+ + TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*- + TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_s0 + TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_s0bar + TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_c+ + TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + // B*_c- + TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); + + // Charm pentaquarks + // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) + TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, 1, kTRUE); + + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + psmode[0][0] = 413; // D*+ + psmode[0][1] = -2212; // anti-p + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); + psmode[0][0] = -413; // D*- + psmode[0][1] = 2212; // p + TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); + + // Define the 2-body phase space decay for the Lithium 4 + Int_t model4[6][3]; + Float_t bratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratiol4[kz] = 0.; + model4[kz][0] = 0; + model4[kz][1] = 0; + model4[kz][2] = 0; + } + bratiol4[0] = 100.; + model4[0][0] = 1000020030; // Helium3 + model4[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); + + // Define the 2-body phase space decay for the Anti-Lithium 4 + Int_t amodel4[6][3]; + Float_t abratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratiol4[kz] = 0.; + amodel4[kz][0] = 0; + amodel4[kz][1] = 0; + amodel4[kz][2] = 0; + } + abratiol4[0] = 100.; + amodel4[0][0] = -1000020030; // Anti-Helium3 + amodel4[0][1] = -2212; // Anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); + + // Define the 2- and 3-body phase space decay for the Hypertriton + Int_t mode[6][3]; + Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 50.; + mode[0][0] = 1000020030; // Helium3 + mode[0][1] = -211; // negative pion + + bratio[1] = 50.; + mode[1][0] = 1000010020; // deuteron + mode[1][1] = 2212; // proton + mode[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); + + // Define the 2- and 3-body phase space decay for the Anti-Hypertriton + Int_t amode[6][3]; + Float_t abratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio[kz] = 0.; + amode[kz][0] = 0; + amode[kz][1] = 0; + amode[kz][2] = 0; + } + abratio[0] = 50.; + amode[0][0] = -1000020030; // anti- Helium3 + amode[0][1] = 211; // positive pion + abratio[1] = 50.; + amode[1][0] = -1000010020; // anti-deuteron + amode[1][1] = -2212; // anti-proton + amode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); + + ////// ----------Hypernuclei with Mass=4 ----------- ////////// + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + + Int_t mode3[6][3]; + Float_t bratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio3[kz] = 0.; + mode3[kz][0] = 0; + mode3[kz][1] = 0; + mode3[kz][2] = 0; + } + bratio3[0] = 50.; + mode3[0][0] = 1000020040; // Helium4 + mode3[0][1] = -211; // negative pion + + bratio3[1] = 50.; + mode3[1][0] = 1000010030; // tritium + mode3[1][1] = 2212; // proton + mode3[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + Int_t amode3[6][3]; + Float_t abratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio3[kz] = 0.; + amode3[kz][0] = 0; + amode3[kz][1] = 0; + amode3[kz][2] = 0; + } + abratio3[0] = 50.; + amode3[0][0] = -1000020040; // anti- Helium4 + amode3[0][1] = 211; // positive pion + abratio3[1] = 50.; + amode3[1][0] = -1000010030; // anti-tritium + amode3[1][1] = -2212; // anti-proton + amode3[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); + + // Define the 3-body phase space decay for the Hyperhelium 4 + Int_t mode4[6][3]; + Float_t bratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4[kz] = 0.; + mode4[kz][0] = 0; + mode4[kz][1] = 0; + mode4[kz][2] = 0; + } + bratio4[0] = 50.; + mode4[0][0] = 1000020030; // Helium3 + mode4[0][1] = -211; // negative pion + mode4[0][2] = 2212; // proton + + bratio4[1] = 50.; + mode4[1][0] = 1000030040; // lithium-4 + mode4[1][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 4 + Int_t amode4[6][3]; + Float_t abratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4[kz] = 0.; + amode4[kz][0] = 0; + amode4[kz][1] = 0; + amode4[kz][2] = 0; + } + abratio4[0] = 50.; + amode4[0][0] = -1000020030; // anti-Helium 3 + amode4[0][1] = 211; // positive pion + amode4[0][2] = -2212; // anti proton + + abratio4[1] = 50.; + amode4[1][0] = -1000030040; // antilithium-4 + amode4[1][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); + + // Define the 3-body phase space decay for the Hyperhelium 5 + Int_t mode41[6][3]; + Float_t bratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio41[kz] = 0.; + mode41[kz][0] = 0; + mode41[kz][1] = 0; + mode41[kz][2] = 0; + } + bratio41[0] = 50.; + mode41[0][0] = 1000020040; // Helium4 + mode41[0][1] = -211; // negative pion + mode41[0][2] = 2212; // proton + bratio41[1] = 50.; + mode41[1][0] = 1000020030; // Helium3 + mode41[1][1] = -211; // negative pion + mode41[1][2] = 1000010020; // Deuteron + + TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 5 + Int_t amode41[6][3]; + Float_t abratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio41[kz] = 0.; + amode41[kz][0] = 0; + amode41[kz][1] = 0; + amode41[kz][2] = 0; + } + abratio41[0] = 50.; + amode41[0][0] = -1000020040; // anti-Helium 4 + amode41[0][1] = 211; // positive pion + amode41[0][2] = -2212; // anti proton + abratio41[1] = 50.; + amode41[1][0] = -1000020030; // anti-Helium 3 + amode41[1][1] = 211; // positive pion + amode41[1][2] = -1000010020; // anti deuteron + + TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); + + // Define the 3-body phase space decay for the Doublehyperhydrogen 4 + Int_t mode42[6][3]; + Float_t bratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio42[kz] = 0.; + mode42[kz][0] = 0; + mode42[kz][1] = 0; + mode42[kz][2] = 0; + } + bratio42[0] = 50.; + mode42[0][0] = 1010020040; // Hyper-Helium4 + mode42[0][1] = -211; // negative pion + bratio42[1] = 50.; + mode42[1][0] = 1010010030; // Hypertriton + mode42[1][1] = 2212; // proton + mode42[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); + + + // Define the 2-body phase space decay for the Anti-Doublehyperhydrogen 4 + Int_t amode42[6][3]; + Float_t abratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio42[kz] = 0.; + amode42[kz][0] = 0; + amode42[kz][1] = 0; + amode42[kz][2] = 0; + } + abratio42[0] = 100.; + amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 + amode42[0][1] = 211; // positive pion + abratio42[1] = 50.; + amode42[1][0] = -1010010030; // anti-Hypertriton + amode42[1][1] = -2212; // antiproton + amode42[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); + + // Define the decay for the 4Xi(-)He + Int_t mode4XiHe[6][3]; + Float_t bratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiHe[kz] = 0.; + mode4XiHe[kz][0] = 0; + mode4XiHe[kz][1] = 0; + mode4XiHe[kz][2] = 0; + } + bratio4XiHe[0] = 33.; + mode4XiHe[0][0] = 1010020040; // HyperHelium4 + mode4XiHe[0][1] = -211; // negative pion + + bratio4XiHe[1] = 33.; + mode4XiHe[1][0] = 3122; // lambda + mode4XiHe[1][1] = 1000020030; // helium-3 + mode4XiHe[1][2] = -211; // negative pion + + bratio4XiHe[2] = 33.; + mode4XiHe[2][0] = 1000030040; // lithium-4 + mode4XiHe[2][1] = -211; // negative pion + mode4XiHe[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe); + + // Define the decay for the Anti-4Xi(-)He + Int_t amode4XiHe[6][3]; + Float_t abratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiHe[kz] = 0.; + amode4XiHe[kz][0] = 0; + amode4XiHe[kz][1] = 0; + amode4XiHe[kz][2] = 0; + } + abratio4XiHe[0] = 33.; + amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4 + amode4XiHe[0][1] = 211; // positive pion + + abratio4XiHe[1] = 33.; + amode4XiHe[1][0] = -3122; // antilambda + amode4XiHe[1][1] = -1000020030; // antihelium-3 + amode4XiHe[1][2] = 211; // positive pion + + abratio4XiHe[2] = 33.; + amode4XiHe[2][0] = -1000030040; // antilithium-4 + amode4XiHe[2][1] = 211; // positive pion + amode4XiHe[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe); + + // Define the decay for the 4Xi(-)H + Int_t mode4XiH[6][3]; + Float_t bratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiH[kz] = 0.; + mode4XiH[kz][0] = 0; + mode4XiH[kz][1] = 0; + mode4XiH[kz][2] = 0; + } + bratio4XiH[0] = 33.; + mode4XiH[0][0] = 1010010040; // HyperHydrogen4 + mode4XiH[0][1] = -211; // negative pion + + bratio4XiH[1] = 33.; + mode4XiH[1][0] = 3122; // lambda + mode4XiH[1][1] = 1000010030; // triton + mode4XiH[1][2] = -211; // negative pion + + bratio4XiH[2] = 33.; + mode4XiH[2][0] = 1000020040; // alpha + mode4XiH[2][1] = -211; // negative pion + mode4XiH[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH); + + // Define the decay for the Anti-4Xi(-)H + Int_t amode4XiH[6][3]; + Float_t abratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiH[kz] = 0.; + amode4XiH[kz][0] = 0; + amode4XiH[kz][1] = 0; + amode4XiH[kz][2] = 0; + } + abratio4XiH[0] = 33.; + amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4 + amode4XiH[0][1] = 211; // positive pion + + abratio4XiH[1] = 33.; + amode4XiH[1][0] = -3122; // antilambda + amode4XiH[1][1] = -1000010030; // antitriton + amode4XiH[1][2] = 211; // positive pion + + abratio4XiH[2] = 33.; + amode4XiH[2][0] = -1000020040; // antialpha + amode4XiH[2][1] = 211; // positive pion + amode4XiH[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH); + + // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma + Int_t mode4s[6][3]; + Float_t bratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4s[kz] = 0.; + mode4s[kz][0] = 0; + mode4s[kz][1] = 0; + mode4s[kz][2] = 0; + } + bratio4s[0] = 20.; + mode4s[0][0] = 1000020040; // Helium4 + mode4s[0][1] = 111; // pion0 + bratio4s[1] = 40.; + mode4s[1][0] = 1000010030; // tritium + mode4s[1][2] = 2212; // proton + mode4s[1][1] = 111; // pion0 + bratio4s[2] = 40.; + mode4s[2][0] = 1000010030; // tritium + mode4s[2][2] = 2212; // pion+ + mode4s[2][1] = 2112; // neutron + + TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); + + // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma + Int_t amode4s[6][3]; + Float_t abratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4s[kz] = 0.; + amode4s[kz][0] = 0; + amode4s[kz][1] = 0; + amode4s[kz][2] = 0; + } + abratio4s[0] = 50.; + amode4s[0][0] = -1000020040; // anti-Helium4 + amode4s[0][1] = 111; // pion0 + abratio4s[1] = 50.; + amode4s[1][0] = -1000010030; // anti-tritium + amode4s[1][2] = -2212; // anti-proton + amode4s[1][1] = 111; // pion0 + abratio4s[2] = 50.; + amode4s[2][0] = -1000010030; // anti-tritium + amode4s[2][2] = -211; // pion- + amode4s[2][1] = -2112; // anti-neutron + + TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); + + // Define the 2-body phase space decay for the Lambda-neutron boundstate + Int_t mode1[6][3]; + Float_t bratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio1[kz] = 0.; + mode1[kz][0] = 0; + mode1[kz][1] = 0; + mode1[kz][2] = 0; + } + bratio1[0] = 100.; + mode1[0][0] = 1000010020; // deuteron + mode1[0][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); + + // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate + Int_t amode1[6][3]; + Float_t abratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio1[kz] = 0.; + amode1[kz][0] = 0; + amode1[kz][1] = 0; + amode1[kz][2] = 0; + } + abratio1[0] = 100.; + amode1[0][0] = -1000010020; // anti-deuteron + amode1[0][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); + + // Define the 2-body phase space decay for the H-Dibaryon + Int_t mode2[6][3]; + Float_t bratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio2[kz] = 0.; + mode2[kz][0] = 0; + mode2[kz][1] = 0; + mode2[kz][2] = 0; + } + bratio2[0] = 100.; + mode2[0][0] = 3122; // Lambda + mode2[0][1] = 2212; // proton + mode2[0][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); + + // Define the 2-body phase space decay for the Anti-H-Dibaryon + Int_t amode2[6][3]; + Float_t abratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio2[kz] = 0.; + amode2[kz][0] = 0; + amode2[kz][1] = 0; + amode2[kz][2] = 0; + } + abratio2[0] = 100.; + amode2[0][0] = -3122; // anti-deuteron + amode2[0][1] = -2212; // anti-proton + amode2[0][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); + + // Define the 2-body phase space decay for the Xi0P + Int_t mode5[6][3]; + Float_t bratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio5[kz] = 0.; + mode5[kz][0] = 0; + mode5[kz][1] = 0; + mode5[kz][2] = 0; + } + bratio5[0] = 100.; + mode5[0][0] = 3122; // Lambda + mode5[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); + + // Define the 2-body phase space decay for the Anti-Xi0P + Int_t amode5[6][3]; + Float_t abratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio5[kz] = 0.; + amode5[kz][0] = 0; + amode5[kz][1] = 0; + amode5[kz][2] = 0; + } + abratio5[0] = 100.; + amode5[0][0] = -3122; // anti-Lambda + amode5[0][1] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); + + // Define the 2-body phase space decay for the Lambda-Neutron-Neutron + Int_t mode6[6][3]; + Float_t bratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio6[kz] = 0.; + mode6[kz][0] = 0; + mode6[kz][1] = 0; + mode6[kz][2] = 0; + } + bratio6[0] = 100.; + mode6[0][0] = 1000010030; // triton + mode6[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); + + // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron + Int_t amode6[6][3]; + Float_t abratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio6[kz] = 0.; + amode6[kz][0] = 0; + amode6[kz][1] = 0; + amode6[kz][2] = 0; + } + abratio6[0] = 100.; + amode6[0][0] = -1000010030; // anti-triton + amode6[0][1] = 211; // pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); + + // Define the 3-body phase space decay for the Omega-Proton + Int_t mode7[6][3]; + Float_t bratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio7[kz] = 0.; + mode7[kz][0] = 0; + mode7[kz][1] = 0; + mode7[kz][2] = 0; + } + bratio7[0] = 100.; + mode7[0][0] = 3122; // Lambda + mode7[0][1] = -321; // negative Kaon + mode7[0][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); + + // Define the 3-body phase space decay for the Anti-Omega-Proton + Int_t amode7[6][3]; + Float_t abratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio7[kz] = 0.; + amode7[kz][0] = 0; + amode7[kz][1] = 0; + amode7[kz][2] = 0; + } + abratio7[0] = 100.; + amode7[0][0] = -3122; // anti-Lambda + amode7[0][1] = 321; // positive kaon + amode7[0][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); + + // Define the 2-body phase space decay for the Omega-Neutron + Int_t mode8[6][3]; + Float_t bratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio8[kz] = 0.; + mode8[kz][0] = 0; + mode8[kz][1] = 0; + mode8[kz][2] = 0; + } + bratio8[0] = 100.; + mode8[0][0] = 3122; // Lambda + mode8[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); + + // Define the 2-body phase space decay for the Anti-Omega-Neutron + Int_t amode8[6][3]; + Float_t abratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio8[kz] = 0.; + amode8[kz][0] = 0; + amode8[kz][1] = 0; + amode8[kz][2] = 0; + } + abratio8[0] = 100.; + amode8[0][0] = -3122; // anti-Lambda + amode8[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); + + // Define the 3-body phase space decay for the Omega-Omega + Int_t mode9[6][3]; + Float_t bratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio9[kz] = 0.; + mode9[kz][0] = 0; + mode9[kz][1] = 0; + mode9[kz][2] = 0; + } + bratio9[0] = 100.; + mode9[0][0] = 3334; // negative Omega + mode9[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); + + // Define the 3-body phase space decay for the Anti-Omega-Omega + Int_t amode9[6][3]; + Float_t abratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio9[kz] = 0.; + amode9[kz][0] = 0; + amode9[kz][1] = 0; + amode9[kz][2] = 0; + } + abratio9[0] = 100.; + amode9[0][0] = -3334; // positive Omega + amode9[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); + + // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton + Int_t mode10[6][3]; + Float_t bratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio10[kz] = 0.; + mode10[kz][0] = 0; + mode10[kz][1] = 0; + mode10[kz][2] = 0; + } + bratio10[0] = 50.; + mode10[0][0] = 3122; // Lambda + mode10[0][1] = 2212; // proton + bratio10[1] = 50.; + mode10[1][0] = 2212; // proton + mode10[1][1] = -321; // negative kaon + mode10[1][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); + + // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton + Int_t amode10[6][3]; + Float_t abratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio10[kz] = 0.; + amode10[kz][0] = 0; + amode10[kz][1] = 0; + amode10[kz][2] = 0; + } + abratio10[0] = 50.; + amode10[0][0] = -3122; // anti-Lambda + amode10[0][1] = -2212; // anti-proton + abratio10[1] = 50.; + amode10[1][0] = -2212; // anti-proton + amode10[1][1] = 321; // positive kaon + amode10[1][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); + + // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) + Int_t mode11[6][3]; + Float_t bratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio11[kz] = 0.; + mode11[kz][0] = 0; + mode11[kz][1] = 0; + mode11[kz][2] = 0; + } + bratio11[0] = 50.; + mode11[0][0] = 3122; // Lambda + mode11[0][1] = 3122; // Lambda + bratio11[1] = 50.; + mode11[1][0] = 3122; // Lambda + mode11[1][1] = 2212; // proton + mode11[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); + + // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) + Int_t amode11[6][3]; + Float_t abratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio11[kz] = 0.; + amode11[kz][0] = 0; + amode11[kz][1] = 0; + amode11[kz][2] = 0; + } + abratio11[0] = 50.; + amode11[0][0] = -3122; // anti-Lambda + amode11[0][1] = -3122; // anti-Lambda + abratio11[1] = 50.; + amode11[1][0] = -3122; // anti-Lambda + amode11[1][1] = -2212; // anti-proton + amode11[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); + + // Define the decays for the c-triton + Int_t ctmode[6][3]; + Float_t ctbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + ctbratio[kz] = 0.; + ctmode[kz][0] = 0; + ctmode[kz][1] = 0; + ctmode[kz][2] = 0; + } + ctbratio[0] = 50.; + ctmode[0][0] = 1000020030; // Helium3 + ctmode[0][1] = 310; // K0s + + ctbratio[1] = 50.; + ctmode[1][0] = 1000020030; // Helium3 + ctmode[1][1] = -321; // negative kaon + ctmode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); + + // Define the decays for the anti-c-triton + Int_t actmode[6][3]; + Float_t actbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + actbratio[kz] = 0.; + actmode[kz][0] = 0; + actmode[kz][1] = 0; + actmode[kz][2] = 0; + } + actbratio[0] = 50.; + actmode[0][0] = -1000020030; // Helium3 + actmode[0][1] = 310; // K0s + + actbratio[1] = 50.; + actmode[1][0] = -1000020030; // Helium3 + actmode[1][1] = 321; // negative kaon + actmode[1][2] = -211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); + + // Define the decays for the c-deuteron + Int_t cdmode[6][3]; + Float_t cdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + cdbratio[kz] = 0.; + cdmode[kz][0] = 0; + cdmode[kz][1] = 0; + cdmode[kz][2] = 0; + } + cdbratio[0] = 50.; + cdmode[0][0] = 1000010020; // deuteron + cdmode[0][1] = -321; // negative kaon + cdmode[0][2] = 211; // positive pion + + cdbratio[1] = 50.; + cdmode[1][0] = 1000010020; // deuteron + cdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); + + // Define the decays for the anti-c-deuteron + Int_t acdmode[6][3]; + Float_t acdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + acdbratio[kz] = 0.; + acdmode[kz][0] = 0; + acdmode[kz][1] = 0; + acdmode[kz][2] = 0; + } + acdbratio[0] = 50.; + acdmode[0][0] = -1000010020; // deuteron + acdmode[0][1] = 321; // negative kaon + acdmode[0][2] = -211; // positive pion + + acdbratio[1] = 50.; + acdmode[1][0] = -1000010020; // deuteron + acdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); + + /////////////////////////////////////////////////////////////////// + + // Define the 2-body phase space decay for the f0(980) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); + + // Define the 2-body phase space decay for the f2(1270) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); + + // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710 + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 310; // K0s + mode[0][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) + TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) + TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) + TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) + TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) + + // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + + bratio2[0] = 50.; + mode[0][0] = 310; // K0s + mode[0][1] = -321; // anti-K + mode[0][2] = 211; // pion+ + + bratio2[1] = 50.; + mode[1][0] = 310; // K0s + mode[1][1] = 321; // K + mode[1][2] = -211; // pion- + + TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) + TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) + + // Lambda1520/Lambda1520bar + + TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); + + // Lambda1520 decay modes + Int_t lmode[9][3]; + Float_t lbratio[9]; + for (Int_t kz = 0; kz < 9; kz++) { + lbratio[kz] = 0.; + lmode[kz][0] = 0; + lmode[kz][1] = 0; + lmode[kz][2] = 0; + } + + // L(1520) -> p K- + lbratio[0] = 0.229944; + lmode[0][0] = 2212; + lmode[0][1] = -321; + + // L(1520) -> n K0 + lbratio[1] = 0.229944; + lmode[1][0] = 2112; + lmode[1][1] = -311; + + // L(1520) -> Sigma+ pi- + lbratio[2] = 0.143076; + lmode[2][0] = 3222; + lmode[2][1] = -211; + + // L(1520) -> Sigma0 pi0 + lbratio[3] = 0.143076; + lmode[3][0] = 3212; + lmode[3][1] = 111; + + // L(1520) -> Sigma- pi+ + lbratio[4] = 0.143076; + lmode[4][0] = 3112; + lmode[4][1] = 211; + + // L(1520) -> Sigma*- pi+ + lbratio[5] = 0.034066; + lmode[5][0] = 3114; + lmode[5][1] = 211; + + // L(1520) -> Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = 3214; + lmode[6][1] = 111; + + // L(1520) -> Sigma*+ pi- + lbratio[7] = 0.034066; + lmode[7][0] = 3224; + lmode[7][1] = -211; + + // L(1520) -> Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = 3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); + + // Lambda1520bar decay modes + + // L(1520)bar -> p- K+ + lbratio[0] = 0.229944; + lmode[0][0] = -2212; + lmode[0][1] = 321; + + // L(1520)bar -> nbar K0bar + lbratio[1] = 0.229944; + lmode[1][0] = -2112; + lmode[1][1] = 311; + + // L(1520)bar -> Sigmabar- pi+ + lbratio[2] = 0.143076; + lmode[2][0] = -3222; + lmode[2][1] = 211; + + // L(1520)bar -> Sigma0bar pi0 + lbratio[3] = 0.143076; + lmode[3][0] = -3212; + lmode[3][1] = 111; + + // L(1520)bar -> Sigmabar+ pi- + lbratio[4] = 0.143076; + lmode[4][0] = -3112; + lmode[4][1] = -211; + + // L(1520)bar -> anti-Sigma*- pi- + lbratio[5] = 0.034066; + lmode[5][0] = -3114; + lmode[5][1] = -211; + + // L(1520)bar -> anti-Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = -3214; + lmode[6][1] = 111; + + // L(1520)bar -> anti-Sigma*+ pi+ + lbratio[7] = 0.034066; + lmode[7][0] = -3224; + lmode[7][1] = 211; + + // L(1520)bar -> Anti-Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = -3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); + + // -------------------------------------------------------------------- + + //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) + TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, -2, kTRUE); +} + +void O2MCApplicationBase::AddParticles() +{ + // dispatch first to function in FairRoot + FairMCApplication::AddParticles(); + + // register special particles for ALICE + // TODO: try to make use of FairRoot if easier or more customizable + addSpecialParticles(); + + auto& param = o2::conf::SimUserDecay::Instance(); + LOG(info) << "Printing \'SimUserDecay\' parameters"; + LOG(info) << param; + + // check if there are PDG codes requested for user decay + if (param.pdglist.empty()) { + return; + } + + // loop over PDG codes in the string + std::stringstream ss(param.pdglist); + int pdg; + while (ss >> pdg) { + LOG(info) << "Setting user decay for PDG " << pdg; + TVirtualMC::GetMC()->SetUserDecay(pdg); + } +} + +void O2MCApplicationBase::initTrackRefHook() +{ + if (mCutParams.stepTrackRefHook) { + LOG(info) << "Initializing the hook for TrackReferences during stepping"; + auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); + if (std::filesystem::exists(expandedTrackRefHookFileName)) { + // if this file exists we will compile the hook on the fly + mTrackRefFcn = o2::conf::GetFromMacro(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook"); + LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; + } else { + LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; + mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing + } + } +} + +void O2MCApplication::initLate() +{ + o2::utils::ShmManager::Instance().occupySegment(); + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->initializeLate(); + } + } +} + +void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const +{ + // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); + o2::base::attachTMessage(info, *mSimDataChannel, parts); +} + +// helper function to fetch data from FairRootManager branch and serialize it +// returns handle to container +template +const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts) +{ + auto mgr = FairRootManager::Instance(); + // check if branch is present + if (mgr->GetBranchId(name) == -1) { + LOG(error) << "Branch " << name << " not found"; + return nullptr; + } + auto data = mgr->InitObjectAs(name.c_str()); + if (data) { + o2::base::attachTMessage(*data, channel, parts); + } + return data; +} + +void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) +{ + mSubEventInfo = i; + // being communicated a SubEventInfo also means we get a FairMCEventHeader + fMCEventHeader = &mSubEventInfo->mMCEventHeader; +} + +void O2MCApplication::SendData() +{ + fair::mq::Parts simdataparts; + + // fill these parts ... the receiver has to unpack similary + // TODO: actually we could just loop over branches in FairRootManager at this moment? + mSubEventInfo->npersistenttracks = static_cast(GetStack())->getMCTracks()->size(); + mSubEventInfo->nprimarytracks = static_cast(GetStack())->GetNprimary(); + attachSubEventInfo(simdataparts, *mSubEventInfo); + auto tracks = attachBranch>("MCTrack", *mSimDataChannel, simdataparts); + attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); + assert(tracks->size() == mSubEventInfo->npersistenttracks); + + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); + } + } + LOG(info) << "sending message with " << simdataparts.Size() << " parts"; + mSimDataChannel->Send(simdataparts); +} +} // namespace steer } // namespace o2 From db0d2bde09b3bfc31f1b53be78f3ecf1df2f7eeb Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:34:10 +0100 Subject: [PATCH 04/15] Delete DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h --- .../SimulationDataFormat/O2DatabasePDG.h | 690 ------------------ 1 file changed, 690 deletions(-) delete mode 100644 DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h deleted file mode 100644 index b6e008ae11e80..0000000000000 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ /dev/null @@ -1,690 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -// -// Created by Sandro Wenzel on 11.08.22. -// - -#ifndef O2_O2DATABASEPDG_H -#define O2_O2DATABASEPDG_H - -#include -#include "TDatabasePDG.h" -#include "TParticlePDG.h" - -namespace o2 -{ - -// An ALICE specific extension of ROOT's TDatabasePDG -// -// By using O2DatabasePDG::Instance() in our code instead of TDatabasePDG::Instance(), correct initialization -// is guaranteed. Alternatively, a static function is exposed with which particles can be added to TDatabasePDG objects -// directly. -class O2DatabasePDG -{ - // - public: - static TDatabasePDG* Instance() - { - static bool initialized = false; // initialize this --> adds particles to TDatabasePDG; - auto db = TDatabasePDG::Instance(); - if (!initialized) { - addALICEParticles(db); - initialized = true; - } - return db; - } - - // adds ALICE particles to a given TDatabasePDG instance - static void addALICEParticles(TDatabasePDG* db = TDatabasePDG::Instance()); - static void addParticlesFromExternalFile(TDatabasePDG* db); - - // get particle's (if any) mass - static Double_t MassImpl(TParticlePDG* particle, bool& success) - { - success = false; - if (!particle) { - return -1.; - } - success = true; - return particle->Mass(); - } - - // determine particle to get mass for based on PDG - static Double_t Mass(int pdg, bool& success, TDatabasePDG* db = O2DatabasePDG::Instance()) - { - if (pdg < IONBASELOW || pdg > IONBASEHIGH) { - // not an ion, return immediately - return MassImpl(db->GetParticle(pdg), success); - } - if (auto particle = db->GetParticle(pdg)) { - // see if this ion can be found - return MassImpl(particle, success); - } - // if we are here, try one last time to look for ground state of potential isomere state - pdg = pdg / 10 * 10; - return MassImpl(db->GetParticle(pdg), success); - } - - // remove default constructor - O2DatabasePDG() = delete; - - private: - static constexpr int IONBASELOW{1000000000}; - static constexpr int IONBASEHIGH{1099999999}; -}; - -// by keeping this inline, we can use it in other parts of the code, for instance Framework or Analysis, -// without needing to link against this library -inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) -{ - // - // Add ALICE particles to the ROOT PDG data base - // Code has been taken from AliRoot - const Int_t kspe = 50000000; - - // PDG nuclear states are 10-digit numbers - // 10LZZZAAAI e.g. deuteron is - // 1000010020 - const Int_t kion = 1000000000; - - /* - const Double_t kAu2Gev=0.9314943228; -*/ - - const Double_t khSlash = 1.0545726663e-27; - const Double_t kErg2Gev = 1 / 1.6021773349e-3; - const Double_t khShGev = khSlash * kErg2Gev; - const Double_t kYear2Sec = 3600 * 24 * 365.25; - - // Heavy-flavour particles - - // χc1(3872) aka X(3872), taken from PDG 2022 (https://pdg.lbl.gov/2022/listings/rpp2022-list-chi-c1-3872.pdf) - db->AddParticle("Chi_c1(3872)", "Chi_c1(3872)", 3.87165, kFALSE, 0, 0, "CCBarMeson", 9920443); - - // - // Bottom mesons - // mass and life-time from PDG - // - db->AddParticle("Upsilon(3S)", "Upsilon(3S)", 10.3552, kTRUE, - 0, 0, "Bottonium", 200553); - - // QCD diffractive states - db->AddParticle("rho_diff0", "rho_diff0", 0, kTRUE, - 0, 0, "QCD diffr. state", 9900110); - db->AddParticle("pi_diffr+", "pi_diffr+", 0, kTRUE, - 0, 3, "QCD diffr. state", 9900210); - db->AddParticle("omega_di", "omega_di", 0, kTRUE, - 0, 0, "QCD diffr. state", 9900220); - db->AddParticle("phi_diff", "phi_diff", 0, kTRUE, - 0, 0, "QCD diffr. state", 9900330); - db->AddParticle("J/psi_di", "J/psi_di", 0, kTRUE, - 0, 0, "QCD diffr. state", 9900440); - db->AddParticle("n_diffr0", "n_diffr0", 0, kTRUE, - 0, 0, "QCD diffr. state", 9902110); - db->AddParticle("p_diffr+", "p_diffr+", 0, kTRUE, - 0, 3, "QCD diffr. state", 9902210); - - // From Herwig - db->AddParticle("PSID ", " ", 3.7699, kFALSE, 0.0, 0, "meson", 30443); - - db->AddParticle("A_00 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9000111); - db->AddParticle("A_0+ ", " ", 0.9960, kFALSE, 0.0, +3, "meson", 9000211); - db->AddParticle("A_0- ", " ", 0.9960, kFALSE, 0.0, -3, "meson", -9000211); - - //db->AddParticle("F0P0 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9010221); - - db->AddParticle("KDL_2+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 10325); - db->AddParticle("KDL_2- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -10325); - - db->AddParticle("KDL_20 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 10315); - db->AddParticle("KDL_2BR0", " ", 1.773, kFALSE, 0.0, 0, "meson", -10315); - - db->AddParticle("PI_2+ ", " ", 1.670, kFALSE, 0.0, +3, "meson", 10215); - db->AddParticle("PI_2- ", " ", 1.670, kFALSE, 0.0, -3, "meson", -10215); - db->AddParticle("PI_20 ", " ", 1.670, kFALSE, 0.0, 0, "meson", 10115); - - db->AddParticle("KD*+ ", " ", 1.717, kFALSE, 0.0, +3, "meson", 30323); - db->AddParticle("KD*- ", " ", 1.717, kFALSE, 0.0, -3, "meson", -30323); - - db->AddParticle("KD*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", 30313); - db->AddParticle("KDBR*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", -30313); - - db->AddParticle("RHOD+ ", " ", 1.700, kFALSE, 0.0, +3, "meson", 30213); - db->AddParticle("RHOD- ", " ", 1.700, kFALSE, 0.0, -3, "meson", -30213); - db->AddParticle("RHOD0 ", " ", 1.700, kFALSE, 0.0, 0, "meson", 30113); - - db->AddParticle("ETA_2(L)", " ", 1.632, kFALSE, 0.0, 0, "meson", 10225); - db->AddParticle("ETA_2(H)", " ", 1.854, kFALSE, 0.0, 0, "meson", 10335); - db->AddParticle("OMEGA(H)", " ", 1.649, kFALSE, 0.0, 0, "meson", 30223); - - db->AddParticle("KDH_2+ ", " ", 1.816, kFALSE, 0.0, +3, "meson", 20325); - db->AddParticle("KDH_2- ", " ", 1.816, kFALSE, 0.0, -3, "meson", -20325); - - db->AddParticle("KDH_20 ", " ", 1.816, kFALSE, 0.0, 0, "meson", 20315); - db->AddParticle("KDH_2BR0", " ", 1.816, kFALSE, 0.0, 0, "meson", -20315); - - db->AddParticle("KD_3+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 327); - db->AddParticle("KD_3- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -327); - - db->AddParticle("KD_30 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 317); - db->AddParticle("KD_3BR0 ", " ", 1.773, kFALSE, 0.0, 0, "meson", -317); - - db->AddParticle("RHO_3+ ", " ", 1.691, kFALSE, 0.0, +3, "meson", 217); - db->AddParticle("RHO_3- ", " ", 1.691, kFALSE, 0.0, -3, "meson", -217); - db->AddParticle("RHO_30 ", " ", 1.691, kFALSE, 0.0, 0, "meson", 117); - db->AddParticle("OMEGA_3 ", " ", 1.667, kFALSE, 0.0, 0, "meson", 227); - db->AddParticle("PHI_3 ", " ", 1.854, kFALSE, 0.0, 0, "meson", 337); - - db->AddParticle("CHI2P_B0", " ", 10.232, kFALSE, 0.0, 0, "meson", 110551); - db->AddParticle("CHI2P_B1", " ", 10.255, kFALSE, 0.0, 0, "meson", 120553); - db->AddParticle("CHI2P_B2", " ", 10.269, kFALSE, 0.0, 0, "meson", 100555); - db->AddParticle("UPSLON4S", " ", 10.580, kFALSE, 0.0, 0, "meson", 300553); - - // IONS - // - // Done by default now from Pythia6 table - // Needed for other generators - // So check if already defined - - /// UPDATED VALUES FROM CODATA 2018 - Int_t ionCode = kion + 10020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Deuteron", "Deuteron", 1.87561294257, kTRUE, - 0, 3, "Ion", ionCode); - } - db->AddAntiParticle("AntiDeuteron", -ionCode); - - ionCode = kion + 10030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Triton", "Triton", 2.80892113298, kFALSE, - khShGev / (12.33 * kYear2Sec), 3, "Ion", ionCode); - } - db->AddAntiParticle("AntiTriton", -ionCode); - - ionCode = kion + 20030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("HE3", "HE3", 2.80839160743, kFALSE, - 0, 6, "Ion", ionCode); - } - db->AddAntiParticle("AntiHE3", -ionCode); - - ionCode = kion + 20040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Alpha", "Alpha", 3.7273794066, kTRUE, - khShGev / (12.33 * kYear2Sec), 6, "Ion", ionCode); - } - db->AddAntiParticle("AntiAlpha", -ionCode); - /// PLEASE UPDATE REGULARLY - - // Special particles - // - db->AddParticle("Cherenkov", "Cherenkov", 0, kFALSE, - 0, 0, "Special", kspe + 50); - db->AddParticle("FeedbackPhoton", "FeedbackPhoton", 0, kFALSE, - 0, 0, "Special", kspe + 51); - - //Hyper nuclei and exotica - ionCode = 1010010030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("HyperTriton", "HyperTriton", 2.991134, kFALSE, - 2.5e-15, 3, "Ion", ionCode); - db->AddAntiParticle("AntiHyperTriton", -ionCode); - } - - //hyper hydrogen 4 - ionCode = 1010010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.922434, kFALSE, - 2.5e-15, 3, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhydrog4", -ionCode); - } - - //hyper helium 4 - ionCode = 1010020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.921728, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhelium4", -ionCode); - } - - //hyper helium 5 - ionCode = 1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.839961, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhelium5", -ionCode); - } - - //double hyper hydrogen 4 - ionCode = 1020010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - db->AddAntiParticle("AntiDoubleHyperhydrogen4", -ionCode); - } - - //4-Xi-He - ionCode = 1120020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("4XiHe", "4XiHe", 4.128, kFALSE, - 4.04e-15, 3, "Ion", ionCode); - db->AddAntiParticle("Anti4XiHe", -ionCode); - } - - //4-Xi-H - ionCode = 1120010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("4XiH", "4XiH", 4.128, kFALSE, - 4.04e-15, 3, "Ion", ionCode); - db->AddAntiParticle("Anti4XiH", -ionCode); - } - - // Lithium 4 ground state - ionCode = 1000030040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lithium4", "Lithium4", 3.7513, kFALSE, - 0.003, 9, "Ion", ionCode); - } - // anti Lithium 4 ground state - ionCode = -1000030040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLithium4", "AntiLithium4", 3.7513, kFALSE, - 0.003, 9, "Ion", ionCode); - } - - ionCode = 1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.841, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - } - - ionCode = -1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium5", "AntiHyperhelium5", 4.841, kFALSE, - 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); - } - - ionCode = -1020010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("DoubleAntiHyperhydrogen4", "DoubleAntiHyperhydrogen4", 4.106, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - } - - // hyper helium 4 sigma - ionCode = 1110020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4sigma", "Hyperhelium4sigma", 3.995, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - } - // anti-hyper helium 4 sigma - ionCode = -1110020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium4sigma", "AntiHyperhelium4sigma", 3.995, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - } - - ionCode = 1010000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("LambdaNeutron", "LambdaNeutron", 2.054, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = -1010000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambdaNeutron", "AntiLambdaNeutron", 2.054, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1020000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hdibaryon", "Hdibaryon", 2.23, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = -1020000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHdibaryon", "AntiHdibaryon", 2.23, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1010000030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("LambdaNeutronNeutron", "LambdaNeutronNeutron", 2.99, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = -1010000030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambdaNeutronNeutron", "AntiLambdaNeutronNeutron", 2.99, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1020010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi0Proton", "Xi0Proton", 2.248, kFALSE, - 5e-15, 3, "Ion", ionCode); - } - - ionCode = -1020010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiXi0Proton", "AntiXi0Proton", 2.248, kFALSE, - 5e-15, 3, "Ion", ionCode); - } - - ionCode = 1030000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaProton", "OmegaProton", 2.592, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = -1030000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaProton", "AntiOmegaProton", 2.592, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1030010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaNeutron", "OmegaNeutron", 2.472, kFALSE, - 0.003, 3, "Special", ionCode); - } - - ionCode = -1030010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaNeutron", "AntiOmegaNeutron", 2.472, kFALSE, - 0.003, 3, "Special", ionCode); - } - - ionCode = 1060020020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaOmega", "OmegaOmega", 3.229, kFALSE, - 2.5e-15, 6, "Special", ionCode); - } - - ionCode = -1060020020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaOmega", "AntiOmegaOmega", 3.229, kFALSE, - 2.5e-15, 6, "Special", ionCode); - } - - ionCode = 1010010021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda1405Proton", "Lambda1405Proton", 2.295, kFALSE, - 0.05, 3, "Special", ionCode); - } - - ionCode = -1010010021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambda1405Proton", "AntiLambda1405Proton", 2.295, kFALSE, - 0.05, 3, "Special", ionCode); - } - - ionCode = 1020000021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda1405Lambda1405", "Lambda1405Lambda1405", 2.693, kFALSE, - 0.05, 0, "Special", ionCode); - } - - ionCode = -1020000021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambda1405Lambda1405", "AntiLambda1405Lambda1405", 2.693, kFALSE, - 0.05, 0, "Special", ionCode); - } - - ionCode = 2010010030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("CTriton", "CTriton", 4.162, kFALSE, - 3.3e-12, 3, "Ion", ionCode); - db->AddAntiParticle("AntiCTriton", -ionCode); - } - - ionCode = 2010010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("CDeuteron", "CDeuteron", 3.226, kFALSE, - 3.3e-12, 3, "Ion", ionCode); - db->AddAntiParticle("AntiCDeuteron", -ionCode); - } - - // Special resonances - - ionCode = 9010221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_980", "f0_980", 0.980, kFALSE, - 0.07, 0, "Resonance", ionCode); - } - - ionCode = 225; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f2_1270", "f2_1270", 1.275, kFALSE, - 0.185, 0, "Resonance", ionCode); - } - - // Lambda(1520)0 - ionCode = 102134; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda_1520_0", "Lambda_1520_0", 1.5195, kFALSE, 0.0156, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("AntiLambda_1520_0", "AntiLambda_1520_0", 1.5195, kFALSE, 0.0156, 0, "Resonance", -ionCode); - } - - // f1 study - ionCode = 20223; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f1_1285", "f1_1285", 1.28210, kFALSE, 0.02420, 0, "Resonance", ionCode); - } - ionCode = 20333; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f1_1420", "f1_1420", 1.42640, kFALSE, 0.05490, 0, "Resonance", ionCode); - } - - // glueball hunting - ionCode = 115; - if (!db->GetParticle(ionCode)) { - db->AddParticle("a2_1320", "a2_1320", 1.3182, kFALSE, 0.1078, 0, "Resonance", ionCode); - } - ionCode = 10221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1370", "f0_1370", 1.37, kFALSE, 0.200, 0, "Resonance", ionCode); - } - ionCode = 9030221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1500", "f0_1500", 1.500, kFALSE, 0.112, 0, "Resonance", ionCode); - } - ionCode = 10331; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1710", "f0_1710", 1.710, kFALSE, 0.139, 0, "Resonance", ionCode); - } - ionCode = 335; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f2_1525", "f2_1525", 1.525, kFALSE, 0.073, 0, "Resonance", ionCode); - } - - // Xi-/+ (1820) - ionCode = 123314; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi_Minus_1820", "Xi_Minus_1820", 1.8234, kFALSE, 0.024, -3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Xi_Plus_1820", "Xi_Plus_1820", 1.8234, kFALSE, 0.024, 3, "Resonance", -ionCode); - } - - // Xi0 (1820) - ionCode = 123324; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi_0_1820", "Xi_0_1820", 1.8234, kFALSE, 0.024, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Xi_0_Bar_1820", "Xi_0_Bar_1820", 1.8234, kFALSE, 0.024, 0, "Resonance", -ionCode); - } - - // Ps - hidden strange (s-sbar) pentaquarks - - ionCode = 9322134; - if (!db->GetParticle(ionCode)) { - db->AddParticle("ps_2100", "ps_2100", 2.100, kFALSE, - 0.040, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("anti-ps_2100", "anti-ps_2100", 2.100, kFALSE, - 0.040, -3, "Resonance", -ionCode); - } - - ionCode = 9322136; - if (!db->GetParticle(ionCode)) { - db->AddParticle("ps_2500", "ps_2500", 2.500, kFALSE, - 0.040, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("anti-ps_2500", "anti-ps_2500", 2.500, kFALSE, - 0.040, -3, "Resonance", -ionCode); - } - - //Additional Hidden Strangeness Pentaquarks - - //Ps +/- - ionCode = 9322132; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_1870", "Ps_Plus_1870", 1.870, kFALSE, - 0.10, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_1870", "Anti-Ps_Minus_1870", 1.870, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9322312; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2065", "Ps_Plus_2065", 2.065, kFALSE, - 0.10, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2065", "Anti-Ps_Minus_2065", 2.065, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9323212; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2255", "Ps_Plus_2255", 2.255, kFALSE, - 0.10, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2255", "Anti-Ps_Minus_2255", 2.255, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9332212; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2455", "Ps_Plus_2455", 2.455, kFALSE, - 0.10, 3, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2455", "Anti-Ps_Minus_2455", 2.455, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - - //Ps0 - ionCode = 9322131; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_1870", "Ps_0_1870", 1.870, kFALSE, - 0.10, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_1870", "Anti-Ps_0_1870", 1.870, kFALSE, - 0.10, 0, "Resonance", -ionCode); - } - ionCode = 9322311; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2065", "Ps_0_2065", 2.065, kFALSE, - 0.10, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2065", "Anti-Ps_0_2065", 2.065, kFALSE, - 0.10, 0, "Resonance", -ionCode); - } - ionCode = 9323211; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2255", "Ps_0_2255", 2.255, kFALSE, - 0.10, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2255", "Anti-Ps_0_2255", 2.255, kFALSE, - 0.10, 0, "Resonance", -ionCode); - } - ionCode = 9332211; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2455", "Ps_0_2455", 2.455, kFALSE, - 0.10, 0, "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2455", "Anti-Ps_0_2455", 2.455, kFALSE, - 0.10, 0, "Resonance", -ionCode); - } - - // Charm pentaquarks - // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) - ionCode = 9422111; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Anti-Theta_c_3100", "Anti-Theta_c_3100", 3.099, kFALSE, - 83.e-6, 0, "Resonance", ionCode); // same width as D*+ (83 keV) - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Theta_c_3100", "Theta_c_3100", 3.099, kFALSE, - 83.e-6, 0, "Resonance", -ionCode); // same width as D*+ (83 keV) - } - - // d*(2380) - dibaryon resonance - - ionCode = 900010020; //Arbitrary choice - as deuteron but with leading 9 instead of 10 - if (!db->GetParticle(ionCode)) { - db->AddParticle("d*_2380", "d*_2380", 2.38, kFALSE, - 0.070, 3, "Resonance", ionCode); - } - db->AddAntiParticle("d*_2380_bar", -ionCode); - - //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) - ionCode = 900000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Sexaquark", "Sexaquark", 2.0, kTRUE, 0.0, 0, "Special", ionCode); - } - - if (!db->GetParticle(-ionCode)) { - db->AddParticle("AntiSexaquark", "AntiSexaquark", 2.0, kTRUE, 0.0, 0, "Special", -ionCode); - } - - // lastly, add particle from the the extra text file - addParticlesFromExternalFile(db); -} - -inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG* db) -{ - static bool initialized = false; - if (!initialized) { - // allow user to specify custom file - if (const char* custom = std::getenv("O2_SIM_CUSTOM_PDG")) { - // TODO: make sure this is a file - db->ReadPDGTable(custom); - } else if (const char* o2Root = std::getenv("O2_ROOT")) { - // take the maintained file from O2 - auto inputExtraPDGs = std::string(o2Root) + "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; - db->ReadPDGTable(inputExtraPDGs.c_str()); - } - initialized = true; - } -} - -} // namespace o2 - -#endif //O2_O2DATABASEPDG_H From 7f590f3e12b9c447a87776d07f6f582a0f7ef03f Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:34:43 +0100 Subject: [PATCH 05/15] Adding O2DatabasePDG.h after formatting changes --- .../SimulationDataFormat/O2DatabasePDG.h | 708 ++++++++++++++++++ 1 file changed, 708 insertions(+) create mode 100644 DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h new file mode 100644 index 0000000000000..5d1ed87a39822 --- /dev/null +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -0,0 +1,708 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// +// Created by Sandro Wenzel on 11.08.22. +// + +#ifndef O2_O2DATABASEPDG_H +#define O2_O2DATABASEPDG_H + +#include "TDatabasePDG.h" +#include "TParticlePDG.h" +#include + +namespace o2 { + +// An ALICE specific extension of ROOT's TDatabasePDG +// +// By using O2DatabasePDG::Instance() in our code instead of +// TDatabasePDG::Instance(), correct initialization is guaranteed. +// Alternatively, a static function is exposed with which particles can be added +// to TDatabasePDG objects directly. +class O2DatabasePDG { + // +public: + static TDatabasePDG *Instance() { + static bool initialized = + false; // initialize this --> adds particles to TDatabasePDG; + auto db = TDatabasePDG::Instance(); + if (!initialized) { + addALICEParticles(db); + initialized = true; + } + return db; + } + + // adds ALICE particles to a given TDatabasePDG instance + static void addALICEParticles(TDatabasePDG *db = TDatabasePDG::Instance()); + static void addParticlesFromExternalFile(TDatabasePDG *db); + + // get particle's (if any) mass + static Double_t MassImpl(TParticlePDG *particle, bool &success) { + success = false; + if (!particle) { + return -1.; + } + success = true; + return particle->Mass(); + } + + // determine particle to get mass for based on PDG + static Double_t Mass(int pdg, bool &success, + TDatabasePDG *db = O2DatabasePDG::Instance()) { + if (pdg < IONBASELOW || pdg > IONBASEHIGH) { + // not an ion, return immediately + return MassImpl(db->GetParticle(pdg), success); + } + if (auto particle = db->GetParticle(pdg)) { + // see if this ion can be found + return MassImpl(particle, success); + } + // if we are here, try one last time to look for ground state of potential + // isomere state + pdg = pdg / 10 * 10; + return MassImpl(db->GetParticle(pdg), success); + } + + // remove default constructor + O2DatabasePDG() = delete; + +private: + static constexpr int IONBASELOW{1000000000}; + static constexpr int IONBASEHIGH{1099999999}; +}; + +// by keeping this inline, we can use it in other parts of the code, for +// instance Framework or Analysis, without needing to link against this library +inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { + // + // Add ALICE particles to the ROOT PDG data base + // Code has been taken from AliRoot + const Int_t kspe = 50000000; + + // PDG nuclear states are 10-digit numbers + // 10LZZZAAAI e.g. deuteron is + // 1000010020 + const Int_t kion = 1000000000; + + /* + const Double_t kAu2Gev=0.9314943228; +*/ + + const Double_t khSlash = 1.0545726663e-27; + const Double_t kErg2Gev = 1 / 1.6021773349e-3; + const Double_t khShGev = khSlash * kErg2Gev; + const Double_t kYear2Sec = 3600 * 24 * 365.25; + + // Heavy-flavour particles + + // χc1(3872) aka X(3872), taken from PDG 2022 + // (https://pdg.lbl.gov/2022/listings/rpp2022-list-chi-c1-3872.pdf) + db->AddParticle("Chi_c1(3872)", "Chi_c1(3872)", 3.87165, kFALSE, 0, 0, + "CCBarMeson", 9920443); + + // + // Bottom mesons + // mass and life-time from PDG + // + db->AddParticle("Upsilon(3S)", "Upsilon(3S)", 10.3552, kTRUE, 0, 0, + "Bottonium", 200553); + + // QCD diffractive states + db->AddParticle("rho_diff0", "rho_diff0", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900110); + db->AddParticle("pi_diffr+", "pi_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", + 9900210); + db->AddParticle("omega_di", "omega_di", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900220); + db->AddParticle("phi_diff", "phi_diff", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900330); + db->AddParticle("J/psi_di", "J/psi_di", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900440); + db->AddParticle("n_diffr0", "n_diffr0", 0, kTRUE, 0, 0, "QCD diffr. state", + 9902110); + db->AddParticle("p_diffr+", "p_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", + 9902210); + + // From Herwig + db->AddParticle("PSID ", " ", 3.7699, kFALSE, 0.0, 0, "meson", 30443); + + db->AddParticle("A_00 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9000111); + db->AddParticle("A_0+ ", " ", 0.9960, kFALSE, 0.0, +3, "meson", 9000211); + db->AddParticle("A_0- ", " ", 0.9960, kFALSE, 0.0, -3, "meson", -9000211); + + // db->AddParticle("F0P0 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9010221); + + db->AddParticle("KDL_2+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 10325); + db->AddParticle("KDL_2- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -10325); + + db->AddParticle("KDL_20 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 10315); + db->AddParticle("KDL_2BR0", " ", 1.773, kFALSE, 0.0, 0, "meson", -10315); + + db->AddParticle("PI_2+ ", " ", 1.670, kFALSE, 0.0, +3, "meson", 10215); + db->AddParticle("PI_2- ", " ", 1.670, kFALSE, 0.0, -3, "meson", -10215); + db->AddParticle("PI_20 ", " ", 1.670, kFALSE, 0.0, 0, "meson", 10115); + + db->AddParticle("KD*+ ", " ", 1.717, kFALSE, 0.0, +3, "meson", 30323); + db->AddParticle("KD*- ", " ", 1.717, kFALSE, 0.0, -3, "meson", -30323); + + db->AddParticle("KD*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", 30313); + db->AddParticle("KDBR*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", -30313); + + db->AddParticle("RHOD+ ", " ", 1.700, kFALSE, 0.0, +3, "meson", 30213); + db->AddParticle("RHOD- ", " ", 1.700, kFALSE, 0.0, -3, "meson", -30213); + db->AddParticle("RHOD0 ", " ", 1.700, kFALSE, 0.0, 0, "meson", 30113); + + db->AddParticle("ETA_2(L)", " ", 1.632, kFALSE, 0.0, 0, "meson", 10225); + db->AddParticle("ETA_2(H)", " ", 1.854, kFALSE, 0.0, 0, "meson", 10335); + db->AddParticle("OMEGA(H)", " ", 1.649, kFALSE, 0.0, 0, "meson", 30223); + + db->AddParticle("KDH_2+ ", " ", 1.816, kFALSE, 0.0, +3, "meson", 20325); + db->AddParticle("KDH_2- ", " ", 1.816, kFALSE, 0.0, -3, "meson", -20325); + + db->AddParticle("KDH_20 ", " ", 1.816, kFALSE, 0.0, 0, "meson", 20315); + db->AddParticle("KDH_2BR0", " ", 1.816, kFALSE, 0.0, 0, "meson", -20315); + + db->AddParticle("KD_3+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 327); + db->AddParticle("KD_3- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -327); + + db->AddParticle("KD_30 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 317); + db->AddParticle("KD_3BR0 ", " ", 1.773, kFALSE, 0.0, 0, "meson", -317); + + db->AddParticle("RHO_3+ ", " ", 1.691, kFALSE, 0.0, +3, "meson", 217); + db->AddParticle("RHO_3- ", " ", 1.691, kFALSE, 0.0, -3, "meson", -217); + db->AddParticle("RHO_30 ", " ", 1.691, kFALSE, 0.0, 0, "meson", 117); + db->AddParticle("OMEGA_3 ", " ", 1.667, kFALSE, 0.0, 0, "meson", 227); + db->AddParticle("PHI_3 ", " ", 1.854, kFALSE, 0.0, 0, "meson", 337); + + db->AddParticle("CHI2P_B0", " ", 10.232, kFALSE, 0.0, 0, "meson", 110551); + db->AddParticle("CHI2P_B1", " ", 10.255, kFALSE, 0.0, 0, "meson", 120553); + db->AddParticle("CHI2P_B2", " ", 10.269, kFALSE, 0.0, 0, "meson", 100555); + db->AddParticle("UPSLON4S", " ", 10.580, kFALSE, 0.0, 0, "meson", 300553); + + // IONS + // + // Done by default now from Pythia6 table + // Needed for other generators + // So check if already defined + + /// UPDATED VALUES FROM CODATA 2018 + Int_t ionCode = kion + 10020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Deuteron", "Deuteron", 1.87561294257, kTRUE, 0, 3, "Ion", + ionCode); + } + db->AddAntiParticle("AntiDeuteron", -ionCode); + + ionCode = kion + 10030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Triton", "Triton", 2.80892113298, kFALSE, + khShGev / (12.33 * kYear2Sec), 3, "Ion", ionCode); + } + db->AddAntiParticle("AntiTriton", -ionCode); + + ionCode = kion + 20030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("HE3", "HE3", 2.80839160743, kFALSE, 0, 6, "Ion", ionCode); + } + db->AddAntiParticle("AntiHE3", -ionCode); + + ionCode = kion + 20040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Alpha", "Alpha", 3.7273794066, kTRUE, + khShGev / (12.33 * kYear2Sec), 6, "Ion", ionCode); + } + db->AddAntiParticle("AntiAlpha", -ionCode); + /// PLEASE UPDATE REGULARLY + + // Special particles + // + db->AddParticle("Cherenkov", "Cherenkov", 0, kFALSE, 0, 0, "Special", + kspe + 50); + db->AddParticle("FeedbackPhoton", "FeedbackPhoton", 0, kFALSE, 0, 0, + "Special", kspe + 51); + + // Hyper nuclei and exotica + ionCode = 1010010030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("HyperTriton", "HyperTriton", 2.991134, kFALSE, 2.5e-15, 3, + "Ion", ionCode); + db->AddAntiParticle("AntiHyperTriton", -ionCode); + } + + // hyper hydrogen 4 + ionCode = 1010010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.922434, kFALSE, 2.5e-15, + 3, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhydrog4", -ionCode); + } + + // hyper helium 4 + ionCode = 1010020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.921728, kFALSE, 2.5e-15, + 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium4", -ionCode); + } + + // hyper helium 5 + ionCode = 1010020050; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.839961, kFALSE, 2.5e-15, + 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium5", -ionCode); + } + + // double hyper hydrogen 4 + ionCode = 1020010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, + kFALSE, 2.5e-15, 6, "Ion", ionCode); + db->AddAntiParticle("AntiDoubleHyperhydrogen4", -ionCode); + } + + // 4-Xi-He + ionCode = 1120020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("4XiHe", "4XiHe", 4.128, kFALSE, 4.04e-15, 3, "Ion", + ionCode); + db->AddAntiParticle("Anti4XiHe", -ionCode); + } + + // 4-Xi-H + ionCode = 1120010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("4XiH", "4XiH", 4.128, kFALSE, 4.04e-15, 3, "Ion", ionCode); + db->AddAntiParticle("Anti4XiH", -ionCode); + } + + // Lithium 4 ground state + ionCode = 1000030040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lithium4", "Lithium4", 3.7513, kFALSE, 0.003, 9, "Ion", + ionCode); + } + // anti Lithium 4 ground state + ionCode = -1000030040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLithium4", "AntiLithium4", 3.7513, kFALSE, 0.003, 9, + "Ion", ionCode); + } + + ionCode = 1010020050; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.841, kFALSE, 2.5e-15, 6, + "Ion", ionCode); + } + + ionCode = -1010020050; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiHyperhelium5", "AntiHyperhelium5", 4.841, kFALSE, + 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); + } + + ionCode = -1020010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("DoubleAntiHyperhydrogen4", "DoubleAntiHyperhydrogen4", + 4.106, kFALSE, 2.5e-15, 6, "Ion", ionCode); + } + + // hyper helium 4 sigma + ionCode = 1110020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium4sigma", "Hyperhelium4sigma", 3.995, kFALSE, + 2.5e-15, 6, "Ion", ionCode); + } + // anti-hyper helium 4 sigma + ionCode = -1110020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiHyperhelium4sigma", "AntiHyperhelium4sigma", 3.995, + kFALSE, 2.5e-15, 6, "Ion", ionCode); + } + + ionCode = 1010000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("LambdaNeutron", "LambdaNeutron", 2.054, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1010000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambdaNeutron", "AntiLambdaNeutron", 2.054, kFALSE, + 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1020000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hdibaryon", "Hdibaryon", 2.23, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1020000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiHdibaryon", "AntiHdibaryon", 2.23, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = 1010000030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("LambdaNeutronNeutron", "LambdaNeutronNeutron", 2.99, + kFALSE, 2.5e-15, 0, "Special", ionCode); + } + + ionCode = -1010000030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambdaNeutronNeutron", "AntiLambdaNeutronNeutron", + 2.99, kFALSE, 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1020010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi0Proton", "Xi0Proton", 2.248, kFALSE, 5e-15, 3, "Ion", + ionCode); + } + + ionCode = -1020010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiXi0Proton", "AntiXi0Proton", 2.248, kFALSE, 5e-15, 3, + "Ion", ionCode); + } + + ionCode = 1030000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaProton", "OmegaProton", 2.592, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1030000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaProton", "AntiOmegaProton", 2.592, kFALSE, + 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1030010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaNeutron", "OmegaNeutron", 2.472, kFALSE, 0.003, 3, + "Special", ionCode); + } + + ionCode = -1030010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaNeutron", "AntiOmegaNeutron", 2.472, kFALSE, + 0.003, 3, "Special", ionCode); + } + + ionCode = 1060020020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaOmega", "OmegaOmega", 3.229, kFALSE, 2.5e-15, 6, + "Special", ionCode); + } + + ionCode = -1060020020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaOmega", "AntiOmegaOmega", 3.229, kFALSE, 2.5e-15, + 6, "Special", ionCode); + } + + ionCode = 1010010021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda1405Proton", "Lambda1405Proton", 2.295, kFALSE, 0.05, + 3, "Special", ionCode); + } + + ionCode = -1010010021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambda1405Proton", "AntiLambda1405Proton", 2.295, + kFALSE, 0.05, 3, "Special", ionCode); + } + + ionCode = 1020000021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda1405Lambda1405", "Lambda1405Lambda1405", 2.693, + kFALSE, 0.05, 0, "Special", ionCode); + } + + ionCode = -1020000021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambda1405Lambda1405", "AntiLambda1405Lambda1405", + 2.693, kFALSE, 0.05, 0, "Special", ionCode); + } + + ionCode = 2010010030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("CTriton", "CTriton", 4.162, kFALSE, 3.3e-12, 3, "Ion", + ionCode); + db->AddAntiParticle("AntiCTriton", -ionCode); + } + + ionCode = 2010010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("CDeuteron", "CDeuteron", 3.226, kFALSE, 3.3e-12, 3, "Ion", + ionCode); + db->AddAntiParticle("AntiCDeuteron", -ionCode); + } + + // Special resonances + + ionCode = 9010221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_980", "f0_980", 0.980, kFALSE, 0.07, 0, "Resonance", + ionCode); + } + + ionCode = 225; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f2_1270", "f2_1270", 1.275, kFALSE, 0.185, 0, "Resonance", + ionCode); + } + + // Lambda(1520)0 + ionCode = 102134; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda_1520_0", "Lambda_1520_0", 1.5195, kFALSE, 0.0156, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("AntiLambda_1520_0", "AntiLambda_1520_0", 1.5195, kFALSE, + 0.0156, 0, "Resonance", -ionCode); + } + + // f1 study + ionCode = 20223; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f1_1285", "f1_1285", 1.28210, kFALSE, 0.02420, 0, + "Resonance", ionCode); + } + ionCode = 20333; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f1_1420", "f1_1420", 1.42640, kFALSE, 0.05490, 0, + "Resonance", ionCode); + } + + // glueball hunting + ionCode = 115; + if (!db->GetParticle(ionCode)) { + db->AddParticle("a2_1320", "a2_1320", 1.3182, kFALSE, 0.1078, 0, + "Resonance", ionCode); + } + ionCode = 10221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1370", "f0_1370", 1.37, kFALSE, 0.200, 0, "Resonance", + ionCode); + } + ionCode = 9030221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1500", "f0_1500", 1.500, kFALSE, 0.112, 0, "Resonance", + ionCode); + } + ionCode = 10331; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1710", "f0_1710", 1.710, kFALSE, 0.139, 0, "Resonance", + ionCode); + } + ionCode = 335; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f2_1525", "f2_1525", 1.525, kFALSE, 0.073, 0, "Resonance", + ionCode); + } + + // Xi-/+ (1820) + ionCode = 123314; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi_Minus_1820", "Xi_Minus_1820", 1.8234, kFALSE, 0.024, -3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Xi_Plus_1820", "Xi_Plus_1820", 1.8234, kFALSE, 0.024, 3, + "Resonance", -ionCode); + } + + // Xi0 (1820) + ionCode = 123324; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi_0_1820", "Xi_0_1820", 1.8234, kFALSE, 0.024, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Xi_0_Bar_1820", "Xi_0_Bar_1820", 1.8234, kFALSE, 0.024, 0, + "Resonance", -ionCode); + } + + // Ps - hidden strange (s-sbar) pentaquarks + + ionCode = 9322134; + if (!db->GetParticle(ionCode)) { + db->AddParticle("ps_2100", "ps_2100", 2.100, kFALSE, 0.040, 3, "Resonance", + ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("anti-ps_2100", "anti-ps_2100", 2.100, kFALSE, 0.040, -3, + "Resonance", -ionCode); + } + + ionCode = 9322136; + if (!db->GetParticle(ionCode)) { + db->AddParticle("ps_2500", "ps_2500", 2.500, kFALSE, 0.040, 3, "Resonance", + ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("anti-ps_2500", "anti-ps_2500", 2.500, kFALSE, 0.040, -3, + "Resonance", -ionCode); + } + + // Additional Hidden Strangeness Pentaquarks + + // Ps +/- + ionCode = 9322132; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_1870", "Ps_Plus_1870", 1.870, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_1870", "Anti-Ps_Minus_1870", 1.870, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9322312; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2065", "Ps_Plus_2065", 2.065, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2065", "Anti-Ps_Minus_2065", 2.065, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9323212; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2255", "Ps_Plus_2255", 2.255, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2255", "Anti-Ps_Minus_2255", 2.255, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9332212; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2455", "Ps_Plus_2455", 2.455, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2455", "Anti-Ps_Minus_2455", 2.455, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + + // Ps0 + ionCode = 9322131; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_1870", "Ps_0_1870", 1.870, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_1870", "Anti-Ps_0_1870", 1.870, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9322311; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2065", "Ps_0_2065", 2.065, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2065", "Anti-Ps_0_2065", 2.065, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9323211; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2255", "Ps_0_2255", 2.255, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2255", "Anti-Ps_0_2255", 2.255, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9332211; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2455", "Ps_0_2455", 2.455, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2455", "Anti-Ps_0_2455", 2.455, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + + // Charm pentaquarks + // Theta_c: isospin singlet with J=1/2+ (see + // https://arxiv.org/abs/hep-ph/0409121) + ionCode = 9422111; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Anti-Theta_c_3100", "Anti-Theta_c_3100", 3.099, kFALSE, + 83.e-6, 0, "Resonance", + ionCode); // same width as D*+ (83 keV) + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Theta_c_3100", "Theta_c_3100", 3.099, kFALSE, 83.e-6, 0, + "Resonance", -ionCode); // same width as D*+ (83 keV) + } + + // d*(2380) - dibaryon resonance + + ionCode = 900010020; // Arbitrary choice - as deuteron but with leading 9 + // instead of 10 + if (!db->GetParticle(ionCode)) { + db->AddParticle("d*_2380", "d*_2380", 2.38, kFALSE, 0.070, 3, "Resonance", + ionCode); + } + db->AddAntiParticle("d*_2380_bar", -ionCode); + + // Sexaquark (uuddss): compact, neutral and stable hypothetical bound state + // (arxiv.org/abs/1708.08951) + ionCode = 900000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Sexaquark", "Sexaquark", 2.0, kTRUE, 0.0, 0, "Special", + ionCode); + } + + if (!db->GetParticle(-ionCode)) { + db->AddParticle("AntiSexaquark", "AntiSexaquark", 2.0, kTRUE, 0.0, 0, + "Special", -ionCode); + } + + // lastly, add particle from the the extra text file + addParticlesFromExternalFile(db); +} + +inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG *db) { + static bool initialized = false; + if (!initialized) { + // allow user to specify custom file + if (const char *custom = std::getenv("O2_SIM_CUSTOM_PDG")) { + // TODO: make sure this is a file + db->ReadPDGTable(custom); + } else if (const char *o2Root = std::getenv("O2_ROOT")) { + // take the maintained file from O2 + auto inputExtraPDGs = + std::string(o2Root) + + "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; + db->ReadPDGTable(inputExtraPDGs.c_str()); + } + initialized = true; + } +} + +} // namespace o2 + +#endif // O2_O2DATABASEPDG_H From 003e41479e14ea471c6d11621e62f61e3eecc6b6 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:36:56 +0100 Subject: [PATCH 06/15] Delete Steer/src/O2MCApplication.cxx --- Steer/src/O2MCApplication.cxx | 1610 --------------------------------- 1 file changed, 1610 deletions(-) delete mode 100644 Steer/src/O2MCApplication.cxx diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx deleted file mode 100644 index 426b3734fdd22..0000000000000 --- a/Steer/src/O2MCApplication.cxx +++ /dev/null @@ -1,1610 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "DetectorsBase/Aligner.h" -#include "DetectorsBase/MaterialManager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "SimConfig/SimUserDecay.h" -#include -#include -#include "SimConfig/GlobalProcessCutSimParam.h" -#include "DetectorsBase/GeometryManagerParam.h" -#include - -namespace o2 -{ -namespace steer -{ -// helper function to send trivial data -template -void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts) -{ - static auto mgr = FairRootManager::Instance(); - auto vector = mgr->InitObjectAs*>(name); - if (vector) { - auto buffer = (char*)&(*vector)[0]; - auto buffersize = vector->size() * sizeof(T); - fair::mq::MessagePtr message(channel.NewMessage( - buffer, buffersize, - [](void* data, void* hint) {}, buffer)); - parts.AddPart(std::move(message)); - } -} - -void O2MCApplicationBase::Stepping() -{ - mStepCounter++; - - // check the max time of flight condition - const auto tof = fMC->TrackTime(); - auto& params = o2::GlobalProcessCutSimParam::Instance(); - if (tof > params.TOFMAX) { - fMC->StopTrack(); - return; - } - - mLongestTrackTime = std::max((double)mLongestTrackTime, tof); - - if (mCutParams.stepFiltering) { - // we can kill tracks here based on our - // custom detector specificities - - // Note that this is done in addition to the generic - // R + Z-cut mechanism at VMC level. - - float x, y, z; - fMC->TrackPosition(x, y, z); - - // this function is implementing a basic z-dependent R cut - // can be generalized later on - auto outOfR = [x, y, this](float z) { - // for the moment for cases when we have ZDC enabled - if (std::abs(z) > mCutParams.tunnelZ) { - if ((x * x + y * y) > mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { - return true; - } - } - return false; - }; - - if (z > mCutParams.ZmaxA || - -z > mCutParams.ZmaxC || - outOfR(z)) { - fMC->StopTrack(); - return; - } - } - - if (mCutParams.stepTrackRefHook) { - mTrackRefFcn(fMC); - } - - // dispatch now to stepping function in FairRoot - FairMCApplication::Stepping(); -} - -void O2MCApplicationBase::PreTrack() -{ - // dispatch first to function in FairRoot - FairMCApplication::PreTrack(); -} - -void O2MCApplicationBase::ConstructGeometry() -{ - // fill the mapping - mModIdToName.clear(); - o2::detectors::DetID::mask_t dmask{}; - for (int i = 0; i < fModules->GetEntries(); ++i) { - auto mod = static_cast(fModules->At(i)); - if (mod) { - mModIdToName[mod->GetModId()] = mod->GetName(); - int did = o2::detectors::DetID::nameToID(mod->GetName()); - if (did >= 0) { - dmask |= o2::detectors::DetID::getMask(did); - } - } - } - gGeoManager->SetUniqueID(dmask.to_ulong()); - FairMCApplication::ConstructGeometry(); - - std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); - // construct the volume name to module name mapping useful for StepAnalysis - auto vollist = gGeoManager->GetListOfVolumes(); - for (int i = 0; i < vollist->GetEntries(); ++i) { - auto vol = static_cast(vollist->At(i)); - auto iter = fModVolMap.find(vol->GetNumber()); - voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; - } -} - -void O2MCApplicationBase::InitGeometry() -{ - // load special cuts which might be given from the outside first. - auto& matMgr = o2::base::MaterialManager::Instance(); - matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE); - matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); - // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module - FairMCApplication::InitGeometry(); - matMgr.writeCutsAndProcessesToJSON(); - // now the sensitive volumes are set up in fVolMap and we can query them - for (auto e : fVolMap) { - // since fVolMap contains multiple entries (if multiple copies), this may - // write to the same entry multiple times - mSensitiveVolumes[e.first] = e.second->GetName(); - } - std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); - for (auto e : mSensitiveVolumes) { - sensvolfile << e.first << ":" << e.second << "\n"; - } -} - -bool O2MCApplicationBase::MisalignGeometry() -{ - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->addAlignableVolumes(); - } - } - - // we stream out both unaligned geometry (to allow for - // dynamic post-alignment) as well as the aligned version - // which can be used by digitization etc. immediately - auto& confref = o2::conf::SimConfig::Instance(); - auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); - // since in general the geometry is a CCDB object, it must be exported under the standard name - gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); - gGeoManager->Export(geomfile.c_str()); - - // apply alignment for included detectors AFTER exporting ideal geometry - auto& aligner = o2::base::Aligner::Instance(); - aligner.applyAlignment(confref.getTimestamp()); - - // export aligned geometry into different file - auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); - gGeoManager->Export(alignedgeomfile.c_str()); - - auto& param = o2::GeometryManagerParam::Instance(); - - // fill parallel world geometry if activated - if (param.useParallelWorld) { - TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors"); - if (param.usePwGeoBVH) { - pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); - } - if (param.usePwCaching) { - TGeoNavigator::SetPWSafetyCaching(true); - } - for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->fillParallelWorld(); - } - } - gGeoManager->SetUseParallelWorldNav(true); - } - - // return original return value of misalignment procedure - return true; -} - -void O2MCApplicationBase::finishEventCommon() -{ - LOG(info) << "This event/chunk did " << mStepCounter << " steps"; - LOG(info) << "Longest track time is " << mLongestTrackTime; - - auto header = static_cast(fMCEventHeader); - header->getMCEventStats().setNSteps(mStepCounter); - header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); - - static_cast(GetStack())->updateEventStats(); -} - -void O2MCApplicationBase::FinishEvent() -{ - finishEventCommon(); - - auto header = static_cast(fMCEventHeader); - auto& confref = o2::conf::SimConfig::Instance(); - - if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { - LOG(info) << "Discarding current event due to no hits"; - SetSaveCurrentEvent(false); - } - - // dispatch to function in FairRoot - FairMCApplication::FinishEvent(); -} - -void O2MCApplicationBase::BeginEvent() -{ - // dispatch first to function in FairRoot - FairMCApplication::BeginEvent(); - - // register event header with our stack - auto header = static_cast(fMCEventHeader); - static_cast(GetStack())->setMCEventStats(&header->getMCEventStats()); - - mStepCounter = 0; - mLongestTrackTime = 0; -} - -void addSpecialParticles() -{ - // - // Add particles needed for ALICE (not present in Geant3 or Geant4) - // Code ported 1-1 from AliRoot - // - - LOG(info) << "Adding custom particles to VMC"; - - // ### NUCLEI ### - // 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); - - // ### HYPER NUCLEI (|S| = 1) ### - //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); - - //Hyper hydrogen 4 - 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 - 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 - 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 - 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); - - //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); - - // ### HYPER NUCLEI (|S| = 2) ### - //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); - - //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); - //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); - - // 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); - - // ### EXOTICA ### - //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); - - //Anti-Lambda-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-H-Dibaryon - TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Xi-Proton - 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); - - //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); - - //Anti-Lambda-Neutron-Neutron - TVirtualMC::GetMC()->DefineParticle(-1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); - - //Omega-Proton - TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Proton - TVirtualMC::GetMC()->DefineParticle(-1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Omega-Neutron - 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); - - //Omega-Omega - TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Anti-Omega-Omega - TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //Lambda(1405)-Proton - 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); - - //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); - - //Anti-Lambda(1405)-Lambda(1405) - TVirtualMC::GetMC()->DefineParticle(-1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); - - //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); - - //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); - - //Resonances not in Generators - // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) - TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f2(1270) (PDG: width = 185 MeV) - TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - // Glueball hunting family - // Their life times are not known, so we set them to 1e-24 - // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) - TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, 0, 0, kTRUE); - // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, 0, 0, kTRUE); - // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct - TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, 0, 0, kTRUE); - - // Xi_0(1820) - TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, 1.8234, 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); - - int xi_0_1820_mode[6][3] = {{0}}; - float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - xi_0_1820_mode[0][0] = 3122; // Lambda - xi_0_1820_mode[0][1] = 310; // K0s - TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); - xi_0_1820_mode[0][0] = -3122; // Lambda-bar - TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); - - // Xi-+(1820) - TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, 1.8234, -1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, 1.8234, 1.0, 2.742550e-23, "Hadron", 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); - - int xi_charged_1820_mode[6][3] = {{0}}; - float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; - xi_charged_1820_mode[0][0] = 3122; // Lambda - xi_charged_1820_mode[0][1] = -321; // K- - TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode); - xi_charged_1820_mode[0][0] = -3122; // Lambda-bar - xi_charged_1820_mode[0][1] = 321; // K+ - TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode); - - // Ps - hidden strange (s-sbar) pentaquarks - TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, 0, 0, 0, -1, kTRUE); - - Int_t psmode[6][3] = {0}; - Float_t psratio[6] = {0.f}; - psratio[0] = 100.; - - psmode[0][0] = 333; // phi - psmode[0][1] = 2212; // proton - TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); - - psmode[0][1] = -2212; // anti-proton - TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); - TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); - - //Omega(2012) - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - - TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - psmode[0][0] = 3312; // Xi- - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); - - TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, 0, 0, 0, 0, 0, -1, kTRUE); - psmode[0][0] = -3312; // anti-Xi+ - psmode[0][1] = 310; // K0S - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); - - // d*(2380) - dibaryon resonance - TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, 0, 0, -2, kTRUE); - - Int_t dstmode[6][3] = {0}; - Float_t dstratio[6] = {0.f}; - dstratio[0] = 100; // For now we implement only the mode of interest - // d* -> d pi+ pi- - dstmode[0][0] = 1000010020; // deuteron - dstmode[0][1] = -211; // negative pion - dstmode[0][2] = 211; // positive pion - TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); - - dstmode[0][0] = -1000010020; // anti-deuteron - TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); - - // Heavy vector mesons - // D*+ - TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*- - TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0 - TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*0bar - TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s+ - TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // D*_s- - TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0 - TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*0bar - TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*+ - TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*- - TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0 - TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_s0bar - TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c+ - TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - // B*_c- - TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE); - - // Charm pentaquarks - // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121) - TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, -1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, 1, 0, 0, 0, 0, 0, 1, kTRUE); - - for (int j = 1; j < 6; j++) { - psmode[j][0] = psmode[j][1] = 0; - psratio[j] = 0.; - } - psmode[0][0] = 413; // D*+ - psmode[0][1] = -2212; // anti-p - psratio[0] = 100.; - TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); - psmode[0][0] = -413; // D*- - psmode[0][1] = 2212; // p - TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); - - // Define the 2-body phase space decay for the Lithium 4 - Int_t model4[6][3]; - Float_t bratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratiol4[kz] = 0.; - model4[kz][0] = 0; - model4[kz][1] = 0; - model4[kz][2] = 0; - } - bratiol4[0] = 100.; - model4[0][0] = 1000020030; // Helium3 - model4[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); - - // Define the 2-body phase space decay for the Anti-Lithium 4 - Int_t amodel4[6][3]; - Float_t abratiol4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratiol4[kz] = 0.; - amodel4[kz][0] = 0; - amodel4[kz][1] = 0; - amodel4[kz][2] = 0; - } - abratiol4[0] = 100.; - amodel4[0][0] = -1000020030; // Anti-Helium3 - amodel4[0][1] = -2212; // Anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); - - // Define the 2- and 3-body phase space decay for the Hypertriton - Int_t mode[6][3]; - Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 50.; - mode[0][0] = 1000020030; // Helium3 - mode[0][1] = -211; // negative pion - - bratio[1] = 50.; - mode[1][0] = 1000010020; // deuteron - mode[1][1] = 2212; // proton - mode[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); - - // Define the 2- and 3-body phase space decay for the Anti-Hypertriton - Int_t amode[6][3]; - Float_t abratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio[kz] = 0.; - amode[kz][0] = 0; - amode[kz][1] = 0; - amode[kz][2] = 0; - } - abratio[0] = 50.; - amode[0][0] = -1000020030; // anti- Helium3 - amode[0][1] = 211; // positive pion - abratio[1] = 50.; - amode[1][0] = -1000010020; // anti-deuteron - amode[1][1] = -2212; // anti-proton - amode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); - - ////// ----------Hypernuclei with Mass=4 ----------- ////////// - - // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 - - Int_t mode3[6][3]; - Float_t bratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio3[kz] = 0.; - mode3[kz][0] = 0; - mode3[kz][1] = 0; - mode3[kz][2] = 0; - } - bratio3[0] = 50.; - mode3[0][0] = 1000020040; // Helium4 - mode3[0][1] = -211; // negative pion - - bratio3[1] = 50.; - mode3[1][0] = 1000010030; // tritium - mode3[1][1] = 2212; // proton - mode3[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); - - // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 - Int_t amode3[6][3]; - Float_t abratio3[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio3[kz] = 0.; - amode3[kz][0] = 0; - amode3[kz][1] = 0; - amode3[kz][2] = 0; - } - abratio3[0] = 50.; - amode3[0][0] = -1000020040; // anti- Helium4 - amode3[0][1] = 211; // positive pion - abratio3[1] = 50.; - amode3[1][0] = -1000010030; // anti-tritium - amode3[1][1] = -2212; // anti-proton - amode3[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); - - // Define the 3-body phase space decay for the Hyperhelium 4 - Int_t mode4[6][3]; - Float_t bratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4[kz] = 0.; - mode4[kz][0] = 0; - mode4[kz][1] = 0; - mode4[kz][2] = 0; - } - bratio4[0] = 50.; - mode4[0][0] = 1000020030; // Helium3 - mode4[0][1] = -211; // negative pion - mode4[0][2] = 2212; // proton - - bratio4[1] = 50.; - mode4[1][0] = 1000030040; // lithium-4 - mode4[1][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); - - // Define the 2-body phase space decay for the Anti-Hyperhelium 4 - Int_t amode4[6][3]; - Float_t abratio4[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4[kz] = 0.; - amode4[kz][0] = 0; - amode4[kz][1] = 0; - amode4[kz][2] = 0; - } - abratio4[0] = 50.; - amode4[0][0] = -1000020030; // anti-Helium 3 - amode4[0][1] = 211; // positive pion - amode4[0][2] = -2212; // anti proton - - abratio4[1] = 50.; - amode4[1][0] = -1000030040; // antilithium-4 - amode4[1][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); - - // Define the 3-body phase space decay for the Hyperhelium 5 - Int_t mode41[6][3]; - Float_t bratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio41[kz] = 0.; - mode41[kz][0] = 0; - mode41[kz][1] = 0; - mode41[kz][2] = 0; - } - bratio41[0] = 50.; - mode41[0][0] = 1000020040; // Helium4 - mode41[0][1] = -211; // negative pion - mode41[0][2] = 2212; // proton - bratio41[1] = 50.; - mode41[1][0] = 1000020030; // Helium3 - mode41[1][1] = -211; // negative pion - mode41[1][2] = 1000010020; // Deuteron - - TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); - - // Define the 2-body phase space decay for the Anti-Hyperhelium 5 - Int_t amode41[6][3]; - Float_t abratio41[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio41[kz] = 0.; - amode41[kz][0] = 0; - amode41[kz][1] = 0; - amode41[kz][2] = 0; - } - abratio41[0] = 50.; - amode41[0][0] = -1000020040; // anti-Helium 4 - amode41[0][1] = 211; // positive pion - amode41[0][2] = -2212; // anti proton - abratio41[1] = 50.; - amode41[1][0] = -1000020030; // anti-Helium 3 - amode41[1][1] = 211; // positive pion - amode41[1][2] = -1000010020; // anti deuteron - - TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); - - // Define the 3-body phase space decay for the Doublehyperhydrogen 4 - Int_t mode42[6][3]; - Float_t bratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio42[kz] = 0.; - mode42[kz][0] = 0; - mode42[kz][1] = 0; - mode42[kz][2] = 0; - } - bratio42[0] = 50.; - mode42[0][0] = 1010020040; // Hyper-Helium4 - mode42[0][1] = -211; // negative pion - bratio42[1] = 50.; - mode42[1][0] = 1010010030; // Hypertriton - mode42[1][1] = 2212; // proton - mode42[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); - - - // Define the 2-body phase space decay for the Anti-Doublehyperhydrogen 4 - Int_t amode42[6][3]; - Float_t abratio42[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio42[kz] = 0.; - amode42[kz][0] = 0; - amode42[kz][1] = 0; - amode42[kz][2] = 0; - } - abratio42[0] = 100.; - amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 - amode42[0][1] = 211; // positive pion - abratio42[1] = 50.; - amode42[1][0] = -1010010030; // anti-Hypertriton - amode42[1][1] = -2212; // antiproton - amode42[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); - - // Define the decay for the 4Xi(-)He - Int_t mode4XiHe[6][3]; - Float_t bratio4XiHe[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4XiHe[kz] = 0.; - mode4XiHe[kz][0] = 0; - mode4XiHe[kz][1] = 0; - mode4XiHe[kz][2] = 0; - } - bratio4XiHe[0] = 33.; - mode4XiHe[0][0] = 1010020040; // HyperHelium4 - mode4XiHe[0][1] = -211; // negative pion - - bratio4XiHe[1] = 33.; - mode4XiHe[1][0] = 3122; // lambda - mode4XiHe[1][1] = 1000020030; // helium-3 - mode4XiHe[1][2] = -211; // negative pion - - bratio4XiHe[2] = 33.; - mode4XiHe[2][0] = 1000030040; // lithium-4 - mode4XiHe[2][1] = -211; // negative pion - mode4XiHe[2][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe); - - // Define the decay for the Anti-4Xi(-)He - Int_t amode4XiHe[6][3]; - Float_t abratio4XiHe[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4XiHe[kz] = 0.; - amode4XiHe[kz][0] = 0; - amode4XiHe[kz][1] = 0; - amode4XiHe[kz][2] = 0; - } - abratio4XiHe[0] = 33.; - amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4 - amode4XiHe[0][1] = 211; // positive pion - - abratio4XiHe[1] = 33.; - amode4XiHe[1][0] = -3122; // antilambda - amode4XiHe[1][1] = -1000020030; // antihelium-3 - amode4XiHe[1][2] = 211; // positive pion - - abratio4XiHe[2] = 33.; - amode4XiHe[2][0] = -1000030040; // antilithium-4 - amode4XiHe[2][1] = 211; // positive pion - amode4XiHe[2][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe); - - // Define the decay for the 4Xi(-)H - Int_t mode4XiH[6][3]; - Float_t bratio4XiH[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4XiH[kz] = 0.; - mode4XiH[kz][0] = 0; - mode4XiH[kz][1] = 0; - mode4XiH[kz][2] = 0; - } - bratio4XiH[0] = 33.; - mode4XiH[0][0] = 1010010040; // HyperHydrogen4 - mode4XiH[0][1] = -211; // negative pion - - bratio4XiH[1] = 33.; - mode4XiH[1][0] = 3122; // lambda - mode4XiH[1][1] = 1000010030; // triton - mode4XiH[1][2] = -211; // negative pion - - bratio4XiH[2] = 33.; - mode4XiH[2][0] = 1000020040; // alpha - mode4XiH[2][1] = -211; // negative pion - mode4XiH[2][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH); - - // Define the decay for the Anti-4Xi(-)H - Int_t amode4XiH[6][3]; - Float_t abratio4XiH[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4XiH[kz] = 0.; - amode4XiH[kz][0] = 0; - amode4XiH[kz][1] = 0; - amode4XiH[kz][2] = 0; - } - abratio4XiH[0] = 33.; - amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4 - amode4XiH[0][1] = 211; // positive pion - - abratio4XiH[1] = 33.; - amode4XiH[1][0] = -3122; // antilambda - amode4XiH[1][1] = -1000010030; // antitriton - amode4XiH[1][2] = 211; // positive pion - - abratio4XiH[2] = 33.; - amode4XiH[2][0] = -1000020040; // antialpha - amode4XiH[2][1] = 211; // positive pion - amode4XiH[2][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH); - - // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma - Int_t mode4s[6][3]; - Float_t bratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio4s[kz] = 0.; - mode4s[kz][0] = 0; - mode4s[kz][1] = 0; - mode4s[kz][2] = 0; - } - bratio4s[0] = 20.; - mode4s[0][0] = 1000020040; // Helium4 - mode4s[0][1] = 111; // pion0 - bratio4s[1] = 40.; - mode4s[1][0] = 1000010030; // tritium - mode4s[1][2] = 2212; // proton - mode4s[1][1] = 111; // pion0 - bratio4s[2] = 40.; - mode4s[2][0] = 1000010030; // tritium - mode4s[2][2] = 2212; // pion+ - mode4s[2][1] = 2112; // neutron - - TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); - - // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma - Int_t amode4s[6][3]; - Float_t abratio4s[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio4s[kz] = 0.; - amode4s[kz][0] = 0; - amode4s[kz][1] = 0; - amode4s[kz][2] = 0; - } - abratio4s[0] = 50.; - amode4s[0][0] = -1000020040; // anti-Helium4 - amode4s[0][1] = 111; // pion0 - abratio4s[1] = 50.; - amode4s[1][0] = -1000010030; // anti-tritium - amode4s[1][2] = -2212; // anti-proton - amode4s[1][1] = 111; // pion0 - abratio4s[2] = 50.; - amode4s[2][0] = -1000010030; // anti-tritium - amode4s[2][2] = -211; // pion- - amode4s[2][1] = -2112; // anti-neutron - - TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); - - // Define the 2-body phase space decay for the Lambda-neutron boundstate - Int_t mode1[6][3]; - Float_t bratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio1[kz] = 0.; - mode1[kz][0] = 0; - mode1[kz][1] = 0; - mode1[kz][2] = 0; - } - bratio1[0] = 100.; - mode1[0][0] = 1000010020; // deuteron - mode1[0][1] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); - - // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate - Int_t amode1[6][3]; - Float_t abratio1[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio1[kz] = 0.; - amode1[kz][0] = 0; - amode1[kz][1] = 0; - amode1[kz][2] = 0; - } - abratio1[0] = 100.; - amode1[0][0] = -1000010020; // anti-deuteron - amode1[0][1] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); - - // Define the 2-body phase space decay for the H-Dibaryon - Int_t mode2[6][3]; - Float_t bratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio2[kz] = 0.; - mode2[kz][0] = 0; - mode2[kz][1] = 0; - mode2[kz][2] = 0; - } - bratio2[0] = 100.; - mode2[0][0] = 3122; // Lambda - mode2[0][1] = 2212; // proton - mode2[0][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); - - // Define the 2-body phase space decay for the Anti-H-Dibaryon - Int_t amode2[6][3]; - Float_t abratio2[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio2[kz] = 0.; - amode2[kz][0] = 0; - amode2[kz][1] = 0; - amode2[kz][2] = 0; - } - abratio2[0] = 100.; - amode2[0][0] = -3122; // anti-deuteron - amode2[0][1] = -2212; // anti-proton - amode2[0][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); - - // Define the 2-body phase space decay for the Xi0P - Int_t mode5[6][3]; - Float_t bratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio5[kz] = 0.; - mode5[kz][0] = 0; - mode5[kz][1] = 0; - mode5[kz][2] = 0; - } - bratio5[0] = 100.; - mode5[0][0] = 3122; // Lambda - mode5[0][1] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); - - // Define the 2-body phase space decay for the Anti-Xi0P - Int_t amode5[6][3]; - Float_t abratio5[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio5[kz] = 0.; - amode5[kz][0] = 0; - amode5[kz][1] = 0; - amode5[kz][2] = 0; - } - abratio5[0] = 100.; - amode5[0][0] = -3122; // anti-Lambda - amode5[0][1] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); - - // Define the 2-body phase space decay for the Lambda-Neutron-Neutron - Int_t mode6[6][3]; - Float_t bratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio6[kz] = 0.; - mode6[kz][0] = 0; - mode6[kz][1] = 0; - mode6[kz][2] = 0; - } - bratio6[0] = 100.; - mode6[0][0] = 1000010030; // triton - mode6[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); - - // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron - Int_t amode6[6][3]; - Float_t abratio6[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio6[kz] = 0.; - amode6[kz][0] = 0; - amode6[kz][1] = 0; - amode6[kz][2] = 0; - } - abratio6[0] = 100.; - amode6[0][0] = -1000010030; // anti-triton - amode6[0][1] = 211; // pion - - TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); - - // Define the 3-body phase space decay for the Omega-Proton - Int_t mode7[6][3]; - Float_t bratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio7[kz] = 0.; - mode7[kz][0] = 0; - mode7[kz][1] = 0; - mode7[kz][2] = 0; - } - bratio7[0] = 100.; - mode7[0][0] = 3122; // Lambda - mode7[0][1] = -321; // negative Kaon - mode7[0][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); - - // Define the 3-body phase space decay for the Anti-Omega-Proton - Int_t amode7[6][3]; - Float_t abratio7[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio7[kz] = 0.; - amode7[kz][0] = 0; - amode7[kz][1] = 0; - amode7[kz][2] = 0; - } - abratio7[0] = 100.; - amode7[0][0] = -3122; // anti-Lambda - amode7[0][1] = 321; // positive kaon - amode7[0][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); - - // Define the 2-body phase space decay for the Omega-Neutron - Int_t mode8[6][3]; - Float_t bratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio8[kz] = 0.; - mode8[kz][0] = 0; - mode8[kz][1] = 0; - mode8[kz][2] = 0; - } - bratio8[0] = 100.; - mode8[0][0] = 3122; // Lambda - mode8[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); - - // Define the 2-body phase space decay for the Anti-Omega-Neutron - Int_t amode8[6][3]; - Float_t abratio8[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio8[kz] = 0.; - amode8[kz][0] = 0; - amode8[kz][1] = 0; - amode8[kz][2] = 0; - } - abratio8[0] = 100.; - amode8[0][0] = -3122; // anti-Lambda - amode8[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); - - // Define the 3-body phase space decay for the Omega-Omega - Int_t mode9[6][3]; - Float_t bratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio9[kz] = 0.; - mode9[kz][0] = 0; - mode9[kz][1] = 0; - mode9[kz][2] = 0; - } - bratio9[0] = 100.; - mode9[0][0] = 3334; // negative Omega - mode9[0][1] = 3312; // negative Xi - - TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); - - // Define the 3-body phase space decay for the Anti-Omega-Omega - Int_t amode9[6][3]; - Float_t abratio9[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio9[kz] = 0.; - amode9[kz][0] = 0; - amode9[kz][1] = 0; - amode9[kz][2] = 0; - } - abratio9[0] = 100.; - amode9[0][0] = -3334; // positive Omega - amode9[0][1] = -3312; // positive Xi - - TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); - - // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton - Int_t mode10[6][3]; - Float_t bratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio10[kz] = 0.; - mode10[kz][0] = 0; - mode10[kz][1] = 0; - mode10[kz][2] = 0; - } - bratio10[0] = 50.; - mode10[0][0] = 3122; // Lambda - mode10[0][1] = 2212; // proton - bratio10[1] = 50.; - mode10[1][0] = 2212; // proton - mode10[1][1] = -321; // negative kaon - mode10[1][2] = 2212; // proton - - TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); - - // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton - Int_t amode10[6][3]; - Float_t abratio10[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio10[kz] = 0.; - amode10[kz][0] = 0; - amode10[kz][1] = 0; - amode10[kz][2] = 0; - } - abratio10[0] = 50.; - amode10[0][0] = -3122; // anti-Lambda - amode10[0][1] = -2212; // anti-proton - abratio10[1] = 50.; - amode10[1][0] = -2212; // anti-proton - amode10[1][1] = 321; // positive kaon - amode10[1][2] = -2212; // anti-proton - - TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); - - // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) - Int_t mode11[6][3]; - Float_t bratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio11[kz] = 0.; - mode11[kz][0] = 0; - mode11[kz][1] = 0; - mode11[kz][2] = 0; - } - bratio11[0] = 50.; - mode11[0][0] = 3122; // Lambda - mode11[0][1] = 3122; // Lambda - bratio11[1] = 50.; - mode11[1][0] = 3122; // Lambda - mode11[1][1] = 2212; // proton - mode11[1][2] = -211; // negative pion - - TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); - - // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) - Int_t amode11[6][3]; - Float_t abratio11[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - abratio11[kz] = 0.; - amode11[kz][0] = 0; - amode11[kz][1] = 0; - amode11[kz][2] = 0; - } - abratio11[0] = 50.; - amode11[0][0] = -3122; // anti-Lambda - amode11[0][1] = -3122; // anti-Lambda - abratio11[1] = 50.; - amode11[1][0] = -3122; // anti-Lambda - amode11[1][1] = -2212; // anti-proton - amode11[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); - - // Define the decays for the c-triton - Int_t ctmode[6][3]; - Float_t ctbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - ctbratio[kz] = 0.; - ctmode[kz][0] = 0; - ctmode[kz][1] = 0; - ctmode[kz][2] = 0; - } - ctbratio[0] = 50.; - ctmode[0][0] = 1000020030; // Helium3 - ctmode[0][1] = 310; // K0s - - ctbratio[1] = 50.; - ctmode[1][0] = 1000020030; // Helium3 - ctmode[1][1] = -321; // negative kaon - ctmode[1][2] = 211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); - - // Define the decays for the anti-c-triton - Int_t actmode[6][3]; - Float_t actbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - actbratio[kz] = 0.; - actmode[kz][0] = 0; - actmode[kz][1] = 0; - actmode[kz][2] = 0; - } - actbratio[0] = 50.; - actmode[0][0] = -1000020030; // Helium3 - actmode[0][1] = 310; // K0s - - actbratio[1] = 50.; - actmode[1][0] = -1000020030; // Helium3 - actmode[1][1] = 321; // negative kaon - actmode[1][2] = -211; // positive pion - - TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); - - // Define the decays for the c-deuteron - Int_t cdmode[6][3]; - Float_t cdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - cdbratio[kz] = 0.; - cdmode[kz][0] = 0; - cdmode[kz][1] = 0; - cdmode[kz][2] = 0; - } - cdbratio[0] = 50.; - cdmode[0][0] = 1000010020; // deuteron - cdmode[0][1] = -321; // negative kaon - cdmode[0][2] = 211; // positive pion - - cdbratio[1] = 50.; - cdmode[1][0] = 1000010020; // deuteron - cdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); - - // Define the decays for the anti-c-deuteron - Int_t acdmode[6][3]; - Float_t acdbratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - acdbratio[kz] = 0.; - acdmode[kz][0] = 0; - acdmode[kz][1] = 0; - acdmode[kz][2] = 0; - } - acdbratio[0] = 50.; - acdmode[0][0] = -1000010020; // deuteron - acdmode[0][1] = 321; // negative kaon - acdmode[0][2] = -211; // positive pion - - acdbratio[1] = 50.; - acdmode[1][0] = -1000010020; // deuteron - acdmode[1][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); - - /////////////////////////////////////////////////////////////////// - - // Define the 2-body phase space decay for the f0(980) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); - - // Define the 2-body phase space decay for the f2(1270) - // Int_t mode[6][3]; - // Float_t bratio[6]; - - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 211; // pion - mode[0][1] = -211; // pion - - TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); - - // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710 - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - bratio[0] = 100.; - mode[0][0] = 310; // K0s - mode[0][1] = 310; // K0s - - TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) - TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) - TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) - TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) - TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) - - // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) - for (Int_t kz = 0; kz < 6; kz++) { - bratio[kz] = 0.; - mode[kz][0] = 0; - mode[kz][1] = 0; - mode[kz][2] = 0; - } - - bratio2[0] = 50.; - mode[0][0] = 310; // K0s - mode[0][1] = -321; // anti-K - mode[0][2] = 211; // pion+ - - bratio2[1] = 50.; - mode[1][0] = 310; // K0s - mode[1][1] = 321; // K - mode[1][2] = -211; // pion- - - TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) - TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) - - // Lambda1520/Lambda1520bar - - TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, 1, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); - - // Lambda1520 decay modes - Int_t lmode[9][3]; - Float_t lbratio[9]; - for (Int_t kz = 0; kz < 9; kz++) { - lbratio[kz] = 0.; - lmode[kz][0] = 0; - lmode[kz][1] = 0; - lmode[kz][2] = 0; - } - - // L(1520) -> p K- - lbratio[0] = 0.229944; - lmode[0][0] = 2212; - lmode[0][1] = -321; - - // L(1520) -> n K0 - lbratio[1] = 0.229944; - lmode[1][0] = 2112; - lmode[1][1] = -311; - - // L(1520) -> Sigma+ pi- - lbratio[2] = 0.143076; - lmode[2][0] = 3222; - lmode[2][1] = -211; - - // L(1520) -> Sigma0 pi0 - lbratio[3] = 0.143076; - lmode[3][0] = 3212; - lmode[3][1] = 111; - - // L(1520) -> Sigma- pi+ - lbratio[4] = 0.143076; - lmode[4][0] = 3112; - lmode[4][1] = 211; - - // L(1520) -> Sigma*- pi+ - lbratio[5] = 0.034066; - lmode[5][0] = 3114; - lmode[5][1] = 211; - - // L(1520) -> Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = 3214; - lmode[6][1] = 111; - - // L(1520) -> Sigma*+ pi- - lbratio[7] = 0.034066; - lmode[7][0] = 3224; - lmode[7][1] = -211; - - // L(1520) -> Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = 3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); - - // Lambda1520bar decay modes - - // L(1520)bar -> p- K+ - lbratio[0] = 0.229944; - lmode[0][0] = -2212; - lmode[0][1] = 321; - - // L(1520)bar -> nbar K0bar - lbratio[1] = 0.229944; - lmode[1][0] = -2112; - lmode[1][1] = 311; - - // L(1520)bar -> Sigmabar- pi+ - lbratio[2] = 0.143076; - lmode[2][0] = -3222; - lmode[2][1] = 211; - - // L(1520)bar -> Sigma0bar pi0 - lbratio[3] = 0.143076; - lmode[3][0] = -3212; - lmode[3][1] = 111; - - // L(1520)bar -> Sigmabar+ pi- - lbratio[4] = 0.143076; - lmode[4][0] = -3112; - lmode[4][1] = -211; - - // L(1520)bar -> anti-Sigma*- pi- - lbratio[5] = 0.034066; - lmode[5][0] = -3114; - lmode[5][1] = -211; - - // L(1520)bar -> anti-Sigma*0 pi0 - lbratio[6] = 0.034066; - lmode[6][0] = -3214; - lmode[6][1] = 111; - - // L(1520)bar -> anti-Sigma*+ pi+ - lbratio[7] = 0.034066; - lmode[7][0] = -3224; - lmode[7][1] = 211; - - // L(1520)bar -> Anti-Lambda gamma - lbratio[8] = 0.008687; - lmode[8][0] = -3122; - lmode[8][1] = 22; - - TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); - - // -------------------------------------------------------------------- - - //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951) - TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE); - TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, -2, kTRUE); -} - -void O2MCApplicationBase::AddParticles() -{ - // dispatch first to function in FairRoot - FairMCApplication::AddParticles(); - - // register special particles for ALICE - // TODO: try to make use of FairRoot if easier or more customizable - addSpecialParticles(); - - auto& param = o2::conf::SimUserDecay::Instance(); - LOG(info) << "Printing \'SimUserDecay\' parameters"; - LOG(info) << param; - - // check if there are PDG codes requested for user decay - if (param.pdglist.empty()) { - return; - } - - // loop over PDG codes in the string - std::stringstream ss(param.pdglist); - int pdg; - while (ss >> pdg) { - LOG(info) << "Setting user decay for PDG " << pdg; - TVirtualMC::GetMC()->SetUserDecay(pdg); - } -} - -void O2MCApplicationBase::initTrackRefHook() -{ - if (mCutParams.stepTrackRefHook) { - LOG(info) << "Initializing the hook for TrackReferences during stepping"; - auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); - if (std::filesystem::exists(expandedTrackRefHookFileName)) { - // if this file exists we will compile the hook on the fly - mTrackRefFcn = o2::conf::GetFromMacro(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook"); - LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; - } else { - LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; - mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing - } - } -} - -void O2MCApplication::initLate() -{ - o2::utils::ShmManager::Instance().occupySegment(); - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->initializeLate(); - } - } -} - -void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const -{ - // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); - o2::base::attachTMessage(info, *mSimDataChannel, parts); -} - -// helper function to fetch data from FairRootManager branch and serialize it -// returns handle to container -template -const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts) -{ - auto mgr = FairRootManager::Instance(); - // check if branch is present - if (mgr->GetBranchId(name) == -1) { - LOG(error) << "Branch " << name << " not found"; - return nullptr; - } - auto data = mgr->InitObjectAs(name.c_str()); - if (data) { - o2::base::attachTMessage(*data, channel, parts); - } - return data; -} - -void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) -{ - mSubEventInfo = i; - // being communicated a SubEventInfo also means we get a FairMCEventHeader - fMCEventHeader = &mSubEventInfo->mMCEventHeader; -} - -void O2MCApplication::SendData() -{ - fair::mq::Parts simdataparts; - - // fill these parts ... the receiver has to unpack similary - // TODO: actually we could just loop over branches in FairRootManager at this moment? - mSubEventInfo->npersistenttracks = static_cast(GetStack())->getMCTracks()->size(); - mSubEventInfo->nprimarytracks = static_cast(GetStack())->GetNprimary(); - attachSubEventInfo(simdataparts, *mSubEventInfo); - auto tracks = attachBranch>("MCTrack", *mSimDataChannel, simdataparts); - attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); - assert(tracks->size() == mSubEventInfo->npersistenttracks); - - for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); - } - } - LOG(info) << "sending message with " << simdataparts.Size() << " parts"; - mSimDataChannel->Send(simdataparts); -} -} // namespace steer -} // namespace o2 From e2d859325c4b6030c31b607e3e2ec500bb40242b Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:37:27 +0100 Subject: [PATCH 07/15] Uploading O2MCApplication.cxx after formatting changes --- Steer/src/O2MCApplication.cxx | 1778 +++++++++++++++++++++++++++++++++ 1 file changed, 1778 insertions(+) create mode 100644 Steer/src/O2MCApplication.cxx diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx new file mode 100644 index 0000000000000..99cd1da90e955 --- /dev/null +++ b/Steer/src/O2MCApplication.cxx @@ -0,0 +1,1778 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include + +#include "DetectorsBase/Aligner.h" +#include "DetectorsBase/GeometryManagerParam.h" +#include "DetectorsBase/MaterialManager.h" +#include "SimConfig/GlobalProcessCutSimParam.h" +#include "SimConfig/SimUserDecay.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace o2 { +namespace steer { +// helper function to send trivial data +template +void TypedVectorAttach(const char *name, fair::mq::Channel &channel, + fair::mq::Parts &parts) { + static auto mgr = FairRootManager::Instance(); + auto vector = mgr->InitObjectAs *>(name); + if (vector) { + auto buffer = (char *)&(*vector)[0]; + auto buffersize = vector->size() * sizeof(T); + fair::mq::MessagePtr message(channel.NewMessage( + buffer, buffersize, [](void *data, void *hint) {}, buffer)); + parts.AddPart(std::move(message)); + } +} + +void O2MCApplicationBase::Stepping() { + mStepCounter++; + + // check the max time of flight condition + const auto tof = fMC->TrackTime(); + auto ¶ms = o2::GlobalProcessCutSimParam::Instance(); + if (tof > params.TOFMAX) { + fMC->StopTrack(); + return; + } + + mLongestTrackTime = std::max((double)mLongestTrackTime, tof); + + if (mCutParams.stepFiltering) { + // we can kill tracks here based on our + // custom detector specificities + + // Note that this is done in addition to the generic + // R + Z-cut mechanism at VMC level. + + float x, y, z; + fMC->TrackPosition(x, y, z); + + // this function is implementing a basic z-dependent R cut + // can be generalized later on + auto outOfR = [x, y, this](float z) { + // for the moment for cases when we have ZDC enabled + if (std::abs(z) > mCutParams.tunnelZ) { + if ((x * x + y * y) > + mCutParams.maxRTrackingZDC * mCutParams.maxRTrackingZDC) { + return true; + } + } + return false; + }; + + if (z > mCutParams.ZmaxA || -z > mCutParams.ZmaxC || outOfR(z)) { + fMC->StopTrack(); + return; + } + } + + if (mCutParams.stepTrackRefHook) { + mTrackRefFcn(fMC); + } + + // dispatch now to stepping function in FairRoot + FairMCApplication::Stepping(); +} + +void O2MCApplicationBase::PreTrack() { + // dispatch first to function in FairRoot + FairMCApplication::PreTrack(); +} + +void O2MCApplicationBase::ConstructGeometry() { + // fill the mapping + mModIdToName.clear(); + o2::detectors::DetID::mask_t dmask{}; + for (int i = 0; i < fModules->GetEntries(); ++i) { + auto mod = static_cast(fModules->At(i)); + if (mod) { + mModIdToName[mod->GetModId()] = mod->GetName(); + int did = o2::detectors::DetID::nameToID(mod->GetName()); + if (did >= 0) { + dmask |= o2::detectors::DetID::getMask(did); + } + } + } + gGeoManager->SetUniqueID(dmask.to_ulong()); + FairMCApplication::ConstructGeometry(); + + std::ofstream voltomodulefile("MCStepLoggerVolMap.dat"); + // construct the volume name to module name mapping useful for StepAnalysis + auto vollist = gGeoManager->GetListOfVolumes(); + for (int i = 0; i < vollist->GetEntries(); ++i) { + auto vol = static_cast(vollist->At(i)); + auto iter = fModVolMap.find(vol->GetNumber()); + voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] + << "\n"; + } +} + +void O2MCApplicationBase::InitGeometry() { + // load special cuts which might be given from the outside first. + auto &matMgr = o2::base::MaterialManager::Instance(); + matMgr.loadCutsAndProcessesFromJSON( + o2::base::MaterialManager::ESpecial::kTRUE); + matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); + // During the following, FairModule::SetSpecialPhysicsCuts will be called for + // each module + FairMCApplication::InitGeometry(); + matMgr.writeCutsAndProcessesToJSON(); + // now the sensitive volumes are set up in fVolMap and we can query them + for (auto e : fVolMap) { + // since fVolMap contains multiple entries (if multiple copies), this may + // write to the same entry multiple times + mSensitiveVolumes[e.first] = e.second->GetName(); + } + std::ofstream sensvolfile("MCStepLoggerSenVol.dat"); + for (auto e : mSensitiveVolumes) { + sensvolfile << e.first << ":" << e.second << "\n"; + } +} + +bool O2MCApplicationBase::MisalignGeometry() { + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector *)det)->addAlignableVolumes(); + } + } + + // we stream out both unaligned geometry (to allow for + // dynamic post-alignment) as well as the aligned version + // which can be used by digitization etc. immediately + auto &confref = o2::conf::SimConfig::Instance(); + auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); + // since in general the geometry is a CCDB object, it must be exported under + // the standard name + gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str()); + gGeoManager->Export(geomfile.c_str()); + + // apply alignment for included detectors AFTER exporting ideal geometry + auto &aligner = o2::base::Aligner::Instance(); + aligner.applyAlignment(confref.getTimestamp()); + + // export aligned geometry into different file + auto alignedgeomfile = + o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); + gGeoManager->Export(alignedgeomfile.c_str()); + + auto ¶m = o2::GeometryManagerParam::Instance(); + + // fill parallel world geometry if activated + if (param.useParallelWorld) { + TGeoParallelWorld *pw = + gGeoManager->CreateParallelWorld("priority_sensors"); + if (param.usePwGeoBVH) { + pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); + } + if (param.usePwCaching) { + TGeoNavigator::SetPWSafetyCaching(true); + } + for (auto det : listDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector *)det)->fillParallelWorld(); + } + } + gGeoManager->SetUseParallelWorldNav(true); + } + + // return original return value of misalignment procedure + return true; +} + +void O2MCApplicationBase::finishEventCommon() { + LOG(info) << "This event/chunk did " << mStepCounter << " steps"; + LOG(info) << "Longest track time is " << mLongestTrackTime; + + auto header = static_cast(fMCEventHeader); + header->getMCEventStats().setNSteps(mStepCounter); + header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); + + static_cast(GetStack())->updateEventStats(); +} + +void O2MCApplicationBase::FinishEvent() { + finishEventCommon(); + + auto header = static_cast(fMCEventHeader); + auto &confref = o2::conf::SimConfig::Instance(); + + if (confref.isFilterOutNoHitEvents() && + header->getMCEventStats().getNHits() == 0) { + LOG(info) << "Discarding current event due to no hits"; + SetSaveCurrentEvent(false); + } + + // dispatch to function in FairRoot + FairMCApplication::FinishEvent(); +} + +void O2MCApplicationBase::BeginEvent() { + // dispatch first to function in FairRoot + FairMCApplication::BeginEvent(); + + // register event header with our stack + auto header = static_cast(fMCEventHeader); + static_cast(GetStack()) + ->setMCEventStats(&header->getMCEventStats()); + + mStepCounter = 0; + mLongestTrackTime = 0; +} + +void addSpecialParticles() { + // + // Add particles needed for ALICE (not present in Geant3 or Geant4) + // Code ported 1-1 from AliRoot + // + + LOG(info) << "Adding custom particles to VMC"; + + // ### NUCLEI ### + // 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); + + // ### HYPER NUCLEI (|S| = 1) ### + // 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); + + // Hyper hydrogen 4 + 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 + 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 + 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 + 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); + + // 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); + + // ### HYPER NUCLEI (|S| = 2) ### + // 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); + + // 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); + // 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); + + // 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); + + // ### EXOTICA ### + // 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); + + // Anti-Lambda-Neutron + TVirtualMC::GetMC()->DefineParticle( + -1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, + 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, 0, 0, + 0, 0, 0, 2, kFALSE); + + // Anti-H-Dibaryon + TVirtualMC::GetMC()->DefineParticle(-1020000020, "AntiHdibaryon", kPTNeutron, + 2.23, 0.0, 2.632e-10, "Hadron", 0.0, 0, 1, + 0, 0, 0, 0, 0, 2, kFALSE); + + // Xi-Proton + 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); + + // 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); + + // Anti-Lambda-Neutron-Neutron + TVirtualMC::GetMC()->DefineParticle( + -1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + + // Omega-Proton + TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, + 2.592, 0.0, 2.632e-10, "Hadron", 0.0, 2, + 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // Anti-Omega-Proton + TVirtualMC::GetMC()->DefineParticle( + -1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, + "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // Omega-Neutron + 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); + + // Omega-Omega + TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, + 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, + 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // Anti-Omega-Omega + TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, + 3.229, 2.0, 2.632e-10, "Hadron", 0.0, 0, + 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // Lambda(1405)-Proton + 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); + + // 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); + + // Anti-Lambda(1405)-Lambda(1405) + TVirtualMC::GetMC()->DefineParticle( + -1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, + 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + + // 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); + + // 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); + + // Resonances not in Generators + // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV) + TVirtualMC::GetMC()->DefineParticle(9010221, "f0_980", kPTNeutron, 0.98, 0.0, + 9.403e-24, "Hadron", 7e-2, 0, 1, 1, 0, 0, + 1, 0, 0, kTRUE); + + // f2(1270) (PDG: width = 185 MeV) + TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, + 3.558e-24, "Hadron", 0.185, 4, 1, 1, 0, 0, + 1, 0, 0, kTRUE); + + // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20223, "f1_1285", kPTNeutron, 1.28210, + 0.0, 1e-24, "Hadron", 0.02420, 3, 1, 0, 0, + 0, 0, 0, 1, kTRUE); + // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(20333, "f1_1420", kPTNeutron, 1.42640, + 0.0, 1e-24, "Hadron", 0.05490, 3, 1, 0, 0, + 0, 0, 0, 1, kTRUE); + + // Glueball hunting family + // Their life times are not known, so we set them to 1e-24 + // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10221, "f0_1370", kPTNeutron, 1.37, 0.0, + 1e-24, "Hadron", 0.2, 1, 1, 1, 0, 0, 1, 0, + 0, kTRUE); + // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct) + TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, + 1e-24, "Hadron", 0.1078, 1, 1, 1, 1, 0, 1, + 0, 0, kTRUE); + // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(9030221, "f0_1500", kPTNeutron, 1.506, + 0.0, 1e-24, "Hadron", 0.112, 0, 1, 1, 0, + 0, 1, 0, 0, kTRUE); + // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, + 1e-24, "Hadron", 0.139, 1, 1, 1, 0, 0, 1, + 0, 0, kTRUE); + // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct + TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, + 1e-24, "Hadron", 0.073, 5, 1, 1, 0, 0, 1, + 0, 0, kTRUE); + + // Xi_0(1820) + TVirtualMC::GetMC()->DefineParticle(123324, "Xi_0_1820", kPTNeutron, 1.8234, + 0.0, 2.742550e-23, "Hadron", 0.024, 3, -1, + 0, 1, 1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123324, "Xi_0_Bar_1820", kPTNeutron, + 1.8234, 0.0, 2.742550e-23, "Hadron", + 0.024, 3, -1, 0, 1, -1, 0, 0, -1, kTRUE); + + int xi_0_1820_mode[6][3] = {{0}}; + float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + xi_0_1820_mode[0][0] = 3122; // Lambda + xi_0_1820_mode[0][1] = 310; // K0s + TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode); + xi_0_1820_mode[0][0] = -3122; // Lambda-bar + TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode); + + // Xi-+(1820) + TVirtualMC::GetMC()->DefineParticle(123314, "Xi_Minus_1820", kPTHadron, + 1.8234, -1.0, 2.742550e-23, "Hadron", + 0.024, 3, -1, 0, 1, -1, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-123314, "Xi_Plus_1820", kPTHadron, + 1.8234, 1.0, 2.742550e-23, "Hadron", + 0.024, 3, -1, 0, 1, 1, 0, 0, -1, kTRUE); + + int xi_charged_1820_mode[6][3] = {{0}}; + float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f}; + xi_charged_1820_mode[0][0] = 3122; // Lambda + xi_charged_1820_mode[0][1] = -321; // K- + TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, + xi_charged_1820_mode); + xi_charged_1820_mode[0][0] = -3122; // Lambda-bar + xi_charged_1820_mode[0][1] = 321; // K+ + TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, + xi_charged_1820_mode); + + // Ps - hidden strange (s-sbar) pentaquarks + TVirtualMC::GetMC()->DefineParticle(9322134, "Ps_2100", kPTHadron, 2.1, 1.0, + 1.6455e-23, "Hadron", 4.e-2, 3, -1, 0, 0, + 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322134, "AntiPs_2100", kPTHadron, 2.1, + -1.0, 1.6455e-23, "Hadron", 4.e-2, 3, -1, + 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(9322136, "Ps_2500", kPTHadron, 2.5, 1.0, + 1.6455e-23, "Hadron", 4.e-2, 5, 1, 0, 0, + 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9322136, "AntiPs_2500", kPTHadron, 2.5, + -1.0, 1.6455e-23, "Hadron", 4.e-2, 5, 1, + 0, 0, 0, 0, 0, -1, kTRUE); + + Int_t psmode[6][3] = {0}; + Float_t psratio[6] = {0.f}; + psratio[0] = 100.; + + psmode[0][0] = 333; // phi + psmode[0][1] = 2212; // proton + TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode); + + psmode[0][1] = -2212; // anti-proton + TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode); + TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode); + + // Omega(2012) + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + + TVirtualMC::GetMC()->DefineParticle(3335, "Omega2012", kPTHadron, 2.012, -1.0, + 1.0285e-22, "Hadron", 0.0064, 3, -1, 0, 0, + 0, 0, 0, 1, kTRUE); + psmode[0][0] = 3312; // Xi- + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode); + + TVirtualMC::GetMC()->DefineParticle(-3335, "AntiOmega2012", kPTHadron, 2.012, + 1.0, 1.0285e-22, "Hadron", 0.0064, 3, 1, + 0, 0, 0, 0, 0, -1, kTRUE); + psmode[0][0] = -3312; // anti-Xi+ + psmode[0][1] = 310; // K0S + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode); + + // d*(2380) - dibaryon resonance + TVirtualMC::GetMC()->DefineParticle(900010020, "d*_2380", kPTHadron, 2.38, + 1.0, 0.94e-23, "Ion", 0.07, 6, 1, 0, 0, 0, + 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900010020, "d*_2380_bar", kPTHadron, + 2.38, -1.0, 0.94e-23, "Ion", 0.07, 6, 1, + 0, 0, 0, 0, 0, -2, kTRUE); + + Int_t dstmode[6][3] = {0}; + Float_t dstratio[6] = {0.f}; + dstratio[0] = 100; // For now we implement only the mode of interest + // d* -> d pi+ pi- + dstmode[0][0] = 1000010020; // deuteron + dstmode[0][1] = -211; // negative pion + dstmode[0][2] = 211; // positive pion + TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode); + + dstmode[0][0] = -1000010020; // anti-deuteron + TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode); + + // Heavy vector mesons + // D*+ + TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // D*- + TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // D*0 + TVirtualMC::GetMC()->DefineParticle(423, "D*0", kPTHadron, 2.0007, 0.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // D*0bar + TVirtualMC::GetMC()->DefineParticle(-423, "D*0bar", kPTHadron, 2.0007, 0.0, + 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, + 0, kTRUE); + // D*_s+ + TVirtualMC::GetMC()->DefineParticle(433, "D*_s+", kPTHadron, 2.1123, 1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // D*_s- + TVirtualMC::GetMC()->DefineParticle(-433, "D*_s-", kPTHadron, 2.1123, -1.0, + 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, + 0, kTRUE); + // B*0 + TVirtualMC::GetMC()->DefineParticle(513, "B*0", kPTHadron, 5.3251, 0.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // B*0bar + TVirtualMC::GetMC()->DefineParticle(-513, "B*0bar", kPTHadron, 5.3251, 0.0, + 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, + 0, kTRUE); + // B*+ + TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // B*- + TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // B*_s0 + TVirtualMC::GetMC()->DefineParticle(533, "B*_s0", kPTHadron, 5.4128, 0.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // B*_s0bar + TVirtualMC::GetMC()->DefineParticle(-533, "B*_s0bar", kPTHadron, 5.4128, 0.0, + 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, + 0, kTRUE); + // B*_c+ + TVirtualMC::GetMC()->DefineParticle(543, "B*_c+", kPTHadron, 6.6020, 1.0, 0.0, + "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, + kTRUE); + // B*_c- + TVirtualMC::GetMC()->DefineParticle(-543, "B*_c-", kPTHadron, 6.6020, -1.0, + 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, + 0, kTRUE); + + // Charm pentaquarks + // Theta_c: isospin singlet with J=1/2+ (see + // https://arxiv.org/abs/hep-ph/0409121) + TVirtualMC::GetMC()->DefineParticle(9422111, "Anti-Theta_c_3100", kPTHadron, + 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, + 1, 0, 0, 0, 0, 0, -1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-9422111, "Theta_c_3100", kPTHadron, + 3.099, 0., 6.9e-21, "Hadron", 83.e-6, 1, + 1, 0, 0, 0, 0, 0, 1, kTRUE); + + for (int j = 1; j < 6; j++) { + psmode[j][0] = psmode[j][1] = 0; + psratio[j] = 0.; + } + psmode[0][0] = 413; // D*+ + psmode[0][1] = -2212; // anti-p + psratio[0] = 100.; + TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode); + psmode[0][0] = -413; // D*- + psmode[0][1] = 2212; // p + TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode); + + // Define the 2-body phase space decay for the Lithium 4 + Int_t model4[6][3]; + Float_t bratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratiol4[kz] = 0.; + model4[kz][0] = 0; + model4[kz][1] = 0; + model4[kz][2] = 0; + } + bratiol4[0] = 100.; + model4[0][0] = 1000020030; // Helium3 + model4[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4); + + // Define the 2-body phase space decay for the Anti-Lithium 4 + Int_t amodel4[6][3]; + Float_t abratiol4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratiol4[kz] = 0.; + amodel4[kz][0] = 0; + amodel4[kz][1] = 0; + amodel4[kz][2] = 0; + } + abratiol4[0] = 100.; + amodel4[0][0] = -1000020030; // Anti-Helium3 + amodel4[0][1] = -2212; // Anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4); + + // Define the 2- and 3-body phase space decay for the Hypertriton + Int_t mode[6][3]; + Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 50.; + mode[0][0] = 1000020030; // Helium3 + mode[0][1] = -211; // negative pion + + bratio[1] = 50.; + mode[1][0] = 1000010020; // deuteron + mode[1][1] = 2212; // proton + mode[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode); + + // Define the 2- and 3-body phase space decay for the Anti-Hypertriton + Int_t amode[6][3]; + Float_t abratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio[kz] = 0.; + amode[kz][0] = 0; + amode[kz][1] = 0; + amode[kz][2] = 0; + } + abratio[0] = 50.; + amode[0][0] = -1000020030; // anti- Helium3 + amode[0][1] = 211; // positive pion + abratio[1] = 50.; + amode[1][0] = -1000010020; // anti-deuteron + amode[1][1] = -2212; // anti-proton + amode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode); + + ////// ----------Hypernuclei with Mass=4 ----------- ////////// + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + + Int_t mode3[6][3]; + Float_t bratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio3[kz] = 0.; + mode3[kz][0] = 0; + mode3[kz][1] = 0; + mode3[kz][2] = 0; + } + bratio3[0] = 50.; + mode3[0][0] = 1000020040; // Helium4 + mode3[0][1] = -211; // negative pion + + bratio3[1] = 50.; + mode3[1][0] = 1000010030; // tritium + mode3[1][1] = 2212; // proton + mode3[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3); + + // Define the 2- and 3-body phase space decay for the Hyperhydrogen 4 + Int_t amode3[6][3]; + Float_t abratio3[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio3[kz] = 0.; + amode3[kz][0] = 0; + amode3[kz][1] = 0; + amode3[kz][2] = 0; + } + abratio3[0] = 50.; + amode3[0][0] = -1000020040; // anti- Helium4 + amode3[0][1] = 211; // positive pion + abratio3[1] = 50.; + amode3[1][0] = -1000010030; // anti-tritium + amode3[1][1] = -2212; // anti-proton + amode3[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3); + + // Define the 3-body phase space decay for the Hyperhelium 4 + Int_t mode4[6][3]; + Float_t bratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4[kz] = 0.; + mode4[kz][0] = 0; + mode4[kz][1] = 0; + mode4[kz][2] = 0; + } + bratio4[0] = 50.; + mode4[0][0] = 1000020030; // Helium3 + mode4[0][1] = -211; // negative pion + mode4[0][2] = 2212; // proton + + bratio4[1] = 50.; + mode4[1][0] = 1000030040; // lithium-4 + mode4[1][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 4 + Int_t amode4[6][3]; + Float_t abratio4[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4[kz] = 0.; + amode4[kz][0] = 0; + amode4[kz][1] = 0; + amode4[kz][2] = 0; + } + abratio4[0] = 50.; + amode4[0][0] = -1000020030; // anti-Helium 3 + amode4[0][1] = 211; // positive pion + amode4[0][2] = -2212; // anti proton + + abratio4[1] = 50.; + amode4[1][0] = -1000030040; // antilithium-4 + amode4[1][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4); + + // Define the 3-body phase space decay for the Hyperhelium 5 + Int_t mode41[6][3]; + Float_t bratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio41[kz] = 0.; + mode41[kz][0] = 0; + mode41[kz][1] = 0; + mode41[kz][2] = 0; + } + bratio41[0] = 50.; + mode41[0][0] = 1000020040; // Helium4 + mode41[0][1] = -211; // negative pion + mode41[0][2] = 2212; // proton + bratio41[1] = 50.; + mode41[1][0] = 1000020030; // Helium3 + mode41[1][1] = -211; // negative pion + mode41[1][2] = 1000010020; // Deuteron + + TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41); + + // Define the 2-body phase space decay for the Anti-Hyperhelium 5 + Int_t amode41[6][3]; + Float_t abratio41[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio41[kz] = 0.; + amode41[kz][0] = 0; + amode41[kz][1] = 0; + amode41[kz][2] = 0; + } + abratio41[0] = 50.; + amode41[0][0] = -1000020040; // anti-Helium 4 + amode41[0][1] = 211; // positive pion + amode41[0][2] = -2212; // anti proton + abratio41[1] = 50.; + amode41[1][0] = -1000020030; // anti-Helium 3 + amode41[1][1] = 211; // positive pion + amode41[1][2] = -1000010020; // anti deuteron + + TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41); + + // Define the 3-body phase space decay for the Doublehyperhydrogen 4 + Int_t mode42[6][3]; + Float_t bratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio42[kz] = 0.; + mode42[kz][0] = 0; + mode42[kz][1] = 0; + mode42[kz][2] = 0; + } + bratio42[0] = 50.; + mode42[0][0] = 1010020040; // Hyper-Helium4 + mode42[0][1] = -211; // negative pion + bratio42[1] = 50.; + mode42[1][0] = 1010010030; // Hypertriton + mode42[1][1] = 2212; // proton + mode42[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42); + + // Define the 2-body phase space decay for the Anti-Doublehyperhydrogen 4 + Int_t amode42[6][3]; + Float_t abratio42[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio42[kz] = 0.; + amode42[kz][0] = 0; + amode42[kz][1] = 0; + amode42[kz][2] = 0; + } + abratio42[0] = 100.; + amode42[0][0] = -1010020040; // anti-Hyper-Helium 4 + amode42[0][1] = 211; // positive pion + abratio42[1] = 50.; + amode42[1][0] = -1010010030; // anti-Hypertriton + amode42[1][1] = -2212; // antiproton + amode42[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42); + + // Define the decay for the 4Xi(-)He + Int_t mode4XiHe[6][3]; + Float_t bratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiHe[kz] = 0.; + mode4XiHe[kz][0] = 0; + mode4XiHe[kz][1] = 0; + mode4XiHe[kz][2] = 0; + } + bratio4XiHe[0] = 33.; + mode4XiHe[0][0] = 1010020040; // HyperHelium4 + mode4XiHe[0][1] = -211; // negative pion + + bratio4XiHe[1] = 33.; + mode4XiHe[1][0] = 3122; // lambda + mode4XiHe[1][1] = 1000020030; // helium-3 + mode4XiHe[1][2] = -211; // negative pion + + bratio4XiHe[2] = 33.; + mode4XiHe[2][0] = 1000030040; // lithium-4 + mode4XiHe[2][1] = -211; // negative pion + mode4XiHe[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe); + + // Define the decay for the Anti-4Xi(-)He + Int_t amode4XiHe[6][3]; + Float_t abratio4XiHe[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiHe[kz] = 0.; + amode4XiHe[kz][0] = 0; + amode4XiHe[kz][1] = 0; + amode4XiHe[kz][2] = 0; + } + abratio4XiHe[0] = 33.; + amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4 + amode4XiHe[0][1] = 211; // positive pion + + abratio4XiHe[1] = 33.; + amode4XiHe[1][0] = -3122; // antilambda + amode4XiHe[1][1] = -1000020030; // antihelium-3 + amode4XiHe[1][2] = 211; // positive pion + + abratio4XiHe[2] = 33.; + amode4XiHe[2][0] = -1000030040; // antilithium-4 + amode4XiHe[2][1] = 211; // positive pion + amode4XiHe[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe); + + // Define the decay for the 4Xi(-)H + Int_t mode4XiH[6][3]; + Float_t bratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4XiH[kz] = 0.; + mode4XiH[kz][0] = 0; + mode4XiH[kz][1] = 0; + mode4XiH[kz][2] = 0; + } + bratio4XiH[0] = 33.; + mode4XiH[0][0] = 1010010040; // HyperHydrogen4 + mode4XiH[0][1] = -211; // negative pion + + bratio4XiH[1] = 33.; + mode4XiH[1][0] = 3122; // lambda + mode4XiH[1][1] = 1000010030; // triton + mode4XiH[1][2] = -211; // negative pion + + bratio4XiH[2] = 33.; + mode4XiH[2][0] = 1000020040; // alpha + mode4XiH[2][1] = -211; // negative pion + mode4XiH[2][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH); + + // Define the decay for the Anti-4Xi(-)H + Int_t amode4XiH[6][3]; + Float_t abratio4XiH[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4XiH[kz] = 0.; + amode4XiH[kz][0] = 0; + amode4XiH[kz][1] = 0; + amode4XiH[kz][2] = 0; + } + abratio4XiH[0] = 33.; + amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4 + amode4XiH[0][1] = 211; // positive pion + + abratio4XiH[1] = 33.; + amode4XiH[1][0] = -3122; // antilambda + amode4XiH[1][1] = -1000010030; // antitriton + amode4XiH[1][2] = 211; // positive pion + + abratio4XiH[2] = 33.; + amode4XiH[2][0] = -1000020040; // antialpha + amode4XiH[2][1] = 211; // positive pion + amode4XiH[2][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH); + + // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma + Int_t mode4s[6][3]; + Float_t bratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio4s[kz] = 0.; + mode4s[kz][0] = 0; + mode4s[kz][1] = 0; + mode4s[kz][2] = 0; + } + bratio4s[0] = 20.; + mode4s[0][0] = 1000020040; // Helium4 + mode4s[0][1] = 111; // pion0 + bratio4s[1] = 40.; + mode4s[1][0] = 1000010030; // tritium + mode4s[1][2] = 2212; // proton + mode4s[1][1] = 111; // pion0 + bratio4s[2] = 40.; + mode4s[2][0] = 1000010030; // tritium + mode4s[2][2] = 2212; // pion+ + mode4s[2][1] = 2112; // neutron + + TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s); + + // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 + // sigma + Int_t amode4s[6][3]; + Float_t abratio4s[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio4s[kz] = 0.; + amode4s[kz][0] = 0; + amode4s[kz][1] = 0; + amode4s[kz][2] = 0; + } + abratio4s[0] = 50.; + amode4s[0][0] = -1000020040; // anti-Helium4 + amode4s[0][1] = 111; // pion0 + abratio4s[1] = 50.; + amode4s[1][0] = -1000010030; // anti-tritium + amode4s[1][2] = -2212; // anti-proton + amode4s[1][1] = 111; // pion0 + abratio4s[2] = 50.; + amode4s[2][0] = -1000010030; // anti-tritium + amode4s[2][2] = -211; // pion- + amode4s[2][1] = -2112; // anti-neutron + + TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s); + + // Define the 2-body phase space decay for the Lambda-neutron boundstate + Int_t mode1[6][3]; + Float_t bratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio1[kz] = 0.; + mode1[kz][0] = 0; + mode1[kz][1] = 0; + mode1[kz][2] = 0; + } + bratio1[0] = 100.; + mode1[0][0] = 1000010020; // deuteron + mode1[0][1] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1); + + // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate + Int_t amode1[6][3]; + Float_t abratio1[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio1[kz] = 0.; + amode1[kz][0] = 0; + amode1[kz][1] = 0; + amode1[kz][2] = 0; + } + abratio1[0] = 100.; + amode1[0][0] = -1000010020; // anti-deuteron + amode1[0][1] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1); + + // Define the 2-body phase space decay for the H-Dibaryon + Int_t mode2[6][3]; + Float_t bratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio2[kz] = 0.; + mode2[kz][0] = 0; + mode2[kz][1] = 0; + mode2[kz][2] = 0; + } + bratio2[0] = 100.; + mode2[0][0] = 3122; // Lambda + mode2[0][1] = 2212; // proton + mode2[0][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2); + + // Define the 2-body phase space decay for the Anti-H-Dibaryon + Int_t amode2[6][3]; + Float_t abratio2[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio2[kz] = 0.; + amode2[kz][0] = 0; + amode2[kz][1] = 0; + amode2[kz][2] = 0; + } + abratio2[0] = 100.; + amode2[0][0] = -3122; // anti-deuteron + amode2[0][1] = -2212; // anti-proton + amode2[0][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2); + + // Define the 2-body phase space decay for the Xi0P + Int_t mode5[6][3]; + Float_t bratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio5[kz] = 0.; + mode5[kz][0] = 0; + mode5[kz][1] = 0; + mode5[kz][2] = 0; + } + bratio5[0] = 100.; + mode5[0][0] = 3122; // Lambda + mode5[0][1] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5); + + // Define the 2-body phase space decay for the Anti-Xi0P + Int_t amode5[6][3]; + Float_t abratio5[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio5[kz] = 0.; + amode5[kz][0] = 0; + amode5[kz][1] = 0; + amode5[kz][2] = 0; + } + abratio5[0] = 100.; + amode5[0][0] = -3122; // anti-Lambda + amode5[0][1] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5); + + // Define the 2-body phase space decay for the Lambda-Neutron-Neutron + Int_t mode6[6][3]; + Float_t bratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio6[kz] = 0.; + mode6[kz][0] = 0; + mode6[kz][1] = 0; + mode6[kz][2] = 0; + } + bratio6[0] = 100.; + mode6[0][0] = 1000010030; // triton + mode6[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6); + + // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron + Int_t amode6[6][3]; + Float_t abratio6[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio6[kz] = 0.; + amode6[kz][0] = 0; + amode6[kz][1] = 0; + amode6[kz][2] = 0; + } + abratio6[0] = 100.; + amode6[0][0] = -1000010030; // anti-triton + amode6[0][1] = 211; // pion + + TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6); + + // Define the 3-body phase space decay for the Omega-Proton + Int_t mode7[6][3]; + Float_t bratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio7[kz] = 0.; + mode7[kz][0] = 0; + mode7[kz][1] = 0; + mode7[kz][2] = 0; + } + bratio7[0] = 100.; + mode7[0][0] = 3122; // Lambda + mode7[0][1] = -321; // negative Kaon + mode7[0][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7); + + // Define the 3-body phase space decay for the Anti-Omega-Proton + Int_t amode7[6][3]; + Float_t abratio7[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio7[kz] = 0.; + amode7[kz][0] = 0; + amode7[kz][1] = 0; + amode7[kz][2] = 0; + } + abratio7[0] = 100.; + amode7[0][0] = -3122; // anti-Lambda + amode7[0][1] = 321; // positive kaon + amode7[0][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7); + + // Define the 2-body phase space decay for the Omega-Neutron + Int_t mode8[6][3]; + Float_t bratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio8[kz] = 0.; + mode8[kz][0] = 0; + mode8[kz][1] = 0; + mode8[kz][2] = 0; + } + bratio8[0] = 100.; + mode8[0][0] = 3122; // Lambda + mode8[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8); + + // Define the 2-body phase space decay for the Anti-Omega-Neutron + Int_t amode8[6][3]; + Float_t abratio8[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio8[kz] = 0.; + amode8[kz][0] = 0; + amode8[kz][1] = 0; + amode8[kz][2] = 0; + } + abratio8[0] = 100.; + amode8[0][0] = -3122; // anti-Lambda + amode8[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8); + + // Define the 3-body phase space decay for the Omega-Omega + Int_t mode9[6][3]; + Float_t bratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio9[kz] = 0.; + mode9[kz][0] = 0; + mode9[kz][1] = 0; + mode9[kz][2] = 0; + } + bratio9[0] = 100.; + mode9[0][0] = 3334; // negative Omega + mode9[0][1] = 3312; // negative Xi + + TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9); + + // Define the 3-body phase space decay for the Anti-Omega-Omega + Int_t amode9[6][3]; + Float_t abratio9[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio9[kz] = 0.; + amode9[kz][0] = 0; + amode9[kz][1] = 0; + amode9[kz][2] = 0; + } + abratio9[0] = 100.; + amode9[0][0] = -3334; // positive Omega + amode9[0][1] = -3312; // positive Xi + + TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9); + + // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton + Int_t mode10[6][3]; + Float_t bratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio10[kz] = 0.; + mode10[kz][0] = 0; + mode10[kz][1] = 0; + mode10[kz][2] = 0; + } + bratio10[0] = 50.; + mode10[0][0] = 3122; // Lambda + mode10[0][1] = 2212; // proton + bratio10[1] = 50.; + mode10[1][0] = 2212; // proton + mode10[1][1] = -321; // negative kaon + mode10[1][2] = 2212; // proton + + TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10); + + // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton + Int_t amode10[6][3]; + Float_t abratio10[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio10[kz] = 0.; + amode10[kz][0] = 0; + amode10[kz][1] = 0; + amode10[kz][2] = 0; + } + abratio10[0] = 50.; + amode10[0][0] = -3122; // anti-Lambda + amode10[0][1] = -2212; // anti-proton + abratio10[1] = 50.; + amode10[1][0] = -2212; // anti-proton + amode10[1][1] = 321; // positive kaon + amode10[1][2] = -2212; // anti-proton + + TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10); + + // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405) + Int_t mode11[6][3]; + Float_t bratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio11[kz] = 0.; + mode11[kz][0] = 0; + mode11[kz][1] = 0; + mode11[kz][2] = 0; + } + bratio11[0] = 50.; + mode11[0][0] = 3122; // Lambda + mode11[0][1] = 3122; // Lambda + bratio11[1] = 50.; + mode11[1][0] = 3122; // Lambda + mode11[1][1] = 2212; // proton + mode11[1][2] = -211; // negative pion + + TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11); + + // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405) + Int_t amode11[6][3]; + Float_t abratio11[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + abratio11[kz] = 0.; + amode11[kz][0] = 0; + amode11[kz][1] = 0; + amode11[kz][2] = 0; + } + abratio11[0] = 50.; + amode11[0][0] = -3122; // anti-Lambda + amode11[0][1] = -3122; // anti-Lambda + abratio11[1] = 50.; + amode11[1][0] = -3122; // anti-Lambda + amode11[1][1] = -2212; // anti-proton + amode11[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11); + + // Define the decays for the c-triton + Int_t ctmode[6][3]; + Float_t ctbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + ctbratio[kz] = 0.; + ctmode[kz][0] = 0; + ctmode[kz][1] = 0; + ctmode[kz][2] = 0; + } + ctbratio[0] = 50.; + ctmode[0][0] = 1000020030; // Helium3 + ctmode[0][1] = 310; // K0s + + ctbratio[1] = 50.; + ctmode[1][0] = 1000020030; // Helium3 + ctmode[1][1] = -321; // negative kaon + ctmode[1][2] = 211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode); + + // Define the decays for the anti-c-triton + Int_t actmode[6][3]; + Float_t actbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + actbratio[kz] = 0.; + actmode[kz][0] = 0; + actmode[kz][1] = 0; + actmode[kz][2] = 0; + } + actbratio[0] = 50.; + actmode[0][0] = -1000020030; // Helium3 + actmode[0][1] = 310; // K0s + + actbratio[1] = 50.; + actmode[1][0] = -1000020030; // Helium3 + actmode[1][1] = 321; // negative kaon + actmode[1][2] = -211; // positive pion + + TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode); + + // Define the decays for the c-deuteron + Int_t cdmode[6][3]; + Float_t cdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + cdbratio[kz] = 0.; + cdmode[kz][0] = 0; + cdmode[kz][1] = 0; + cdmode[kz][2] = 0; + } + cdbratio[0] = 50.; + cdmode[0][0] = 1000010020; // deuteron + cdmode[0][1] = -321; // negative kaon + cdmode[0][2] = 211; // positive pion + + cdbratio[1] = 50.; + cdmode[1][0] = 1000010020; // deuteron + cdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode); + + // Define the decays for the anti-c-deuteron + Int_t acdmode[6][3]; + Float_t acdbratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + acdbratio[kz] = 0.; + acdmode[kz][0] = 0; + acdmode[kz][1] = 0; + acdmode[kz][2] = 0; + } + acdbratio[0] = 50.; + acdmode[0][0] = -1000010020; // deuteron + acdmode[0][1] = 321; // negative kaon + acdmode[0][2] = -211; // positive pion + + acdbratio[1] = 50.; + acdmode[1][0] = -1000010020; // deuteron + acdmode[1][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode); + + /////////////////////////////////////////////////////////////////// + + // Define the 2-body phase space decay for the f0(980) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode); + + // Define the 2-body phase space decay for the f2(1270) + // Int_t mode[6][3]; + // Float_t bratio[6]; + + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 211; // pion + mode[0][1] = -211; // pion + + TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); + + // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), + // f0(1710 + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + bratio[0] = 100.; + mode[0][0] = 310; // K0s + mode[0][1] = 310; // K0s + + TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500) + TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525) + TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710) + TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370) + TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320) + + // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420) + for (Int_t kz = 0; kz < 6; kz++) { + bratio[kz] = 0.; + mode[kz][0] = 0; + mode[kz][1] = 0; + mode[kz][2] = 0; + } + + bratio2[0] = 50.; + mode[0][0] = 310; // K0s + mode[0][1] = -321; // anti-K + mode[0][2] = 211; // pion+ + + bratio2[1] = 50.; + mode[1][0] = 310; // K0s + mode[1][1] = 321; // K + mode[1][2] = -211; // pion- + + TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285) + TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420) + + // Lambda1520/Lambda1520bar + + TVirtualMC::GetMC()->DefineParticle(102134, "Lambda1520", kPTNeutron, 1.5195, + 0.0, 4.22e-23, "Hadron", 0.0156, 3, -1, 0, + 0, 0, 0, 0, 1, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-102134, "Lambda1520bar", kPTNeutron, + 1.5195, 0.0, 4.22e-23, "Hadron", 0.0156, + 3, -1, 0, 0, 0, 0, 0, -1, kTRUE); + + // Lambda1520 decay modes + Int_t lmode[9][3]; + Float_t lbratio[9]; + for (Int_t kz = 0; kz < 9; kz++) { + lbratio[kz] = 0.; + lmode[kz][0] = 0; + lmode[kz][1] = 0; + lmode[kz][2] = 0; + } + + // L(1520) -> p K- + lbratio[0] = 0.229944; + lmode[0][0] = 2212; + lmode[0][1] = -321; + + // L(1520) -> n K0 + lbratio[1] = 0.229944; + lmode[1][0] = 2112; + lmode[1][1] = -311; + + // L(1520) -> Sigma+ pi- + lbratio[2] = 0.143076; + lmode[2][0] = 3222; + lmode[2][1] = -211; + + // L(1520) -> Sigma0 pi0 + lbratio[3] = 0.143076; + lmode[3][0] = 3212; + lmode[3][1] = 111; + + // L(1520) -> Sigma- pi+ + lbratio[4] = 0.143076; + lmode[4][0] = 3112; + lmode[4][1] = 211; + + // L(1520) -> Sigma*- pi+ + lbratio[5] = 0.034066; + lmode[5][0] = 3114; + lmode[5][1] = 211; + + // L(1520) -> Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = 3214; + lmode[6][1] = 111; + + // L(1520) -> Sigma*+ pi- + lbratio[7] = 0.034066; + lmode[7][0] = 3224; + lmode[7][1] = -211; + + // L(1520) -> Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = 3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode); + + // Lambda1520bar decay modes + + // L(1520)bar -> p- K+ + lbratio[0] = 0.229944; + lmode[0][0] = -2212; + lmode[0][1] = 321; + + // L(1520)bar -> nbar K0bar + lbratio[1] = 0.229944; + lmode[1][0] = -2112; + lmode[1][1] = 311; + + // L(1520)bar -> Sigmabar- pi+ + lbratio[2] = 0.143076; + lmode[2][0] = -3222; + lmode[2][1] = 211; + + // L(1520)bar -> Sigma0bar pi0 + lbratio[3] = 0.143076; + lmode[3][0] = -3212; + lmode[3][1] = 111; + + // L(1520)bar -> Sigmabar+ pi- + lbratio[4] = 0.143076; + lmode[4][0] = -3112; + lmode[4][1] = -211; + + // L(1520)bar -> anti-Sigma*- pi- + lbratio[5] = 0.034066; + lmode[5][0] = -3114; + lmode[5][1] = -211; + + // L(1520)bar -> anti-Sigma*0 pi0 + lbratio[6] = 0.034066; + lmode[6][0] = -3214; + lmode[6][1] = 111; + + // L(1520)bar -> anti-Sigma*+ pi+ + lbratio[7] = 0.034066; + lmode[7][0] = -3224; + lmode[7][1] = 211; + + // L(1520)bar -> Anti-Lambda gamma + lbratio[8] = 0.008687; + lmode[8][0] = -3122; + lmode[8][1] = 22; + + TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode); + + // -------------------------------------------------------------------- + + // Sexaquark (uuddss): compact, neutral and stable hypothetical bound state + // (arxiv.org/abs/1708.08951) + TVirtualMC::GetMC()->DefineParticle(900000020, "Sexaquark", kPTUndefined, 2.0, + 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, 0, 0, + 0, 0, 0, 2, kTRUE); + TVirtualMC::GetMC()->DefineParticle(-900000020, "AntiSexaquark", kPTUndefined, + 2.0, 0.0, 4.35e+17, "Hadron", 0.0, 0, 1, + 0, 0, 0, 0, 0, -2, kTRUE); +} + +void O2MCApplicationBase::AddParticles() { + // dispatch first to function in FairRoot + FairMCApplication::AddParticles(); + + // register special particles for ALICE + // TODO: try to make use of FairRoot if easier or more customizable + addSpecialParticles(); + + auto ¶m = o2::conf::SimUserDecay::Instance(); + LOG(info) << "Printing \'SimUserDecay\' parameters"; + LOG(info) << param; + + // check if there are PDG codes requested for user decay + if (param.pdglist.empty()) { + return; + } + + // loop over PDG codes in the string + std::stringstream ss(param.pdglist); + int pdg; + while (ss >> pdg) { + LOG(info) << "Setting user decay for PDG " << pdg; + TVirtualMC::GetMC()->SetUserDecay(pdg); + } +} + +void O2MCApplicationBase::initTrackRefHook() { + if (mCutParams.stepTrackRefHook) { + LOG(info) << "Initializing the hook for TrackReferences during stepping"; + auto expandedTrackRefHookFileName = + o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); + if (std::filesystem::exists(expandedTrackRefHookFileName)) { + // if this file exists we will compile the hook on the fly + mTrackRefFcn = o2::conf::GetFromMacro( + mCutParams.stepTrackRefHookFile, "trackRefHook()", + "o2::steer::O2MCApplicationBase::TrackRefFcn", + "o2mc_stepping_trackref_hook"); + LOG(info) << "Hook initialized from file " + << expandedTrackRefHookFileName; + } else { + LOG(error) << "Did not file TrackRefHook file " + << expandedTrackRefHookFileName << " ; Will not execute hook"; + mTrackRefFcn = [](TVirtualMC const *) {}; // do nothing + } + } +} + +void O2MCApplication::initLate() { + o2::utils::ShmManager::Instance().occupySegment(); + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector *)det)->initializeLate(); + } + } +} + +void O2MCApplication::attachSubEventInfo( + fair::mq::Parts &parts, o2::data::SubEventInfo const &info) const { + // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); + o2::base::attachTMessage(info, *mSimDataChannel, parts); +} + +// helper function to fetch data from FairRootManager branch and serialize it +// returns handle to container +template +const T *attachBranch(std::string const &name, fair::mq::Channel &channel, + fair::mq::Parts &parts) { + auto mgr = FairRootManager::Instance(); + // check if branch is present + if (mgr->GetBranchId(name) == -1) { + LOG(error) << "Branch " << name << " not found"; + return nullptr; + } + auto data = mgr->InitObjectAs(name.c_str()); + if (data) { + o2::base::attachTMessage(*data, channel, parts); + } + return data; +} + +void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo *i) { + mSubEventInfo = i; + // being communicated a SubEventInfo also means we get a FairMCEventHeader + fMCEventHeader = &mSubEventInfo->mMCEventHeader; +} + +void O2MCApplication::SendData() { + fair::mq::Parts simdataparts; + + // fill these parts ... the receiver has to unpack similary + // TODO: actually we could just loop over branches in FairRootManager at this + // moment? + mSubEventInfo->npersistenttracks = + static_cast(GetStack())->getMCTracks()->size(); + mSubEventInfo->nprimarytracks = + static_cast(GetStack())->GetNprimary(); + attachSubEventInfo(simdataparts, *mSubEventInfo); + auto tracks = attachBranch>( + "MCTrack", *mSimDataChannel, simdataparts); + attachBranch>("TrackRefs", *mSimDataChannel, + simdataparts); + assert(tracks->size() == mSubEventInfo->npersistenttracks); + + for (auto det : listActiveDetectors) { + if (dynamic_cast(det)) { + ((o2::base::Detector *)det)->attachHits(*mSimDataChannel, simdataparts); + } + } + LOG(info) << "sending message with " << simdataparts.Size() << " parts"; + mSimDataChannel->Send(simdataparts); +} +} // namespace steer +} // namespace o2 From 877dffbbdbb7c77e883729c8831e9b522526ab24 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 28 Nov 2024 07:38:07 +0000 Subject: [PATCH 08/15] Please consider the following formatting changes --- .../SimulationDataFormat/O2DatabasePDG.h | 41 +++-- Steer/src/O2MCApplication.cxx | 171 ++++++++++-------- 2 files changed, 119 insertions(+), 93 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index 5d1ed87a39822..1bcbb5deceb53 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -20,7 +20,8 @@ #include "TParticlePDG.h" #include -namespace o2 { +namespace o2 +{ // An ALICE specific extension of ROOT's TDatabasePDG // @@ -28,12 +29,14 @@ namespace o2 { // TDatabasePDG::Instance(), correct initialization is guaranteed. // Alternatively, a static function is exposed with which particles can be added // to TDatabasePDG objects directly. -class O2DatabasePDG { +class O2DatabasePDG +{ // -public: - static TDatabasePDG *Instance() { + public: + static TDatabasePDG* Instance() + { static bool initialized = - false; // initialize this --> adds particles to TDatabasePDG; + false; // initialize this --> adds particles to TDatabasePDG; auto db = TDatabasePDG::Instance(); if (!initialized) { addALICEParticles(db); @@ -43,11 +46,12 @@ class O2DatabasePDG { } // adds ALICE particles to a given TDatabasePDG instance - static void addALICEParticles(TDatabasePDG *db = TDatabasePDG::Instance()); - static void addParticlesFromExternalFile(TDatabasePDG *db); + static void addALICEParticles(TDatabasePDG* db = TDatabasePDG::Instance()); + static void addParticlesFromExternalFile(TDatabasePDG* db); // get particle's (if any) mass - static Double_t MassImpl(TParticlePDG *particle, bool &success) { + static Double_t MassImpl(TParticlePDG* particle, bool& success) + { success = false; if (!particle) { return -1.; @@ -57,8 +61,9 @@ class O2DatabasePDG { } // determine particle to get mass for based on PDG - static Double_t Mass(int pdg, bool &success, - TDatabasePDG *db = O2DatabasePDG::Instance()) { + static Double_t Mass(int pdg, bool& success, + TDatabasePDG* db = O2DatabasePDG::Instance()) + { if (pdg < IONBASELOW || pdg > IONBASEHIGH) { // not an ion, return immediately return MassImpl(db->GetParticle(pdg), success); @@ -76,14 +81,15 @@ class O2DatabasePDG { // remove default constructor O2DatabasePDG() = delete; -private: + private: static constexpr int IONBASELOW{1000000000}; static constexpr int IONBASEHIGH{1099999999}; }; // by keeping this inline, we can use it in other parts of the code, for // instance Framework or Analysis, without needing to link against this library -inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { +inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) +{ // // Add ALICE particles to the ROOT PDG data base // Code has been taken from AliRoot @@ -685,18 +691,19 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { addParticlesFromExternalFile(db); } -inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG *db) { +inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG* db) +{ static bool initialized = false; if (!initialized) { // allow user to specify custom file - if (const char *custom = std::getenv("O2_SIM_CUSTOM_PDG")) { + if (const char* custom = std::getenv("O2_SIM_CUSTOM_PDG")) { // TODO: make sure this is a file db->ReadPDGTable(custom); - } else if (const char *o2Root = std::getenv("O2_ROOT")) { + } else if (const char* o2Root = std::getenv("O2_ROOT")) { // take the maintained file from O2 auto inputExtraPDGs = - std::string(o2Root) + - "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; + std::string(o2Root) + + "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; db->ReadPDGTable(inputExtraPDGs.c_str()); } initialized = true; diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index 99cd1da90e955..310d55f82f89d 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -38,29 +38,33 @@ #include #include -namespace o2 { -namespace steer { +namespace o2 +{ +namespace steer +{ // helper function to send trivial data template -void TypedVectorAttach(const char *name, fair::mq::Channel &channel, - fair::mq::Parts &parts) { +void TypedVectorAttach(const char* name, fair::mq::Channel& channel, + fair::mq::Parts& parts) +{ static auto mgr = FairRootManager::Instance(); - auto vector = mgr->InitObjectAs *>(name); + auto vector = mgr->InitObjectAs*>(name); if (vector) { - auto buffer = (char *)&(*vector)[0]; + auto buffer = (char*)&(*vector)[0]; auto buffersize = vector->size() * sizeof(T); fair::mq::MessagePtr message(channel.NewMessage( - buffer, buffersize, [](void *data, void *hint) {}, buffer)); + buffer, buffersize, [](void* data, void* hint) {}, buffer)); parts.AddPart(std::move(message)); } } -void O2MCApplicationBase::Stepping() { +void O2MCApplicationBase::Stepping() +{ mStepCounter++; // check the max time of flight condition const auto tof = fMC->TrackTime(); - auto ¶ms = o2::GlobalProcessCutSimParam::Instance(); + auto& params = o2::GlobalProcessCutSimParam::Instance(); if (tof > params.TOFMAX) { fMC->StopTrack(); return; @@ -105,17 +109,19 @@ void O2MCApplicationBase::Stepping() { FairMCApplication::Stepping(); } -void O2MCApplicationBase::PreTrack() { +void O2MCApplicationBase::PreTrack() +{ // dispatch first to function in FairRoot FairMCApplication::PreTrack(); } -void O2MCApplicationBase::ConstructGeometry() { +void O2MCApplicationBase::ConstructGeometry() +{ // fill the mapping mModIdToName.clear(); o2::detectors::DetID::mask_t dmask{}; for (int i = 0; i < fModules->GetEntries(); ++i) { - auto mod = static_cast(fModules->At(i)); + auto mod = static_cast(fModules->At(i)); if (mod) { mModIdToName[mod->GetModId()] = mod->GetName(); int did = o2::detectors::DetID::nameToID(mod->GetName()); @@ -131,18 +137,19 @@ void O2MCApplicationBase::ConstructGeometry() { // construct the volume name to module name mapping useful for StepAnalysis auto vollist = gGeoManager->GetListOfVolumes(); for (int i = 0; i < vollist->GetEntries(); ++i) { - auto vol = static_cast(vollist->At(i)); + auto vol = static_cast(vollist->At(i)); auto iter = fModVolMap.find(vol->GetNumber()); voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n"; } } -void O2MCApplicationBase::InitGeometry() { +void O2MCApplicationBase::InitGeometry() +{ // load special cuts which might be given from the outside first. - auto &matMgr = o2::base::MaterialManager::Instance(); + auto& matMgr = o2::base::MaterialManager::Instance(); matMgr.loadCutsAndProcessesFromJSON( - o2::base::MaterialManager::ESpecial::kTRUE); + o2::base::MaterialManager::ESpecial::kTRUE); matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut); // During the following, FairModule::SetSpecialPhysicsCuts will be called for // each module @@ -160,17 +167,18 @@ void O2MCApplicationBase::InitGeometry() { } } -bool O2MCApplicationBase::MisalignGeometry() { +bool O2MCApplicationBase::MisalignGeometry() +{ for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector *)det)->addAlignableVolumes(); + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->addAlignableVolumes(); } } // we stream out both unaligned geometry (to allow for // dynamic post-alignment) as well as the aligned version // which can be used by digitization etc. immediately - auto &confref = o2::conf::SimConfig::Instance(); + auto& confref = o2::conf::SimConfig::Instance(); auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix()); // since in general the geometry is a CCDB object, it must be exported under // the standard name @@ -178,20 +186,20 @@ bool O2MCApplicationBase::MisalignGeometry() { gGeoManager->Export(geomfile.c_str()); // apply alignment for included detectors AFTER exporting ideal geometry - auto &aligner = o2::base::Aligner::Instance(); + auto& aligner = o2::base::Aligner::Instance(); aligner.applyAlignment(confref.getTimestamp()); // export aligned geometry into different file auto alignedgeomfile = - o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); + o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix()); gGeoManager->Export(alignedgeomfile.c_str()); - auto ¶m = o2::GeometryManagerParam::Instance(); + auto& param = o2::GeometryManagerParam::Instance(); // fill parallel world geometry if activated if (param.useParallelWorld) { - TGeoParallelWorld *pw = - gGeoManager->CreateParallelWorld("priority_sensors"); + TGeoParallelWorld* pw = + gGeoManager->CreateParallelWorld("priority_sensors"); if (param.usePwGeoBVH) { pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH); } @@ -199,8 +207,8 @@ bool O2MCApplicationBase::MisalignGeometry() { TGeoNavigator::SetPWSafetyCaching(true); } for (auto det : listDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector *)det)->fillParallelWorld(); + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->fillParallelWorld(); } } gGeoManager->SetUseParallelWorldNav(true); @@ -210,22 +218,24 @@ bool O2MCApplicationBase::MisalignGeometry() { return true; } -void O2MCApplicationBase::finishEventCommon() { +void O2MCApplicationBase::finishEventCommon() +{ LOG(info) << "This event/chunk did " << mStepCounter << " steps"; LOG(info) << "Longest track time is " << mLongestTrackTime; - auto header = static_cast(fMCEventHeader); + auto header = static_cast(fMCEventHeader); header->getMCEventStats().setNSteps(mStepCounter); header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex()); - static_cast(GetStack())->updateEventStats(); + static_cast(GetStack())->updateEventStats(); } -void O2MCApplicationBase::FinishEvent() { +void O2MCApplicationBase::FinishEvent() +{ finishEventCommon(); - auto header = static_cast(fMCEventHeader); - auto &confref = o2::conf::SimConfig::Instance(); + auto header = static_cast(fMCEventHeader); + auto& confref = o2::conf::SimConfig::Instance(); if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) { @@ -237,20 +247,22 @@ void O2MCApplicationBase::FinishEvent() { FairMCApplication::FinishEvent(); } -void O2MCApplicationBase::BeginEvent() { +void O2MCApplicationBase::BeginEvent() +{ // dispatch first to function in FairRoot FairMCApplication::BeginEvent(); // register event header with our stack - auto header = static_cast(fMCEventHeader); - static_cast(GetStack()) - ->setMCEventStats(&header->getMCEventStats()); + auto header = static_cast(fMCEventHeader); + static_cast(GetStack()) + ->setMCEventStats(&header->getMCEventStats()); mStepCounter = 0; mLongestTrackTime = 0; } -void addSpecialParticles() { +void addSpecialParticles() +{ // // Add particles needed for ALICE (not present in Geant3 or Geant4) // Code ported 1-1 from AliRoot @@ -349,8 +361,8 @@ void addSpecialParticles() { // Anti-Lambda-Neutron TVirtualMC::GetMC()->DefineParticle( - -1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, - "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + -1010000020, "AntiLambdaNeutron", kPTNeutron, 2.054, 0.0, 2.632e-10, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); // H-Dibaryon TVirtualMC::GetMC()->DefineParticle(1020000020, "Hdibaryon", kPTNeutron, 2.23, @@ -374,13 +386,13 @@ void addSpecialParticles() { // 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); + 1010000030, "LambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); // Anti-Lambda-Neutron-Neutron TVirtualMC::GetMC()->DefineParticle( - -1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, - "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); + -1010000030, "AntiLambdaNeutronNeutron", kPTNeutron, 2.99, 0.0, 2.632e-10, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 3, kFALSE); // Omega-Proton TVirtualMC::GetMC()->DefineParticle(1030000020, "OmegaProton", kPTNeutron, @@ -389,8 +401,8 @@ void addSpecialParticles() { // Anti-Omega-Proton TVirtualMC::GetMC()->DefineParticle( - -1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, - "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); + -1030000020, "AntiOmegaProton", kPTNeutron, 2.592, 0.0, 2.632e-10, + "Hadron", 0.0, 2, 1, 0, 0, 0, 0, 0, 2, kFALSE); // Omega-Neutron TVirtualMC::GetMC()->DefineParticle(1030010020, "OmegaNeutron", kPTHadron, @@ -399,8 +411,8 @@ void addSpecialParticles() { // 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); + -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, @@ -419,18 +431,18 @@ void addSpecialParticles() { // 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); + -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); + 1020000021, "Lambda1405Lambda1405", kPTNeutron, 2.693, 0.0, 1.316e-23, + "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); // Anti-Lambda(1405)-Lambda(1405) TVirtualMC::GetMC()->DefineParticle( - -1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, - 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); + -1020000021, "AntiLambda1405Lambda1405", kPTNeutron, 2.693, 0.0, + 1.316e-23, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE); // c-deuteron TVirtualMC::GetMC()->DefineParticle(2010010020, "CDeuteron", kPTHadron, 3.226, @@ -1663,7 +1675,8 @@ void addSpecialParticles() { 0, 0, 0, 0, 0, -2, kTRUE); } -void O2MCApplicationBase::AddParticles() { +void O2MCApplicationBase::AddParticles() +{ // dispatch first to function in FairRoot FairMCApplication::AddParticles(); @@ -1671,7 +1684,7 @@ void O2MCApplicationBase::AddParticles() { // TODO: try to make use of FairRoot if easier or more customizable addSpecialParticles(); - auto ¶m = o2::conf::SimUserDecay::Instance(); + auto& param = o2::conf::SimUserDecay::Instance(); LOG(info) << "Printing \'SimUserDecay\' parameters"; LOG(info) << param; @@ -1689,38 +1702,41 @@ void O2MCApplicationBase::AddParticles() { } } -void O2MCApplicationBase::initTrackRefHook() { +void O2MCApplicationBase::initTrackRefHook() +{ if (mCutParams.stepTrackRefHook) { LOG(info) << "Initializing the hook for TrackReferences during stepping"; auto expandedTrackRefHookFileName = - o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); + o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile); if (std::filesystem::exists(expandedTrackRefHookFileName)) { // if this file exists we will compile the hook on the fly mTrackRefFcn = o2::conf::GetFromMacro( - mCutParams.stepTrackRefHookFile, "trackRefHook()", - "o2::steer::O2MCApplicationBase::TrackRefFcn", - "o2mc_stepping_trackref_hook"); + mCutParams.stepTrackRefHookFile, "trackRefHook()", + "o2::steer::O2MCApplicationBase::TrackRefFcn", + "o2mc_stepping_trackref_hook"); LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName; } else { LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook"; - mTrackRefFcn = [](TVirtualMC const *) {}; // do nothing + mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing } } } -void O2MCApplication::initLate() { +void O2MCApplication::initLate() +{ o2::utils::ShmManager::Instance().occupySegment(); for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector *)det)->initializeLate(); + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->initializeLate(); } } } void O2MCApplication::attachSubEventInfo( - fair::mq::Parts &parts, o2::data::SubEventInfo const &info) const { + fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const +{ // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info))); o2::base::attachTMessage(info, *mSimDataChannel, parts); } @@ -1728,47 +1744,50 @@ void O2MCApplication::attachSubEventInfo( // helper function to fetch data from FairRootManager branch and serialize it // returns handle to container template -const T *attachBranch(std::string const &name, fair::mq::Channel &channel, - fair::mq::Parts &parts) { +const T* attachBranch(std::string const& name, fair::mq::Channel& channel, + fair::mq::Parts& parts) +{ auto mgr = FairRootManager::Instance(); // check if branch is present if (mgr->GetBranchId(name) == -1) { LOG(error) << "Branch " << name << " not found"; return nullptr; } - auto data = mgr->InitObjectAs(name.c_str()); + auto data = mgr->InitObjectAs(name.c_str()); if (data) { o2::base::attachTMessage(*data, channel, parts); } return data; } -void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo *i) { +void O2MCApplication::setSubEventInfo(o2::data::SubEventInfo* i) +{ mSubEventInfo = i; // being communicated a SubEventInfo also means we get a FairMCEventHeader fMCEventHeader = &mSubEventInfo->mMCEventHeader; } -void O2MCApplication::SendData() { +void O2MCApplication::SendData() +{ fair::mq::Parts simdataparts; // fill these parts ... the receiver has to unpack similary // TODO: actually we could just loop over branches in FairRootManager at this // moment? mSubEventInfo->npersistenttracks = - static_cast(GetStack())->getMCTracks()->size(); + static_cast(GetStack())->getMCTracks()->size(); mSubEventInfo->nprimarytracks = - static_cast(GetStack())->GetNprimary(); + static_cast(GetStack())->GetNprimary(); attachSubEventInfo(simdataparts, *mSubEventInfo); auto tracks = attachBranch>( - "MCTrack", *mSimDataChannel, simdataparts); + "MCTrack", *mSimDataChannel, simdataparts); attachBranch>("TrackRefs", *mSimDataChannel, simdataparts); assert(tracks->size() == mSubEventInfo->npersistenttracks); for (auto det : listActiveDetectors) { - if (dynamic_cast(det)) { - ((o2::base::Detector *)det)->attachHits(*mSimDataChannel, simdataparts); + if (dynamic_cast(det)) { + ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts); } } LOG(info) << "sending message with " << simdataparts.Size() << " parts"; From ab4710fb7a73d0b61a9713fe2fbe198a699938bc Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:48:36 +0100 Subject: [PATCH 09/15] Updating Copyrights --- .../include/SimulationDataFormat/O2DatabasePDG.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index 1bcbb5deceb53..461abc9dac02f 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". @@ -9,10 +9,6 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// -// Created by Sandro Wenzel on 11.08.22. -// - #ifndef O2_O2DATABASEPDG_H #define O2_O2DATABASEPDG_H From f4ecb652578140b700854e8e44374b0ba021fff3 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:49:57 +0100 Subject: [PATCH 10/15] Updating Copyrights --- Steer/src/O2MCApplication.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Steer/src/O2MCApplication.cxx b/Steer/src/O2MCApplication.cxx index 310d55f82f89d..51d7a2dacc4ae 100644 --- a/Steer/src/O2MCApplication.cxx +++ b/Steer/src/O2MCApplication.cxx @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". From 9a78a32ff24d097ce8384277cb66c36f111534c1 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:53:02 +0100 Subject: [PATCH 11/15] Removind hypernuclei named twice --- .../SimulationDataFormat/O2DatabasePDG.h | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index 461abc9dac02f..891a887ad393a 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -301,31 +301,7 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) "Ion", ionCode); } - ionCode = 1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.841, kFALSE, 2.5e-15, 6, - "Ion", ionCode); - } - - ionCode = -1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium5", "AntiHyperhelium5", 4.841, kFALSE, - 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); - } - - ionCode = -1020010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("DoubleAntiHyperhydrogen4", "DoubleAntiHyperhydrogen4", - 4.106, kFALSE, 2.5e-15, 6, "Ion", ionCode); - } - - // hyper helium 4 sigma + // hyper helium 4 sigma ionCode = 1110020040; if (!db->GetParticle(ionCode)) { db->AddParticle("Hyperhelium4sigma", "Hyperhelium4sigma", 3.995, kFALSE, From 7b3ae0caccbcd50bb1323f6efe76843e4565ac9a Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:56:57 +0100 Subject: [PATCH 12/15] Delete file to upload new one with correct formatting --- .../SimulationDataFormat/O2DatabasePDG.h | 687 ------------------ 1 file changed, 687 deletions(-) delete mode 100644 DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h deleted file mode 100644 index 891a887ad393a..0000000000000 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -#ifndef O2_O2DATABASEPDG_H -#define O2_O2DATABASEPDG_H - -#include "TDatabasePDG.h" -#include "TParticlePDG.h" -#include - -namespace o2 -{ - -// An ALICE specific extension of ROOT's TDatabasePDG -// -// By using O2DatabasePDG::Instance() in our code instead of -// TDatabasePDG::Instance(), correct initialization is guaranteed. -// Alternatively, a static function is exposed with which particles can be added -// to TDatabasePDG objects directly. -class O2DatabasePDG -{ - // - public: - static TDatabasePDG* Instance() - { - static bool initialized = - false; // initialize this --> adds particles to TDatabasePDG; - auto db = TDatabasePDG::Instance(); - if (!initialized) { - addALICEParticles(db); - initialized = true; - } - return db; - } - - // adds ALICE particles to a given TDatabasePDG instance - static void addALICEParticles(TDatabasePDG* db = TDatabasePDG::Instance()); - static void addParticlesFromExternalFile(TDatabasePDG* db); - - // get particle's (if any) mass - static Double_t MassImpl(TParticlePDG* particle, bool& success) - { - success = false; - if (!particle) { - return -1.; - } - success = true; - return particle->Mass(); - } - - // determine particle to get mass for based on PDG - static Double_t Mass(int pdg, bool& success, - TDatabasePDG* db = O2DatabasePDG::Instance()) - { - if (pdg < IONBASELOW || pdg > IONBASEHIGH) { - // not an ion, return immediately - return MassImpl(db->GetParticle(pdg), success); - } - if (auto particle = db->GetParticle(pdg)) { - // see if this ion can be found - return MassImpl(particle, success); - } - // if we are here, try one last time to look for ground state of potential - // isomere state - pdg = pdg / 10 * 10; - return MassImpl(db->GetParticle(pdg), success); - } - - // remove default constructor - O2DatabasePDG() = delete; - - private: - static constexpr int IONBASELOW{1000000000}; - static constexpr int IONBASEHIGH{1099999999}; -}; - -// by keeping this inline, we can use it in other parts of the code, for -// instance Framework or Analysis, without needing to link against this library -inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) -{ - // - // Add ALICE particles to the ROOT PDG data base - // Code has been taken from AliRoot - const Int_t kspe = 50000000; - - // PDG nuclear states are 10-digit numbers - // 10LZZZAAAI e.g. deuteron is - // 1000010020 - const Int_t kion = 1000000000; - - /* - const Double_t kAu2Gev=0.9314943228; -*/ - - const Double_t khSlash = 1.0545726663e-27; - const Double_t kErg2Gev = 1 / 1.6021773349e-3; - const Double_t khShGev = khSlash * kErg2Gev; - const Double_t kYear2Sec = 3600 * 24 * 365.25; - - // Heavy-flavour particles - - // χc1(3872) aka X(3872), taken from PDG 2022 - // (https://pdg.lbl.gov/2022/listings/rpp2022-list-chi-c1-3872.pdf) - db->AddParticle("Chi_c1(3872)", "Chi_c1(3872)", 3.87165, kFALSE, 0, 0, - "CCBarMeson", 9920443); - - // - // Bottom mesons - // mass and life-time from PDG - // - db->AddParticle("Upsilon(3S)", "Upsilon(3S)", 10.3552, kTRUE, 0, 0, - "Bottonium", 200553); - - // QCD diffractive states - db->AddParticle("rho_diff0", "rho_diff0", 0, kTRUE, 0, 0, "QCD diffr. state", - 9900110); - db->AddParticle("pi_diffr+", "pi_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", - 9900210); - db->AddParticle("omega_di", "omega_di", 0, kTRUE, 0, 0, "QCD diffr. state", - 9900220); - db->AddParticle("phi_diff", "phi_diff", 0, kTRUE, 0, 0, "QCD diffr. state", - 9900330); - db->AddParticle("J/psi_di", "J/psi_di", 0, kTRUE, 0, 0, "QCD diffr. state", - 9900440); - db->AddParticle("n_diffr0", "n_diffr0", 0, kTRUE, 0, 0, "QCD diffr. state", - 9902110); - db->AddParticle("p_diffr+", "p_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", - 9902210); - - // From Herwig - db->AddParticle("PSID ", " ", 3.7699, kFALSE, 0.0, 0, "meson", 30443); - - db->AddParticle("A_00 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9000111); - db->AddParticle("A_0+ ", " ", 0.9960, kFALSE, 0.0, +3, "meson", 9000211); - db->AddParticle("A_0- ", " ", 0.9960, kFALSE, 0.0, -3, "meson", -9000211); - - // db->AddParticle("F0P0 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9010221); - - db->AddParticle("KDL_2+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 10325); - db->AddParticle("KDL_2- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -10325); - - db->AddParticle("KDL_20 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 10315); - db->AddParticle("KDL_2BR0", " ", 1.773, kFALSE, 0.0, 0, "meson", -10315); - - db->AddParticle("PI_2+ ", " ", 1.670, kFALSE, 0.0, +3, "meson", 10215); - db->AddParticle("PI_2- ", " ", 1.670, kFALSE, 0.0, -3, "meson", -10215); - db->AddParticle("PI_20 ", " ", 1.670, kFALSE, 0.0, 0, "meson", 10115); - - db->AddParticle("KD*+ ", " ", 1.717, kFALSE, 0.0, +3, "meson", 30323); - db->AddParticle("KD*- ", " ", 1.717, kFALSE, 0.0, -3, "meson", -30323); - - db->AddParticle("KD*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", 30313); - db->AddParticle("KDBR*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", -30313); - - db->AddParticle("RHOD+ ", " ", 1.700, kFALSE, 0.0, +3, "meson", 30213); - db->AddParticle("RHOD- ", " ", 1.700, kFALSE, 0.0, -3, "meson", -30213); - db->AddParticle("RHOD0 ", " ", 1.700, kFALSE, 0.0, 0, "meson", 30113); - - db->AddParticle("ETA_2(L)", " ", 1.632, kFALSE, 0.0, 0, "meson", 10225); - db->AddParticle("ETA_2(H)", " ", 1.854, kFALSE, 0.0, 0, "meson", 10335); - db->AddParticle("OMEGA(H)", " ", 1.649, kFALSE, 0.0, 0, "meson", 30223); - - db->AddParticle("KDH_2+ ", " ", 1.816, kFALSE, 0.0, +3, "meson", 20325); - db->AddParticle("KDH_2- ", " ", 1.816, kFALSE, 0.0, -3, "meson", -20325); - - db->AddParticle("KDH_20 ", " ", 1.816, kFALSE, 0.0, 0, "meson", 20315); - db->AddParticle("KDH_2BR0", " ", 1.816, kFALSE, 0.0, 0, "meson", -20315); - - db->AddParticle("KD_3+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 327); - db->AddParticle("KD_3- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -327); - - db->AddParticle("KD_30 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 317); - db->AddParticle("KD_3BR0 ", " ", 1.773, kFALSE, 0.0, 0, "meson", -317); - - db->AddParticle("RHO_3+ ", " ", 1.691, kFALSE, 0.0, +3, "meson", 217); - db->AddParticle("RHO_3- ", " ", 1.691, kFALSE, 0.0, -3, "meson", -217); - db->AddParticle("RHO_30 ", " ", 1.691, kFALSE, 0.0, 0, "meson", 117); - db->AddParticle("OMEGA_3 ", " ", 1.667, kFALSE, 0.0, 0, "meson", 227); - db->AddParticle("PHI_3 ", " ", 1.854, kFALSE, 0.0, 0, "meson", 337); - - db->AddParticle("CHI2P_B0", " ", 10.232, kFALSE, 0.0, 0, "meson", 110551); - db->AddParticle("CHI2P_B1", " ", 10.255, kFALSE, 0.0, 0, "meson", 120553); - db->AddParticle("CHI2P_B2", " ", 10.269, kFALSE, 0.0, 0, "meson", 100555); - db->AddParticle("UPSLON4S", " ", 10.580, kFALSE, 0.0, 0, "meson", 300553); - - // IONS - // - // Done by default now from Pythia6 table - // Needed for other generators - // So check if already defined - - /// UPDATED VALUES FROM CODATA 2018 - Int_t ionCode = kion + 10020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Deuteron", "Deuteron", 1.87561294257, kTRUE, 0, 3, "Ion", - ionCode); - } - db->AddAntiParticle("AntiDeuteron", -ionCode); - - ionCode = kion + 10030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Triton", "Triton", 2.80892113298, kFALSE, - khShGev / (12.33 * kYear2Sec), 3, "Ion", ionCode); - } - db->AddAntiParticle("AntiTriton", -ionCode); - - ionCode = kion + 20030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("HE3", "HE3", 2.80839160743, kFALSE, 0, 6, "Ion", ionCode); - } - db->AddAntiParticle("AntiHE3", -ionCode); - - ionCode = kion + 20040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Alpha", "Alpha", 3.7273794066, kTRUE, - khShGev / (12.33 * kYear2Sec), 6, "Ion", ionCode); - } - db->AddAntiParticle("AntiAlpha", -ionCode); - /// PLEASE UPDATE REGULARLY - - // Special particles - // - db->AddParticle("Cherenkov", "Cherenkov", 0, kFALSE, 0, 0, "Special", - kspe + 50); - db->AddParticle("FeedbackPhoton", "FeedbackPhoton", 0, kFALSE, 0, 0, - "Special", kspe + 51); - - // Hyper nuclei and exotica - ionCode = 1010010030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("HyperTriton", "HyperTriton", 2.991134, kFALSE, 2.5e-15, 3, - "Ion", ionCode); - db->AddAntiParticle("AntiHyperTriton", -ionCode); - } - - // hyper hydrogen 4 - ionCode = 1010010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.922434, kFALSE, 2.5e-15, - 3, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhydrog4", -ionCode); - } - - // hyper helium 4 - ionCode = 1010020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.921728, kFALSE, 2.5e-15, - 6, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhelium4", -ionCode); - } - - // hyper helium 5 - ionCode = 1010020050; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.839961, kFALSE, 2.5e-15, - 6, "Ion", ionCode); - db->AddAntiParticle("AntiHyperhelium5", -ionCode); - } - - // double hyper hydrogen 4 - ionCode = 1020010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, - kFALSE, 2.5e-15, 6, "Ion", ionCode); - db->AddAntiParticle("AntiDoubleHyperhydrogen4", -ionCode); - } - - // 4-Xi-He - ionCode = 1120020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("4XiHe", "4XiHe", 4.128, kFALSE, 4.04e-15, 3, "Ion", - ionCode); - db->AddAntiParticle("Anti4XiHe", -ionCode); - } - - // 4-Xi-H - ionCode = 1120010040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("4XiH", "4XiH", 4.128, kFALSE, 4.04e-15, 3, "Ion", ionCode); - db->AddAntiParticle("Anti4XiH", -ionCode); - } - - // Lithium 4 ground state - ionCode = 1000030040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lithium4", "Lithium4", 3.7513, kFALSE, 0.003, 9, "Ion", - ionCode); - } - // anti Lithium 4 ground state - ionCode = -1000030040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLithium4", "AntiLithium4", 3.7513, kFALSE, 0.003, 9, - "Ion", ionCode); - } - - // hyper helium 4 sigma - ionCode = 1110020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hyperhelium4sigma", "Hyperhelium4sigma", 3.995, kFALSE, - 2.5e-15, 6, "Ion", ionCode); - } - // anti-hyper helium 4 sigma - ionCode = -1110020040; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHyperhelium4sigma", "AntiHyperhelium4sigma", 3.995, - kFALSE, 2.5e-15, 6, "Ion", ionCode); - } - - ionCode = 1010000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("LambdaNeutron", "LambdaNeutron", 2.054, kFALSE, 2.5e-15, 0, - "Special", ionCode); - } - - ionCode = -1010000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambdaNeutron", "AntiLambdaNeutron", 2.054, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1020000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Hdibaryon", "Hdibaryon", 2.23, kFALSE, 2.5e-15, 0, - "Special", ionCode); - } - - ionCode = -1020000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiHdibaryon", "AntiHdibaryon", 2.23, kFALSE, 2.5e-15, 0, - "Special", ionCode); - } - - ionCode = 1010000030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("LambdaNeutronNeutron", "LambdaNeutronNeutron", 2.99, - kFALSE, 2.5e-15, 0, "Special", ionCode); - } - - ionCode = -1010000030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambdaNeutronNeutron", "AntiLambdaNeutronNeutron", - 2.99, kFALSE, 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1020010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi0Proton", "Xi0Proton", 2.248, kFALSE, 5e-15, 3, "Ion", - ionCode); - } - - ionCode = -1020010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiXi0Proton", "AntiXi0Proton", 2.248, kFALSE, 5e-15, 3, - "Ion", ionCode); - } - - ionCode = 1030000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaProton", "OmegaProton", 2.592, kFALSE, 2.5e-15, 0, - "Special", ionCode); - } - - ionCode = -1030000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaProton", "AntiOmegaProton", 2.592, kFALSE, - 2.5e-15, 0, "Special", ionCode); - } - - ionCode = 1030010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaNeutron", "OmegaNeutron", 2.472, kFALSE, 0.003, 3, - "Special", ionCode); - } - - ionCode = -1030010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaNeutron", "AntiOmegaNeutron", 2.472, kFALSE, - 0.003, 3, "Special", ionCode); - } - - ionCode = 1060020020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("OmegaOmega", "OmegaOmega", 3.229, kFALSE, 2.5e-15, 6, - "Special", ionCode); - } - - ionCode = -1060020020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiOmegaOmega", "AntiOmegaOmega", 3.229, kFALSE, 2.5e-15, - 6, "Special", ionCode); - } - - ionCode = 1010010021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda1405Proton", "Lambda1405Proton", 2.295, kFALSE, 0.05, - 3, "Special", ionCode); - } - - ionCode = -1010010021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambda1405Proton", "AntiLambda1405Proton", 2.295, - kFALSE, 0.05, 3, "Special", ionCode); - } - - ionCode = 1020000021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda1405Lambda1405", "Lambda1405Lambda1405", 2.693, - kFALSE, 0.05, 0, "Special", ionCode); - } - - ionCode = -1020000021; - if (!db->GetParticle(ionCode)) { - db->AddParticle("AntiLambda1405Lambda1405", "AntiLambda1405Lambda1405", - 2.693, kFALSE, 0.05, 0, "Special", ionCode); - } - - ionCode = 2010010030; - if (!db->GetParticle(ionCode)) { - db->AddParticle("CTriton", "CTriton", 4.162, kFALSE, 3.3e-12, 3, "Ion", - ionCode); - db->AddAntiParticle("AntiCTriton", -ionCode); - } - - ionCode = 2010010020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("CDeuteron", "CDeuteron", 3.226, kFALSE, 3.3e-12, 3, "Ion", - ionCode); - db->AddAntiParticle("AntiCDeuteron", -ionCode); - } - - // Special resonances - - ionCode = 9010221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_980", "f0_980", 0.980, kFALSE, 0.07, 0, "Resonance", - ionCode); - } - - ionCode = 225; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f2_1270", "f2_1270", 1.275, kFALSE, 0.185, 0, "Resonance", - ionCode); - } - - // Lambda(1520)0 - ionCode = 102134; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Lambda_1520_0", "Lambda_1520_0", 1.5195, kFALSE, 0.0156, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("AntiLambda_1520_0", "AntiLambda_1520_0", 1.5195, kFALSE, - 0.0156, 0, "Resonance", -ionCode); - } - - // f1 study - ionCode = 20223; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f1_1285", "f1_1285", 1.28210, kFALSE, 0.02420, 0, - "Resonance", ionCode); - } - ionCode = 20333; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f1_1420", "f1_1420", 1.42640, kFALSE, 0.05490, 0, - "Resonance", ionCode); - } - - // glueball hunting - ionCode = 115; - if (!db->GetParticle(ionCode)) { - db->AddParticle("a2_1320", "a2_1320", 1.3182, kFALSE, 0.1078, 0, - "Resonance", ionCode); - } - ionCode = 10221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1370", "f0_1370", 1.37, kFALSE, 0.200, 0, "Resonance", - ionCode); - } - ionCode = 9030221; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1500", "f0_1500", 1.500, kFALSE, 0.112, 0, "Resonance", - ionCode); - } - ionCode = 10331; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f0_1710", "f0_1710", 1.710, kFALSE, 0.139, 0, "Resonance", - ionCode); - } - ionCode = 335; - if (!db->GetParticle(ionCode)) { - db->AddParticle("f2_1525", "f2_1525", 1.525, kFALSE, 0.073, 0, "Resonance", - ionCode); - } - - // Xi-/+ (1820) - ionCode = 123314; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi_Minus_1820", "Xi_Minus_1820", 1.8234, kFALSE, 0.024, -3, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Xi_Plus_1820", "Xi_Plus_1820", 1.8234, kFALSE, 0.024, 3, - "Resonance", -ionCode); - } - - // Xi0 (1820) - ionCode = 123324; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Xi_0_1820", "Xi_0_1820", 1.8234, kFALSE, 0.024, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Xi_0_Bar_1820", "Xi_0_Bar_1820", 1.8234, kFALSE, 0.024, 0, - "Resonance", -ionCode); - } - - // Ps - hidden strange (s-sbar) pentaquarks - - ionCode = 9322134; - if (!db->GetParticle(ionCode)) { - db->AddParticle("ps_2100", "ps_2100", 2.100, kFALSE, 0.040, 3, "Resonance", - ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("anti-ps_2100", "anti-ps_2100", 2.100, kFALSE, 0.040, -3, - "Resonance", -ionCode); - } - - ionCode = 9322136; - if (!db->GetParticle(ionCode)) { - db->AddParticle("ps_2500", "ps_2500", 2.500, kFALSE, 0.040, 3, "Resonance", - ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("anti-ps_2500", "anti-ps_2500", 2.500, kFALSE, 0.040, -3, - "Resonance", -ionCode); - } - - // Additional Hidden Strangeness Pentaquarks - - // Ps +/- - ionCode = 9322132; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_1870", "Ps_Plus_1870", 1.870, kFALSE, 0.10, 3, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_1870", "Anti-Ps_Minus_1870", 1.870, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9322312; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2065", "Ps_Plus_2065", 2.065, kFALSE, 0.10, 3, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2065", "Anti-Ps_Minus_2065", 2.065, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9323212; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2255", "Ps_Plus_2255", 2.255, kFALSE, 0.10, 3, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2255", "Anti-Ps_Minus_2255", 2.255, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - ionCode = 9332212; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_Plus_2455", "Ps_Plus_2455", 2.455, kFALSE, 0.10, 3, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_Minus_2455", "Anti-Ps_Minus_2455", 2.455, kFALSE, - 0.10, -3, "Resonance", -ionCode); - } - - // Ps0 - ionCode = 9322131; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_1870", "Ps_0_1870", 1.870, kFALSE, 0.10, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_1870", "Anti-Ps_0_1870", 1.870, kFALSE, 0.10, 0, - "Resonance", -ionCode); - } - ionCode = 9322311; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2065", "Ps_0_2065", 2.065, kFALSE, 0.10, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2065", "Anti-Ps_0_2065", 2.065, kFALSE, 0.10, 0, - "Resonance", -ionCode); - } - ionCode = 9323211; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2255", "Ps_0_2255", 2.255, kFALSE, 0.10, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2255", "Anti-Ps_0_2255", 2.255, kFALSE, 0.10, 0, - "Resonance", -ionCode); - } - ionCode = 9332211; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Ps_0_2455", "Ps_0_2455", 2.455, kFALSE, 0.10, 0, - "Resonance", ionCode); - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Anti-Ps_0_2455", "Anti-Ps_0_2455", 2.455, kFALSE, 0.10, 0, - "Resonance", -ionCode); - } - - // Charm pentaquarks - // Theta_c: isospin singlet with J=1/2+ (see - // https://arxiv.org/abs/hep-ph/0409121) - ionCode = 9422111; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Anti-Theta_c_3100", "Anti-Theta_c_3100", 3.099, kFALSE, - 83.e-6, 0, "Resonance", - ionCode); // same width as D*+ (83 keV) - } - if (!db->GetParticle(-ionCode)) { - db->AddParticle("Theta_c_3100", "Theta_c_3100", 3.099, kFALSE, 83.e-6, 0, - "Resonance", -ionCode); // same width as D*+ (83 keV) - } - - // d*(2380) - dibaryon resonance - - ionCode = 900010020; // Arbitrary choice - as deuteron but with leading 9 - // instead of 10 - if (!db->GetParticle(ionCode)) { - db->AddParticle("d*_2380", "d*_2380", 2.38, kFALSE, 0.070, 3, "Resonance", - ionCode); - } - db->AddAntiParticle("d*_2380_bar", -ionCode); - - // Sexaquark (uuddss): compact, neutral and stable hypothetical bound state - // (arxiv.org/abs/1708.08951) - ionCode = 900000020; - if (!db->GetParticle(ionCode)) { - db->AddParticle("Sexaquark", "Sexaquark", 2.0, kTRUE, 0.0, 0, "Special", - ionCode); - } - - if (!db->GetParticle(-ionCode)) { - db->AddParticle("AntiSexaquark", "AntiSexaquark", 2.0, kTRUE, 0.0, 0, - "Special", -ionCode); - } - - // lastly, add particle from the the extra text file - addParticlesFromExternalFile(db); -} - -inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG* db) -{ - static bool initialized = false; - if (!initialized) { - // allow user to specify custom file - if (const char* custom = std::getenv("O2_SIM_CUSTOM_PDG")) { - // TODO: make sure this is a file - db->ReadPDGTable(custom); - } else if (const char* o2Root = std::getenv("O2_ROOT")) { - // take the maintained file from O2 - auto inputExtraPDGs = - std::string(o2Root) + - "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; - db->ReadPDGTable(inputExtraPDGs.c_str()); - } - initialized = true; - } -} - -} // namespace o2 - -#endif // O2_O2DATABASEPDG_H From 25fcc24f26692ec28551ccded2a8026e88bc5bc7 Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:57:26 +0100 Subject: [PATCH 13/15] Upload new O2DatabasePDG.h with correct formatting using clang-format --- .../SimulationDataFormat/O2DatabasePDG.h | 680 ++++++++++++++++++ 1 file changed, 680 insertions(+) create mode 100644 DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h new file mode 100644 index 0000000000000..9536b46257866 --- /dev/null +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -0,0 +1,680 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright +// holders. All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifndef O2_O2DATABASEPDG_H +#define O2_O2DATABASEPDG_H + +#include "TDatabasePDG.h" +#include "TParticlePDG.h" +#include + +namespace o2 { + +// An ALICE specific extension of ROOT's TDatabasePDG +// +// By using O2DatabasePDG::Instance() in our code instead of +// TDatabasePDG::Instance(), correct initialization is guaranteed. +// Alternatively, a static function is exposed with which particles can be added +// to TDatabasePDG objects directly. +class O2DatabasePDG { + // +public: + static TDatabasePDG *Instance() { + static bool initialized = + false; // initialize this --> adds particles to TDatabasePDG; + auto db = TDatabasePDG::Instance(); + if (!initialized) { + addALICEParticles(db); + initialized = true; + } + return db; + } + + // adds ALICE particles to a given TDatabasePDG instance + static void addALICEParticles(TDatabasePDG *db = TDatabasePDG::Instance()); + static void addParticlesFromExternalFile(TDatabasePDG *db); + + // get particle's (if any) mass + static Double_t MassImpl(TParticlePDG *particle, bool &success) { + success = false; + if (!particle) { + return -1.; + } + success = true; + return particle->Mass(); + } + + // determine particle to get mass for based on PDG + static Double_t Mass(int pdg, bool &success, + TDatabasePDG *db = O2DatabasePDG::Instance()) { + if (pdg < IONBASELOW || pdg > IONBASEHIGH) { + // not an ion, return immediately + return MassImpl(db->GetParticle(pdg), success); + } + if (auto particle = db->GetParticle(pdg)) { + // see if this ion can be found + return MassImpl(particle, success); + } + // if we are here, try one last time to look for ground state of potential + // isomere state + pdg = pdg / 10 * 10; + return MassImpl(db->GetParticle(pdg), success); + } + + // remove default constructor + O2DatabasePDG() = delete; + +private: + static constexpr int IONBASELOW{1000000000}; + static constexpr int IONBASEHIGH{1099999999}; +}; + +// by keeping this inline, we can use it in other parts of the code, for +// instance Framework or Analysis, without needing to link against this library +inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { + // + // Add ALICE particles to the ROOT PDG data base + // Code has been taken from AliRoot + const Int_t kspe = 50000000; + + // PDG nuclear states are 10-digit numbers + // 10LZZZAAAI e.g. deuteron is + // 1000010020 + const Int_t kion = 1000000000; + + /* + const Double_t kAu2Gev=0.9314943228; +*/ + + const Double_t khSlash = 1.0545726663e-27; + const Double_t kErg2Gev = 1 / 1.6021773349e-3; + const Double_t khShGev = khSlash * kErg2Gev; + const Double_t kYear2Sec = 3600 * 24 * 365.25; + + // Heavy-flavour particles + + // χc1(3872) aka X(3872), taken from PDG 2022 + // (https://pdg.lbl.gov/2022/listings/rpp2022-list-chi-c1-3872.pdf) + db->AddParticle("Chi_c1(3872)", "Chi_c1(3872)", 3.87165, kFALSE, 0, 0, + "CCBarMeson", 9920443); + + // + // Bottom mesons + // mass and life-time from PDG + // + db->AddParticle("Upsilon(3S)", "Upsilon(3S)", 10.3552, kTRUE, 0, 0, + "Bottonium", 200553); + + // QCD diffractive states + db->AddParticle("rho_diff0", "rho_diff0", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900110); + db->AddParticle("pi_diffr+", "pi_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", + 9900210); + db->AddParticle("omega_di", "omega_di", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900220); + db->AddParticle("phi_diff", "phi_diff", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900330); + db->AddParticle("J/psi_di", "J/psi_di", 0, kTRUE, 0, 0, "QCD diffr. state", + 9900440); + db->AddParticle("n_diffr0", "n_diffr0", 0, kTRUE, 0, 0, "QCD diffr. state", + 9902110); + db->AddParticle("p_diffr+", "p_diffr+", 0, kTRUE, 0, 3, "QCD diffr. state", + 9902210); + + // From Herwig + db->AddParticle("PSID ", " ", 3.7699, kFALSE, 0.0, 0, "meson", 30443); + + db->AddParticle("A_00 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9000111); + db->AddParticle("A_0+ ", " ", 0.9960, kFALSE, 0.0, +3, "meson", 9000211); + db->AddParticle("A_0- ", " ", 0.9960, kFALSE, 0.0, -3, "meson", -9000211); + + // db->AddParticle("F0P0 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9010221); + + db->AddParticle("KDL_2+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 10325); + db->AddParticle("KDL_2- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -10325); + + db->AddParticle("KDL_20 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 10315); + db->AddParticle("KDL_2BR0", " ", 1.773, kFALSE, 0.0, 0, "meson", -10315); + + db->AddParticle("PI_2+ ", " ", 1.670, kFALSE, 0.0, +3, "meson", 10215); + db->AddParticle("PI_2- ", " ", 1.670, kFALSE, 0.0, -3, "meson", -10215); + db->AddParticle("PI_20 ", " ", 1.670, kFALSE, 0.0, 0, "meson", 10115); + + db->AddParticle("KD*+ ", " ", 1.717, kFALSE, 0.0, +3, "meson", 30323); + db->AddParticle("KD*- ", " ", 1.717, kFALSE, 0.0, -3, "meson", -30323); + + db->AddParticle("KD*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", 30313); + db->AddParticle("KDBR*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", -30313); + + db->AddParticle("RHOD+ ", " ", 1.700, kFALSE, 0.0, +3, "meson", 30213); + db->AddParticle("RHOD- ", " ", 1.700, kFALSE, 0.0, -3, "meson", -30213); + db->AddParticle("RHOD0 ", " ", 1.700, kFALSE, 0.0, 0, "meson", 30113); + + db->AddParticle("ETA_2(L)", " ", 1.632, kFALSE, 0.0, 0, "meson", 10225); + db->AddParticle("ETA_2(H)", " ", 1.854, kFALSE, 0.0, 0, "meson", 10335); + db->AddParticle("OMEGA(H)", " ", 1.649, kFALSE, 0.0, 0, "meson", 30223); + + db->AddParticle("KDH_2+ ", " ", 1.816, kFALSE, 0.0, +3, "meson", 20325); + db->AddParticle("KDH_2- ", " ", 1.816, kFALSE, 0.0, -3, "meson", -20325); + + db->AddParticle("KDH_20 ", " ", 1.816, kFALSE, 0.0, 0, "meson", 20315); + db->AddParticle("KDH_2BR0", " ", 1.816, kFALSE, 0.0, 0, "meson", -20315); + + db->AddParticle("KD_3+ ", " ", 1.773, kFALSE, 0.0, +3, "meson", 327); + db->AddParticle("KD_3- ", " ", 1.773, kFALSE, 0.0, -3, "meson", -327); + + db->AddParticle("KD_30 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 317); + db->AddParticle("KD_3BR0 ", " ", 1.773, kFALSE, 0.0, 0, "meson", -317); + + db->AddParticle("RHO_3+ ", " ", 1.691, kFALSE, 0.0, +3, "meson", 217); + db->AddParticle("RHO_3- ", " ", 1.691, kFALSE, 0.0, -3, "meson", -217); + db->AddParticle("RHO_30 ", " ", 1.691, kFALSE, 0.0, 0, "meson", 117); + db->AddParticle("OMEGA_3 ", " ", 1.667, kFALSE, 0.0, 0, "meson", 227); + db->AddParticle("PHI_3 ", " ", 1.854, kFALSE, 0.0, 0, "meson", 337); + + db->AddParticle("CHI2P_B0", " ", 10.232, kFALSE, 0.0, 0, "meson", 110551); + db->AddParticle("CHI2P_B1", " ", 10.255, kFALSE, 0.0, 0, "meson", 120553); + db->AddParticle("CHI2P_B2", " ", 10.269, kFALSE, 0.0, 0, "meson", 100555); + db->AddParticle("UPSLON4S", " ", 10.580, kFALSE, 0.0, 0, "meson", 300553); + + // IONS + // + // Done by default now from Pythia6 table + // Needed for other generators + // So check if already defined + + /// UPDATED VALUES FROM CODATA 2018 + Int_t ionCode = kion + 10020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Deuteron", "Deuteron", 1.87561294257, kTRUE, 0, 3, "Ion", + ionCode); + } + db->AddAntiParticle("AntiDeuteron", -ionCode); + + ionCode = kion + 10030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Triton", "Triton", 2.80892113298, kFALSE, + khShGev / (12.33 * kYear2Sec), 3, "Ion", ionCode); + } + db->AddAntiParticle("AntiTriton", -ionCode); + + ionCode = kion + 20030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("HE3", "HE3", 2.80839160743, kFALSE, 0, 6, "Ion", ionCode); + } + db->AddAntiParticle("AntiHE3", -ionCode); + + ionCode = kion + 20040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Alpha", "Alpha", 3.7273794066, kTRUE, + khShGev / (12.33 * kYear2Sec), 6, "Ion", ionCode); + } + db->AddAntiParticle("AntiAlpha", -ionCode); + /// PLEASE UPDATE REGULARLY + + // Special particles + // + db->AddParticle("Cherenkov", "Cherenkov", 0, kFALSE, 0, 0, "Special", + kspe + 50); + db->AddParticle("FeedbackPhoton", "FeedbackPhoton", 0, kFALSE, 0, 0, + "Special", kspe + 51); + + // Hyper nuclei and exotica + ionCode = 1010010030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("HyperTriton", "HyperTriton", 2.991134, kFALSE, 2.5e-15, 3, + "Ion", ionCode); + db->AddAntiParticle("AntiHyperTriton", -ionCode); + } + + // hyper hydrogen 4 + ionCode = 1010010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhydrog4", "Hyperhydrog4", 3.922434, kFALSE, 2.5e-15, + 3, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhydrog4", -ionCode); + } + + // hyper helium 4 + ionCode = 1010020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium4", "Hyperhelium4", 3.921728, kFALSE, 2.5e-15, + 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium4", -ionCode); + } + + // hyper helium 5 + ionCode = 1010020050; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium5", "Hyperhelium5", 4.839961, kFALSE, 2.5e-15, + 6, "Ion", ionCode); + db->AddAntiParticle("AntiHyperhelium5", -ionCode); + } + + // double hyper hydrogen 4 + ionCode = 1020010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("DoubleHyperhydrogen4", "DoubleHyperhydrogen4", 4.106, + kFALSE, 2.5e-15, 6, "Ion", ionCode); + db->AddAntiParticle("AntiDoubleHyperhydrogen4", -ionCode); + } + + // 4-Xi-He + ionCode = 1120020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("4XiHe", "4XiHe", 4.128, kFALSE, 4.04e-15, 3, "Ion", + ionCode); + db->AddAntiParticle("Anti4XiHe", -ionCode); + } + + // 4-Xi-H + ionCode = 1120010040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("4XiH", "4XiH", 4.128, kFALSE, 4.04e-15, 3, "Ion", ionCode); + db->AddAntiParticle("Anti4XiH", -ionCode); + } + + // Lithium 4 ground state + ionCode = 1000030040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lithium4", "Lithium4", 3.7513, kFALSE, 0.003, 9, "Ion", + ionCode); + } + // anti Lithium 4 ground state + ionCode = -1000030040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLithium4", "AntiLithium4", 3.7513, kFALSE, 0.003, 9, + "Ion", ionCode); + } + + // hyper helium 4 sigma + ionCode = 1110020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hyperhelium4sigma", "Hyperhelium4sigma", 3.995, kFALSE, + 2.5e-15, 6, "Ion", ionCode); + } + // anti-hyper helium 4 sigma + ionCode = -1110020040; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiHyperhelium4sigma", "AntiHyperhelium4sigma", 3.995, + kFALSE, 2.5e-15, 6, "Ion", ionCode); + } + + ionCode = 1010000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("LambdaNeutron", "LambdaNeutron", 2.054, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1010000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambdaNeutron", "AntiLambdaNeutron", 2.054, kFALSE, + 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1020000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Hdibaryon", "Hdibaryon", 2.23, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1020000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiHdibaryon", "AntiHdibaryon", 2.23, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = 1010000030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("LambdaNeutronNeutron", "LambdaNeutronNeutron", 2.99, + kFALSE, 2.5e-15, 0, "Special", ionCode); + } + + ionCode = -1010000030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambdaNeutronNeutron", "AntiLambdaNeutronNeutron", + 2.99, kFALSE, 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1020010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi0Proton", "Xi0Proton", 2.248, kFALSE, 5e-15, 3, "Ion", + ionCode); + } + + ionCode = -1020010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiXi0Proton", "AntiXi0Proton", 2.248, kFALSE, 5e-15, 3, + "Ion", ionCode); + } + + ionCode = 1030000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaProton", "OmegaProton", 2.592, kFALSE, 2.5e-15, 0, + "Special", ionCode); + } + + ionCode = -1030000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaProton", "AntiOmegaProton", 2.592, kFALSE, + 2.5e-15, 0, "Special", ionCode); + } + + ionCode = 1030010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaNeutron", "OmegaNeutron", 2.472, kFALSE, 0.003, 3, + "Special", ionCode); + } + + ionCode = -1030010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaNeutron", "AntiOmegaNeutron", 2.472, kFALSE, + 0.003, 3, "Special", ionCode); + } + + ionCode = 1060020020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("OmegaOmega", "OmegaOmega", 3.229, kFALSE, 2.5e-15, 6, + "Special", ionCode); + } + + ionCode = -1060020020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiOmegaOmega", "AntiOmegaOmega", 3.229, kFALSE, 2.5e-15, + 6, "Special", ionCode); + } + + ionCode = 1010010021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda1405Proton", "Lambda1405Proton", 2.295, kFALSE, 0.05, + 3, "Special", ionCode); + } + + ionCode = -1010010021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambda1405Proton", "AntiLambda1405Proton", 2.295, + kFALSE, 0.05, 3, "Special", ionCode); + } + + ionCode = 1020000021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda1405Lambda1405", "Lambda1405Lambda1405", 2.693, + kFALSE, 0.05, 0, "Special", ionCode); + } + + ionCode = -1020000021; + if (!db->GetParticle(ionCode)) { + db->AddParticle("AntiLambda1405Lambda1405", "AntiLambda1405Lambda1405", + 2.693, kFALSE, 0.05, 0, "Special", ionCode); + } + + ionCode = 2010010030; + if (!db->GetParticle(ionCode)) { + db->AddParticle("CTriton", "CTriton", 4.162, kFALSE, 3.3e-12, 3, "Ion", + ionCode); + db->AddAntiParticle("AntiCTriton", -ionCode); + } + + ionCode = 2010010020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("CDeuteron", "CDeuteron", 3.226, kFALSE, 3.3e-12, 3, "Ion", + ionCode); + db->AddAntiParticle("AntiCDeuteron", -ionCode); + } + + // Special resonances + + ionCode = 9010221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_980", "f0_980", 0.980, kFALSE, 0.07, 0, "Resonance", + ionCode); + } + + ionCode = 225; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f2_1270", "f2_1270", 1.275, kFALSE, 0.185, 0, "Resonance", + ionCode); + } + + // Lambda(1520)0 + ionCode = 102134; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Lambda_1520_0", "Lambda_1520_0", 1.5195, kFALSE, 0.0156, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("AntiLambda_1520_0", "AntiLambda_1520_0", 1.5195, kFALSE, + 0.0156, 0, "Resonance", -ionCode); + } + + // f1 study + ionCode = 20223; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f1_1285", "f1_1285", 1.28210, kFALSE, 0.02420, 0, + "Resonance", ionCode); + } + ionCode = 20333; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f1_1420", "f1_1420", 1.42640, kFALSE, 0.05490, 0, + "Resonance", ionCode); + } + + // glueball hunting + ionCode = 115; + if (!db->GetParticle(ionCode)) { + db->AddParticle("a2_1320", "a2_1320", 1.3182, kFALSE, 0.1078, 0, + "Resonance", ionCode); + } + ionCode = 10221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1370", "f0_1370", 1.37, kFALSE, 0.200, 0, "Resonance", + ionCode); + } + ionCode = 9030221; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1500", "f0_1500", 1.500, kFALSE, 0.112, 0, "Resonance", + ionCode); + } + ionCode = 10331; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f0_1710", "f0_1710", 1.710, kFALSE, 0.139, 0, "Resonance", + ionCode); + } + ionCode = 335; + if (!db->GetParticle(ionCode)) { + db->AddParticle("f2_1525", "f2_1525", 1.525, kFALSE, 0.073, 0, "Resonance", + ionCode); + } + + // Xi-/+ (1820) + ionCode = 123314; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi_Minus_1820", "Xi_Minus_1820", 1.8234, kFALSE, 0.024, -3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Xi_Plus_1820", "Xi_Plus_1820", 1.8234, kFALSE, 0.024, 3, + "Resonance", -ionCode); + } + + // Xi0 (1820) + ionCode = 123324; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Xi_0_1820", "Xi_0_1820", 1.8234, kFALSE, 0.024, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Xi_0_Bar_1820", "Xi_0_Bar_1820", 1.8234, kFALSE, 0.024, 0, + "Resonance", -ionCode); + } + + // Ps - hidden strange (s-sbar) pentaquarks + + ionCode = 9322134; + if (!db->GetParticle(ionCode)) { + db->AddParticle("ps_2100", "ps_2100", 2.100, kFALSE, 0.040, 3, "Resonance", + ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("anti-ps_2100", "anti-ps_2100", 2.100, kFALSE, 0.040, -3, + "Resonance", -ionCode); + } + + ionCode = 9322136; + if (!db->GetParticle(ionCode)) { + db->AddParticle("ps_2500", "ps_2500", 2.500, kFALSE, 0.040, 3, "Resonance", + ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("anti-ps_2500", "anti-ps_2500", 2.500, kFALSE, 0.040, -3, + "Resonance", -ionCode); + } + + // Additional Hidden Strangeness Pentaquarks + + // Ps +/- + ionCode = 9322132; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_1870", "Ps_Plus_1870", 1.870, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_1870", "Anti-Ps_Minus_1870", 1.870, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9322312; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2065", "Ps_Plus_2065", 2.065, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2065", "Anti-Ps_Minus_2065", 2.065, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9323212; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2255", "Ps_Plus_2255", 2.255, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2255", "Anti-Ps_Minus_2255", 2.255, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + ionCode = 9332212; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_Plus_2455", "Ps_Plus_2455", 2.455, kFALSE, 0.10, 3, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_Minus_2455", "Anti-Ps_Minus_2455", 2.455, kFALSE, + 0.10, -3, "Resonance", -ionCode); + } + + // Ps0 + ionCode = 9322131; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_1870", "Ps_0_1870", 1.870, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_1870", "Anti-Ps_0_1870", 1.870, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9322311; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2065", "Ps_0_2065", 2.065, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2065", "Anti-Ps_0_2065", 2.065, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9323211; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2255", "Ps_0_2255", 2.255, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2255", "Anti-Ps_0_2255", 2.255, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + ionCode = 9332211; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Ps_0_2455", "Ps_0_2455", 2.455, kFALSE, 0.10, 0, + "Resonance", ionCode); + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Anti-Ps_0_2455", "Anti-Ps_0_2455", 2.455, kFALSE, 0.10, 0, + "Resonance", -ionCode); + } + + // Charm pentaquarks + // Theta_c: isospin singlet with J=1/2+ (see + // https://arxiv.org/abs/hep-ph/0409121) + ionCode = 9422111; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Anti-Theta_c_3100", "Anti-Theta_c_3100", 3.099, kFALSE, + 83.e-6, 0, "Resonance", + ionCode); // same width as D*+ (83 keV) + } + if (!db->GetParticle(-ionCode)) { + db->AddParticle("Theta_c_3100", "Theta_c_3100", 3.099, kFALSE, 83.e-6, 0, + "Resonance", -ionCode); // same width as D*+ (83 keV) + } + + // d*(2380) - dibaryon resonance + + ionCode = 900010020; // Arbitrary choice - as deuteron but with leading 9 + // instead of 10 + if (!db->GetParticle(ionCode)) { + db->AddParticle("d*_2380", "d*_2380", 2.38, kFALSE, 0.070, 3, "Resonance", + ionCode); + } + db->AddAntiParticle("d*_2380_bar", -ionCode); + + // Sexaquark (uuddss): compact, neutral and stable hypothetical bound state + // (arxiv.org/abs/1708.08951) + ionCode = 900000020; + if (!db->GetParticle(ionCode)) { + db->AddParticle("Sexaquark", "Sexaquark", 2.0, kTRUE, 0.0, 0, "Special", + ionCode); + } + + if (!db->GetParticle(-ionCode)) { + db->AddParticle("AntiSexaquark", "AntiSexaquark", 2.0, kTRUE, 0.0, 0, + "Special", -ionCode); + } + + // lastly, add particle from the the extra text file + addParticlesFromExternalFile(db); +} + +inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG *db) { + static bool initialized = false; + if (!initialized) { + // allow user to specify custom file + if (const char *custom = std::getenv("O2_SIM_CUSTOM_PDG")) { + // TODO: make sure this is a file + db->ReadPDGTable(custom); + } else if (const char *o2Root = std::getenv("O2_ROOT")) { + // take the maintained file from O2 + auto inputExtraPDGs = + std::string(o2Root) + + "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; + db->ReadPDGTable(inputExtraPDGs.c_str()); + } + initialized = true; + } +} + +} // namespace o2 + +#endif // O2_O2DATABASEPDG_H From bbd9d2b2f04f782b74311b8411d8638ac137c373 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 28 Nov 2024 11:57:58 +0000 Subject: [PATCH 14/15] Please consider the following formatting changes --- .../SimulationDataFormat/O2DatabasePDG.h | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index 9536b46257866..fc32a0ae14590 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -16,7 +16,8 @@ #include "TParticlePDG.h" #include -namespace o2 { +namespace o2 +{ // An ALICE specific extension of ROOT's TDatabasePDG // @@ -24,12 +25,14 @@ namespace o2 { // TDatabasePDG::Instance(), correct initialization is guaranteed. // Alternatively, a static function is exposed with which particles can be added // to TDatabasePDG objects directly. -class O2DatabasePDG { +class O2DatabasePDG +{ // -public: - static TDatabasePDG *Instance() { + public: + static TDatabasePDG* Instance() + { static bool initialized = - false; // initialize this --> adds particles to TDatabasePDG; + false; // initialize this --> adds particles to TDatabasePDG; auto db = TDatabasePDG::Instance(); if (!initialized) { addALICEParticles(db); @@ -39,11 +42,12 @@ class O2DatabasePDG { } // adds ALICE particles to a given TDatabasePDG instance - static void addALICEParticles(TDatabasePDG *db = TDatabasePDG::Instance()); - static void addParticlesFromExternalFile(TDatabasePDG *db); + static void addALICEParticles(TDatabasePDG* db = TDatabasePDG::Instance()); + static void addParticlesFromExternalFile(TDatabasePDG* db); // get particle's (if any) mass - static Double_t MassImpl(TParticlePDG *particle, bool &success) { + static Double_t MassImpl(TParticlePDG* particle, bool& success) + { success = false; if (!particle) { return -1.; @@ -53,8 +57,9 @@ class O2DatabasePDG { } // determine particle to get mass for based on PDG - static Double_t Mass(int pdg, bool &success, - TDatabasePDG *db = O2DatabasePDG::Instance()) { + static Double_t Mass(int pdg, bool& success, + TDatabasePDG* db = O2DatabasePDG::Instance()) + { if (pdg < IONBASELOW || pdg > IONBASEHIGH) { // not an ion, return immediately return MassImpl(db->GetParticle(pdg), success); @@ -72,14 +77,15 @@ class O2DatabasePDG { // remove default constructor O2DatabasePDG() = delete; -private: + private: static constexpr int IONBASELOW{1000000000}; static constexpr int IONBASEHIGH{1099999999}; }; // by keeping this inline, we can use it in other parts of the code, for // instance Framework or Analysis, without needing to link against this library -inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { +inline void O2DatabasePDG::addALICEParticles(TDatabasePDG* db) +{ // // Add ALICE particles to the ROOT PDG data base // Code has been taken from AliRoot @@ -657,18 +663,19 @@ inline void O2DatabasePDG::addALICEParticles(TDatabasePDG *db) { addParticlesFromExternalFile(db); } -inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG *db) { +inline void O2DatabasePDG::addParticlesFromExternalFile(TDatabasePDG* db) +{ static bool initialized = false; if (!initialized) { // allow user to specify custom file - if (const char *custom = std::getenv("O2_SIM_CUSTOM_PDG")) { + if (const char* custom = std::getenv("O2_SIM_CUSTOM_PDG")) { // TODO: make sure this is a file db->ReadPDGTable(custom); - } else if (const char *o2Root = std::getenv("O2_ROOT")) { + } else if (const char* o2Root = std::getenv("O2_ROOT")) { // take the maintained file from O2 auto inputExtraPDGs = - std::string(o2Root) + - "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; + std::string(o2Root) + + "/share/Detectors/gconfig/data/extra_ions_pdg_table.dat"; db->ReadPDGTable(inputExtraPDGs.c_str()); } initialized = true; From 8665353b11d7c24b2666b432c566381ab014040a Mon Sep 17 00:00:00 2001 From: jditzelnew <58816213+jditzelnew@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:00:59 +0100 Subject: [PATCH 15/15] Update Copyright --- .../simulation/include/SimulationDataFormat/O2DatabasePDG.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h index fc32a0ae14590..4a64b0c836342 100644 --- a/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h +++ b/DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h @@ -1,6 +1,6 @@ // Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright -// holders. All rights not expressly granted are reserved. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING".