20 if (mcPrimaryList.empty())
21 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
24 LArInteractionTypeHelper::SetInteractionParameters(mcPrimaryList, parameters);
26 const InteractionType cosmicRayHypothesis(LArInteractionTypeHelper::CosmicRayHypothesis(mcPrimaryList, parameters));
28 if (OTHER_INTERACTION != cosmicRayHypothesis)
29 return cosmicRayHypothesis;
31 if ((1 == mcPrimaryList.size()) && LArMCParticleHelper::IsBeamParticle(mcPrimaryList.front()))
34 return BEAM_PARTICLE_MU;
36 return BEAM_PARTICLE_P;
38 return BEAM_PARTICLE_E;
40 return BEAM_PARTICLE_PHOTON;
42 return BEAM_PARTICLE_PI_PLUS;
44 return BEAM_PARTICLE_PI_MINUS;
46 return BEAM_PARTICLE_KAON_PLUS;
48 return BEAM_PARTICLE_KAON_MINUS;
50 return BEAM_PARTICLE_OTHER;
53 const MCParticle *pMCNeutrino(
nullptr);
55 for (
const MCParticle *
const pMCPrimary : mcPrimaryList)
57 if (!LArMCParticleHelper::IsBeamNeutrinoFinalState(pMCPrimary) ||
58 (pMCNeutrino && (pMCNeutrino != LArMCParticleHelper::GetParentMCParticle(pMCPrimary))))
59 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
61 pMCNeutrino = LArMCParticleHelper::GetParentMCParticle(pMCPrimary);
65 throw StatusCodeException(STATUS_CODE_FAILURE);
67 const int nuNuanceCode(LArMCParticleHelper::GetNuanceCode(pMCNeutrino));
69 if (1001 == nuNuanceCode)
78 return CCQEL_MU_P_P_P;
80 return CCQEL_MU_P_P_P_P;
82 return CCQEL_MU_P_P_P_P_P;
93 return CCQEL_E_P_P_P_P;
95 return CCQEL_E_P_P_P_P_P;
98 if (1002 == nuNuanceCode)
107 return NCQEL_P_P_P_P;
109 return NCQEL_P_P_P_P_P;
112 if ((nuNuanceCode >= 1003) && (nuNuanceCode <= 1005))
121 return CCRES_MU_P_P_P;
123 return CCRES_MU_P_P_P_P;
125 return CCRES_MU_P_P_P_P_P;
128 return CCRES_MU_PIPLUS;
130 return CCRES_MU_P_PIPLUS;
132 return CCRES_MU_P_P_PIPLUS;
134 return CCRES_MU_P_P_P_PIPLUS;
136 return CCRES_MU_P_P_P_P_PIPLUS;
138 return CCRES_MU_P_P_P_P_P_PIPLUS;
141 return CCRES_MU_PHOTON;
143 return CCRES_MU_P_PHOTON;
145 return CCRES_MU_P_P_PHOTON;
147 return CCRES_MU_P_P_P_PHOTON;
149 return CCRES_MU_P_P_P_P_PHOTON;
151 return CCRES_MU_P_P_P_P_P_PHOTON;
154 return CCRES_MU_PIZERO;
156 return CCRES_MU_P_PIZERO;
158 return CCRES_MU_P_P_PIZERO;
160 return CCRES_MU_P_P_P_PIZERO;
162 return CCRES_MU_P_P_P_P_PIZERO;
164 return CCRES_MU_P_P_P_P_P_PIZERO;
173 return CCRES_E_P_P_P;
175 return CCRES_E_P_P_P_P;
177 return CCRES_E_P_P_P_P_P;
180 return CCRES_E_PIPLUS;
182 return CCRES_E_P_PIPLUS;
184 return CCRES_E_P_P_PIPLUS;
186 return CCRES_E_P_P_P_PIPLUS;
188 return CCRES_E_P_P_P_P_PIPLUS;
190 return CCRES_E_P_P_P_P_P_PIPLUS;
193 return CCRES_E_PHOTON;
195 return CCRES_E_P_PHOTON;
197 return CCRES_E_P_P_PHOTON;
199 return CCRES_E_P_P_P_PHOTON;
201 return CCRES_E_P_P_P_P_PHOTON;
203 return CCRES_E_P_P_P_P_P_PHOTON;
206 return CCRES_E_PIZERO;
208 return CCRES_E_P_PIZERO;
210 return CCRES_E_P_P_PIZERO;
212 return CCRES_E_P_P_P_PIZERO;
214 return CCRES_E_P_P_P_P_PIZERO;
216 return CCRES_E_P_P_P_P_P_PIZERO;
219 if ((nuNuanceCode >= 1006) && (nuNuanceCode <= 1009))
228 return NCRES_P_P_P_P;
230 return NCRES_P_P_P_P_P;
235 return NCRES_P_PIPLUS;
237 return NCRES_P_P_PIPLUS;
239 return NCRES_P_P_P_PIPLUS;
241 return NCRES_P_P_P_P_PIPLUS;
243 return NCRES_P_P_P_P_P_PIPLUS;
246 return NCRES_PIMINUS;
248 return NCRES_P_PIMINUS;
250 return NCRES_P_P_PIMINUS;
252 return NCRES_P_P_P_PIMINUS;
254 return NCRES_P_P_P_P_PIMINUS;
256 return NCRES_P_P_P_P_P_PIMINUS;
261 return NCRES_P_PHOTON;
263 return NCRES_P_P_PHOTON;
265 return NCRES_P_P_P_PHOTON;
267 return NCRES_P_P_P_P_PHOTON;
269 return NCRES_P_P_P_P_P_PHOTON;
274 return NCRES_P_PIZERO;
276 return NCRES_P_P_PIZERO;
278 return NCRES_P_P_P_PIZERO;
280 return NCRES_P_P_P_P_PIZERO;
282 return NCRES_P_P_P_P_P_PIZERO;
285 if (1091 == nuNuanceCode)
294 return CCDIS_MU_P_P_P;
296 return CCDIS_MU_P_P_P_P;
298 return CCDIS_MU_P_P_P_P_P;
301 return CCDIS_MU_PIPLUS;
303 return CCDIS_MU_P_PIPLUS;
305 return CCDIS_MU_P_P_PIPLUS;
307 return CCDIS_MU_P_P_P_PIPLUS;
309 return CCDIS_MU_P_P_P_P_PIPLUS;
311 return CCDIS_MU_P_P_P_P_P_PIPLUS;
314 return CCDIS_MU_PHOTON;
316 return CCDIS_MU_P_PHOTON;
318 return CCDIS_MU_P_P_PHOTON;
320 return CCDIS_MU_P_P_P_PHOTON;
322 return CCDIS_MU_P_P_P_P_PHOTON;
324 return CCDIS_MU_P_P_P_P_P_PHOTON;
327 return CCDIS_MU_PIZERO;
329 return CCDIS_MU_P_PIZERO;
331 return CCDIS_MU_P_P_PIZERO;
333 return CCDIS_MU_P_P_P_PIZERO;
335 return CCDIS_MU_P_P_P_P_PIZERO;
337 return CCDIS_MU_P_P_P_P_P_PIZERO;
340 if (1092 == nuNuanceCode)
349 return NCDIS_P_P_P_P;
351 return NCDIS_P_P_P_P_P;
356 return NCDIS_P_PIPLUS;
358 return NCDIS_P_P_PIPLUS;
360 return NCDIS_P_P_P_PIPLUS;
362 return NCDIS_P_P_P_P_PIPLUS;
364 return NCDIS_P_P_P_P_P_PIPLUS;
367 return NCDIS_PIMINUS;
369 return NCDIS_P_PIMINUS;
371 return NCDIS_P_P_PIMINUS;
373 return NCDIS_P_P_P_PIMINUS;
375 return NCDIS_P_P_P_P_PIMINUS;
377 return NCDIS_P_P_P_P_P_PIMINUS;
382 return NCDIS_P_PHOTON;
384 return NCDIS_P_P_PHOTON;
386 return NCDIS_P_P_P_PHOTON;
388 return NCDIS_P_P_P_P_PHOTON;
390 return NCDIS_P_P_P_P_P_PHOTON;
395 return NCDIS_P_PIZERO;
397 return NCDIS_P_P_PIZERO;
399 return NCDIS_P_P_P_PIZERO;
401 return NCDIS_P_P_P_P_PIZERO;
403 return NCDIS_P_P_P_P_P_PIZERO;
406 if (1096 == nuNuanceCode)
408 if (1097 == nuNuanceCode)
411 return OTHER_INTERACTION;
418 if (mcPrimaryList.empty())
419 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
422 LArInteractionTypeHelper::SetInteractionParameters(mcPrimaryList, parameters);
424 const InteractionType cosmicRayHypothesis(LArInteractionTypeHelper::CosmicRayHypothesis(mcPrimaryList, parameters));
426 if (OTHER_INTERACTION != cosmicRayHypothesis)
427 return cosmicRayHypothesis;
429 int targetParentId(0);
431 for (
const MCParticle *
const pMCPrimary : mcPrimaryList)
433 if (LArMCParticleHelper::GetParentMCParticle(pMCPrimary) != pMCPrimary)
436 if (13 == std::fabs(pMCPrimary->GetParticleId()))
438 else if (11 == std::fabs(pMCPrimary->GetParticleId()))
440 else if (2212 == std::fabs(pMCPrimary->GetParticleId()))
442 else if (22 == pMCPrimary->GetParticleId())
444 else if (211 == pMCPrimary->GetParticleId())
446 else if (-211 == pMCPrimary->GetParticleId())
448 else if (321 == pMCPrimary->GetParticleId())
450 else if (-321 == pMCPrimary->GetParticleId())
454 targetParentId = pMCPrimary->GetParticleId();
457 MCParticleSet piZero, kaon0L;
458 for (
const MCParticle *
const pMCPrimary : mcPrimaryList)
460 if (22 == pMCPrimary->GetParticleId() && pMCPrimary->GetParentList().size() == 1)
462 const MCParticle *
const pParentMCParticle(pMCPrimary->GetParentList().front());
463 if (pParentMCParticle->GetParticleId() == 111 && !piZero.count(pParentMCParticle))
464 piZero.insert(pParentMCParticle);
466 else if ((111 == pMCPrimary->GetParticleId() || 211 == std::fabs(pMCPrimary->GetParticleId())) && pMCPrimary->GetParentList().size() == 1)
468 const MCParticle *
const pParentMCParticle(pMCPrimary->GetParentList().front());
469 if (pParentMCParticle->GetParticleId() == 130 && !kaon0L.count(pParentMCParticle))
470 kaon0L.insert(pParentMCParticle);
477 if (211 == targetParentId)
480 return BEAM_PARTICLE_PI_PLUS_PI_PLUS;
482 return BEAM_PARTICLE_PI_PLUS_PI_PLUS_PHOTON;
484 return BEAM_PARTICLE_PI_PLUS_PI_PLUS_PIZERO;
485 return BEAM_PARTICLE_PI_PLUS_COMPLEX;
487 else if (-211 == targetParentId)
490 return BEAM_PARTICLE_PI_MINUS_PI_MINUS;
492 return BEAM_PARTICLE_PI_MINUS_PI_MINUS_PHOTON;
494 return BEAM_PARTICLE_PI_MINUS_PI_MINUS_PIZERO;
495 return BEAM_PARTICLE_PI_MINUS_COMPLEX;
497 else if (2212 == targetParentId)
500 return BEAM_PARTICLE_P_P;
502 return BEAM_PARTICLE_P_P_PHOTON;
504 return BEAM_PARTICLE_P_P_PHOTON_PHOTON;
506 return BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON;
508 return BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON_PHOTON;
511 return BEAM_PARTICLE_P_P_P;
513 return BEAM_PARTICLE_P_P_P_PHOTON;
515 return BEAM_PARTICLE_P_P_P_PHOTON_PHOTON;
517 return BEAM_PARTICLE_P_P_P_PHOTON_PHOTON_PHOTON;
520 return BEAM_PARTICLE_P_P_P_P;
522 return BEAM_PARTICLE_P_P_P_P_PHOTON;
524 return BEAM_PARTICLE_P_P_P_P_PHOTON_PHOTON;
527 return BEAM_PARTICLE_P_P_P_P_P;
529 return BEAM_PARTICLE_P_P_P_P_P_PHOTON;
532 return BEAM_PARTICLE_P_P_P_P_P_P;
534 return BEAM_PARTICLE_P_COMPLEX;
536 else if (13 == std::fabs(targetParentId))
539 return BEAM_PARTICLE_MU;
541 return BEAM_PARTICLE_MU_E;
542 return BEAM_PARTICLE_MU_COMPLEX;
544 else if (321 == targetParentId)
547 return BEAM_PARTICLE_KAON_PLUS_MU;
549 return BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_KAON0L_COMPLEX;
551 return BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_COMPLEX;
552 return BEAM_PARTICLE_KAON_PLUS_COMPLEX;
554 else if (-321 == targetParentId)
557 return BEAM_PARTICLE_KAON_MINUS_MU;
559 return BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_KAON0L_COMPLEX;
561 return BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_COMPLEX;
562 return BEAM_PARTICLE_KAON_MINUS_COMPLEX;
564 else if (11 == std::fabs(targetParentId))
567 return BEAM_PARTICLE_E;
568 return BEAM_PARTICLE_E_COMPLEX;
572 return BEAM_PARTICLE_COMPLEX_HIERARCHY;
574 return BEAM_PARTICLE_UNKNOWN_HIERARCHY;
579 void LArInteractionTypeHelper::SetInteractionParameters(
const MCParticleList &mcPrimaryList,
InteractionParameters ¶meters)
581 for (
const MCParticle *
const pMCPrimary : mcPrimaryList)
583 if (2112 != pMCPrimary->GetParticleId())
585 if (13 == std::fabs(pMCPrimary->GetParticleId()))
587 if (11 == std::fabs(pMCPrimary->GetParticleId()))
589 else if (2212 == std::fabs(pMCPrimary->GetParticleId()))
591 else if (22 == pMCPrimary->GetParticleId())
593 else if (211 == pMCPrimary->GetParticleId())
595 else if (-211 == pMCPrimary->GetParticleId())
597 else if (321 == pMCPrimary->GetParticleId())
599 else if (-321 == pMCPrimary->GetParticleId())
609 if ((1 == mcPrimaryList.size()) && LArMCParticleHelper::IsCosmicRay(mcPrimaryList.front()))
612 return COSMIC_RAY_MU;
618 return COSMIC_RAY_PHOTON;
620 return COSMIC_RAY_OTHER;
623 return OTHER_INTERACTION;
630 switch (interactionType)
634 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
641 LArInteractionTypeHelper::InteractionParameters::InteractionParameters() :
Header file for the interaction type helper class.
#define GET_INTERACTION_TYPE_NAME_SWITCH(a)
The name switch statement macro.
Header file for the lar monitoring helper helper class.
unsigned int m_nNonNeutrons
Header file for the lar monte carlo particle helper helper class.
InteractionType
InteractionType enum.
unsigned int m_nElectrons
#define INTERACTION_TYPE_TABLE(d)
unsigned int m_nKaonMinus