19 : nProton(0), nPion(0), nPizero(0), nNeutron(0), pdgCode(0), tauMode(0)
29 int trueMode = truth.
Mode();
40 else if (
abs(pdg) == 12) {
48 else if (
abs(pdg) == 16) {
77 else if (
abs(pdg) == 12) {
85 else if (
abs(pdg) == 16) {
104 unsigned int nTopologyHits = 0)
119 for (
int p = 0; p < truth->
NParticles(); ++p) {
131 else if (pdg == 13) {
162 if (part.
Mother() != 0) {
continue; }
165 if (pdg > 2000000000) {
continue; }
168 if (pdg > 1000000) {
continue; }
180 if (pdg == 111 || pdg == 2112) {
188 if (nSimIDE < nTopologyHits) {
continue; }
192 case 211: ++
nPion;
break;
206 std::cout <<
"== Topology Information ==" << std::endl;
208 std::cout <<
" - Neutrino PDG code = " <<
pdgCode << std::endl;
210 std::cout <<
" - Number of protons (3 means >2) = " <<
nProton << std::endl;
212 std::cout <<
" - Number of charged pions (3 means >2) = " <<
nPion << std::endl;
214 std::cout <<
" - Number of pizeros (3 means >2) = " <<
nPizero << std::endl;
216 std::cout <<
" - Number of neutrons (3 means >2) = " <<
nNeutron << std::endl;
234 throw std::runtime_error(
"Topology type not recognised!");
248 throw std::runtime_error(
"Topology type not recognised!");
256 unsigned short baseProcess = std::numeric_limits<unsigned short>::max();
259 std::string processName = particle.
EndProcess();
263 baseProcess =
static_cast<unsigned int>(
GetProcessKey(processName));
266 std::cout <<
"What interaction type, then? " << processName << std::endl;
271 unsigned int nPi0 = 0;
272 unsigned int nPiM = 0;
273 unsigned int nPiP = 0;
274 unsigned int nNeu = 0;
275 unsigned int nPro = 0;
276 unsigned int nOth = 0;
281 case 111: ++nPi0;
break;
282 case -211: ++nPiM;
break;
283 case 211: ++nPiP;
break;
284 case 2112: ++nNeu;
break;
285 case 2212: ++nPro;
break;
286 default: ++nOth;
break;
290 std::cout <<
"Base process = " << baseProcess << std::endl;
291 std::cout <<
"Daughters = " << nPi0 <<
" pi0s, " << nPiM <<
" pi-s, " << nPiP <<
" pi+s, " 292 << nNeu <<
" neutrons, " << nPro <<
" protons and " << nOth <<
" other particles." 296 if (
abs(particle.
PdgCode()) == 211 && nPi0 == 1) {
308 if (process.compare(
"primary") == 0)
return 0;
309 if (process.compare(
"hadElastic") == 0)
return 1;
310 if (process.compare(
"pi-Inelastic") == 0)
return 2;
311 if (process.compare(
"pi+Inelastic") == 0)
return 3;
312 if (process.compare(
"kaon-Inelastic") == 0)
return 4;
313 if (process.compare(
"kaon+Inelastic") == 0)
return 5;
314 if (process.compare(
"protonInelastic") == 0)
return 6;
315 if (process.compare(
"neutronInelastic") == 0)
return 7;
316 if (process.compare(
"kaon0SInelastic") == 0)
return 8;
317 if (process.compare(
"kaon0LInelastic") == 0)
return 9;
318 if (process.compare(
"lambdaInelastic") == 0)
return 10;
319 if (process.compare(
"omega-Inelastic") == 0)
return 11;
320 if (process.compare(
"sigma+Inelastic") == 0)
return 12;
321 if (process.compare(
"sigma-Inelastic") == 0)
return 13;
322 if (process.compare(
"sigma0Inelastic") == 0)
return 14;
323 if (process.compare(
"xi-Inelastic") == 0)
return 15;
324 if (process.compare(
"xi0Inelastic") == 0)
return 16;
325 if (process.compare(
"anti_protonInelastic") == 0)
return 20;
326 if (process.compare(
"anti_neutronInelastic") == 0)
return 21;
327 if (process.compare(
"anti_lambdaInelastic") == 0)
return 22;
328 if (process.compare(
"anti_omega-Inelastic") == 0)
return 23;
329 if (process.compare(
"anti_sigma+Inelastic") == 0)
return 24;
330 if (process.compare(
"anti_sigma-Inelastic") == 0)
return 25;
331 if (process.compare(
"anti_xi-Inelastic") == 0)
return 26;
332 if (process.compare(
"anti_xi0Inelastic") == 0)
return 27;
334 if (process.compare(
"Decay") == 0)
return 30;
335 if (process.compare(
"FastScintillation") == 0)
return 31;
336 if (process.compare(
"nKiller") == 0)
338 if (process.compare(
"nCapture") == 0)
return 33;
340 if (process.compare(
"compt") == 0)
return 40;
341 if (process.compare(
"rayleigh") == 0)
return 41;
342 if (process.compare(
"phot") == 0)
return 42;
343 if (process.compare(
"conv") == 0)
return 43;
344 if (process.compare(
"CoupledTransportation") == 0)
return 44;
353 unsigned int nSimIDEs = 0;
363 std::cout <<
"Got " << localSimIDEs <<
" hits from " << daughter->
PdgCode() << std::endl;
366 nSimIDEs += localSimIDEs;
int GetProcessKey(std::string process) const
const simb::MCNeutrino & GetNeutrino() const
InteractionType GetInteractionType(simb::MCNeutrino &truth) const
neutrino electron elastic scatter
const simb::MCParticle * TrackIdToParticle_P(int id) const
const simb::MCParticle & Nu() const
constexpr auto abs(T v)
Returns the absolute value of the argument.
std::vector< const simb::MCParticle * > MCTruthToParticles_Ps(art::Ptr< simb::MCTruth > const &mct) const
Utility class for truth labels.
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
Nue CC Resonant interaction.
unsigned short GetTopologyTypeAlt() const
int NumberDaughters() const
int Daughter(const int i) const
unsigned short GetTopologyType() const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Nutau CC Resonant interaction.
std::string EndProcess() const
Nutau CC DIS interaction.
Numu CC, other than above.
AssignLabels()
Default constructor.
const simb::MCParticle & GetParticle(int i) const
void GetTopology(const art::Ptr< simb::MCTruth > truth, unsigned int nTopologyHits)
Nue CC, other than above.
unsigned int GetNeutralDaughterHitsRecursive(const simb::MCParticle &particle) const
Numu CC Resonant interaction.
InteractionType GetInteractionTypeFromSlice(int nuPDG, bool nuCCNC, int nuMode) const
Nutau CC, other than above.
unsigned short GetProtoDUNEBeamInteractionType(const simb::MCParticle &particle) const
Event generator information.