11int External () {
2- std ::string path {"o2sim_Kine .root" };
2+ std ::string path {"tf1/sgn_Kine .root" };
33
44 int checkPdgQuarkOne {4 };
55 int checkPdgQuarkTwo {5 };
66 float ratioTrigger = 1. /5. ; // one event triggered out of 5
7- std ::array < std ::array < int , 2 > , 6 > pdgReplParticles = {{10433 , 30433 }, {10433 , 437 }, {435 , 4325 }, {435 , 4326 }, {425 , 4315 }, {425 , 4316 }};
8- std ::array < std ::array < int , 2 > , 6 > pdgReplPartCounters = {{0 , 0 }, {0 , 0 }, {0 , 0 }, {0 , 0 }, {0 , 0 }, {0 , 0 }};
9- std ::array < float , 4 > freqRepl = {0.1 , 0.1 , 0.1 , 0.1 , 0.5 , 0.5 }; // one event triggered out of 5
7+ std ::array < std ::array < int , 2 > , 6 > pdgReplParticles = {std :: array {10433 , 30433 }, std :: array {10433 , 437 }, std :: array {435 , 4325 }, std :: array {435 , 4326 }, std :: array {425 , 4315 }, std :: array {425 , 4316 }};
8+ std ::array < std ::array < int , 2 > , 6 > pdgReplPartCounters = {std :: array {0 , 0 }, std :: array {0 , 0 }, std :: array {0 , 0 }, std :: array {0 , 0 }, std :: array {0 , 0 }, std :: array {0 , 0 }};
9+ std ::array < float , 6 > freqRepl = {0.1 , 0.1 , 0.1 , 0.1 , 0.5 , 0.5 };
1010
11- std ::vector < int > checkPdgHadron {10433 , 30433 , 435 , 437 , 4325 , 4326 , 4315 , 4316 };
11+ std ::array < int , 11 > checkPdgHadron {411 , 421 , 10433 , 30433 , 435 , 437 , 4325 , 4326 , 4315 , 4316 , 531 };
1212 std ::map < int , std ::vector < std ::vector < int >>> checkHadronDecays { // sorted pdg of daughters
1313 {411 , {{-321 , 211 , 211 }, {-313 , 211 }, {211 , 311 }, {211 , 333 }}}, // D+
1414 {421 , {{-321 , 211 }, {-321 , 211 , 111 }}}, // D0
@@ -43,9 +43,10 @@ int External() {
4343 tree -> GetEntry (i );
4444
4545 // check subgenerator information
46+ int subGeneratorId {-1 };
4647 if (eventHeader -> hasInfo (o2 ::mcgenid ::GeneratorProperty ::SUBGENERATORID )) {
4748 bool isValid = false;
48- int subGeneratorId = eventHeader -> getInfo < int > (o2 ::mcgenid ::GeneratorProperty ::SUBGENERATORID , isValid );
49+ subGeneratorId = eventHeader -> getInfo < int > (o2 ::mcgenid ::GeneratorProperty ::SUBGENERATORID , isValid );
4950 if (subGeneratorId == 0 ) {
5051 nEventsMB ++ ;
5152 } else if (subGeneratorId == checkPdgQuarkOne ) {
@@ -66,11 +67,11 @@ int External() {
6667 nQuarksTwo ++ ;
6768 continue ;
6869 }
69- if (std ::find (checkPdgHadron .begin (), checkPdgHadron .end (), std :: abs ( pdg ) ) != checkPdgHadron .end ()) { // found signal
70+ if (std ::find (checkPdgHadron .begin (), checkPdgHadron .end (), absPdg ) != checkPdgHadron .end ()) { // found signal
7071 nSignals ++ ; // count signal PDG
7172
7273 if (subGeneratorId == checkPdgQuarkOne ) { // replacement only for prompt
73- for (int iRepl {0 }; iRepl < 4 ; ++ iRepl ) {
74+ for (int iRepl {0 }; iRepl < 6 ; ++ iRepl ) {
7475 if (absPdg == pdgReplParticles [iRepl ][0 ]) {
7576 pdgReplPartCounters [iRepl ][0 ]++ ;
7677 } else if (absPdg == pdgReplParticles [iRepl ][1 ]) {
@@ -142,7 +143,7 @@ int External() {
142143 return 1 ;
143144 }
144145
145- for (int iRepl {0 }; iRepl < 4 ; ++ iRepl ) {
146+ for (int iRepl {0 }; iRepl < 6 ; ++ iRepl ) {
146147 if (std ::abs (pdgReplPartCounters [iRepl ][1 ] - freqRepl [iRepl ] * pdgReplPartCounters [iRepl ][0 ]) > 2 * std ::sqrt (freqRepl [iRepl ] * pdgReplPartCounters [iRepl ][0 ])) { // 2 sigma compatibility
147148 std ::cerr << "Fraction of replaced " << pdgReplParticles [iRepl ][0 ] << " into " << pdgReplParticles [iRepl ][1 ] << " is " << pdgReplPartCounters [iRepl ][1 ] / pdgReplPartCounters [iRepl ][0 ] <<" (expected " << freqRepl [iRepl ] << ")\n" ;
148149 return 1 ;
0 commit comments