17 #include <TParameter.h>
21 #include "Framework/Conventions/GBuild.h"
39 using std::ostringstream;
41 using namespace genie;
42 using namespace genie::utils;
43 using namespace genie::constants;
44 using namespace genie::controls;
67 <<
"Simulating nuclear de-excitation gamma rays";
72 <<
"No nuclear target found - Won't simulate nuclear de-excitation";
103 double suppress_probability_factor = 0.20;
108 if(rnd->
RndDec().Rndm() < suppress_probability_factor){
123 <<
"Done with this event";
129 <<
"Simulating nuclear de-excitation gamma rays for Oxygen target";
152 double Ps12 = 1. - Pp12 - Pp32;
156 double p32Elv[np32] = { 0.00632, 0.00993, 0.01070 };
157 double p32Plv[np32] = { 0.872, 0.064, 0.064 };
159 double p32Plv1_1gamma = 0.78;
160 double p32Plv1_cascade = 0.22;
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 };
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 };
183 double rshell = rnd->
RndDec().Rndm();
189 <<
"Hit nucleon left a P1/2 shell p-hole. Remnant is at g.s.";
196 if(rshell < Pp12 + Pp32) {
198 <<
"Hit nucleon left a P3/2 shell p-hole";
200 double rdecmode = rnd->
RndDec().Rndm();
203 for(
int istate=0; istate<np32; istate++) {
204 prob_sum += p32Plv[istate];
205 if(rdecmode < prob_sum) {
211 <<
"Selected P3/2 excited state = " << sel_state;
221 double r = rnd->
RndDec().Rndm();
223 if(r < p32Plv1_1gamma) {
228 if(r < p32Plv1_1gamma + p32Plv1_cascade) {
230 this->
AddPhoton(evrec, p32Elv[1]-p32Elv[0], dt);
247 else if (rshell < Pp12 + Pp32 + Ps12) {
249 <<
"Hit nucleon left an S1/2 shell p-hole";
251 double rdecmode = rnd->
RndDec().Rndm();
254 for(
int istate=0; istate<ns12; istate++) {
255 prob_sum += s12Plv[istate];
256 if(rdecmode < prob_sum) {
262 <<
"Selected S1/2 excited state = " << sel_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);
271 double * pdec = 0, * edec = 0;
274 ndec = ns12lv2; pdec = s12Plv2; edec = s12Elv2;
277 ndec = ns12lv7; pdec = s12Plv7; edec = s12Elv7;
280 ndec = ns12lv10; pdec = s12Plv10; edec = s12Elv10;
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;
295 if(sel_decmode == -1)
return;
296 this->
AddPhoton(evrec, edec[sel_decmode], dt);
317 double p32Elv = 0.00618;
319 double s12Elv = 0.00703;
320 double s12Plv = 0.222;
323 double rshell = rnd->
RndDec().Rndm();
329 <<
"Hit nucleon left a P1/2 shell n-hole. Remnant is at g.s.";
336 if(rshell < Pp12 + Pp32) {
338 <<
"Hit nucleon left a P3/2 shell n-hole";
345 if(rshell < Pp12 + Pp32 + Ps12) {
347 <<
"Hit nucleon left a S1/2 shell n-hole";
349 double r = rnd->
RndDec().Rndm();
350 if(r < s12Plv) this->
AddPhoton(evrec, s12Elv,dt);
384 <<
"Simulating nuclear de-excitation gamma rays for Carbon target";
408 double Pp32 = 4.0/6.0;
409 double Ps12 = 2.00/6.0;
411 double p32Elv = 0.0020;
414 double s12Elv[ns12] = {0.0005, 0.0007, 0.0017, 0.0021, 0.0033, 0.0035, 0.0047, 0.0063};
417 double s12Plv[ns12] = {0.042, 0.059, 0.028, 0.052, 0.028, 0.04, 0.006, 0.006};
426 double rshell = rnd->
RndDec().Rndm();
433 <<
"Hit nucleon left a P1/2 shell n-hole. Remnant is at g.s.";
440 if(rshell < Pp12 + Pp32) {
442 <<
"Hit nucleon left a P3/2 shell n-hole";
444 double myrand = rnd->
RndDec().Rndm();
456 if(rshell < Pp12 + Pp32 + Ps12) {
458 <<
"Hit nucleon left an S1/2 shell p-hole";
460 double rdecmode = rnd->
RndDec().Rndm();
461 double prob_sum = 0.;
463 for(
int istate=0; istate<ns12; istate++) {
464 prob_sum += s12Plv[istate];
465 if(rdecmode < prob_sum) {
471 <<
"Selected S1/2 excited state = " << sel_state;
473 this->
AddPhoton(evrec, s12Elv[sel_state], dt);
487 GHepRecord * evrec,
double E0,
double dt)
const
495 <<
"Adding a " << E/
units::MeV <<
" MeV photon from nucl. deexcitation";
504 TLorentzVector x4(0,0,0,0);
505 TLorentzVector p4 = this->
Photon4P(E);
510 remnant->
SetPx ( remnant->
Px() - p4.Px() );
511 remnant->
SetPy ( remnant->
Py() - p4.Py() );
512 remnant->
SetPz ( remnant->
Pz() - p4.Pz() );
525 double E = rnd->
RndDec().Gaus(E0 , dE );
528 <<
"<E> = " << E0 <<
", dE = " << dE <<
" -> E = " << E;
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);
545 double px = E * sintheta * cosphi;
546 double py = E * sintheta * sinphi;
547 double pz = E * costheta;
549 TLorentzVector p4(px,py,pz,E);
560 LOG(
"NucDeEx",
pNOTICE ) <<
"Simulating nuclear de-excitation gamma-rays"
561 " for an argon target";
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.;
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";
575 TFile data_file( data_file_name.c_str(),
"read" );
577 TParameter< double >* prob_n =
nullptr;
578 TParameter< double >* prob_p =
nullptr;
580 data_file.GetObject(
"hist_n", hist_n );
581 data_file.GetObject(
"hist_p", hist_p );
583 hist_n->SetDirectory(
nullptr );
584 hist_p->SetDirectory(
nullptr );
586 data_file.GetObject(
"prob_gamma_n", prob_n );
587 data_file.GetObject(
"prob_gamma_p", prob_p );
589 assert( hist_n && hist_p && prob_n && prob_p );
591 prob_gamma_n = prob_n->GetVal();
592 prob_gamma_p = prob_p->GetVal();
598 if ( !hitnuc )
return;
601 int hit_nuc_pdg = hitnuc->
Pdg();
604 TH1D* lead_gamma_hist = hist_n;
605 double gamma_prob = prob_gamma_n;
607 lead_gamma_hist = hist_p;
608 gamma_prob = prob_gamma_p;
614 double r_gamma = rnd->
RndDec().Rndm();
615 if ( r_gamma > gamma_prob ) {
616 LOG(
"NucDeEx",
pNOTICE ) <<
"No gamma-ray emitted";
622 double E_gamma = lead_gamma_hist->GetRandom() / 1e3;
625 LOG(
"NucDeEx",
pNOTICE ) <<
"Added gamma with energy " << E_gamma <<
" GeV";
bool IsResonant(void) const
virtual GHepParticle * Particle(int position) const
double PhotonEnergySmearing(double E0, double t) const
double E(void) const
Get energy.
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
int FirstDaughter(void) const
bool IsQuasiElastic(void) const
static constexpr double s
TLorentzVector Photon4P(double E) const
static constexpr double MeV
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double Pz(void) const
Get Pz.
double Px(void) const
Get Px.
int LastDaughter(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual void Configure(const Registry &config)
virtual GHepParticle * TargetNucleus(void) const
void AddPhoton(GHepRecord *evrec, double E0, double t) const
void ArgonTargetSim(GHepRecord *evrec) const
bool IsDeepInelastic(void) const
void OxygenTargetSim(GHepRecord *evrec) const
A registry. Provides the container for algorithm configuration parameters.
virtual GHepParticle * HitNucleon(void) const
void CarbonTargetSim(GHepRecord *evrec) const
virtual void AddParticle(const GHepParticle &p)
const ProcessInfo & ProcInfo(void) const
bool GetParamDef(const RgKey &name, T &p, const T &def) const
static const double kPlankConstant
GENIE's GHEP MC event record.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
TRandom3 & RndDec(void) const
rnd number generator used by decay models
STDHEP-like event record entry that can fit a particle or a nucleus.
void ProcessEventRecord(GHepRecord *evrec) const override
void Configure(const Registry &config) override
double Py(void) const
Get Py.