17 #include "Framework/Conventions/GBuild.h" 35 using std::ostringstream;
37 using namespace genie;
63 <<
"Simulating nuclear de-excitation gamma rays";
68 <<
"No nuclear target found - Won't simulate nuclear de-excitation";
75 <<
"Done with this event";
81 <<
"Simulating nuclear de-excitation gamma rays for Oxygen target";
104 double Ps12 = 1. - Pp12 - Pp32;
108 double p32Elv[np32] = { 0.00632, 0.00993, 0.01070 };
109 double p32Plv[np32] = { 0.872, 0.064, 0.064 };
111 double p32Plv1_1gamma = 0.78;
112 double p32Plv1_cascade = 0.22;
116 double s12Elv[ns12] = {
117 0.00309, 0.00368, 0.00385, 0.00444, 0.00492,
118 0.00511, 0.00609, 0.00673, 0.00701, 0.00703, 0.00734 };
119 double s12Plv[ns12] = {
120 0.0625, 0.1875, 0.075, 0.1375, 0.1375,
121 0.0125, 0.0125, 0.075, 0.0563, 0.0563, 0.1874 };
124 const int ns12lv2 = 3;
125 double s12Elv2[ns12lv2] = { 0.00309, 0.00369, 0.00385 };
126 double s12Plv2[ns12lv2] = { 0.013, 0.360, 0.625 };
127 const int ns12lv7 = 2;
128 double s12Elv7[ns12lv7] = { 0.00609, 0.00673 };
129 double s12Plv7[ns12lv7] = { 0.04, 0.96 };
130 const int ns12lv10 = 3;
131 double s12Elv10[ns12lv10] = { 0.00609, 0.00673, 0.00734 };
132 double s12Plv10[ns12lv10] = { 0.050, 0.033, 0.017 };
135 double rshell = rnd->
RndDec().Rndm();
141 <<
"Hit nucleon left a P1/2 shell p-hole. Remnant is at g.s.";
148 if(rshell < Pp12 + Pp32) {
150 <<
"Hit nucleon left a P3/2 shell p-hole";
152 double rdecmode = rnd->
RndDec().Rndm();
155 for(
int istate=0; istate<np32; istate++) {
156 prob_sum += p32Plv[istate];
157 if(rdecmode < prob_sum) {
163 <<
"Selected P3/2 excited state = " << sel_state;
173 double r = rnd->
RndDec().Rndm();
175 if(r < p32Plv1_1gamma) {
180 if(r < p32Plv1_1gamma + p32Plv1_cascade) {
182 this->
AddPhoton(evrec, p32Elv[1]-p32Elv[0], dt);
199 else if (rshell < Pp12 + Pp32 + Ps12) {
201 <<
"Hit nucleon left an S1/2 shell p-hole";
203 double rdecmode = rnd->
RndDec().Rndm();
206 for(
int istate=0; istate<ns12; istate++) {
207 prob_sum += s12Plv[istate];
208 if(rdecmode < prob_sum) {
214 <<
"Selected S1/2 excited state = " << sel_state;
217 bool multiple_decay_modes =
218 (sel_state==2 || sel_state==7 || sel_state==10);
219 if(!multiple_decay_modes) {
220 this->
AddPhoton(evrec, s12Elv[sel_state], dt);
223 double * pdec = 0, * edec = 0;
226 ndec = ns12lv2; pdec = s12Plv2; edec = s12Elv2;
229 ndec = ns12lv7; pdec = s12Plv7; edec = s12Elv7;
232 ndec = ns12lv10; pdec = s12Plv10; edec = s12Elv10;
237 double r = rnd->
RndDec().Rndm();
238 double decmode_prob_sum = 0;
239 int sel_decmode = -1;
240 for(
int idecmode=0; idecmode < ndec; idecmode++) {
241 decmode_prob_sum += pdec[idecmode];
242 if(r < decmode_prob_sum) {
243 sel_decmode = idecmode;
247 if(sel_decmode == -1)
return;
248 this->
AddPhoton(evrec, edec[sel_decmode], dt);
269 double p32Elv = 0.00618;
271 double s12Elv = 0.00703;
272 double s12Plv = 0.222;
275 double rshell = rnd->
RndDec().Rndm();
281 <<
"Hit nucleon left a P1/2 shell n-hole. Remnant is at g.s.";
288 if(rshell < Pp12 + Pp32) {
290 <<
"Hit nucleon left a P3/2 shell n-hole";
297 if(rshell < Pp12 + Pp32 + Ps12) {
299 <<
"Hit nucleon left a S1/2 shell n-hole";
301 double r = rnd->
RndDec().Rndm();
302 if(r < s12Plv) this->
AddPhoton(evrec, s12Elv,dt);
310 GHepRecord * evrec,
double E0,
double dt)
const 318 <<
"Adding a " << E/
units::MeV <<
" MeV photon from nucl. deexcitation";
327 TLorentzVector x4(0,0,0,0);
328 TLorentzVector p4 = this->
Photon4P(E);
333 remnant->
SetPx ( remnant->
Px() - p4.Px() );
334 remnant->
SetPy ( remnant->
Py() - p4.Py() );
335 remnant->
SetPz ( remnant->
Pz() - p4.Pz() );
348 double E = rnd->
RndDec().Gaus(E0 , dE );
351 <<
"<E> = " << E0 <<
", dE = " << dE <<
" -> E = " <<
E;
362 double costheta = -1. + 2. * rnd->
RndDec().Rndm();
363 double sintheta = TMath::Sqrt(TMath::Max(0., 1.-TMath::Power(costheta,2)));
364 double phi = 2*
kPi * rnd->
RndDec().Rndm();
365 double cosphi = TMath::Cos(phi);
366 double sinphi = TMath::Sin(phi);
368 double px = E * sintheta * cosphi;
369 double py = E * sintheta * sinphi;
370 double pz = E * costheta;
372 TLorentzVector p4(px,py,pz,E);
virtual GHepParticle * Particle(int position) const
double PhotonEnergySmearing(double E0, double t) const
THE MAIN GENIE PROJECT NAMESPACE
double E(void) const
Get energy.
static RandomGen * Instance()
Access instance.
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
int FirstDaughter(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.
void ProcessEventRecord(GHepRecord *evrec) const
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 GHepParticle * TargetNucleus(void) const
double gamma(double KE, const simb::MCParticle *part)
Misc GENIE control constants.
void AddPhoton(GHepRecord *evrec, double E0, double t) const
void OxygenTargetSim(GHepRecord *evrec) const
virtual GHepParticle * HitNucleon(void) const
virtual void AddParticle(const GHepParticle &p)
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.
Root of GENIE utility namespaces.
double Py(void) const
Get Py.