Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
genie::HNIntranuke2015 Class Reference

#include <HNIntranuke2015.h>

Inheritance diagram for genie::HNIntranuke2015:
genie::Intranuke2015 genie::EventRecordVisitorI genie::Algorithm

Public Member Functions

 HNIntranuke2015 ()
 
 HNIntranuke2015 (string config)
 
 ~HNIntranuke2015 ()
 
void ProcessEventRecord (GHepRecord *event_rec) const
 
virtual string GetINukeMode () const
 
- Public Member Functions inherited from genie::Intranuke2015
 Intranuke2015 ()
 
 Intranuke2015 (string name)
 
 Intranuke2015 (string name, string config)
 
 ~Intranuke2015 ()
 
void Configure (const Registry &config)
 Configure the algorithm. More...
 
void Configure (string param_set)
 Configure the algorithm. More...
 
- Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void FindConfig (void)
 Lookup configuration from the config pool. More...
 
virtual const RegistryGetConfig (void) const
 Get configuration registry. More...
 
RegistryGetOwnedConfig (void)
 Get a writeable version of an owned configuration Registry. More...
 
virtual const AlgIdId (void) const
 Get algorithm ID. More...
 
virtual AlgStatus_t GetStatus (void) const
 Get algorithm status. More...
 
virtual bool AllowReconfig (void) const
 
virtual AlgCmp_t Compare (const Algorithm *alg) const
 Compare with input algorithm. More...
 
virtual void SetId (const AlgId &id)
 Set algorithm ID. More...
 
virtual void SetId (string name, string config)
 
const AlgorithmSubAlg (const RgKey &registry_key) const
 
void AdoptConfig (void)
 
void AdoptSubstructure (void)
 
virtual void Print (ostream &stream) const
 Print algorithm info. More...
 

Private Member Functions

void LoadConfig (void)
 
void SimulateHadronicFinalState (GHepRecord *ev, GHepParticle *p) const
 
INukeFateHN_t HadronFateHN (const GHepParticle *p) const
 
INukeFateHN_t HadronFateOset () const
 
double FateWeight (int pdgc, INukeFateHN_t fate) const
 
void ElasHN (GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
 
void AbsorbHN (GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
 
void InelasticHN (GHepRecord *ev, GHepParticle *p) const
 
void GammaInelasticHN (GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
 
bool HandleCompoundNucleusHN (GHepRecord *ev, GHepParticle *p) const
 
int HandleCompoundNucleus (GHepRecord *ev, GHepParticle *p, int mom) const
 

Private Attributes

int nuclA
 value of A for the target nucleus in hA mode More...
 
double fNucQEFac
 

Friends

class IntranukeTester
 

Additional Inherited Members

- Protected Member Functions inherited from genie::Intranuke2015
void TransportHadrons (GHepRecord *ev) const
 
void GenerateVertex (GHepRecord *ev) const
 
bool NeedsRescattering (const GHepParticle *p) const
 
bool CanRescatter (const GHepParticle *p) const
 
bool IsInNucleus (const GHepParticle *p) const
 
void SetTrackingRadius (const GHepParticle *p) const
 
double GenerateStep (GHepRecord *ev, GHepParticle *p) const
 
- Protected Member Functions inherited from genie::EventRecordVisitorI
 EventRecordVisitorI ()
 
 EventRecordVisitorI (string name)
 
 EventRecordVisitorI (string name, string config)
 
- Protected Member Functions inherited from genie::Algorithm
 Algorithm ()
 
 Algorithm (string name)
 
 Algorithm (string name, string config)
 
void Initialize (void)
 
void DeleteConfig (void)
 
void DeleteSubstructure (void)
 
- Protected Attributes inherited from genie::Intranuke2015
double fTrackingRadius
 tracking radius for the nucleus in the current event More...
 
TGenPhaseSpace fGenPhaseSpace
 a phase space generator More...
 
INukeHadroData2015fHadroData2015
 a collection of h+N,h+A data & calculations More...
 
AlgFactoryfAlgf
 algorithm factory instance More...
 
const NuclearModelIfNuclmodel
 nuclear model used to generate fermi momentum More...
 
int fRemnA
 remnant nucleus A More...
 
int fRemnZ
 remnant nucleus Z More...
 
TLorentzVector fRemnP4
 P4 of remnant system. More...
 
GEvGenMode_t fGMode
 event generation mode (lepton+A, hadron+A, ...) More...
 
double fR0
 effective nuclear size param More...
 
double fNR
 param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear boundary" More...
 
double fNucRmvE
 binding energy to subtract from cascade nucleons More...
 
double fDelRPion
 factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement More...
 
double fDelRNucleon
 factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement More...
 
double fHadStep
 step size for intranuclear hadron transport More...
 
double fNucAbsFac
 absorption xsec correction factor (hN Mode) More...
 
double fNucCEXFac
 charge exchange xsec correction factor (hN Mode) More...
 
double fEPreEq
 threshold for pre-equilibrium reaction More...
 
double fFermiFac
 testing parameter to modify fermi momentum More...
 
double fFreeStep
 produced particle free stem, in fm More...
 
double fFermiMomentum
 whether or not particle collision is pauli blocked More...
 
bool fDoFermi
 whether or not to do fermi mom. More...
 
bool fDoMassDiff
 whether or not to do mass diff. mode More...
 
bool fDoCompoundNucleus
 whether or not to do compound nucleus considerations More...
 
bool fUseOset
 Oset model for low energy pion in hN. More...
 
bool fAltOset
 NuWro's table-based implementation (not recommended) More...
 
bool fXsecNNCorr
 use nuclear medium correction for NN cross section More...
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsConfig
 true if it owns its config. registry More...
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
RegistryfConfig
 config. (either owned or pointing to config pool) More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Definition at line 51 of file HNIntranuke2015.h.

Constructor & Destructor Documentation

HNIntranuke2015::HNIntranuke2015 ( )

Definition at line 94 of file HNIntranuke2015.cxx.

94  :
95 Intranuke2015("genie::HNIntranuke2015")
96 {
97 
98 }
HNIntranuke2015::HNIntranuke2015 ( string  config)

Definition at line 100 of file HNIntranuke2015.cxx.

100  :
101 Intranuke2015("genie::HNIntranuke2015",config)
102 {
103 
104 }
HNIntranuke2015::~HNIntranuke2015 ( )

Definition at line 106 of file HNIntranuke2015.cxx.

107 {
108 
109 }

Member Function Documentation

void HNIntranuke2015::AbsorbHN ( GHepRecord ev,
GHepParticle p,
INukeFateHN_t  fate 
) const
private

Definition at line 385 of file HNIntranuke2015.cxx.

387 {
388  // handles pi+d->2p, pi-d->nn, pi0 d->pn absorbtion, all using pi+d values
389 
390  int pdgc = p->Pdg();
391 
392 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
393  LOG("HNIntranuke2015", pDEBUG)
394  << "AbsorbHN() is invoked for a : " << p->Name()
395  << " whose fate is : " << INukeHadroFates::AsString(fate);
396 #endif
397 
398  // check fate
399  if(fate!=kIHNFtAbs)
400  {
401  LOG("HNIntranuke2015", pWARN)
402  << "AbsorbHN() cannot handle fate: " << INukeHadroFates::AsString(fate);
403  return;
404  }
405 
406  // random number generator
407  RandomGen * rnd = RandomGen::Instance();
408 
409  // Notes on the kinematics
410  // -- Simple variables are used for efficiency
411  // -- Variables are numbered according to particle
412  // -- -- #1 -> incoming particle
413  // -- -- #2 -> target (here, 2_1 and 2_2 for individual particles)
414  // -- -- #3 -> scattered incoming (Particle tracked in hA mode)
415  // -- -- #4 -> other scattered particle
416  // -- Suffix "L" is for lab frame, suffix "CM" is for center of mass frame
417  // -- Subscript "z" is for parallel component, "t" is for transverse
418 
419  int pcode, t1code, t2code, scode, s2code; // particles
420  double M1, M2_1, M2_2, M3, M4; // rest energies, in GeV
421  double E1L, P1L, E2L, P2L, E3L, P3L, E4L, P4L;
422  double P1zL, P2zL;
423  double beta, gm; // speed and gamma for CM frame in lab
424  double Et, E2CM;
425  double C3CM, S3CM; // cos and sin of scattering angle
426  double Theta1, Theta2, theta5;
427  double PHI3; // transverse scattering angle
428  double E1CM, E3CM, E4CM, P3CM;
429  double P3zL, P3tL, P4zL, P4tL;
430  double E2_1L, E2_2L;
431  TVector3 tP2_1L, tP2_2L, tP1L, tP2L, tPtot, P1zCM, P2zCM;
432  TVector3 tP3L, tP4L;
433  TVector3 bDir, tTrans, tbeta, tVect;
434 
435  // Library instance for reference
436  PDGLibrary * pLib = PDGLibrary::Instance();
437 
438  // Handle fermi target
439  Target target(ev->TargetNucleus()->Pdg());
440 
441  // Target should be a deuteron, but for now
442  // handling it as seperate nucleons
443  if(pdgc==211) // pi-plus
444  {
445  pcode = 211;
446  t1code = 2212; // proton
447  t2code = 2112; // neutron
448  scode = 2212;
449  s2code = 2212;
450  }
451  else if(pdgc==-211) // pi-minus
452  {
453  pcode = -211;
454  t1code = 2212;
455  t2code = 2112;
456  scode = 2112;
457  s2code = 2112;
458  }
459  else if(pdgc==111) // pi-zero
460  {
461  pcode = 111;
462  t1code = 2212;
463  t2code = 2112;
464  scode = 2212;
465  s2code = 2112;
466  }
467  else
468  {
469  LOG("HNIntranuke2015", pWARN)
470  << "AbsorbHN() cannot handle probe: " << pdgc;
471  return;
472  }
473 
474  // assign proper masses
475  M1 = pLib->Find(pcode) ->Mass();
476  M2_1 = pLib->Find(t1code)->Mass();
477  M2_2 = pLib->Find(t2code)->Mass();
478  M3 = pLib->Find(scode) ->Mass();
479  M4 = pLib->Find(s2code)->Mass();
480 
481  // handle fermi momentum
482  if(fDoFermi)
483  {
484  target.SetHitNucPdg(t1code);
486  tP2_1L=fFermiFac * fNuclmodel->Momentum3();
487  E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1);
488 
489  target.SetHitNucPdg(t2code);
491  tP2_2L=fFermiFac * fNuclmodel->Momentum3();
492  E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2);
493  }
494  else
495  {
496  tP2_1L.SetXYZ(0.0, 0.0, 0.0);
497  E2_1L = M2_1;
498 
499  tP2_2L.SetXYZ(0.0, 0.0, 0.0);
500  E2_2L = M2_2;
501  }
502 
503  E2L = E2_1L + E2_2L;
504 
505  // adjust p to reflect scattering
506  // get random scattering angle
507  C3CM = fHadroData2015->IntBounce(p,t1code,scode,fate);
508  if (C3CM<-1.)
509  {
511  ev->AddParticle(*p);
512  return;
513  }
514  S3CM = TMath::Sqrt(1.0 - C3CM*C3CM);
515 
516  // Get lab energy and momenta
517  E1L = p->E();
518  if(E1L<0.001) E1L=0.001;
519  P1L = TMath::Sqrt(E1L*E1L - M1*M1);
520  tP1L = p->P4()->Vect();
521  tP2L = tP2_1L + tP2_2L;
522  P2L = tP2L.Mag();
523  tPtot = tP1L + tP2L;
524 
525  // get unit vectors and angles needed for later
526  bDir = tPtot.Unit();
527  Theta1 = tP1L.Angle(bDir);
528  Theta2 = tP2L.Angle(bDir);
529 
530  // get parallel and transverse components
531  P1zL = P1L*TMath::Cos(Theta1);
532  P2zL = P2L*TMath::Cos(Theta2);
533  tVect.SetXYZ(1,0,0);
534  if(TMath::Abs((tVect - bDir).Mag())<.01) tVect.SetXYZ(0,1,0);
535  theta5 = tVect.Angle(bDir);
536  tTrans = (tVect - TMath::Cos(theta5)*bDir).Unit();
537 
538  // calculate beta and gamma
539  tbeta = tPtot * (1.0 / (E1L + E2L));
540  beta = tbeta.Mag();
541  gm = 1.0 / TMath::Sqrt(1.0 - beta*beta);
542 
543  // boost to CM frame to get scattered particle momenta
544  E1CM = gm*E1L - gm*beta*P1zL;
545  P1zCM = gm*P1zL*bDir - gm*tbeta*E1L;
546  E2CM = gm*E2L - gm*beta*P2zL;
547  P2zCM = gm*P2zL*bDir - gm*tbeta*E2L;
548  Et = E1CM + E2CM;
549  E3CM = (Et*Et + (M3*M3) - (M4*M4)) / (2.0*Et);
550  E4CM = Et - E3CM;
551  P3CM = TMath::Sqrt(E3CM*E3CM - M3*M3);
552 
553  // boost back to lab
554  P3zL = gm*beta*E3CM + gm*P3CM*C3CM;
555  P3tL = P3CM*S3CM;
556  P4zL = gm*beta*E4CM + gm*P3CM*(-C3CM);
557  P4tL = P3CM*(-S3CM);
558 
559  P3L = TMath::Sqrt(P3zL*P3zL + P3tL*P3tL);
560  P4L = TMath::Sqrt(P4zL*P4zL + P4tL*P4tL);
561 
562  // check for too small values
563  // may introduce error, so warn if it occurs
564  if(!(TMath::Finite(P3L))||P3L<.001)
565  {
566  LOG("HNIntranuke2015",pINFO)
567  << "Particle 3 " << M3 << " momentum small or non-finite: " << P3L
568  << "\n" << "--> Assigning .001 as new momentum";
569  P3tL = 0;
570  P3zL = .001;
571  P3L = .001;
572  E3L = TMath::Sqrt(P3L*P3L + M3*M3);
573  }
574 
575  if(!(TMath::Finite(P4L))||P4L<.001)
576  {
577  LOG("HNIntranuke2015",pINFO)
578  << "Particle 4 " << M4 << " momentum small or non-finite: " << P4L
579  << "\n" << "--> Assigning .001 as new momentum";
580  P4tL = 0;
581  P4zL = .001;
582  P4L = .001;
583  E4L = TMath::Sqrt(P4L*P4L + M4*M4);
584  }
585 
586  // pauli blocking (do not apply PB for Oset)
587  //if(!fUseOset && (P3L < fFermiMomentum || P4L < fFermiMomentum))
588  double ke = p->KinE() / units::MeV;
589  if((!fUseOset || ke > 350.0 ) && (P3L < fFermiMomentum || P4L < fFermiMomentum))
590  {
591 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
592  LOG("HNIntranuke2015",pINFO) << "AbsorbHN failed: Pauli blocking";
593 #endif
594  /*
595  p->SetStatus(kIStHadronInTheNucleus);
596  //disable until needed
597  // utils::intranuke2015::StepParticle(p,fFreeStep,fTrackingRadius);
598  ev->AddParticle(*p);
599  return;
600  */
601  // new attempt at error handling:
602  LOG("HNIntranuke2015", pINFO) << "AbsorbHN failed: Pauli blocking";
604  exception.SetReason("hN absorption failed");
605  throw exception;
606  }
607 
608  // handle remnant nucleus updates
609  fRemnZ--;
610  fRemnA -=2;
611  fRemnP4 -= TLorentzVector(tP2_1L,E2_1L);
612  fRemnP4 -= TLorentzVector(tP2_2L,E2_2L);
613 
614  // get random phi angle, distributed uniformally in 360 deg
615  PHI3 = 2 * kPi * rnd->RndFsi().Rndm();
616 
617  tP3L = P3zL*bDir + P3tL*tTrans;
618  tP4L = P4zL*bDir + P4tL*tTrans;
619 
620  tP3L.Rotate(PHI3,bDir); // randomize transverse components
621  tP4L.Rotate(PHI3,bDir);
622 
623  E3L = TMath::Sqrt(P3L*P3L + M3*M3);
624  E4L = TMath::Sqrt(P4L*P4L + M4*M4);
625 
626  // create t particle w/ appropriate momenta, code, and status
627  // set target's mom to be the mom of the hadron that was cloned
628  GHepParticle * t = new GHepParticle(*p);
629  t->SetFirstMother(p->FirstMother());
630  t->SetLastMother(p->LastMother());
631 
632  TLorentzVector t4P4L(tP4L,E4L);
633  t->SetPdgCode(s2code);
634  t->SetMomentum(t4P4L);
636 
637  // adjust p to reflect scattering
638  TLorentzVector t4P3L(tP3L,E3L);
639  p->SetPdgCode(scode);
640  p->SetMomentum(t4P3L);
642 
643 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
644  LOG("HNIntranuke2015", pDEBUG)
645  << "|p3| = " << (P3L) << ", E3 = " << (E3L);
646  LOG("HNIntranuke2015", pDEBUG)
647  << "|p4| = " << (P4L) << ", E4 = " << (E4L);
648 #endif
649 
650  ev->AddParticle(*p);
651  ev->AddParticle(*t);
652 
653  delete t; // delete particle clone
654 }
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
void SetFirstMother(int m)
Definition: GHepParticle.h:131
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
bool fUseOset
Oset model for low energy pion in hN.
double E(void) const
Get energy.
Definition: GHepParticle.h:90
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
static const double MeV
Definition: Units.h:130
void SetMomentum(const TLorentzVector &p4)
double fFermiMomentum
whether or not particle collision is pauli blocked
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
int LastMother(void) const
Definition: GHepParticle.h:68
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
string Name(void) const
Name that corresponds to the PDG code.
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
Definition: Intranuke2015.h:95
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
bool fDoFermi
whether or not to do fermi mom.
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
double fFermiFac
testing parameter to modify fermi momentum
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:323
#define pINFO
Definition: Messenger.h:53
#define pWARN
Definition: Messenger.h:51
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:45
void SetLastMother(int m)
Definition: GHepParticle.h:132
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:27
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:125
virtual TVector3 Momentum3(void) const
Definition: NuclearModelI.h:59
static string AsString(INukeFateHN_t fate)
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:63
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
TLorentzVector fRemnP4
P4 of remnant system.
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
static const double kPi
Definition: Constants.h:38
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
#define pDEBUG
Definition: Messenger.h:54
void SetPdgCode(int c)
void HNIntranuke2015::ElasHN ( GHepRecord ev,
GHepParticle p,
INukeFateHN_t  fate 
) const
private

Definition at line 656 of file HNIntranuke2015.cxx.

658 {
659  // scatters particle within nucleus
660 
661 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
662  LOG("HNIntranuke2015", pDEBUG)
663  << "ElasHN() is invoked for a : " << p->Name()
664  << " whose fate is : " << INukeHadroFates::AsString(fate);
665 #endif
666 
667  if(fate!=kIHNFtCEx && fate!=kIHNFtElas)
668  {
669  LOG("HNIntranuke2015", pWARN)
670  << "ElasHN() cannot handle fate: " << INukeHadroFates::AsString(fate);
671  return;
672  }
673 
674  // Random number generator
675  RandomGen * rnd = RandomGen::Instance();
676 
677  // vars for incoming particle, target, and scattered pdg codes
678  int pcode = p->Pdg();
679  int tcode, scode, s2code;
680  double ppcnt = (double) fRemnZ / (double) fRemnA; // % of protons
681 
682  // Select a target randomly, weighted to #
683  // -- Unless, of course, the fate is CEx,
684  // -- in which case the target may be deterministic
685  // Also assign scattered particle code
686  if(fate==kIHNFtCEx)
687  {
688  if(pcode==kPdgPiP) {tcode = kPdgNeutron; scode = kPdgPi0; s2code = kPdgProton;}
689  else if(pcode==kPdgPiM) {tcode = kPdgProton; scode = kPdgPi0; s2code = kPdgNeutron;}
690  else if(pcode==kPdgKP) {tcode = kPdgNeutron; scode = kPdgK0; s2code = kPdgProton;}
691  else
692  {
693  // for pi0
694  tcode = (rnd->RndFsi().Rndm()<=ppcnt)?(kPdgProton) :(kPdgNeutron);
695  scode = (tcode == kPdgProton) ?(kPdgPiP) :(kPdgPiM);
696  s2code = (tcode == kPdgProton) ?(kPdgNeutron):(kPdgProton);
697  }
698  }
699  else
700  {
701  tcode = (rnd->RndFsi().Rndm()<=ppcnt)?(kPdgProton):(kPdgNeutron);
702  scode = pcode;
703  s2code = tcode;
704  }
705 
706  // get random scattering angle
707  double C3CM = fHadroData2015->IntBounce(p,tcode,scode,fate);
708  if (C3CM<-1.)
709  {
711  ev->AddParticle(*p);
712  return;
713  }
714 
715  // create scattered particle
716  GHepParticle * t = new GHepParticle(*p);
717  t->SetPdgCode(tcode);
718  double Mt = t->Mass();
719  //t->SetMomentum(TLorentzVector(0,0,0,Mt));
720 
721  // handle fermi momentum
722  if(fDoFermi)
723  {
724  // Handle fermi target
725  Target target(ev->TargetNucleus()->Pdg());
726 
727  target.SetHitNucPdg(tcode);
729  TVector3 tP3L = fFermiFac * fNuclmodel->Momentum3();
730  double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
731  t->SetMomentum(TLorentzVector(tP3L,tE));
732  }
733  else
734  {
735  t->SetMomentum(TLorentzVector(0,0,0,Mt));
736  }
737 
738  bool pass = utils::intranuke2015::TwoBodyCollision(ev,pcode,tcode,scode,s2code,C3CM,
740 
741 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
742  LOG("HNIntranuke2015",pDEBUG)
743  << "|p3| = " << P3L << ", E3 = " << E3L;
744  LOG("HNIntranuke2015",pDEBUG)
745  << "|p4| = " << P4L << ", E4 = " << E4L;
746 #endif
747 
748  if (pass==true)
749  {
750  // give each of the particles a free step (remove Apr, 2016 - not needed)
751  // utils::intranuke2015::StepParticle(p,fFreeStep,fTrackingRadius);
752  // utils::intranuke2015::StepParticle(t,fFreeStep,fTrackingRadius);
753  ev->AddParticle(*p);
754  ev->AddParticle(*t);
755  } else
756  {
757  delete t; //fixes memory leak
758  LOG("HNIntranuke2015", pINFO) << "Elastic in hN failed calling TwoBodyCollision";
760  exception.SetReason("hN scattering kinematics through TwoBodyCollision failed");
761  throw exception;
762  }
763 
764  delete t;
765 
766 }
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
void SetMomentum(const TLorentzVector &p4)
double Mass(void) const
Mass that corresponds to the PDG code.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
const int kPdgK0
Definition: PDGCodes.h:148
int Pdg(void) const
Definition: GHepParticle.h:64
string Name(void) const
Name that corresponds to the PDG code.
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
Definition: Intranuke2015.h:95
const HLTPathStatus pass
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
bool fDoFermi
whether or not to do fermi mom.
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
const int kPdgKP
Definition: PDGCodes.h:146
const int kPdgPiP
Definition: PDGCodes.h:132
const int kPdgPi0
Definition: PDGCodes.h:134
double fFermiFac
testing parameter to modify fermi momentum
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:323
#define pINFO
Definition: Messenger.h:53
#define pWARN
Definition: Messenger.h:51
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:125
virtual TVector3 Momentum3(void) const
Definition: NuclearModelI.h:59
static string AsString(INukeFateHN_t fate)
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
const int kPdgPiM
Definition: PDGCodes.h:133
TLorentzVector fRemnP4
P4 of remnant system.
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
const int kPdgProton
Definition: PDGCodes.h:62
bool TwoBodyCollision(GHepRecord *ev, int pcode, int tcode, int scode, int s2code, double C3CM, GHepParticle *p, GHepParticle *t, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, EINukeMode mode=kIMdHA)
Intranuke utility functions.
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
const int kPdgNeutron
Definition: PDGCodes.h:64
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
#define pDEBUG
Definition: Messenger.h:54
void SetPdgCode(int c)
double HNIntranuke2015::FateWeight ( int  pdgc,
INukeFateHN_t  fate 
) const
private

Definition at line 360 of file HNIntranuke2015.cxx.

361 {
362  // turn fates off if the remnant nucleus does not have the number of p,n
363  // required
364 
365  int np = fRemnZ;
366  int nn = fRemnA - fRemnZ;
367 
368  if (np < 1 && nn < 1)
369  {
370  LOG("HNIntranuke2015", pERROR) << "** Nothing left in nucleus!!! **";
371  return 0;
372  }
373  else
374  {
375  if (fate == kIHNFtCEx && pdgc==kPdgPiP ) { return (nn>=1) ? 1. : 0.; }
376  if (fate == kIHNFtCEx && pdgc==kPdgPiM ) { return (np>=1) ? 1. : 0.; }
377  if (fate == kIHNFtCEx && pdgc==kPdgKP ) { return (nn>=1) ? 1. : 0.; } //Added, changed np to nn
378  if (fate == kIHNFtAbs) { return ((nn>=1) && (np>=1)) ? 1. : 0.; }
379  if (fate == kIHNFtCmp ) { return ((pdgc==kPdgProton||pdgc==kPdgNeutron)&&fDoCompoundNucleus&&fRemnA>5) ? 1. : 0.; }
380 
381  }
382  return 1.;
383 }
#define pERROR
Definition: Messenger.h:50
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
bool fDoCompoundNucleus
whether or not to do compound nucleus considerations
const int kPdgKP
Definition: PDGCodes.h:146
const int kPdgPiP
Definition: PDGCodes.h:132
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
const int kPdgPiM
Definition: PDGCodes.h:133
const int kPdgProton
Definition: PDGCodes.h:62
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
const int kPdgNeutron
Definition: PDGCodes.h:64
void HNIntranuke2015::GammaInelasticHN ( GHepRecord ev,
GHepParticle p,
INukeFateHN_t  fate 
) const
private

Definition at line 808 of file HNIntranuke2015.cxx.

809 {
810  // This function handles pion photoproduction reactions
811 
812 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
813  LOG("HNIntranuke2015", pDEBUG)
814  << "GammaInelasticHN() is invoked for a : " << p->Name()
815  << " whose fate is : " << INukeHadroFates::AsString(fate);
816 #endif
817 
818  if(fate!=kIHNFtInelas && p->Pdg()!=kPdgGamma)
819  {
820  LOG("HNIntranuke2015", pWARN)
821  << "GammaInelasticHN() cannot handle fate: " << INukeHadroFates::AsString(fate);
822  return;
823  }
824 
825  // random number generator
826  RandomGen * rnd = RandomGen::Instance();
827 
828  // vars for incoming particle, target, and scattered reaction products
829  double ppcnt = (double) fRemnZ / (double) fRemnA; // % of protons
830  int pcode = p->Pdg();
831  int tcode = (rnd->RndFsi().Rndm()<=ppcnt)?(kPdgProton):(kPdgNeutron);
832  int scode, s2code;
833  double ke = p->KinE() / units::MeV;
834 
835  LOG("HNIntranuke2015", pNOTICE)
836  << "Particle code: " << pcode << ", target: " << tcode;
837 
838 
839  if (rnd->RndFsi().Rndm() * (fHadroData2015 -> XSecGamp_fs() -> Evaluate(ke) +
840  fHadroData2015 -> XSecGamn_fs() -> Evaluate(ke) )
841  <= fHadroData2015 -> XSecGamp_fs() -> Evaluate(ke) ) { scode = kPdgProton; }
842  else { scode = kPdgNeutron; }
843 
844  //scode=fHadroData2015->AngleAndProduct(p,tcode,C3CM,fate);
845  //double C3CM = 0.0; // cos of scattering angle
846  double C3CM = fHadroData2015->IntBounce(p,tcode,scode,fate);
847 
848  if ((tcode == kPdgProton ) && (scode==kPdgProton )) {s2code=kPdgPi0;}
849  else if ((tcode == kPdgProton ) && (scode==kPdgNeutron)) {s2code=kPdgPiP;}
850  else if ((tcode == kPdgNeutron) && (scode==kPdgProton )) {s2code=kPdgPiM;}
851  else if ((tcode == kPdgNeutron) && (scode==kPdgNeutron)) {s2code=kPdgPi0;}
852  else {
853  LOG("HNIntranuke2015", pERROR)
854  << "Error: could not determine particle final states";
855  ev->AddParticle(*p);
856  return;
857  }
858 
859  LOG("HNIntranuke2015", pNOTICE)
860  << "GammaInelastic fate: " << INukeHadroFates::AsString(fate);
861  LOG("HNIntranuke2015", pNOTICE)
862  << " final state: " << scode << " and " << s2code;
863  LOG("HNIntranuke2015", pNOTICE)
864  << " scattering angle: " << C3CM;
865 
866  GHepParticle * t = new GHepParticle(*p);
867  t->SetPdgCode(tcode);
868  double Mt = t->Mass();
869 
870  // handle fermi momentum
871  if(fDoFermi)
872  {
873  // Handle fermi target
874  Target target(ev->TargetNucleus()->Pdg());
875 
876  target.SetHitNucPdg(tcode);
878  TVector3 tP3L = fFermiFac * fNuclmodel->Momentum3();
879  double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt);
880  t->SetMomentum(TLorentzVector(tP3L,tE));
881  }
882  else
883  {
884  t->SetMomentum(TLorentzVector(0,0,0,Mt));
885  }
886 
887  bool pass = utils::intranuke2015::TwoBodyCollision(ev,pcode,tcode,scode,s2code,C3CM,
889 
890 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
891  LOG("HNIntranuke2015",pDEBUG)
892  << "|p3| = " << P3L << ", E3 = " << E3L;
893  LOG("HNIntranuke2015",pDEBUG)
894  << "|p4| = " << P4L << ", E4 = " << E4L;
895 #endif
896 
897  if (pass==true)
898  {
899  //p->SetStatus(kIStStableFinalState);
900  //t->SetStatus(kIStStableFinalState);
901  ev->AddParticle(*p);
902  ev->AddParticle(*t);
903  } else
904  {
905  ev->AddParticle(*p);
906  }
907 
908  delete t;
909 
910 }
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
#define pERROR
Definition: Messenger.h:50
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
static const double MeV
Definition: Units.h:130
void SetMomentum(const TLorentzVector &p4)
double Mass(void) const
Mass that corresponds to the PDG code.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
int Pdg(void) const
Definition: GHepParticle.h:64
string Name(void) const
Name that corresponds to the PDG code.
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
Definition: Intranuke2015.h:95
const HLTPathStatus pass
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
const int kPdgGamma
Definition: PDGCodes.h:163
bool fDoFermi
whether or not to do fermi mom.
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
const int kPdgPiP
Definition: PDGCodes.h:132
const int kPdgPi0
Definition: PDGCodes.h:134
double fFermiFac
testing parameter to modify fermi momentum
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:323
#define pWARN
Definition: Messenger.h:51
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
virtual TVector3 Momentum3(void) const
Definition: NuclearModelI.h:59
static string AsString(INukeFateHN_t fate)
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
const int kPdgPiM
Definition: PDGCodes.h:133
TLorentzVector fRemnP4
P4 of remnant system.
virtual bool GenerateNucleon(const Target &) const =0
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
const int kPdgProton
Definition: PDGCodes.h:62
bool TwoBodyCollision(GHepRecord *ev, int pcode, int tcode, int scode, int s2code, double C3CM, GHepParticle *p, GHepParticle *t, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, EINukeMode mode=kIMdHA)
Intranuke utility functions.
#define pNOTICE
Definition: Messenger.h:52
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
const int kPdgNeutron
Definition: PDGCodes.h:64
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
#define pDEBUG
Definition: Messenger.h:54
void SetPdgCode(int c)
virtual string genie::HNIntranuke2015::GetINukeMode ( ) const
inlinevirtual

Reimplemented from genie::Intranuke2015.

Definition at line 62 of file HNIntranuke2015.h.

62 {return "hN2015";};
INukeFateHN_t HNIntranuke2015::HadronFateHN ( const GHepParticle p) const
private

Definition at line 205 of file HNIntranuke2015.cxx.

206 {
207 // Select a hadron fate in HN mode
208 //
209  RandomGen * rnd = RandomGen::Instance();
210 
211  // get pdgc code & kinetic energy in MeV
212  int pdgc = p->Pdg();
213  double ke = p->KinE() / units::MeV;
214 
215  bool isPion = (pdgc == kPdgPiP or pdgc == kPdgPi0 or pdgc == kPdgPiM);
216 
217  if (isPion and fUseOset and ke < 350.0) return HadronFateOset ();
218 
219  LOG("HNIntranuke2015", pNOTICE)
220  << "Selecting hN fate for " << p->Name() << " with KE = " << ke << " MeV";
221 
222  // try to generate a hadron fate
223  unsigned int iter = 0;
224  while(iter++ < kRjMaxIterations) {
225 
226  // handle pions
227  //
228  if (pdgc==kPdgPiP || pdgc==kPdgPiM || pdgc==kPdgPi0) {
229 
230  double frac_cex = this->FateWeight(pdgc, kIHNFtCEx)
231  * fHadroData2015->Frac(pdgc, kIHNFtCEx, ke, fRemnA, fRemnZ);
232  double frac_elas = this->FateWeight(pdgc, kIHNFtElas)
233  * fHadroData2015->Frac(pdgc, kIHNFtElas, ke, fRemnA, fRemnZ);
234  double frac_inel = this->FateWeight(pdgc, kIHNFtInelas)
235  * fHadroData2015->Frac(pdgc, kIHNFtInelas, ke, fRemnA, fRemnZ);
236  double frac_abs = this->FateWeight(pdgc, kIHNFtAbs)
237  * fHadroData2015->Frac(pdgc, kIHNFtAbs, ke, fRemnA, fRemnZ);
238 
239  frac_cex *= fNucCEXFac; // scaling factors
240  frac_abs *= fNucAbsFac;
241  frac_elas *= fNucQEFac;
242  if(pdgc==kPdgPi0) frac_abs*= 0.665; //isospin factor
243 
244  LOG("HNIntranuke2015", pNOTICE)
245  << "\n frac{" << INukeHadroFates::AsString(kIHNFtCEx) << "} = " << frac_cex
246  << "\n frac{" << INukeHadroFates::AsString(kIHNFtElas) << "} = " << frac_elas
247  << "\n frac{" << INukeHadroFates::AsString(kIHNFtInelas) << "} = " << frac_inel
248  << "\n frac{" << INukeHadroFates::AsString(kIHNFtAbs) << "} = " << frac_abs;
249 
250  // compute total fraction (can be <1 if fates have been switched off)
251  double tf = frac_cex +
252  frac_elas +
253  frac_inel +
254  frac_abs;
255 
256  double r = tf * rnd->RndFsi().Rndm();
257 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
258  LOG("HNIntranuke2015", pDEBUG) << "r = " << r << " (max = " << tf << ")";
259 #endif
260 
261  double cf=0; // current fraction
262 
263  if(r < (cf += frac_cex )) return kIHNFtCEx; //cex
264  if(r < (cf += frac_elas )) return kIHNFtElas; //elas
265  if(r < (cf += frac_inel )) return kIHNFtInelas; //inelas
266  if(r < (cf += frac_abs )) return kIHNFtAbs; //abs
267 
268  LOG("HNIntranuke2015", pWARN)
269  << "No selection after going through all fates! "
270  << "Total fraction = " << tf << " (r = " << r << ")";
271  ////////////////////////////
272  return kIHNFtUndefined;
273  }
274 
275  // handle nucleons
276  else if (pdgc==kPdgProton || pdgc==kPdgNeutron) {
277 
278  double frac_elas = this->FateWeight(pdgc, kIHNFtElas)
279  * fHadroData2015->Frac(pdgc, kIHNFtElas, ke, fRemnA, fRemnZ);
280  double frac_inel = this->FateWeight(pdgc, kIHNFtInelas)
281  * fHadroData2015->Frac(pdgc, kIHNFtInelas, ke, fRemnA, fRemnZ);
282  double frac_cmp = this->FateWeight(pdgc, kIHNFtCmp)
283  * fHadroData2015->Frac(pdgc, kIHNFtCmp, ke, fRemnA , fRemnZ);
284 
285  LOG("HNIntranuke2015", pINFO)
286  << "\n frac{" << INukeHadroFates::AsString(kIHNFtElas) << "} = " << frac_elas
287  << "\n frac{" << INukeHadroFates::AsString(kIHNFtInelas) << "} = " << frac_inel;
288 
289  // compute total fraction (can be <1 if fates have been switched off)
290  double tf = frac_elas +
291  frac_inel +
292  frac_cmp;
293 
294  double r = tf * rnd->RndFsi().Rndm();
295 
296 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
297  LOG("HNIntranuke2015", pDEBUG) << "r = " << r << " (max = " << tf << ")";
298 #endif
299 
300  double cf=0; // current fraction
301  if(r < (cf += frac_elas )) return kIHNFtElas; // elas
302  if(r < (cf += frac_inel )) return kIHNFtInelas; // inelas
303  if(r < (cf += frac_cmp )) return kIHNFtCmp; // cmp
304 
305  LOG("HNIntranuke2015", pWARN)
306  << "No selection after going through all fates! "
307  << "Total fraction = " << tf << " (r = " << r << ")";
308  //////////////////////////
309  return kIHNFtUndefined;
310  }
311 
312  // handle gamma -- does not currently consider the elastic case
313  else if (pdgc==kPdgGamma) return kIHNFtInelas;
314  // Handle kaon -- elastic + charge exchange
315  else if (pdgc==kPdgKP){
316  double frac_cex = this->FateWeight(pdgc, kIHNFtCEx)
317  * fHadroData2015->Frac(pdgc, kIHNFtCEx, ke, fRemnA, fRemnZ);
318  double frac_elas = this->FateWeight(pdgc, kIHNFtElas)
319  * fHadroData2015->Frac(pdgc, kIHNFtElas, ke, fRemnA, fRemnZ);
320 
321  // frac_cex *= fNucCEXFac; // scaling factors
322  // frac_elas *= fNucQEFac; // Flor - Correct scaling factors?
323 
324  LOG("HNIntranuke", pINFO)
325  << "\n frac{" << INukeHadroFates::AsString(kIHNFtCEx) << "} = " << frac_cex
326  << "\n frac{" << INukeHadroFates::AsString(kIHNFtElas) << "} = " << frac_elas;
327 
328  // compute total fraction (can be <1 if fates have been switched off)
329  double tf = frac_cex +
330  frac_elas;
331 
332  double r = tf * rnd->RndFsi().Rndm();
333 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
334  LOG("HNIntranuke", pDEBUG) << "r = " << r << " (max = " << tf << ")";
335 #endif
336 
337  double cf=0; // current fraction
338 
339  if(r < (cf += frac_cex )) return kIHNFtCEx; //cex
340  if(r < (cf += frac_elas )) return kIHNFtElas; //elas
341 
342  LOG("HNIntranuke", pWARN)
343  << "No selection after going through all fates! "
344  << "Total fraction = " << tf << " (r = " << r << ")";
345  ////////////////////////////
346  return kIHNFtUndefined;
347  }//End K+
348 
349  /*else if (pdgc==kPdgKM){
350 
351  return kIHNFtElas;
352  }//End K-*/
353 
354  }//iterations
355 
356  return kIHNFtUndefined;
357 }
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
bool fUseOset
Oset model for low energy pion in hN.
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
static const double MeV
Definition: Units.h:130
Definition: tf_graph.h:23
double Frac(int hpdgc, INukeFateHN_t fate, double ke, int targA=0, int targZ=0) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
int Pdg(void) const
Definition: GHepParticle.h:64
string Name(void) const
Name that corresponds to the PDG code.
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
Definition: Intranuke2015.h:95
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
double FateWeight(int pdgc, INukeFateHN_t fate) const
const int kPdgGamma
Definition: PDGCodes.h:163
const int kPdgKP
Definition: PDGCodes.h:146
const int kPdgPiP
Definition: PDGCodes.h:132
const int kPdgPi0
Definition: PDGCodes.h:134
#define pINFO
Definition: Messenger.h:53
#define pWARN
Definition: Messenger.h:51
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
static string AsString(INukeFateHN_t fate)
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
const int kPdgPiM
Definition: PDGCodes.h:133
const int kPdgProton
Definition: PDGCodes.h:62
#define pNOTICE
Definition: Messenger.h:52
static const unsigned int kRjMaxIterations
Definition: Controls.h:27
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
const int kPdgNeutron
Definition: PDGCodes.h:64
double fNucAbsFac
absorption xsec correction factor (hN Mode)
#define pDEBUG
Definition: Messenger.h:54
double fNucCEXFac
charge exchange xsec correction factor (hN Mode)
INukeFateHN_t HadronFateOset() const
INukeFateHN_t HNIntranuke2015::HadronFateOset ( ) const
private

Definition at line 1012 of file HNIntranuke2015.cxx.

1013 {
1014  //LOG("HNIntranuke2015", pWARN) << "IN HadronFateOset";
1015 
1016  //LOG("HNIntranuke2015", pWARN) << "{ frac abs = " << osetUtils::currentInstance->getAbsorptionFraction();
1017  //LOG("HNIntranuke2015", pWARN) << " frac cex = " << osetUtils::currentInstance->getCexFraction() << " }";
1018 
1019  const double fractionAbsorption = osetUtils::currentInstance->
1020  getAbsorptionFraction();
1021  const double fractionCex = osetUtils::currentInstance->getCexFraction ();
1022 
1023  RandomGen *randomGenerator = RandomGen::Instance();
1024  const double randomNumber = randomGenerator->RndFsi().Rndm();
1025 
1026  //LOG("HNIntranuke2015", pWARN) << "{ frac abs = " << fractionAbsorption;
1027  //LOG("HNIntranuke2015", pWARN) << " frac cex = " << fractionCex;
1028  //LOG("HNIntranuke2015", pWARN) << " frac elas = " << 1-fractionAbsorption-fractionCex << " }";
1029 
1030  if (randomNumber < fractionAbsorption && fRemnA > 1) return kIHNFtAbs;
1031  else if (randomNumber < fractionAbsorption + fractionCex) return kIHNFtCEx;
1032  else return kIHNFtElas;
1033 }
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
INukeOset * currentInstance
Definition: INukeOset.cxx:5
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
double getCexFraction() const
return fraction of cex events
Definition: INukeOset.h:53
int HNIntranuke2015::HandleCompoundNucleus ( GHepRecord ev,
GHepParticle p,
int  mom 
) const
privatevirtual

Implements genie::Intranuke2015.

Definition at line 912 of file HNIntranuke2015.cxx.

913 {
914 
915  // handle compound nucleus option
916  // -- Call the PreEquilibrium function
918  { // random number generator
919  RandomGen * rnd = RandomGen::Instance();
920 
921  double rpreeq = rnd->RndFsi().Rndm(); // sdytman test
922 
923  if((p->KinE() < fEPreEq) )
924  {
925  if(fRemnA>5&&rpreeq<0.12)
926  {
927  GHepParticle * sp = new GHepParticle(*p);
928  sp->SetFirstMother(mom);
931  delete sp;
932  return 2;
933  }
934  else
935  {
936  // nothing left to interact with!
937  LOG("HNIntranuke2015", pNOTICE)
938  << "*** Nothing left to interact with, escaping.";
939  GHepParticle * sp = new GHepParticle(*p);
940  sp->SetFirstMother(mom);
942  ev->AddParticle(*sp);
943  delete sp;
944  return 1;
945  }
946  }
947  }
948  return 0;
949 }
void SetFirstMother(int m)
Definition: GHepParticle.h:131
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
Definition: RandomGen.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
double fNucRmvE
binding energy to subtract from cascade nucleons
bool IsInNucleus(const GHepParticle *p) const
double fEPreEq
threshold for pre-equilibrium reaction
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
int Pdg(void) const
Definition: GHepParticle.h:64
void PreEquilibrium(GHepRecord *ev, GHepParticle *p, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, const NuclearModelI *Nuclmodel, double NucRmvE, EINukeMode mode=kIMdHN)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
bool fDoCompoundNucleus
whether or not to do compound nucleus considerations
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
bool fDoFermi
whether or not to do fermi mom.
double fFermiFac
testing parameter to modify fermi momentum
double KinE(bool mass_from_pdg=false) const
Get kinetic energy.
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:125
bool IsNeutronOrProton(int pdgc)
Definition: PDGUtils.cxx:321
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
TLorentzVector fRemnP4
P4 of remnant system.
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
#define pNOTICE
Definition: Messenger.h:52
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
bool HNIntranuke2015::HandleCompoundNucleusHN ( GHepRecord ev,
GHepParticle p 
) const
private

Definition at line 951 of file HNIntranuke2015.cxx.

952 {
953  return (this->HandleCompoundNucleus(ev,p,p->FirstMother())==2);
954 }
int FirstMother(void) const
Definition: GHepParticle.h:67
int HandleCompoundNucleus(GHepRecord *ev, GHepParticle *p, int mom) const
void HNIntranuke2015::InelasticHN ( GHepRecord ev,
GHepParticle p 
) const
private

Definition at line 768 of file HNIntranuke2015.cxx.

769 {
770  // Aaron Meyer (Jan 2010)
771  // Updated version of InelasticHN
772 
773  GHepParticle * s1 = new GHepParticle(*p);
774  GHepParticle * s2 = new GHepParticle(*p);
775  GHepParticle * s3 = new GHepParticle(*p);
776 
778  {
779  // set status of particles and return
780 
784 
785  ev->AddParticle(*s1);
786  ev->AddParticle(*s2);
787  ev->AddParticle(*s3);
788  }
789  else
790  {
791  delete s1; //added to prevent potential memory leak
792  delete s2;
793  delete s3;
794 
795  LOG("HNIntranuke2015", pNOTICE) << "Error: could not create pion production final state";
797  exception.SetReason("PionProduction in hN failed");
798  throw exception;
799  }
800 
801  delete s1;
802  delete s2;
803  delete s3;
804  return;
805 
806 }
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
double fFermiMomentum
whether or not particle collision is pauli blocked
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
bool fDoFermi
whether or not to do fermi mom.
bool PionProduction(GHepRecord *ev, GHepParticle *p, GHepParticle *s1, GHepParticle *s2, GHepParticle *s3, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, double FermiMomentum, const NuclearModelI *Nuclmodel)
double fFermiFac
testing parameter to modify fermi momentum
void SetStatus(GHepStatus_t s)
Definition: GHepParticle.h:125
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
TLorentzVector fRemnP4
P4 of remnant system.
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
#define pNOTICE
Definition: Messenger.h:52
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void HNIntranuke2015::LoadConfig ( void  )
privatevirtual

Implements genie::Intranuke2015.

Definition at line 956 of file HNIntranuke2015.cxx.

957 {
959  const Registry * gc = confp->GlobalParameterList();
960 
961  // load hadronic cross sections
963 
964  // fermi momentum setup
966  fNuclmodel = dynamic_cast<const NuclearModelI *>
967  (fAlgf->GetAlgorithm("genie::FGMBodekRitchie","Default"));
968 
969  // other intranuke config params
970  fR0 = fConfig->GetDoubleDef ("R0", gc->GetDouble("NUCL-R0")); // fm
971  fNR = fConfig->GetDoubleDef ("NR", gc->GetDouble("NUCL-NR"));
972  fNucRmvE = fConfig->GetDoubleDef ("NucRmvE", gc->GetDouble("INUKE-NucRemovalE")); // GeV
973  fDelRPion = fConfig->GetDoubleDef ("DelRPion", gc->GetDouble("HNINUKE-DelRPion"));
974  fDelRNucleon = fConfig->GetDoubleDef ("DelRNucleon", gc->GetDouble("HNINUKE-DelRNucleon"));
975  fHadStep = fConfig->GetDoubleDef ("HadStep", gc->GetDouble("INUKE-HadStep")); // fm
976  fNucAbsFac = fConfig->GetDoubleDef ("NucAbsFac", gc->GetDouble("INUKE-NucAbsFac"));
977  fNucQEFac = fConfig->GetDoubleDef ("NucQEFac", gc->GetDouble("INUKE-NucQEFac"));
978  fNucCEXFac = fConfig->GetDoubleDef ("NucCEXFac", gc->GetDouble("INUKE-NucCEXFac"));
979  fEPreEq = fConfig->GetDoubleDef ("EPreEq", gc->GetDouble("INUKE-Energy_Pre_Eq"));
980  fFermiFac = fConfig->GetDoubleDef ("FermiFac", gc->GetDouble("INUKE-FermiFac"));
981  fFermiMomentum = fConfig->GetDoubleDef ("FermiMomentum",gc->GetDouble("INUKE-FermiMomentum"));
982  fDoFermi = fConfig->GetBoolDef ("DoFermi", gc->GetBool("INUKE-DoFermi"));
983  fFreeStep = fConfig->GetDoubleDef ("FreeStep", gc->GetDouble("INUKE-FreeStep"));
984  fDoCompoundNucleus = fConfig->GetBoolDef ("DoCompoundNucleus", gc->GetBool("INUKE-DoCompoundNucleus"));
985  //fUseOset = fConfig->GetBoolDef ("UseOset", true);
986  fUseOset = fConfig->GetBoolDef ("UseOset", gc->GetBool("HNINUKE-UseOset"));
987  fAltOset = fConfig->GetBoolDef ("AltOset", false);
988  fXsecNNCorr = fConfig->GetBoolDef ("XsecNNCorr", gc->GetBool("INUKE-XsecNNCorr"));
989 
990  // report
991  LOG("HNIntranuke2015", pINFO) << "Settings for Intranuke2015 mode: " << INukeMode::AsString(kIMdHN);
992  LOG("HNIntranuke2015", pWARN) << "R0 = " << fR0 << " fermi";
993  LOG("HNIntranuke2015", pWARN) << "NR = " << fNR;
994  LOG("HNIntranuke2015", pWARN) << "DelRPion = " << fDelRPion;
995  LOG("HNIntranuke2015", pWARN) << "DelRNucleon = " << fDelRNucleon;
996  LOG("HNIntranuke2015", pWARN) << "HadStep = " << fHadStep << " fermi";
997  LOG("HNIntranuke2015", pWARN) << "NucAbsFac = " << fNucAbsFac;
998  LOG("HNIntranuke2015", pWARN) << "NucQEFac = " << fNucQEFac;
999  LOG("HNIntranuke2015", pWARN) << "NucCEXFac = " << fNucCEXFac;
1000  LOG("HNIntranuke2015", pWARN) << "EPreEq = " << fEPreEq;
1001  LOG("HNIntranuke2015", pWARN) << "FermiFac = " << fFermiFac;
1002  LOG("HNIntranuke2015", pWARN) << "FreeStep = " << fFreeStep; // free step in fm
1003  LOG("HNIntranuke2015", pWARN) << "FermiMomtm = " << fFermiMomentum;
1004  LOG("HNIntranuke2015", pWARN) << "DoFermi? = " << ((fDoFermi)?(true):(false));
1005  LOG("HNIntranuke2015", pWARN) << "DoCmpndNuc? = " << ((fDoCompoundNucleus)?(true):(false));
1006  LOG("HNIntranuke2015", pWARN) << "useOset = " << fUseOset;
1007  LOG("HNIntranuke2015", pWARN) << "altOset = " << fAltOset;
1008  LOG("HNIntranuke2015", pWARN) << "XsecNNCorr? = " << ((fXsecNNCorr)?(true):(false));
1009 }
static string AsString(INukeMode_t mode)
Definition: INukeMode.h:41
RgDbl GetDoubleDef(RgKey key, RgDbl def_opt, bool set_def=true)
Definition: Registry.cxx:549
bool fUseOset
Oset model for low energy pion in hN.
static INukeHadroData2015 * Instance(void)
double fR0
effective nuclear size param
double fNucRmvE
binding energy to subtract from cascade nucleons
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
bool fXsecNNCorr
use nuclear medium correction for NN cross section
double fFreeStep
produced particle free stem, in fm
Pure abstract base class. Defines the NuclearModelI interface to be implemented by any physics model ...
Definition: NuclearModelI.h:42
double fEPreEq
threshold for pre-equilibrium reaction
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:488
double fFermiMomentum
whether or not particle collision is pauli blocked
double fNR
param multiplying the nuclear radius, determining how far to track hadrons beyond the "nuclear bounda...
INukeHadroData2015 * fHadroData2015
a collection of h+N,h+A data & calculations
Definition: Intranuke2015.h:95
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
bool fDoCompoundNucleus
whether or not to do compound nucleus considerations
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
bool fDoFermi
whether or not to do fermi mom.
AlgFactory * fAlgf
algorithm factory instance
Definition: Intranuke2015.h:96
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:86
double fFermiFac
testing parameter to modify fermi momentum
#define pINFO
Definition: Messenger.h:53
Registry * GlobalParameterList(void) const
#define pWARN
Definition: Messenger.h:51
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
RgBool GetBool(RgKey key) const
Definition: Registry.cxx:474
bool fAltOset
NuWro&#39;s table-based implementation (not recommended)
Registry * fConfig
config. (either owned or pointing to config pool)
Definition: Algorithm.h:122
double fDelRNucleon
factor by which Nucleon Compton wavelength gets multiplied to become nuclear size enhancement ...
RgBool GetBoolDef(RgKey key, RgBool def_opt, bool set_def=true)
Definition: Registry.cxx:539
double fHadStep
step size for intranuclear hadron transport
double fNucAbsFac
absorption xsec correction factor (hN Mode)
static AlgConfigPool * Instance()
double fDelRPion
factor by which Pion Compton wavelength gets multiplied to become nuclear size enhancement ...
double fNucCEXFac
charge exchange xsec correction factor (hN Mode)
void HNIntranuke2015::ProcessEventRecord ( GHepRecord event_rec) const
virtual

Reimplemented from genie::Intranuke2015.

Definition at line 111 of file HNIntranuke2015.cxx.

112 {
113  LOG("HNIntranuke2015", pNOTICE)
114  << "************ Running hN2015 MODE INTRANUKE ************";
115 
116  LOG("HNIntranuke2015", pWARN)
118  "Experimental code (INTRANUKE/hN model) - Run at your own risk");
119 
121 
122  LOG("HNIntranuke2015", pINFO) << "Done with this event";
123 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
#define pINFO
Definition: Messenger.h:53
#define pWARN
Definition: Messenger.h:51
virtual void ProcessEventRecord(GHepRecord *event_rec) const
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
#define pNOTICE
Definition: Messenger.h:52
void HNIntranuke2015::SimulateHadronicFinalState ( GHepRecord ev,
GHepParticle p 
) const
privatevirtual

Implements genie::Intranuke2015.

Definition at line 125 of file HNIntranuke2015.cxx.

126 {
127 // Simulate a hadron interaction for the input particle p in HN mode
128 //
129  if(!p || !ev)
130  {
131  LOG("HNIntranuke2015", pERROR) << "** Null input!";
132  return;
133  }
134 
135  // check particle id
136  int pdgc = p->Pdg();
137  bool is_pion = (pdgc==kPdgPiP || pdgc==kPdgPiM || pdgc==kPdgPi0);
138  bool is_kaon = (pdgc==kPdgKP);
139  bool is_baryon = (pdgc==kPdgProton || pdgc==kPdgNeutron);
140  bool is_gamma = (pdgc==kPdgGamma);
141  if(!(is_pion || is_baryon || is_gamma || is_kaon))
142  {
143  LOG("HNIntranuke2015", pERROR) << "** Cannot handle particle: " << p->Name();
144  return;
145  }
146  try
147  {
148  // select a fate for the input particle
149  INukeFateHN_t fate = this->HadronFateHN(p);
150 
151  // store the fate
152  ev->Particle(p->FirstMother())->SetRescatterCode((int)fate);
153 
154  if(fate == kIHNFtUndefined)
155  {
156  LOG("HNIntranuke2015", pERROR) << "** Couldn't select a fate";
157  LOG("HNIntranuke2015", pERROR) << "** Num Protons: " << fRemnZ
158  << ", Num Neutrons: "<<(fRemnA-fRemnZ);
159  LOG("HNIntranuke2015", pERROR) << "** Particle: " << "\n" << (*p);
160  //LOG("HNIntranuke2015", pERROR) << "** Event Record: " << "\n" << (*ev);
161  //p->SetStatus(kIStUndefined);
162  p->SetStatus(kIStStableFinalState);
163  ev->AddParticle(*p);
164  return;
165  }
166 
167  LOG("HNIntranuke2015", pNOTICE)
168  << "Selected " << p->Name() << " fate: " << INukeHadroFates::AsString(fate);
169 
170  // handle the reaction
171  if(fate == kIHNFtCEx || fate == kIHNFtElas)
172  {
173  this->ElasHN(ev,p,fate);
174  }
175  else if(fate == kIHNFtAbs) {this-> AbsorbHN(ev,p,fate);}
176  else if(fate == kIHNFtInelas && pdgc != kPdgGamma)
177  {
178 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
179  LOG("HNIntranuke2015", pDEBUG)
180  << "Invoking InelasticHN() for a : " << p->Name()
181  << " whose fate is : " << INukeHadroFates::AsString(fate);
182 #endif
183 
184  this-> InelasticHN(ev,p);
185  }
186  else if(fate == kIHNFtInelas && pdgc == kPdgGamma) {this-> GammaInelasticHN(ev,p,fate);}
188  else if(fate == kIHNFtNoInteraction)
189  {
190  p->SetStatus(kIStStableFinalState);
191  ev->AddParticle(*p);
192  return;
193  }
194  }
196  {
197  this->SimulateHadronicFinalState(ev,p);
198  LOG("HNIntranuke2015", pNOTICE)
199  << "retry call to SimulateHadronicFinalState ";
200  LOG("HNIntranuke2015", pNOTICE) << exception;
201 
202  }
203 }
An exception thrown by SimulateHadronState for kinematics problems. TwoBodyCollision/Kinematics used ...
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:148
void InelasticHN(GHepRecord *ev, GHepParticle *p) const
#define pERROR
Definition: Messenger.h:50
void ElasHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
double fNucRmvE
binding energy to subtract from cascade nucleons
void GammaInelasticHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
void SimulateHadronicFinalState(GHepRecord *ev, GHepParticle *p) const
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
string Name(void) const
Name that corresponds to the PDG code.
void PreEquilibrium(GHepRecord *ev, GHepParticle *p, int &RemnA, int &RemnZ, TLorentzVector &RemnP4, bool DoFermi, double FermiFac, const NuclearModelI *Nuclmodel, double NucRmvE, EINukeMode mode=kIMdHN)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:87
const NuclearModelI * fNuclmodel
nuclear model used to generate fermi momentum
Definition: Intranuke2015.h:97
const int kPdgGamma
Definition: PDGCodes.h:163
bool fDoFermi
whether or not to do fermi mom.
const int kPdgKP
Definition: PDGCodes.h:146
const int kPdgPiP
Definition: PDGCodes.h:132
const int kPdgPi0
Definition: PDGCodes.h:134
double fFermiFac
testing parameter to modify fermi momentum
enum genie::EINukeFateHN_t INukeFateHN_t
void AbsorbHN(GHepRecord *ev, GHepParticle *p, INukeFateHN_t fate) const
static string AsString(INukeFateHN_t fate)
int fRemnZ
remnant nucleus Z
Definition: Intranuke2015.h:99
const int kPdgPiM
Definition: PDGCodes.h:133
TLorentzVector fRemnP4
P4 of remnant system.
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:526
const int kPdgProton
Definition: PDGCodes.h:62
#define pNOTICE
Definition: Messenger.h:52
INukeFateHN_t HadronFateHN(const GHepParticle *p) const
int fRemnA
remnant nucleus A
Definition: Intranuke2015.h:98
const int kPdgNeutron
Definition: PDGCodes.h:64
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
#define pDEBUG
Definition: Messenger.h:54

Friends And Related Function Documentation

friend class IntranukeTester
friend

Definition at line 53 of file HNIntranuke2015.h.

Member Data Documentation

double genie::HNIntranuke2015::fNucQEFac
private

Definition at line 83 of file HNIntranuke2015.h.

int genie::HNIntranuke2015::nuclA
mutableprivate

value of A for the target nucleus in hA mode

Definition at line 80 of file HNIntranuke2015.h.


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