GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::NucDeExcitationSim Class Reference

Generates nuclear de-excitation gamma rays. More...

#include <NucDeExcitationSim.h>

Inheritance diagram for genie::NucDeExcitationSim:
Inheritance graph
[legend]
Collaboration diagram for genie::NucDeExcitationSim:
Collaboration graph
[legend]

Public Member Functions

 NucDeExcitationSim ()
 
 NucDeExcitationSim (string config)
 
 ~NucDeExcitationSim ()
 
void Configure (const Registry &config) override
 
void Configure (std::string config) override
 
void ProcessEventRecord (GHepRecord *evrec) const override
 
- Public Member Functions inherited from genie::EventRecordVisitorI
virtual ~EventRecordVisitorI ()
 
- Public Member Functions inherited from genie::Algorithm
virtual ~Algorithm ()
 
virtual void Configure (string config)
 
virtual void FindConfig (void)
 
virtual const RegistryGetConfig (void) const
 
RegistryGetOwnedConfig (void)
 
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 OxygenTargetSim (GHepRecord *evrec) const
 
void CarbonTargetSim (GHepRecord *evrec) const
 
void ArgonTargetSim (GHepRecord *evrec) const
 
void AddPhoton (GHepRecord *evrec, double E0, double t) const
 
double PhotonEnergySmearing (double E0, double t) const
 
TLorentzVector Photon4P (double E) const
 
void LoadConfig ()
 

Private Attributes

bool fDoCarbon = false
 
bool fDoArgon = false
 

Additional Inherited Members

- Static Public Member Functions inherited from genie::Algorithm
static string BuildParamVectKey (const std::string &comm_name, unsigned int i)
 
static string BuildParamVectSizeKey (const std::string &comm_name)
 
static string BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j)
 
static string BuildParamMatRowSizeKey (const std::string &comm_name)
 
static string BuildParamMatColSizeKey (const std::string &comm_name)
 
- 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)
 
RegistryExtractLocalConfig (const Registry &in) const
 
RegistryExtractLowerConfig (const Registry &in, const string &alg_key) const
 Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More...
 
template<class T >
bool GetParam (const RgKey &name, T &p, bool is_top_call=true) const
 
template<class T >
bool GetParamDef (const RgKey &name, T &p, const T &def) const
 
template<class T >
int GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
 Handle to load vectors of parameters. More...
 
int GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
template<class T >
int GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const
 Handle to load matrix of parameters. More...
 
template<class T >
int GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const
 
int GetParamMatKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const
 
int AddTopRegistry (Registry *rp, bool owns=true)
 add registry with top priority, also update ownership More...
 
int AddLowRegistry (Registry *rp, bool owns=true)
 add registry with lowest priority, also update ownership More...
 
int MergeTopRegistry (const Registry &r)
 
int AddTopRegisties (const vector< Registry * > &rs, bool owns=false)
 Add registries with top priority, also udated Ownerships. More...
 
- Protected Attributes inherited from genie::Algorithm
bool fAllowReconfig
 
bool fOwnsSubstruc
 true if it owns its substructure (sub-algs,...) More...
 
AlgId fID
 algorithm name and configuration set More...
 
vector< Registry * > fConfVect
 
vector< bool > fOwnerships
 ownership for every registry in fConfVect More...
 
AlgStatus_t fStatus
 algorithm execution status More...
 
AlgMapfOwnedSubAlgMp
 local pool for owned sub-algs (taken out of the factory pool) More...
 

Detailed Description

Generates nuclear de-excitation gamma rays.

Author
Costas Andreopoulos <c.andreopoulos cern.ch> University of Liverpool
References:
16O: H.Ejiri,Phys.Rev.C48,1442(1993); K.Kobayashi et al., Nucl.Phys.B (proc Suppl) 139 (2005)
Created:
March 05, 2008
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 31 of file NucDeExcitationSim.h.

Constructor & Destructor Documentation

NucDeExcitationSim::NucDeExcitationSim ( )

Definition at line 47 of file NucDeExcitationSim.cxx.

47  :
48 EventRecordVisitorI("genie::NucDeExcitationSim")
49 {
50 
51 }
NucDeExcitationSim::NucDeExcitationSim ( string  config)

Definition at line 53 of file NucDeExcitationSim.cxx.

53  :
54 EventRecordVisitorI("genie::NucDeExcitationSim", config)
55 {
56 
57 }
NucDeExcitationSim::~NucDeExcitationSim ( )

Definition at line 59 of file NucDeExcitationSim.cxx.

60 {
61 
62 }

Member Function Documentation

void NucDeExcitationSim::AddPhoton ( GHepRecord evrec,
double  E0,
double  t 
) const
private

Definition at line 486 of file NucDeExcitationSim.cxx.

References genie::GHepRecord::AddParticle(), genie::GHepParticle::E(), genie::GHepParticle::FirstDaughter(), genie::pdg::IsIon(), genie::kIStStableFinalState, genie::kPdgGamma, genie::GHepParticle::LastDaughter(), LOG, genie::units::MeV, genie::GHepRecord::Particle(), genie::GHepParticle::Pdg(), Photon4P(), PhotonEnergySmearing(), pNOTICE, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::GHepParticle::SetEnergy(), genie::GHepParticle::SetPx(), genie::GHepParticle::SetPy(), and genie::GHepParticle::SetPz().

Referenced by ArgonTargetSim(), CarbonTargetSim(), and OxygenTargetSim().

488 {
489 // Add a photon at the event record & recoil the remnant nucleus so as to
490 // conserve energy/momenta
491 //
492  double E = (dt>0) ? this->PhotonEnergySmearing(E0, dt) : E0;
493 
494  LOG("NucDeEx", pNOTICE)
495  << "Adding a " << E/units::MeV << " MeV photon from nucl. deexcitation";
496 
497  GHepParticle * target = evrec->Particle(1);
498  GHepParticle * remnant = 0;
499  for(int i = target->FirstDaughter(); i <= target->LastDaughter(); i++) {
500  remnant = evrec->Particle(i);
501  if(pdg::IsIon(remnant->Pdg())) break;
502  }
503 
504  TLorentzVector x4(0,0,0,0);
505  TLorentzVector p4 = this->Photon4P(E);
506  GHepParticle gamma(kPdgGamma, kIStStableFinalState,1,-1,-1,-1, p4, x4); // note that this assigns the parent of the photon as the initial-state nucleon/nucleus. (do we want that??)
507  evrec->AddParticle(gamma);
508 
509 
510  remnant->SetPx ( remnant->Px() - p4.Px() );
511  remnant->SetPy ( remnant->Py() - p4.Py() );
512  remnant->SetPz ( remnant->Pz() - p4.Pz() );
513  remnant->SetEnergy ( remnant->E() - p4.E() );
514 }
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:104
double PhotonEnergySmearing(double E0, double t) const
double E(void) const
Get energy.
Definition: GHepParticle.h:91
void SetPz(double pz)
int FirstDaughter(void) const
Definition: GHepParticle.h:68
TLorentzVector Photon4P(double E) const
static constexpr double MeV
Definition: Units.h:129
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:90
void SetPx(double px)
double Px(void) const
Get Px.
Definition: GHepParticle.h:88
int Pdg(void) const
Definition: GHepParticle.h:63
int LastDaughter(void) const
Definition: GHepParticle.h:69
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgGamma
Definition: PDGCodes.h:189
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:42
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:499
#define pNOTICE
Definition: Messenger.h:61
void SetEnergy(double E)
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void SetPy(double py)
double Py(void) const
Get Py.
Definition: GHepParticle.h:89
void NucDeExcitationSim::ArgonTargetSim ( GHepRecord evrec) const
private

Definition at line 555 of file NucDeExcitationSim.cxx.

References AddPhoton(), fDoArgon, genie::GHepRecord::HitNucleon(), genie::RandomGen::Instance(), genie::pdg::IsNucleon(), genie::kPdgProton, LOG, genie::GHepParticle::Pdg(), pNOTICE, and genie::RandomGen::RndDec().

Referenced by ProcessEventRecord().

556 {
557  // If we've disabled argon de-excitations, then this function is a no-op
558  if ( !fDoArgon ) return;
559 
560  LOG( "NucDeEx", pNOTICE ) << "Simulating nuclear de-excitation gamma-rays"
561  " for an argon target";
562 
563  // Load the leading gamma-ray spectra and emission probabilities from prior
564  // simulation results
565  static bool loaded_hists = false;
566  static TH1D* hist_n = nullptr;
567  static TH1D* hist_p = nullptr;
568  static double prob_gamma_n = 0.;
569  static double prob_gamma_p = 0.;
570 
571  if ( !loaded_hists ) {
572  std::string data_file_name = std::string( gSystem->Getenv("GENIE") )
573  + "/data/evgen/nucl/marley_argon_sf_lead_gamma_hists.root";
574 
575  TFile data_file( data_file_name.c_str(), "read" );
576 
577  TParameter< double >* prob_n = nullptr;
578  TParameter< double >* prob_p = nullptr;
579 
580  data_file.GetObject( "hist_n", hist_n );
581  data_file.GetObject( "hist_p", hist_p );
582 
583  hist_n->SetDirectory( nullptr );
584  hist_p->SetDirectory( nullptr );
585 
586  data_file.GetObject( "prob_gamma_n", prob_n );
587  data_file.GetObject( "prob_gamma_p", prob_p );
588 
589  assert( hist_n && hist_p && prob_n && prob_p );
590 
591  prob_gamma_n = prob_n->GetVal();
592  prob_gamma_p = prob_p->GetVal();
593 
594  loaded_hists = true;
595  }
596 
597  GHepParticle* hitnuc = evrec->HitNucleon();
598  if ( !hitnuc ) return;
599 
600  // Choose the appropriate gamma-ray distribution based on the struck nucleon
601  int hit_nuc_pdg = hitnuc->Pdg();
602  if ( !genie::pdg::IsNucleon(hit_nuc_pdg) ) return;
603 
604  TH1D* lead_gamma_hist = hist_n;
605  double gamma_prob = prob_gamma_n;
606  if ( hit_nuc_pdg == kPdgProton ) {
607  lead_gamma_hist = hist_p;
608  gamma_prob = prob_gamma_p;
609  }
610 
611  // Throw a random number to see if this de-excitation event contains at least
612  // one gamma-ray. If it doesn't, just return without doing anything.
614  double r_gamma = rnd->RndDec().Rndm();
615  if ( r_gamma > gamma_prob ) {
616  LOG( "NucDeEx", pNOTICE ) << "No gamma-ray emitted";
617  return;
618  }
619  // If it does, then sample the leading gamma from the pre-saved distribution
620  // and add it to the event. Note that the MARLEY histogram is in MeV, so we
621  // also convert to GeV here for consistency with GENIE conventions.
622  double E_gamma = lead_gamma_hist->GetRandom() / 1e3;
623  this->AddPhoton( evrec, E_gamma, -1. );
624 
625  LOG( "NucDeEx", pNOTICE ) << "Added gamma with energy " << E_gamma << " GeV";
626 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:346
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
int Pdg(void) const
Definition: GHepParticle.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void AddPhoton(GHepRecord *evrec, double E0, double t) const
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:313
const int kPdgProton
Definition: PDGCodes.h:81
#define pNOTICE
Definition: Messenger.h:61
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void NucDeExcitationSim::CarbonTargetSim ( GHepRecord evrec) const
private

Definition at line 378 of file NucDeExcitationSim.cxx.

References AddPhoton(), fDoCarbon, genie::GHepRecord::HitNucleon(), genie::RandomGen::Instance(), LOG, pNOTICE, and genie::RandomGen::RndDec().

Referenced by ProcessEventRecord().

379 {
380  // If we've disabled carbon de-excitations, then this function is a no-op
381  if ( !fDoCarbon ) return;
382 
383  LOG("NucDeEx", pNOTICE)
384  << "Simulating nuclear de-excitation gamma rays for Carbon target";
385 
386  GHepParticle * hitnuc = evrec->HitNucleon();
387  if(!hitnuc) return;
388 
389  // bool p_hole = (hitnuc->Pdg() == kPdgProton);
390 
391 
392 
393  double dt = -1;
394 
395  RandomGen * rnd = RandomGen::Instance();
396 
397 
398  //
399  // * Define all the data required for simulating deexcitations of n-hole states
400  //
401 
402  //std::cout << "Rik simulating n-hole in carbon " << std::endl;
403 
404  // > probabilities for creating a n-hole in the P1/2, P3/2, S1/2 shells
405  // Kamyshkov gives it a different way than the oxygen folks did.
406  // A probability for the Pstates combined, and branching fractions for S1/2
407  double Pp12 = 0.0; // 0.75/6.0; // 0.25; // P1/2 Rik says set to zero.
408  double Pp32 = 4.0/6.0; // 0.44; // P3/2
409  double Ps12 = 2.00/6.0; //0.09; // S1/2
410  //>
411  double p32Elv = 0.0020;
412  //>
413  const int ns12 = 8;
414  double s12Elv[ns12] = {0.0005, 0.0007, 0.0017, 0.0021, 0.0033, 0.0035, 0.0047, 0.0063};
415  //double s12Plv[ns12] = {0.21, 0.295, 0.14, 0.26, 0.14, 0.2, 0.03, 0.03};
416  // the above multiply by 0.2
417  double s12Plv[ns12] = {0.042, 0.059, 0.028, 0.052, 0.028, 0.04, 0.006, 0.006};
418  // the above multiply by 0.2 and by 2/6.
419  //double s12Plv[ns12] = {0.0140, 0.01967, 0.0933, 0.01733, 0.00933, 0.0133, 0.0020, 0.0020};
420 
421 
422  //double s12Elv = 0.00703;
423  //double s12Plv = 0.222;
424 
425  // Select one of the P1/2, P3/2 or S1/2
426  double rshell = rnd->RndDec().Rndm();
427  //
428  // >> P1/2 shell
429  //
430  if(rshell < Pp12) {
431  // Rik says this probability is already set to zero for Kamyshkov
432  LOG("NucDeEx", pNOTICE)
433  << "Hit nucleon left a P1/2 shell n-hole. Remnant is at g.s.";
434  return;
435  }
436  //
437  // >> P3/2 shell
438  //
439  else
440  if(rshell < Pp12 + Pp32) {
441  LOG("NucDeEx", pNOTICE)
442  << "Hit nucleon left a P3/2 shell n-hole";
443 
444  double myrand = rnd->RndDec().Rndm();
445  if(myrand < 0.2){
446  this->AddPhoton(evrec, p32Elv, dt);
447  //std::cout << "Rik made p32Elv " << p32Elv << std::endl;
448  } else {
449  //std::cout << "Rik made none p32" << std::endl;
450  }
451  }
452  //
453  // >> S1/2 shell
454  //
455  else
456  if(rshell < Pp12 + Pp32 + Ps12) {
457  LOG("NucDeEx", pNOTICE)
458  << "Hit nucleon left an S1/2 shell p-hole";
459  // Select one of the excited states caused by a S1/2 shell hole
460  double rdecmode = rnd->RndDec().Rndm();
461  double prob_sum = 0.;
462  int sel_state = -1;
463  for(int istate=0; istate<ns12; istate++) {
464  prob_sum += s12Plv[istate];
465  if(rdecmode < prob_sum) {
466  sel_state = istate;
467  break;
468  }
469  }
470  LOG("NucDeEx", pNOTICE)
471  << "Selected S1/2 excited state = " << sel_state;
472  if(sel_state >= 0){
473  this->AddPhoton(evrec, s12Elv[sel_state], dt);
474  //std::cout << "Rik made s12Elv " << s12Elv[sel_state] << std::endl;
475  } else {
476  //std::cout << "Rik made none s12" << std::endl;
477  }
478  }
479  else {
480  //std::cout << "Rik made none at all" << std::endl;
481  }
482 
483 
484 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void AddPhoton(GHepRecord *evrec, double E0, double t) const
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:313
#define pNOTICE
Definition: Messenger.h:61
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
void NucDeExcitationSim::Configure ( const Registry config)
overridevirtual

Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority

Reimplemented from genie::Algorithm.

Definition at line 628 of file NucDeExcitationSim.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

629 {
630  Algorithm::Configure( config );
631  this->LoadConfig();
632 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void NucDeExcitationSim::Configure ( std::string  config)
override

Definition at line 634 of file NucDeExcitationSim.cxx.

References genie::Algorithm::Configure(), and LoadConfig().

635 {
636  Algorithm::Configure( config );
637  this->LoadConfig();
638 }
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
void NucDeExcitationSim::LoadConfig ( void  )
private

Definition at line 640 of file NucDeExcitationSim.cxx.

References fDoArgon, fDoCarbon, and genie::Algorithm::GetParamDef().

Referenced by Configure().

641 {
642  // Boolean flag that enables/disables de-excitation handling for carbon
643  GetParamDef( "DoCarbon", fDoCarbon, false );
644 
645  // Boolean flag that enables/disables de-excitation handling for argon
646  GetParamDef( "DoArgon", fDoArgon, false );
647 }
bool GetParamDef(const RgKey &name, T &p, const T &def) const
void NucDeExcitationSim::OxygenTargetSim ( GHepRecord evrec) const
private

Definition at line 126 of file NucDeExcitationSim.cxx.

References AddPhoton(), genie::GHepRecord::HitNucleon(), genie::RandomGen::Instance(), genie::kPdgProton, LOG, genie::GHepParticle::Pdg(), pNOTICE, and genie::RandomGen::RndDec().

Referenced by ProcessEventRecord().

127 {
128  LOG("NucDeEx", pNOTICE)
129  << "Simulating nuclear de-excitation gamma rays for Oxygen target";
130 
131  //LOG("NucDeEx", pNOTICE) << *evrec;
132 
133  GHepParticle * hitnuc = evrec->HitNucleon();
134  if(!hitnuc) return;
135 
136  bool p_hole = (hitnuc->Pdg() == kPdgProton);
137  double dt = -1;
138 
139  RandomGen * rnd = RandomGen::Instance();
140 
141  //
142  // ****** P-Hole
143  //
144  if (p_hole) {
145  //
146  // * Define all the data required for simulating deexcitations of p-hole states
147  //
148 
149  // > probabilities for creating a p-hole in the P1/2, P3/2, S1/2 shells
150  double Pp12 = 0.25; // P1/2
151  double Pp32 = 0.47; // P3/2
152  double Ps12 = 1. - Pp12 - Pp32; // S1/2
153 
154  // > excited state energy levels & probabilities for P3/2-shell p-holes
155  const int np32 = 3;
156  double p32Elv[np32] = { 0.00632, 0.00993, 0.01070 };
157  double p32Plv[np32] = { 0.872, 0.064, 0.064 };
158  // - probabilities for deexcitation modes of P3/2-shell p-hole state '1'
159  double p32Plv1_1gamma = 0.78; // prob to decay via 1 gamma
160  double p32Plv1_cascade = 0.22; // prob to decay via gamma cascade
161 
162  // > excited state energy levels & probabilities for S1/2-shell p-holes
163  const int ns12 = 11;
164  double s12Elv[ns12] = {
165  0.00309, 0.00368, 0.00385, 0.00444, 0.00492,
166  0.00511, 0.00609, 0.00673, 0.00701, 0.00703, 0.00734 };
167  double s12Plv[ns12] = {
168  0.0625, 0.1875, 0.075, 0.1375, 0.1375,
169  0.0125, 0.0125, 0.075, 0.0563, 0.0563, 0.1874 };
170  // - gamma energies and probabilities for S1/2-shell p-hole excited
171  // states '2','7' and '10' with >1 deexcitation modes
172  const int ns12lv2 = 3;
173  double s12Elv2[ns12lv2] = { 0.00309, 0.00369, 0.00385 };
174  double s12Plv2[ns12lv2] = { 0.013, 0.360, 0.625 };
175  const int ns12lv7 = 2;
176  double s12Elv7[ns12lv7] = { 0.00609, 0.00673 };
177  double s12Plv7[ns12lv7] = { 0.04, 0.96 };
178  const int ns12lv10 = 3;
179  double s12Elv10[ns12lv10] = { 0.00609, 0.00673, 0.00734 };
180  double s12Plv10[ns12lv10] = { 0.050, 0.033, 0.017 };
181 
182  // Select one of the P1/2, P3/2 or S1/2
183  double rshell = rnd->RndDec().Rndm();
184  //
185  // >> P1/2 shell
186  //
187  if(rshell < Pp12) {
188  LOG("NucDeEx", pNOTICE)
189  << "Hit nucleon left a P1/2 shell p-hole. Remnant is at g.s.";
190  return;
191  }
192  //
193  // >> P3/2 shell
194  //
195  else
196  if(rshell < Pp12 + Pp32) {
197  LOG("NucDeEx", pNOTICE)
198  << "Hit nucleon left a P3/2 shell p-hole";
199  // Select one of the excited states
200  double rdecmode = rnd->RndDec().Rndm();
201  double prob_sum = 0;
202  int sel_state = -1;
203  for(int istate=0; istate<np32; istate++) {
204  prob_sum += p32Plv[istate];
205  if(rdecmode < prob_sum) {
206  sel_state = istate;
207  break;
208  }
209  }
210  LOG("NucDeEx", pNOTICE)
211  << "Selected P3/2 excited state = " << sel_state;
212 
213  // Decay that excited state
214  // >> 6.32 MeV state
215  if(sel_state==0) {
216  this->AddPhoton(evrec, p32Elv[0], dt);
217  }
218  // >> 9.93 MeV state
219  else
220  if(sel_state==1) {
221  double r = rnd->RndDec().Rndm();
222  // >>> emit a single gamma
223  if(r < p32Plv1_1gamma) {
224  this->AddPhoton(evrec, p32Elv[1], dt);
225  }
226  // >>> emit a cascade of gammas
227  else
228  if(r < p32Plv1_1gamma + p32Plv1_cascade) {
229  this->AddPhoton(evrec, p32Elv[1], dt);
230  this->AddPhoton(evrec, p32Elv[1]-p32Elv[0], dt);
231  }
232  }
233  // >> 10.7 MeV state
234  else
235  if(sel_state==2) {
236  // Above the particle production threshold - need to emit
237  // a 0.5 MeV kinetic energy proton.
238  // Will neglect that given that it is a very low energy
239  // kinetic energy nucleon and the intranuke break-up nucleon
240  // cross sections are already tuned.
241  return;
242  }
243  } //p3/2
244  //
245  // >> S1/2 shell
246  //
247  else if (rshell < Pp12 + Pp32 + Ps12) {
248  LOG("NucDeEx", pNOTICE)
249  << "Hit nucleon left an S1/2 shell p-hole";
250  // Select one of the excited states caused by a S1/2 shell hole
251  double rdecmode = rnd->RndDec().Rndm();
252  double prob_sum = 0;
253  int sel_state = -1;
254  for(int istate=0; istate<ns12; istate++) {
255  prob_sum += s12Plv[istate];
256  if(rdecmode < prob_sum) {
257  sel_state = istate;
258  break;
259  }
260  }
261  LOG("NucDeEx", pNOTICE)
262  << "Selected S1/2 excited state = " << sel_state;
263 
264  // Decay that excited state
265  bool multiple_decay_modes =
266  (sel_state==2 || sel_state==7 || sel_state==10);
267  if(!multiple_decay_modes) {
268  this->AddPhoton(evrec, s12Elv[sel_state], dt);
269  } else {
270  int ndec = -1;
271  double * pdec = 0, * edec = 0;
272  switch(sel_state) {
273  case(2) :
274  ndec = ns12lv2; pdec = s12Plv2; edec = s12Elv2;
275  break;
276  case(7) :
277  ndec = ns12lv7; pdec = s12Plv7; edec = s12Elv7;
278  break;
279  case(10) :
280  ndec = ns12lv10; pdec = s12Plv10; edec = s12Elv10;
281  break;
282  default:
283  return;
284  }
285  double r = rnd->RndDec().Rndm();
286  double decmode_prob_sum = 0;
287  int sel_decmode = -1;
288  for(int idecmode=0; idecmode < ndec; idecmode++) {
289  decmode_prob_sum += pdec[idecmode];
290  if(r < decmode_prob_sum) {
291  sel_decmode = idecmode;
292  break;
293  }
294  }
295  if(sel_decmode == -1) return;
296  this->AddPhoton(evrec, edec[sel_decmode], dt);
297  }//mult.dec.ch
298 
299  } // s1/2
300  else {
301  }
302  } // p-hole
303 
304  //
305  // ****** n-hole
306  //
307  else {
308  //
309  // * Define all the data required for simulating deexcitations of n-hole states
310  //
311 
312  // > probabilities for creating a n-hole in the P1/2, P3/2, S1/2 shells
313  double Pp12 = 0.25; // P1/2
314  double Pp32 = 0.44; // P3/2
315  double Ps12 = 0.09; // S1/2
316  //>
317  double p32Elv = 0.00618;
318  //>
319  double s12Elv = 0.00703;
320  double s12Plv = 0.222;
321 
322  // Select one of the P1/2, P3/2 or S1/2
323  double rshell = rnd->RndDec().Rndm();
324  //
325  // >> P1/2 shell
326  //
327  if(rshell < Pp12) {
328  LOG("NucDeEx", pNOTICE)
329  << "Hit nucleon left a P1/2 shell n-hole. Remnant is at g.s.";
330  return;
331  }
332  //
333  // >> P3/2 shell
334  //
335  else
336  if(rshell < Pp12 + Pp32) {
337  LOG("NucDeEx", pNOTICE)
338  << "Hit nucleon left a P3/2 shell n-hole";
339  this->AddPhoton(evrec, p32Elv, dt);
340  }
341  //
342  // >> S1/2 shell
343  //
344  else
345  if(rshell < Pp12 + Pp32 + Ps12) {
346  LOG("NucDeEx", pNOTICE)
347  << "Hit nucleon left a S1/2 shell n-hole";
348  // only one of the deexcitation modes involve a (7.03 MeV) photon
349  double r = rnd->RndDec().Rndm();
350  if(r < s12Plv) this->AddPhoton(evrec, s12Elv,dt);
351  }
352  else {
353  }
354  } //n-hole
355 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
int Pdg(void) const
Definition: GHepParticle.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
void AddPhoton(GHepRecord *evrec, double E0, double t) const
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:313
const int kPdgProton
Definition: PDGCodes.h:81
#define pNOTICE
Definition: Messenger.h:61
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
TLorentzVector NucDeExcitationSim::Photon4P ( double  E) const
private

Definition at line 533 of file NucDeExcitationSim.cxx.

References genie::RandomGen::Instance(), genie::constants::kPi, and genie::RandomGen::RndDec().

Referenced by AddPhoton().

534 {
535 // Generate a photon 4p
536 
537  RandomGen * rnd = RandomGen::Instance();
538 
539  double costheta = -1. + 2. * rnd->RndDec().Rndm();
540  double sintheta = TMath::Sqrt(TMath::Max(0., 1.-TMath::Power(costheta,2)));
541  double phi = 2*kPi * rnd->RndDec().Rndm();
542  double cosphi = TMath::Cos(phi);
543  double sinphi = TMath::Sin(phi);
544 
545  double px = E * sintheta * cosphi;
546  double py = E * sintheta * sinphi;
547  double pz = E * costheta;
548 
549  TLorentzVector p4(px,py,pz,E);
550  return p4;
551 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
double NucDeExcitationSim::PhotonEnergySmearing ( double  E0,
double  t 
) const
private

Definition at line 516 of file NucDeExcitationSim.cxx.

References genie::RandomGen::Instance(), genie::constants::kPlankConstant, LOG, pNOTICE, genie::RandomGen::RndDec(), and genie::units::s.

Referenced by AddPhoton().

517 {
518 // Returns the smeared energy of the emitted gamma
519 // E0 : energy of the excited state (GeV)
520 // dt: excited state lifetime (sec)
521 //
522  double dE = kPlankConstant / (dt*units::s);
523 
524  RandomGen * rnd = RandomGen::Instance();
525  double E = rnd->RndDec().Gaus(E0 /*mean*/, dE /*sigma*/);
526 
527  LOG("NucDeEx", pNOTICE)
528  << "<E> = " << E0 << ", dE = " << dE << " -> E = " << E;
529 
530  return E;
531 }
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
static constexpr double s
Definition: Units.h:95
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pNOTICE
Definition: Messenger.h:61
static const double kPlankConstant
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
void NucDeExcitationSim::ProcessEventRecord ( GHepRecord evrec) const
overridevirtual

Implements genie::EventRecordVisitorI.

Definition at line 64 of file NucDeExcitationSim.cxx.

References ArgonTargetSim(), CarbonTargetSim(), genie::RandomGen::Instance(), genie::ProcessInfo::IsDeepInelastic(), genie::ProcessInfo::IsMEC(), genie::ProcessInfo::IsQuasiElastic(), genie::ProcessInfo::IsResonant(), LOG, OxygenTargetSim(), pINFO, pNOTICE, genie::Interaction::ProcInfo(), genie::RandomGen::RndDec(), genie::GHepRecord::Summary(), genie::GHepRecord::TargetNucleus(), and genie::GHepParticle::Z().

65 {
66  LOG("NucDeEx", pNOTICE)
67  << "Simulating nuclear de-excitation gamma rays";
68 
69  GHepParticle * nucltgt = evrec->TargetNucleus();
70  if (!nucltgt) {
71  LOG("NucDeEx", pINFO)
72  << "No nuclear target found - Won't simulate nuclear de-excitation";
73  return;
74  }
75 
76  if(nucltgt->Z()==8) this->OxygenTargetSim(evrec);
77 
78  // if oxygen, keep the existing genie behavior
79 
80  // if not oxygen, only simulate these for QE events
81  // double nucleon knockout produces fewer photons.
82  // too much energy and it all leaves as nucleon ejection.
83  // either set them to zero, or set them to 1/10 probability.
84  // proc_info.IsQuasiElastic();
85  // RIK TODO still need to test that this works.
86  // Then move the photon spectrom to p-hole too
87  // Then activate for Argon.
88  // Then make plots of the spectra.
89  // do not do this for coherent ? MEC, RES, DIS only ?
90  // ask if the exotic processes are used and should get it.
91 
93 
94  if(evrec->Summary()->ProcInfo().IsQuasiElastic()){ // || rand < 0.1}
95  //suppress_probability_factor = 1.0;
96  if(nucltgt->Z()==6) this->CarbonTargetSim(evrec);
97  // simulate argon with a dedicated calculation
98  if(nucltgt->Z()==18) this->ArgonTargetSim(evrec);
99  } else if(evrec->Summary()->ProcInfo().IsResonant() ||
100  evrec->Summary()->ProcInfo().IsMEC() ||
101  evrec->Summary()->ProcInfo().IsDeepInelastic()){
102 
103  double suppress_probability_factor = 0.20;
104  // deexcitation is less likely after multiple nucleon knockout
105  // because there is too much energy.
106  // the decay will happen via nucleon or alpha ejection
107  // and the KE will be carried away in that fashion, not gamma.
108  if(rnd->RndDec().Rndm() < suppress_probability_factor){
109  if(nucltgt->Z()==6) this->CarbonTargetSim(evrec);
110  // simulate argon with the same probabilities.
111  // Argoneut using FLUKA says
112  if(nucltgt->Z()==18) this->ArgonTargetSim(evrec);
113  } else {
114  //std::cout << "Rik made none nonQE " << std::endl;
115  }
116 
117  }
118 
119 
120  // else if rand < 0.1
121 
122  LOG("NucDeEx", pINFO)
123  << "Done with this event";
124 }
bool IsResonant(void) const
Definition: ProcessInfo.cxx:99
int Z(void) const
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:71
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:69
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:29
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:293
#define pINFO
Definition: Messenger.h:62
bool IsMEC(void) const
void ArgonTargetSim(GHepRecord *evrec) const
bool IsDeepInelastic(void) const
Definition: ProcessInfo.cxx:89
void OxygenTargetSim(GHepRecord *evrec) const
void CarbonTargetSim(GHepRecord *evrec) const
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
#define pNOTICE
Definition: Messenger.h:61
TRandom3 & RndDec(void) const
rnd number generator used by decay models
Definition: RandomGen.h:56
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39

Member Data Documentation

bool genie::NucDeExcitationSim::fDoArgon = false
private

Definition at line 56 of file NucDeExcitationSim.h.

Referenced by ArgonTargetSim(), and LoadConfig().

bool genie::NucDeExcitationSim::fDoCarbon = false
private

Definition at line 55 of file NucDeExcitationSim.h.

Referenced by CarbonTargetSim(), and LoadConfig().


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