Project
Loading...
Searching...
No Matches
O2MCApplication.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include <cstdlib>
13
15#include <fairmq/Channel.h>
16#include <fairmq/Message.h>
17#include <fairmq/Device.h>
18#include <fairmq/Parts.h>
20#include <TMessage.h>
21#include <sstream>
22#include <SimConfig/SimConfig.h>
27#include <cassert>
29#include <TGeoManager.h>
30#include <fstream>
31#include <FairVolume.h>
35#include <filesystem>
38#include <FairRunSim.h>
39#include <FairField.h> // full type: FairField derives from TVirtualMagField
40#include <TVirtualMC.h>
42#include <TGeoParallelWorld.h>
43#include <TGeoVolume.h>
44#include <TBuffer3D.h>
45#include <TGeoTessellated.h>
47#include <unordered_set>
48#include "SimConfig/G4Params.h"
49#include "DetectorsBase/VMCSeederService.h" // per-track seeding of the engine
50#include <TLorentzVector.h>
51#include <TRandom.h>
52#include <cstring>
53
54namespace o2
55{
56namespace steer
57{
58// helper function to send trivial data
59template <typename T>
60void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts)
61{
62 static auto mgr = FairRootManager::Instance();
63 auto vector = mgr->InitObjectAs<const std::vector<T>*>(name);
64 if (vector) {
65 auto buffer = (char*)&(*vector)[0];
66 auto buffersize = vector->size() * sizeof(T);
67 fair::mq::MessagePtr message(channel.NewMessage(
68 buffer, buffersize,
69 [](void* data, void* hint) {}, buffer));
70 parts.AddPart(std::move(message));
71 }
72}
73
75{
77
78 // check the max time of flight condition
79 const auto tof = fMC->TrackTime();
81 if (tof > params.TOFMAX) {
82 fMC->StopTrack();
83 return;
84 }
85
86 mLongestTrackTime = std::max((double)mLongestTrackTime, tof);
87
89 // we can kill tracks here based on our
90 // custom detector specificities
91
92 // Note that this is done in addition to the generic
93 // R + Z-cut mechanism at VMC level.
94
95 float x, y, z;
96 fMC->TrackPosition(x, y, z);
97
98 // this function is implementing a basic z-dependent R cut
99 // can be generalized later on
100 auto outOfR = [x, y, this](float z) {
101 // for the moment for cases when we have ZDC enabled
102 if (std::abs(z) > mCutParams.tunnelZ) {
104 return true;
105 }
106 }
107 return false;
108 };
109
110 if (z > mCutParams.ZmaxA ||
111 -z > mCutParams.ZmaxC ||
112 outOfR(z)) {
113 fMC->StopTrack();
114 return;
115 }
116 }
117
118 // an additional, user-provided criterion; only consulted when one is
119 // configured, so that SimCutParams.stepFilteringMacro being unset leaves the
120 // code above as the whole of the geometry cut
121 if (mHasStepFilterMacro && !mKeepStepFcn(fMC)) {
122 fMC->StopTrack();
123 return;
124 }
125
127 mTrackRefFcn(fMC);
128 }
129
130 // dispatch now to stepping function in FairRoot
131 FairMCApplication::Stepping();
132}
133
134namespace
135{
136// Hash of a track's initial state (vertex, global time, momentum, PDG). Used as
137// the random seed for that track, so that a track's random stream depends only
138// on the track itself and not on how many randoms earlier tracks happened to
139// consume.
140//
141// The values are read from the transport engine, not from
142// o2::data::Stack::GetCurrentTrack(): under Geant4 the stack's "current track"
143// is only meaningful for primaries -- Stack::SetCurrentTrack() falls back to
144// mCurrentParticle0 (the last particle *pushed*) for anything beyond the
145// primary array, so every secondary would hash the wrong particle. Both engines
146// have the track's initial state loaded by the time PreTrack is called (Geant4
147// sets the step to kVertex first; Geant3 calls GLTRAC before GUTRAK).
148ULong_t hashCurrentTrack(TVirtualMC* vmc)
149{
150 auto asLong = [](double x) {
151 ULong_t l;
152 std::memcpy(&l, &x, sizeof(l));
153 return l;
154 };
155
156 TLorentzVector pos, mom;
157 vmc->TrackPosition(pos);
158 vmc->TrackMomentum(mom);
159
160 ULong_t hash = asLong(pos.X());
161 hash ^= asLong(pos.Y());
162 hash ^= asLong(pos.Z());
163 hash ^= asLong(pos.T());
164 hash ^= asLong(mom.Px());
165 hash ^= asLong(mom.Py());
166 hash ^= asLong(mom.Pz());
167 hash += (ULong_t)vmc->TrackPid();
168 return hash;
169}
170} // namespace
171
173{
174 // Geant3 seeds at stack-pop time, in o2::data::Stack::PopNextTrack(). That is
175 // strictly earlier than its PreTrack hook (gutrak).
176 // Do not seed Geant3 here as well -- it is already covered, and reseeding a
177 // second time mid-track would undo the first.
178 static const bool inPreTrack = [this]() {
179 const char* name = (fMC != nullptr) ? fMC->GetName() : "";
180 return strncmp(name, "TGeant3", 7) != 0;
181 }();
182 return inPreTrack;
183}
184
186{
188 // Per-track seeding for engines that do not go through
189 // o2::data::Stack::PopNextTrack(). Geant4 is one: it takes primaries via
190 // PopPrimaryForTracking and keeps secondaries internally, so the stack hook
191 // never fires and this is the only per-track hook available. It is called
192 // for primaries and secondaries alike
193 // (TG4TrackingAction::PreUserTrackingAction), and only on a track's first
194 // step, so a suspended track is not reseeded mid-flight.
195 auto hash = hashCurrentTrack(fMC);
196 // TRandom::SetSeed(0) means "seed from the clock" -- never let that happen.
197 gRandom->SetSeed(hash == 0 ? 1 : hash);
199 }
200
201 // dispatch now to function in FairRoot
202 FairMCApplication::PreTrack();
203}
204
206{
207 // The transport engine constructs the geometry from inside its own
208 // constructor, long before FairMCApplication::InitMC() attaches the magnetic
209 // field to it. The media built below read the field through
210 // Detector::initFieldTrackingParams(), so without this they all silently fall
211 // back to hardcoded defaults. The run has known the field since
212 // build_geometry.C, which runs before Init() -- hand it over now.
213 if (auto* vmc = TVirtualMC::GetMC(); vmc != nullptr && vmc->GetMagField() == nullptr) {
214 auto* run = FairRunSim::Instance();
215 if (run != nullptr && run->GetField() != nullptr) {
216 vmc->SetMagField(run->GetField());
217 LOG(info) << "Magnetic field attached to the engine before media creation";
218 } else {
219 LOG(warn) << "No magnetic field available at geometry construction; media "
220 "will be initialised with default tracking parameters";
221 }
222 }
223
224 // fill the mapping
225 mModIdToName.clear();
227 for (int i = 0; i < fModules->GetEntries(); ++i) {
228 auto mod = static_cast<FairModule*>(fModules->At(i));
229 if (mod) {
230 mModIdToName[mod->GetModId()] = mod->GetName();
231 int did = o2::detectors::DetID::nameToID(mod->GetName());
232 if (did >= 0) {
233 dmask |= o2::detectors::DetID::getMask(did);
234 }
235 }
236 }
237 gGeoManager->SetUniqueID(dmask.to_ulong());
238 FairMCApplication::ConstructGeometry();
239
240 std::ofstream voltomodulefile("MCStepLoggerVolMap.dat");
241 // construct the volume name to module name mapping useful for StepAnalysis
242 auto vollist = gGeoManager->GetListOfVolumes();
243 for (int i = 0; i < vollist->GetEntries(); ++i) {
244 auto vol = static_cast<TGeoVolume*>(vollist->At(i));
245 auto iter = fModVolMap.find(vol->GetNumber());
246 voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n";
247 }
248}
249
251{
252 if (mCutParams.stepFilteringMacro.empty()) {
253 return;
254 }
256 if (!std::filesystem::exists(macro)) {
257 LOG(error) << "Macro for step filtering does not exist at " << macro << "; ignoring it";
258 return;
259 }
260 LOG(info) << "Initializing step filtering from macro " << macro;
261 mKeepStepFcn = o2::conf::GetFromMacro<KeepStepFcn>(macro, "keepStep()",
262 "o2::steer::O2MCApplicationBase::KeepStepFcn",
263 "o2mc_stepping_keep_step");
264 if (!mKeepStepFcn) {
265 LOG(error) << "Could not set up keepStep() from " << macro << "; ignoring it";
266 return;
267 }
268 mHasStepFilterMacro = true;
269 LOG(info) << "Step filtering initialized from macro " << macro;
270}
271
273{
274 // load special cuts which might be given from the outside first.
276 matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE);
277 matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut);
278 // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module
279 FairMCApplication::InitGeometry();
280 matMgr.writeCutsAndProcessesToJSON();
281 // now the sensitive volumes are set up in fVolMap and we can query them
282 for (auto e : fVolMap) {
283 // since fVolMap contains multiple entries (if multiple copies), this may
284 // write to the same entry multiple times
285 mSensitiveVolumes[e.first] = e.second->GetName();
286 }
287 std::ofstream sensvolfile("MCStepLoggerSenVol.dat");
288 for (auto e : mSensitiveVolumes) {
289 sensvolfile << e.first << ":" << e.second << "\n";
290 }
291}
292
294{
295 for (auto det : listDetectors) {
296 if (dynamic_cast<o2::base::Detector*>(det)) {
297 ((o2::base::Detector*)det)->addAlignableVolumes();
298 }
299 }
300
301 // we stream out both unaligned geometry (to allow for
302 // dynamic post-alignment) as well as the aligned version
303 // which can be used by digitization etc. immediately
304 auto& confref = o2::conf::SimConfig::Instance();
305 auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix());
306 // since in general the geometry is a CCDB object, it must be exported under the standard name
307 gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str());
308 gGeoManager->Export(geomfile.c_str());
309
310 // apply alignment for included detectors AFTER exporting ideal geometry
311 auto& aligner = o2::base::Aligner::Instance();
312 aligner.applyAlignment(confref.getTimestamp());
313
314 // export aligned geometry into different file
315 auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix());
316 gGeoManager->Export(alignedgeomfile.c_str());
317
319
320 // fill parallel world geometry if activated
321 if (param.useParallelWorld) {
322 TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors");
323 if (param.usePwGeoBVH) {
324 pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH);
325 }
326 if (param.usePwCaching) {
327 TGeoNavigator::SetPWSafetyCaching(true);
328 }
329 for (auto det : listDetectors) {
330 if (dynamic_cast<o2::base::Detector*>(det)) {
331 ((o2::base::Detector*)det)->fillParallelWorld();
332 }
333 }
334 gGeoManager->SetUseParallelWorldNav(true);
335 }
336
337 // performs possible optimizations (shape replacements on the runtime geometry)
339
340 // return original return value of misalignment procedure
341 return true;
342}
343
345{
346 auto& g4Params = o2::conf::G4Params::Instance();
347 if (g4Params.navmode != o2::conf::EG4Nav::kTGeo) {
348 return;
349 }
350
351 // Replace TGeo shapes by other ones for performance or other reasons.
352 // Should only affect runtime of simulation.
353
354 // TODO: make this configurable via external JSON rules/macro
355
356 // Also delete original shapes for memory reasons
357
358 // We follow a visitor pattern on a geom hierarchy
359 // for now replace a TGeoTessellate by our own implementation
360 std::unordered_set<TGeoVolume*> volumes_visited;
361 std::unordered_set<TGeoShape*> old_shape_pointers;
362
363 std::function<void(TGeoNode*)> visit;
364 visit = [&](TGeoNode* node) -> void {
365 if (!node) {
366 return;
367 }
368 auto vol = node->GetVolume();
369 if (volumes_visited.find(vol) != volumes_visited.end()) {
370 return;
371 }
372 volumes_visited.insert(vol);
373
374 // transform the shape of this volume
375 auto shape = vol->GetShape();
376 if (shape->IsA() == TGeoTessellated::Class()) {
377 auto tsl = static_cast<TGeoTessellated*>(shape);
378
379 // make a new O2Tessellated until ROOT has proper support for navigation in TGeoTessellated
380 std::cout << "Converting to O2Tessellated for vol " << vol->GetName() << "\n";
381 auto replacement_shape = new o2::base::O2Tessellated(*tsl, false);
382 vol->SetShape(replacement_shape);
383 old_shape_pointers.insert(shape);
384 }
385 // other cases could come here
386
387 for (int i = 0; i < vol->GetNdaughters(); ++i) {
388 auto child_node = vol->GetNode(i);
389 visit(child_node);
390 }
391 };
392
393 visit(gGeoManager->GetTopNode());
394
395 for (auto ptr : old_shape_pointers) {
396 delete ptr;
397 ptr = nullptr;
398 }
399}
400
402{
403 LOG(info) << "This event/chunk did " << mStepCounter << " steps";
404 LOG(info) << "Longest track time is " << mLongestTrackTime;
405
406 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
408 header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex());
409
410 static_cast<o2::data::Stack*>(GetStack())->updateEventStats();
411
412 // Per-track seeding used to be wired to a stack callback that one of the two
413 // engines never invoked, and it failed silently. Never again: if it was asked
414 // for and nothing was seeded, say so.
417 mTrackSeedWarned = true;
418 LOG(warn) << "Per-track seeding (SimCutParams.trackSeed) was requested but not a single track "
419 "was seeded -- neither the stack nor the PreTrack hook fired for this engine. "
420 "Seeding is NOT active.";
421 }
422}
423
425{
427
428 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
429 auto& confref = o2::conf::SimConfig::Instance();
430
431 if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) {
432 LOG(info) << "Discarding current event due to no hits";
433 SetSaveCurrentEvent(false);
434 }
435
436 // dispatch to function in FairRoot
437 FairMCApplication::FinishEvent();
438}
439
441{
442 // dispatch first to function in FairRoot
443 FairMCApplication::BeginEvent();
444
445 // register event header with our stack
446 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
447 static_cast<o2::data::Stack*>(GetStack())->setMCEventStats(&header->getMCEventStats());
448
449 mStepCounter = 0;
451}
452
454{
455 //
456 // Add particles needed for ALICE (not present in Geant3 or Geant4)
457 // Code ported 1-1 from AliRoot
458 //
459
460 LOG(info) << "Adding custom particles to VMC";
461
462 //Hypertriton
463 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);
464 //Anti-Hypertriton
465 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);
466
467 //Hyper hydrogen 4 ground state
468 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);
469 //Anti-Hyper hydrogen 4 ground state
470 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);
471
472 //Hyper helium 4 ground state
473 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);
474 //Anti-Hyper helium 4 ground state
475 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);
476
477 // Lithium 4 ground state
478 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);
479 // Anti-Lithium 4 ground state
480 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);
481
482 //Hyper helium 5
483 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);
484 //Anti-Hyper helium 5
485 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);
486
487 //Double Hyper hydrogen 4
488 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);
489 //Double Anti-Hyper hydrogen 4
490 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);
491
492 // 4Xi(-)H
493 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);
494 // Anti-4Xi(-)H
495 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);
496 // 4Xi(-)He
497 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);
498 // Anti-4Xi(-)He
499 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);
500
501 // Hyper helium 4 sigma
502 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);
503 // Anti-Hyper helium 4 sigma
504 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);
505
506 //Lambda-Neutron
507 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);
508
509 //Anti-Lambda-Neutron
510 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);
511
512 //H-Dibaryon
513 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);
514
515 //Anti-H-Dibaryon
516 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);
517
518 //Xi-Proton
519 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);
520
521 //Anti-Xi-Proton
522 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);
523
524 //Lambda-Neutron-Neutron
525 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);
526
527 //Anti-Lambda-Neutron-Neutron
528 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);
529
530 //Omega-Proton
531 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);
532
533 //Anti-Omega-Proton
534 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);
535
536 //Omega-Neutron
537 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);
538
539 //Anti-Omega-Neutron
540 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);
541
542 //Omega-Omega
543 TVirtualMC::GetMC()->DefineParticle(1060020020, "OmegaOmega", kPTHadron, 3.343, -2.0, 8.21e-11, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
544
545 //Anti-Omega-Omega
546 TVirtualMC::GetMC()->DefineParticle(-1060020020, "AntiOmegaOmega", kPTHadron, 3.343, 2.0, 8.21e-11, "Hadron", 0.0, 0, 1, 0, 0, 0, 0, 0, 2, kFALSE);
547
548 //Lambda(1405)-Proton
549 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);
550
551 //Anti-Lambda(1405)-Proton
552 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);
553
554 //Lambda(1405)-Lambda(1405)
555 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);
556
557 //Anti-Lambda(1405)-Lambda(1405)
558 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);
559
560 //c-deuteron
561 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);
562 //Anti-c-deuteron
563 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);
564
565 //c-triton
566 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);
567 //Anti-c-Hypertriton
568 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);
569
570 //Resonances not in Generators
571 // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV)
572 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);
573
574 // f2(1270) (PDG: width = 186 MeV)
575 TVirtualMC::GetMC()->DefineParticle(225, "f2_1270", kPTNeutron, 1.275, 0.0, 3.538e-24, "Hadron", 0.186, 2, 1, 1, 0, 0, 1, 0, 0, kTRUE);
576
577 // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct
578 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);
579 // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct
580 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);
581
582 // lambda1405 (PDG: width = 50 MeV)
583 TVirtualMC::GetMC()->DefineParticle(102132, "Lambda1405", kPTNeutron, 1.405, 0.0, 1.316e-23, "Hadron", 0.050, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE);
584 TVirtualMC::GetMC()->DefineParticle(-102132, "AntiLambda1405", kPTNeutron, 1.405, 0.0, 1.316e-23, "Hadron", 0.050, 0, 1, 0, 0, 0, 0, 0, 2, kTRUE);
585
586 // Glueball hunting family
587 // Their life times are not known, so we set them to 1e-24
588 // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct
589 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);
590 // a2(1320) (PDG: width = 107.8 MeV)
591 TVirtualMC::GetMC()->DefineParticle(115, "a2_1320", kPTNeutron, 1.3182, 0.0, 6.1e-24, "Hadron", 0.1078, 2, 1, 1, 1, 0, -1, 0, 0, kTRUE);
592 // f0(1500) (PDG: width = 112 MeV)
593 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);
594 // f0(1710) (PDG: width = 150 MeV)
595 TVirtualMC::GetMC()->DefineParticle(10331, "f0_1710", kPTNeutron, 1.71, 0.0, 4.4e-24, "Hadron", 0.150, 0, 1, 1, 0, 0, 1, 0, 0, kTRUE);
596 // f2(1525) (PDG: width = 84 MeV)
597 TVirtualMC::GetMC()->DefineParticle(335, "f2_1525", kPTNeutron, 1.525, 0.0, 7.798e-24, "Hadron", 0.084, 2, 1, 1, 0, 0, 1, 0, 0, kTRUE);
598
599 // Xi_0(1820)
600 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);
601 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);
602
603 int xi_0_1820_mode[6][3] = {{0}};
604 float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f};
605 xi_0_1820_mode[0][0] = 3122; // Lambda
606 xi_0_1820_mode[0][1] = 310; // K0s
607 TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode);
608 xi_0_1820_mode[0][0] = -3122; // Lambda-bar
609 TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode);
610
611 // Xi-+(1820)
612 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);
613 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);
614
615 int xi_charged_1820_mode[6][3] = {{0}};
616 float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f};
617 xi_charged_1820_mode[0][0] = 3122; // Lambda
618 xi_charged_1820_mode[0][1] = -321; // K-
619 TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode);
620 xi_charged_1820_mode[0][0] = -3122; // Lambda-bar
621 xi_charged_1820_mode[0][1] = 321; // K+
622 TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode);
623
624 // Ps - hidden strange (s-sbar) pentaquarks
625 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);
626 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);
627 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);
628 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);
629
630 Int_t psmode[6][3] = {0};
631 Float_t psratio[6] = {0.f};
632 psratio[0] = 100.;
633
634 psmode[0][0] = 333; // phi
635 psmode[0][1] = 2212; // proton
636 TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode);
637 TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode);
638
639 psmode[0][1] = -2212; // anti-proton
640 TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode);
641 TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode);
642
643 //Omega(2012)
644 for (int j = 1; j < 6; j++) {
645 psmode[j][0] = psmode[j][1] = 0;
646 psratio[j] = 0.;
647 }
648
649 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);
650 psmode[0][0] = 3312; // Xi-
651 psmode[0][1] = 310; // K0S
652 psratio[0] = 100.;
653 TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode);
654
655 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);
656 psmode[0][0] = -3312; // anti-Xi+
657 psmode[0][1] = 310; // K0S
658 psratio[0] = 100.;
659 TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode);
660
661 // d*(2380) - dibaryon resonance
662 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);
663 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);
664
665 Int_t dstmode[6][3] = {0};
666 Float_t dstratio[6] = {0.f};
667 dstratio[0] = 100; // For now we implement only the mode of interest
668 // d* -> d pi+ pi-
669 dstmode[0][0] = 1000010020; // deuteron
670 dstmode[0][1] = -211; // negative pion
671 dstmode[0][2] = 211; // positive pion
672 TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode);
673
674 dstmode[0][0] = -1000010020; // anti-deuteron
675 TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode);
676
677 // Heavy vector mesons
678 // D*+
679 TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
680 // D*-
681 TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
682 // D*0
683 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);
684 // D*0bar
685 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);
686 // D*_s+
687 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);
688 // D*_s-
689 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);
690 // B*0
691 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);
692 // B*0bar
693 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);
694 // B*+
695 TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
696 // B*-
697 TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
698 // B*_s0
699 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);
700 // B*_s0bar
701 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);
702 // B*_c+
703 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);
704 // B*_c-
705 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);
706
707 // Charm pentaquarks
708 // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121)
709 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);
710 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);
711
712 for (int j = 1; j < 6; j++) {
713 psmode[j][0] = psmode[j][1] = 0;
714 psratio[j] = 0.;
715 }
716 psmode[0][0] = 413; // D*+
717 psmode[0][1] = -2212; // anti-p
718 psratio[0] = 100.;
719 TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode);
720 psmode[0][0] = -413; // D*-
721 psmode[0][1] = 2212; // p
722 TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode);
723
724 // Define the 2- and 3-body phase space decay for the Hyper-Triton
725 Int_t mode[6][3];
726 Float_t bratio[6];
727
728 for (Int_t kz = 0; kz < 6; kz++) {
729 bratio[kz] = 0.;
730 mode[kz][0] = 0;
731 mode[kz][1] = 0;
732 mode[kz][2] = 0;
733 }
734 bratio[0] = 50.;
735 mode[0][0] = 1000020030; // Helium3
736 mode[0][1] = -211; // negative pion
737
738 bratio[1] = 50.;
739 mode[1][0] = 1000010020; // deuteron
740 mode[1][1] = 2212; // proton
741 mode[1][2] = -211; // negative pion
742
743 TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode);
744
745 // Define the 2- and 3-body phase space decay for the Anti-Hyper-Triton
746 Int_t amode[6][3];
747 Float_t abratio[6];
748
749 for (Int_t kz = 0; kz < 6; kz++) {
750 abratio[kz] = 0.;
751 amode[kz][0] = 0;
752 amode[kz][1] = 0;
753 amode[kz][2] = 0;
754 }
755 abratio[0] = 50.;
756 amode[0][0] = -1000020030; // anti- Helium3
757 amode[0][1] = 211; // positive pion
758 abratio[1] = 50.;
759 amode[1][0] = -1000010020; // anti-deuteron
760 amode[1][1] = -2212; // anti-proton
761 amode[1][2] = 211; // positive pion
762
763 TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode);
764
766
767 // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
768
769 Int_t mode3[6][3];
770 Float_t bratio3[6];
771
772 for (Int_t kz = 0; kz < 6; kz++) {
773 bratio3[kz] = 0.;
774 mode3[kz][0] = 0;
775 mode3[kz][1] = 0;
776 mode3[kz][2] = 0;
777 }
778 bratio3[0] = 50.;
779 mode3[0][0] = 1000020040; // Helium4
780 mode3[0][1] = -211; // negative pion
781
782 bratio3[1] = 50.;
783 mode3[1][0] = 1000010030; // tritium
784 mode3[1][1] = 2212; // proton
785 mode3[1][2] = -211; // negative pion
786
787 TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3);
788
789 // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
790 Int_t amode3[6][3];
791 Float_t abratio3[6];
792
793 for (Int_t kz = 0; kz < 6; kz++) {
794 abratio3[kz] = 0.;
795 amode3[kz][0] = 0;
796 amode3[kz][1] = 0;
797 amode3[kz][2] = 0;
798 }
799 abratio3[0] = 50.;
800 amode3[0][0] = -1000020040; // anti- Helium4
801 amode3[0][1] = 211; // positive pion
802 abratio3[1] = 50.;
803 amode3[1][0] = -1000010030; // anti-tritium
804 amode3[1][1] = -2212; // anti-proton
805 amode3[1][2] = 211; // positive pion
806
807 TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3);
808
809 // Define the 3-body phase space decay for the Hyper Helium 4
810 Int_t mode4[6][3];
811 Float_t bratio4[6];
812
813 for (Int_t kz = 0; kz < 6; kz++) {
814 bratio4[kz] = 0.;
815 mode4[kz][0] = 0;
816 mode4[kz][1] = 0;
817 mode4[kz][2] = 0;
818 }
819 bratio4[0] = 50.;
820 mode4[0][0] = 1000020030; // Helium3
821 mode4[0][1] = -211; // negative pion
822 mode4[0][2] = 2212; // proton
823
824 bratio4[1] = 50.;
825 mode4[1][0] = 1000030040; // lithium-4
826 mode4[1][1] = -211; // negative pion
827
828 TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4);
829
830 // Define the 2-body phase space decay for the Anti-Hyper Helium 4
831 Int_t amode4[6][3];
832 Float_t abratio4[6];
833
834 for (Int_t kz = 0; kz < 6; kz++) {
835 abratio4[kz] = 0.;
836 amode4[kz][0] = 0;
837 amode4[kz][1] = 0;
838 amode4[kz][2] = 0;
839 }
840 abratio4[0] = 50.;
841 amode4[0][0] = -1000020030; // anti-Helium 3
842 amode4[0][1] = 211; // positive pion
843 amode4[0][2] = -2212; // anti proton
844
845 abratio4[1] = 50.;
846 amode4[1][0] = -1000030040; // antilithium-4
847 amode4[1][1] = 211; // positive pion
848
849 TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4);
850
851 // Define the 2-body phase space decay for the Lithium 4
852 Int_t model4[6][3];
853 Float_t bratiol4[6];
854
855 for (Int_t kz = 0; kz < 6; kz++) {
856 bratiol4[kz] = 0.;
857 model4[kz][0] = 0;
858 model4[kz][1] = 0;
859 model4[kz][2] = 0;
860 }
861 bratiol4[0] = 100.;
862 model4[0][0] = 1000020030; // Helium3
863 model4[0][1] = 2212; // proton
864
865 TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4);
866
867 // Define the 2-body phase space decay for the Anti-Lithium 4
868 Int_t amodel4[6][3];
869 Float_t abratiol4[6];
870
871 for (Int_t kz = 0; kz < 6; kz++) {
872 abratiol4[kz] = 0.;
873 amodel4[kz][0] = 0;
874 amodel4[kz][1] = 0;
875 amodel4[kz][2] = 0;
876 }
877 abratiol4[0] = 100.;
878 amodel4[0][0] = -1000020030; // Anti-Helium3
879 amodel4[0][1] = -2212; // Anti-proton
880
881 TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4);
882
883 // Define the 3-body phase space decay for the Hyper Helium 5
884 Int_t mode41[6][3];
885 Float_t bratio41[6];
886
887 for (Int_t kz = 0; kz < 6; kz++) {
888 bratio41[kz] = 0.;
889 mode41[kz][0] = 0;
890 mode41[kz][1] = 0;
891 mode41[kz][2] = 0;
892 }
893 bratio41[0] = 50.;
894 mode41[0][0] = 1000020040; // Helium4
895 mode41[0][1] = -211; // negative pion
896 mode41[0][2] = 2212; // proton
897 bratio41[1] = 50.;
898 mode41[1][0] = 1000020030; // Helium3
899 mode41[1][1] = -211; // negative pion
900 mode41[1][2] = 1000010020; // Deuteron
901
902 TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41);
903
904 // Define the 2-body phase space decay for the Anti-Hyper Helium 5
905 Int_t amode41[6][3];
906 Float_t abratio41[6];
907
908 for (Int_t kz = 0; kz < 6; kz++) {
909 abratio41[kz] = 0.;
910 amode41[kz][0] = 0;
911 amode41[kz][1] = 0;
912 amode41[kz][2] = 0;
913 }
914 abratio41[0] = 50.;
915 amode41[0][0] = -1000020040; // anti-Helium 4
916 amode41[0][1] = 211; // positive pion
917 amode41[0][2] = -2212; // anti proton
918 abratio41[1] = 50.;
919 amode41[1][0] = -1000020030; // anti-Helium 3
920 amode41[1][1] = 211; // positive pion
921 amode41[1][2] = -1000010020; // anti deuteron
922
923 TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41);
924
925 // Define the 3-body phase space decay for the Double Hyper Hydrogen 4
926 Int_t mode42[6][3];
927 Float_t bratio42[6];
928
929 for (Int_t kz = 0; kz < 6; kz++) {
930 bratio42[kz] = 0.;
931 mode42[kz][0] = 0;
932 mode42[kz][1] = 0;
933 mode42[kz][2] = 0;
934 }
935 bratio42[0] = 50.;
936 mode42[0][0] = 1010020040; // Hyper-Helium4
937 mode42[0][1] = -211; // negative pion
938
939 bratio42[1] = 50.;
940 mode42[1][0] = 1010010030; // Hypertriton
941 mode42[1][1] = 2212; // proton
942 mode42[1][2] = -211; // negative pion
943
944 TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42);
945
946 // Define the 2-body phase space decay for the Anti Double Hyper Hydrogen 4
947 Int_t amode42[6][3];
948 Float_t abratio42[6];
949
950 for (Int_t kz = 0; kz < 6; kz++) {
951 abratio42[kz] = 0.;
952 amode42[kz][0] = 0;
953 amode42[kz][1] = 0;
954 amode42[kz][2] = 0;
955 }
956 abratio42[0] = 50.;
957 amode42[0][0] = -1010020040; // anti-Hyper-Helium 4
958 amode42[0][1] = 211; // positive pion
959
960 abratio42[1] = 50.;
961 amode42[1][0] = -1010010030; // anti-Hypertriton
962 amode42[1][1] = -2212; // antiproton
963 amode42[1][2] = 211; // positive pion
964
965 TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42);
966
967 // Define the decay for the 4Xi(-)He
968 Int_t mode4XiHe[6][3];
969 Float_t bratio4XiHe[6];
970
971 for (Int_t kz = 0; kz < 6; kz++) {
972 bratio4XiHe[kz] = 0.;
973 mode4XiHe[kz][0] = 0;
974 mode4XiHe[kz][1] = 0;
975 mode4XiHe[kz][2] = 0;
976 }
977 bratio4XiHe[0] = 33.;
978 mode4XiHe[0][0] = 1010020040; // HyperHelium4
979 mode4XiHe[0][1] = -211; // negative pion
980
981 bratio4XiHe[1] = 33.;
982 mode4XiHe[1][0] = 3122; // lambda
983 mode4XiHe[1][1] = 1000020030; // helium-3
984 mode4XiHe[1][2] = -211; // negative pion
985
986 bratio4XiHe[2] = 33.;
987 mode4XiHe[2][0] = 1000030040; // lithium-4
988 mode4XiHe[2][1] = -211; // negative pion
989 mode4XiHe[2][2] = -211; // negative pion
990
991 TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe);
992
993 // Define the decay for the Anti-4Xi(-)He
994 Int_t amode4XiHe[6][3];
995 Float_t abratio4XiHe[6];
996
997 for (Int_t kz = 0; kz < 6; kz++) {
998 abratio4XiHe[kz] = 0.;
999 amode4XiHe[kz][0] = 0;
1000 amode4XiHe[kz][1] = 0;
1001 amode4XiHe[kz][2] = 0;
1002 }
1003 abratio4XiHe[0] = 33.;
1004 amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4
1005 amode4XiHe[0][1] = 211; // positive pion
1006
1007 abratio4XiHe[1] = 33.;
1008 amode4XiHe[1][0] = -3122; // antilambda
1009 amode4XiHe[1][1] = -1000020030; // antihelium-3
1010 amode4XiHe[1][2] = 211; // positive pion
1011
1012 abratio4XiHe[2] = 33.;
1013 amode4XiHe[2][0] = -1000030040; // antilithium-4
1014 amode4XiHe[2][1] = 211; // positive pion
1015 amode4XiHe[2][2] = 211; // positive pion
1016
1017 TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe);
1018
1019 // Define the decay for the 4Xi(-)H
1020 Int_t mode4XiH[6][3];
1021 Float_t bratio4XiH[6];
1022
1023 for (Int_t kz = 0; kz < 6; kz++) {
1024 bratio4XiH[kz] = 0.;
1025 mode4XiH[kz][0] = 0;
1026 mode4XiH[kz][1] = 0;
1027 mode4XiH[kz][2] = 0;
1028 }
1029 bratio4XiH[0] = 33.;
1030 mode4XiH[0][0] = 1010010040; // HyperHydrogen4
1031 mode4XiH[0][1] = -211; // negative pion
1032
1033 bratio4XiH[1] = 33.;
1034 mode4XiH[1][0] = 3122; // lambda
1035 mode4XiH[1][1] = 1000010030; // triton
1036 mode4XiH[1][2] = -211; // negative pion
1037
1038 bratio4XiH[2] = 33.;
1039 mode4XiH[2][0] = 1000020040; // alpha
1040 mode4XiH[2][1] = -211; // negative pion
1041 mode4XiH[2][2] = -211; // negative pion
1042
1043 TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH);
1044
1045 // Define the decay for the Anti-4Xi(-)H
1046 Int_t amode4XiH[6][3];
1047 Float_t abratio4XiH[6];
1048
1049 for (Int_t kz = 0; kz < 6; kz++) {
1050 abratio4XiH[kz] = 0.;
1051 amode4XiH[kz][0] = 0;
1052 amode4XiH[kz][1] = 0;
1053 amode4XiH[kz][2] = 0;
1054 }
1055 abratio4XiH[0] = 33.;
1056 amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4
1057 amode4XiH[0][1] = 211; // positive pion
1058
1059 abratio4XiH[1] = 33.;
1060 amode4XiH[1][0] = -3122; // antilambda
1061 amode4XiH[1][1] = -1000010030; // antitriton
1062 amode4XiH[1][2] = 211; // positive pion
1063
1064 abratio4XiH[2] = 33.;
1065 amode4XiH[2][0] = -1000020040; // antialpha
1066 amode4XiH[2][1] = 211; // positive pion
1067 amode4XiH[2][2] = 211; // positive pion
1068
1069 TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH);
1070
1071 // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma
1072 Int_t mode4s[6][3];
1073 Float_t bratio4s[6];
1074
1075 for (Int_t kz = 0; kz < 6; kz++) {
1076 bratio4s[kz] = 0.;
1077 mode4s[kz][0] = 0;
1078 mode4s[kz][1] = 0;
1079 mode4s[kz][2] = 0;
1080 }
1081 bratio4s[0] = 20.;
1082 mode4s[0][0] = 1000020040; // Helium4
1083 mode4s[0][1] = 111; // pion0
1084 bratio4s[1] = 40.;
1085 mode4s[1][0] = 1000010030; // tritium
1086 mode4s[1][2] = 2212; // proton
1087 mode4s[1][1] = 111; // pion0
1088 bratio4s[2] = 40.;
1089 mode4s[2][0] = 1000010030; // tritium
1090 mode4s[2][2] = 211; // pion+
1091 mode4s[2][1] = 2112; // neutron
1092
1093 TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s);
1094
1095 // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma
1096 Int_t amode4s[6][3];
1097 Float_t abratio4s[6];
1098
1099 for (Int_t kz = 0; kz < 6; kz++) {
1100 abratio4s[kz] = 0.;
1101 amode4s[kz][0] = 0;
1102 amode4s[kz][1] = 0;
1103 amode4s[kz][2] = 0;
1104 }
1105 abratio4s[0] = 20.;
1106 amode4s[0][0] = -1000020040; // anti-Helium4
1107 amode4s[0][1] = 111; // pion0
1108 abratio4s[1] = 40.;
1109 amode4s[1][0] = -1000010030; // anti-tritium
1110 amode4s[1][2] = -2212; // anti-proton
1111 amode4s[1][1] = 111; // pion0
1112 abratio4s[2] = 40.;
1113 amode4s[2][0] = -1000010030; // anti-tritium
1114 amode4s[2][2] = -211; // pion-
1115 amode4s[2][1] = -2112; // anti-neutron
1116
1117 TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s);
1118
1119 // Define the 2-body phase space decay for the Lambda-neutron boundstate
1120 Int_t mode1[6][3];
1121 Float_t bratio1[6];
1122
1123 for (Int_t kz = 0; kz < 6; kz++) {
1124 bratio1[kz] = 0.;
1125 mode1[kz][0] = 0;
1126 mode1[kz][1] = 0;
1127 mode1[kz][2] = 0;
1128 }
1129 bratio1[0] = 100.;
1130 mode1[0][0] = 1000010020; // deuteron
1131 mode1[0][1] = -211; // negative pion
1132
1133 TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1);
1134
1135 // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate
1136 Int_t amode1[6][3];
1137 Float_t abratio1[6];
1138
1139 for (Int_t kz = 0; kz < 6; kz++) {
1140 abratio1[kz] = 0.;
1141 amode1[kz][0] = 0;
1142 amode1[kz][1] = 0;
1143 amode1[kz][2] = 0;
1144 }
1145 abratio1[0] = 100.;
1146 amode1[0][0] = -1000010020; // anti-deuteron
1147 amode1[0][1] = 211; // positive pion
1148
1149 TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1);
1150
1151 // Define the 2-body phase space decay for the H-Dibaryon
1152 Int_t mode2[6][3];
1153 Float_t bratio2[6];
1154
1155 for (Int_t kz = 0; kz < 6; kz++) {
1156 bratio2[kz] = 0.;
1157 mode2[kz][0] = 0;
1158 mode2[kz][1] = 0;
1159 mode2[kz][2] = 0;
1160 }
1161 bratio2[0] = 100.;
1162 mode2[0][0] = 3122; // Lambda
1163 mode2[0][1] = 2212; // proton
1164 mode2[0][2] = -211; // negative pion
1165
1166 TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2);
1167
1168 // Define the 2-body phase space decay for the Anti-H-Dibaryon
1169 Int_t amode2[6][3];
1170 Float_t abratio2[6];
1171
1172 for (Int_t kz = 0; kz < 6; kz++) {
1173 abratio2[kz] = 0.;
1174 amode2[kz][0] = 0;
1175 amode2[kz][1] = 0;
1176 amode2[kz][2] = 0;
1177 }
1178 abratio2[0] = 100.;
1179 amode2[0][0] = -3122; // anti-deuteron
1180 amode2[0][1] = -2212; // anti-proton
1181 amode2[0][2] = 211; // positive pion
1182
1183 TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2);
1184
1185 // Define the 2-body phase space decay for the Xi0P
1186 Int_t mode5[6][3];
1187 Float_t bratio5[6];
1188
1189 for (Int_t kz = 0; kz < 6; kz++) {
1190 bratio5[kz] = 0.;
1191 mode5[kz][0] = 0;
1192 mode5[kz][1] = 0;
1193 mode5[kz][2] = 0;
1194 }
1195 bratio5[0] = 100.;
1196 mode5[0][0] = 3122; // Lambda
1197 mode5[0][1] = 2212; // proton
1198
1199 TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5);
1200
1201 // Define the 2-body phase space decay for the Anti-Xi0P
1202 Int_t amode5[6][3];
1203 Float_t abratio5[6];
1204
1205 for (Int_t kz = 0; kz < 6; kz++) {
1206 abratio5[kz] = 0.;
1207 amode5[kz][0] = 0;
1208 amode5[kz][1] = 0;
1209 amode5[kz][2] = 0;
1210 }
1211 abratio5[0] = 100.;
1212 amode5[0][0] = -3122; // anti-Lambda
1213 amode5[0][1] = -2212; // anti-proton
1214
1215 TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5);
1216
1217 // Define the 2-body phase space decay for the Lambda-Neutron-Neutron
1218 Int_t mode6[6][3];
1219 Float_t bratio6[6];
1220
1221 for (Int_t kz = 0; kz < 6; kz++) {
1222 bratio6[kz] = 0.;
1223 mode6[kz][0] = 0;
1224 mode6[kz][1] = 0;
1225 mode6[kz][2] = 0;
1226 }
1227 bratio6[0] = 100.;
1228 mode6[0][0] = 1000010030; // triton
1229 mode6[0][1] = -211; // pion
1230
1231 TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6);
1232
1233 // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron
1234 Int_t amode6[6][3];
1235 Float_t abratio6[6];
1236
1237 for (Int_t kz = 0; kz < 6; kz++) {
1238 abratio6[kz] = 0.;
1239 amode6[kz][0] = 0;
1240 amode6[kz][1] = 0;
1241 amode6[kz][2] = 0;
1242 }
1243 abratio6[0] = 100.;
1244 amode6[0][0] = -1000010030; // anti-triton
1245 amode6[0][1] = 211; // pion
1246
1247 TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6);
1248
1249 // Define the 3-body phase space decay for the Omega-Proton
1250 Int_t mode7[6][3];
1251 Float_t bratio7[6];
1252
1253 for (Int_t kz = 0; kz < 6; kz++) {
1254 bratio7[kz] = 0.;
1255 mode7[kz][0] = 0;
1256 mode7[kz][1] = 0;
1257 mode7[kz][2] = 0;
1258 }
1259 bratio7[0] = 100.;
1260 mode7[0][0] = 3122; // Lambda
1261 mode7[0][1] = -321; // negative Kaon
1262 mode7[0][2] = 2212; // proton
1263
1264 TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7);
1265
1266 // Define the 3-body phase space decay for the Anti-Omega-Proton
1267 Int_t amode7[6][3];
1268 Float_t abratio7[6];
1269
1270 for (Int_t kz = 0; kz < 6; kz++) {
1271 abratio7[kz] = 0.;
1272 amode7[kz][0] = 0;
1273 amode7[kz][1] = 0;
1274 amode7[kz][2] = 0;
1275 }
1276 abratio7[0] = 100.;
1277 amode7[0][0] = -3122; // anti-Lambda
1278 amode7[0][1] = 321; // positive kaon
1279 amode7[0][2] = -2212; // anti-proton
1280
1281 TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7);
1282
1283 // Define the 2-body phase space decay for the Omega-Neutron
1284 Int_t mode8[6][3];
1285 Float_t bratio8[6];
1286
1287 for (Int_t kz = 0; kz < 6; kz++) {
1288 bratio8[kz] = 0.;
1289 mode8[kz][0] = 0;
1290 mode8[kz][1] = 0;
1291 mode8[kz][2] = 0;
1292 }
1293 bratio8[0] = 100.;
1294 mode8[0][0] = 3122; // Lambda
1295 mode8[0][1] = 3312; // negative Xi
1296
1297 TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8);
1298
1299 // Define the 2-body phase space decay for the Anti-Omega-Neutron
1300 Int_t amode8[6][3];
1301 Float_t abratio8[6];
1302
1303 for (Int_t kz = 0; kz < 6; kz++) {
1304 abratio8[kz] = 0.;
1305 amode8[kz][0] = 0;
1306 amode8[kz][1] = 0;
1307 amode8[kz][2] = 0;
1308 }
1309 abratio8[0] = 100.;
1310 amode8[0][0] = -3122; // anti-Lambda
1311 amode8[0][1] = -3312; // positive Xi
1312
1313 TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8);
1314
1315 // Define the 3-body phase space decay for the Omega-Omega
1316 // Assuming that one of the Omegas decays freely inside the nucleus
1317 Int_t mode9[6][3];
1318 Float_t bratio9[6];
1319
1320 for (Int_t kz = 0; kz < 6; kz++) {
1321 bratio9[kz] = 0.;
1322 mode9[kz][0] = 0;
1323 mode9[kz][1] = 0;
1324 mode9[kz][2] = 0;
1325 }
1326 bratio9[0] = 68.;
1327 mode9[0][0] = 3334; // negative Omega
1328 mode9[0][1] = 3122; // Lambda
1329 mode9[0][2] = -321; // negative Kaon
1330 bratio9[1] = 24;
1331 mode9[1][0] = 3334; // negative Omega
1332 mode9[1][1] = 3322; // neutral Xi
1333 mode9[1][2] = -211; // negative pion
1334 bratio9[2] = 8.;
1335 mode9[2][0] = 3334; // negative Omega
1336 mode9[2][1] = 3312; // negative Xi
1337 mode9[2][2] = 111; // neutral pion
1338
1339 TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9);
1340
1341 // Define the 3-body phase space decay for the Anti-Omega-Omega
1342 Int_t amode9[6][3];
1343 Float_t abratio9[6];
1344
1345 for (Int_t kz = 0; kz < 6; kz++) {
1346 abratio9[kz] = 0.;
1347 amode9[kz][0] = 0;
1348 amode9[kz][1] = 0;
1349 amode9[kz][2] = 0;
1350 }
1351 abratio9[0] = 68.;
1352 amode9[0][0] = -3334; // positive Omega
1353 amode9[0][1] = -3122; // anti-Lambda
1354 amode9[0][2] = 321; // positive Kaon
1355 abratio9[1] = 24.;
1356 amode9[1][0] = -3334; // positive Omega
1357 amode9[1][1] = -3322; // anti-neutral Xi
1358 amode9[1][2] = 211; // positive pion
1359 abratio9[2] = 8.;
1360 amode9[2][0] = -3334; // positive Omega
1361 amode9[2][1] = -3312; // positive Xi
1362 amode9[2][2] = 111; // neutral pion
1363
1364 TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9);
1365
1366 // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton
1367 Int_t mode10[6][3];
1368 Float_t bratio10[6];
1369
1370 for (Int_t kz = 0; kz < 6; kz++) {
1371 bratio10[kz] = 0.;
1372 mode10[kz][0] = 0;
1373 mode10[kz][1] = 0;
1374 mode10[kz][2] = 0;
1375 }
1376 bratio10[0] = 50.;
1377 mode10[0][0] = 3122; // Lambda
1378 mode10[0][1] = 2212; // proton
1379 bratio10[1] = 50.;
1380 mode10[1][0] = 2212; // proton
1381 mode10[1][1] = -321; // negative kaon
1382 mode10[1][2] = 2212; // proton
1383
1384 TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10);
1385
1386 // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton
1387 Int_t amode10[6][3];
1388 Float_t abratio10[6];
1389
1390 for (Int_t kz = 0; kz < 6; kz++) {
1391 abratio10[kz] = 0.;
1392 amode10[kz][0] = 0;
1393 amode10[kz][1] = 0;
1394 amode10[kz][2] = 0;
1395 }
1396 abratio10[0] = 50.;
1397 amode10[0][0] = -3122; // anti-Lambda
1398 amode10[0][1] = -2212; // anti-proton
1399 abratio10[1] = 50.;
1400 amode10[1][0] = -2212; // anti-proton
1401 amode10[1][1] = 321; // positive kaon
1402 amode10[1][2] = -2212; // anti-proton
1403
1404 TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10);
1405
1406 // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405)
1407 Int_t mode11[6][3];
1408 Float_t bratio11[6];
1409
1410 for (Int_t kz = 0; kz < 6; kz++) {
1411 bratio11[kz] = 0.;
1412 mode11[kz][0] = 0;
1413 mode11[kz][1] = 0;
1414 mode11[kz][2] = 0;
1415 }
1416 bratio11[0] = 50.;
1417 mode11[0][0] = 3122; // Lambda
1418 mode11[0][1] = 3122; // Lambda
1419 bratio11[1] = 50.;
1420 mode11[1][0] = 3122; // Lambda
1421 mode11[1][1] = 2212; // proton
1422 mode11[1][2] = -211; // negative pion
1423
1424 TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11);
1425
1426 // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405)
1427 Int_t amode11[6][3];
1428 Float_t abratio11[6];
1429
1430 for (Int_t kz = 0; kz < 6; kz++) {
1431 abratio11[kz] = 0.;
1432 amode11[kz][0] = 0;
1433 amode11[kz][1] = 0;
1434 amode11[kz][2] = 0;
1435 }
1436 abratio11[0] = 50.;
1437 amode11[0][0] = -3122; // anti-Lambda
1438 amode11[0][1] = -3122; // anti-Lambda
1439 abratio11[1] = 50.;
1440 amode11[1][0] = -3122; // anti-Lambda
1441 amode11[1][1] = -2212; // anti-proton
1442 amode11[1][2] = 211; // positive pion
1443
1444 TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11);
1445
1446 // Define the decays for the c-triton
1447 Int_t ctmode[6][3];
1448 Float_t ctbratio[6];
1449
1450 for (Int_t kz = 0; kz < 6; kz++) {
1451 ctbratio[kz] = 0.;
1452 ctmode[kz][0] = 0;
1453 ctmode[kz][1] = 0;
1454 ctmode[kz][2] = 0;
1455 }
1456 ctbratio[0] = 50.;
1457 ctmode[0][0] = 1000020030; // Helium3
1458 ctmode[0][1] = 310; // K0s
1459
1460 ctbratio[1] = 50.;
1461 ctmode[1][0] = 1000020030; // Helium3
1462 ctmode[1][1] = -321; // negative kaon
1463 ctmode[1][2] = 211; // positive pion
1464
1465 TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode);
1466
1467 // Define the decays for the anti-c-triton
1468 Int_t actmode[6][3];
1469 Float_t actbratio[6];
1470
1471 for (Int_t kz = 0; kz < 6; kz++) {
1472 actbratio[kz] = 0.;
1473 actmode[kz][0] = 0;
1474 actmode[kz][1] = 0;
1475 actmode[kz][2] = 0;
1476 }
1477 actbratio[0] = 50.;
1478 actmode[0][0] = -1000020030; // Helium3
1479 actmode[0][1] = 310; // K0s
1480
1481 actbratio[1] = 50.;
1482 actmode[1][0] = -1000020030; // Helium3
1483 actmode[1][1] = 321; // negative kaon
1484 actmode[1][2] = -211; // positive pion
1485
1486 TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode);
1487
1488 // Define the decays for the c-deuteron
1489 Int_t cdmode[6][3];
1490 Float_t cdbratio[6];
1491
1492 for (Int_t kz = 0; kz < 6; kz++) {
1493 cdbratio[kz] = 0.;
1494 cdmode[kz][0] = 0;
1495 cdmode[kz][1] = 0;
1496 cdmode[kz][2] = 0;
1497 }
1498 cdbratio[0] = 50.;
1499 cdmode[0][0] = 1000010020; // deuteron
1500 cdmode[0][1] = -321; // negative kaon
1501 cdmode[0][2] = 211; // positive pion
1502
1503 cdbratio[1] = 50.;
1504 cdmode[1][0] = 1000010020; // deuteron
1505 cdmode[1][1] = 310; // K0s
1506
1507 TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode);
1508
1509 // Define the decays for the anti-c-deuteron
1510 Int_t acdmode[6][3];
1511 Float_t acdbratio[6];
1512
1513 for (Int_t kz = 0; kz < 6; kz++) {
1514 acdbratio[kz] = 0.;
1515 acdmode[kz][0] = 0;
1516 acdmode[kz][1] = 0;
1517 acdmode[kz][2] = 0;
1518 }
1519 acdbratio[0] = 50.;
1520 acdmode[0][0] = -1000010020; // deuteron
1521 acdmode[0][1] = 321; // negative kaon
1522 acdmode[0][2] = -211; // positive pion
1523
1524 acdbratio[1] = 50.;
1525 acdmode[1][0] = -1000010020; // deuteron
1526 acdmode[1][1] = 310; // K0s
1527
1528 TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode);
1529
1531
1532 // Define the 2-body phase space decay for the f0(980)
1533 // Int_t mode[6][3];
1534 // Float_t bratio[6];
1535
1536 for (Int_t kz = 0; kz < 6; kz++) {
1537 bratio[kz] = 0.;
1538 mode[kz][0] = 0;
1539 mode[kz][1] = 0;
1540 mode[kz][2] = 0;
1541 }
1542 bratio[0] = 100.;
1543 mode[0][0] = 211; // pion
1544 mode[0][1] = -211; // pion
1545
1546 TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode);
1547
1548 // Define the 2-body phase space decay for the f2(1270)
1549
1550 // for (Int_t kz = 0; kz < 6; kz++) {
1551 // bratio[kz] = 0.;
1552 // mode[kz][0] = 0;
1553 // mode[kz][1] = 0;
1554 // mode[kz][2] = 0;
1555 // }
1556 // bratio[0] = 100.;
1557 // mode[0][0] = 211; // pion
1558 // mode[0][1] = -211; // pion
1559
1560 // TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode);
1561
1562 // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710), f0(1370), a2(1320), f2(1270)
1563 for (Int_t kz = 0; kz < 6; kz++) {
1564 bratio[kz] = 0.;
1565 mode[kz][0] = 0;
1566 mode[kz][1] = 0;
1567 mode[kz][2] = 0;
1568 }
1569 bratio[0] = 100.;
1570 mode[0][0] = 310; // K0s
1571 mode[0][1] = 310; // K0s
1572
1573 TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500)
1574 TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525)
1575 TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710)
1576 TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370)
1577 TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320)
1578 TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode); // f2(1270)
1579
1580 // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420)
1581 for (Int_t kz = 0; kz < 6; kz++) {
1582 bratio[kz] = 0.;
1583 mode[kz][0] = 0;
1584 mode[kz][1] = 0;
1585 mode[kz][2] = 0;
1586 }
1587
1588 bratio2[0] = 50.;
1589 mode[0][0] = 310; // K0s
1590 mode[0][1] = -321; // anti-K
1591 mode[0][2] = 211; // pion+
1592
1593 bratio2[1] = 50.;
1594 mode[1][0] = 310; // K0s
1595 mode[1][1] = 321; // K
1596 mode[1][2] = -211; // pion-
1597
1598 TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285)
1599 TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420)
1600
1601 // Define the decay modes for the Lambda(1405)
1602 for (Int_t kz = 0; kz < 6; kz++) {
1603 bratio[kz] = 0.;
1604 mode[kz][0] = 0;
1605 mode[kz][1] = 0;
1606 mode[kz][2] = 0;
1607 }
1608 // 33.3 % sigma-pi+, sigma+pi-, sigma0pi0
1609 bratio[0] = 33.3;
1610 mode[0][0] = 3112; // Sigma-
1611 mode[0][1] = 211; // negative pion
1612 bratio[1] = 33.3;
1613 mode[1][0] = 3222; // Sigma+
1614 mode[1][1] = -211; // positive pion
1615 bratio[2] = 33.3;
1616 mode[2][0] = 3212; // Sigma0
1617 mode[2][1] = 111; // neutral pion
1618 TVirtualMC::GetMC()->SetDecayMode(102132, bratio, mode); // Lambda(1405)
1619 // Define the decay modes for the Anti-Lambda(1405)
1620 for (Int_t kz = 0; kz < 6; kz++) {
1621 abratio[kz] = 0.;
1622 amode[kz][0] = 0;
1623 amode[kz][1] = 0;
1624 amode[kz][2] = 0;
1625 }
1626 // 33.3 % sigma-pi-, sigma-pi+, sigma0pi0
1627 abratio[0] = 33.3;
1628 amode[0][0] = -3112; // AntiSigma-
1629 amode[0][1] = -211; // positive pion
1630 abratio[1] = 33.3;
1631 amode[1][0] = -3222; // AntiSigma+
1632 amode[1][1] = 211; // negative pion
1633 abratio[2] = 33.3;
1634 amode[2][0] = -3212; // Sigma0
1635 amode[2][1] = 111; // negative pion
1636 TVirtualMC::GetMC()->SetDecayMode(-102132, abratio, amode); // Anti-Lambda(1405)
1637
1638 // Lambda1520/Lambda1520bar
1639
1640 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);
1641 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);
1642
1643 // Lambda1520 decay modes
1644 Int_t lmode[9][3];
1645 Float_t lbratio[9];
1646 for (Int_t kz = 0; kz < 9; kz++) {
1647 lbratio[kz] = 0.;
1648 lmode[kz][0] = 0;
1649 lmode[kz][1] = 0;
1650 lmode[kz][2] = 0;
1651 }
1652
1653 // L(1520) -> p K-
1654 lbratio[0] = 0.229944;
1655 lmode[0][0] = 2212;
1656 lmode[0][1] = -321;
1657
1658 // L(1520) -> n K0
1659 lbratio[1] = 0.229944;
1660 lmode[1][0] = 2112;
1661 lmode[1][1] = -311;
1662
1663 // L(1520) -> Sigma+ pi-
1664 lbratio[2] = 0.143076;
1665 lmode[2][0] = 3222;
1666 lmode[2][1] = -211;
1667
1668 // L(1520) -> Sigma0 pi0
1669 lbratio[3] = 0.143076;
1670 lmode[3][0] = 3212;
1671 lmode[3][1] = 111;
1672
1673 // L(1520) -> Sigma- pi+
1674 lbratio[4] = 0.143076;
1675 lmode[4][0] = 3112;
1676 lmode[4][1] = 211;
1677
1678 // L(1520) -> Sigma*- pi+
1679 lbratio[5] = 0.034066;
1680 lmode[5][0] = 3114;
1681 lmode[5][1] = 211;
1682
1683 // L(1520) -> Sigma*0 pi0
1684 lbratio[6] = 0.034066;
1685 lmode[6][0] = 3214;
1686 lmode[6][1] = 111;
1687
1688 // L(1520) -> Sigma*+ pi-
1689 lbratio[7] = 0.034066;
1690 lmode[7][0] = 3224;
1691 lmode[7][1] = -211;
1692
1693 // L(1520) -> Lambda gamma
1694 lbratio[8] = 0.008687;
1695 lmode[8][0] = 3122;
1696 lmode[8][1] = 22;
1697
1698 TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode);
1699
1700 // Lambda1520bar decay modes
1701
1702 // L(1520)bar -> p- K+
1703 lbratio[0] = 0.229944;
1704 lmode[0][0] = -2212;
1705 lmode[0][1] = 321;
1706
1707 // L(1520)bar -> nbar K0bar
1708 lbratio[1] = 0.229944;
1709 lmode[1][0] = -2112;
1710 lmode[1][1] = 311;
1711
1712 // L(1520)bar -> Sigmabar- pi+
1713 lbratio[2] = 0.143076;
1714 lmode[2][0] = -3222;
1715 lmode[2][1] = 211;
1716
1717 // L(1520)bar -> Sigma0bar pi0
1718 lbratio[3] = 0.143076;
1719 lmode[3][0] = -3212;
1720 lmode[3][1] = 111;
1721
1722 // L(1520)bar -> Sigmabar+ pi-
1723 lbratio[4] = 0.143076;
1724 lmode[4][0] = -3112;
1725 lmode[4][1] = -211;
1726
1727 // L(1520)bar -> anti-Sigma*- pi-
1728 lbratio[5] = 0.034066;
1729 lmode[5][0] = -3114;
1730 lmode[5][1] = -211;
1731
1732 // L(1520)bar -> anti-Sigma*0 pi0
1733 lbratio[6] = 0.034066;
1734 lmode[6][0] = -3214;
1735 lmode[6][1] = 111;
1736
1737 // L(1520)bar -> anti-Sigma*+ pi+
1738 lbratio[7] = 0.034066;
1739 lmode[7][0] = -3224;
1740 lmode[7][1] = 211;
1741
1742 // L(1520)bar -> Anti-Lambda gamma
1743 lbratio[8] = 0.008687;
1744 lmode[8][0] = -3122;
1745 lmode[8][1] = 22;
1746
1747 TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode);
1748
1749 // --------------------------------------------------------------------
1750
1751 //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951)
1752 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);
1753 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);
1754}
1755
1757{
1758 // dispatch first to function in FairRoot
1759 FairMCApplication::AddParticles();
1760
1761 // register special particles for ALICE
1762 // TODO: try to make use of FairRoot if easier or more customizable
1764
1766 LOG(info) << "Printing \'SimUserDecay\' parameters";
1767 LOG(info) << param;
1768
1769 // check if there are PDG codes requested for user decay
1770 if (param.pdglist.empty()) {
1771 return;
1772 }
1773
1774 // loop over PDG codes in the string
1775 std::stringstream ss(param.pdglist);
1776 int pdg;
1777 while (ss >> pdg) {
1778 LOG(info) << "Setting user decay for PDG " << pdg;
1779 TVirtualMC::GetMC()->SetUserDecay(pdg);
1780 }
1781}
1782
1784{
1786 LOG(info) << "Initializing the hook for TrackReferences during stepping";
1787 auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile);
1788 if (std::filesystem::exists(expandedTrackRefHookFileName)) {
1789 // if this file exists we will compile the hook on the fly
1790 mTrackRefFcn = o2::conf::GetFromMacro<TrackRefFcn>(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook");
1791 LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName;
1792 } else {
1793 LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook";
1794 mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing
1795 }
1796 }
1797}
1798
1800{
1802 for (auto det : listActiveDetectors) {
1803 if (dynamic_cast<o2::base::Detector*>(det)) {
1804 ((o2::base::Detector*)det)->initializeLate();
1805 }
1806 }
1807}
1808
1809void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const
1810{
1811 // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info)));
1813}
1814
1815// helper function to fetch data from FairRootManager branch and serialize it
1816// returns handle to container
1817template <typename T>
1818const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts)
1819{
1820 auto mgr = FairRootManager::Instance();
1821 // check if branch is present
1822 if (mgr->GetBranchId(name) == -1) {
1823 LOG(error) << "Branch " << name << " not found";
1824 return nullptr;
1825 }
1826 auto data = mgr->InitObjectAs<const T*>(name.c_str());
1827 if (data) {
1828 o2::base::attachTMessage(*data, channel, parts);
1829 }
1830 return data;
1831}
1832
1834{
1835 mSubEventInfo = i;
1836 // being communicated a SubEventInfo also means we get a FairMCEventHeader
1837 fMCEventHeader = &mSubEventInfo->mMCEventHeader;
1838}
1839
1841{
1842 fair::mq::Parts simdataparts;
1843
1844 // fill these parts ... the receiver has to unpack similary
1845 // TODO: actually we could just loop over branches in FairRootManager at this moment?
1846 mSubEventInfo->npersistenttracks = static_cast<o2::data::Stack*>(GetStack())->getMCTracks()->size();
1847 mSubEventInfo->nprimarytracks = static_cast<o2::data::Stack*>(GetStack())->GetNprimary();
1848 attachSubEventInfo(simdataparts, *mSubEventInfo);
1849 auto tracks = attachBranch<std::vector<o2::MCTrack>>("MCTrack", *mSimDataChannel, simdataparts);
1850 attachBranch<std::vector<o2::TrackReference>>("TrackRefs", *mSimDataChannel, simdataparts);
1851 assert(tracks->size() == mSubEventInfo->npersistenttracks);
1852
1853 for (auto det : listActiveDetectors) {
1854 if (dynamic_cast<o2::base::Detector*>(det)) {
1855 ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts);
1856 }
1857 }
1858 LOG(info) << "sending message with " << simdataparts.Size() << " parts";
1859 mSimDataChannel->Send(simdataparts);
1860}
1861} // namespace steer
1862} // namespace o2
Definition of the Detector class.
uint32_t hash
std::unique_ptr< expressions::Node > node
int32_t i
Definition of the Names Generator class.
uint16_t pos
Definition RawData.h:3
uint32_t j
Definition RawData.h:0
TBranch * ptr
static std::vector< int > const & getDetId2HitBitIndex()
Definition Detector.h:240
static MaterialManager & Instance()
static std::string getAlignedGeomFileName(const std::string_view prefix="")
Definition NameConf.cxx:46
static std::string getGeomFileName(const std::string_view prefix="")
Definition NameConf.cxx:40
static constexpr std::string_view CCDBOBJECT
Definition NameConf.h:66
unsigned long long getSeedCount() const
how often a seed was propagated; lets callers detect a silent no-op
static VMCSeederService const & instance()
static SimConfig & Instance()
Definition SimConfig.h:112
static constexpr int nameToID(char const *name, int id=First)
Definition DetID.h:155
static mask_t getMask(const std::string_view detList)
detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)
Definition DetID.cxx:42
void finishEventCommon()
some common parts of finishEvent
o2::conf::SimCutParams const & mCutParams
std::map< int, std::string > mSensitiveVolumes
std::map< int, std::string > mModIdToName
o2::data::SubEventInfo * mSubEventInfo
generic channel on which to send sim data
fair::mq::Channel * mSimDataChannel
void attachSubEventInfo(fair::mq::Parts &, o2::data::SubEventInfo const &info) const
void setSubEventInfo(o2::data::SubEventInfo *i)
static ShmManager & Instance()
Definition ShmManager.h:61
GLint GLenum GLint x
Definition glcorearb.h:403
GLenum mode
Definition glcorearb.h:266
GLuint buffer
Definition glcorearb.h:655
GLuint const GLchar * name
Definition glcorearb.h:781
GLint y
Definition glcorearb.h:270
GLenum const GLfloat * params
Definition glcorearb.h:272
GLboolean * data
Definition glcorearb.h:298
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLsizei const GLchar * message
Definition glcorearb.h:2517
GLenum GLfloat param
Definition glcorearb.h:271
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
void attachTMessage(Container const &hits, fair::mq::Channel &channel, fair::mq::Parts &parts)
Definition Detector.h:285
const T * attachBranch(std::string const &name, fair::mq::Channel &channel, fair::mq::Parts &parts)
void addSpecialParticles()
void TypedVectorAttach(const char *name, fair::mq::Channel &channel, fair::mq::Parts &parts)
std::string expandShellVarsInFileName(std::string const &input)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string stepFilteringMacro
Definition SimParams.h:26
std::string stepTrackRefHookFile
Definition SimParams.h:28
o2::dataformats::MCEventHeader mMCEventHeader
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"