Skip to content

Commit a7ef9ba

Browse files
committed
Add Xi0, Sigma+, and Sigma- to otf decayer
1 parent a08c4af commit a7ef9ba

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,18 @@
4747
using namespace o2;
4848
using namespace o2::framework;
4949

50-
static constexpr int NumDecays = 7;
50+
static constexpr int NumDecays = 12;
5151
static constexpr int NumParameters = 1;
52-
static constexpr int DefaultParameters[NumDecays][NumParameters]{{1}, {1}, {1}, {1}, {1}, {1}, {1}};
52+
static constexpr std::array<std::array<int, NumParameters>, NumDecays> DefaultParameters{{{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}};
5353
static const std::vector<std::string> parameterNames{"enable"};
5454
static const std::vector<std::string> particleNames{"K0s",
5555
"Lambda",
5656
"Anti-Lambda",
57+
"SigmaPlus",
58+
"Anti-SigmaPlus",
59+
"SigmaMinus",
60+
"Anti-SigmaMinus",
61+
"Xi0",
5762
"Xi",
5863
"Anti-Xi",
5964
"Omega",
@@ -62,6 +67,11 @@ static const std::vector<std::string> particleNames{"K0s",
6267
static const std::vector<int> pdgCodes{PDG_t::kK0Short,
6368
PDG_t::kLambda0,
6469
PDG_t::kLambda0Bar,
70+
PDG_t::kSigmaPlus,
71+
PDG_t::kSigmaBarMinus,
72+
PDG_t::kSigmaMinus,
73+
PDG_t::kSigmaBarPlus,
74+
o2::constants::physics::kXi0,
6575
PDG_t::kXiMinus,
6676
PDG_t::kXiPlusBar,
6777
PDG_t::kOmegaMinus,
@@ -78,13 +88,13 @@ struct OnTheFlyDecayer {
7888
Produces<aod::OTFDecayerBits> tableOTFDecayerBits;
7989

8090
o2::upgrade::Decayer decayer;
81-
Service<o2::framework::O2DatabasePDG> pdgDB;
91+
Service<o2::framework::O2DatabasePDG> pdgDB{};
8292
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
8393

8494
Configurable<int> seed{"seed", 0, "Set seed for particle decayer"};
8595
Configurable<float> magneticField{"magneticField", 20., "Magnetic field (kG)"};
8696
Configurable<LabeledArray<int>> enabledDecays{"enabledDecays",
87-
{DefaultParameters[0], NumDecays, NumParameters, particleNames, parameterNames},
97+
{DefaultParameters[0].data(), NumDecays, NumParameters, particleNames, parameterNames},
8898
"Enable option for particle to be decayed: 0 - no, 1 - yes"};
8999

90100
std::size_t indexOffset = 0;
@@ -99,7 +109,7 @@ struct OnTheFlyDecayer {
99109
decayer.setSeed(seed);
100110
decayer.setBField(magneticField);
101111
for (int i = 0; i < NumDecays; ++i) {
102-
if (enabledDecays->get(particleNames[i].c_str(), "enable")) {
112+
if (enabledDecays->get(particleNames[i].c_str(), "enable") != 0) {
103113
LOG(info) << " --- Decay enabled: " << pdgCodes[i];
104114
mEnabledDecays.push_back(pdgCodes[i]);
105115
}
@@ -146,9 +156,9 @@ struct OnTheFlyDecayer {
146156

147157
const float decayRadius = decayer.getDecayRadius();
148158
const float trackVelocity = o2::upgrade::computeParticleVelocity(particle.p(), pdgDB->GetParticle(particle.pdgCode())->Mass());
149-
const int charge = pdgDB->GetParticle(particle.pdgCode())->Charge() / 3;
159+
const int charge = static_cast<int>(pdgDB->GetParticle(particle.pdgCode())->Charge() / 3);
150160
float trackLength{-1.f};
151-
if (!charge) {
161+
if (charge == 0) {
152162
const float dx = particle.vx() - decayer.getSecondaryVertexX();
153163
const float dy = particle.vy() - decayer.getSecondaryVertexY();
154164
const float dz = particle.vz() - decayer.getSecondaryVertexZ();

0 commit comments

Comments
 (0)