]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliGlobals.cxx
added comment lines separating methods
[u/mrichter/AliRoot.git] / AliGeant4 / AliGlobals.cxx
1 // $Id$
2 // Category: global
3 //
4 // See the class description in the header file.
5
6 #include "AliGlobals.h"
7 #include "TG4Globals.h"
8
9 #include <stdlib.h>
10
11 // static data members
12 const G4double AliGlobals::fgkDefaultCut = 2.0*mm;
13
14 //_____________________________________________________________________________
15 AliGlobals::AliGlobals() {
16 //
17 }
18   
19 //_____________________________________________________________________________
20 AliGlobals::~AliGlobals() {
21 //
22 }
23   
24 // static methods
25
26 //_____________________________________________________________________________
27 void AliGlobals::Exception(const char* s)
28 {
29 // Prints error message end exits the program.
30 // ---
31
32   if (s)
33   {  G4cerr << G4endl << "    " << s << G4endl; }
34   G4cerr << "*** AliceException: Aborting execution ***" << G4endl;   
35   exit(1);
36 }
37
38 //_____________________________________________________________________________
39 void AliGlobals::Warning(const char* s)
40 {
41 // Prints warning message.
42 // ---
43
44   G4cerr << "+++ Alice Warning: +++" << G4endl;   
45   if (s)
46   {  G4cerr  << "    " << s << G4endl; }
47   G4cerr << "++++++++++++++++++++++" << G4endl;   
48 }
49
50 #ifdef G4USE_STL
51 //_____________________________________________________________________________
52 void AliGlobals::Exception(G4std::string s) {
53 //
54   AliGlobals::Exception(s.c_str());
55 }
56
57 //_____________________________________________________________________________
58 void AliGlobals::Exception(G4String s) {
59 //
60    AliGlobals::Exception(s.c_str());
61 }
62
63 //_____________________________________________________________________________
64 void AliGlobals::Warning(G4std::string s) {
65 //
66   AliGlobals::Warning(s.c_str());
67 }
68
69 //_____________________________________________________________________________
70 void AliGlobals::Warning(G4String s) {
71 //
72   AliGlobals::Warning(s.c_str());
73 }
74 #endif
75
76 //_____________________________________________________________________________
77 void AliGlobals::AppendNumberToString(G4String& s, G4int a)
78 {
79 // Appends number to string.
80 // ---
81   TG4Globals::AppendNumberToString(s, a);
82 }
83
84 //_____________________________________________________________________________
85 G4int AliGlobals::StringToInt(G4String s)
86 {
87 // Converts one char string to integer number.
88 // ---
89
90   // make better
91   if (s=="0") return 0;
92   if (s=="1") return 1;
93   if (s=="2") return 2;
94   if (s=="3") return 3;
95   if (s=="4") return 4;
96   if (s=="5") return 5;
97   if (s=="6") return 6;
98   if (s=="7") return 7;
99   if (s=="8") return 8;
100   if (s=="9") return 9;
101   return -1;
102 }
103