Skip to content

Commit 738d936

Browse files
authored
[ALICE3] Add Xi0 and charged Sigma to otf decayer (#17184)
1 parent a585e73 commit 738d936

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ALICE3/Core/TrackUtilities.h"
2121
#include "ALICE3/DataModel/tracksAlice3.h"
2222

23+
#include <CommonConstants/PhysicsConstants.h>
2324
#include <Framework/AnalysisDataModel.h>
2425
#include <Framework/AnalysisHelpers.h>
2526
#include <Framework/AnalysisTask.h>
@@ -47,13 +48,19 @@
4748
using namespace o2;
4849
using namespace o2::framework;
4950

50-
static constexpr int NumDecays = 7;
51+
static constexpr int NumDecays = 13;
5152
static constexpr int NumParameters = 1;
52-
static constexpr int DefaultParameters[NumDecays][NumParameters]{{1}, {1}, {1}, {1}, {1}, {1}, {1}};
53+
static constexpr std::array<std::array<int, NumParameters>, NumDecays> DefaultParameters{{{1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}, {1}}};
5354
static const std::vector<std::string> parameterNames{"enable"};
5455
static const std::vector<std::string> particleNames{"K0s",
5556
"Lambda",
5657
"Anti-Lambda",
58+
"SigmaPlus",
59+
"Anti-SigmaPlus",
60+
"SigmaMinus",
61+
"Anti-SigmaMinus",
62+
"Xi0",
63+
"Anti-Xi0",
5764
"Xi",
5865
"Anti-Xi",
5966
"Omega",
@@ -62,6 +69,12 @@ static const std::vector<std::string> particleNames{"K0s",
6269
static const std::vector<int> pdgCodes{PDG_t::kK0Short,
6370
PDG_t::kLambda0,
6471
PDG_t::kLambda0Bar,
72+
PDG_t::kSigmaPlus,
73+
PDG_t::kSigmaBarMinus,
74+
PDG_t::kSigmaMinus,
75+
PDG_t::kSigmaBarPlus,
76+
o2::constants::physics::kXi0,
77+
-o2::constants::physics::kXi0,
6578
PDG_t::kXiMinus,
6679
PDG_t::kXiPlusBar,
6780
PDG_t::kOmegaMinus,
@@ -78,13 +91,13 @@ struct OnTheFlyDecayer {
7891
Produces<aod::OTFDecayerBits> tableOTFDecayerBits;
7992

8093
o2::upgrade::Decayer decayer;
81-
Service<o2::framework::O2DatabasePDG> pdgDB;
94+
Service<o2::framework::O2DatabasePDG> pdgDB{};
8295
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
8396

8497
Configurable<int> seed{"seed", 0, "Set seed for particle decayer"};
8598
Configurable<float> magneticField{"magneticField", 20., "Magnetic field (kG)"};
8699
Configurable<LabeledArray<int>> enabledDecays{"enabledDecays",
87-
{DefaultParameters[0], NumDecays, NumParameters, particleNames, parameterNames},
100+
{DefaultParameters[0].data(), NumDecays, NumParameters, particleNames, parameterNames},
88101
"Enable option for particle to be decayed: 0 - no, 1 - yes"};
89102

90103
std::size_t indexOffset = 0;
@@ -99,7 +112,7 @@ struct OnTheFlyDecayer {
99112
decayer.setSeed(seed);
100113
decayer.setBField(magneticField);
101114
for (int i = 0; i < NumDecays; ++i) {
102-
if (enabledDecays->get(particleNames[i].c_str(), "enable")) {
115+
if (enabledDecays->get(particleNames[i].c_str(), "enable") != 0) {
103116
LOG(info) << " --- Decay enabled: " << pdgCodes[i];
104117
mEnabledDecays.push_back(pdgCodes[i]);
105118
}
@@ -146,9 +159,9 @@ struct OnTheFlyDecayer {
146159

147160
const float decayRadius = decayer.getDecayRadius();
148161
const float trackVelocity = o2::upgrade::computeParticleVelocity(particle.p(), pdgDB->GetParticle(particle.pdgCode())->Mass());
149-
const int charge = pdgDB->GetParticle(particle.pdgCode())->Charge() / 3;
162+
const int charge = static_cast<int>(pdgDB->GetParticle(particle.pdgCode())->Charge() / 3);
150163
float trackLength{-1.f};
151-
if (!charge) {
164+
if (charge == 0) {
152165
const float dx = particle.vx() - decayer.getSecondaryVertexX();
153166
const float dy = particle.vy() - decayer.getSecondaryVertexY();
154167
const float dz = particle.vz() - decayer.getSecondaryVertexZ();

0 commit comments

Comments
 (0)