Skip to content

Commit 1109b4a

Browse files
author
jokonig
committed
implement comments from Marvin
1 parent 406de46 commit 1109b4a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎PWGEM/PhotonMeson/Tasks/mesonSignalLoss.cxx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ struct MesonSignalLoss {
176176
if (multiplicityEstimator == kCentralBarrel) {
177177
decision = std::abs(eta) < 0.8f; // o2-linter: disable=magic-number (rapidity range of central barrel)
178178
} else if (multiplicityEstimator == kFT0A) {
179-
decision = 3.3f < eta && eta < 5.0f; // o2-linter: disable=magic-number (rapidity range of FT0)
179+
decision = 3.5f < eta && eta < 4.9f; // o2-linter: disable=magic-number (rapidity range of FT0)
180180
} else if (multiplicityEstimator == kFT0C) {
181181
decision = -3.3f < eta && eta < -2.1f; // o2-linter: disable=magic-number (rapidity range of FT0)
182182
}
@@ -186,7 +186,7 @@ struct MesonSignalLoss {
186186
/// \brief Counts charged physical-primary particles in the configured eta range.
187187
/// \param[in] particles Particles to include in the multiplicity count.
188188
/// \return Number of charged physical-primary particles in range.
189-
template <typename TParticles>
189+
template <soa::is_table TParticles>
190190
int countTrueMultiplicity(TParticles const& particles) const
191191
{
192192
int multiplicity = 0;
@@ -210,6 +210,8 @@ struct MesonSignalLoss {
210210
{
211211
std::vector<int64_t> particlesToCheck{particle.globalIndex()};
212212
std::unordered_set<int64_t> checkedParticles;
213+
auto currentParticle = mcParticles.begin();
214+
auto mother = mcParticles.begin();
213215

214216
while (!particlesToCheck.empty()) {
215217
const auto particleIndex = particlesToCheck.back();
@@ -218,7 +220,7 @@ struct MesonSignalLoss {
218220
continue;
219221
}
220222

221-
const auto currentParticle = mcParticles.iteratorAt(particleIndex);
223+
currentParticle.setCursor(particleIndex);
222224
const auto process = currentParticle.getProcess();
223225
const bool fromDecay = currentParticle.producedByGenerator() || process == TMCProcess::kPDecay || process == TMCProcess::kPRadDecay;
224226
if (!currentParticle.producedByGenerator() && !fromDecay) {
@@ -229,7 +231,7 @@ struct MesonSignalLoss {
229231
if (motherIndex < 0 || motherIndex >= mcParticles.size()) {
230232
continue;
231233
}
232-
const auto mother = mcParticles.iteratorAt(motherIndex);
234+
mother.setCursor(motherIndex);
233235
const float decayLength = std::sqrt(std::pow(currentParticle.vx() - mother.vx(), 2) + std::pow(currentParticle.vy() - mother.vy(), 2) + std::pow(currentParticle.vz() - mother.vz(), 2));
234236
if (fromDecay && decayLength > particleConfig.cfgSecondaryDecayLength.value) {
235237
return true;
@@ -246,7 +248,7 @@ struct MesonSignalLoss {
246248
/// \param[in] selectionStage First selection stage to fill.
247249
/// \param[in] selectionStageMax Last selection stage to fill.
248250
/// \param[in] trueMultiplicity True charged-particle multiplicity of the collision.
249-
template <typename TParticles>
251+
template <soa::is_table TParticles>
250252
void fillGeneratedParticles(TParticles const& particlesInMCCollision, aod::McParticles const& mcParticles, int selectionStage, int selectionStageMax, int trueMultiplicity)
251253
{
252254
if (selectionStageMax < selectionStage) {

0 commit comments

Comments
 (0)