Skip to content

Commit 6a7d7ca

Browse files
author
Chiara De Martin
committed
add macro in tests
1 parent 2a67a48 commit 6a7d7ca

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

MC/config/PWGLF/ini/GeneratorDoubleLambdaTriggered.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[GeneratorExternal]
22
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_doubleLambdas.C
3-
#fileName=/home/chdemart/O2Container/O2DPG/MC/config/PWGLF/pythia8/generator_pythia8_doubleLambdas.C
43
funcName=generateDoubleLambda(4, 0.2, 10, 0.8)
54

65
[GeneratorPythia8]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie()) {
6+
std::cerr << "Cannot open ROOT file " << path << "\n";
7+
return 1;
8+
}
9+
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree) {
12+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
13+
return 1;
14+
}
15+
std::vector<o2::MCTrack> *tracks{};
16+
tree->SetBranchAddress("MCTrack", &tracks);
17+
18+
auto nLambda = tree->Scan("MCTrack.GetPdgCode()", "TMath::Abs(MCTrack.GetPdgCode()) == 3122");
19+
20+
if (nLambda == 0) {
21+
std::cerr << "No event of interest\n";
22+
return 1;
23+
}
24+
return 0;
25+
}

0 commit comments

Comments
 (0)