Skip to content

Commit 556e374

Browse files
committed
Modify test accordingly
1 parent 97e1ffd commit 556e374

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

MC/config/PWGHF/ini/tests/GeneratorHF_D2H_bbbar_Mode2_OmegaC_NoDecay.C

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ int External() {
44
int checkPdgQuarkOne = 5;
55

66
int checkPdgHadron{4332};
7-
int checkHadronDecays{3334};
7+
int checkHadronDecays{0};
88

99
TFile file(path.c_str(), "READ");
1010
if (file.IsZombie()) {
@@ -19,7 +19,7 @@ int External() {
1919
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
2020

2121
int nEventsInj{};
22-
int nQuarks{}, nSignals{}, nSignalGoodDecay{};
22+
int nQuarks{}, nSignals{};
2323
auto nEvents = tree->GetEntries();
2424

2525
for (int i = 0; i < nEvents; i++) {
@@ -44,10 +44,8 @@ int External() {
4444
nSignals++; // count signal PDG
4545

4646
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) {
47-
auto pdgDau = tracks->at(j).GetPdgCode();
48-
if (std::abs(pdgDau) == checkHadronDecays) {
49-
nSignalGoodDecay;
50-
break;
47+
if (j >= 0) {
48+
checkHadronDecays += 1;
5149
}
5250
}
5351
}
@@ -59,7 +57,7 @@ int External() {
5957
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuark) << nEventsInj << "\n";
6058
std::cout << Form("# %d (anti)quarks: ", checkPdgQuark) << nQuarks << "\n";
6159
std::cout <<"# signal hadrons: " << nSignals << "\n";
62-
std::cout <<"# signal hadrons decaying in the correct channel: " << nSignalGoodDecay << "\n";
60+
std::cout <<"# signal hadrons decaying : " << checkHadronDecays << "\n";
6361

6462
if (nEventsInj < nEvents) {
6563
std::cerr << "Number of generated events with triggered events different than expected\n";
@@ -76,9 +74,8 @@ int External() {
7674
return 1;
7775
}
7876

79-
float fracForcedDecays = float(nSignalGoodDecay) / nSignals;
80-
if (fracForcedDecays < 0.9) { // we put some tolerance (it should not happen, but to be conservative)
81-
std::cerr << "Fraction of signals decaying into the correct channel " << fracForcedDecays << " lower than expected\n";
77+
if (checkHadronDecays > 0) {
78+
std::cerr << "Decayed OmegaC, it should never decay\n";
8279
return 1;
8380
}
8481

0 commit comments

Comments
 (0)