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

GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interactions. Each such object is configured for a given initial state and it drives all relevant GENIE neutrino interaction physics simulation code for that state. To set-up MC jobs involving a multitude of possible initial states, including arbitrarily complex neutrino flux and detector geometry descriptions, see the GMCJDriver object. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01a/Linux64bit+3.10-2.17-e19-debug/GENIE-Generator/src/Framework/EventGen/GEVGDriver.h"

Public Member Functions

 GEVGDriver ()
 
 ~GEVGDriver ()
 
void UseSplines (void)
 
void SetEventGeneratorList (string listname)
 
void SetUnphysEventMask (const TBits &mask)
 
void Configure (int nu_pdgc, int Z, int A)
 
void Configure (const InitialState &init_state)
 
EventRecordGenerateEvent (const TLorentzVector &nu4p)
 
const InteractionListInteractions (void) const
 
const EventGeneratorListEventGenerators (void) const
 
const EventGeneratorIFindGenerator (const Interaction *interaction) const
 
const SplineXSecSumSpline (void) const
 
const SplineXSecSpline (const Interaction *interaction) const
 
void CreateSplines (int nknots=-1, double emax=-1, bool inLogE=true)
 
double XSecSum (const TLorentzVector &nup4)
 
void CreateXSecSumSpline (int nk, double Emin, double Emax, bool inlogE=true)
 
Range1D_t ValidEnergyRange (void) const
 
void Reset (void)
 
void Print (ostream &stream) const
 

Private Member Functions

void Init (void)
 
void CleanUp (void)
 
void BuildInitialState (const InitialState &init_state)
 
void BuildGeneratorList (void)
 
void BuildInteractionGeneratorMap (void)
 
void BuildInteractionSelector (void)
 
void AssertIsValidInitState (void) const
 

Private Attributes

InitialStatefInitState
 initial state information for driver instance More...
 
EventRecordfCurrentRecord
 ptr to the event record being processed More...
 
EventGeneratorListfEvGenList
 all Event Generators available at this job More...
 
InteractionSelectorIfIntSelector
 interaction selector More...
 
InteractionGeneratorMapfIntGenMap
 interaction -> generator assosiative container More...
 
TBits * fUnphysEventMask
 controls whether unphysical events are returned More...
 
bool fUseSplines
 controls whether xsecs are computed or interpolated More...
 
SplinefXSecSumSpl
 sum{xsec(all interactions | this init state)} More...
 
unsigned int fNRecLevel
 recursive mode depth counter More...
 
string fEventGenList
 list of event generators loaded by this driver (what used to be the $GEVGL setting) More...
 

Friends

ostream & operator<< (ostream &stream, const GEVGDriver &driver)
 

Detailed Description

GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interactions. Each such object is configured for a given initial state and it drives all relevant GENIE neutrino interaction physics simulation code for that state. To set-up MC jobs involving a multitude of possible initial states, including arbitrarily complex neutrino flux and detector geometry descriptions, see the GMCJDriver object.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

August 06, 2004

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 55 of file GEVGDriver.h.

Constructor & Destructor Documentation

GEVGDriver::GEVGDriver ( )

Definition at line 58 of file GEVGDriver.cxx.

References Init().

59 {
60  this->Init();
61 }
void Init(void)
Definition: GEVGDriver.cxx:68
GEVGDriver::~GEVGDriver ( )

Definition at line 63 of file GEVGDriver.cxx.

64 {
65  this->CleanUp();
66 }
void CleanUp(void)
Definition: GEVGDriver.cxx:122

Member Function Documentation

void GEVGDriver::AssertIsValidInitState ( void  ) const
private

Definition at line 699 of file GEVGDriver.cxx.

References ana::assert(), genie::pdg::IsDarkMatter(), and genie::pdg::IsLepton().

Referenced by XSecSumSpline().

700 {
702  int ppdgc = fInitState->ProbePdg();
703  bool isv = pdg::IsLepton(ppdgc) || pdg::IsDarkMatter(ppdgc);
704  assert(isv);
705 }
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:125
int ProbePdg(void) const
Definition: InitialState.h:65
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
assert(nhit_max >=nhit_nbins)
bool IsLepton(int pdgc)
Definition: PDGUtils.cxx:84
void GEVGDriver::BuildGeneratorList ( void  )
private

Load event generators. The list of event generators is named by fEventGenList.

Definition at line 177 of file GEVGDriver.cxx.

References genie::EventGeneratorListAssembler::AssembleGeneratorList(), LOG, and pINFO.

Referenced by XSecSumSpline().

178 {
179 //! Load event generators.
180 //! The list of event generators is named by fEventGenList.
181 
182  LOG("GEVGDriver", pINFO)
183  << "Building the event generator list (specified list name: "
184  << fEventGenList << ")";
185 
186  EventGeneratorListAssembler evglist_assembler(fEventGenList.c_str());
187  fEvGenList = evglist_assembler.AssembleGeneratorList();
188 }
string fEventGenList
list of event generators loaded by this driver (what used to be the $GEVGL setting) ...
Definition: GEVGDriver.h:128
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
Assembles a list of all the EventGeneratorI subclasses that can be employed during a neutrino event g...
void GEVGDriver::BuildInitialState ( const InitialState init_state)
private

Definition at line 167 of file GEVGDriver.cxx.

References LOG, and pINFO.

Referenced by XSecSumSpline().

168 {
169  LOG("GEVGDriver", pINFO) << "Setting the initial state";
170 
171  if(fInitState) delete fInitState;
172  fInitState = new InitialState(init_state);
173 
174  this->AssertIsValidInitState();
175 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
void AssertIsValidInitState(void) const
Definition: GEVGDriver.cxx:699
Initial State information.
Definition: InitialState.h:49
void GEVGDriver::BuildInteractionGeneratorMap ( void  )
private

Map each possible interaction, for the given initial state, to one of the generators loaded up

Definition at line 190 of file GEVGDriver.cxx.

References LOG, pDEBUG, pINFO, genie::utils::print::PrintFramedMesg(), and genie::InteractionGeneratorMap::UseGeneratorList().

Referenced by XSecSumSpline().

191 {
192 //! Map each possible interaction, for the given initial state, to one
193 //! of the generators loaded up
194 
195  LOG("GEVGDriver", pINFO)
196  << "Building the interaction -> generator associations...";
197 
201 
202  string mesgh = "Interaction -> Generator assignments for Initial State: ";
203 
204  LOG("GEVGDriver", pDEBUG)
205  << utils::print::PrintFramedMesg(mesgh + fInitState->AsString(), 0, '-')
206  << *fIntGenMap;
207 }
An Interaction -> EventGeneratorI associative container. The container is being built for the loaded ...
void BuildMap(const InitialState &init_state)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
string AsString(void) const
#define pINFO
Definition: Messenger.h:63
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
void UseGeneratorList(const EventGeneratorList *list)
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
#define pDEBUG
Definition: Messenger.h:64
void GEVGDriver::BuildInteractionSelector ( void  )
private

Definition at line 209 of file GEVGDriver.cxx.

References genie::AlgFactory::AdoptAlgorithm(), genie::AlgFactory::Instance(), LOG, and pINFO.

Referenced by XSecSumSpline().

210 {
211  LOG("GEVGDriver", pINFO) << "Building the interaction selector...";
212 
213  AlgFactory * algf = AlgFactory::Instance();
214 
215  if(fIntSelector) delete fIntSelector;
216  fIntSelector = dynamic_cast<InteractionSelectorI *> (
217  algf->AdoptAlgorithm("genie::PhysInteractionSelector","Default"));
218 }
InteractionSelectorI * fIntSelector
interaction selector
Definition: GEVGDriver.h:122
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Definition: AlgFactory.cxx:127
Defines the InteractionSelectorI interface to be implemented by algorithms selecting interactions to ...
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
void GEVGDriver::CleanUp ( void  )
private

Definition at line 122 of file GEVGDriver.cxx.

Referenced by XSecSumSpline().

123 {
125  if (fInitState) delete fInitState;
126  if (fEvGenList) delete fEvGenList;
127  if (fIntSelector) delete fIntSelector;
128  if (fIntGenMap) delete fIntGenMap;
129  if (fXSecSumSpl) delete fXSecSumSpl;
130 }
InteractionSelectorI * fIntSelector
interaction selector
Definition: GEVGDriver.h:122
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition: GEVGDriver.h:124
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
Spline * fXSecSumSpl
sum{xsec(all interactions | this init state)}
Definition: GEVGDriver.h:126
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
void GEVGDriver::Configure ( int  nu_pdgc,
int  Z,
int  A 
)

Definition at line 138 of file GEVGDriver.cxx.

References Configure().

Referenced by Configure(), GenerateEventsAtFixedInitState(), GetEventGenDriver(), main(), make_sk_xsec_table(), and genie::GMCJDriver::PopulateEventGenDriverPool().

139 {
140  Target target(Z, A);
141  InitialState init_state(target, nu_pdgc);
142 
143  this->Configure(init_state);
144 }
const XML_Char * target
Definition: expat.h:268
Float_t Z
Definition: plot.C:38
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
static const double A
Definition: Units.h:82
void Configure(int nu_pdgc, int Z, int A)
Definition: GEVGDriver.cxx:138
Initial State information.
Definition: InitialState.h:49
void GEVGDriver::Configure ( const InitialState init_state)

Definition at line 146 of file GEVGDriver.cxx.

References genie::InitialState::AsString(), LOG, pINFO, pNOTICE, genie::utils::print::PrintFramedMesg(), genie::InitialState::ProbePdg(), and genie::InitialState::TgtPdg().

147 {
148  InitialState init_state(is.TgtPdg(), is.ProbePdg()); // filter any other init state info
149 
150  ostringstream mesg;
151  mesg << "Configuring event generation driver for initial state: `"
152  << init_state.AsString()
153  << "' using event generator list: `"
154  << fEventGenList << "'.";
155 
156  LOG("GEVGDriver", pNOTICE)
157  << utils::print::PrintFramedMesg(mesg.str(), 0, '*');
158 
159  this -> BuildInitialState (init_state);
160  this -> BuildGeneratorList ();
161  this -> BuildInteractionGeneratorMap ();
162  this -> BuildInteractionSelector ();
163 
164  LOG("GEVGDriver", pINFO) << "Done configuring. \n";
165 }
string fEventGenList
list of event generators loaded by this driver (what used to be the $GEVGL setting) ...
Definition: GEVGDriver.h:128
void BuildInteractionGeneratorMap(void)
Definition: GEVGDriver.cxx:190
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
string AsString(void) const
#define pINFO
Definition: Messenger.h:63
void BuildGeneratorList(void)
Definition: GEVGDriver.cxx:177
void BuildInteractionSelector(void)
Definition: GEVGDriver.cxx:209
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
#define pNOTICE
Definition: Messenger.h:62
Initial State information.
Definition: InitialState.h:49
void BuildInitialState(const InitialState &init_state)
Definition: GEVGDriver.cxx:167
void GEVGDriver::CreateSplines ( int  nknots = -1,
double  emax = -1,
bool  inLogE = true 
)

Definition at line 578 of file GEVGDriver.cxx.

References ana::assert(), genie::Interaction::AsString(), genie::InteractionListGeneratorI::CreateInteractionList(), genie::XSecSplineList::CreateSpline(), genie::EventGeneratorI::CrossSectionAlg(), Emax, genie::GVldContext::Emax(), genie::GVldContext::Emin(), genie::Algorithm::Id(), genie::XSecSplineList::Instance(), makeTrainCVSamples::int, genie::EventGeneratorI::IntListGenerator(), genie::AlgId::Key(), LOG, pDEBUG, pINFO, pWARN, genie::XSecSplineList::SetLogE(), SLOG, genie::XSecSplineList::SplineExists(), and genie::EventGeneratorI::ValidityContext().

Referenced by genie::GMCJDriver::BootstrapXSecSplines(), GetEventGenDriver(), main(), and XSecSumSpline().

579 {
580 // Creates all the cross section splines that are needed by this driver.
581 // It will check for pre-loaded splines and it will skip the creation of the
582 // splines it already finds loaded.
583 
584  LOG("GEVGDriver", pINFO)
585  << "Creating (missing) splines with [UseLogE: "
586  << ((useLogE) ? "ON]" : "OFF]");
587  // Get the list of spline objects
589  xsl->SetLogE(useLogE);
590 
591  EventGeneratorList::const_iterator evgliter; // event generator list iter
592  InteractionList::iterator intliter; // interaction list iter
593 
594  // loop over all EventGenerator objects used in the current job
595  for(evgliter = fEvGenList->begin();
596  evgliter != fEvGenList->end(); ++evgliter) {
597  // current event generator
598  const EventGeneratorI * evgen = *evgliter;
599  LOG("GEVGDriver", pINFO)
600  << "Querying [" << evgen->Id().Key()
601  << "] for its InteractionList";
602 
603  // ask the event generator to produce a list of all interaction it can
604  // generate for the input initial state
605  const InteractionListGeneratorI * ilstgen = evgen->IntListGenerator();
607  if(!ilst) continue;
608 
609  // total cross section algorithm used by the current EventGenerator
610  const XSecAlgorithmI * alg = evgen->CrossSectionAlg();
611 
612  // get the energy range of the spline from the EventGenerator
613  // validity context
614  double Emin = TMath::Max(0.001,evgen->ValidityContext().Emin());
615  double Emax = evgen->ValidityContext().Emax();
616 
617  // if the user set a maximum energy, create the spline up to this
618  // energy - otherwise use the upper limit of the validity range of
619  // the current generator
620  if ( emax > 0 ) {
621  if ( emax > Emax ) {
622  LOG("GEVGDriver", pWARN)
623  << "Refusing to exceed validity range: Emax = " << Emax;
624  }
625  emax = TMath::Min(emax,Emax); // don't exceed validity range
626  } else {
627  emax = Emax;
628  }
629 
630  assert( emax > Emin );
631 
632  // number of knots: use specified number. If not set, use 15 knots
633  // per decade. Don't use less than 30 knots.
634  if ( nknots < 0 ) {
635  nknots = (int) (15 * TMath::Log10(emax-Emin));
636  }
637  nknots = TMath::Max(nknots,30);
638 
639  // loop over all interactions that can be generated and ask the
640  // appropriate cross section algorithm to compute its cross section
641  for(intliter = ilst->begin(); intliter != ilst->end(); ++intliter) {
642 
643  // current interaction
644  Interaction * interaction = *intliter;
645  string code = interaction->AsString();
646 
647  SLOG("GEVGDriver", pINFO) << "Need xsec spline for " << code;
648 
649  // only create the spline if it does not already exists
650  bool spl_exists = xsl->SplineExists(alg, interaction);
651  if(!spl_exists) {
652  SLOG("GEVGDriver", pDEBUG)
653  << "The spline wasn't loaded at initialization. "
654  << "I can build it now but it might take a while...";
655  xsl->CreateSpline(alg, interaction, nknots, Emin, emax);
656  } else {
657  SLOG("GEVGDriver", pDEBUG) << "Spline was found";
658  }
659  } // loop over interaction that can be generated by this generator
660  delete ilst;
661  ilst = 0;
662  } // loop over event generators
663 
664  LOG("GEVGDriver", pINFO) << *xsl; // print list of splines
665 
666  fUseSplines = true;
667 }
Cross Section Calculation Interface.
void CreateSpline(const XSecAlgorithmI *alg, const Interaction *i, int nknots=-1, double e_min=-1, double e_max=-1)
Defines the InteractionListGeneratorI interface. Concrete implementations of this interface generate ...
virtual const InteractionListGeneratorI * IntListGenerator(void) const =0
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
Defines the EventGeneratorI interface.
static XSecSplineList * Instance()
string AsString(void) const
virtual const GVldContext & ValidityContext(void) const =0
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const Int_t nknots
Definition: testXsec.C:24
const double emax
#define pINFO
Definition: Messenger.h:63
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
virtual InteractionList * CreateInteractionList(const InitialState &init) const =0
#define pWARN
Definition: Messenger.h:61
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
Definition: inftrees.h:24
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
double Emax(void) const
Definition: GVldContext.h:47
void SetLogE(bool on)
set opt to build splines as f(E) or as f(logE)
assert(nhit_max >=nhit_nbins)
A vector of Interaction objects.
double Emax
double Emin(void) const
Definition: GVldContext.h:46
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
List of cross section vs energy splines.
Module to generate only pions from cosmic rays.
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
string Key(void) const
Definition: AlgId.h:47
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
#define pDEBUG
Definition: Messenger.h:64
void GEVGDriver::CreateXSecSumSpline ( int  nk,
double  Emin,
double  Emax,
bool  inlogE = true 
)

Definition at line 441 of file GEVGDriver.cxx.

References ana::assert(), dE, E, e, MECModelEnuComparisons::i, LOG, make_associated_cosmic_defs::p4, pFATAL, pINFO, and xsec.

Referenced by genie::GMCJDriver::BootstrapXSecSplineSummation(), CalcTotalXSec(), GetEventGenDriver(), make_sk_xsec_table(), and XSecSumSpline().

443 {
444 // This method creates a spline with the *total* cross section vs E (or logE)
445 // for the initial state that this driver was configured with.
446 // This spline is used, for example, by the GMCJDriver to select a target
447 // material out of all the materials in a detector geometry (summing the
448 // cross sections again and again proved to be expensive...)
449 
450  LOG("GEVGDriver", pINFO)
451  << "Creating spline (sum-xsec = f(" << ((inlogE) ? "logE" : "E")
452  << ") in E = [" << Emin << ", " << Emax << "] using " << nk << " knots";
453 
454  if(!fUseSplines) {
455  LOG("GEVGDriver", pFATAL) << "You haven't loaded any splines!! ";
456  }
458  assert(Emin<Emax && Emin>0 && nk>2);
459 
460  double logEmin=0, logEmax=0, dE=0;
461 
462  double * E = new double[nk];
463  double * xsec = new double[nk];
464 
465  if(inlogE) {
466  logEmin = TMath::Log(Emin);
467  logEmax = TMath::Log(Emax);
468  dE = (logEmax-logEmin)/(nk-1);
469  } else {
470  dE = (Emax-Emin)/(nk-1);
471  }
472 
473  TLorentzVector p4(0,0,0,0);
474 
475  for(int i=0; i<nk; i++) {
476  double e = (inlogE) ? TMath::Exp(logEmin + i*dE) : Emin + i*dE;
477  p4.SetPxPyPzE(0.,0.,e,e);
478  double xs = this->XSecSum(p4);
479 
480  E[i] = e;
481  xsec[i] = xs;
482  }
483  if (fXSecSumSpl) delete fXSecSumSpl;
484  fXSecSumSpl = new Spline(nk, E, xsec);
485  delete [] E;
486  delete [] xsec;
487 }
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:47
#define pFATAL
Definition: Messenger.h:57
double dE
#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
double XSecSum(const TLorentzVector &nup4)
Definition: GEVGDriver.cxx:374
#define pINFO
Definition: Messenger.h:63
Double_t xsec[nknots]
Definition: testXsec.C:47
Spline * fXSecSumSpl
sum{xsec(all interactions | this init state)}
Definition: GEVGDriver.h:126
assert(nhit_max >=nhit_nbins)
double Emax
Float_t e
Definition: plot.C:35
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
const EventGeneratorList* genie::GEVGDriver::EventGenerators ( void  ) const
inline

Definition at line 81 of file GEVGDriver.h.

References fEvGenList, and FindGenerator().

81 { return fEvGenList; }
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
const EventGeneratorI * GEVGDriver::FindGenerator ( const Interaction interaction) const

Definition at line 358 of file GEVGDriver.cxx.

References LOG, and pWARN.

Referenced by EventGenerators().

359 {
360  if(!interaction) {
361  LOG("GEVGDriver", pWARN) << "Null interaction!!";
362  return 0;
363  }
364  if(!fIntGenMap) {
365  LOG("GEVGDriver", pWARN)
366  << "Interaction->Generator Map has not being built yet!";
367  return 0;
368  }
369 
370  const EventGeneratorI * evgen = fIntGenMap->FindGenerator(interaction);
371  return evgen;
372 }
const EventGeneratorI * FindGenerator(const Interaction *in) const
Defines the EventGeneratorI interface.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pWARN
Definition: Messenger.h:61
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
Module to generate only pions from cosmic rays.
EventRecord * GEVGDriver::GenerateEvent ( const TLorentzVector &  nu4p)

Definition at line 229 of file GEVGDriver.cxx.

References ana::assert(), genie::InitialState::AsString(), GenerateEvent(), genie::Algorithm::Id(), genie::RunningThreadInfo::Instance(), genie::AlgId::Key(), genie::controls::kRecursiveModeMaxDepth, LOG, pDEBUG, pERROR, pINFO, pNOTICE, genie::utils::print::PrintFramedMesg(), genie::EventRecordVisitorI::ProcessEventRecord(), pWARN, genie::InitialState::SetProbeP4(), and genie::RunningThreadInfo::UpdateRunningThread().

Referenced by GenerateEvent(), genie::GMCJDriver::GenerateEventKinematics(), and GenerateEventsAtFixedInitState().

230 {
231  //-- Build initial state information from inputs
232  LOG("GEVGDriver", pINFO) << "Creating the initial state";
233  InitialState init_state(*fInitState);
234  init_state.SetProbeP4(nu4p);
235 
236  //-- Select the interaction to be generated (amongst the entries of the
237  // InteractionList assembled by the EventGenerators) and bootstrap the
238  // event record
239  LOG("GEVGDriver", pINFO)
240  << "Selecting an Interaction & Bootstraping the EventRecord";
242 
243  if(!fCurrentRecord) {
244  LOG("GEVGDriver", pWARN)
245  << "No interaction could be selected for: "
246  << init_state.AsString() << " at E = " << nu4p.E() << " GeV";
247  return 0;
248  }
249 
250  //-- Get a ptr to the interaction summary
251  LOG("GEVGDriver", pDEBUG) << "Getting the selected interaction";
252  Interaction * interaction = fCurrentRecord->Summary();
253 
254  //-- Find the appropriate concrete EventGeneratorI implementation
255  // for generating this event.
256  //
257  // The right EventGeneratorI will be selecting by iterating over the
258  // entries of the EventGeneratorList and compare the interaction
259  // against the ValidityContext declared by each EventGeneratorI
260  //
261  // (note: use of the 'Chain of Responsibility' Design Pattern)
262 
263  LOG("GEVGDriver", pINFO) << "Finding an appropriate EventGenerator";
264 
265  const EventGeneratorI * evgen = fIntGenMap->FindGenerator(interaction);
266  assert(evgen);
267 
269  rtinfo->UpdateRunningThread(evgen);
270 
271  //-- Generate the selected event
272  //
273  // The selected EventGeneratorI subclass will start processing the
274  // event record (by sequentially asking each entry in its list of
275  // EventRecordVisitorI subclasses to visit and process the record).
276  // Most of the actual event generation takes place in this step.
277  //
278  // (note: use of the 'Visitor' Design Pattern)
279 
280  string mesg = "Requesting from event generation thread: " +
281  evgen->Id().Key() + " to generate the selected interaction";
282 
283  LOG("GEVGDriver", pNOTICE)
284  << utils::print::PrintFramedMesg(mesg,1,'=');
285 
288 
289  //-- Check the generated event flags. The default behaviour is
290  // to reject an unphysical event and enter in recursive mode
291  // and try to regenerate it. If an unphysical event mask has
292  // been set, error conditions may be ignored so that the
293  // requested classes of unphysical events can be passed-through.
294 
295  bool unphys = fCurrentRecord->IsUnphysical();
296  if(!unphys) {
297  LOG("GEVGDriver", pINFO) << "Returning the current event!";
298  fNRecLevel = 0;
299  return fCurrentRecord; // The client 'adopts' the event record
300  } else {
301  LOG("GEVGDriver", pWARN) << "An unphysical event was generated...";
302  // Check whether the user wants to ignore the err
303  bool accept = fCurrentRecord->Accept();
304  if(accept) {
305  LOG("GEVGDriver", pWARN)
306  << "The generated unphysical event is accepted by the user";
307  fNRecLevel = 0;
308  return fCurrentRecord; // The client 'adopts' the event record
309 
310  } else {
311  LOG("GEVGDriver", pWARN)
312  << "The generated unphysical event is rejected";
313  delete fCurrentRecord;
314  fCurrentRecord = 0;
315  fNRecLevel++; // increase the nested level counter
316 
318  LOG("GEVGDriver", pWARN)
319  << "Attempting to regenerate the event...";
320  return this->GenerateEvent(nu4p);
321  } else {
322  LOG("GEVGDriver", pERROR)
323  << "Could not produce a physical event after "
324  << kRecursiveModeMaxDepth << " attempts!";
325  delete fCurrentRecord;
326  fCurrentRecord = 0;
327  fNRecLevel = 0;
328  return 0;
329 // exit(1);
330  }
331  }
332  }
333 }
EventRecord * fCurrentRecord
ptr to the event record being processed
Definition: GEVGDriver.h:120
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
#define pERROR
Definition: Messenger.h:60
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:135
const EventGeneratorI * FindGenerator(const Interaction *in) const
Defines the EventGeneratorI interface.
unsigned int fNRecLevel
recursive mode depth counter
Definition: GEVGDriver.h:127
InteractionSelectorI * fIntSelector
interaction selector
Definition: GEVGDriver.h:122
Summary information for an interaction.
Definition: Interaction.h:56
virtual bool Accept(void) const
Definition: GHepRecord.cxx:983
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition: GEVGDriver.h:124
#define pINFO
Definition: Messenger.h:63
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
#define pWARN
Definition: Messenger.h:61
static RunningThreadInfo * Instance(void)
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
virtual bool IsUnphysical(void) const
Definition: GHepRecord.h:120
void UpdateRunningThread(const EventGeneratorI *evg)
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
assert(nhit_max >=nhit_nbins)
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Definition: PrintUtils.cxx:171
#define pNOTICE
Definition: Messenger.h:62
virtual EventRecord * SelectInteraction(const InteractionGeneratorMap *igmp, const TLorentzVector &p4) const =0
Define the InteractionSelectorI interface.
Module to generate only pions from cosmic rays.
void SetUnphysEventMask(const TBits &mask)
Definition: GHepRecord.cxx:974
Keep info on the event generation thread currently on charge. This is used so that event generation m...
string Key(void) const
Definition: AlgId.h:47
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64
EventRecord * GenerateEvent(const TLorentzVector &nu4p)
Definition: GEVGDriver.cxx:229
static const unsigned int kRecursiveModeMaxDepth
Definition: Controls.h:30
void GEVGDriver::Init ( void  )
private

Definition at line 68 of file GEVGDriver.cxx.

References MECModelEnuComparisons::i, LOG, genie::GHepFlags::NFlags(), and pNOTICE.

Referenced by XSecSumSpline().

69 {
70  // initial state for which this driver is configured
71  fInitState = 0;
72 
73  // current event record (ownership is transfered at GenerateEvent())
74  fCurrentRecord = 0;
75 
76  // list of Event Generator objects loaded into the driver
77  fEvGenList = 0;
78 
79  // interaction selector
80  fIntSelector = 0;
81 
82  // flag instructing the driver whether, for each interaction, to compute
83  // cross section by running their corresponding XSecAlgorithm or by
84  // evaluating their corresponding xsec spline
85  fUseSplines = false;
86 
87  // set of event generators to be loaded by this driver
88  fEventGenList = "Default";
89 
90  // 'depth' counter when entering a recursive mode to re-generate a failed/
91  // unphysical event - the driver is not allowed to go into arbitrarily large
92  // depths
93  fNRecLevel = 0;
94 
95  // an "interaction" -> "generator" associative contained built for all
96  // simulated interactions (from the loaded Event Generators and for the
97  // input initial state)
98  fIntGenMap = 0;
99 
100  // A spline describing the sum of all interaction cross sections given an
101  // initial state (the init state with which this driver was configured).
102  // Create it using the CreateXSecSumSpline() method
103  // The sum of all interaction cross sections is used, for example, by
104  // GMCJDriver for selecting an initial state.
105  fXSecSumSpl = 0;
106 
107  // Default driver behaviour is to filter out unphysical events
108  // If needed, set the fUnphysEventMask bitfield to get pre-selected types of
109  // unphysical events (just set to 1 the bit you want ignored from the check).
110  // Be warned that the event record for unphysical events might be incomplete
111  // depending on the processing step that event generation was stopped.
112  fUnphysEventMask = new TBits(GHepFlags::NFlags());
113  //fUnphysEventMask->ResetAllBits(true);
114  for(unsigned int i = 0; i < GHepFlags::NFlags(); i++) {
115  fUnphysEventMask->SetBitNumber(i, true);
116  }
117  LOG("GEVGDriver", pNOTICE)
118  << "Initializing unphysical event mask (bits: " << GHepFlags::NFlags()-1
119  << " -> 0) : " << *fUnphysEventMask;
120 }
EventRecord * fCurrentRecord
ptr to the event record being processed
Definition: GEVGDriver.h:120
string fEventGenList
list of event generators loaded by this driver (what used to be the $GEVGL setting) ...
Definition: GEVGDriver.h:128
unsigned int fNRecLevel
recursive mode depth counter
Definition: GEVGDriver.h:127
InteractionSelectorI * fIntSelector
interaction selector
Definition: GEVGDriver.h:122
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition: GEVGDriver.h:124
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
Spline * fXSecSumSpl
sum{xsec(all interactions | this init state)}
Definition: GEVGDriver.h:126
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
#define pNOTICE
Definition: Messenger.h:62
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
const InteractionList * GEVGDriver::Interactions ( void  ) const

Definition at line 335 of file GEVGDriver.cxx.

References LOG, and pWARN.

Referenced by SaveGraphsToRootFile(), and SaveToPsFile().

336 {
337 // Returns the list of all interactions that can be generated by this driver
338 
339  if(!fIntGenMap) {
340  LOG("GEVGDriver", pWARN)
341  << "Interaction->Generator Map has not being built yet!";
342  return 0;
343  }
344 
346  return &ilst;
347 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pWARN
Definition: Messenger.h:61
const InteractionList & GetInteractionList(void) const
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
A vector of Interaction objects.
void GEVGDriver::Print ( ostream &  stream) const

Definition at line 707 of file GEVGDriver.cxx.

References genie::utils::print::BoolAsIOString(), and genie::GHepFlags::NFlags().

Referenced by genie::operator<<(), and XSecSumSpline().

708 {
709  stream
710  << "\n\n *********************** GEVGDriver ***************************";
711 
712  int ppdg = fInitState->ProbePdg();
713  int tgtpdg = fInitState->Tgt().Pdg();
714 
715  stream << "\n |---o Probe PDG-code ......: " << ppdg;
716  stream << "\n |---o Target PDG-code .....: " << tgtpdg;
717 
718  stream << "\n |---o Using cross section splines is turned "
720  stream << "\n |---o Unphysical event filter mask ("
721  << GHepFlags::NFlags() << "->0) = " << *fUnphysEventMask;
722 
723  stream << "\n *********************************************************\n";
724 }
int Pdg(void) const
Definition: Target.h:72
string BoolAsIOString(bool b)
Definition: PrintUtils.cxx:109
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition: GEVGDriver.h:124
int ProbePdg(void) const
Definition: InitialState.h:65
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
const Target & Tgt(void) const
Definition: InitialState.h:67
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
void GEVGDriver::Reset ( void  )

Definition at line 132 of file GEVGDriver.cxx.

References Init().

Referenced by XSecSumSpline().

133 {
134  this->CleanUp();
135  this->Init();
136 }
void Init(void)
Definition: GEVGDriver.cxx:68
void CleanUp(void)
Definition: GEVGDriver.cxx:122
void GEVGDriver::SetEventGeneratorList ( string  listname)

Definition at line 349 of file GEVGDriver.cxx.

References LOG, and pNOTICE.

Referenced by GenerateEventsAtFixedInitState(), GetEventGenDriver(), main(), and genie::GMCJDriver::PopulateEventGenDriverPool().

350 {
351  LOG("GEVGDriver", pNOTICE)
352  << "Setting event generator list: " << listname;
353 
354  fEventGenList = listname;
355 }
string fEventGenList
list of event generators loaded by this driver (what used to be the $GEVGL setting) ...
Definition: GEVGDriver.h:128
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pNOTICE
Definition: Messenger.h:62
void GEVGDriver::SetUnphysEventMask ( const TBits &  mask)

Definition at line 220 of file GEVGDriver.cxx.

References LOG, lem_server::mask, genie::GHepFlags::NFlags(), and pNOTICE.

Referenced by genie::GMCJDriver::GenerateEventKinematics(), and GenerateEventsAtFixedInitState().

221 {
223 
224  LOG("GEVGDriver", pNOTICE)
225  << "Setting unphysical event mask (bits: " << GHepFlags::NFlags() - 1
226  << " -> 0) : " << *fUnphysEventMask;
227 }
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TBits * fUnphysEventMask
controls whether unphysical events are returned
Definition: GEVGDriver.h:124
#define pNOTICE
Definition: Messenger.h:62
void GEVGDriver::UseSplines ( void  )

Definition at line 509 of file GEVGDriver.cxx.

References ana::assert(), genie::Interaction::AsString(), genie::Algorithm::Id(), genie::XSecSplineList::Instance(), genie::AlgId::Key(), LOG, pWARN, and genie::XSecSplineList::SplineExists().

Referenced by Configure(), make_sk_xsec_table(), and genie::GMCJDriver::PopulateEventGenDriverPool().

510 {
511 // Instructs the driver to use cross section splines rather than computing
512 // cross sections by integrating the differential cross section model which
513 // can be very time-consuming.
514 // **Note**
515 // -- If you called GEVGDriver::CreateSplines() already the driver would
516 // a) assume that you want to use them and b) would be assured that it
517 // has all the splines it needs, so you do not need to call this method.
518 // -- If you populated the XSecSplineList in another way without this driver
519 // knowing about it, eg from an external XML file, do call this method
520 // to let the driver know that you want to use the splines. However, note
521 // that the driver would **explicitly check** that you have loaded all the
522 // splines it needs. If not, then its fiery personality will take over and
523 // it will refuse your request, reverting back to not using splines.
524 
525  fUseSplines = true;
526 
527  // Get the list of spline objects
528  // Should have been constructed at the job initialization
530 
531  // If the user wants to use splines, make sure that all the splines needed
532  // have been computed or loaded
533  if(fUseSplines) {
534 
535  // Get the list of all interactions that can be generated by this driver
537 
538  // Loop over all interactions & check that all splines have been loaded
539  InteractionList::const_iterator intliter;
540  for(intliter = ilst.begin(); intliter != ilst.end(); ++intliter) {
541 
542  // current interaction
543  Interaction * interaction = *intliter;
544 
545  // corresponding cross section algorithm
546  const XSecAlgorithmI * xsec_alg =
547  fIntGenMap->FindGenerator(interaction)->CrossSectionAlg();
548  assert(xsec_alg);
549 
550  // spline exists in spline list?
551  bool spl_exists = xsl->SplineExists(xsec_alg, interaction);
552 
553  // update the 'use splines' flag
554  fUseSplines = fUseSplines && spl_exists;
555 
556  if(!spl_exists) {
557  if(!xsec_alg) {
558  LOG("GEVGDriver", pWARN)
559  << "Null cross-section algorithm! Can not load cross-section spline.";
560  return;
561  }
562  if(!interaction) {
563  LOG("GEVGDriver", pWARN)
564  << "Null interaction! Can not load cross-section spline.";
565  return;
566  }
567  LOG("GEVGDriver", pWARN)
568  << "*** At least a spline (algorithm: "
569  << xsec_alg->Id().Key() << ", interaction: "
570  << interaction->AsString() << " doesn't exist. "
571  << "Reverting back to not using splines";
572  return;
573  }
574  } // loop over interaction list
575  }//use-splines?
576 }
Cross Section Calculation Interface.
const EventGeneratorI * FindGenerator(const Interaction *in) const
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
static XSecSplineList * Instance()
string AsString(void) const
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pWARN
Definition: Messenger.h:61
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
const InteractionList & GetInteractionList(void) const
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
assert(nhit_max >=nhit_nbins)
A vector of Interaction objects.
List of cross section vs energy splines.
string Key(void) const
Definition: AlgId.h:47
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
Range1D_t GEVGDriver::ValidEnergyRange ( void  ) const

Definition at line 669 of file GEVGDriver.cxx.

References ana::assert(), E, Emax, genie::GVldContext::Emax(), genie::GVldContext::Emin(), genie::Range1D_t::max, genie::Range1D_t::min, and genie::EventGeneratorI::ValidityContext().

Referenced by genie::GMCJDriver::BootstrapXSecSplineSummation(), and XSecSumSpline().

670 {
671 // loops over all loaded event generation threads, queries for the energy
672 // range at their validity context and builds the valid energy range for
673 // this driver
674 
675  Range1D_t E;
676  E.min = 9999;
677  E.max = -9999;
678 
679  EventGeneratorList::const_iterator evgliter; // event generator list iter
680 
681  // loop over all EventGenerator objects used in the current job
682  for(evgliter = fEvGenList->begin();
683  evgliter != fEvGenList->end(); ++evgliter) {
684  // current event generator
685  const EventGeneratorI * evgen = *evgliter;
686 
687  // Emin, Emax as declared in current generator's validity context
688  double Emin = TMath::Max(0.001,evgen->ValidityContext().Emin());
689  double Emax = evgen->ValidityContext().Emax();
690 
691  // combined Emin, Emax
692  E.min = TMath::Min(E.min, Emin);
693  E.max = TMath::Max(E.max, Emax);
694  }
695  assert(E.min<E.max && E.min>=0);
696  return E;
697 }
A simple [min,max] interval for doubles.
Definition: Range1.h:43
Defines the EventGeneratorI interface.
virtual const GVldContext & ValidityContext(void) const =0
Float_t E
Definition: plot.C:20
double max
Definition: Range1.h:54
double Emax(void) const
Definition: GVldContext.h:47
assert(nhit_max >=nhit_nbins)
double Emax
double Emin(void) const
Definition: GVldContext.h:46
double min
Definition: Range1.h:53
Module to generate only pions from cosmic rays.
EventGeneratorList * fEvGenList
all Event Generators available at this job
Definition: GEVGDriver.h:121
const Spline * GEVGDriver::XSecSpline ( const Interaction interaction) const

Definition at line 489 of file GEVGDriver.cxx.

References ana::assert(), genie::XSecSplineList::GetSpline(), and genie::XSecSplineList::Instance().

Referenced by SaveGraphsToRootFile(), SaveToPsFile(), and XSecSumSpline().

490 {
491 // Returns the cross section spline for the input interaction as was
492 // computed from the cross section model associated with that interaction.
493 
494  if (!fUseSplines) return 0;
495 
496  // Get the list of spline objects
497  // Should have been constructed at the job initialization
499 
500  // get corresponding cross section algorithm for the input interaction
501  const XSecAlgorithmI * xsec_alg =
502  fIntGenMap->FindGenerator(interaction)->CrossSectionAlg();
503  assert(xsec_alg);
504 
505  const Spline * spl = xssl->GetSpline(xsec_alg,interaction);
506  return spl;
507 }
Cross Section Calculation Interface.
const EventGeneratorI * FindGenerator(const Interaction *in) const
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:47
static XSecSplineList * Instance()
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
assert(nhit_max >=nhit_nbins)
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
List of cross section vs energy splines.
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
double GEVGDriver::XSecSum ( const TLorentzVector &  nup4)

Definition at line 374 of file GEVGDriver.cxx.

References ana::assert(), genie::Interaction::AsString(), genie::units::cm2, E, genie::Spline::Evaluate(), genie::PDGLibrary::Find(), GetName(), genie::XSecSplineList::GetSpline(), genie::Interaction::InitStatePtr(), genie::PDGLibrary::Instance(), genie::XSecSplineList::Instance(), genie::XSecAlgorithmI::Integral(), LOG, pDEBUG, pINFO, genie::InitialState::SetProbeP4(), SLOG, genie::XSecSplineList::SplineExists(), and xsec.

Referenced by XSecSumSpline().

375 {
376 // Computes the sum of the cross sections for all the interactions that can
377 // be simulated for the given initial state and for the input neutrino energy
378 //
379  LOG("GEVGDriver", pDEBUG) << "Computing the cross section sum";
380 
381  double xsec_sum = 0;
382 
383  // Get the list of spline objects
384  // Should have been constructed at the job initialization
386 
387  // Get the list of all interactions that can be generated by this driver
389 
390  // Loop over all interactions & compute cross sections
391  InteractionList::const_iterator intliter;
392  for(intliter = ilst.begin(); intliter != ilst.end(); ++intliter) {
393 
394  // get current interaction
395  Interaction * interaction = new Interaction(**intliter);
396  interaction->InitStatePtr()->SetProbeP4(nup4);
397 
398  string code = interaction->AsString();
399  SLOG("GEVGDriver", pDEBUG)
400  << "Compute cross section for interaction: \n" << code;
401 
402  // get corresponding cross section algorithm
403  const XSecAlgorithmI * xsec_alg =
404  fIntGenMap->FindGenerator(interaction)->CrossSectionAlg();
405  assert(xsec_alg);
406 
407  // compute (or evaluate) the cross section
408  double xsec = 0;
409  bool spline_exists = xssl->SplineExists(xsec_alg, interaction);
410  if (spline_exists && fUseSplines) {
411  double E = nup4.Energy();
412  xsec = xssl->GetSpline(xsec_alg,interaction)->Evaluate(E);
413  } else
414  xsec = xsec_alg->Integral(interaction);
415 
416  xsec = TMath::Max(0., xsec);
417 
418  // sum-up and report
419  xsec_sum += xsec;
420  LOG("GEVGDriver", pDEBUG)
421  << "\nInteraction = " << code
422  << "\nCross Section "
423  << (fUseSplines ? "*interpolated*" : "*computed*")
424  << " = " << (xsec/units::cm2) << " cm2";
425 
426  delete interaction;
427  } // loop over event generators
428 
429  PDGLibrary * pdglib = PDGLibrary::Instance();
430  LOG("GEVGDriver", pINFO)
431  << "SumXSec("
432  << pdglib->Find(fInitState->ProbePdg())->GetName() << "+"
433  << pdglib->Find(fInitState->Tgt().Pdg())->GetName() << "->X, "
434  << "E = " << nup4.Energy() << " GeV)"
435  << (fUseSplines ? "*interpolated*" : "*computed*")
436  << " = " << (xsec_sum/units::cm2) << " cm2";
437 
438  return xsec_sum;
439 }
Cross Section Calculation Interface.
void SetProbeP4(const TLorentzVector &P4)
const EventGeneratorI * FindGenerator(const Interaction *in) const
bool SplineExists(const XSecAlgorithmI *alg, const Interaction *i) const
int Pdg(void) const
Definition: Target.h:72
static XSecSplineList * Instance()
double Evaluate(double x) const
Definition: Spline.cxx:362
static const double cm2
Definition: Units.h:77
string AsString(void) const
Summary information for an interaction.
Definition: Interaction.h:56
std::string GetName(int i)
#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
virtual double Integral(const Interaction *i) const =0
int ProbePdg(void) const
Definition: InitialState.h:65
#define pINFO
Definition: Messenger.h:63
InitialState * fInitState
initial state information for driver instance
Definition: GEVGDriver.h:119
Double_t xsec[nknots]
Definition: testXsec.C:47
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
Definition: inftrees.h:24
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:30
const InteractionList & GetInteractionList(void) const
InteractionGeneratorMap * fIntGenMap
interaction -> generator assosiative container
Definition: GEVGDriver.h:123
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
assert(nhit_max >=nhit_nbins)
A vector of Interaction objects.
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const Target & Tgt(void) const
Definition: InitialState.h:67
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
Definition: Messenger.h:85
const Spline * GetSpline(const XSecAlgorithmI *alg, const Interaction *i) const
List of cross section vs energy splines.
bool fUseSplines
controls whether xsecs are computed or interpolated
Definition: GEVGDriver.h:125
#define pDEBUG
Definition: Messenger.h:64
const Spline* genie::GEVGDriver::XSecSumSpline ( void  ) const
inline

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const GEVGDriver driver 
)
friend

Definition at line 51 of file GEVGDriver.cxx.

Referenced by XSecSumSpline().

52  {
53  driver.Print(stream);
54  return stream;
55  }
void Print(ostream &stream) const
Definition: GEVGDriver.cxx:707

Member Data Documentation

EventRecord* genie::GEVGDriver::fCurrentRecord
private

ptr to the event record being processed

Definition at line 120 of file GEVGDriver.h.

string genie::GEVGDriver::fEventGenList
private

list of event generators loaded by this driver (what used to be the $GEVGL setting)

Definition at line 128 of file GEVGDriver.h.

EventGeneratorList* genie::GEVGDriver::fEvGenList
private

all Event Generators available at this job

Definition at line 121 of file GEVGDriver.h.

Referenced by EventGenerators().

InitialState* genie::GEVGDriver::fInitState
private

initial state information for driver instance

Definition at line 119 of file GEVGDriver.h.

InteractionGeneratorMap* genie::GEVGDriver::fIntGenMap
private

interaction -> generator assosiative container

Definition at line 123 of file GEVGDriver.h.

InteractionSelectorI* genie::GEVGDriver::fIntSelector
private

interaction selector

Definition at line 122 of file GEVGDriver.h.

unsigned int genie::GEVGDriver::fNRecLevel
private

recursive mode depth counter

Definition at line 127 of file GEVGDriver.h.

TBits* genie::GEVGDriver::fUnphysEventMask
private

controls whether unphysical events are returned

Definition at line 124 of file GEVGDriver.h.

bool genie::GEVGDriver::fUseSplines
private

controls whether xsecs are computed or interpolated

Definition at line 125 of file GEVGDriver.h.

Spline* genie::GEVGDriver::fXSecSumSpl
private

sum{xsec(all interactions | this init state)}

Definition at line 126 of file GEVGDriver.h.

Referenced by XSecSumSpline().


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