LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LArInteractionTypeHelper Class Reference

LArInteractionTypeHelper class. More...

#include "LArInteractionTypeHelper.h"

Classes

class  InteractionParameters
 Interaction parameters. More...
 

Public Types

enum  InteractionType : unsigned int { INTERACTION_TYPE_TABLE =(GET_INTERACTION_TYPE_ENTRY) UNKNOWN_INTERACTION_TYPE = 0 }
 InteractionType enum. More...
 

Static Public Member Functions

static InteractionType GetInteractionType (const pandora::MCParticleList &mcPrimaryList)
 Get the interaction type of an event. More...
 
static InteractionDescriptor GetInteractionDescriptor (const pandora::MCParticleList &mcPrimaryList)
 Get the interaction descriptor of an event. More...
 
static InteractionType GetTestBeamHierarchyInteractionType (const pandora::MCParticleList &mcPrimaryList)
 Get the test beam hierarchy interaction type of an event. More...
 
static void SetInteractionParameters (const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters)
 Set parameters describing the number and species of primary interaction products. More...
 
static InteractionType CosmicRayHypothesis (const pandora::MCParticleList &mcPrimaryList, const InteractionParameters &parameters)
 Get the interaction type of an event under a cosmic ray hypothesis. More...
 
static std::string ToString (const InteractionType interactionType)
 Get a string representation of an interaction type. More...
 

Detailed Description

LArInteractionTypeHelper class.

Definition at line 241 of file LArInteractionTypeHelper.h.

Member Enumeration Documentation

InteractionType enum.

Enumerator
INTERACTION_TYPE_TABLE 

Definition at line 247 of file LArInteractionTypeHelper.h.

247  : unsigned int
248  {
249  INTERACTION_TYPE_TABLE(GET_INTERACTION_TYPE_ENTRY) UNKNOWN_INTERACTION_TYPE = 0
250  };
#define GET_INTERACTION_TYPE_ENTRY(a)
The particle type enum macro.

Member Function Documentation

LArInteractionTypeHelper::InteractionType lar_content::LArInteractionTypeHelper::CosmicRayHypothesis ( const pandora::MCParticleList &  mcPrimaryList,
const InteractionParameters parameters 
)
static

Get the interaction type of an event under a cosmic ray hypothesis.

Parameters
mcPrimaryListthe list of primary mc particles
parametersthe parameter block to set
Returns
interaction type

Definition at line 679 of file LArInteractionTypeHelper.cc.

References lar_content::LArInteractionTypeHelper::InteractionParameters::m_nElectrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nMuons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPhotons, and lar_content::LArInteractionTypeHelper::InteractionParameters::m_nProtons.

681 {
682  if ((1 == mcPrimaryList.size()) && LArMCParticleHelper::IsCosmicRay(mcPrimaryList.front()))
683  {
684  if (1 == parameters.m_nMuons)
685  return COSMIC_RAY_MU;
686  if (1 == parameters.m_nProtons)
687  return COSMIC_RAY_P;
688  if (1 == parameters.m_nElectrons)
689  return COSMIC_RAY_E;
690  if (1 == parameters.m_nPhotons)
691  return COSMIC_RAY_PHOTON;
692  else
693  return COSMIC_RAY_OTHER;
694  }
695 
696  return OTHER_INTERACTION;
697 }
static bool IsCosmicRay(const pandora::MCParticle *const pMCParticle)
Return true if passed a primary cosmic ray MCParticle.
InteractionDescriptor lar_content::LArInteractionTypeHelper::GetInteractionDescriptor ( const pandora::MCParticleList &  mcPrimaryList)
static

Get the interaction descriptor of an event.

Parameters
mcPrimaryListthe list of primary mc particles
Returns
interaction descriptor

Definition at line 416 of file LArInteractionTypeHelper.cc.

References lar_content::LArInteractionTypeHelper::InteractionParameters::m_nElectrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nMuons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPhotons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiPlus, and lar_content::LArInteractionTypeHelper::InteractionParameters::m_nProtons.

Referenced by lar_content::VertexMonitoringAlgorithm::AssessVertices(), lar_content::LArHierarchyHelper::MatchInfo::Print(), and lar_content::HierarchyValidationAlgorithm::Run().

417 {
418  if (mcPrimaryList.empty())
419  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
420 
421  InteractionParameters parameters;
422  LArInteractionTypeHelper::SetInteractionParameters(mcPrimaryList, parameters);
423 
424  const MCParticle *pMCNeutrino(nullptr);
425 
426  for (const MCParticle *const pMCPrimary : mcPrimaryList)
427  {
429  (pMCNeutrino && (pMCNeutrino != LArMCParticleHelper::GetParentMCParticle(pMCPrimary))))
430  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
431 
432  pMCNeutrino = LArMCParticleHelper::GetParentMCParticle(pMCPrimary);
433  }
434 
435  if (!pMCNeutrino)
436  throw StatusCodeException(STATUS_CODE_FAILURE);
437 
438  const int nuNuanceCode(LArMCParticleHelper::GetNuanceCode(pMCNeutrino));
439 
440  if (1001 == nuNuanceCode)
441  {
442  return InteractionDescriptor(
443  true, true, false, false, false, parameters.m_nMuons == 1, parameters.m_nElectrons == 1, 0, 0, 0, parameters.m_nProtons);
444  }
445 
446  if (1002 == nuNuanceCode)
447  {
448  return InteractionDescriptor(false, true, false, false, false, false, false, 0, 0, 0, parameters.m_nProtons);
449  }
450 
451  if ((nuNuanceCode >= 1003) && (nuNuanceCode <= 1005))
452  {
453  return InteractionDescriptor(true, false, true, false, false, parameters.m_nMuons == 1, parameters.m_nElectrons == 1,
454  parameters.m_nPiPlus, parameters.m_nPiMinus, parameters.m_nPhotons, parameters.m_nProtons);
455  }
456 
457  if ((nuNuanceCode >= 1006) && (nuNuanceCode <= 1009))
458  {
459  return InteractionDescriptor(false, false, true, false, false, parameters.m_nMuons == 1, parameters.m_nElectrons == 1,
460  parameters.m_nPiPlus, parameters.m_nPiMinus, parameters.m_nPhotons, parameters.m_nProtons);
461  }
462 
463  if (1091 == nuNuanceCode)
464  {
465  return InteractionDescriptor(true, false, false, true, false, parameters.m_nMuons == 1, parameters.m_nElectrons == 1,
466  parameters.m_nPiPlus, parameters.m_nPiMinus, parameters.m_nPhotons, parameters.m_nProtons);
467  }
468 
469  if (1092 == nuNuanceCode)
470  {
471  return InteractionDescriptor(false, false, false, true, false, parameters.m_nMuons == 1, parameters.m_nElectrons == 1,
472  parameters.m_nPiPlus, parameters.m_nPiMinus, parameters.m_nPhotons, parameters.m_nProtons);
473  }
474 
475  if (1096 == nuNuanceCode)
476  {
477  return InteractionDescriptor(false, false, false, false, true, parameters.m_nMuons == 1, parameters.m_nElectrons == 1, 0, 0, 0, 0);
478  }
479  if (1097 == nuNuanceCode)
480  {
481  return InteractionDescriptor(true, false, false, false, true, parameters.m_nMuons == 1, parameters.m_nElectrons == 1, 0, 0, 0, 0);
482  }
483 
484  return InteractionDescriptor(false, false, false, false, false, false, false, 0, 0, 0, 0);
485 }
static unsigned int GetNuanceCode(const pandora::MCParticle *const pMCParticle)
Get the nuance code of an MCParticle.
static void SetInteractionParameters(const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters)
Set parameters describing the number and species of primary interaction products. ...
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
static bool IsBeamNeutrinoFinalState(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary neutrino final state MCParticle.
LArInteractionTypeHelper::InteractionType lar_content::LArInteractionTypeHelper::GetInteractionType ( const pandora::MCParticleList &  mcPrimaryList)
static

Get the interaction type of an event.

Parameters
mcPrimaryListthe list of primary mc particles
Returns
interaction type

Definition at line 18 of file LArInteractionTypeHelper.cc.

References lar_content::LArInteractionTypeHelper::InteractionParameters::m_nElectrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonPlus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nMuons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nNonNeutrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPhotons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiPlus, and lar_content::LArInteractionTypeHelper::InteractionParameters::m_nProtons.

Referenced by lar_content::TrainedVertexSelectionAlgorithm::GetInteractionType(), and lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput().

19 {
20  if (mcPrimaryList.empty())
21  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
22 
23  InteractionParameters parameters;
24  LArInteractionTypeHelper::SetInteractionParameters(mcPrimaryList, parameters);
25 
26  const InteractionType cosmicRayHypothesis(LArInteractionTypeHelper::CosmicRayHypothesis(mcPrimaryList, parameters));
27 
28  if (OTHER_INTERACTION != cosmicRayHypothesis)
29  return cosmicRayHypothesis;
30 
31  if ((1 == mcPrimaryList.size()) && LArMCParticleHelper::IsBeamParticle(mcPrimaryList.front()))
32  {
33  if (1 == parameters.m_nMuons)
34  return BEAM_PARTICLE_MU;
35  if (1 == parameters.m_nProtons)
36  return BEAM_PARTICLE_P;
37  if (1 == parameters.m_nElectrons)
38  return BEAM_PARTICLE_E;
39  if (1 == parameters.m_nPhotons)
40  return BEAM_PARTICLE_PHOTON;
41  if (1 == parameters.m_nPiPlus)
42  return BEAM_PARTICLE_PI_PLUS;
43  if (1 == parameters.m_nPiMinus)
44  return BEAM_PARTICLE_PI_MINUS;
45  if (1 == parameters.m_nKaonPlus)
46  return BEAM_PARTICLE_KAON_PLUS;
47  if (1 == parameters.m_nKaonMinus)
48  return BEAM_PARTICLE_KAON_MINUS;
49  else
50  return BEAM_PARTICLE_OTHER;
51  }
52 
53  const MCParticle *pMCNeutrino(nullptr);
54 
55  for (const MCParticle *const pMCPrimary : mcPrimaryList)
56  {
58  (pMCNeutrino && (pMCNeutrino != LArMCParticleHelper::GetParentMCParticle(pMCPrimary))))
59  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
60 
61  pMCNeutrino = LArMCParticleHelper::GetParentMCParticle(pMCPrimary);
62  }
63 
64  if (!pMCNeutrino)
65  throw StatusCodeException(STATUS_CODE_FAILURE);
66 
67  const int nuNuanceCode(LArMCParticleHelper::GetNuanceCode(pMCNeutrino));
68 
69  if (1001 == nuNuanceCode)
70  {
71  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons))
72  return CCQEL_MU;
73  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons))
74  return CCQEL_MU_P;
75  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons))
76  return CCQEL_MU_P_P;
77  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons))
78  return CCQEL_MU_P_P_P;
79  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons))
80  return CCQEL_MU_P_P_P_P;
81  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons))
82  return CCQEL_MU_P_P_P_P_P;
83 
84  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (0 == parameters.m_nProtons))
85  return CCQEL_E;
86  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (1 == parameters.m_nProtons))
87  return CCQEL_E_P;
88  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (2 == parameters.m_nProtons))
89  return CCQEL_E_P_P;
90  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (3 == parameters.m_nProtons))
91  return CCQEL_E_P_P_P;
92  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (4 == parameters.m_nProtons))
93  return CCQEL_E_P_P_P_P;
94  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (5 == parameters.m_nProtons))
95  return CCQEL_E_P_P_P_P_P;
96  }
97 
98  if (1002 == nuNuanceCode)
99  {
100  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons))
101  return NCQEL_P;
102  if ((2 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons))
103  return NCQEL_P_P;
104  if ((3 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons))
105  return NCQEL_P_P_P;
106  if ((4 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons))
107  return NCQEL_P_P_P_P;
108  if ((5 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons))
109  return NCQEL_P_P_P_P_P;
110  }
111 
112  if ((nuNuanceCode >= 1003) && (nuNuanceCode <= 1005))
113  {
114  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons))
115  return CCRES_MU;
116  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons))
117  return CCRES_MU_P;
118  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons))
119  return CCRES_MU_P_P;
120  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons))
121  return CCRES_MU_P_P_P;
122  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons))
123  return CCRES_MU_P_P_P_P;
124  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons))
125  return CCRES_MU_P_P_P_P_P;
126 
127  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
128  return CCRES_MU_PIPLUS;
129  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
130  return CCRES_MU_P_PIPLUS;
131  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
132  return CCRES_MU_P_P_PIPLUS;
133  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
134  return CCRES_MU_P_P_P_PIPLUS;
135  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
136  return CCRES_MU_P_P_P_P_PIPLUS;
137  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
138  return CCRES_MU_P_P_P_P_P_PIPLUS;
139 
140  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
141  return CCRES_MU_PHOTON;
142  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
143  return CCRES_MU_P_PHOTON;
144  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
145  return CCRES_MU_P_P_PHOTON;
146  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
147  return CCRES_MU_P_P_P_PHOTON;
148  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
149  return CCRES_MU_P_P_P_P_PHOTON;
150  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
151  return CCRES_MU_P_P_P_P_P_PHOTON;
152 
153  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
154  return CCRES_MU_PIZERO;
155  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
156  return CCRES_MU_P_PIZERO;
157  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
158  return CCRES_MU_P_P_PIZERO;
159  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
160  return CCRES_MU_P_P_P_PIZERO;
161  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
162  return CCRES_MU_P_P_P_P_PIZERO;
163  if ((8 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
164  return CCRES_MU_P_P_P_P_P_PIZERO;
165 
166  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (0 == parameters.m_nProtons))
167  return CCRES_E;
168  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (1 == parameters.m_nProtons))
169  return CCRES_E_P;
170  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (2 == parameters.m_nProtons))
171  return CCRES_E_P_P;
172  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (3 == parameters.m_nProtons))
173  return CCRES_E_P_P_P;
174  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (4 == parameters.m_nProtons))
175  return CCRES_E_P_P_P_P;
176  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (5 == parameters.m_nProtons))
177  return CCRES_E_P_P_P_P_P;
178 
179  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
180  return CCRES_E_PIPLUS;
181  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
182  return CCRES_E_P_PIPLUS;
183  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
184  return CCRES_E_P_P_PIPLUS;
185  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
186  return CCRES_E_P_P_P_PIPLUS;
187  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
188  return CCRES_E_P_P_P_P_PIPLUS;
189  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
190  return CCRES_E_P_P_P_P_P_PIPLUS;
191 
192  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
193  return CCRES_E_PHOTON;
194  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
195  return CCRES_E_P_PHOTON;
196  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
197  return CCRES_E_P_P_PHOTON;
198  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
199  return CCRES_E_P_P_P_PHOTON;
200  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
201  return CCRES_E_P_P_P_P_PHOTON;
202  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
203  return CCRES_E_P_P_P_P_P_PHOTON;
204 
205  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (0 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
206  return CCRES_E_PIZERO;
207  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
208  return CCRES_E_P_PIZERO;
209  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
210  return CCRES_E_P_P_PIZERO;
211  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
212  return CCRES_E_P_P_P_PIZERO;
213  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (4 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
214  return CCRES_E_P_P_P_P_PIZERO;
215  if ((8 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons) && (5 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
216  return CCRES_E_P_P_P_P_P_PIZERO;
217  }
218 
219  if ((nuNuanceCode >= 1006) && (nuNuanceCode <= 1009))
220  {
221  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons))
222  return NCRES_P;
223  if ((2 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons))
224  return NCRES_P_P;
225  if ((3 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons))
226  return NCRES_P_P_P;
227  if ((4 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons))
228  return NCRES_P_P_P_P;
229  if ((5 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons))
230  return NCRES_P_P_P_P_P;
231 
232  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
233  return NCRES_PIPLUS;
234  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
235  return NCRES_P_PIPLUS;
236  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
237  return NCRES_P_P_PIPLUS;
238  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
239  return NCRES_P_P_P_PIPLUS;
240  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
241  return NCRES_P_P_P_P_PIPLUS;
242  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
243  return NCRES_P_P_P_P_P_PIPLUS;
244 
245  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
246  return NCRES_PIMINUS;
247  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
248  return NCRES_P_PIMINUS;
249  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
250  return NCRES_P_P_PIMINUS;
251  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
252  return NCRES_P_P_P_PIMINUS;
253  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
254  return NCRES_P_P_P_P_PIMINUS;
255  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
256  return NCRES_P_P_P_P_P_PIMINUS;
257 
258  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
259  return NCRES_PHOTON;
260  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
261  return NCRES_P_PHOTON;
262  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
263  return NCRES_P_P_PHOTON;
264  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
265  return NCRES_P_P_P_PHOTON;
266  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
267  return NCRES_P_P_P_P_PHOTON;
268  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
269  return NCRES_P_P_P_P_P_PHOTON;
270 
271  if ((2 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
272  return NCRES_PIZERO;
273  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
274  return NCRES_P_PIZERO;
275  if ((4 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
276  return NCRES_P_P_PIZERO;
277  if ((5 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
278  return NCRES_P_P_P_PIZERO;
279  if ((6 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
280  return NCRES_P_P_P_P_PIZERO;
281  if ((7 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
282  return NCRES_P_P_P_P_P_PIZERO;
283  }
284 
285  if (1091 == nuNuanceCode)
286  {
287  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons))
288  return CCDIS_MU;
289  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons))
290  return CCDIS_MU_P;
291  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons))
292  return CCDIS_MU_P_P;
293  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons))
294  return CCDIS_MU_P_P_P;
295  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons))
296  return CCDIS_MU_P_P_P_P;
297  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons))
298  return CCDIS_MU_P_P_P_P_P;
299 
300  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
301  return CCDIS_MU_PIPLUS;
302  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
303  return CCDIS_MU_P_PIPLUS;
304  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
305  return CCDIS_MU_P_P_PIPLUS;
306  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
307  return CCDIS_MU_P_P_P_PIPLUS;
308  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
309  return CCDIS_MU_P_P_P_P_PIPLUS;
310  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
311  return CCDIS_MU_P_P_P_P_P_PIPLUS;
312 
313  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
314  return CCDIS_MU_PHOTON;
315  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
316  return CCDIS_MU_P_PHOTON;
317  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
318  return CCDIS_MU_P_P_PHOTON;
319  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
320  return CCDIS_MU_P_P_P_PHOTON;
321  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
322  return CCDIS_MU_P_P_P_P_PHOTON;
323  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
324  return CCDIS_MU_P_P_P_P_P_PHOTON;
325 
326  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (0 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
327  return CCDIS_MU_PIZERO;
328  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
329  return CCDIS_MU_P_PIZERO;
330  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
331  return CCDIS_MU_P_P_PIZERO;
332  if ((6 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
333  return CCDIS_MU_P_P_P_PIZERO;
334  if ((7 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (4 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
335  return CCDIS_MU_P_P_P_P_PIZERO;
336  if ((8 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons) && (5 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
337  return CCDIS_MU_P_P_P_P_P_PIZERO;
338  }
339 
340  if (1092 == nuNuanceCode)
341  {
342  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons))
343  return NCDIS_P;
344  if ((2 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons))
345  return NCDIS_P_P;
346  if ((3 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons))
347  return NCDIS_P_P_P;
348  if ((4 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons))
349  return NCDIS_P_P_P_P;
350  if ((5 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons))
351  return NCDIS_P_P_P_P_P;
352 
353  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
354  return NCDIS_PIPLUS;
355  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
356  return NCDIS_P_PIPLUS;
357  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
358  return NCDIS_P_P_PIPLUS;
359  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
360  return NCDIS_P_P_P_PIPLUS;
361  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
362  return NCDIS_P_P_P_P_PIPLUS;
363  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiPlus))
364  return NCDIS_P_P_P_P_P_PIPLUS;
365 
366  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
367  return NCDIS_PIMINUS;
368  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
369  return NCDIS_P_PIMINUS;
370  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
371  return NCDIS_P_P_PIMINUS;
372  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
373  return NCDIS_P_P_P_PIMINUS;
374  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
375  return NCDIS_P_P_P_P_PIMINUS;
376  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPiMinus))
377  return NCDIS_P_P_P_P_P_PIMINUS;
378 
379  if ((1 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
380  return NCDIS_PHOTON;
381  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
382  return NCDIS_P_PHOTON;
383  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
384  return NCDIS_P_P_PHOTON;
385  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
386  return NCDIS_P_P_P_PHOTON;
387  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
388  return NCDIS_P_P_P_P_PHOTON;
389  if ((6 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
390  return NCDIS_P_P_P_P_P_PHOTON;
391 
392  if ((2 == parameters.m_nNonNeutrons) && (0 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
393  return NCDIS_PIZERO;
394  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
395  return NCDIS_P_PIZERO;
396  if ((4 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
397  return NCDIS_P_P_PIZERO;
398  if ((5 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
399  return NCDIS_P_P_P_PIZERO;
400  if ((6 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
401  return NCDIS_P_P_P_P_PIZERO;
402  if ((7 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
403  return NCDIS_P_P_P_P_P_PIZERO;
404  }
405 
406  if (1096 == nuNuanceCode)
407  return NCCOH;
408  if (1097 == nuNuanceCode)
409  return CCCOH;
410 
411  return OTHER_INTERACTION;
412 }
static unsigned int GetNuanceCode(const pandora::MCParticle *const pMCParticle)
Get the nuance code of an MCParticle.
static void SetInteractionParameters(const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters)
Set parameters describing the number and species of primary interaction products. ...
static bool IsBeamParticle(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary beam MCParticle.
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
static InteractionType CosmicRayHypothesis(const pandora::MCParticleList &mcPrimaryList, const InteractionParameters &parameters)
Get the interaction type of an event under a cosmic ray hypothesis.
static bool IsBeamNeutrinoFinalState(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary neutrino final state MCParticle.
LArInteractionTypeHelper::InteractionType lar_content::LArInteractionTypeHelper::GetTestBeamHierarchyInteractionType ( const pandora::MCParticleList &  mcPrimaryList)
static

Get the test beam hierarchy interaction type of an event.

Parameters
mcPrimaryListthe list of primary mc particles
Returns
interaction type

Definition at line 489 of file LArInteractionTypeHelper.cc.

References if(), lar_content::LArInteractionTypeHelper::InteractionParameters::m_nElectrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaon0L, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonPlus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nMuons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nNonNeutrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPhotons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiPlus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiZero, and lar_content::LArInteractionTypeHelper::InteractionParameters::m_nProtons.

490 {
491  if (mcPrimaryList.empty())
492  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
493 
494  InteractionParameters parameters;
495  LArInteractionTypeHelper::SetInteractionParameters(mcPrimaryList, parameters);
496 
497  const InteractionType cosmicRayHypothesis(LArInteractionTypeHelper::CosmicRayHypothesis(mcPrimaryList, parameters));
498 
499  if (OTHER_INTERACTION != cosmicRayHypothesis)
500  return cosmicRayHypothesis;
501 
502  int targetParentId(0);
503 
504  for (const MCParticle *const pMCPrimary : mcPrimaryList)
505  {
506  if (LArMCParticleHelper::GetParentMCParticle(pMCPrimary) != pMCPrimary)
507  continue;
508 
509  if (13 == std::fabs(pMCPrimary->GetParticleId()))
510  --parameters.m_nMuons;
511  else if (11 == std::fabs(pMCPrimary->GetParticleId()))
512  --parameters.m_nElectrons;
513  else if (2212 == std::fabs(pMCPrimary->GetParticleId()))
514  --parameters.m_nProtons;
515  else if (22 == pMCPrimary->GetParticleId())
516  --parameters.m_nPhotons;
517  else if (211 == pMCPrimary->GetParticleId())
518  --parameters.m_nPiPlus;
519  else if (-211 == pMCPrimary->GetParticleId())
520  --parameters.m_nPiMinus;
521  else if (321 == pMCPrimary->GetParticleId())
522  --parameters.m_nKaonPlus;
523  else if (-321 == pMCPrimary->GetParticleId())
524  --parameters.m_nKaonMinus;
525 
526  --parameters.m_nNonNeutrons;
527  targetParentId = pMCPrimary->GetParticleId();
528  }
529 
530  MCParticleSet piZero, kaon0L;
531  for (const MCParticle *const pMCPrimary : mcPrimaryList)
532  {
533  if (22 == pMCPrimary->GetParticleId() && pMCPrimary->GetParentList().size() == 1)
534  {
535  const MCParticle *const pParentMCParticle(pMCPrimary->GetParentList().front());
536  if (pParentMCParticle->GetParticleId() == 111 && !piZero.count(pParentMCParticle))
537  piZero.insert(pParentMCParticle);
538  }
539  else if ((111 == pMCPrimary->GetParticleId() || 211 == std::fabs(pMCPrimary->GetParticleId())) && pMCPrimary->GetParentList().size() == 1)
540  {
541  const MCParticle *const pParentMCParticle(pMCPrimary->GetParentList().front());
542  if (pParentMCParticle->GetParticleId() == 130 && !kaon0L.count(pParentMCParticle))
543  kaon0L.insert(pParentMCParticle);
544  }
545  }
546 
547  parameters.m_nPiZero = piZero.size();
548  parameters.m_nKaon0L = kaon0L.size();
549 
550  if (211 == targetParentId)
551  {
552  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiPlus))
553  return BEAM_PARTICLE_PI_PLUS_PI_PLUS;
554  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiPlus) && (1 == parameters.m_nPhotons))
555  return BEAM_PARTICLE_PI_PLUS_PI_PLUS_PHOTON;
556  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiPlus) && (1 == parameters.m_nPiZero))
557  return BEAM_PARTICLE_PI_PLUS_PI_PLUS_PIZERO;
558  return BEAM_PARTICLE_PI_PLUS_COMPLEX;
559  }
560  else if (-211 == targetParentId)
561  {
562  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiMinus))
563  return BEAM_PARTICLE_PI_MINUS_PI_MINUS;
564  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiMinus) && (1 == parameters.m_nPhotons))
565  return BEAM_PARTICLE_PI_MINUS_PI_MINUS_PHOTON;
566  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nPiMinus) && (1 == parameters.m_nPiZero))
567  return BEAM_PARTICLE_PI_MINUS_PI_MINUS_PIZERO;
568  return BEAM_PARTICLE_PI_MINUS_COMPLEX;
569  }
570  else if (2212 == targetParentId)
571  {
572  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons))
573  return BEAM_PARTICLE_P_P;
574  if ((2 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
575  return BEAM_PARTICLE_P_P_PHOTON;
576  if ((3 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
577  return BEAM_PARTICLE_P_P_PHOTON_PHOTON;
578  if ((4 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (3 == parameters.m_nPhotons))
579  return BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON;
580  if ((5 == parameters.m_nNonNeutrons) && (1 == parameters.m_nProtons) && (4 == parameters.m_nPhotons))
581  return BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON_PHOTON;
582 
583  if ((2 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons))
584  return BEAM_PARTICLE_P_P_P;
585  if ((3 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
586  return BEAM_PARTICLE_P_P_P_PHOTON;
587  if ((4 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
588  return BEAM_PARTICLE_P_P_P_PHOTON_PHOTON;
589  if ((5 == parameters.m_nNonNeutrons) && (2 == parameters.m_nProtons) && (3 == parameters.m_nPhotons))
590  return BEAM_PARTICLE_P_P_P_PHOTON_PHOTON_PHOTON;
591 
592  if ((3 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons))
593  return BEAM_PARTICLE_P_P_P_P;
594  if ((4 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
595  return BEAM_PARTICLE_P_P_P_P_PHOTON;
596  if ((5 == parameters.m_nNonNeutrons) && (3 == parameters.m_nProtons) && (2 == parameters.m_nPhotons))
597  return BEAM_PARTICLE_P_P_P_P_PHOTON_PHOTON;
598 
599  if ((4 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons))
600  return BEAM_PARTICLE_P_P_P_P_P;
601  if ((5 == parameters.m_nNonNeutrons) && (4 == parameters.m_nProtons) && (1 == parameters.m_nPhotons))
602  return BEAM_PARTICLE_P_P_P_P_P_PHOTON;
603 
604  if ((5 == parameters.m_nNonNeutrons) && (5 == parameters.m_nProtons))
605  return BEAM_PARTICLE_P_P_P_P_P_P;
606 
607  return BEAM_PARTICLE_P_COMPLEX;
608  }
609  else if (13 == std::fabs(targetParentId))
610  {
611  if (0 == parameters.m_nNonNeutrons)
612  return BEAM_PARTICLE_MU;
613  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nElectrons))
614  return BEAM_PARTICLE_MU_E;
615  return BEAM_PARTICLE_MU_COMPLEX;
616  }
617  else if (321 == targetParentId)
618  {
619  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons))
620  return BEAM_PARTICLE_KAON_PLUS_MU;
621  if ((parameters.m_nNonNeutrons >= 2) && (1 == parameters.m_nKaonPlus) && (1 == parameters.m_nKaon0L))
622  return BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_KAON0L_COMPLEX;
623  if ((parameters.m_nNonNeutrons > 1) && (1 == parameters.m_nKaonPlus))
624  return BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_COMPLEX;
625  return BEAM_PARTICLE_KAON_PLUS_COMPLEX;
626  }
627  else if (-321 == targetParentId)
628  {
629  if ((1 == parameters.m_nNonNeutrons) && (1 == parameters.m_nMuons))
630  return BEAM_PARTICLE_KAON_MINUS_MU;
631  if ((parameters.m_nNonNeutrons >= 2) && (1 == parameters.m_nKaonMinus) && (1 == parameters.m_nKaon0L))
632  return BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_KAON0L_COMPLEX;
633  if ((parameters.m_nNonNeutrons > 1) && (1 == parameters.m_nKaonMinus))
634  return BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_COMPLEX;
635  return BEAM_PARTICLE_KAON_MINUS_COMPLEX;
636  }
637  else if (11 == std::fabs(targetParentId))
638  {
639  if (0 == parameters.m_nNonNeutrons)
640  return BEAM_PARTICLE_E;
641  return BEAM_PARTICLE_E_COMPLEX;
642  }
643 
644  if (parameters.m_nNonNeutrons > 5)
645  return BEAM_PARTICLE_COMPLEX_HIERARCHY;
646 
647  return BEAM_PARTICLE_UNKNOWN_HIERARCHY;
648 }
static void SetInteractionParameters(const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters)
Set parameters describing the number and species of primary interaction products. ...
if(nlines<=0)
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
static InteractionType CosmicRayHypothesis(const pandora::MCParticleList &mcPrimaryList, const InteractionParameters &parameters)
Get the interaction type of an event under a cosmic ray hypothesis.
void lar_content::LArInteractionTypeHelper::SetInteractionParameters ( const pandora::MCParticleList &  mcPrimaryList,
InteractionParameters parameters 
)
static

Set parameters describing the number and species of primary interaction products.

Parameters
mcPrimaryListthe list of primary mc particles
parametersthe parameter block to set

Definition at line 652 of file LArInteractionTypeHelper.cc.

References if(), lar_content::LArInteractionTypeHelper::InteractionParameters::m_nElectrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nKaonPlus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nMuons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nNonNeutrons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPhotons, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiMinus, lar_content::LArInteractionTypeHelper::InteractionParameters::m_nPiPlus, and lar_content::LArInteractionTypeHelper::InteractionParameters::m_nProtons.

653 {
654  for (const MCParticle *const pMCPrimary : mcPrimaryList)
655  {
656  if (2112 != pMCPrimary->GetParticleId())
657  ++parameters.m_nNonNeutrons;
658  if (13 == std::fabs(pMCPrimary->GetParticleId()))
659  ++parameters.m_nMuons;
660  if (11 == std::fabs(pMCPrimary->GetParticleId()))
661  ++parameters.m_nElectrons;
662  else if (2212 == std::fabs(pMCPrimary->GetParticleId()))
663  ++parameters.m_nProtons;
664  else if (22 == pMCPrimary->GetParticleId())
665  ++parameters.m_nPhotons;
666  else if (211 == pMCPrimary->GetParticleId())
667  ++parameters.m_nPiPlus;
668  else if (-211 == pMCPrimary->GetParticleId())
669  ++parameters.m_nPiMinus;
670  else if (321 == pMCPrimary->GetParticleId())
671  ++parameters.m_nKaonPlus;
672  else if (-321 == pMCPrimary->GetParticleId())
673  ++parameters.m_nKaonMinus;
674  }
675 }
if(nlines<=0)
std::string lar_content::LArInteractionTypeHelper::ToString ( const InteractionType  interactionType)
static

Get a string representation of an interaction type.

Parameters
interactionTypethe interaction type
Returns
string

Definition at line 701 of file LArInteractionTypeHelper.cc.

References GET_INTERACTION_TYPE_NAME_SWITCH, and INTERACTION_TYPE_TABLE.

Referenced by lar_content::TrainedVertexSelectionAlgorithm::GetInteractionType(), and lar_content::NeutrinoEventValidationAlgorithm::ProcessOutput().

702 {
703  switch (interactionType)
704  {
706  default:
707  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
708  }
709 }
#define GET_INTERACTION_TYPE_NAME_SWITCH(a)
The name switch statement macro.

The documentation for this class was generated from the following files: