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>
39#include <TGeoParallelWorld.h>
40
41namespace o2
42{
43namespace steer
44{
45// helper function to send trivial data
46template <typename T>
47void TypedVectorAttach(const char* name, fair::mq::Channel& channel, fair::mq::Parts& parts)
48{
49 static auto mgr = FairRootManager::Instance();
50 auto vector = mgr->InitObjectAs<const std::vector<T>*>(name);
51 if (vector) {
52 auto buffer = (char*)&(*vector)[0];
53 auto buffersize = vector->size() * sizeof(T);
54 fair::mq::MessagePtr message(channel.NewMessage(
55 buffer, buffersize,
56 [](void* data, void* hint) {}, buffer));
57 parts.AddPart(std::move(message));
58 }
59}
60
62{
64
65 // check the max time of flight condition
66 const auto tof = fMC->TrackTime();
68 if (tof > params.TOFMAX) {
69 fMC->StopTrack();
70 return;
71 }
72
73 mLongestTrackTime = std::max((double)mLongestTrackTime, tof);
74
76 // we can kill tracks here based on our
77 // custom detector specificities
78
79 // Note that this is done in addition to the generic
80 // R + Z-cut mechanism at VMC level.
81
82 float x, y, z;
83 fMC->TrackPosition(x, y, z);
84
85 // this function is implementing a basic z-dependent R cut
86 // can be generalized later on
87 auto outOfR = [x, y, this](float z) {
88 // for the moment for cases when we have ZDC enabled
89 if (std::abs(z) > mCutParams.tunnelZ) {
91 return true;
92 }
93 }
94 return false;
95 };
96
97 if (z > mCutParams.ZmaxA ||
98 -z > mCutParams.ZmaxC ||
99 outOfR(z)) {
100 fMC->StopTrack();
101 return;
102 }
103 }
104
106 mTrackRefFcn(fMC);
107 }
108
109 // dispatch now to stepping function in FairRoot
110 FairMCApplication::Stepping();
111}
112
114{
115 // dispatch first to function in FairRoot
116 FairMCApplication::PreTrack();
117}
118
120{
121 // fill the mapping
122 mModIdToName.clear();
124 for (int i = 0; i < fModules->GetEntries(); ++i) {
125 auto mod = static_cast<FairModule*>(fModules->At(i));
126 if (mod) {
127 mModIdToName[mod->GetModId()] = mod->GetName();
128 int did = o2::detectors::DetID::nameToID(mod->GetName());
129 if (did >= 0) {
130 dmask |= o2::detectors::DetID::getMask(did);
131 }
132 }
133 }
134 gGeoManager->SetUniqueID(dmask.to_ulong());
135 FairMCApplication::ConstructGeometry();
136
137 std::ofstream voltomodulefile("MCStepLoggerVolMap.dat");
138 // construct the volume name to module name mapping useful for StepAnalysis
139 auto vollist = gGeoManager->GetListOfVolumes();
140 for (int i = 0; i < vollist->GetEntries(); ++i) {
141 auto vol = static_cast<TGeoVolume*>(vollist->At(i));
142 auto iter = fModVolMap.find(vol->GetNumber());
143 voltomodulefile << vol->GetName() << ":" << mModIdToName[iter->second] << "\n";
144 }
145}
146
148{
149 // load special cuts which might be given from the outside first.
151 matMgr.loadCutsAndProcessesFromJSON(o2::base::MaterialManager::ESpecial::kTRUE);
152 matMgr.SetLowEnergyNeutronTransport(mCutParams.lowneut);
153 // During the following, FairModule::SetSpecialPhysicsCuts will be called for each module
154 FairMCApplication::InitGeometry();
155 matMgr.writeCutsAndProcessesToJSON();
156 // now the sensitive volumes are set up in fVolMap and we can query them
157 for (auto e : fVolMap) {
158 // since fVolMap contains multiple entries (if multiple copies), this may
159 // write to the same entry multiple times
160 mSensitiveVolumes[e.first] = e.second->GetName();
161 }
162 std::ofstream sensvolfile("MCStepLoggerSenVol.dat");
163 for (auto e : mSensitiveVolumes) {
164 sensvolfile << e.first << ":" << e.second << "\n";
165 }
166}
167
169{
170 for (auto det : listDetectors) {
171 if (dynamic_cast<o2::base::Detector*>(det)) {
172 ((o2::base::Detector*)det)->addAlignableVolumes();
173 }
174 }
175
176 // we stream out both unaligned geometry (to allow for
177 // dynamic post-alignment) as well as the aligned version
178 // which can be used by digitization etc. immediately
179 auto& confref = o2::conf::SimConfig::Instance();
180 auto geomfile = o2::base::NameConf::getGeomFileName(confref.getOutPrefix());
181 // since in general the geometry is a CCDB object, it must be exported under the standard name
182 gGeoManager->SetName(std::string(o2::base::NameConf::CCDBOBJECT).c_str());
183 gGeoManager->Export(geomfile.c_str());
184
185 // apply alignment for included detectors AFTER exporting ideal geometry
186 auto& aligner = o2::base::Aligner::Instance();
187 aligner.applyAlignment(confref.getTimestamp());
188
189 // export aligned geometry into different file
190 auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix());
191 gGeoManager->Export(alignedgeomfile.c_str());
192
194
195 // fill parallel world geometry if activated
196 if (param.useParallelWorld) {
197 TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors");
198 if (param.usePwGeoBVH) {
199 pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH);
200 }
201 if (param.usePwCaching) {
202 TGeoNavigator::SetPWSafetyCaching(true);
203 }
204 for (auto det : listDetectors) {
205 if (dynamic_cast<o2::base::Detector*>(det)) {
206 ((o2::base::Detector*)det)->fillParallelWorld();
207 }
208 }
209 gGeoManager->SetUseParallelWorldNav(true);
210 }
211
212 // return original return value of misalignment procedure
213 return true;
214}
215
217{
218 LOG(info) << "This event/chunk did " << mStepCounter << " steps";
219 LOG(info) << "Longest track time is " << mLongestTrackTime;
220
221 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
223 header->setDetId2HitBitLUT(o2::base::Detector::getDetId2HitBitIndex());
224
225 static_cast<o2::data::Stack*>(GetStack())->updateEventStats();
226}
227
229{
231
232 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
233 auto& confref = o2::conf::SimConfig::Instance();
234
235 if (confref.isFilterOutNoHitEvents() && header->getMCEventStats().getNHits() == 0) {
236 LOG(info) << "Discarding current event due to no hits";
237 SetSaveCurrentEvent(false);
238 }
239
240 // dispatch to function in FairRoot
241 FairMCApplication::FinishEvent();
242}
243
245{
246 // dispatch first to function in FairRoot
247 FairMCApplication::BeginEvent();
248
249 // register event header with our stack
250 auto header = static_cast<o2::dataformats::MCEventHeader*>(fMCEventHeader);
251 static_cast<o2::data::Stack*>(GetStack())->setMCEventStats(&header->getMCEventStats());
252
253 mStepCounter = 0;
255}
256
258{
259 //
260 // Add particles needed for ALICE (not present in Geant3 or Geant4)
261 // Code ported 1-1 from AliRoot
262 //
263
264 LOG(info) << "Adding custom particles to VMC";
265
266 //Hypertriton
267 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);
268 //Anti-Hypertriton
269 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);
270
271 //Hyper hydrogen 4 ground state
272 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);
273 //Anti-Hyper hydrogen 4 ground state
274 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);
275
276 //Hyper helium 4 ground state
277 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);
278 //Anti-Hyper helium 4 ground state
279 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);
280
281 // Lithium 4 ground state
282 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);
283 // Anti-Lithium 4 ground state
284 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);
285
286 //Hyper helium 5
287 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);
288 //Anti-Hyper helium 5
289 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);
290
291 //Double Hyper hydrogen 4
292 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);
293 //Double Anti-Hyper hydrogen 4
294 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);
295
296 // 4Xi(-)H
297 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);
298 // Anti-4Xi(-)H
299 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);
300 // 4Xi(-)He
301 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);
302 // Anti-4Xi(-)He
303 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);
304
305 // Hyper helium 4 sigma
306 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);
307 // Anti-Hyper helium 4 sigma
308 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);
309
310 //Lambda-Neutron
311 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);
312
313 //Anti-Lambda-Neutron
314 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);
315
316 //H-Dibaryon
317 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);
318
319 //Anti-H-Dibaryon
320 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);
321
322 //Xi-Proton
323 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);
324
325 //Anti-Xi-Proton
326 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);
327
328 //Lambda-Neutron-Neutron
329 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);
330
331 //Anti-Lambda-Neutron-Neutron
332 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);
333
334 //Omega-Proton
335 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);
336
337 //Anti-Omega-Proton
338 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);
339
340 //Omega-Neutron
341 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);
342
343 //Anti-Omega-Neutron
344 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);
345
346 //Omega-Omega
347 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);
348
349 //Anti-Omega-Omega
350 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);
351
352 //Lambda(1405)-Proton
353 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);
354
355 //Anti-Lambda(1405)-Proton
356 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);
357
358 //Lambda(1405)-Lambda(1405)
359 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);
360
361 //Anti-Lambda(1405)-Lambda(1405)
362 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);
363
364 //c-deuteron
365 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);
366 //Anti-c-deuteron
367 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);
368
369 //c-triton
370 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);
371 //Anti-c-Hypertriton
372 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);
373
374 //Resonances not in Generators
375 // f0(980) assume 70 MeV as width (PDG: 40 to 100 MeV)
376 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);
377
378 // f2(1270) (PDG: width = 185 MeV)
379 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);
380
381 // f1(1285) (PDG: width = 24.20 MeV) Spin/Parity might not be correct
382 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);
383 // f1(1420) (PDG: width = 54 MeV) Spin/Parity might not be correct
384 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);
385
386 // Glueball hunting family
387 // Their life times are not known, so we set them to 1e-24
388 // f0(1370) (PDG: width = 200-500 MeV) Spin/Parity might not be correct
389 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);
390 // a2(1320) (PDG: width = 107.8 MeV) (Spin/Parity might not be correct)
391 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);
392 // f0(1500) (PDG: width = 112 MeV) Spin/Parity might not be correct
393 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);
394 // f0(1710) (PDG: width = 139 MeV) Spin/Parity might not be correct
395 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);
396 // f2(1525) (PDG: width = 73 MeV) Spin/Parity might not be correct
397 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);
398
399 // Xi_0(1820)
400 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);
401 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);
402
403 int xi_0_1820_mode[6][3] = {{0}};
404 float xi_0_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f};
405 xi_0_1820_mode[0][0] = 3122; // Lambda
406 xi_0_1820_mode[0][1] = 310; // K0s
407 TVirtualMC::GetMC()->SetDecayMode(123324, xi_0_1820_ratio, xi_0_1820_mode);
408 xi_0_1820_mode[0][0] = -3122; // Lambda-bar
409 TVirtualMC::GetMC()->SetDecayMode(-123324, xi_0_1820_ratio, xi_0_1820_mode);
410
411 // Xi-+(1820)
412 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);
413 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);
414
415 int xi_charged_1820_mode[6][3] = {{0}};
416 float xi_charged_1820_ratio[6] = {100.f, 0.f, 0.f, 0.f, 0.f, 0.f};
417 xi_charged_1820_mode[0][0] = 3122; // Lambda
418 xi_charged_1820_mode[0][1] = -321; // K-
419 TVirtualMC::GetMC()->SetDecayMode(123314, xi_charged_1820_ratio, xi_charged_1820_mode);
420 xi_charged_1820_mode[0][0] = -3122; // Lambda-bar
421 xi_charged_1820_mode[0][1] = 321; // K+
422 TVirtualMC::GetMC()->SetDecayMode(-123314, xi_charged_1820_ratio, xi_charged_1820_mode);
423
424 // Ps - hidden strange (s-sbar) pentaquarks
425 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);
426 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);
427 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);
428 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);
429
430 Int_t psmode[6][3] = {0};
431 Float_t psratio[6] = {0.f};
432 psratio[0] = 100.;
433
434 psmode[0][0] = 333; // phi
435 psmode[0][1] = 2212; // proton
436 TVirtualMC::GetMC()->SetDecayMode(9322134, psratio, psmode);
437 TVirtualMC::GetMC()->SetDecayMode(9322136, psratio, psmode);
438
439 psmode[0][1] = -2212; // anti-proton
440 TVirtualMC::GetMC()->SetDecayMode(-9322134, psratio, psmode);
441 TVirtualMC::GetMC()->SetDecayMode(-9322136, psratio, psmode);
442
443 //Omega(2012)
444 for (int j = 1; j < 6; j++) {
445 psmode[j][0] = psmode[j][1] = 0;
446 psratio[j] = 0.;
447 }
448
449 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);
450 psmode[0][0] = 3312; // Xi-
451 psmode[0][1] = 310; // K0S
452 psratio[0] = 100.;
453 TVirtualMC::GetMC()->SetDecayMode(3335, psratio, psmode);
454
455 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);
456 psmode[0][0] = -3312; // anti-Xi+
457 psmode[0][1] = 310; // K0S
458 psratio[0] = 100.;
459 TVirtualMC::GetMC()->SetDecayMode(-3335, psratio, psmode);
460
461 // d*(2380) - dibaryon resonance
462 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);
463 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);
464
465 Int_t dstmode[6][3] = {0};
466 Float_t dstratio[6] = {0.f};
467 dstratio[0] = 100; // For now we implement only the mode of interest
468 // d* -> d pi+ pi-
469 dstmode[0][0] = 1000010020; // deuteron
470 dstmode[0][1] = -211; // negative pion
471 dstmode[0][2] = 211; // positive pion
472 TVirtualMC::GetMC()->SetDecayMode(900010020, dstratio, dstmode);
473
474 dstmode[0][0] = -1000010020; // anti-deuteron
475 TVirtualMC::GetMC()->SetDecayMode(-900010020, dstratio, dstmode);
476
477 // Heavy vector mesons
478 // D*+
479 TVirtualMC::GetMC()->DefineParticle(413, "D*+", kPTHadron, 2.0103, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
480 // D*-
481 TVirtualMC::GetMC()->DefineParticle(-413, "D*-", kPTHadron, 2.0103, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
482 // D*0
483 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);
484 // D*0bar
485 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);
486 // D*_s+
487 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);
488 // D*_s-
489 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);
490 // B*0
491 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);
492 // B*0bar
493 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);
494 // B*+
495 TVirtualMC::GetMC()->DefineParticle(523, "B*+", kPTHadron, 5.3251, 1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
496 // B*-
497 TVirtualMC::GetMC()->DefineParticle(-523, "B*-", kPTHadron, 5.3251, -1.0, 0.0, "Hadron", 0.0, 1, -1, 0, 0, 0, 0, 0, 0, kTRUE);
498 // B*_s0
499 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);
500 // B*_s0bar
501 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);
502 // B*_c+
503 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);
504 // B*_c-
505 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);
506
507 // Charm pentaquarks
508 // Theta_c: isospin singlet with J=1/2+ (see https://arxiv.org/abs/hep-ph/0409121)
509 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);
510 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);
511
512 for (int j = 1; j < 6; j++) {
513 psmode[j][0] = psmode[j][1] = 0;
514 psratio[j] = 0.;
515 }
516 psmode[0][0] = 413; // D*+
517 psmode[0][1] = -2212; // anti-p
518 psratio[0] = 100.;
519 TVirtualMC::GetMC()->SetDecayMode(9422111, psratio, psmode);
520 psmode[0][0] = -413; // D*-
521 psmode[0][1] = 2212; // p
522 TVirtualMC::GetMC()->SetDecayMode(-9422111, psratio, psmode);
523
524 // Define the 2- and 3-body phase space decay for the Hyper-Triton
525 Int_t mode[6][3];
526 Float_t bratio[6];
527
528 for (Int_t kz = 0; kz < 6; kz++) {
529 bratio[kz] = 0.;
530 mode[kz][0] = 0;
531 mode[kz][1] = 0;
532 mode[kz][2] = 0;
533 }
534 bratio[0] = 50.;
535 mode[0][0] = 1000020030; // Helium3
536 mode[0][1] = -211; // negative pion
537
538 bratio[1] = 50.;
539 mode[1][0] = 1000010020; // deuteron
540 mode[1][1] = 2212; // proton
541 mode[1][2] = -211; // negative pion
542
543 TVirtualMC::GetMC()->SetDecayMode(1010010030, bratio, mode);
544
545 // Define the 2- and 3-body phase space decay for the Anti-Hyper-Triton
546 Int_t amode[6][3];
547 Float_t abratio[6];
548
549 for (Int_t kz = 0; kz < 6; kz++) {
550 abratio[kz] = 0.;
551 amode[kz][0] = 0;
552 amode[kz][1] = 0;
553 amode[kz][2] = 0;
554 }
555 abratio[0] = 50.;
556 amode[0][0] = -1000020030; // anti- Helium3
557 amode[0][1] = 211; // positive pion
558 abratio[1] = 50.;
559 amode[1][0] = -1000010020; // anti-deuteron
560 amode[1][1] = -2212; // anti-proton
561 amode[1][2] = 211; // positive pion
562
563 TVirtualMC::GetMC()->SetDecayMode(-1010010030, abratio, amode);
564
566
567 // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
568
569 Int_t mode3[6][3];
570 Float_t bratio3[6];
571
572 for (Int_t kz = 0; kz < 6; kz++) {
573 bratio3[kz] = 0.;
574 mode3[kz][0] = 0;
575 mode3[kz][1] = 0;
576 mode3[kz][2] = 0;
577 }
578 bratio3[0] = 50.;
579 mode3[0][0] = 1000020040; // Helium4
580 mode3[0][1] = -211; // negative pion
581
582 bratio3[1] = 50.;
583 mode3[1][0] = 1000010030; // tritium
584 mode3[1][1] = 2212; // proton
585 mode3[1][2] = -211; // negative pion
586
587 TVirtualMC::GetMC()->SetDecayMode(1010010040, bratio3, mode3);
588
589 // Define the 2- and 3-body phase space decay for the Hyper Hydrogen 4
590 Int_t amode3[6][3];
591 Float_t abratio3[6];
592
593 for (Int_t kz = 0; kz < 6; kz++) {
594 abratio3[kz] = 0.;
595 amode3[kz][0] = 0;
596 amode3[kz][1] = 0;
597 amode3[kz][2] = 0;
598 }
599 abratio3[0] = 50.;
600 amode3[0][0] = -1000020040; // anti- Helium4
601 amode3[0][1] = 211; // positive pion
602 abratio3[1] = 50.;
603 amode3[1][0] = -1000010030; // anti-tritium
604 amode3[1][1] = -2212; // anti-proton
605 amode3[1][2] = 211; // positive pion
606
607 TVirtualMC::GetMC()->SetDecayMode(-1010010040, abratio3, amode3);
608
609 // Define the 3-body phase space decay for the Hyper Helium 4
610 Int_t mode4[6][3];
611 Float_t bratio4[6];
612
613 for (Int_t kz = 0; kz < 6; kz++) {
614 bratio4[kz] = 0.;
615 mode4[kz][0] = 0;
616 mode4[kz][1] = 0;
617 mode4[kz][2] = 0;
618 }
619 bratio4[0] = 50.;
620 mode4[0][0] = 1000020030; // Helium3
621 mode4[0][1] = -211; // negative pion
622 mode4[0][2] = 2212; // proton
623
624 bratio4[1] = 50.;
625 mode4[1][0] = 1000030040; // lithium-4
626 mode4[1][1] = -211; // negative pion
627
628 TVirtualMC::GetMC()->SetDecayMode(1010020040, bratio4, mode4);
629
630 // Define the 2-body phase space decay for the Anti-Hyper Helium 4
631 Int_t amode4[6][3];
632 Float_t abratio4[6];
633
634 for (Int_t kz = 0; kz < 6; kz++) {
635 abratio4[kz] = 0.;
636 amode4[kz][0] = 0;
637 amode4[kz][1] = 0;
638 amode4[kz][2] = 0;
639 }
640 abratio4[0] = 50.;
641 amode4[0][0] = -1000020030; // anti-Helium 3
642 amode4[0][1] = 211; // positive pion
643 amode4[0][2] = -2212; // anti proton
644
645 abratio4[1] = 50.;
646 amode4[1][0] = -1000030040; // antilithium-4
647 amode4[1][1] = 211; // positive pion
648
649 TVirtualMC::GetMC()->SetDecayMode(-1010020040, abratio4, amode4);
650
651 // Define the 2-body phase space decay for the Lithium 4
652 Int_t model4[6][3];
653 Float_t bratiol4[6];
654
655 for (Int_t kz = 0; kz < 6; kz++) {
656 bratiol4[kz] = 0.;
657 model4[kz][0] = 0;
658 model4[kz][1] = 0;
659 model4[kz][2] = 0;
660 }
661 bratiol4[0] = 100.;
662 model4[0][0] = 1000020030; // Helium3
663 model4[0][1] = 2212; // proton
664
665 TVirtualMC::GetMC()->SetDecayMode(1000030040, bratiol4, model4);
666
667 // Define the 2-body phase space decay for the Anti-Lithium 4
668 Int_t amodel4[6][3];
669 Float_t abratiol4[6];
670
671 for (Int_t kz = 0; kz < 6; kz++) {
672 abratiol4[kz] = 0.;
673 amodel4[kz][0] = 0;
674 amodel4[kz][1] = 0;
675 amodel4[kz][2] = 0;
676 }
677 abratiol4[0] = 100.;
678 amodel4[0][0] = -1000020030; // Anti-Helium3
679 amodel4[0][1] = -2212; // Anti-proton
680
681 TVirtualMC::GetMC()->SetDecayMode(-1000030040, abratiol4, amodel4);
682
683 // Define the 3-body phase space decay for the Hyper Helium 5
684 Int_t mode41[6][3];
685 Float_t bratio41[6];
686
687 for (Int_t kz = 0; kz < 6; kz++) {
688 bratio41[kz] = 0.;
689 mode41[kz][0] = 0;
690 mode41[kz][1] = 0;
691 mode41[kz][2] = 0;
692 }
693 bratio41[0] = 50.;
694 mode41[0][0] = 1000020040; // Helium4
695 mode41[0][1] = -211; // negative pion
696 mode41[0][2] = 2212; // proton
697 bratio41[1] = 50.;
698 mode41[1][0] = 1000020030; // Helium3
699 mode41[1][1] = -211; // negative pion
700 mode41[1][2] = 1000010020; // Deuteron
701
702 TVirtualMC::GetMC()->SetDecayMode(1010020050, bratio41, mode41);
703
704 // Define the 2-body phase space decay for the Anti-Hyper Helium 5
705 Int_t amode41[6][3];
706 Float_t abratio41[6];
707
708 for (Int_t kz = 0; kz < 6; kz++) {
709 abratio41[kz] = 0.;
710 amode41[kz][0] = 0;
711 amode41[kz][1] = 0;
712 amode41[kz][2] = 0;
713 }
714 abratio41[0] = 50.;
715 amode41[0][0] = -1000020040; // anti-Helium 4
716 amode41[0][1] = 211; // positive pion
717 amode41[0][2] = -2212; // anti proton
718 abratio41[1] = 50.;
719 amode41[1][0] = -1000020030; // anti-Helium 3
720 amode41[1][1] = 211; // positive pion
721 amode41[1][2] = -1000010020; // anti deuteron
722
723 TVirtualMC::GetMC()->SetDecayMode(-1010020050, abratio41, amode41);
724
725 // Define the 3-body phase space decay for the Double Hyper Hydrogen 4
726 Int_t mode42[6][3];
727 Float_t bratio42[6];
728
729 for (Int_t kz = 0; kz < 6; kz++) {
730 bratio42[kz] = 0.;
731 mode42[kz][0] = 0;
732 mode42[kz][1] = 0;
733 mode42[kz][2] = 0;
734 }
735 bratio42[0] = 50.;
736 mode42[0][0] = 1010020040; // Hyper-Helium4
737 mode42[0][1] = -211; // negative pion
738
739 bratio42[1] = 50.;
740 mode42[1][0] = 1010010030; // Hypertriton
741 mode42[1][1] = 2212; // proton
742 mode42[1][2] = -211; // negative pion
743
744 TVirtualMC::GetMC()->SetDecayMode(1020010040, bratio42, mode42);
745
746 // Define the 2-body phase space decay for the Anti Double Hyper Hydrogen 4
747 Int_t amode42[6][3];
748 Float_t abratio42[6];
749
750 for (Int_t kz = 0; kz < 6; kz++) {
751 abratio42[kz] = 0.;
752 amode42[kz][0] = 0;
753 amode42[kz][1] = 0;
754 amode42[kz][2] = 0;
755 }
756 abratio42[0] = 50.;
757 amode42[0][0] = -1010020040; // anti-Hyper-Helium 4
758 amode42[0][1] = 211; // positive pion
759
760 abratio42[1] = 50.;
761 amode42[1][0] = -1010010030; // anti-Hypertriton
762 amode42[1][1] = -2212; // antiproton
763 amode42[1][2] = 211; // positive pion
764
765 TVirtualMC::GetMC()->SetDecayMode(-1020010040, abratio42, amode42);
766
767 // Define the decay for the 4Xi(-)He
768 Int_t mode4XiHe[6][3];
769 Float_t bratio4XiHe[6];
770
771 for (Int_t kz = 0; kz < 6; kz++) {
772 bratio4XiHe[kz] = 0.;
773 mode4XiHe[kz][0] = 0;
774 mode4XiHe[kz][1] = 0;
775 mode4XiHe[kz][2] = 0;
776 }
777 bratio4XiHe[0] = 33.;
778 mode4XiHe[0][0] = 1010020040; // HyperHelium4
779 mode4XiHe[0][1] = -211; // negative pion
780
781 bratio4XiHe[1] = 33.;
782 mode4XiHe[1][0] = 3122; // lambda
783 mode4XiHe[1][1] = 1000020030; // helium-3
784 mode4XiHe[1][2] = -211; // negative pion
785
786 bratio4XiHe[2] = 33.;
787 mode4XiHe[2][0] = 1000030040; // lithium-4
788 mode4XiHe[2][1] = -211; // negative pion
789 mode4XiHe[2][2] = -211; // negative pion
790
791 TVirtualMC::GetMC()->SetDecayMode(1120020040, bratio4XiHe, mode4XiHe);
792
793 // Define the decay for the Anti-4Xi(-)He
794 Int_t amode4XiHe[6][3];
795 Float_t abratio4XiHe[6];
796
797 for (Int_t kz = 0; kz < 6; kz++) {
798 abratio4XiHe[kz] = 0.;
799 amode4XiHe[kz][0] = 0;
800 amode4XiHe[kz][1] = 0;
801 amode4XiHe[kz][2] = 0;
802 }
803 abratio4XiHe[0] = 33.;
804 amode4XiHe[0][0] = -1010020040; // antiHyperHelium-4
805 amode4XiHe[0][1] = 211; // positive pion
806
807 abratio4XiHe[1] = 33.;
808 amode4XiHe[1][0] = -3122; // antilambda
809 amode4XiHe[1][1] = -1000020030; // antihelium-3
810 amode4XiHe[1][2] = 211; // positive pion
811
812 abratio4XiHe[2] = 33.;
813 amode4XiHe[2][0] = -1000030040; // antilithium-4
814 amode4XiHe[2][1] = 211; // positive pion
815 amode4XiHe[2][2] = 211; // positive pion
816
817 TVirtualMC::GetMC()->SetDecayMode(-1120020040, abratio4XiHe, amode4XiHe);
818
819 // Define the decay for the 4Xi(-)H
820 Int_t mode4XiH[6][3];
821 Float_t bratio4XiH[6];
822
823 for (Int_t kz = 0; kz < 6; kz++) {
824 bratio4XiH[kz] = 0.;
825 mode4XiH[kz][0] = 0;
826 mode4XiH[kz][1] = 0;
827 mode4XiH[kz][2] = 0;
828 }
829 bratio4XiH[0] = 33.;
830 mode4XiH[0][0] = 1010010040; // HyperHydrogen4
831 mode4XiH[0][1] = -211; // negative pion
832
833 bratio4XiH[1] = 33.;
834 mode4XiH[1][0] = 3122; // lambda
835 mode4XiH[1][1] = 1000010030; // triton
836 mode4XiH[1][2] = -211; // negative pion
837
838 bratio4XiH[2] = 33.;
839 mode4XiH[2][0] = 1000020040; // alpha
840 mode4XiH[2][1] = -211; // negative pion
841 mode4XiH[2][2] = -211; // negative pion
842
843 TVirtualMC::GetMC()->SetDecayMode(1120010040, bratio4XiH, mode4XiH);
844
845 // Define the decay for the Anti-4Xi(-)H
846 Int_t amode4XiH[6][3];
847 Float_t abratio4XiH[6];
848
849 for (Int_t kz = 0; kz < 6; kz++) {
850 abratio4XiH[kz] = 0.;
851 amode4XiH[kz][0] = 0;
852 amode4XiH[kz][1] = 0;
853 amode4XiH[kz][2] = 0;
854 }
855 abratio4XiH[0] = 33.;
856 amode4XiH[0][0] = -1010010040; // antiHyperHydrogen-4
857 amode4XiH[0][1] = 211; // positive pion
858
859 abratio4XiH[1] = 33.;
860 amode4XiH[1][0] = -3122; // antilambda
861 amode4XiH[1][1] = -1000010030; // antitriton
862 amode4XiH[1][2] = 211; // positive pion
863
864 abratio4XiH[2] = 33.;
865 amode4XiH[2][0] = -1000020040; // antialpha
866 amode4XiH[2][1] = 211; // positive pion
867 amode4XiH[2][2] = 211; // positive pion
868
869 TVirtualMC::GetMC()->SetDecayMode(-1120010040, abratio4XiH, amode4XiH);
870
871 // Define the 2- and 3-body phase space decay for the Hyper Helium 4 sigma
872 Int_t mode4s[6][3];
873 Float_t bratio4s[6];
874
875 for (Int_t kz = 0; kz < 6; kz++) {
876 bratio4s[kz] = 0.;
877 mode4s[kz][0] = 0;
878 mode4s[kz][1] = 0;
879 mode4s[kz][2] = 0;
880 }
881 bratio4s[0] = 20.;
882 mode4s[0][0] = 1000020040; // Helium4
883 mode4s[0][1] = 111; // pion0
884 bratio4s[1] = 40.;
885 mode4s[1][0] = 1000010030; // tritium
886 mode4s[1][2] = 2212; // proton
887 mode4s[1][1] = 111; // pion0
888 bratio4s[2] = 40.;
889 mode4s[2][0] = 1000010030; // tritium
890 mode4s[2][2] = 2212; // pion+
891 mode4s[2][1] = 2112; // neutron
892
893 TVirtualMC::GetMC()->SetDecayMode(1110020040, bratio4s, mode4s);
894
895 // Define the 2- and 3-body phase space decay for the Anti Hyper Helium 4 sigma
896 Int_t amode4s[6][3];
897 Float_t abratio4s[6];
898
899 for (Int_t kz = 0; kz < 6; kz++) {
900 abratio4s[kz] = 0.;
901 amode4s[kz][0] = 0;
902 amode4s[kz][1] = 0;
903 amode4s[kz][2] = 0;
904 }
905 abratio4s[0] = 20.;
906 amode4s[0][0] = -1000020040; // anti-Helium4
907 amode4s[0][1] = 111; // pion0
908 abratio4s[1] = 40.;
909 amode4s[1][0] = -1000010030; // anti-tritium
910 amode4s[1][2] = -2212; // anti-proton
911 amode4s[1][1] = 111; // pion0
912 abratio4s[2] = 40.;
913 amode4s[2][0] = -1000010030; // anti-tritium
914 amode4s[2][2] = -211; // pion-
915 amode4s[2][1] = -2112; // anti-neutron
916
917 TVirtualMC::GetMC()->SetDecayMode(-1110020040, abratio4s, amode4s);
918
919 // Define the 2-body phase space decay for the Lambda-neutron boundstate
920 Int_t mode1[6][3];
921 Float_t bratio1[6];
922
923 for (Int_t kz = 0; kz < 6; kz++) {
924 bratio1[kz] = 0.;
925 mode1[kz][0] = 0;
926 mode1[kz][1] = 0;
927 mode1[kz][2] = 0;
928 }
929 bratio1[0] = 100.;
930 mode1[0][0] = 1000010020; // deuteron
931 mode1[0][1] = -211; // negative pion
932
933 TVirtualMC::GetMC()->SetDecayMode(1010000020, bratio1, mode1);
934
935 // Define the 2-body phase space decay for the Anti-Lambda-neutron boundstate
936 Int_t amode1[6][3];
937 Float_t abratio1[6];
938
939 for (Int_t kz = 0; kz < 6; kz++) {
940 abratio1[kz] = 0.;
941 amode1[kz][0] = 0;
942 amode1[kz][1] = 0;
943 amode1[kz][2] = 0;
944 }
945 abratio1[0] = 100.;
946 amode1[0][0] = -1000010020; // anti-deuteron
947 amode1[0][1] = 211; // positive pion
948
949 TVirtualMC::GetMC()->SetDecayMode(-1010000020, abratio1, amode1);
950
951 // Define the 2-body phase space decay for the H-Dibaryon
952 Int_t mode2[6][3];
953 Float_t bratio2[6];
954
955 for (Int_t kz = 0; kz < 6; kz++) {
956 bratio2[kz] = 0.;
957 mode2[kz][0] = 0;
958 mode2[kz][1] = 0;
959 mode2[kz][2] = 0;
960 }
961 bratio2[0] = 100.;
962 mode2[0][0] = 3122; // Lambda
963 mode2[0][1] = 2212; // proton
964 mode2[0][2] = -211; // negative pion
965
966 TVirtualMC::GetMC()->SetDecayMode(1020000020, bratio2, mode2);
967
968 // Define the 2-body phase space decay for the Anti-H-Dibaryon
969 Int_t amode2[6][3];
970 Float_t abratio2[6];
971
972 for (Int_t kz = 0; kz < 6; kz++) {
973 abratio2[kz] = 0.;
974 amode2[kz][0] = 0;
975 amode2[kz][1] = 0;
976 amode2[kz][2] = 0;
977 }
978 abratio2[0] = 100.;
979 amode2[0][0] = -3122; // anti-deuteron
980 amode2[0][1] = -2212; // anti-proton
981 amode2[0][2] = 211; // positive pion
982
983 TVirtualMC::GetMC()->SetDecayMode(-1020000020, abratio2, amode2);
984
985 // Define the 2-body phase space decay for the Xi0P
986 Int_t mode5[6][3];
987 Float_t bratio5[6];
988
989 for (Int_t kz = 0; kz < 6; kz++) {
990 bratio5[kz] = 0.;
991 mode5[kz][0] = 0;
992 mode5[kz][1] = 0;
993 mode5[kz][2] = 0;
994 }
995 bratio5[0] = 100.;
996 mode5[0][0] = 3122; // Lambda
997 mode5[0][1] = 2212; // proton
998
999 TVirtualMC::GetMC()->SetDecayMode(1020010020, bratio5, mode5);
1000
1001 // Define the 2-body phase space decay for the Anti-Xi0P
1002 Int_t amode5[6][3];
1003 Float_t abratio5[6];
1004
1005 for (Int_t kz = 0; kz < 6; kz++) {
1006 abratio5[kz] = 0.;
1007 amode5[kz][0] = 0;
1008 amode5[kz][1] = 0;
1009 amode5[kz][2] = 0;
1010 }
1011 abratio5[0] = 100.;
1012 amode5[0][0] = -3122; // anti-Lambda
1013 amode5[0][1] = -2212; // anti-proton
1014
1015 TVirtualMC::GetMC()->SetDecayMode(-1020010020, abratio5, amode5);
1016
1017 // Define the 2-body phase space decay for the Lambda-Neutron-Neutron
1018 Int_t mode6[6][3];
1019 Float_t bratio6[6];
1020
1021 for (Int_t kz = 0; kz < 6; kz++) {
1022 bratio6[kz] = 0.;
1023 mode6[kz][0] = 0;
1024 mode6[kz][1] = 0;
1025 mode6[kz][2] = 0;
1026 }
1027 bratio6[0] = 100.;
1028 mode6[0][0] = 1000010030; // triton
1029 mode6[0][1] = -211; // pion
1030
1031 TVirtualMC::GetMC()->SetDecayMode(1010000030, bratio6, mode6);
1032
1033 // Define the 2-body phase space decay for the Anti-Lambda-Neutron-Neutron
1034 Int_t amode6[6][3];
1035 Float_t abratio6[6];
1036
1037 for (Int_t kz = 0; kz < 6; kz++) {
1038 abratio6[kz] = 0.;
1039 amode6[kz][0] = 0;
1040 amode6[kz][1] = 0;
1041 amode6[kz][2] = 0;
1042 }
1043 abratio6[0] = 100.;
1044 amode6[0][0] = -1000010030; // anti-triton
1045 amode6[0][1] = 211; // pion
1046
1047 TVirtualMC::GetMC()->SetDecayMode(-1010000030, abratio6, amode6);
1048
1049 // Define the 3-body phase space decay for the Omega-Proton
1050 Int_t mode7[6][3];
1051 Float_t bratio7[6];
1052
1053 for (Int_t kz = 0; kz < 6; kz++) {
1054 bratio7[kz] = 0.;
1055 mode7[kz][0] = 0;
1056 mode7[kz][1] = 0;
1057 mode7[kz][2] = 0;
1058 }
1059 bratio7[0] = 100.;
1060 mode7[0][0] = 3122; // Lambda
1061 mode7[0][1] = -321; // negative Kaon
1062 mode7[0][2] = 2212; // proton
1063
1064 TVirtualMC::GetMC()->SetDecayMode(1030000020, bratio7, mode7);
1065
1066 // Define the 3-body phase space decay for the Anti-Omega-Proton
1067 Int_t amode7[6][3];
1068 Float_t abratio7[6];
1069
1070 for (Int_t kz = 0; kz < 6; kz++) {
1071 abratio7[kz] = 0.;
1072 amode7[kz][0] = 0;
1073 amode7[kz][1] = 0;
1074 amode7[kz][2] = 0;
1075 }
1076 abratio7[0] = 100.;
1077 amode7[0][0] = -3122; // anti-Lambda
1078 amode7[0][1] = 321; // positive kaon
1079 amode7[0][2] = -2212; // anti-proton
1080
1081 TVirtualMC::GetMC()->SetDecayMode(-1030000020, abratio7, amode7);
1082
1083 // Define the 2-body phase space decay for the Omega-Neutron
1084 Int_t mode8[6][3];
1085 Float_t bratio8[6];
1086
1087 for (Int_t kz = 0; kz < 6; kz++) {
1088 bratio8[kz] = 0.;
1089 mode8[kz][0] = 0;
1090 mode8[kz][1] = 0;
1091 mode8[kz][2] = 0;
1092 }
1093 bratio8[0] = 100.;
1094 mode8[0][0] = 3122; // Lambda
1095 mode8[0][1] = 3312; // negative Xi
1096
1097 TVirtualMC::GetMC()->SetDecayMode(1030010020, bratio8, mode8);
1098
1099 // Define the 2-body phase space decay for the Anti-Omega-Neutron
1100 Int_t amode8[6][3];
1101 Float_t abratio8[6];
1102
1103 for (Int_t kz = 0; kz < 6; kz++) {
1104 abratio8[kz] = 0.;
1105 amode8[kz][0] = 0;
1106 amode8[kz][1] = 0;
1107 amode8[kz][2] = 0;
1108 }
1109 abratio8[0] = 100.;
1110 amode8[0][0] = -3122; // anti-Lambda
1111 amode8[0][1] = -3312; // positive Xi
1112
1113 TVirtualMC::GetMC()->SetDecayMode(-1030010020, abratio8, amode8);
1114
1115 // Define the 3-body phase space decay for the Omega-Omega
1116 Int_t mode9[6][3];
1117 Float_t bratio9[6];
1118
1119 for (Int_t kz = 0; kz < 6; kz++) {
1120 bratio9[kz] = 0.;
1121 mode9[kz][0] = 0;
1122 mode9[kz][1] = 0;
1123 mode9[kz][2] = 0;
1124 }
1125 bratio9[0] = 100.;
1126 mode9[0][0] = 3334; // negative Omega
1127 mode9[0][1] = 3312; // negative Xi
1128
1129 TVirtualMC::GetMC()->SetDecayMode(1060020020, bratio9, mode9);
1130
1131 // Define the 3-body phase space decay for the Anti-Omega-Omega
1132 Int_t amode9[6][3];
1133 Float_t abratio9[6];
1134
1135 for (Int_t kz = 0; kz < 6; kz++) {
1136 abratio9[kz] = 0.;
1137 amode9[kz][0] = 0;
1138 amode9[kz][1] = 0;
1139 amode9[kz][2] = 0;
1140 }
1141 abratio9[0] = 100.;
1142 amode9[0][0] = -3334; // positive Omega
1143 amode9[0][1] = -3312; // positive Xi
1144
1145 TVirtualMC::GetMC()->SetDecayMode(-1060020020, abratio9, amode9);
1146
1147 // Define the 2- and 3-body phase space decay for the Lambda(1405)-Proton
1148 Int_t mode10[6][3];
1149 Float_t bratio10[6];
1150
1151 for (Int_t kz = 0; kz < 6; kz++) {
1152 bratio10[kz] = 0.;
1153 mode10[kz][0] = 0;
1154 mode10[kz][1] = 0;
1155 mode10[kz][2] = 0;
1156 }
1157 bratio10[0] = 50.;
1158 mode10[0][0] = 3122; // Lambda
1159 mode10[0][1] = 2212; // proton
1160 bratio10[1] = 50.;
1161 mode10[1][0] = 2212; // proton
1162 mode10[1][1] = -321; // negative kaon
1163 mode10[1][2] = 2212; // proton
1164
1165 TVirtualMC::GetMC()->SetDecayMode(1010010021, bratio10, mode10);
1166
1167 // Define the 2- and 3-body phase space decay for the Anti-Lambda(1405)-Proton
1168 Int_t amode10[6][3];
1169 Float_t abratio10[6];
1170
1171 for (Int_t kz = 0; kz < 6; kz++) {
1172 abratio10[kz] = 0.;
1173 amode10[kz][0] = 0;
1174 amode10[kz][1] = 0;
1175 amode10[kz][2] = 0;
1176 }
1177 abratio10[0] = 50.;
1178 amode10[0][0] = -3122; // anti-Lambda
1179 amode10[0][1] = -2212; // anti-proton
1180 abratio10[1] = 50.;
1181 amode10[1][0] = -2212; // anti-proton
1182 amode10[1][1] = 321; // positive kaon
1183 amode10[1][2] = -2212; // anti-proton
1184
1185 TVirtualMC::GetMC()->SetDecayMode(-1010010021, abratio10, amode10);
1186
1187 // Define the 3-body phase space decay for the Lambda(1405)-Lambda(1405)
1188 Int_t mode11[6][3];
1189 Float_t bratio11[6];
1190
1191 for (Int_t kz = 0; kz < 6; kz++) {
1192 bratio11[kz] = 0.;
1193 mode11[kz][0] = 0;
1194 mode11[kz][1] = 0;
1195 mode11[kz][2] = 0;
1196 }
1197 bratio11[0] = 50.;
1198 mode11[0][0] = 3122; // Lambda
1199 mode11[0][1] = 3122; // Lambda
1200 bratio11[1] = 50.;
1201 mode11[1][0] = 3122; // Lambda
1202 mode11[1][1] = 2212; // proton
1203 mode11[1][2] = -211; // negative pion
1204
1205 TVirtualMC::GetMC()->SetDecayMode(1020000021, bratio11, mode11);
1206
1207 // Define the 3-body phase space decay for the Anti-Lambda(1405)-Lambda(1405)
1208 Int_t amode11[6][3];
1209 Float_t abratio11[6];
1210
1211 for (Int_t kz = 0; kz < 6; kz++) {
1212 abratio11[kz] = 0.;
1213 amode11[kz][0] = 0;
1214 amode11[kz][1] = 0;
1215 amode11[kz][2] = 0;
1216 }
1217 abratio11[0] = 50.;
1218 amode11[0][0] = -3122; // anti-Lambda
1219 amode11[0][1] = -3122; // anti-Lambda
1220 abratio11[1] = 50.;
1221 amode11[1][0] = -3122; // anti-Lambda
1222 amode11[1][1] = -2212; // anti-proton
1223 amode11[1][2] = 211; // positive pion
1224
1225 TVirtualMC::GetMC()->SetDecayMode(-1020000021, abratio11, amode11);
1226
1227 // Define the decays for the c-triton
1228 Int_t ctmode[6][3];
1229 Float_t ctbratio[6];
1230
1231 for (Int_t kz = 0; kz < 6; kz++) {
1232 ctbratio[kz] = 0.;
1233 ctmode[kz][0] = 0;
1234 ctmode[kz][1] = 0;
1235 ctmode[kz][2] = 0;
1236 }
1237 ctbratio[0] = 50.;
1238 ctmode[0][0] = 1000020030; // Helium3
1239 ctmode[0][1] = 310; // K0s
1240
1241 ctbratio[1] = 50.;
1242 ctmode[1][0] = 1000020030; // Helium3
1243 ctmode[1][1] = -321; // negative kaon
1244 ctmode[1][2] = 211; // positive pion
1245
1246 TVirtualMC::GetMC()->SetDecayMode(2010010030, ctbratio, ctmode);
1247
1248 // Define the decays for the anti-c-triton
1249 Int_t actmode[6][3];
1250 Float_t actbratio[6];
1251
1252 for (Int_t kz = 0; kz < 6; kz++) {
1253 actbratio[kz] = 0.;
1254 actmode[kz][0] = 0;
1255 actmode[kz][1] = 0;
1256 actmode[kz][2] = 0;
1257 }
1258 actbratio[0] = 50.;
1259 actmode[0][0] = -1000020030; // Helium3
1260 actmode[0][1] = 310; // K0s
1261
1262 actbratio[1] = 50.;
1263 actmode[1][0] = -1000020030; // Helium3
1264 actmode[1][1] = 321; // negative kaon
1265 actmode[1][2] = -211; // positive pion
1266
1267 TVirtualMC::GetMC()->SetDecayMode(-2010010030, actbratio, actmode);
1268
1269 // Define the decays for the c-deuteron
1270 Int_t cdmode[6][3];
1271 Float_t cdbratio[6];
1272
1273 for (Int_t kz = 0; kz < 6; kz++) {
1274 cdbratio[kz] = 0.;
1275 cdmode[kz][0] = 0;
1276 cdmode[kz][1] = 0;
1277 cdmode[kz][2] = 0;
1278 }
1279 cdbratio[0] = 50.;
1280 cdmode[0][0] = 1000010020; // deuteron
1281 cdmode[0][1] = -321; // negative kaon
1282 cdmode[0][2] = 211; // positive pion
1283
1284 cdbratio[1] = 50.;
1285 cdmode[1][0] = 1000010020; // deuteron
1286 cdmode[1][1] = 310; // K0s
1287
1288 TVirtualMC::GetMC()->SetDecayMode(2010010020, cdbratio, cdmode);
1289
1290 // Define the decays for the anti-c-deuteron
1291 Int_t acdmode[6][3];
1292 Float_t acdbratio[6];
1293
1294 for (Int_t kz = 0; kz < 6; kz++) {
1295 acdbratio[kz] = 0.;
1296 acdmode[kz][0] = 0;
1297 acdmode[kz][1] = 0;
1298 acdmode[kz][2] = 0;
1299 }
1300 acdbratio[0] = 50.;
1301 acdmode[0][0] = -1000010020; // deuteron
1302 acdmode[0][1] = 321; // negative kaon
1303 acdmode[0][2] = -211; // positive pion
1304
1305 acdbratio[1] = 50.;
1306 acdmode[1][0] = -1000010020; // deuteron
1307 acdmode[1][1] = 310; // K0s
1308
1309 TVirtualMC::GetMC()->SetDecayMode(-2010010020, acdbratio, acdmode);
1310
1312
1313 // Define the 2-body phase space decay for the f0(980)
1314 // Int_t mode[6][3];
1315 // Float_t bratio[6];
1316
1317 for (Int_t kz = 0; kz < 6; kz++) {
1318 bratio[kz] = 0.;
1319 mode[kz][0] = 0;
1320 mode[kz][1] = 0;
1321 mode[kz][2] = 0;
1322 }
1323 bratio[0] = 100.;
1324 mode[0][0] = 211; // pion
1325 mode[0][1] = -211; // pion
1326
1327 TVirtualMC::GetMC()->SetDecayMode(9010221, bratio, mode);
1328
1329 // Define the 2-body phase space decay for the f2(1270)
1330 // Int_t mode[6][3];
1331 // Float_t bratio[6];
1332
1333 for (Int_t kz = 0; kz < 6; kz++) {
1334 bratio[kz] = 0.;
1335 mode[kz][0] = 0;
1336 mode[kz][1] = 0;
1337 mode[kz][2] = 0;
1338 }
1339 bratio[0] = 100.;
1340 mode[0][0] = 211; // pion
1341 mode[0][1] = -211; // pion
1342
1343 TVirtualMC::GetMC()->SetDecayMode(225, bratio, mode);
1344
1345 // Define the 2-body phase space decay for the resonances: f0(1500), f2(1525), f0(1710
1346 for (Int_t kz = 0; kz < 6; kz++) {
1347 bratio[kz] = 0.;
1348 mode[kz][0] = 0;
1349 mode[kz][1] = 0;
1350 mode[kz][2] = 0;
1351 }
1352 bratio[0] = 100.;
1353 mode[0][0] = 310; // K0s
1354 mode[0][1] = 310; // K0s
1355
1356 TVirtualMC::GetMC()->SetDecayMode(9030221, bratio, mode); // f0(1500)
1357 TVirtualMC::GetMC()->SetDecayMode(335, bratio, mode); // f2(1525)
1358 TVirtualMC::GetMC()->SetDecayMode(10331, bratio, mode); // f0(1710)
1359 TVirtualMC::GetMC()->SetDecayMode(10221, bratio, mode); // f0(1370)
1360 TVirtualMC::GetMC()->SetDecayMode(115, bratio, mode); // a2(1320)
1361
1362 // Define the 3-body phase space decay for the resonances: f1(1285), f1(1420)
1363 for (Int_t kz = 0; kz < 6; kz++) {
1364 bratio[kz] = 0.;
1365 mode[kz][0] = 0;
1366 mode[kz][1] = 0;
1367 mode[kz][2] = 0;
1368 }
1369
1370 bratio2[0] = 50.;
1371 mode[0][0] = 310; // K0s
1372 mode[0][1] = -321; // anti-K
1373 mode[0][2] = 211; // pion+
1374
1375 bratio2[1] = 50.;
1376 mode[1][0] = 310; // K0s
1377 mode[1][1] = 321; // K
1378 mode[1][2] = -211; // pion-
1379
1380 TVirtualMC::GetMC()->SetDecayMode(20223, bratio2, mode); // f1(1285)
1381 TVirtualMC::GetMC()->SetDecayMode(20333, bratio2, mode); // f1(1420)
1382
1383 // Lambda1520/Lambda1520bar
1384
1385 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);
1386 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);
1387
1388 // Lambda1520 decay modes
1389 Int_t lmode[9][3];
1390 Float_t lbratio[9];
1391 for (Int_t kz = 0; kz < 9; kz++) {
1392 lbratio[kz] = 0.;
1393 lmode[kz][0] = 0;
1394 lmode[kz][1] = 0;
1395 lmode[kz][2] = 0;
1396 }
1397
1398 // L(1520) -> p K-
1399 lbratio[0] = 0.229944;
1400 lmode[0][0] = 2212;
1401 lmode[0][1] = -321;
1402
1403 // L(1520) -> n K0
1404 lbratio[1] = 0.229944;
1405 lmode[1][0] = 2112;
1406 lmode[1][1] = -311;
1407
1408 // L(1520) -> Sigma+ pi-
1409 lbratio[2] = 0.143076;
1410 lmode[2][0] = 3222;
1411 lmode[2][1] = -211;
1412
1413 // L(1520) -> Sigma0 pi0
1414 lbratio[3] = 0.143076;
1415 lmode[3][0] = 3212;
1416 lmode[3][1] = 111;
1417
1418 // L(1520) -> Sigma- pi+
1419 lbratio[4] = 0.143076;
1420 lmode[4][0] = 3112;
1421 lmode[4][1] = 211;
1422
1423 // L(1520) -> Sigma*- pi+
1424 lbratio[5] = 0.034066;
1425 lmode[5][0] = 3114;
1426 lmode[5][1] = 211;
1427
1428 // L(1520) -> Sigma*0 pi0
1429 lbratio[6] = 0.034066;
1430 lmode[6][0] = 3214;
1431 lmode[6][1] = 111;
1432
1433 // L(1520) -> Sigma*+ pi-
1434 lbratio[7] = 0.034066;
1435 lmode[7][0] = 3224;
1436 lmode[7][1] = -211;
1437
1438 // L(1520) -> Lambda gamma
1439 lbratio[8] = 0.008687;
1440 lmode[8][0] = 3122;
1441 lmode[8][1] = 22;
1442
1443 TVirtualMC::GetMC()->SetDecayMode(102134, lbratio, lmode);
1444
1445 // Lambda1520bar decay modes
1446
1447 // L(1520)bar -> p- K+
1448 lbratio[0] = 0.229944;
1449 lmode[0][0] = -2212;
1450 lmode[0][1] = 321;
1451
1452 // L(1520)bar -> nbar K0bar
1453 lbratio[1] = 0.229944;
1454 lmode[1][0] = -2112;
1455 lmode[1][1] = 311;
1456
1457 // L(1520)bar -> Sigmabar- pi+
1458 lbratio[2] = 0.143076;
1459 lmode[2][0] = -3222;
1460 lmode[2][1] = 211;
1461
1462 // L(1520)bar -> Sigma0bar pi0
1463 lbratio[3] = 0.143076;
1464 lmode[3][0] = -3212;
1465 lmode[3][1] = 111;
1466
1467 // L(1520)bar -> Sigmabar+ pi-
1468 lbratio[4] = 0.143076;
1469 lmode[4][0] = -3112;
1470 lmode[4][1] = -211;
1471
1472 // L(1520)bar -> anti-Sigma*- pi-
1473 lbratio[5] = 0.034066;
1474 lmode[5][0] = -3114;
1475 lmode[5][1] = -211;
1476
1477 // L(1520)bar -> anti-Sigma*0 pi0
1478 lbratio[6] = 0.034066;
1479 lmode[6][0] = -3214;
1480 lmode[6][1] = 111;
1481
1482 // L(1520)bar -> anti-Sigma*+ pi+
1483 lbratio[7] = 0.034066;
1484 lmode[7][0] = -3224;
1485 lmode[7][1] = 211;
1486
1487 // L(1520)bar -> Anti-Lambda gamma
1488 lbratio[8] = 0.008687;
1489 lmode[8][0] = -3122;
1490 lmode[8][1] = 22;
1491
1492 TVirtualMC::GetMC()->SetDecayMode(-102134, lbratio, lmode);
1493
1494 // --------------------------------------------------------------------
1495
1496 //Sexaquark (uuddss): compact, neutral and stable hypothetical bound state (arxiv.org/abs/1708.08951)
1497 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);
1498 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);
1499}
1500
1502{
1503 // dispatch first to function in FairRoot
1504 FairMCApplication::AddParticles();
1505
1506 // register special particles for ALICE
1507 // TODO: try to make use of FairRoot if easier or more customizable
1509
1511 LOG(info) << "Printing \'SimUserDecay\' parameters";
1512 LOG(info) << param;
1513
1514 // check if there are PDG codes requested for user decay
1515 if (param.pdglist.empty()) {
1516 return;
1517 }
1518
1519 // loop over PDG codes in the string
1520 std::stringstream ss(param.pdglist);
1521 int pdg;
1522 while (ss >> pdg) {
1523 LOG(info) << "Setting user decay for PDG " << pdg;
1524 TVirtualMC::GetMC()->SetUserDecay(pdg);
1525 }
1526}
1527
1529{
1531 LOG(info) << "Initializing the hook for TrackReferences during stepping";
1532 auto expandedTrackRefHookFileName = o2::utils::expandShellVarsInFileName(mCutParams.stepTrackRefHookFile);
1533 if (std::filesystem::exists(expandedTrackRefHookFileName)) {
1534 // if this file exists we will compile the hook on the fly
1535 mTrackRefFcn = o2::conf::GetFromMacro<TrackRefFcn>(mCutParams.stepTrackRefHookFile, "trackRefHook()", "o2::steer::O2MCApplicationBase::TrackRefFcn", "o2mc_stepping_trackref_hook");
1536 LOG(info) << "Hook initialized from file " << expandedTrackRefHookFileName;
1537 } else {
1538 LOG(error) << "Did not file TrackRefHook file " << expandedTrackRefHookFileName << " ; Will not execute hook";
1539 mTrackRefFcn = [](TVirtualMC const*) {}; // do nothing
1540 }
1541 }
1542}
1543
1545{
1547 for (auto det : listActiveDetectors) {
1548 if (dynamic_cast<o2::base::Detector*>(det)) {
1549 ((o2::base::Detector*)det)->initializeLate();
1550 }
1551 }
1552}
1553
1554void O2MCApplication::attachSubEventInfo(fair::mq::Parts& parts, o2::data::SubEventInfo const& info) const
1555{
1556 // parts.AddPart(std::move(mSimDataChannel->NewSimpleMessage(info)));
1558}
1559
1560// helper function to fetch data from FairRootManager branch and serialize it
1561// returns handle to container
1562template <typename T>
1563const T* attachBranch(std::string const& name, fair::mq::Channel& channel, fair::mq::Parts& parts)
1564{
1565 auto mgr = FairRootManager::Instance();
1566 // check if branch is present
1567 if (mgr->GetBranchId(name) == -1) {
1568 LOG(error) << "Branch " << name << " not found";
1569 return nullptr;
1570 }
1571 auto data = mgr->InitObjectAs<const T*>(name.c_str());
1572 if (data) {
1573 o2::base::attachTMessage(*data, channel, parts);
1574 }
1575 return data;
1576}
1577
1579{
1580 mSubEventInfo = i;
1581 // being communicated a SubEventInfo also means we get a FairMCEventHeader
1582 fMCEventHeader = &mSubEventInfo->mMCEventHeader;
1583}
1584
1586{
1587 fair::mq::Parts simdataparts;
1588
1589 // fill these parts ... the receiver has to unpack similary
1590 // TODO: actually we could just loop over branches in FairRootManager at this moment?
1591 mSubEventInfo->npersistenttracks = static_cast<o2::data::Stack*>(GetStack())->getMCTracks()->size();
1592 mSubEventInfo->nprimarytracks = static_cast<o2::data::Stack*>(GetStack())->GetNprimary();
1593 attachSubEventInfo(simdataparts, *mSubEventInfo);
1594 auto tracks = attachBranch<std::vector<o2::MCTrack>>("MCTrack", *mSimDataChannel, simdataparts);
1595 attachBranch<std::vector<o2::TrackReference>>("TrackRefs", *mSimDataChannel, simdataparts);
1596 assert(tracks->size() == mSubEventInfo->npersistenttracks);
1597
1598 for (auto det : listActiveDetectors) {
1599 if (dynamic_cast<o2::base::Detector*>(det)) {
1600 ((o2::base::Detector*)det)->attachHits(*mSimDataChannel, simdataparts);
1601 }
1602 }
1603 LOG(info) << "sending message with " << simdataparts.Size() << " parts";
1604 mSimDataChannel->Send(simdataparts);
1605}
1606} // namespace steer
1607} // namespace o2
Definition of the Detector class.
int32_t i
Definition of the Names Generator class.
uint32_t j
Definition RawData.h:0
static std::vector< int > const & getDetId2HitBitIndex()
Definition Detector.h:221
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
static SimConfig & Instance()
Definition SimConfig.h:111
static constexpr int nameToID(char const *name, int id=First)
Definition DetID.h:154
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
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:266
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 stepTrackRefHookFile
Definition SimParams.h:27
o2::dataformats::MCEventHeader mMCEventHeader
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"