File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
MC/config/ALICE3/ini/tests Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,26 @@ int External()
1313 std ::cerr << "Cannot find tree o2sim in file " << path << "\n" ;
1414 return 1 ;
1515 }
16+
1617 std ::vector < o2 ::MCTrack > * tracks {};
1718 tree -> SetBranchAddress ("MCTrack" , & tracks );
18-
1919 auto nEvents = tree -> GetEntries ();
20- auto nSelected = tree -> Scan ("MCTrack.GetPdgCode()" , "MCTrack.GetPdgCode() == 3312" );
21- if (nSelected == 0 ) {
22- std ::cerr << "No event of interest\n" ;
20+ int nInjected = 0 ;
21+ for (int i = 0 ; i < nEvents ; i ++ ) {
22+ tree -> GetEntry (i );
23+ for (auto& track : * tracks ) {
24+ auto pdgCode = std ::fabs (track .GetPdgCode ());
25+ if (pdgCode == 3312 ) {
26+ nInjected ++ ;
27+ }
28+ }
29+ }
30+
31+ // Check if we are above typical Angantyr numbers
32+ if (nInjected < 5 * nEvents ) {
33+ std ::cerr << "Too few particles injected\n" ;
2334 return 1 ;
2435 }
36+
2537 return 0 ;
2638}
You can’t perform that action at this time.
0 commit comments