File tree Expand file tree Collapse file tree 4 files changed +104
-0
lines changed
Expand file tree Collapse file tree 4 files changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ int External ()
2+ {
3+ std ::string path {"o2sim_Kine.root" };
4+ int pdgToCheck = 3312 ;
5+
6+ TFile file (path .c_str (), "read ");
7+ if (file .IsZombie ()) {
8+ std ::cerr << "Cannot open ROOT file " << path << std ::endl ;
9+ return 1 ;
10+ }
11+
12+ int nInjectedParticles = 0 ;
13+ TTree * tree = (TTree * )file .Get ("o2sim" );
14+
15+ if (!tree ) {
16+ std ::cerr << "Cannot find tree o2sim in file " << path << std ::endl ;
17+ return 1 ;
18+ }
19+
20+ std ::vector < o2 ::MCTrack > * tracks {};
21+ tree -> SetBranchAddress ("MCTrack" , & tracks );
22+
23+ int nEvents = tree -> GetEntries ();
24+ for (int i = 0 ; i < nEvents ; i ++ ) {
25+ tree -> GetEntry (i );
26+ for (auto& track : * tracks ) {
27+ auto pdgCode = track .GetPdgCode ();
28+ if (pdgCode == pdgToCheck ) {
29+ // not injecting anti-particle
30+ nInjectedParticles ++ ;
31+ }
32+ }
33+ }
34+
35+ if (nInjectedParticles < nEvents ) {
36+ // Check that we are correctly injecting 15
37+ // particle per event
38+ return 1 ;
39+ }
40+
41+ return 0 ;
42+ }
43+
44+
45+
46+
Original file line number Diff line number Diff line change 1+ int External ()
2+ {
3+ std ::string path {"o2sim_Kine.root" };
4+ int pdgToCheck = 3312 ;
5+
6+ TFile file (path .c_str (), "read ");
7+ if (file .IsZombie ()) {
8+ std ::cerr << "Cannot open ROOT file " << path << std ::endl ;
9+ return 1 ;
10+ }
11+
12+ int nInjectedParticles = 0 ;
13+ TTree * tree = (TTree * )file .Get ("o2sim" );
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 );
22+
23+ int nEvents = tree -> GetEntries ();
24+ for (int i = 0 ; i < nEvents ; i ++ ) {
25+ tree -> GetEntry (i );
26+ for (auto& track : * tracks ) {
27+ auto pdgCode = track .GetPdgCode ();
28+ if (pdgCode == pdgToCheck ) {
29+ // not injecting anti-particle
30+ nInjectedParticles ++ ;
31+ }
32+ }
33+ }
34+
35+ if (nInjectedParticles < nEvents ) {
36+ // Check that we are correctly injecting one
37+ // particle per event
38+ return 1 ;
39+ }
40+
41+ return 0 ;
42+ }
43+
44+
45+
46+
Original file line number Diff line number Diff line change 1+ [GeneratorExternal]
2+ fileName =${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_gun_PbPb.C
3+ funcName =generateNativeXi()
4+
5+ [GeneratorPythia8]
6+ config =${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/config_custom_xicc.cfg
Original file line number Diff line number Diff line change 1+ [GeneratorExternal]
2+ fileName =${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_gun_pp.C
3+ funcName =generateNativeXi()
4+
5+ [GeneratorPythia8]
6+ config =${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/config_custom_xicc.cfg
You can’t perform that action at this time.
0 commit comments