Skip to content

Commit 4ac7170

Browse files
committed
fix CI error
1 parent eb7372c commit 4ac7170

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

MC/config/ALICE3/ini/tests/xi_PbPb.C

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
int External()
22
{
3-
std::string path = "o2sim_Kine.root";
3+
std::string path{"o2sim_Kine.root"};
44
int pdgToCheck = 3312;
55

66
TFile file(path.c_str(), "read");
@@ -11,8 +11,14 @@ int External()
1111

1212
int nInjectedParticles = 0;
1313
TTree* tree = (TTree*)file.Get("o2sim");
14-
std::vector<o2::MCTrack>* tracks{};
15-
tree->SetBranchAdress("MCTrack", &tracks)
14+
15+
if (!tree) {
16+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
17+
return 1;
18+
}
19+
20+
std::vector<o2::MCTrack> *tracks{};
21+
tree->SetBranchAddress("MCTrack", &tracks);
1622

1723
int nEvents = tree->GetEntries();
1824
for (int i = 0; i < nEvents; i++) {
@@ -27,10 +33,14 @@ int External()
2733
}
2834

2935
if (nInjectedParticles < nEvents) {
30-
// Check that we are correctly injecting one
36+
// Check that we are correctly injecting 15
3137
// particle per event
3238
return 1;
3339
}
3440

3541
return 0;
36-
}
42+
}
43+
44+
45+
46+

MC/config/ALICE3/ini/tests/xi_pp.C

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
int External()
22
{
3-
std::string path = "o2sim_Kine.root";
3+
std::string path{"o2sim_Kine.root"};
44
int pdgToCheck = 3312;
55

66
TFile file(path.c_str(), "read");
@@ -11,8 +11,14 @@ int External()
1111

1212
int nInjectedParticles = 0;
1313
TTree* tree = (TTree*)file.Get("o2sim");
14-
std::vector<o2::MCTrack>* tracks;
15-
tree->SetBranchAdress("MCTrack", &tracks)
14+
15+
if (!tree) {
16+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
17+
return 1;
18+
}
19+
20+
std::vector<o2::MCTrack> *tracks{};
21+
tree->SetBranchAddress("MCTrack", &tracks);
1622

1723
int nEvents = tree->GetEntries();
1824
for (int i = 0; i < nEvents; i++) {
@@ -27,10 +33,14 @@ int External()
2733
}
2834

2935
if (nInjectedParticles < nEvents) {
30-
// Check that we are correctly injecting 15
36+
// Check that we are correctly injecting one
3137
// particle per event
3238
return 1;
3339
}
3440

3541
return 0;
3642
}
43+
44+
45+
46+

0 commit comments

Comments
 (0)