GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XSecAlgorithmI.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <c.andreopoulos \at cern.ch>
7  University of Liverpool
8 */
9 //____________________________________________________________________________
10 
13 
14 using namespace genie;
15 
16 //___________________________________________________________________________
18 Algorithm()
19 {
20 
21 }
22 //___________________________________________________________________________
24 Algorithm(name)
25 {
26 
27 }
28 //___________________________________________________________________________
29 XSecAlgorithmI::XSecAlgorithmI(string name, string config) :
30 Algorithm(name, config)
31 {
32 
33 }
34 //___________________________________________________________________________
36 {
37 
38 }
39 //___________________________________________________________________________
40 bool XSecAlgorithmI::ValidKinematics(const Interaction* interaction) const
41 {
42 // can offer common implementation for all concrete x-section models because
43 // the input interaction is aware of its kinematic limits
44 
45  if ( interaction->TestBit(kISkipKinematicChk) ) return true;
46 
47  const KPhaseSpace& kps = interaction->PhaseSpace();
48 
49  if ( ! kps.IsAboveThreshold() ) {
50  LOG("XSecBase", pINFO) << "*** Below energy threshold";
51  return false;
52  }
53  if ( ! kps.IsAllowed() ) {
54  LOG("XSecBase", pINFO) << "*** Not in allowed kinematical space";
55  return false;
56  }
57  return true;
58 }
59 //___________________________________________________________________________
const KPhaseSpace & PhaseSpace(void) const
Definition: Interaction.h:73
Algorithm abstract base class.
Definition: Algorithm.h:54
Summary information for an interaction.
Definition: Interaction.h:56
virtual bool ValidKinematics(const Interaction *i) const
Is the input kinematical point a physically allowed one?
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Kinematical phase space.
Definition: KPhaseSpace.h:33
#define pINFO
Definition: Messenger.h:62
const UInt_t kISkipKinematicChk
if set, skip kinematic validity checks
Definition: Interaction.h:48
bool IsAllowed(void) const
Check whether the current kinematics is in the allowed phase space.
bool IsAboveThreshold(void) const
Checks whether the interaction is above the energy threshold.