274 Bool_t checkBothCharges)
const
279 Bool_t result = kTRUE;
280 Int_t absRequiredPDG = TMath::Abs(requiredPDG);
282 switch (absRequiredPDG) {
287 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 100 && TMath::Abs(particlePDG) <= 199;
289 if (requiredPDG > 0) result = particlePDG >= 100 && particlePDG <= 199;
290 if (requiredPDG < 0) result = particlePDG >= -199 && particlePDG <= -100;
294 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 1000 && TMath::Abs(particlePDG) <= 1999;
296 if (requiredPDG > 0) result = particlePDG >= 1000 && particlePDG <= 1999;
297 if (requiredPDG < 0) result = particlePDG >= -1999 && particlePDG <= -1000;
301 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 200 && TMath::Abs(particlePDG) <= 299;
303 if (requiredPDG > 0) result = particlePDG >= 200 && particlePDG <= 299;
304 if (requiredPDG < 0) result = particlePDG >= -299 && particlePDG <= -200;
308 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 2000 && TMath::Abs(particlePDG) <= 2999;
310 if (requiredPDG > 0) result = particlePDG >= 2000 && particlePDG <= 2999;
311 if (requiredPDG < 0) result = particlePDG >= -2999 && particlePDG <= -2000;
315 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 300 && TMath::Abs(particlePDG) <= 399;
317 if (requiredPDG > 0) result = particlePDG >= 300 && particlePDG <= 399;
318 if (requiredPDG < 0) result = particlePDG >= -399 && particlePDG <= -300;
322 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 3000 && TMath::Abs(particlePDG) <= 3999;
324 if (requiredPDG > 0) result = particlePDG >= 3000 && particlePDG <= 3999;
325 if (requiredPDG < 0) result = particlePDG >= -3999 && particlePDG <= -3000;
329 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 400 && TMath::Abs(particlePDG) <= 499;
331 if (requiredPDG > 0) result = particlePDG >= 400 && particlePDG <= 499;
332 if (requiredPDG < 0) result = particlePDG >= -499 && particlePDG <= -400;
336 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 400 && TMath::Abs(particlePDG) <= 439;
338 if (requiredPDG > 0) result = particlePDG >= 400 && particlePDG <= 439;
339 if (requiredPDG < 0) result = particlePDG >= -439 && particlePDG <= -400;
343 if (checkBothCharges)
344 result = (TMath::Abs(particlePDG) >= 400 && TMath::Abs(particlePDG) <= 439)
345 || (TMath::Abs(particlePDG) >= 4000 && TMath::Abs(particlePDG) <= 4399);
348 result = (particlePDG >= 400 && particlePDG <= 439) || (particlePDG >= 4000 && particlePDG <= 4399);
350 result = (particlePDG >= -439 && particlePDG <= -400) || (particlePDG >= -4399 && particlePDG <= -4000);
354 if (checkBothCharges)
355 result = (TMath::Abs(particlePDG) >= 400 && TMath::Abs(particlePDG) <= 499)
356 || (TMath::Abs(particlePDG) >= 4000 && TMath::Abs(particlePDG) <= 4999);
359 result = (particlePDG >= 400 && particlePDG <= 499) || (particlePDG >= 4000 && particlePDG <= 4999);
361 result = (particlePDG >= -499 && particlePDG <= -400) || (particlePDG >= -4999 && particlePDG <= -4000);
365 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 4000 && TMath::Abs(particlePDG) <= 4999;
367 if (requiredPDG > 0) result = particlePDG >= 4000 && particlePDG <= 4999;
368 if (requiredPDG < 0) result = particlePDG >= -4999 && particlePDG <= -4000;
372 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 4000 && TMath::Abs(particlePDG) <= 4399;
374 if (requiredPDG > 0) result = particlePDG >= 4000 && particlePDG <= 4399;
375 if (requiredPDG < 0) result = particlePDG >= -4399 && particlePDG <= -4000;
379 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 500 && TMath::Abs(particlePDG) <= 599;
381 if (requiredPDG > 0) result = particlePDG >= 500 && particlePDG <= 599;
382 if (requiredPDG < 0) result = particlePDG >= -599 && particlePDG <= -500;
386 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 500 && TMath::Abs(particlePDG) <= 549;
388 if (requiredPDG > 0) result = particlePDG >= 500 && particlePDG <= 549;
389 if (requiredPDG < 0) result = particlePDG >= -549 && particlePDG <= -500;
393 if (checkBothCharges)
394 result = (TMath::Abs(particlePDG) >= 500 && TMath::Abs(particlePDG) <= 549)
395 || (TMath::Abs(particlePDG) >= 5000 && TMath::Abs(particlePDG) <= 5499);
398 result = (particlePDG >= 500 && particlePDG <= 549) || (particlePDG >= 5000 && particlePDG <= 5499);
400 result = (particlePDG >= -549 && particlePDG <= -500) || (particlePDG >= -5499 && particlePDG <= -5000);
404 if (checkBothCharges)
405 result = (TMath::Abs(particlePDG) >= 500 && TMath::Abs(particlePDG) <= 599)
406 || (TMath::Abs(particlePDG) >= 5000 && TMath::Abs(particlePDG) <= 5999);
409 result = (particlePDG >= 500 && particlePDG <= 599) || (particlePDG >= 5000 && particlePDG <= 5999);
411 result = (particlePDG >= -599 && particlePDG <= -500) || (particlePDG >= -5999 && particlePDG <= -5000);
415 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 5000 && TMath::Abs(particlePDG) <= 5999;
417 if (requiredPDG > 0) result = particlePDG >= 5000 && particlePDG <= 5999;
418 if (requiredPDG < 0) result = particlePDG >= -5999 && particlePDG <= -5000;
422 if (checkBothCharges) result = TMath::Abs(particlePDG) >= 5000 && TMath::Abs(particlePDG) <= 5499;
424 if (requiredPDG > 0) result = particlePDG >= 5000 && particlePDG <= 5499;
425 if (requiredPDG < 0) result = particlePDG >= -5499 && particlePDG <= -5000;
429 if (checkBothCharges)
430 result = (TMath::Abs(particlePDG) >= 400 && TMath::Abs(particlePDG) <= 439)
431 || (TMath::Abs(particlePDG) >= 4000 && TMath::Abs(particlePDG) <= 4399)
432 || (TMath::Abs(particlePDG) >= 500 && TMath::Abs(particlePDG) <= 549)
433 || (TMath::Abs(particlePDG) >= 5000 && TMath::Abs(particlePDG) <= 5499);
436 result = (particlePDG >= 400 && particlePDG <= 439) || (particlePDG >= 4000 && particlePDG <= 4399)
437 || (particlePDG >= 500 && particlePDG <= 549) || (particlePDG >= 5000 && particlePDG <= 5499);
439 result = (particlePDG >= -439 && particlePDG <= -400) || (particlePDG >= -4399 && particlePDG <= -4000)
440 || (particlePDG >= -549 && particlePDG <= -500) || (particlePDG >= -5499 && particlePDG <= -5000);
444 if (checkBothCharges) result = (absRequiredPDG == TMath::Abs(particlePDG));
446 result = (requiredPDG == particlePDG);
449 if (absRequiredPDG != 0 && pdgExclusion) result = !result;
671 Int_t labelD1 = (mcD1 ? mcD1->
GetLabel() : -1);
672 Int_t labelD2 = (mcD2 ? mcD2->
GetLabel() : -1);
677 Bool_t processGEANT = kTRUE;
697 Bool_t directTerm = kTRUE;
781 Bool_t crossTerm = kTRUE;
795 if (!mcM2 && labelD2 > -1) {
806 if (!mcM1 && labelD1 > -1) {
844 if (!mcGG2 && mcG2) {
857 if (!mcGG1 && mcG1) {
868 Bool_t motherRelation = kTRUE;
877 return ((directTerm || crossTerm) && motherRelation && processGEANT);