Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::ptwXPoints * groupFunction (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 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}
int initialize(int PoPId, bool transporting, int energyMode)

◆ 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)

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

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.
84 mProcessedFluxes.insert( iter, GIDI_settings_processedFlux( flux, mGroupX ) );
85 return( 0 );
86}

◆ getEnergyMode()

int GIDI_settings_particle::getEnergyMode ( void  ) const
inline

Definition at line 209 of file GIDI_settings.hh.

209{ return( 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 ); }

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

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

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 ); }

Referenced by GIDI_settings::addParticle().

◆ getTransporting()

bool GIDI_settings_particle::getTransporting ( void  ) const
inline

Definition at line 210 of file GIDI_settings.hh.

210{ return( 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

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

Referenced by GIDI_settings_particle().

◆ isEnergyMode_continuous()

bool GIDI_settings_particle::isEnergyMode_continuous ( void  ) const
inline

Definition at line 216 of file GIDI_settings.hh.

216{ return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_continuousEnergy ); }

◆ isEnergyMode_fixedGrid()

bool GIDI_settings_particle::isEnergyMode_fixedGrid ( void  ) const
inline

Definition at line 218 of file GIDI_settings.hh.

218{ return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_fixedGrid ); }
#define GIDI_settings_projectileEnergyMode_fixedGrid

◆ isEnergyMode_grouped()

bool GIDI_settings_particle::isEnergyMode_grouped ( void  ) const
inline

Definition at line 217 of file GIDI_settings.hh.

217{ return( this->mEnergyMode & GIDI_settings_projectileEnergyMode_grouped ); }

Referenced by MCGIDI_target_heated_recast().

◆ 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}

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

Referenced by GIDI_settings_particle(), and initialize().


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