Geant4_10
ExTGRCRegionData.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: ExTGRCRegionData.cc 76943 2013-11-19 09:57:34Z gcosmo $
27 //
30 
31 
32 #include "ExTGRCRegionData.hh"
33 #include "G4tgrUtils.hh"
34 #include "G4UIcommand.hh"
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37 ExTGRCRegionData::ExTGRCRegionData(const std::vector<G4String>& wl )
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 }
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 {
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 void ExTGRCRegionData::SetCutsData( const std::vector<G4String>& rc )
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 }
void SetCutsData(const std::vector< G4String > &cu)
ExTGRCRegionData(const std::vector< G4String > &rd)
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
Definition of the ExTGRCRegionData class.
G4GLOB_DLL std::ostream G4cerr