20 : nProton(0), nPion(0), nPizero(0), nNeutron(0),
21 pdgCode(0), tauMode(0)
33 int trueMode = truth.
Mode();
46 else if(
abs(pdg) == 12)
55 else if(
abs(pdg) == 16)
88 else if(
abs(pdg) == 12){
96 else if(
abs(pdg) == 16){
142 }
else if (pdg == 13) {
185 if(pdg > 2000000000){
204 if(pdg == 111 || pdg == 2112){
215 if(nSimIDE < nTopologyHits){
223 case 211 : ++
nPion;
break;
268 std::cout <<
"== Topology Information ==" <<
std::endl;
272 std::cout <<
" - Number of protons (3 means >2) = " <<
nProton <<
std::endl;
274 std::cout <<
" - Number of charged pions (3 means >2) = " <<
nPion <<
std::endl;
276 std::cout <<
" - Number of pizeros (3 means >2) = " <<
nPizero <<
std::endl;
303 throw std::runtime_error(
"Topology type not recognised!");
316 throw std::runtime_error(
"Topology type not recognised!");
329 baseProcess =
static_cast<unsigned int>(
GetProcessKey(processName));
332 std::cout <<
"What interaction type, then? " << processName <<
std::endl;
337 unsigned int nPi0 = 0;
338 unsigned int nPiM = 0;
339 unsigned int nPiP = 0;
340 unsigned int nNeu = 0;
341 unsigned int nPro = 0;
342 unsigned int nOth = 0;
347 case 111 : ++nPi0;
break;
348 case -211 : ++nPiM;
break;
349 case 211 : ++nPiP;
break;
350 case 2112 : ++nNeu;
break;
351 case 2212 : ++nPro;
break;
352 default : ++nOth;
break;
356 std::cout <<
"Base process = " << baseProcess <<
std::endl;
357 std::cout <<
"Daughters = " << nPi0 <<
" pi0s, " << nPiM <<
" pi-s, " 358 << nPiP <<
" pi+s, " << nNeu <<
" neutrons, " 359 << nPro <<
" protons and " << nOth <<
" other particles." <<
std::endl;
362 if(
abs(particle.
PdgCode()) == 211 && nPi0 == 1){
373 if(process.compare(
"primary") == 0)
return 0;
374 else if(process.compare(
"hadElastic") == 0)
return 1;
375 else if(process.compare(
"pi-Inelastic") == 0)
return 2;
376 else if(process.compare(
"pi+Inelastic") == 0)
return 3;
377 else if(process.compare(
"kaon-Inelastic") == 0)
return 4;
378 else if(process.compare(
"kaon+Inelastic") == 0)
return 5;
379 else if(process.compare(
"protonInelastic") == 0)
return 6;
380 else if(process.compare(
"neutronInelastic") == 0)
return 7;
381 else if(process.compare(
"kaon0SInelastic") == 0)
return 8;
382 else if(process.compare(
"kaon0LInelastic") == 0)
return 9;
383 else if(process.compare(
"lambdaInelastic") == 0)
return 10;
384 else if(process.compare(
"omega-Inelastic") == 0)
return 11;
385 else if(process.compare(
"sigma+Inelastic") == 0)
return 12;
386 else if(process.compare(
"sigma-Inelastic") == 0)
return 13;
387 else if(process.compare(
"sigma0Inelastic") == 0)
return 14;
388 else if(process.compare(
"xi-Inelastic") == 0)
return 15;
389 else if(process.compare(
"xi0Inelastic") == 0)
return 16;
390 else if(process.compare(
"anti_protonInelastic") == 0)
return 20;
391 else if(process.compare(
"anti_neutronInelastic") == 0)
return 21;
392 else if(process.compare(
"anti_lambdaInelastic") == 0)
return 22;
393 else if(process.compare(
"anti_omega-Inelastic") == 0)
return 23;
394 else if(process.compare(
"anti_sigma+Inelastic") == 0)
return 24;
395 else if(process.compare(
"anti_sigma-Inelastic") == 0)
return 25;
396 else if(process.compare(
"anti_xi-Inelastic") == 0)
return 26;
397 else if(process.compare(
"anti_xi0Inelastic") == 0)
return 27;
399 else if(process.compare(
"Decay") == 0)
return 30;
400 else if(process.compare(
"FastScintillation") == 0)
return 31;
401 else if(process.compare(
"nKiller") == 0)
return 32;
402 else if(process.compare(
"nCapture") == 0)
return 33;
404 else if(process.compare(
"compt") == 0)
return 40;
405 else if(process.compare(
"rayleigh") == 0)
return 41;
406 else if(process.compare(
"phot") == 0)
return 42;
407 else if(process.compare(
"conv") == 0)
return 43;
408 else if(process.compare(
"CoupledTransportation") == 0)
return 44;
416 unsigned int nSimIDEs = 0;
426 std::cout <<
"Got " << localSimIDEs <<
" hits from " << daughter->
PdgCode() <<
std::endl;
429 nSimIDEs += localSimIDEs;
AssignLabels()
Default constructor.
const simb::MCNeutrino & GetNeutrino() const
Nutau CC, other than above.
neutrino electron elastic scatter
Nutau CC DIS interaction.
const simb::MCParticle * TrackIdToParticle_P(int id) const
const simb::MCParticle & Nu() const
Nutau CC Resonant interaction.
std::vector< const simb::MCParticle * > MCTruthToParticles_Ps(art::Ptr< simb::MCTruth > const &mct) const
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
enum cvn::Interaction InteractionType
unsigned short GetTopologyType()
unsigned int GetNeutralDaughterHitsRecursive(const simb::MCParticle &particle) const
Utility class for truth labels.
InteractionType GetInteractionType(simb::MCNeutrino &truth)
int NumberDaughters() const
int Daughter(const int i) const
unsigned short GetTopologyTypeAlt()
InteractionType GetInteractionTypeFromSlice(int nuPDG, bool nuCCNC, int nuMode)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Nue CC Resonant interaction.
void GetTopology(const art::Ptr< simb::MCTruth > truth, unsigned int nTopologyHits)
std::string EndProcess() const
Nue CC, other than above.
unsigned short GetProtoDUNEBeamInteractionType(const simb::MCParticle &particle) const
static int max(int a, int b)
Numu CC Resonant interaction.
const simb::MCParticle & GetParticle(int i) const
Something else. Tau? Hopefully we don't use this.
Numu CC, other than above.
int GetProcessKey(std::string process) const
Event generator information.
def parent(G, child, parent_type)
QTextStream & endl(QTextStream &s)