QELKinematicsGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  For the class documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Mar 03, 2009 - CA
14  Moved into the new QEL package from its previous location (EVGModules)
15  @ Mar 05, 2010 - CA
16  Added a temprorary SpectralFuncExperimentalCode()
17  @ Feb 06, 2013 - CA
18  When the value of the differential cross-section for the selected kinematics
19  is set to the event, set the corresponding KinePhaseSpace_t value too.
20  @ Feb 14, 2013 - CA
21  Temporarily disable the kinematical transformation that takes out the
22  dipole form from the dsigma/dQ2 p.d.f.
23  @ Mar 18, 2016 - JJ (SD)
24  Store the struck nucleon position in the Target object before calling
25  the xsec method for the first time
26 */
27 //____________________________________________________________________________
28 
29 #include <TMath.h>
30 
48 
49 using namespace genie;
50 using namespace genie::controls;
51 using namespace genie::constants;
52 using namespace genie::utils;
53 
54 //___________________________________________________________________________
56 KineGeneratorWithCache("genie::QELKinematicsGenerator")
57 {
58 
59 }
60 //___________________________________________________________________________
62 KineGeneratorWithCache("genie::QELKinematicsGenerator", config)
63 {
64 
65 }
66 //___________________________________________________________________________
68 {
69 
70 }
71 //___________________________________________________________________________
73 {
74  if(fGenerateUniformly) {
75  LOG("QELKinematics", pNOTICE)
76  << "Generating kinematics uniformly over the allowed phase space";
77  }
78 
79  //-- Get the random number generators
81 
82  //-- Access cross section algorithm for running thread
84  const EventGeneratorI * evg = rtinfo->RunningThread();
85  fXSecModel = evg->CrossSectionAlg();
86 
87  //-- Get the interaction and set the 'trust' bits
88  Interaction * interaction = evrec->Summary();
89  interaction->SetBit(kISkipProcessChk);
90  interaction->SetBit(kISkipKinematicChk);
91 
92  // store the struck nucleon position for use by the xsec method
93  double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag();
94  interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos);
95 
96  //-- Note: The kinematic generator would be using the free nucleon cross
97  // section (even for nuclear targets) so as not to double-count nuclear
98  // suppression. This assumes that a) the nuclear suppression was turned
99  // on when computing the cross sections for selecting the current event
100  // and that b) if the event turns out to be unphysical (Pauli-blocked)
101  // the next attempted event will be forced to QEL again.
102  // (discussion with Hugh - GENIE/NeuGEN integration workshop - 07APR2006
103  interaction->SetBit(kIAssumeFreeNucleon);
104 
105  //-- Get the limits for the generated Q2
106  const KPhaseSpace & kps = interaction->PhaseSpace();
107  Range1D_t Q2 = kps.Limits(kKVQ2);
108 
109  if(Q2.max <=0 || Q2.min>=Q2.max) {
110  LOG("QELKinematics", pWARN) << "No available phase space";
111  evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
113  exception.SetReason("No available phase space");
114  exception.SwitchOnFastForward();
115  throw exception;
116  }
117 
118  //-- For the subsequent kinematic selection with the rejection method:
119  // Calculate the max differential cross section or retrieve it from the
120  // cache. Throw an exception and quit the evg thread if a non-positive
121  // value is found.
122  // If the kinematics are generated uniformly over the allowed phase
123  // space the max xsec is irrelevant
124  double xsec_max = (fGenerateUniformly) ? -1 : this->MaxXSec(evrec);
125 
126  //-- Try to select a valid Q2 using the rejection method
127 
128  // kinematical limits
129  double Q2min = Q2.min+kASmallNum;
130  double Q2max = Q2.max-kASmallNum;
131 //double QD2min = utils::kinematics::Q2toQD2(Q2min);
132 //double QD2max = utils::kinematics::Q2toQD2(Q2max);
133  double xsec = -1.;
134  double gQ2 = 0.;
135 
136  unsigned int iter = 0;
137  bool accept = false;
138  while(1) {
139  iter++;
140  if(iter > kRjMaxIterations) {
141  LOG("QELKinematics", pWARN)
142  << "Couldn't select a valid Q^2 after " << iter << " iterations";
143  evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
145  exception.SetReason("Couldn't select kinematics");
146  exception.SwitchOnFastForward();
147  throw exception;
148  }
149 
150  //-- Generate a Q2 value within the allowed phase space
151 /*
152  if(fGenerateUniformly) {
153  gQ2 = Q2min + (Q2max-Q2min) * rnd->RndKine().Rndm();
154  } else {
155  // In unweighted mode - use transform that takes out the dipole form
156  double gQD2 = QD2min + (QD2max-QD2min) * rnd->RndKine().Rndm();
157  gQ2 = utils::kinematics::QD2toQ2(gQD2);
158  }
159 */
160  gQ2 = Q2min + (Q2max-Q2min) * rnd->RndKine().Rndm();
161  interaction->KinePtr()->SetQ2(gQ2);
162  LOG("QELKinematics", pINFO) << "Trying: Q^2 = " << gQ2;
163 
164  //-- Computing cross section for the current kinematics
165  xsec = fXSecModel->XSec(interaction, kPSQ2fE);
166 
167  //-- Decide whether to accept the current kinematics
168  if(!fGenerateUniformly) {
169  this->AssertXSecLimits(interaction, xsec, xsec_max);
170 
171  double t = xsec_max * rnd->RndKine().Rndm();
172  //double J = kinematics::Jacobian(interaction,kPSQ2fE,kPSQD2fE);
173  double J = 1.;
174 
175 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
176  LOG("QELKinematics", pDEBUG)
177  << "xsec= " << xsec << ", J= " << J << ", Rnd= " << t;
178 #endif
179  accept = (t < J*xsec);
180  } else {
181  accept = (xsec>0);
182  }
183 
184  //-- If the generated kinematics are accepted, finish-up module's job
185  if(accept) {
186  LOG("QELKinematics", pINFO) << "Selected: Q^2 = " << gQ2;
187 
188  // reset bits
189  interaction->ResetBit(kISkipProcessChk);
190  interaction->ResetBit(kISkipKinematicChk);
191  interaction->ResetBit(kIAssumeFreeNucleon);
192 
193  // compute the rest of the kinematical variables
194 
195  // get neutrino energy at struck nucleon rest frame and the
196  // struck nucleon mass (can be off the mass shell)
197  const InitialState & init_state = interaction->InitState();
198  double E = init_state.ProbeE(kRfHitNucRest);
199  double M = init_state.Tgt().HitNucP4().M();
200 
201  LOG("QELKinematics", pNOTICE) << "E = " << E << ", M = "<< M;
202 
203  // The hadronic inv. mass is equal to the recoil nucleon on-shell mass.
204  // For QEL/Charm events it is set to be equal to the on-shell mass of
205  // the generated charm baryon (Lamda_c+, Sigma_c+ or Sigma_c++)
206  // Similarly for strange baryons
207  //
208  const XclsTag & xcls = interaction->ExclTag();
209  int rpdgc = 0;
210  if(xcls.IsCharmEvent()) { rpdgc = xcls.CharmHadronPdg(); }
211  else if(xcls.IsStrangeEvent()) { rpdgc = xcls.StrangeHadronPdg(); }
212  else { rpdgc = interaction->RecoilNucleonPdg(); }
213  assert(rpdgc);
214  double gW = PDGLibrary::Instance()->Find(rpdgc)->Mass();
215 
216  LOG("QELKinematics", pNOTICE) << "Selected: W = "<< gW;
217 
218  // (W,Q2) -> (x,y)
219  double gx=0, gy=0;
220  kinematics::WQ2toXY(E,M,gW,gQ2,gx,gy);
221 
222  // set the cross section for the selected kinematics
223  evrec->SetDiffXSec(xsec,kPSQ2fE);
224 
225  // for uniform kinematics, compute an event weight as
226  // wght = (phase space volume)*(differential xsec)/(event total xsec)
227  if(fGenerateUniformly) {
228  double vol = kinematics::PhaseSpaceVolume(interaction,kPSQ2fE);
229  double totxsec = evrec->XSec();
230  double wght = (vol/totxsec)*xsec;
231  LOG("QELKinematics", pNOTICE) << "Kinematics wght = "<< wght;
232 
233  // apply computed weight to the current event weight
234  wght *= evrec->Weight();
235  LOG("QELKinematics", pNOTICE) << "Current event wght = " << wght;
236  evrec->SetWeight(wght);
237  }
238 
239  // lock selected kinematics & clear running values
240  interaction->KinePtr()->SetQ2(gQ2, true);
241  interaction->KinePtr()->SetW (gW, true);
242  interaction->KinePtr()->Setx (gx, true);
243  interaction->KinePtr()->Sety (gy, true);
244  interaction->KinePtr()->ClearRunningValues();
245 
246  return;
247  }
248  }// iterations
249 }
250 //___________________________________________________________________________
252  GHepRecord * evrec) const
253 {
254  //-- Get the random number generators
256 
257  //-- Access cross section algorithm for running thread
259  const EventGeneratorI * evg = rtinfo->RunningThread();
260  fXSecModel = evg->CrossSectionAlg();
261 
262  //-- Get the interaction and set the 'trust' bits
263  Interaction * interaction = new Interaction(*evrec->Summary());
264  interaction->SetBit(kISkipProcessChk);
265  interaction->SetBit(kISkipKinematicChk);
266 
267  // store the struck nucleon position for use by the xsec method
268  double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag();
269  interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos);
270 
271  //-- Note: The kinematic generator would be using the free nucleon cross
272  // section (even for nuclear targets) so as not to double-count nuclear
273  // suppression. This assumes that a) the nuclear suppression was turned
274  // on when computing the cross sections for selecting the current event
275  // and that b) if the event turns out to be unphysical (Pauli-blocked)
276  // the next attempted event will be forced to QEL again.
277  // (discussion with Hugh - GENIE/NeuGEN integration workshop - 07APR2006
278  interaction->SetBit(kIAssumeFreeNucleon);
279 
280  //-- Assume scattering off a nucleon on the mass shell (PWIA prescription)
281  double Mn = interaction->InitState().Tgt().HitNucMass(); // PDG mass, take it to be on-shell
282  double pxn = interaction->InitState().Tgt().HitNucP4().Px();
283  double pyn = interaction->InitState().Tgt().HitNucP4().Py();
284  double pzn = interaction->InitState().Tgt().HitNucP4().Pz();
285  double En = interaction->InitState().Tgt().HitNucP4().Energy();
286  double En0 = TMath::Sqrt(pxn*pxn + pyn*pyn + pzn*pzn + Mn*Mn);
287  double Eb = En0 - En;
288  interaction->InitStatePtr()->TgtPtr()->HitNucP4Ptr()->SetE(En0);
289 
290  //-- Get the limits for the generated Q2
291  const KPhaseSpace & kps = interaction->PhaseSpace();
292  Range1D_t Q2 = kps.Limits(kKVQ2);
293 
294  if(Q2.max <=0 || Q2.min>=Q2.max) {
295  LOG("QELKinematics", pWARN) << "No available phase space";
296  evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
298  exception.SetReason("No available phase space");
299  exception.SwitchOnFastForward();
300  throw exception;
301  }
302 
303  //-- For the subsequent kinematic selection with the rejection method:
304  // Calculate the max differential cross section or retrieve it from the
305  // cache. Throw an exception and quit the evg thread if a non-positive
306  // value is found.
307  // If the kinematics are generated uniformly over the allowed phase
308  // space the max xsec is irrelevant
309 // double xsec_max = (fGenerateUniformly) ? -1 : this->MaxXSec(evrec);
310  double xsec_max = this->MaxXSec(evrec);
311 
312  // get neutrino energy at struck nucleon rest frame and the
313  // struck nucleon mass (can be off the mass shell)
314  const InitialState & init_state = interaction->InitState();
315  double E = init_state.ProbeE(kRfHitNucRest);
316 
317  LOG("QELKinematics", pNOTICE) << "E = " << E << ", M = "<< Mn;
318 
319  //-- Try to select a valid Q2 using the rejection method
320 
321  // kinematical limits
322  double Q2min = Q2.min+kASmallNum;
323  double Q2max = Q2.max-kASmallNum;
324  double xsec = -1.;
325  double gQ2 = 0.;
326  double gW = 0.;
327  double gx = 0.;
328  double gy = 0.;
329 
330  unsigned int iter = 0;
331  bool accept = false;
332  while(1) {
333  iter++;
334  if(iter > kRjMaxIterations) {
335  LOG("QELKinematics", pWARN)
336  << "Couldn't select a valid Q^2 after " << iter << " iterations";
337  evrec->EventFlags()->SetBitNumber(kKineGenErr, true);
339  exception.SetReason("Couldn't select kinematics");
340  exception.SwitchOnFastForward();
341  throw exception;
342  }
343 
344  //-- Generate a Q2 value within the allowed phase space
345  gQ2 = Q2min + (Q2max-Q2min) * rnd->RndKine().Rndm();
346  LOG("QELKinematics", pNOTICE) << "Trying: Q^2 = " << gQ2;
347 
348  // The hadronic inv. mass is equal to the recoil nucleon on-shell mass.
349  // For QEL/Charm events it is set to be equal to the on-shell mass of
350  // the generated charm baryon (Lamda_c+, Sigma_c+ or Sigma_c++)
351  //
352  const XclsTag & xcls = interaction->ExclTag();
353  int rpdgc = 0;
354  if(xcls.IsCharmEvent()) { rpdgc = xcls.CharmHadronPdg(); }
355  else { rpdgc = interaction->RecoilNucleonPdg(); }
356  assert(rpdgc);
357  gW = PDGLibrary::Instance()->Find(rpdgc)->Mass();
358 
359  // (W,Q2) -> (x,y)
360  kinematics::WQ2toXY(E,Mn,gW,gQ2,gx,gy);
361 
362  LOG("QELKinematics", pNOTICE) << "W = "<< gW;
363  LOG("QELKinematics", pNOTICE) << "x = "<< gx;
364  LOG("QELKinematics", pNOTICE) << "y = "<< gy;
365 
366  // v
367  double gv = gy * E;
368  double gv2 = gv*gv;
369 
370  LOG("QELKinematics", pNOTICE) << "v = "<< gv;
371 
372  // v -> v~
373  double gvtilde = gv + Mn - Eb - TMath::Sqrt(Mn*Mn+pxn*pxn+pyn*pyn+pzn*pzn);
374  double gvtilde2 = gvtilde*gvtilde;
375 
376  LOG("QELKinematics", pNOTICE) << "v~ = "<< gvtilde;
377 
378  // Q~^2
379  double gQ2tilde = gQ2 - gv2 + gvtilde2;
380 
381  LOG("QELKinematics", pNOTICE) << "Q~^2 = "<< gQ2tilde;
382 
383  // Set updated Q2
384  interaction->KinePtr()->SetQ2(gQ2tilde);
385 
386  //-- Computing cross section for the current kinematics
387  xsec = fXSecModel->XSec(interaction, kPSQ2fE);
388 
389  //-- Decide whether to accept the current kinematics
390 // if(!fGenerateUniformly) {
391  this->AssertXSecLimits(interaction, xsec, xsec_max);
392 
393  double t = xsec_max * rnd->RndKine().Rndm();
394 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
395  LOG("QELKinematics", pDEBUG)
396  << "xsec= " << xsec << ", Rnd= " << t;
397 #endif
398  accept = (t < xsec);
399 // } else {
400 // accept = (xsec>0);
401 // }
402 
403  //-- If the generated kinematics are accepted, finish-up module's job
404  if(accept) {
405  LOG("QELKinematics", pNOTICE) << "Selected: Q^2 = " << gQ2;
406 
407  // reset bits
408 // interaction->ResetBit(kISkipProcessChk);
409 // interaction->ResetBit(kISkipKinematicChk);
410 // interaction->ResetBit(kIAssumeFreeNucleon);
411 
412  // set the cross section for the selected kinematics
413  evrec->SetDiffXSec(xsec,kPSQ2fE);
414 
415  // for uniform kinematics, compute an event weight as
416  // wght = (phase space volume)*(differential xsec)/(event total xsec)
417 // if(fGenerateUniformly) {
418 // double vol = kinematics::PhaseSpaceVolume(interaction,kPSQ2fE);
419 // double totxsec = evrec->XSec();
420 // double wght = (vol/totxsec)*xsec;
421 // LOG("QELKinematics", pNOTICE) << "Kinematics wght = "<< wght;
422 
423  // apply computed weight to the current event weight
424 // wght *= evrec->Weight();
425 // LOG("QELKinematics", pNOTICE) << "Current event wght = " << wght;
426 // evrec->SetWeight(wght);
427 // }
428 
429  // lock selected kinematics & clear running values
430 // interaction->KinePtr()->SetQ2(gQ2, true);
431 // interaction->KinePtr()->SetW (gW, true);
432 // interaction->KinePtr()->Setx (gx, true);
433 // interaction->KinePtr()->Sety (gy, true);
434 // interaction->KinePtr()->ClearRunningValues();
435 
436  evrec->Summary()->KinePtr()->SetQ2(gQ2, true);
437  evrec->Summary()->KinePtr()->SetW (gW, true);
438  evrec->Summary()->KinePtr()->Setx (gx, true);
439  evrec->Summary()->KinePtr()->Sety (gy, true);
440  evrec->Summary()->KinePtr()->ClearRunningValues();
441  delete interaction;
442 
443  return;
444  }
445  }// iterations
446 }
447 //___________________________________________________________________________
449 {
450  Algorithm::Configure(config);
451  this->LoadConfig();
452 }
453 //____________________________________________________________________________
455 {
456  Algorithm::Configure(config);
457  this->LoadConfig();
458 }
459 //____________________________________________________________________________
461 {
462 // Load sub-algorithms and config data to reduce the number of registry
463 // lookups
464 
465  //-- Safety factor for the maximum differential cross section
466  GetParamDef( "MaxXSec-SafetyFactor", fSafetyFactor , 1.25 ) ;
467 
468  //-- Minimum energy for which max xsec would be cached, forcing explicit
469  // calculation for lower eneries
470  GetParamDef( "Cache-MinEnergy", fEMin, 1.00 ) ;
471 
472  //-- Maximum allowed fractional cross section deviation from maxim cross
473  // section used in rejection method
474  GetParamDef( "MaxXSec-DiffTolerance", fMaxXSecDiffTolerance, 999999. ) ;
476 
477  //-- Generate kinematics uniformly over allowed phase space and compute
478  // an event weight?
479  GetParamDef( "UniformOverPhaseSpace", fGenerateUniformly, false ) ;
480 
481 }
482 //____________________________________________________________________________
484  const Interaction * interaction) const
485 {
486 // Computes the maximum differential cross section in the requested phase
487 // space. This method overloads KineGeneratorWithCache::ComputeMaxXSec
488 // method and the value is cached at a circular cache branch for retrieval
489 // during subsequent event generation.
490 // The computed max differential cross section does not need to be the exact
491 // maximum. The number used in the rejection method will be scaled up by a
492 // safety factor. But it needs to be fast - do not use a very small dQ2 step.
493 
494  double max_xsec = 0.0;
495 
496  const KPhaseSpace & kps = interaction->PhaseSpace();
497  Range1D_t rQ2 = kps.Limits(kKVQ2);
498  if(rQ2.min <=0 || rQ2.max <= rQ2.min) return 0.;
499 
500  const double logQ2min = TMath::Log(rQ2.min + kASmallNum);
501  const double logQ2max = TMath::Log(rQ2.max - kASmallNum);
502 
503  const int N = 15;
504  const int Nb = 10;
505 
506  double dlogQ2 = (logQ2max - logQ2min) /(N-1);
507  double xseclast = -1;
508  bool increasing;
509 
510  for(int i=0; i<N; i++) {
511  double Q2 = TMath::Exp(logQ2min + i * dlogQ2);
512  interaction->KinePtr()->SetQ2(Q2);
513  double xsec = fXSecModel->XSec(interaction, kPSQ2fE);
514 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
515  LOG("QELKinematics", pDEBUG) << "xsec(Q2= " << Q2 << ") = " << xsec;
516 #endif
517  max_xsec = TMath::Max(xsec, max_xsec);
518  increasing = xsec-xseclast>=0;
519  xseclast = xsec;
520 
521  // once the cross section stops increasing, I reduce the step size and
522  // step backwards a little bit to handle cases that the max cross section
523  // is grossly underestimated (very peaky distribution & large step)
524  if(!increasing) {
525  dlogQ2/=(Nb+1);
526  for(int ib=0; ib<Nb; ib++) {
527  Q2 = TMath::Exp(TMath::Log(Q2) - dlogQ2);
528  if(Q2 < rQ2.min) continue;
529  interaction->KinePtr()->SetQ2(Q2);
530  xsec = fXSecModel->XSec(interaction, kPSQ2fE);
531 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
532  LOG("QELKinematics", pDEBUG) << "xsec(Q2= " << Q2 << ") = " << xsec;
533 #endif
534  max_xsec = TMath::Max(xsec, max_xsec);
535  }
536  break;
537  }
538  }//Q^2
539 
540  // Apply safety factor, since value retrieved from the cache might
541  // correspond to a slightly different energy
542  max_xsec *= fSafetyFactor;
543 
544 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
545  SLOG("QELKinematics", pDEBUG) << interaction->AsString();
546  SLOG("QELKinematics", pDEBUG) << "Max xsec in phase space = " << max_xsec;
547  SLOG("QELKinematics", pDEBUG) << "Computed using alg = " << *fXSecModel;
548 #endif
549 
550  return max_xsec;
551 }
552 //___________________________________________________________________________
553 
virtual double MaxXSec(GHepRecord *evrec) const
void SpectralFuncExperimentalCode(GHepRecord *event_rec) const
const KPhaseSpace & PhaseSpace(void) const
Definition: Interaction.h:73
Basic constants.
virtual void SetWeight(double wght)
Definition: GHepRecord.h:131
bool fGenerateUniformly
uniform over allowed phase space + event weight?
double J(double q0, double q3, double Enu, double ml)
Definition: MECUtils.cxx:141
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:135
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
void SetQ2(double Q2, bool selected=false)
Definition: Kinematics.cxx:265
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
double fSafetyFactor
maxxsec -> maxxsec * safety_factor
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
int RecoilNucleonPdg(void) const
recoil nucleon pdg
A simple [min,max] interval for doubles.
Definition: Range1.h:43
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
double HitNucMass(void) const
Definition: Target.cxx:250
int CharmHadronPdg(void) const
Definition: XclsTag.h:50
bool IsStrangeEvent(void) const
Definition: XclsTag.h:51
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Defines the EventGeneratorI interface.
virtual double Weight(void) const
Definition: GHepRecord.h:125
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
void SetHitNucPosition(double r)
Definition: Target.cxx:227
Definition: config.py:1
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecord...
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
Range1D_t Limits(KineVar_t kvar) const
Return the kinematical variable limits.
string AsString(void) const
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:37
double PhaseSpaceVolume(const Interaction *const i, KinePhaseSpace_t ps)
Definition: KineUtils.cxx:34
bool IsCharmEvent(void) const
Definition: XclsTag.h:48
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:92
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
int StrangeHadronPdg(void) const
Definition: XclsTag.h:53
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
Float_t E
Definition: plot.C:20
void WQ2toXY(double Ev, double M, double W, double Q2, double &x, double &y)
Definition: KineUtils.cxx:1046
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:70
Kinematical phase space.
Definition: KPhaseSpace.h:34
void ProcessEventRecord(GHepRecord *event_rec) const
static const double kASmallNum
Definition: Controls.h:40
#define pINFO
Definition: Messenger.h:63
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
Definition: RandomGen.h:51
Misc GENIE control constants.
Double_t xsec[nknots]
Definition: testXsec.C:47
#define pWARN
Definition: Messenger.h:61
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition: Interaction.h:48
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
double ComputeMaxXSec(const Interaction *in) const
void Setx(double x, bool selected=false)
Definition: Kinematics.cxx:241
static RunningThreadInfo * Instance(void)
double max
Definition: Range1.h:54
void SetW(double W, bool selected=false)
Definition: Kinematics.cxx:289
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:264
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
virtual TBits * EventFlags(void) const
Definition: GHepRecord.h:118
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
void Sety(double y, bool selected=false)
Definition: Kinematics.cxx:253
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:49
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
void Configure(const Registry &config)
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:350
Target * TgtPtr(void) const
Definition: InitialState.h:68
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
assert(nhit_max >=nhit_nbins)
virtual double XSec(void) const
Definition: GHepRecord.h:127
double gQ2
Definition: gtestDISSF.cxx:55
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const int Nb
const InitialState & InitState(void) const
Definition: Interaction.h:69
double min
Definition: Range1.h:53
#define pNOTICE
Definition: Messenger.h:62
void ClearRunningValues(void)
Definition: Kinematics.cxx:357
bool GetParamDef(const RgKey &name, T &p, const T &def) const
const Target & Tgt(void) const
Definition: InitialState.h:67
static const unsigned int kRjMaxIterations
Definition: Controls.h:27
const EventGeneratorI * RunningThread(void)
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
double ProbeE(RefFrame_t rf) const
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:46
Keep info on the event generation thread currently on charge. This is used so that event generation m...
Root of GENIE utility namespaces.
const UInt_t kISkipProcessChk
if set, skip process validity checks
Definition: Interaction.h:47
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Definition: GHepRecord.h:134
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64