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

#include <GIDI_settings.hh>

Public Member Functions

 GIDI_settings_group (std::string const &label="empty", int size=0)
 
 GIDI_settings_group (std::string const &label, int length, double const *values)
 
 GIDI_settings_group (std::string const &label, std::vector< double > const &boundaries)
 
 GIDI_settings_group (GIDI_settings_group const &group)
 
 ~GIDI_settings_group ()
 
double operator[] (int const index) const
 
int size (void) const
 
int getNumberOfGroups (void) const
 
double const * pointer (void) const
 
void setFromCDoubleArray (int length, double *values)
 
std::string getLabel () const
 
int getGroupIndexFromEnergy (double energy, bool encloseOutOfRange) const
 
bool isLabel (std::string &label) const
 
void print (bool outline=false, int valuesPerLine=10) const
 

Detailed Description

Definition at line 35 of file GIDI_settings.hh.

Constructor & Destructor Documentation

GIDI_settings_group::GIDI_settings_group ( std::string const &  label = "empty",
int  size = 0 
)

Definition at line 14 of file GIDI_settings_group.cc.

14  {
15 
16  initialize( label, size1, size1, NULL );
17 }

Here is the call graph for this function:

GIDI_settings_group::GIDI_settings_group ( std::string const &  label,
int  length,
double const *  values 
)

Definition at line 21 of file GIDI_settings_group.cc.

21  {
22 
23  initialize( label, length, length, boundaries );
24 }

Here is the call graph for this function:

GIDI_settings_group::GIDI_settings_group ( std::string const &  label,
std::vector< double > const &  boundaries 
)

Definition at line 28 of file GIDI_settings_group.cc.

28  {
29 
30  int size1 = (int) boundaries.size( );
31 
32  initialize( label, size1, size1, &(boundaries[0]) );
33 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)

Here is the call graph for this function:

GIDI_settings_group::GIDI_settings_group ( GIDI_settings_group const &  group)

Definition at line 37 of file GIDI_settings_group.cc.

37  {
38 
39  initialize( group.mLabel, group.size( ), group.size( ), &(group.mBoundaries[0]) );
40 }

Here is the call graph for this function:

GIDI_settings_group::~GIDI_settings_group ( )

Definition at line 57 of file GIDI_settings_group.cc.

57  {
58 
59 }

Member Function Documentation

int GIDI_settings_group::getGroupIndexFromEnergy ( double  energy,
bool  encloseOutOfRange 
) const

Definition at line 63 of file GIDI_settings_group.cc.

63  {
64 
65  int iMin = 0, iMid, iMax = (int) mBoundaries.size( ), iMaxM1 = iMax - 1;
66 
67  if( iMax == 0 ) return( -3 );
68  if( energy < mBoundaries[0] ) {
69  if( encloseOutOfRange ) return( 0 );
70  return( -2 );
71  }
72  if( energy > mBoundaries[iMaxM1] ) {
73  if( encloseOutOfRange ) return( iMax - 2 );
74  return( -1 );
75  }
76  while( 1 ) { // Loop checking, 11.06.2015, T. Koi
77  iMid = ( iMin + iMax ) >> 1;
78  if( iMid == iMin ) break;
79  if( energy < mBoundaries[iMid] ) {
80  iMax = iMid; }
81  else {
82  iMin = iMid;
83  }
84  }
85  if( iMin == iMaxM1 ) iMin--;
86  return( iMin );
87 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string GIDI_settings_group::getLabel ( ) const
inline

Definition at line 54 of file GIDI_settings.hh.

54 { return( mLabel ); }
int GIDI_settings_group::getNumberOfGroups ( void  ) const
inline

Definition at line 50 of file GIDI_settings.hh.

50 { return( (int) ( mBoundaries.size( ) - 1 ) ); }

Here is the caller graph for this function:

bool GIDI_settings_group::isLabel ( std::string &  label) const
inline

Definition at line 56 of file GIDI_settings.hh.

56 { return( label == mLabel ); }
double GIDI_settings_group::operator[] ( int const  index) const
inline

Definition at line 48 of file GIDI_settings.hh.

48 { return( mBoundaries[index] ); }
double const* GIDI_settings_group::pointer ( void  ) const
inline

Definition at line 51 of file GIDI_settings.hh.

51 { return( &(mBoundaries[0]) ); }

Here is the caller graph for this function:

void GIDI_settings_group::print ( bool  outline = false,
int  valuesPerLine = 10 
) const

Definition at line 91 of file GIDI_settings_group.cc.

91  {
92 
93  int nbs = size( );
94  char buffer[128];
95 
96  std::cout << "GROUP: label = '" << mLabel << "': length = " << nbs << std::endl;
97  if( outline ) return;
98  for( int ib = 0; ib < nbs; ib++ ) {
99  sprintf( buffer, "%16.8e", mBoundaries[ib] );
100  std::cout << buffer;
101  if( ( ( ib + 1 ) % valuesPerLine ) == 0 ) std::cout << std::endl;
102  }
103  if( nbs % valuesPerLine ) std::cout << std::endl;
104 }
#define buffer
Definition: xmlparse.cc:628
int size(void) const

Here is the call graph for this function:

void GIDI_settings_group::setFromCDoubleArray ( int  length,
double *  values 
)
int GIDI_settings_group::size ( void  ) const
inline

Definition at line 49 of file GIDI_settings.hh.

49 { return( (int) mBoundaries.size( ) ); }

Here is the caller graph for this function:


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