Skip to content

Commit 21ec6c2

Browse files
author
Francesco Mazzaschi
committed
Fix loop + copyright
1 parent d9d0aff commit 21ec6c2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Generators/include/Generators/NuclCoalescencePythia8.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
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+
112
#ifndef O2_COALESCENCE_H
213
#define O2_COALESCENCE_H
314

@@ -73,10 +84,9 @@ bool coalPythia8(Pythia8::Event& event, int charge, int pdgCode, float mass, dou
7384
bool CoalAfterburner(Pythia8::Event& event, std::vector<unsigned int> inputPdgList = {}, double coalMomentum = 0.4, int firstDauID = -1, int lastDauId = -1)
7485
{
7586
const double coalescenceRadius{0.5 * 1.122462 * coalMomentum};
76-
7787
// if coalescence from a heavy hadron, loop only between firstDauID and lastDauID
7888
int loopStart = firstDauID > 0 ? firstDauID : 0;
79-
int loopEnd = lastDauId > 0 ? lastDauId : event.size();
89+
int loopEnd = lastDauId > 0 ? lastDauId : event.size() - 1;
8090
// fill the nuclear mask
8191
uint8_t nuclearMask = 0;
8292
for (auto nuclPdg : inputPdgList) {
@@ -97,7 +107,7 @@ bool CoalAfterburner(Pythia8::Event& event, std::vector<unsigned int> inputPdgLi
97107
}
98108
// fill nucleon pools
99109
std::vector<int> protons[2], neutrons[2], lambdas[2];
100-
for (auto iPart{loopStart}; iPart < loopEnd; ++iPart) {
110+
for (auto iPart{loopStart}; iPart <= loopEnd; ++iPart) {
101111
if (std::abs(event[iPart].y()) > 1.) // skip particles with y > 1
102112
{
103113
continue;

0 commit comments

Comments
 (0)