Skip to content

Commit 20d74ef

Browse files
committed
test file to check error
1 parent a854274 commit 20d74ef

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎MC/config/PWGDQ/ini/tests/Generator_InjectedCoherentCharmoniaFwdy_PbPb5TeV.C‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ int External() {
5858
}
5959
int child0Id = track.getFirstDaughterTrackId();
6060
int child1Id = track.getLastDaughterTrackId();
61+
if (child0Id < 0 || child1Id < child0Id ||
62+
child1Id >= static_cast<int>(tracks->size())) {
63+
std::cout << "Skip charmonium without valid daughters:"
64+
<< " pdg=" << pdg
65+
<< " mother=" << idMoth
66+
<< " firstDaughter=" << child0Id
67+
<< " lastDaughter=" << child1Id
68+
<< " y=" << rapidity << '\n';
69+
continue;
70+
}
71+
6172
for (int iDaugh = child0Id; iDaugh <= child1Id; iDaugh++) {
6273
auto daugh = tracks->at(iDaugh);
6374
if (daugh.GetPdgCode() == 22) {

0 commit comments

Comments
 (0)