Project
Loading...
Searching...
No Matches
GeneratorKrDecay.h
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
15
16#ifndef ALICEO2_TPC_GeneratorKrDecay_H_
17#define ALICEO2_TPC_GeneratorKrDecay_H_
18
20#include <array>
21#include <memory>
22#include <vector>
23
24namespace o2::tpc
25{
26
33{
34 public:
35 struct Product {
36 int pdg;
37 double eKin;
38 };
39 struct Channel {
40 double fraction;
42 Product products[6]; // max 5 used; 6 for safety
43 };
44 // Eight physically motivated channels (T1 mode x T2 mode):
45 // T1: ICC_total=2035 -> 99.951% IC (75.163% outer-shell, 24.788% K-shell), 0.049% gamma
46 // K-shell: 65.2% K-fluorescence (Kalpha), 34.8% K-Auger
47 // T2: ICC_total=17.09 -> 94.472% IC, 5.528% gamma
48 // Source: G4 PhotonEvaporation5.7/z36.a83, RadioactiveDecay5.6/z36.a83
49 static const int kNChannels = 8;
53 const Channel& sample() const;
54
55 private:
56 // Parse $G4LEVELGAMMADATA/z36.a83. Returns true and fills five values
57 // (energies in keV) on success.
58 static bool parseG4PhotonEvap(const char* path, double& E_T1, double& ICC_T1,
59 double& Kfrac_T1, double& E_T2, double& ICC_T2);
60};
61
62} // namespace o2::tpc
63
64namespace o2::eventgen
65{
66
72{
73 public:
76 Bool_t Init() override;
77 Bool_t generateEvent() override;
78 Bool_t importParticles() override;
79
80 private:
81 static constexpr double kRInner = 83.5;
82 static constexpr double kROuter = 246.5; // TPC outermost pad row outer edge ~247 cm; stay inside
83 static constexpr double kHalfZ = 249.7;
84
85 // O2 status encoding from MCGenProperties.h
86 // bits 0-8: hepmc(9), bits 9-18: gen(10), bits 19-28: reserved(10), bits 29-31: sentinel=5
87 static int krO2EncodedStatus(int hepmc, int gen = 0);
88
89 int mNPerEvent = 1000; // Kr decays per event; overridable at runtime via KR_N_PER_EVENT env var
90 std::unique_ptr<o2::tpc::KrDecayTable> mTable;
91 std::vector<std::array<double, 3>> mVertices;
92 // No ClassDefOverride: the base Generator class's dictionary is sufficient
93 // for a runtime-only generator that is never streamed via ROOT I/O
94 // (matches o2::eventgen::GeneratorGeantinos and other Generator subclasses).
95};
96
97} // namespace o2::eventgen
98
99#endif // ALICEO2_TPC_GeneratorKrDecay_H_
default_random_engine gen(dev())
double cumulative[kNChannels]
const Channel & sample() const
static const int kNChannels
Channel channels[kNChannels]
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
Global TPC definitions and constants.
Definition SimTraits.h:172