Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
GIDI_settings_particle Class Reference

#include <GIDI_settings.hh>

Public Member Functions

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

Private Member Functions

GIDI_settings_flux const * getProcessedFlux (double temperature) const
 

Private Attributes

int mEnergyMode
 
GIDI_settings_group mGroup
 
GIDI::ptwXPointsmGroupX
 
int mPoPId
 
std::vector< GIDI_settings_processedFluxmProcessedFluxes
 
bool mTransporting
 

Detailed Description

Definition at line 188 of file GIDI_settings.hh.

Constructor & Destructor Documentation

◆ GIDI_settings_particle() [1/2]

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}
GIDI_settings_group mGroup
int initialize(int PoPId, bool transporting, int energyMode)

References initialize().

◆ GIDI_settings_particle() [2/2]

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)
std::vector< GIDI_settings_processedFlux > mProcessedFluxes

References initialize(), mEnergyMode, mGroup, mPoPId, mProcessedFluxes, mTransporting, and setGroup().

◆ ~GIDI_settings_particle()

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}
GIDI::ptwXPoints * mGroupX
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
Definition: ptwX_core.cc:158

References mGroupX, and ptwX_free().

Member Function Documentation

◆ addFlux()

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.
85 return( 0 );
86}

References GIDI_settings_flux::getTemperature(), mGroupX, and mProcessedFluxes.

◆ getEnergyMode()

int GIDI_settings_particle::getEnergyMode ( void  ) const
inline

Definition at line 209 of file GIDI_settings.hh.

209{ return( mEnergyMode ); }

References mEnergyMode.

◆ getFlux()

GIDI_settings_flux const * GIDI_settings_particle::getFlux ( double  temperature) const

◆ getGroup()

GIDI_settings_group GIDI_settings_particle::getGroup ( void  ) const
inline

Definition at line 211 of file GIDI_settings.hh.

211{ return( mGroup ); }

References mGroup.

Referenced by MCGIDI_reaction_recast().

◆ getGroupIndexFromEnergy()

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

Definition at line 206 of file GIDI_settings.hh.

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

References GIDI_settings_group::getGroupIndexFromEnergy(), and mGroup.

Referenced by MCGIDI_quantitiesLookupModes::setGroupIndex().

◆ getNumberOfGroups()

int GIDI_settings_particle::getNumberOfGroups ( void  ) const
inline

Definition at line 207 of file GIDI_settings.hh.

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

References GIDI_settings_group::getNumberOfGroups(), and mGroup.

Referenced by MCGIDI_target_heated_recast().

◆ getPoPId()

int GIDI_settings_particle::getPoPId ( void  ) const
inline

Definition at line 208 of file GIDI_settings.hh.

208{ return( mPoPId ); }

References mPoPId.

Referenced by GIDI_settings::addParticle().

◆ getProcessedFlux()

GIDI_settings_flux const * GIDI_settings_particle::getProcessedFlux ( double  temperature) const
private

◆ getTransporting()

bool GIDI_settings_particle::getTransporting ( void  ) const
inline

Definition at line 210 of file GIDI_settings.hh.

210{ return( mTransporting ); }

References mTransporting.

◆ groupFunction()

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_settings_processedFlux const * nearestFluxToTemperature(double temperature) const
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXPoints *groupX, GIDI::ptwXYPoints *ptwXY1, int order) const

References GIDI_settings_processedFlux::groupFunction(), mGroupX, and nearestFluxToTemperature().

Referenced by MCGIDI_reaction_recast().

◆ initialize()

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;
48 return( 0 );
49}
#define GIDI_settings_projectileEnergyMode_grouped
#define GIDI_settings_projectileEnergyMode_continuousEnergy

References GIDI_settings_projectileEnergyMode_continuousEnergy, GIDI_settings_projectileEnergyMode_grouped, mEnergyMode, mGroup, mGroupX, mPoPId, mTransporting, and setGroup().

Referenced by GIDI_settings_particle().

◆ isEnergyMode_continuous()

bool GIDI_settings_particle::isEnergyMode_continuous ( void  ) const
inline

◆ isEnergyMode_fixedGrid()

bool GIDI_settings_particle::isEnergyMode_fixedGrid ( void  ) const
inline

Definition at line 218 of file GIDI_settings.hh.

#define GIDI_settings_projectileEnergyMode_fixedGrid

References GIDI_settings_projectileEnergyMode_fixedGrid.

◆ isEnergyMode_grouped()

bool GIDI_settings_particle::isEnergyMode_grouped ( void  ) const
inline

◆ nearestFluxToTemperature()

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}

References mProcessedFluxes.

Referenced by groupFunction().

◆ setGroup()

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}
double const * pointer(void) const
int size(void) const
enum nfu_status_e nfu_status
ptwXPoints * ptwX_create(int64_t size, int64_t length, double const *xs, nfu_status *status)
Definition: ptwX_core.cc:50

References mGroup, mGroupX, GIDI_settings_group::pointer(), ptwX_create(), ptwX_free(), and GIDI_settings_group::size().

Referenced by GIDI_settings_particle(), and initialize().

Field Documentation

◆ mEnergyMode

int GIDI_settings_particle::mEnergyMode
private

Definition at line 193 of file GIDI_settings.hh.

Referenced by getEnergyMode(), GIDI_settings_particle(), and initialize().

◆ mGroup

GIDI_settings_group GIDI_settings_particle::mGroup
private

◆ mGroupX

GIDI::ptwXPoints* GIDI_settings_particle::mGroupX
private

◆ mPoPId

int GIDI_settings_particle::mPoPId
private

Definition at line 191 of file GIDI_settings.hh.

Referenced by getPoPId(), GIDI_settings_particle(), and initialize().

◆ mProcessedFluxes

std::vector<GIDI_settings_processedFlux> GIDI_settings_particle::mProcessedFluxes
private

Definition at line 196 of file GIDI_settings.hh.

Referenced by addFlux(), GIDI_settings_particle(), and nearestFluxToTemperature().

◆ mTransporting

bool GIDI_settings_particle::mTransporting
private

Definition at line 192 of file GIDI_settings.hh.

Referenced by getTransporting(), GIDI_settings_particle(), and initialize().


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