LArInteractionTypeHelper.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArHelpers/LArInteractionTypeHelper.h
3  *
4  * @brief Header file for the interaction type helper class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_INTERACTION_TYPE_HELPER_H
9 #define LAR_INTERACTION_TYPE_HELPER_H 1
10 
12 
14 
15 namespace lar_content
16 {
17 
18 // clang-format off
19 #define INTERACTION_TYPE_TABLE(d) \
20  d(CCQEL_MU ) \
21  d(CCQEL_MU_P ) \
22  d(CCQEL_MU_P_P ) \
23  d(CCQEL_MU_P_P_P ) \
24  d(CCQEL_MU_P_P_P_P ) \
25  d(CCQEL_MU_P_P_P_P_P ) \
26  d(CCQEL_E ) \
27  d(CCQEL_E_P ) \
28  d(CCQEL_E_P_P ) \
29  d(CCQEL_E_P_P_P ) \
30  d(CCQEL_E_P_P_P_P ) \
31  d(CCQEL_E_P_P_P_P_P ) \
32  d(NCQEL_P ) \
33  d(NCQEL_P_P ) \
34  d(NCQEL_P_P_P ) \
35  d(NCQEL_P_P_P_P ) \
36  d(NCQEL_P_P_P_P_P ) \
37  d(CCRES_MU ) \
38  d(CCRES_MU_P ) \
39  d(CCRES_MU_P_P ) \
40  d(CCRES_MU_P_P_P ) \
41  d(CCRES_MU_P_P_P_P ) \
42  d(CCRES_MU_P_P_P_P_P ) \
43  d(CCRES_MU_PIPLUS ) \
44  d(CCRES_MU_P_PIPLUS ) \
45  d(CCRES_MU_P_P_PIPLUS ) \
46  d(CCRES_MU_P_P_P_PIPLUS ) \
47  d(CCRES_MU_P_P_P_P_PIPLUS ) \
48  d(CCRES_MU_P_P_P_P_P_PIPLUS ) \
49  d(CCRES_MU_PHOTON ) \
50  d(CCRES_MU_P_PHOTON ) \
51  d(CCRES_MU_P_P_PHOTON ) \
52  d(CCRES_MU_P_P_P_PHOTON ) \
53  d(CCRES_MU_P_P_P_P_PHOTON ) \
54  d(CCRES_MU_P_P_P_P_P_PHOTON ) \
55  d(CCRES_MU_PIZERO ) \
56  d(CCRES_MU_P_PIZERO ) \
57  d(CCRES_MU_P_P_PIZERO ) \
58  d(CCRES_MU_P_P_P_PIZERO ) \
59  d(CCRES_MU_P_P_P_P_PIZERO ) \
60  d(CCRES_MU_P_P_P_P_P_PIZERO ) \
61  d(CCRES_E ) \
62  d(CCRES_E_P ) \
63  d(CCRES_E_P_P ) \
64  d(CCRES_E_P_P_P ) \
65  d(CCRES_E_P_P_P_P ) \
66  d(CCRES_E_P_P_P_P_P ) \
67  d(CCRES_E_PIPLUS ) \
68  d(CCRES_E_P_PIPLUS ) \
69  d(CCRES_E_P_P_PIPLUS ) \
70  d(CCRES_E_P_P_P_PIPLUS ) \
71  d(CCRES_E_P_P_P_P_PIPLUS ) \
72  d(CCRES_E_P_P_P_P_P_PIPLUS ) \
73  d(CCRES_E_PHOTON ) \
74  d(CCRES_E_P_PHOTON ) \
75  d(CCRES_E_P_P_PHOTON ) \
76  d(CCRES_E_P_P_P_PHOTON ) \
77  d(CCRES_E_P_P_P_P_PHOTON ) \
78  d(CCRES_E_P_P_P_P_P_PHOTON ) \
79  d(CCRES_E_PIZERO ) \
80  d(CCRES_E_P_PIZERO ) \
81  d(CCRES_E_P_P_PIZERO ) \
82  d(CCRES_E_P_P_P_PIZERO ) \
83  d(CCRES_E_P_P_P_P_PIZERO ) \
84  d(CCRES_E_P_P_P_P_P_PIZERO ) \
85  d(NCRES_P ) \
86  d(NCRES_P_P ) \
87  d(NCRES_P_P_P ) \
88  d(NCRES_P_P_P_P ) \
89  d(NCRES_P_P_P_P_P ) \
90  d(NCRES_PIPLUS ) \
91  d(NCRES_P_PIPLUS ) \
92  d(NCRES_P_P_PIPLUS ) \
93  d(NCRES_P_P_P_PIPLUS ) \
94  d(NCRES_P_P_P_P_PIPLUS ) \
95  d(NCRES_P_P_P_P_P_PIPLUS ) \
96  d(NCRES_PIMINUS ) \
97  d(NCRES_P_PIMINUS ) \
98  d(NCRES_P_P_PIMINUS ) \
99  d(NCRES_P_P_P_PIMINUS ) \
100  d(NCRES_P_P_P_P_PIMINUS ) \
101  d(NCRES_P_P_P_P_P_PIMINUS ) \
102  d(NCRES_PHOTON ) \
103  d(NCRES_P_PHOTON ) \
104  d(NCRES_P_P_PHOTON ) \
105  d(NCRES_P_P_P_PHOTON ) \
106  d(NCRES_P_P_P_P_PHOTON ) \
107  d(NCRES_P_P_P_P_P_PHOTON ) \
108  d(NCRES_PIZERO ) \
109  d(NCRES_P_PIZERO ) \
110  d(NCRES_P_P_PIZERO ) \
111  d(NCRES_P_P_P_PIZERO ) \
112  d(NCRES_P_P_P_P_PIZERO ) \
113  d(NCRES_P_P_P_P_P_PIZERO ) \
114  d(CCDIS_MU ) \
115  d(CCDIS_MU_P ) \
116  d(CCDIS_MU_P_P ) \
117  d(CCDIS_MU_P_P_P ) \
118  d(CCDIS_MU_P_P_P_P ) \
119  d(CCDIS_MU_P_P_P_P_P ) \
120  d(CCDIS_MU_PIPLUS ) \
121  d(CCDIS_MU_P_PIPLUS ) \
122  d(CCDIS_MU_P_P_PIPLUS ) \
123  d(CCDIS_MU_P_P_P_PIPLUS ) \
124  d(CCDIS_MU_P_P_P_P_PIPLUS ) \
125  d(CCDIS_MU_P_P_P_P_P_PIPLUS ) \
126  d(CCDIS_MU_PHOTON ) \
127  d(CCDIS_MU_P_PHOTON ) \
128  d(CCDIS_MU_P_P_PHOTON ) \
129  d(CCDIS_MU_P_P_P_PHOTON ) \
130  d(CCDIS_MU_P_P_P_P_PHOTON ) \
131  d(CCDIS_MU_P_P_P_P_P_PHOTON ) \
132  d(CCDIS_MU_PIZERO ) \
133  d(CCDIS_MU_P_PIZERO ) \
134  d(CCDIS_MU_P_P_PIZERO ) \
135  d(CCDIS_MU_P_P_P_PIZERO ) \
136  d(CCDIS_MU_P_P_P_P_PIZERO ) \
137  d(CCDIS_MU_P_P_P_P_P_PIZERO ) \
138  d(NCDIS_P ) \
139  d(NCDIS_P_P ) \
140  d(NCDIS_P_P_P ) \
141  d(NCDIS_P_P_P_P ) \
142  d(NCDIS_P_P_P_P_P ) \
143  d(NCDIS_PIPLUS ) \
144  d(NCDIS_P_PIPLUS ) \
145  d(NCDIS_P_P_PIPLUS ) \
146  d(NCDIS_P_P_P_PIPLUS ) \
147  d(NCDIS_P_P_P_P_PIPLUS ) \
148  d(NCDIS_P_P_P_P_P_PIPLUS ) \
149  d(NCDIS_PIMINUS ) \
150  d(NCDIS_P_PIMINUS ) \
151  d(NCDIS_P_P_PIMINUS ) \
152  d(NCDIS_P_P_P_PIMINUS ) \
153  d(NCDIS_P_P_P_P_PIMINUS ) \
154  d(NCDIS_P_P_P_P_P_PIMINUS ) \
155  d(NCDIS_PHOTON ) \
156  d(NCDIS_P_PHOTON ) \
157  d(NCDIS_P_P_PHOTON ) \
158  d(NCDIS_P_P_P_PHOTON ) \
159  d(NCDIS_P_P_P_P_PHOTON ) \
160  d(NCDIS_P_P_P_P_P_PHOTON ) \
161  d(NCDIS_PIZERO ) \
162  d(NCDIS_P_PIZERO ) \
163  d(NCDIS_P_P_PIZERO ) \
164  d(NCDIS_P_P_P_PIZERO ) \
165  d(NCDIS_P_P_P_P_PIZERO ) \
166  d(NCDIS_P_P_P_P_P_PIZERO ) \
167  d(CCCOH ) \
168  d(NCCOH ) \
169  d(COSMIC_RAY_MU ) \
170  d(COSMIC_RAY_P ) \
171  d(COSMIC_RAY_E ) \
172  d(COSMIC_RAY_PHOTON ) \
173  d(COSMIC_RAY_OTHER ) \
174  d(BEAM_PARTICLE_MU ) \
175  d(BEAM_PARTICLE_P ) \
176  d(BEAM_PARTICLE_E ) \
177  d(BEAM_PARTICLE_PHOTON ) \
178  d(BEAM_PARTICLE_PI_PLUS ) \
179  d(BEAM_PARTICLE_PI_MINUS ) \
180  d(BEAM_PARTICLE_KAON_PLUS ) \
181  d(BEAM_PARTICLE_KAON_MINUS ) \
182  d(BEAM_PARTICLE_OTHER ) \
183  d(BEAM_PARTICLE_PI_PLUS_PI_PLUS ) \
184  d(BEAM_PARTICLE_PI_PLUS_PI_PLUS_PHOTON ) \
185  d(BEAM_PARTICLE_PI_PLUS_PI_PLUS_PIZERO ) \
186  d(BEAM_PARTICLE_PI_PLUS_COMPLEX ) \
187  d(BEAM_PARTICLE_PI_MINUS_PI_MINUS ) \
188  d(BEAM_PARTICLE_PI_MINUS_PI_MINUS_PHOTON ) \
189  d(BEAM_PARTICLE_PI_MINUS_PI_MINUS_PIZERO ) \
190  d(BEAM_PARTICLE_PI_MINUS_COMPLEX ) \
191  d(BEAM_PARTICLE_P_P ) \
192  d(BEAM_PARTICLE_P_P_PHOTON ) \
193  d(BEAM_PARTICLE_P_P_PHOTON_PHOTON ) \
194  d(BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON ) \
195  d(BEAM_PARTICLE_P_P_PHOTON_PHOTON_PHOTON_PHOTON ) \
196  d(BEAM_PARTICLE_P_P_P ) \
197  d(BEAM_PARTICLE_P_P_P_PHOTON ) \
198  d(BEAM_PARTICLE_P_P_P_PHOTON_PHOTON ) \
199  d(BEAM_PARTICLE_P_P_P_PHOTON_PHOTON_PHOTON ) \
200  d(BEAM_PARTICLE_P_P_P_P ) \
201  d(BEAM_PARTICLE_P_P_P_P_PHOTON ) \
202  d(BEAM_PARTICLE_P_P_P_P_PHOTON_PHOTON ) \
203  d(BEAM_PARTICLE_P_P_P_P_P ) \
204  d(BEAM_PARTICLE_P_P_P_P_P_PHOTON ) \
205  d(BEAM_PARTICLE_P_P_P_P_P_P ) \
206  d(BEAM_PARTICLE_P_COMPLEX ) \
207  d(BEAM_PARTICLE_MU_E ) \
208  d(BEAM_PARTICLE_MU_COMPLEX ) \
209  d(BEAM_PARTICLE_KAON_PLUS_MU ) \
210  d(BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_KAON0L_COMPLEX ) \
211  d(BEAM_PARTICLE_KAON_PLUS_KAON_PLUS_COMPLEX ) \
212  d(BEAM_PARTICLE_KAON_PLUS_COMPLEX ) \
213  d(BEAM_PARTICLE_KAON_MINUS_MU ) \
214  d(BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_KAON0L_COMPLEX) \
215  d(BEAM_PARTICLE_KAON_MINUS_KAON_MINUS_COMPLEX ) \
216  d(BEAM_PARTICLE_KAON_MINUS_COMPLEX ) \
217  d(BEAM_PARTICLE_E_COMPLEX ) \
218  d(BEAM_PARTICLE_COMPLEX_HIERARCHY ) \
219  d(BEAM_PARTICLE_UNKNOWN_HIERARCHY ) \
220  d(OTHER_INTERACTION ) \
221  d(ALL_INTERACTIONS )
222 
223 /**
224  * @brief The particle type enum macro
225  */
226 #define GET_INTERACTION_TYPE_ENTRY(a) \
227  a,
228 
229 /**
230  * @brief The name switch statement macro
231  */
232 #define GET_INTERACTION_TYPE_NAME_SWITCH(a) \
233  case a : return std::string(#a);
234 // clang-format on
235 
236 /**
237  * @brief LArInteractionTypeHelper class
238  */
240 {
241 public:
242  /**
243  * @brief InteractionType enum
244  */
245  enum InteractionType : unsigned int
246  {
248  };
249 
250  /**
251  * @brief Interaction parameters
252  */
254  {
255  public:
256  /**
257  * @brief Constructor
258  */
259  InteractionParameters();
260 
261  unsigned int m_nNonNeutrons;
262  unsigned int m_nMuons;
263  unsigned int m_nElectrons;
264  unsigned int m_nPhotons;
265  unsigned int m_nProtons;
266  unsigned int m_nPiPlus;
267  unsigned int m_nPiMinus;
268  unsigned int m_nPiZero;
269  unsigned int m_nKaonPlus;
270  unsigned int m_nKaonMinus;
271  unsigned int m_nKaon0L;
272  };
273 
274  /**
275  * @brief Get the interaction type of an event
276  *
277  * @param mcPrimaryList the list of primary mc particles
278  *
279  * @return interaction type
280  */
281  static InteractionType GetInteractionType(const pandora::MCParticleList &mcPrimaryList);
282 
283  /**
284  * @brief Get the test beam hierarchy interaction type of an event
285  *
286  * @param mcPrimaryList the list of primary mc particles
287  *
288  * @return interaction type
289  */
290  static InteractionType GetTestBeamHierarchyInteractionType(const pandora::MCParticleList &mcPrimaryList);
291 
292  /**
293  * @brief Set parameters describing the number and species of primary interaction products
294  *
295  * @param mcPrimaryList the list of primary mc particles
296  * @param parameters the parameter block to set
297  */
298  static void SetInteractionParameters(const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters);
299 
300  /**
301  * @brief Get the interaction type of an event under a cosmic ray hypothesis
302  *
303  * @param mcPrimaryList the list of primary mc particles
304  * @param parameters the parameter block to set
305  *
306  * @return interaction type
307  */
308  static InteractionType CosmicRayHypothesis(const pandora::MCParticleList &mcPrimaryList, const InteractionParameters &parameters);
309 
310  /**
311  * @brief Get a string representation of an interaction type
312  *
313  * @param interactionType the interaction type
314  *
315  * @return string
316  */
317  static std::string ToString(const InteractionType interactionType);
318 };
319 
320 } // namespace lar_content
321 
322 #endif // #ifndef LAR_INTERACTION_TYPE_HELPER_H
std::string string
Definition: nybbler.cc:12
static void SetInteractionParameters(const pandora::MCParticleList &mcPrimaryList, InteractionParameters &parameters)
Set parameters describing the number and species of primary interaction products. ...
static InteractionType GetInteractionType(const pandora::MCParticleList &mcPrimaryList)
Get the interaction type of an event.
#define GET_INTERACTION_TYPE_ENTRY(a)
The particle type enum macro.
Header file for the lar monte carlo particle helper helper class.
static std::string ToString(const InteractionType interactionType)
Get a string representation of an interaction type.
Header file for the lar mc particle class.
static InteractionType GetTestBeamHierarchyInteractionType(const pandora::MCParticleList &mcPrimaryList)
Get the test beam hierarchy interaction type of an event.
static InteractionType CosmicRayHypothesis(const pandora::MCParticleList &mcPrimaryList, const InteractionParameters &parameters)
Get the interaction type of an event under a cosmic ray hypothesis.