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
7384bool 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