Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GIDI_settings_particle Class Reference

#include <GIDI_settings.hh>

Public Member Functions

 GIDI_settings_particle (int PoPId, bool transporting, int energyMode)
 
 GIDI_settings_particle (GIDI_settings_particle const &particle)
 
int initialize (int PoPId, bool transporting, int energyMode)
 
 ~GIDI_settings_particle ()
 
int addFlux (GIDI::statusMessageReporting *smr, GIDI_settings_flux const &flux)
 
GIDI_settings_processedFlux const * nearestFluxToTemperature (double temperature) const
 
int getGroupIndexFromEnergy (double e_in, bool encloseOutOfRange) const
 
int getNumberOfGroups (void) const
 
int getPoPId (void) const
 
int getEnergyMode (void) const
 
bool getTransporting (void) const
 
GIDI_settings_group getGroup (void) const
 
GIDI_settings_flux const * getFlux (double temperature) const
 
GIDI::ptwXPointsgroupFunction (GIDI::statusMessageReporting *smr, GIDI::ptwXYPoints *ptwXY1, double temperature, int order) const
 
void setGroup (GIDI_settings_group const &group)
 
bool isEnergyMode_continuous (void) const
 
bool isEnergyMode_grouped (void) const
 
bool isEnergyMode_fixedGrid (void) const
 

Detailed Description

Definition at line 184 of file GIDI_settings.hh.

Constructor & Destructor Documentation

GIDI_settings_particle::GIDI_settings_particle ( int  PoPId,
bool  transporting,
int  energyMode 
)

Definition at line 16 of file GIDI_settings_particle.cc.

16  : mGroup( ) {
17 
18  initialize( PoPId, transporting, energyMode );
19 }
int initialize(int PoPId, bool transporting, int energyMode)

Here is the call graph for this function:

GIDI_settings_particle::GIDI_settings_particle ( GIDI_settings_particle const &  particle)

Definition at line 23 of file GIDI_settings_particle.cc.

23  {
24 
25  initialize( particle.mPoPId, particle.mTransporting, particle.mEnergyMode );
26  setGroup( particle.mGroup );
27  for( std::vector<GIDI_settings_processedFlux>::const_iterator iter = particle.mProcessedFluxes.begin( ); iter != particle.mProcessedFluxes.end( ); ++iter ) {
28  mProcessedFluxes.push_back( *iter );
29  }
30 }
void setGroup(GIDI_settings_group const &group)
int initialize(int PoPId, bool transporting, int energyMode)

Here is the call graph for this function:

GIDI_settings_particle::~GIDI_settings_particle ( )

Definition at line 68 of file GIDI_settings_particle.cc.

68  {
69 
70  if( mGroupX != NULL ) ptwX_free( mGroupX );
71 }
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158

Here is the call graph for this function:

Member Function Documentation

int GIDI_settings_particle::addFlux ( GIDI::statusMessageReporting smr,
GIDI_settings_flux const &  flux 
)

Definition at line 75 of file GIDI_settings_particle.cc.

75  {
76 
77  double temperature = flux.getTemperature( );
78  std::vector<GIDI_settings_processedFlux>::iterator iter;
79 
80  for( iter = mProcessedFluxes.begin( ); iter != mProcessedFluxes.end( ); ++iter ) {
81  if( temperature <= iter->getTemperature( ) ) break;
82  }
83 // BRB need to check if temperature is the same.
84  mProcessedFluxes.insert( iter, GIDI_settings_processedFlux( flux, mGroupX ) );
85  return( 0 );
86 }

Here is the call graph for this function:

int GIDI_settings_particle::getEnergyMode ( void  ) const
inline

Definition at line 205 of file GIDI_settings.hh.

205 { return( mEnergyMode ); }
GIDI_settings_flux const* GIDI_settings_particle::getFlux ( double  temperature) const
GIDI_settings_group GIDI_settings_particle::getGroup ( void  ) const
inline

Definition at line 207 of file GIDI_settings.hh.

207 { return( mGroup ); }

Here is the caller graph for this function:

int GIDI_settings_particle::getGroupIndexFromEnergy ( double  e_in,
bool  encloseOutOfRange 
) const
inline

Definition at line 202 of file GIDI_settings.hh.

202 { return( mGroup.getGroupIndexFromEnergy( e_in, encloseOutOfRange ) ); };
int getGroupIndexFromEnergy(double energy, bool encloseOutOfRange) const

Here is the call graph for this function:

Here is the caller graph for this function:

int GIDI_settings_particle::getNumberOfGroups ( void  ) const
inline

Definition at line 203 of file GIDI_settings.hh.

203 { return( mGroup.getNumberOfGroups( ) ); };
int getNumberOfGroups(void) const

Here is the call graph for this function:

Here is the caller graph for this function:

int GIDI_settings_particle::getPoPId ( void  ) const
inline

Definition at line 204 of file GIDI_settings.hh.

204 { return( mPoPId ); }

Here is the caller graph for this function:

bool GIDI_settings_particle::getTransporting ( void  ) const
inline

Definition at line 206 of file GIDI_settings.hh.

206 { return( mTransporting ); }
ptwXPoints * GIDI_settings_particle::groupFunction ( GIDI::statusMessageReporting smr,
GIDI::ptwXYPoints ptwXY1,
double  temperature,
int  order 
) const

Definition at line 118 of file GIDI_settings_particle.cc.

118  {
119 
120  if( mGroupX == NULL ) return( NULL );
121  GIDI_settings_processedFlux const *processedFlux = nearestFluxToTemperature( temperature );
122  if( processedFlux == NULL ) return( NULL );
123  return( processedFlux->groupFunction( smr, mGroupX, ptwXY1, order ) );
124 }
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXPoints *groupX, GIDI::ptwXYPoints *ptwXY1, int order) const
GIDI_settings_processedFlux const * nearestFluxToTemperature(double temperature) const

Here is the call graph for this function:

Here is the caller graph for this function:

int GIDI_settings_particle::initialize ( int  PoPId,
bool  transporting,
int  energyMode 
)

Definition at line 34 of file GIDI_settings_particle.cc.

34  {
35 
36  mPoPId = PoPId;
37  mTransporting = transporting;
38  int energyMode_ = ( energyMode & GIDI_settings_projectileEnergyMode_continuousEnergy )
40 // + ( energyMode & GIDI_settings_projectileEnergyMode_fixedGrid ) // Currently not supported.
41  ;
42 
43  if( energyMode_ != energyMode ) throw 1;
44  mEnergyMode = energyMode;
45 
46  mGroupX = NULL;
47  setGroup( mGroup );
48  return( 0 );
49 }
void setGroup(GIDI_settings_group const &group)
#define GIDI_settings_projectileEnergyMode_grouped
#define GIDI_settings_projectileEnergyMode_continuousEnergy

Here is the call graph for this function:

Here is the caller graph for this function:

bool GIDI_settings_particle::isEnergyMode_continuous ( void  ) const
inline

Definition at line 212 of file GIDI_settings.hh.

212 { return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_continuousEnergy ); }
#define GIDI_settings_projectileEnergyMode_continuousEnergy
bool GIDI_settings_particle::isEnergyMode_fixedGrid ( void  ) const
inline

Definition at line 214 of file GIDI_settings.hh.

214 { return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_fixedGrid ); }
#define GIDI_settings_projectileEnergyMode_fixedGrid
bool GIDI_settings_particle::isEnergyMode_grouped ( void  ) const
inline

Definition at line 213 of file GIDI_settings.hh.

213 { return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_grouped ); }
#define GIDI_settings_projectileEnergyMode_grouped

Here is the caller graph for this function:

GIDI_settings_processedFlux const * GIDI_settings_particle::nearestFluxToTemperature ( double  temperature) const

Definition at line 90 of file GIDI_settings_particle.cc.

90  {
91 
92  double priorTemperature, lastTemperature;
93  std::vector<GIDI_settings_processedFlux>::const_iterator iter;
94 
95  if( mProcessedFluxes.size( ) == 0 ) return( NULL );
96 
97  priorTemperature = mProcessedFluxes[0].getTemperature( );
98  //TK adds next line
99  lastTemperature = mProcessedFluxes[0].getTemperature( );
100  for( iter = mProcessedFluxes.begin( ); iter != mProcessedFluxes.end( ); ++iter ) {
101  lastTemperature = iter->getTemperature( );
102  if( lastTemperature > temperature ) break;
103  //TK add next line
104  priorTemperature = iter->getTemperature( );
105  }
106  if( iter == mProcessedFluxes.end( ) ) {
107  --iter; }
108  else {
109  //if( fabs( lastTemperature - temperature ) < fabs( temperature - priorTemperature ) ) --iter;
110  //TK modified above line
111  if( std::fabs( lastTemperature - temperature ) > std::fabs( temperature - priorTemperature ) ) --iter;
112  }
113  return( &(*iter) );
114 }

Here is the caller graph for this function:

void GIDI_settings_particle::setGroup ( GIDI_settings_group const &  group)

Definition at line 53 of file GIDI_settings_particle.cc.

53  {
54 
55  nfu_status status_nf;
56 
57  mGroup = group;
58 
59  if( mGroupX != NULL ) ptwX_free( mGroupX );
60  mGroupX = NULL;
61  if( mGroup.size( ) > 0 ) {
62  if( ( mGroupX = ptwX_create( (int) mGroup.size( ), (int) mGroup.size( ), mGroup.pointer( ), &status_nf ) ) == NULL ) throw 1;
63  }
64 }
int size(void) const
ptwXPoints * ptwX_create(int64_t size, int64_t length, double const *xs, nfu_status *status)
Definition: ptwX_core.cc:50
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158
enum nfu_status_e nfu_status
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
double const * pointer(void) const

Here is the call graph for this function:

Here is the caller graph for this function:


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