Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
ExTGRCRegionData Class Reference

#include <ExTGRCRegionData.hh>

Public Member Functions

 ExTGRCRegionData (const std::vector< G4String > &rd)
 
 ~ExTGRCRegionData ()
 
void SetCutsData (const std::vector< G4String > &cu)
 
G4String GetRegionName () const
 
std::vector< G4StringGetLVNames ()
 
G4double GetGammaCut () const
 
G4double GetElectronCut () const
 
G4double GetPositronCut () const
 
G4bool CutsAreSet () const
 

Detailed Description

Stores cuts per region data

Changes: creation May 2007

Author
P. Arce

Definition at line 42 of file ExTGRCRegionData.hh.

Constructor & Destructor Documentation

ExTGRCRegionData::ExTGRCRegionData ( const std::vector< G4String > &  rd)

Definition at line 37 of file ExTGRCRegionData.cc.

References G4UIcommand::ConvertToString(), FatalErrorInArgument, and G4Exception().

38 {
39  if( wl.size() < 2 )
40  {
41  G4Exception("ExTGRCRegionData::ExTGRCRegionData()",
42  "InvalidArgument", FatalErrorInArgument,
43  G4UIcommand::ConvertToString( G4int(wl.size()) ) );
44  }
45  fRegionName = wl[0];
46  for( size_t ii = 1; ii < wl.size(); ii++ )
47  {
48  fLVNames.push_back( wl[ii] );
49  }
50  fbCutsSet = false;
51  fGammaCut = 1.;
52  fElectronCut = 1.;
53  fPositronCut = 1.;
54 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:357
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
ExTGRCRegionData::~ExTGRCRegionData ( )

Definition at line 57 of file ExTGRCRegionData.cc.

58 {
59 }

Member Function Documentation

G4bool ExTGRCRegionData::CutsAreSet ( ) const
inline

Definition at line 58 of file ExTGRCRegionData.hh.

58 { return fbCutsSet; }
G4double ExTGRCRegionData::GetElectronCut ( ) const
inline

Definition at line 56 of file ExTGRCRegionData.hh.

56 { return fElectronCut; }
G4double ExTGRCRegionData::GetGammaCut ( ) const
inline

Definition at line 55 of file ExTGRCRegionData.hh.

55 { return fGammaCut; }
std::vector<G4String> ExTGRCRegionData::GetLVNames ( )
inline

Definition at line 54 of file ExTGRCRegionData.hh.

54 { return fLVNames; }
G4double ExTGRCRegionData::GetPositronCut ( ) const
inline

Definition at line 57 of file ExTGRCRegionData.hh.

57 { return fPositronCut; }
G4String ExTGRCRegionData::GetRegionName ( ) const
inline

Definition at line 53 of file ExTGRCRegionData.hh.

53 { return fRegionName; }
void ExTGRCRegionData::SetCutsData ( const std::vector< G4String > &  cu)

Definition at line 62 of file ExTGRCRegionData.cc.

References G4UIcommand::ConvertToString(), FatalErrorInArgument, G4cerr, G4endl, G4Exception(), G4tgrUtils::GetDouble(), and JustWarning.

63 {
64  if( (rc.size() != 3) && (rc.size() != 4) )
65  {
66  G4cerr << "ERROR - ExTGRCRegionData::SetCutsData()" << G4endl
67  << " Must have 3 or 4 arguments : "
68  << "REGION_NAME, gamma_CUT, e-_CUT (e+_CUT)." << G4endl
69  << " It has only " << rc.size() << " !" << G4endl;
70  G4Exception("ExTGRCRegionCutsMgr::AddRegionCuts()",
71  "InvalidArgument", FatalErrorInArgument,
72  G4UIcommand::ConvertToString( G4int(rc.size()) ) );
73  }
74 
75  if( fbCutsSet )
76  {
77  G4Exception("ExTGRCRegionData::SetCutsData()",
78  "InvalidArgument", JustWarning,
79  G4String("Cuts are already set for region " + fRegionName).c_str() );
80  }
81 
82  fGammaCut = G4tgrUtils::GetDouble( rc[1] );
83  fElectronCut = G4tgrUtils::GetDouble( rc[2] );
84  if( rc.size() == 3 )
85  {
86  fPositronCut = fElectronCut;
87  }
88  else
89  {
90  fPositronCut = G4tgrUtils::GetDouble( rc[3] );
91  }
92 
93  fbCutsSet = true;
94 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:357
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:205
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

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