Import Geant4 10.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2016-06-30 14:12:05 +02:00
parent a654a7ab1f
commit 4ec577e5c4
2021 changed files with 100995 additions and 78277 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile 94738 2015-12-04 11:23:42Z gcosmo $
# $Id: GNUmakefile 97990 2016-06-30 10:04:56Z gcosmo $
# -----------------------------------------------------------------
# "gmake" makes default libraries for each subdomain.
# "gmake global" makes global libraries for each subdomain.
@@ -168,7 +168,7 @@ endif
banner:
@$(ECHO) "*************************************************************"
@$(ECHO) " Installation Geant4 version geant4-10-02 "
@$(ECHO) " Installation Geant4 version geant4-10-03-beta-01 "
@$(ECHO) " Copyright (C) 1994-2016 Geant4 Collaboration "
@$(ECHO) "*************************************************************"
+29 -1
View File
@@ -1,4 +1,4 @@
$Id: History 94599 2015-11-25 13:00:41Z gcosmo $
$Id: History 97670 2016-06-07 08:22:37Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,34 @@ committal in the SVN repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 7, 2016 I. Hrivnacova (analysis-V10-02-05)
- Updated to g4tools 1.27.4 (Guy Barrand):
Fixed remaining Windows-64 compiler warnings.
See History_tools for the complete list of modifications.
June 3, 2016 I. Hrivnacova (analysis-V10-02-04)
- Updated to g4tools 1.27.3 (Guy Barrand):
Fixed Windows-64 compiler warnings.
See History_tools for the complete list of modifications.
May 25, 2016 I. Hrivnacova (analysis-V10-02-03)
- Updated to g4tools 1.27.2 (Guy Barrand):
Fixed Mac OSX compiler warnings.
May 4, 2016 I. Hrivnacova (analysis-V10-02-02)
- Updated to g4tools 1.27.1 (Guy Barrand):
Fixed gcc 6.1 compiler warnings.
April 18, 2016 I. Hrivnacova (analysis-V10-02-01)
- Updated to g4tools 1.27.0 (Guy Barrand):
Fixed incompatibility with ROOT 5.x and 6.x formats reported in ROOT forum:
https://root.cern.ch/phpBB3/viewtopic.php?t=21315
December 8, 2015 I. Hrivnacova (analysis-V10-02-00)
- Fixed definition of /analysis/ntuple command directory
which was created implicitly with the commands and so
defined without a guideline and not deleted
November 25, 2015 I. Hrivnacova (analysis-V10-01-47)
- Adding GNUmakefile in parameters sub-category
+21
View File
@@ -1,3 +1,24 @@
1.27.4 :
- tools/value : Windows-64 : rm warnings when writing a void* in a string..
1.27.3 :
- tools/typedefs, pointer, value.icc : Windows-64 : rm warnings when writing a void* in a string.
- tools/wroot/ntuple : delete columns in destructor.
1.27.2 :
- tools/glutess/render : static_RenderTriangle : (void)size; at end to fix a warning.
1.27.1 :
- hls, sg/style_colormap : correct some g++-6 (pedantic) warnings.
1.27.0 : WARNING : change in the ROOT format for TTrees :
- tools/wroot/basket constructor : enforce m_version += 1000. This has to be considered as a change in the ROOT/IO
format (related to trees) compared to the one of CERN-ROOT/4.x that we followed up so fare. This change follows
what is in CERN-ROOT/5.x/TBasket. It permits to produce files compatible with what CERN-ROOT/hadd program expects,
and which does not work properly for CERN-ROOT/4.x/TBasket versioning logic. Here we must point out that this
CERN-ROOT/hadd tool breaks some "golden rule" claiming that CERN-ROOT will "forever" handle old file format
properly.
1.26.2 :
- test/cpp/viewplot.cpp : more tests to check the sg::plotter nodes reset when producing more pages and files with
the same viewer.
@@ -214,8 +214,6 @@ inline/*static*/ void static_RenderTriangle( GLUtesselator *tess, GLUhalfEdge *e
*/
assert( size == 1 );
AddToTrail( e->Lface, tess->lonelyTriList );
// the following line should suppress compiler warning about unused parameter 'size'
// observed on MacOS/clang
(void)size;
}
+18 -6
View File
@@ -28,9 +28,15 @@ inline void hls_to_rgb(T hue,T light,T satur,T& a_r,T& a_g,T& a_b){
T rh, rl, rs, rm1, rm2;
rh = rl = rs = 0;
if (hue > 0) rh = hue; if (rh > 360) rh = 360;
if (light > 0) rl = light; if (rl > 1) rl = 1;
if (satur > 0) rs = satur; if (rs > 1) rs = 1;
if (hue > 0) rh = hue;
if (rh > 360) rh = 360;
if (light > 0) rl = light;
if (rl > 1) rl = 1;
if (satur > 0) rs = satur;
if (rs > 1) rs = 1;
if (rl <= T(0.5)) {
rm2 = rl*(1 + rs);
@@ -53,9 +59,15 @@ inline void rgb_to_hls(T rr,T gg,T bb,T& hue,T& light,T& satur) {
T rnorm, gnorm, bnorm, minval, maxval, msum, mdiff, cr, cg, cb;
minval = maxval = 0;
cr = cg = cb = 0;
if (rr > 0) cr = rr; if (cr > 1) cr = 1;
if (gg > 0) cg = gg; if (cg > 1) cg = 1;
if (bb > 0) cb = bb; if (cb > 1) cb = 1;
if (rr > 0) cr = rr;
if (cr > 1) cr = 1;
if (gg > 0) cg = gg;
if (cg > 1) cg = 1;
if (bb > 0) cb = bb;
if (cb > 1) cb = 1;
minval = cr;
if (cg < minval) minval = cg;
+17 -44
View File
@@ -4,7 +4,10 @@
#ifndef tools_pointer
#define tools_pointer
//WARNING : touchy
//WARNING : touchy.
//WARNING : _MSC_VER && _WIN64 : sizeof(void*) is NOT sizeof(unsigned long).
#include "typedefs"
#include "snpf"
@@ -13,59 +16,29 @@
namespace tools {
inline bool to_pointer(const std::string& a_string,void*& a_value){
if(sizeof(unsigned long)==sizeof(void*)) { //majority of cases.
unsigned long v = 0L;
if(::sscanf(a_string.c_str(),"0x%lx",&v)!=1) {
if(::sscanf(a_string.c_str(),"%lu",&v)!=1) {
a_value = 0;
return false;
}
upointer v = 0;
if(::sscanf(a_string.c_str(),upointer_format_x(),&v)!=1) {
if(::sscanf(a_string.c_str(),upointer_format(),&v)!=1) {
a_value = 0;
return false;
}
a_value = (void*)v;
return true;
} else if(sizeof(unsigned long long)==sizeof(void*)) { //but not on my Windows-8/64bits !
unsigned long long v = 0L;
if(::sscanf(a_string.c_str(),"0x%llx",&v)!=1) {
if(::sscanf(a_string.c_str(),"%llu",&v)!=1) {
a_value = 0;
return false;
}
}
a_value = (void*)v;
return true;
}
a_value = 0;
return false;
a_value = (void*)v;
return true;
}
inline bool p2s(const void* a_value,std::string& a_s){
char s[512];
if(sizeof(unsigned long)==sizeof(void*)) { //majority of cases.
snpf(s,sizeof(s),"%lu",(unsigned long)a_value);
a_s = s;
return true;
} else if(sizeof(unsigned long long)==sizeof(void*)) { //but not on my Windows-8/64bits !
snpf(s,sizeof(s),"%llu",(unsigned long long)a_value);
a_s = s;
return true;
}
a_s.clear();
return false;
snpf(s,sizeof(s),upointer_format(),(upointer)a_value);
a_s = s;
return true;
}
inline bool p2sx(const void* a_value,std::string& a_s){
char s[512];
if(sizeof(unsigned long)==sizeof(void*)) { //majority of cases.
snpf(s,sizeof(s),"0x%lx",(unsigned long)a_value);
a_s = s;
return true;
} else if(sizeof(unsigned long long)==sizeof(void*)) { //but not on my Windows-8/64bits !
snpf(s,sizeof(s),"0x%llx",(unsigned long long)a_value);
a_s = s;
return true;
}
a_s.clear();
return false;
snpf(s,sizeof(s),upointer_format_x(),(upointer)a_value);
a_s = s;
return true;
}
/*
@@ -303,9 +303,15 @@ public:
g = col.r();
b = col.r();
if (i == 1) { r = 0.6; g = 0.6; b = 0.6; }
if (r == 1) r = 0.9; if (r == 0) r = 0.1;
if (g == 1) g = 0.9; if (g == 0) g = 0.1;
if (b == 1) b = 0.9; if (b == 0) b = 0.1;
if (r == 1) r = 0.9;
if (r == 0) r = 0.1;
if (g == 1) g = 0.9;
if (g == 0) g = 0.1;
if (b == 1) b = 0.9;
if (b == 0) b = 0.1;
rgb_to_hls(r,g,b,h,l,s);
+19 -1
View File
@@ -31,6 +31,16 @@ typedef unsigned long long diff_pointer_t;
typedef unsigned long diff_pointer_t;
#endif
#ifdef _WIN64
typedef unsigned long long upointer;
inline const char* upointer_format() {static const char s[] = "%llu";return s;}
inline const char* upointer_format_x() {static const char s[] = "0x%llx";return s;}
#else
typedef unsigned long upointer;
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
#endif
#elif defined(_LP64)
// 64 Bit Platforms
@@ -46,6 +56,10 @@ inline const char* uint64_format() {static const char s[] = "%lu";return s;}
typedef unsigned long diff_pointer_t;
typedef unsigned long upointer;
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
#else
// 32-Bit Platforms
@@ -61,6 +75,10 @@ inline const char* uint64_format() {static const char s[] = "%llu";return s;}
typedef unsigned long diff_pointer_t;
typedef unsigned long upointer;
inline const char* upointer_format() {static const char s[] = "%lu";return s;}
inline const char* upointer_format_x() {static const char s[] = "0x%lx";return s;}
#endif
inline uint32 uint32_mx() { //4 294 967 295
@@ -87,7 +105,7 @@ typedef char* cstr_t;
typedef const char* const_cstr_t;
class fits_bit {public:char m_c;}; //for exlib/cfitsio
class csv_time {public:long m_l;}; //for inlib/rcsv_ntuple
class csv_time {public:long m_l;}; //for tools/rcsv_ntuple
inline unsigned int size_char() {return 1;}
inline unsigned int size_short() {return 2;}
+18 -18
View File
@@ -212,7 +212,7 @@ public:
mem::increment(s_class().c_str());\
m_type = a_type;\
std::vector<unsigned int> is(1);\
is[0] = a_v.size();\
is[0] = (unsigned int)a_v.size();\
u.a_m_what = new tools::array<a_what>(is);\
u.a_m_what->fill(a_v);\
}
@@ -221,7 +221,7 @@ public:
value(const std::vector<a_what>& a_v){\
m_type = a_type;\
std::vector<unsigned int> is(1);\
is[0] = a_v.size();\
is[0] = (unsigned int)a_v.size();\
u.a_m_what = new tools::array<a_what>(is);\
u.a_m_what->fill(a_v);\
}
@@ -596,7 +596,7 @@ public:
reset();\
m_type = a_type;\
std::vector<unsigned int> is(1);\
is[0] = a_v.size();\
is[0] = (unsigned int)a_v.size();\
u.a_m_what = new tools::array<a_what>(is);\
u.a_m_what->fill(a_v);\
}
@@ -684,49 +684,49 @@ public:
tools::sprintf(a_s,5,"(nil)");
return true;
case INT:
tools::sprintf(a_s,16,"%d",a_v.u.m_int);
tools::sprintf(a_s,32,"%d",a_v.u.m_int);
return true;
case DOUBLE:
tools::sprintf(a_s,16,"%g",a_v.u.m_double);
tools::sprintf(a_s,32,"%g",a_v.u.m_double);
return true;
case VOID_STAR:
tools::sprintf(a_s,16,"0x%lx",(unsigned long)a_v.u.m_void_star);
tools::sprintf(a_s,32,upointer_format_x(),(upointer)a_v.u.m_void_star);
return true;
case UNSIGNED_SHORT:
tools::sprintf(a_s,16,"%u",a_v.u.m_unsigned_short);
tools::sprintf(a_s,32,"%u",a_v.u.m_unsigned_short);
return true;
case UNSIGNED_INT:
tools::sprintf(a_s,16,"%u",a_v.u.m_unsigned_int);
tools::sprintf(a_s,32,"%u",a_v.u.m_unsigned_int);
return true;
case BOOL:
tools::sprintf(a_s,5,"%s",a_v.u.m_bool?"true":"false");
return true;
case SHORT:
tools::sprintf(a_s,16,"%d",a_v.u.m_short);
tools::sprintf(a_s,32,"%d",a_v.u.m_short);
return true;
case INT64:
tools::sprintf(a_s,16,tools::int64_format(),a_v.u.m_int64);
tools::sprintf(a_s,32,tools::int64_format(),a_v.u.m_int64);
return true;
case UNSIGNED_INT64:
tools::sprintf(a_s,16,tools::int64_format(),a_v.u.m_unsigned_int64);
tools::sprintf(a_s,32,tools::int64_format(),a_v.u.m_unsigned_int64);
return true;
case FLOAT:
tools::sprintf(a_s,16,"%g",a_v.u.m_float);
tools::sprintf(a_s,32,"%g",a_v.u.m_float);
return true;
//case UNSIGNED_CHAR:
// tools::sprintf(a_s,16,"%c",a_v.u.m_unsigned_char);
// tools::sprintf(a_s,32,"%c",a_v.u.m_unsigned_char);
// return true;
//case CHAR:
// tools::sprintf(a_s,16,"%c",a_v.u.m_char);
// tools::sprintf(a_s,32,"%c",a_v.u.m_char);
// return true;
case DOUBLE_STAR:
tools::sprintf(a_s,16,"0x%lx",(unsigned long)a_v.u.m_double_star);
tools::sprintf(a_s,32,upointer_format_x(),(upointer)a_v.u.m_double_star);
return true;
case FLOAT_STAR:
tools::sprintf(a_s,16,"0x%lx",(unsigned long)a_v.u.m_float_star);
tools::sprintf(a_s,32,upointer_format_x(),(upointer)a_v.u.m_float_star);
return true;
case INT_STAR:
tools::sprintf(a_s,16,"0x%lx",(unsigned long)a_v.u.m_int_star);
tools::sprintf(a_s,32,upointer_format_x(),(upointer)a_v.u.m_int_star);
return true;
case STRING:
a_s = *a_v.u.m_string;
@@ -866,7 +866,7 @@ public:
return false;
}
unsigned int array_size() const {
size_t array_size() const {
switch(m_type) {
case INT:
case DOUBLE:
+46 -46
View File
@@ -340,8 +340,8 @@ inline bool value::minus(value& aThis,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) stdv[index] = -stdv[index];
size_t number = stdv.size();
for(size_t index=0;index<number;index++) stdv[index] = -stdv[index];
return true;}
//case value::CHAR:
// aThis.u.m_char = -aThis.u.m_char;
@@ -979,8 +979,8 @@ inline bool value::subtract(value& aThis,const value& aV,std::string& aError){
}
std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
stdv[index] -= stdv2[index];
}
return true;}
@@ -1279,8 +1279,8 @@ inline bool value::multiply(value& aThis,const value& aV,std::string& aError){
}
std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
stdv[index] *= stdv2[index];
}
return true;}
@@ -1695,8 +1695,8 @@ inline bool value::divide(value& aThis,const value& aV,std::string& aError){
std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
bool has_div_zero = false;
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv2[index]==0) {
//FIXME : stdv[index] = nan;
stdv[index] = 0; //PAW convention.
@@ -1805,8 +1805,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_int<=stdv[index]) {
aThis.set(false);
return true;
@@ -1861,8 +1861,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_double<=stdv[index]) {
aThis.set(false);
return true;
@@ -1917,8 +1917,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_float<=stdv[index]) {
aThis.set(false);
return true;
@@ -2032,8 +2032,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
switch(aV.m_type) {
case value::INT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]<=aV.u.m_int) {
aThis.set(false);
return true;
@@ -2044,8 +2044,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
}
case value::FLOAT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]<=aV.u.m_float) {
aThis.set(false);
return true;
@@ -2056,8 +2056,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
}
case value::DOUBLE:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]<=aV.u.m_double) {
aThis.set(false);
return true;
@@ -2068,8 +2068,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
}
case value::UNSIGNED_INT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]<=aV.u.m_unsigned_int ) {
aThis.set(false);
return true;
@@ -2082,8 +2082,8 @@ inline bool value::if_gt(value& aThis,const value& aV,std::string& aError){
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
const std::vector<double>& stdv2 = aV.u.m_array_double->vector();
if(stdv.size()!=stdv2.size()) break;
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]<=stdv2[index]) {
aThis.set(false);
return true;
@@ -2175,8 +2175,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_int!=stdv[index]) {
aThis.set(false);
return true;
@@ -2233,8 +2233,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_float!=stdv[index]) {
aThis.set(false);
return true;
@@ -2289,8 +2289,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_double!=stdv[index]) {
aThis.set(false);
return true;
@@ -2435,8 +2435,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
return true;
case value::ARRAY_DOUBLE:{
const std::vector<double>& stdv = aV.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(aThis.u.m_unsigned_int !=stdv[index]) {
aThis.set(false);
return true;
@@ -2513,8 +2513,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
switch(aV.m_type) {
case value::INT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]!=aV.u.m_int) {
aThis.set(false);
return true;
@@ -2525,8 +2525,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
}
case value::FLOAT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]!=aV.u.m_float) {
aThis.set(false);
return true;
@@ -2537,8 +2537,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
}
case value::DOUBLE:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]!=aV.u.m_double) {
aThis.set(false);
return true;
@@ -2549,8 +2549,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
}
case value::UNSIGNED_INT:{
const std::vector<double>& stdv = aThis.u.m_array_double->vector();
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]!=aV.u.m_unsigned_int ) {
aThis.set(false);
return true;
@@ -2566,8 +2566,8 @@ inline bool value::if_eq(value& aThis,const value& aV,std::string& aError){
aThis.set(false);
return true;
}
unsigned int number = stdv.size();
for(unsigned int index=0;index<number;index++) {
size_t number = stdv.size();
for(size_t index=0;index<number;index++) {
if(stdv[index]!=stdv2[index]) {
aThis.set(false);
return true;
@@ -3102,7 +3102,7 @@ inline std::string value::to_string(const value& aThis){
tools::sprintf(s,16,"%g",aThis.u.m_double);
return s;
case value::VOID_STAR:
tools::sprintf(s,16,"0x%lx",(unsigned long)aThis.u.m_void_star);
tools::sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_void_star);
return s;
case value::UNSIGNED_SHORT:
tools::sprintf(s,16,"%u",aThis.u.m_unsigned_short);
@@ -3132,13 +3132,13 @@ inline std::string value::to_string(const value& aThis){
// tools::sprintf(s,16,"%c",aThis.u.m_char);
// return s;
case value::DOUBLE_STAR:
tools::sprintf(s,16,"0x%lx",(unsigned long)aThis.u.m_double_star);
tools::sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_double_star);
return s;
case value::FLOAT_STAR:
tools::sprintf(s,16,"0x%lx",(unsigned long)aThis.u.m_float_star);
tools::sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_float_star);
return s;
case value::INT_STAR:
tools::sprintf(s,16,"0x%lx",(unsigned long)aThis.u.m_int_star);
tools::sprintf(s,32,upointer_format_x(),(upointer)aThis.u.m_int_star);
return s;
case value::STRING:
return *aThis.u.m_string;
@@ -5,13 +5,13 @@
#define tools_version
#define TOOLS_MAJOR_VERSION 1
#define TOOLS_MINOR_VERSION 26
#define TOOLS_PATCH_VERSION 2
#define TOOLS_VERSION "1.26.2"
#define TOOLS_VERSION_VRP "v1r26p2"
#define TOOLS_MINOR_VERSION 27
#define TOOLS_PATCH_VERSION 4
#define TOOLS_VERSION "1.27.4"
#define TOOLS_VERSION_VRP "v1r27p4"
namespace tools {
inline unsigned int version() {return 12602;}
inline unsigned int version() {return 12704;}
}
#endif
@@ -118,6 +118,13 @@ public:
mem::increment(s_class().c_str());
#endif
if(m_version>1000) {
} else {
// G.Barrand : April 2016 : WARNING : this is a change in the ROOT/IO format compared to CERN-ROOT/4.x :
// We follow the logic found on CERN-ROOT/5.x that enforces "+1000" on all baskets.
m_version += 1000;
}
m_key_length = header_record_size(m_version);
initialize(0);
@@ -286,7 +286,9 @@ public:
}
}
virtual ~ntuple() {}
virtual ~ntuple() {
tools::clear<icol>(m_cols);
}
protected:
ntuple(const ntuple& a_from)
:iobject(a_from),itree(a_from),tree(a_from)
@@ -57,6 +57,7 @@ class G4NtupleMessenger : public G4UImessenger
G4VAnalysisManager* fManager; ///< Associated class
std::unique_ptr<G4UIdirectory> fNtupleDir;
std::unique_ptr<G4UIcommand> fSetActivationCmd;
std::unique_ptr<G4UIcmdWithABool> fSetActivationAllCmd;
};
@@ -45,7 +45,9 @@ G4NtupleMessenger::G4NtupleMessenger(G4VAnalysisManager* manager)
fManager(manager),
fSetActivationCmd(nullptr),
fSetActivationAllCmd(nullptr)
{
{
fNtupleDir = G4Analysis::make_unique<G4UIdirectory>("/analysis/ntuple/");
fNtupleDir->SetGuidance("ntuple control");
SetActivationCmd();
SetActivationToAllCmd();
+16 -1
View File
@@ -1,4 +1,4 @@
$Id: History 92598 2015-09-07 07:11:03Z gcosmo $
$Id: History 96535 2016-04-20 12:14:15Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,21 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Apr 20, 2016, G.Cosmo (digits_hits-V10-02-04)
- Fixed shadowing compilation warnings in G4VScoringMesh for 'ps'.
Apr 15, 2016, G.Cosmo (digits_hits-V10-02-03)
- Fixed type in printing on cout in G4SDManager::AddNewDetector().
Dec 18, 2015, M.Asai (digits_hits-V10-02-02)
- While-loop check.
Dec 8, 2015, M.Asai (digits_hits-V10-02-01)
- Further code clean up with C++11 features
Dec 7, 2015, M.Asai (digits_hits-V10-02-00)
- Code clean up with C++11 features
Sept 4, 2015, A.Dotti (digits_hits-V10-01-01)
- Removing sporious cout
@@ -77,7 +77,7 @@ public:
sdsConstIter GetBegin() const { return fSensitiveDetectors.begin(); }
sdsConstIter GetEnd() const { return fSensitiveDetectors.end(); }
void ClearSDs() { fSensitiveDetectors.clear(); }
void AddSD( G4VSensitiveDetector* sd) { fSensitiveDetectors.push_back(sd);}
void AddSD( G4VSensitiveDetector* sd);
private:
sds_t fSensitiveDetectors;
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CellScoreComposer.cc 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4CellScoreComposer.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
@@ -45,8 +45,7 @@ G4CellScoreComposer::~G4CellScoreComposer()
void G4CellScoreComposer::EstimatorCalculation(const G4Step &aStep){
G4StepPoint *p = 0;
p = aStep.GetPreStepPoint();
G4StepPoint *p = aStep.GetPreStepPoint();
if (!p) {
G4Exception("G4CellScoreComposer::EstimatorCalculation","Det0191",FatalException," no pointer to pre PreStepPoint!");
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4MultiFunctionalDetector.cc 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4MultiFunctionalDetector.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// G4MultiFunctionalDetector
//
@@ -40,26 +40,25 @@ G4MultiFunctionalDetector::G4MultiFunctionalDetector(G4String name)
{;}
G4MultiFunctionalDetector::~G4MultiFunctionalDetector()
{;}
{
for(auto pr : primitives) delete pr;
primitives.clear();
}
G4bool G4MultiFunctionalDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* aTH)
{
if(aStep->GetStepLength()>0. || aStep->GetTotalEnergyDeposit()>0.){
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{
primitives[iPrim]->HitPrimitive(aStep,aTH);
}
}
return true;
if(aStep->GetStepLength()>0. || aStep->GetTotalEnergyDeposit()>0.){
for(auto pr : primitives)
{ pr->HitPrimitive(aStep,aTH); }
}
return true;
}
G4bool G4MultiFunctionalDetector::RegisterPrimitive(G4VPrimitiveScorer* aPS)
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
for(auto pr : primitives)
{
if(primitives[iPrim]==aPS)
if(pr==aPS)
{
G4ExceptionDescription ED;
ED << "Primitive <" << aPS->GetName() << "> is already defined in <" << SensitiveDetectorName
@@ -83,17 +82,12 @@ G4bool G4MultiFunctionalDetector::RegisterPrimitive(G4VPrimitiveScorer* aPS)
G4bool G4MultiFunctionalDetector::RemovePrimitive(G4VPrimitiveScorer* aPS)
{
std::vector<G4VPrimitiveScorer*>::iterator iterPS;
std::vector<G4String>::iterator iterName = collectionName.begin();
for(iterPS=primitives.begin();iterPS!=primitives.end();iterPS++)
auto pr = std::find(primitives.begin(),primitives.end(),aPS);
if(pr!=primitives.end())
{
if(*iterPS==aPS)
{
primitives.erase(iterPS);
aPS->SetMultiFunctionalDetector(0);
return true;
}
iterName++;
primitives.erase(pr);
aPS->SetMultiFunctionalDetector(nullptr);
return true;
}
G4cerr << "Primitive <" << aPS->GetName() << "> is not defined in <" << SensitiveDetectorName
<< ">." << G4endl << "Method RemovePrimitive() is ignored." << G4endl;
@@ -102,36 +96,31 @@ G4bool G4MultiFunctionalDetector::RemovePrimitive(G4VPrimitiveScorer* aPS)
void G4MultiFunctionalDetector::Initialize(G4HCofThisEvent* HC)
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{ primitives[iPrim]->Initialize(HC); }
for(auto pr : primitives)
{ pr->Initialize(HC); }
}
void G4MultiFunctionalDetector::EndOfEvent(G4HCofThisEvent* HC)
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{ primitives[iPrim]->EndOfEvent(HC); }
for(auto pr : primitives)
{ pr->EndOfEvent(HC); }
}
void G4MultiFunctionalDetector::clear()
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{ primitives[iPrim]->clear(); }
for(auto pr : primitives)
{ pr->clear(); }
}
void G4MultiFunctionalDetector::DrawAll()
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{ primitives[iPrim]->DrawAll(); }
for(auto pr : primitives)
{ pr->DrawAll(); }
}
void G4MultiFunctionalDetector::PrintAll()
{
G4int nPrim = primitives.size();
for(G4int iPrim=0;iPrim<nPrim;iPrim++)
{ primitives[iPrim]->PrintAll(); }
for(auto pr : primitives)
{ pr->PrintAll(); }
}
@@ -26,6 +26,7 @@
// G4MultiSensitiveDetector
#include "G4MultiSensitiveDetector.hh"
#include "G4SDManager.hh"
#include <sstream>
//#define MSDDEBUG
@@ -133,3 +134,9 @@ G4VSensitiveDetector* G4MultiSensitiveDetector::Clone() const
return newInst;
}
void G4MultiSensitiveDetector::AddSD(G4VSensitiveDetector* sd)
{
// making sure this sensitive detector is registered to G4SDManager
G4SDManager::GetSDMpointer()->AddNewDetector(sd);
fSensitiveDetectors.push_back(sd);
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SDManager.cc 73819 2013-09-12 15:52:52Z gcosmo $
// $Id: G4SDManager.cc 96455 2016-04-15 08:44:06Z gcosmo $
//
#include "G4SDManager.hh"
@@ -35,7 +35,7 @@
#include "G4ios.hh"
G4ThreadLocal G4SDManager* G4SDManager::fSDManager = 0;
G4ThreadLocal G4SDManager* G4SDManager::fSDManager = nullptr;
G4SDManager* G4SDManager::GetSDMpointer()
{
@@ -62,6 +62,10 @@ G4SDManager::~G4SDManager()
delete theMessenger;
delete HCtable;
delete treeTop;
theMessenger = nullptr;
HCtable = nullptr;
treeTop = nullptr;
fSDManager = nullptr;
}
void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
@@ -81,7 +85,7 @@ void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
if( verboseLevel > 0 )
{
G4cout << "New sensitive detector <" << aSD->GetName()
<< "> is registored at " << pathName << G4endl;
<< "> is registered at " << pathName << G4endl;
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SDStructure.cc 74576 2013-10-15 07:20:11Z gcosmo $
// $Id: G4SDStructure.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// G4SDStructure
@@ -47,12 +47,10 @@ G4SDStructure::G4SDStructure(G4String aPath):verboseLevel(0)
G4SDStructure::~G4SDStructure()
{
size_t nTree = structure.size();
for(size_t iTree=0;iTree<nTree;iTree++)
{ delete structure[iTree]; }
size_t nDet = detector.size();
for(size_t iDet=0;iDet<nDet;iDet++)
{ delete detector[iDet]; }
for(auto st : structure) delete st;
structure.clear();
for(auto dt : detector) delete dt;
detector.clear();
}
G4int G4SDStructure::operator==(const G4SDStructure &right) const
@@ -70,7 +68,7 @@ void G4SDStructure::AddNewDetector(G4VSensitiveDetector*aSD,
// First, check if the subdirectoy exists.
G4String subD = ExtractDirName( remainingPath );
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == 0 )
if( tgtSDS == nullptr )
{ // Subdirectory not found. Create a new directory.
subD.prepend(pathName);
tgtSDS = new G4SDStructure(subD);
@@ -100,33 +98,22 @@ void G4SDStructure::AddNewDetector(G4VSensitiveDetector*aSD,
G4SDStructure* G4SDStructure::FindSubDirectory(G4String subD)
{
for( size_t i=0; i<structure.size(); i++ )
{
if( subD == structure[i]->dirName ) return structure[i];
}
return 0;
for(auto st : structure)
{ if( subD == st->dirName ) return st; }
return nullptr;
}
G4VSensitiveDetector* G4SDStructure::GetSD(G4String aSDName)
{
for( size_t i=0; i<detector.size(); i++ )
{
G4VSensitiveDetector* tgtSD = detector[i];
if( aSDName == tgtSD->GetName() ) return tgtSD;
}
return 0;
for(auto det : detector)
{ if(aSDName == det->GetName()) return det; }
return nullptr;
}
void G4SDStructure::RemoveSD(G4VSensitiveDetector* sd)
{
std::vector<G4VSensitiveDetector*>::iterator itr = detector.begin();
for(;itr!=detector.end();itr++)
{
if((*itr)==sd) {
detector.erase(itr);
break;
}
}
auto det = std::find(detector.begin(), detector.end(), sd);
if(det!=detector.end()) detector.erase(det);
}
G4String G4SDStructure::ExtractDirName(G4String aName)
@@ -145,7 +132,7 @@ void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
{ // Command is ordered for a subdirectory.
G4String subD = ExtractDirName(aPath);
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == 0 )
if( tgtSDS == nullptr )
{ // The subdirectory is not found
G4cout << subD << " is not found in " << pathName << G4endl;
}
@@ -156,19 +143,13 @@ void G4SDStructure::Activate(G4String aName, G4bool sensitiveFlag)
}
else if( aPath.isNull() )
{ // Command is ordered for all detectors in this directory.
for( size_t i=0; i<detector.size(); i++)
{
detector[i]->Activate(sensitiveFlag);
}
for( size_t j=0;j<structure.size(); j++)
{
structure[j]->Activate(G4String("/"),sensitiveFlag);
}
for(auto det : detector) det->Activate(sensitiveFlag);
for(auto st : structure) st->Activate(G4String("/"),sensitiveFlag);
}
else
{ // Command is ordered to a particular detector.
G4VSensitiveDetector* tgtSD = GetSD(aPath);
if( tgtSD == 0 )
if( tgtSD == nullptr )
{ // The detector is not found.
G4cout << aPath << " is not found in " << pathName << G4endl;
}
@@ -187,11 +168,11 @@ G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName, G4boo
{ // SD exists in sub-directory
G4String subD = ExtractDirName(aPath);
G4SDStructure* tgtSDS = FindSubDirectory(subD);
if( tgtSDS == 0 )
if( tgtSDS == nullptr )
{ // The subdirectory is not found
if (warning)
G4cout << subD << " is not found in " << pathName << G4endl;
return 0;
return nullptr;
}
else
{
@@ -201,7 +182,7 @@ G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName, G4boo
else
{ // SD must exist in this directory
G4VSensitiveDetector* tgtSD = GetSD(aPath);
if( tgtSD == 0 )
if( tgtSD == nullptr )
{ // The detector is not found.
if (warning)
G4cout << aPath << " is not found in " << pathName << G4endl;
@@ -212,40 +193,29 @@ G4VSensitiveDetector* G4SDStructure::FindSensitiveDetector(G4String aName, G4boo
void G4SDStructure::Initialize(G4HCofThisEvent*HCE)
{
size_t i;
// Broadcast to subdirectories.
for( i=0; i<structure.size(); i++ )
{
structure[i]->Initialize(HCE);
}
for(auto st : structure)
{ st->Initialize(HCE); }
// Initialize all detectors in this directory.
for( i=0; i<detector.size(); i++ )
{
if(detector[i]->isActive()) detector[i]->Initialize(HCE);
}
for(auto dt : detector)
{ if(dt->isActive()) dt->Initialize(HCE); }
}
void G4SDStructure::Terminate(G4HCofThisEvent*HCE)
{
size_t i;
// Broadcast to subdirectories.
for( i=0; i<structure.size(); i++ )
{
structure[i]->Terminate(HCE);
}
// Initialize all detectors in this directory.
for( i=0; i<detector.size(); i++ )
{
if(detector[i]->isActive()) detector[i]->EndOfEvent(HCE);
}
for(auto st : structure)
{ st->Terminate(HCE); }
// Terminate all detectors in this directory.
for(auto dt : detector)
{ if(dt->isActive()) dt->EndOfEvent(HCE); }
}
void G4SDStructure::ListTree()
{
G4cout << pathName << G4endl;
for(size_t i=0; i<detector.size(); i++)
for(auto sd : detector)
{
G4VSensitiveDetector* sd = detector[i];
G4cout << pathName << sd->GetName();
if( sd->isActive() )
{ G4cout << " *** Active "; }
@@ -253,8 +223,7 @@ void G4SDStructure::ListTree()
{ G4cout << " XXX Inactive "; }
G4cout << G4endl;
}
for(size_t j=0; j<structure.size(); j++)
{ structure[j]->ListTree(); }
for(auto st : structure) st->ListTree();
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SensitiveVolumeList.cc 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4SensitiveVolumeList.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -79,19 +79,17 @@
//Other Operations
G4bool G4SensitiveVolumeList::CheckPV(const G4VPhysicalVolume * pvp) const
{
if (thePhysicalVolumeList.size()==0) return false;
for(size_t i=0;i<thePhysicalVolumeList.size();i++)
{ if(thePhysicalVolumeList[i]==pvp) return true; }
for(auto pv : thePhysicalVolumeList)
{ if(pv==pvp) return true; }
return false;
}
G4bool G4SensitiveVolumeList::CheckLV(const G4LogicalVolume * lvp) const
{
if (theLogicalVolumeList.size()==0) return false;
for(size_t i=0;i<theLogicalVolumeList.size();i++)
{ if(theLogicalVolumeList[i]==lvp) return true; }
return false;
for(auto lv : theLogicalVolumeList)
{ if(lv==lvp) return true; }
return false;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VPrimitiveScorer.cc 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4VPrimitiveScorer.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// G4VPrimitiveScorer
#include "G4VPrimitiveScorer.hh"
@@ -35,7 +35,7 @@
#include "G4UnitsTable.hh"
G4VPrimitiveScorer::G4VPrimitiveScorer(G4String name, G4int depth)
:primitiveName(name),detector(0),filter(0),verboseLevel(0),indexDepth(depth),
:primitiveName(name),detector(nullptr),filter(nullptr),verboseLevel(0),indexDepth(depth),
unitName("NoUnit"),unitValue(1.0),fNi(0),fNj(0),fNk(0)
{;}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VReadOutGeometry.cc 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4VReadOutGeometry.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
#include "G4VReadOutGeometry.hh"
@@ -32,8 +32,8 @@
G4VReadOutGeometry::G4VReadOutGeometry()
:ROworld(0),fincludeList(0),
fexcludeList(0),touchableHistory(0)
:ROworld(nullptr),fincludeList(nullptr),
fexcludeList(nullptr),touchableHistory(nullptr)
{
name = "unknown";
ROnavigator = new G4Navigator();
@@ -49,21 +49,29 @@ G4VReadOutGeometry::G4VReadOutGeometry()
G4VReadOutGeometry::G4VReadOutGeometry(const G4VReadOutGeometry &right)
{
fincludeList = 0;
fexcludeList = 0;
fincludeList = nullptr;
fexcludeList = nullptr;
name = right.name;
ROworld = right.ROworld;
touchableHistory = 0;
touchableHistory = nullptr;
ROnavigator = new G4Navigator();
// COPY CONSTRUCTOR NOT STRAIGHT FORWARD: need to copy the touchabelHistory
// VALUE, same for navigator and same for the World+Geom hierachy
}
G4VReadOutGeometry::G4VReadOutGeometry(G4String n)
:ROworld(0),fincludeList(0),
fexcludeList(0),name(n),touchableHistory(0)
:ROworld(nullptr),fincludeList(nullptr),
fexcludeList(nullptr),name(n),touchableHistory(nullptr)
{
ROnavigator = new G4Navigator();
G4ExceptionDescription ed;
ed<<"The concept and the functionality of Readout Geometry has been merged\n"
<<"into Parallel World. This G4VReadOutGeometry is kept for the sake of\n"
<<"not breaking the commonly-used interface in the sensitive detector class.\n"
<<"But this functionality of G4VReadOutGeometry class is no longer tested\n"
<<"and thus may not be working well. We strongly recommend our customers to\n"
<<"migrate to Parallel World scheme.";
G4Exception("G4VReadOutGeometry","DIGIHIT1001",JustWarning,ed);
}
G4VReadOutGeometry::~G4VReadOutGeometry()
@@ -78,11 +86,11 @@ G4VReadOutGeometry::~G4VReadOutGeometry()
G4VReadOutGeometry & G4VReadOutGeometry::operator=(const G4VReadOutGeometry &right)
{
if ( this == &right ) return *this;
delete fincludeList; fincludeList = 0;
delete fexcludeList; fexcludeList = 0;
delete fincludeList; fincludeList = nullptr;
delete fexcludeList; fexcludeList = nullptr;
name = right.name;
ROworld = right.ROworld;
delete touchableHistory; touchableHistory = 0;
delete touchableHistory; touchableHistory = nullptr;
delete ROnavigator; ROnavigator = new G4Navigator();
return *this;
}
@@ -101,7 +109,7 @@ void G4VReadOutGeometry::BuildROGeometry()
G4bool G4VReadOutGeometry::CheckROVolume(G4Step*currentStep,G4TouchableHistory*& ROhist)
{
ROhist = 0;
ROhist = nullptr;
G4bool incFlg = true;
G4VPhysicalVolume* PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
if((fexcludeList)&&(fexcludeList->CheckPV(PV)))
@@ -24,14 +24,15 @@
// ********************************************************************
//
//
// $Id: G4VSensitiveDetector.cc 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4VSensitiveDetector.cc 94771 2015-12-09 09:44:05Z gcosmo $
//
// G4VSensitiveDetector
#include "G4VSensitiveDetector.hh"
#include "G4SDManager.hh"
G4VSensitiveDetector::G4VSensitiveDetector(G4String name)
:verboseLevel(0),active(true),ROgeometry(0),filter(0)
:verboseLevel(0),active(true),
ROgeometry(nullptr),filter(nullptr)
{
size_t sLast = name.last('/');
if(sLast==std::string::npos)
@@ -72,7 +73,7 @@ G4VSensitiveDetector* G4VSensitiveDetector::Clone() const
<< "but Clone method called.\n"
<< "Cannot continue;";
G4Exception("G4VSensitiveDetector::Clone","Det0010",FatalException,msg);
return NULL;
return nullptr;
}
G4VSensitiveDetector & G4VSensitiveDetector::operator=(const G4VSensitiveDetector &right)
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DCofThisEvent.hh 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4DCofThisEvent.hh 94771 2015-12-09 09:44:05Z gcosmo $
//
#ifndef G4DCofThisEvent_h
@@ -74,10 +74,7 @@ class G4DCofThisEvent
inline G4int GetNumberOfCollections() const
{
G4int n = 0;
for(size_t i=0;i<DC->size();i++)
{
if((*DC)[i]) n++;
}
for(auto dc : *DC) if(dc) n++;
return n;
}
// Returns the number of digi collections which are stored in this class
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VHitsCollection.hh 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4VHitsCollection.hh 94772 2015-12-09 09:46:45Z gcosmo $
//
#ifndef G4VHitsCollection_h
@@ -58,18 +58,24 @@ class G4VHitsCollection
// Collection name
G4String collectionName;
G4String SDname;
// Collection ID
G4int colID;
public:
inline G4String GetName()
inline G4String& GetName()
{ return collectionName; }
inline G4String GetSDname()
inline G4String& GetSDname()
{ return SDname; }
inline void SetColID(G4int i)
{ colID = i; }
inline G4int GetColID() const
{ return colID; }
public:
// GetHit and GetSize are given a default implementation here so
// that the template G4THitsCollection can be used, but they
// are re-implemented G4THitsCollection.
virtual G4VHit* GetHit(size_t) const { return 0; }
virtual G4VHit* GetHit(size_t) const { return nullptr; }
virtual size_t GetSize() const { return 0; };
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4HCofThisEvent.cc 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4HCofThisEvent.cc 94772 2015-12-09 09:46:45Z gcosmo $
//
#include "G4HCofThisEvent.hh"
@@ -57,7 +57,10 @@ G4HCofThisEvent::~G4HCofThisEvent()
void G4HCofThisEvent::AddHitsCollection(G4int HCID,G4VHitsCollection * aHC)
{ if (!anHCoTHAllocator_G4MT_TLS_) anHCoTHAllocator_G4MT_TLS_ = new G4Allocator<G4HCofThisEvent> ;
if(HCID>=0 && HCID<G4int(HC->size()))
{ (*HC)[HCID] = aHC; }
{
aHC->SetColID(HCID);
(*HC)[HCID] = aHC;
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VHitsCollection.cc 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4VHitsCollection.cc 94772 2015-12-09 09:46:45Z gcosmo $
//
// G4VHitsCollection
@@ -35,12 +35,14 @@ G4VHitsCollection::G4VHitsCollection()
{
collectionName = "Unknown";
SDname = "Unknown";
colID = -1;
}
G4VHitsCollection::G4VHitsCollection(G4String detName,G4String colNam)
{
collectionName = colNam;
SDname = detName;
colID = -1;
}
G4VHitsCollection::~G4VHitsCollection()
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoringManager.hh 81087 2014-05-20 15:44:27Z gcosmo $
// $Id: G4ScoringManager.hh 94772 2015-12-09 09:46:45Z gcosmo $
//
#ifndef G4ScoringManager_h
@@ -55,7 +55,9 @@ typedef std::vector<G4VScoringMesh*>::const_iterator MeshVecConstItr;
typedef std::map<G4String,G4VScoreColorMap*> ColorMapDict;
typedef std::map<G4String,G4VScoreColorMap*>::iterator ColorMapDictItr;
typedef std::map<G4String,G4VScoreColorMap*>::const_iterator ColorMapDictConstItr;
typedef std::map<G4int,G4VScoringMesh*> MeshMap;
typedef std::map<G4int,G4VScoringMesh*>::iterator MeshMapItr;
typedef std::map<G4int,G4VScoringMesh*>::const_iterator MeshMapConstItr;
class G4ScoringManager
{
@@ -83,6 +85,7 @@ class G4ScoringManager
public:
void Accumulate(G4VHitsCollection* map);
void Merge(const G4ScoringManager* scMan);
G4VScoringMesh* FindMesh(G4VHitsCollection* map);
G4VScoringMesh* FindMesh(const G4String&);
void List() const;
void Dump() const;
@@ -112,6 +115,7 @@ class G4ScoringManager
G4VScoreColorMap * fDefaultLinearColorMap;
ColorMapDict * fColorMapDict;
MeshMap fMeshMap;
public:
inline void SetCurrentMesh(G4VScoringMesh* scm)
{ fCurrentMesh = scm; }
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoringMesh.hh 83518 2014-08-27 12:57:10Z gcosmo $
// $Id: G4VScoringMesh.hh 94772 2015-12-09 09:46:45Z gcosmo $
//
#ifndef G4VScoringMesh_h
@@ -135,7 +135,7 @@ class G4VScoringMesh
G4bool FindPrimitiveScorer(const G4String & psname);
// get whether current primitive scorer is set or not
G4bool IsCurrentPrimitiveScorerNull() {
if(fCurrentPS == NULL) return true;
if(fCurrentPS == nullptr) return true;
else return false;
}
// get unit of primitive scorer by the name
@@ -153,7 +153,7 @@ class G4VScoringMesh
void GetDivisionAxisNames(G4String divisionAxisNames[3]);
// set current primitive scorer to NULL
void SetNullToCurrentPrimitiveScorer() {fCurrentPS = NULL;}
void SetNullToCurrentPrimitiveScorer() {fCurrentPS = nullptr;}
// set verbose level
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; }
@@ -213,7 +213,7 @@ public:
inline void GeometryHasBeenDestroyed()
{
fGeometryHasBeenDestroyed = true;
fMeshElementLogical = 0;
fMeshElementLogical = nullptr;
}
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoreQuantityMessenger.cc 73819 2013-09-12 15:52:52Z gcosmo $
// $Id: G4ScoreQuantityMessenger.cc 94951 2016-01-07 11:58:57Z gcosmo $
//
// ---------------------------------------------------------------------
// Modifications
@@ -502,7 +502,7 @@ void G4ScoreQuantityMessenger::FillTokenVec(G4String newValues, G4TokenVec& toke
G4Tokenizer next(newValues);
G4String val;
while ( !(val = next()).isNull() ) {
while ( !(val = next()).isNull() ) { // Loop checking 12.18.2015 M.Asai
token.push_back(val);
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoringManager.cc 78004 2013-12-02 08:28:23Z gcosmo $
// $Id: G4ScoringManager.cc 94772 2015-12-09 09:46:45Z gcosmo $
//
#include "G4ScoringManager.hh"
@@ -36,7 +36,7 @@
#include "G4DefaultLinearColorMap.hh"
#include "G4ScoreLogColorMap.hh"
G4ThreadLocal G4ScoringManager* G4ScoringManager::fSManager = 0;
G4ThreadLocal G4ScoringManager* G4ScoringManager::fSManager = nullptr;
G4ThreadLocal G4int G4ScoringManager::replicaLevel = 3;
@@ -53,7 +53,7 @@ G4ScoringManager* G4ScoringManager::GetScoringManagerIfExist()
{ return fSManager; }
G4ScoringManager::G4ScoringManager()
: verboseLevel(0),fCurrentMesh(0)
: verboseLevel(0),fCurrentMesh(nullptr)
{
fMessenger = new G4ScoringMessenger(this);
fQuantityMessenger = new G4ScoreQuantityMessenger(this);
@@ -72,7 +72,7 @@ G4ScoringManager::~G4ScoringManager()
delete fColorMapDict;
delete fQuantityMessenger;
delete fMessenger;
fSManager = 0;
fSManager = nullptr;
}
void G4ScoringManager::SetReplicaLevel(G4int lvl)
@@ -82,44 +82,49 @@ G4int G4ScoringManager::GetReplicaLevel()
void G4ScoringManager::Accumulate(G4VHitsCollection* map)
{
G4String wName = map->GetSDname();
G4VScoringMesh* sm = FindMesh(wName);
if(sm == 0) return;
auto sm = FindMesh(map);
if(!sm) return;
if(verboseLevel>9)
{ G4cout << "G4ScoringManager::Accumulate() for " << map->GetSDname() << " / " << map->GetName() << G4endl;
G4cout << " is calling G4VScoringMesh::Accumulate() of " << sm->GetWorldName() << G4endl; }
sm->Accumulate(static_cast<G4THitsMap<double>*>(map));
}
G4VScoringMesh* G4ScoringManager::FindMesh(G4VHitsCollection* map)
{
auto colID = map->GetColID();
G4VScoringMesh* sm = nullptr;
auto msh = fMeshMap.find(colID);
if(msh==fMeshMap.end())
{
auto wName = map->GetSDname();
sm = FindMesh(wName);
fMeshMap[colID] = sm;
}
else
{ sm = (*msh).second; }
return sm;
}
G4VScoringMesh* G4ScoringManager::FindMesh(const G4String& wName)
{
G4VScoringMesh* sm = 0;
for(MeshVecItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
G4String smName = (*itr)->GetWorldName();
if(wName == smName) {
sm = *itr;
break;
}
}
G4VScoringMesh* sm = nullptr;
for(auto msh : fMeshVec)
{ if(msh->GetWorldName()==wName) return msh; }
if(!sm && verboseLevel>9)
{ G4cout << "WARNING : G4ScoringManager::FindMesh() --- <" << wName << "> is not found. Null returned." << G4endl; }
return sm;
return nullptr;
}
void G4ScoringManager::List() const
{
G4cout << "G4ScoringManager has " << GetNumberOfMesh() << " scoring meshes." << G4endl;
for(MeshVecConstItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
(*itr)->List();
}
for(auto msh : fMeshVec) msh->List();
}
void G4ScoringManager::Dump() const
{
for(MeshVecConstItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
(*itr)->Dump();
}
for(auto msh : fMeshVec) msh->Dump();
}
void G4ScoringManager::DrawMesh(const G4String& meshName,
@@ -208,7 +213,7 @@ void G4ScoringManager::RegisterScoreColorMap(G4VScoreColorMap* colorMap)
G4VScoreColorMap* G4ScoringManager::GetScoreColorMap(const G4String& mapName)
{
ColorMapDictItr mItr = fColorMapDict->find(mapName);
if(mItr == fColorMapDict->end()) { return 0; }
if(mItr == fColorMapDict->end()) { return nullptr; }
return (mItr->second);
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ScoringMessenger.cc 81308 2014-05-26 14:28:07Z gcosmo $
// $Id: G4ScoringMessenger.cc 94951 2016-01-07 11:58:57Z gcosmo $
//
// ---------------------------------------------------------------------
@@ -539,7 +539,7 @@ void G4ScoringMessenger::FillTokenVec(G4String newValues, G4TokenVec& token){
G4Tokenizer next(newValues);
G4String val;
while ( !(val = next()).isNull() ) {
while ( !(val = next()).isNull() ) { // Loop checking 12.18.2015 M.Asai
token.push_back(val);
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoreColorMap.cc 89185 2015-03-23 16:11:02Z gcosmo $
// $Id: G4VScoreColorMap.cc 94772 2015-12-09 09:46:45Z gcosmo $
//
#include "G4VScoreColorMap.hh"
@@ -41,7 +41,7 @@
#include "G4Polyhedron.hh"
G4VScoreColorMap::G4VScoreColorMap(G4String mName)
:fName(mName),ifFloat(true),fMinVal(0.),fMaxVal(DBL_MAX),fVisManager(0)
:fName(mName),ifFloat(true),fMinVal(0.),fMaxVal(DBL_MAX),fVisManager(nullptr)
{;}
G4VScoreColorMap::~G4VScoreColorMap()
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoreWriter.cc 67992 2013-03-13 10:59:57Z gcosmo $
// $Id: G4VScoreWriter.cc 94772 2015-12-09 09:46:45Z gcosmo $
//
#include "G4VScoreWriter.hh"
@@ -38,7 +38,7 @@
#include <fstream>
G4VScoreWriter::G4VScoreWriter()
: fScoringMesh(0), verboseLevel(0) {
: fScoringMesh(nullptr), verboseLevel(0) {
fNMeshSegments[0] = fNMeshSegments[1] = fNMeshSegments[2] = 0;
}
+40 -42
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VScoringMesh.cc 83518 2014-08-27 12:57:10Z gcosmo $
// $Id: G4VScoringMesh.cc 96535 2016-04-20 12:14:15Z gcosmo $
//
// ---------------------------------------------------------------------
// Modifications
@@ -44,11 +44,11 @@
#include "G4SDManager.hh"
G4VScoringMesh::G4VScoringMesh(const G4String& wName)
: fWorldName(wName),fCurrentPS(0),fConstructed(false),fActive(true),fShape(undefinedMesh),
fRotationMatrix(0), fMFD(new G4MultiFunctionalDetector(wName)),
: fWorldName(wName),fCurrentPS(nullptr),fConstructed(false),fActive(true),fShape(undefinedMesh),
fRotationMatrix(nullptr), fMFD(new G4MultiFunctionalDetector(wName)),
verboseLevel(0),sizeIsSet(false),nMeshIsSet(false),
fDrawUnit(""), fDrawUnitValue(1.), fMeshElementLogical(0),
fParallelWorldProcess(0), fGeometryHasBeenDestroyed(false)
fDrawUnit(""), fDrawUnitValue(1.), fMeshElementLogical(nullptr),
fParallelWorldProcess(nullptr), fGeometryHasBeenDestroyed(false)
{
G4SDManager::GetSDMpointer()->AddNewDetector(fMFD);
@@ -57,19 +57,19 @@ G4VScoringMesh::G4VScoringMesh(const G4String& wName)
fDivisionAxisNames[0] = fDivisionAxisNames[1] = fDivisionAxisNames[2] = "";
}
G4VScoringMesh::~G4VScoringMesh()
{
G4VScoringMesh::~G4VScoringMesh() {
;
}
void G4VScoringMesh::ResetScore() {
if(verboseLevel > 9) G4cout << "G4VScoringMesh::ResetScore() is called." << G4endl;
std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.begin();
for(; itr != fMap.end(); itr++) {
if(verboseLevel > 9) G4cout << "G4VScoringMesh::ResetScore()" << itr->first << G4endl;
itr->second->clear();
for(auto mp : fMap)
{
if(verboseLevel > 9) G4cout << "G4VScoringMesh::ResetScore()" << mp.first << G4endl;
mp.second->clear();
}
}
void G4VScoringMesh::SetSize(G4double size[3]) {
if ( !sizeIsSet ){
for(int i = 0; i < 3; i++) fSize[i] = size[i];
@@ -105,46 +105,47 @@ void G4VScoringMesh::GetNumberOfSegments(G4int nSegment[3]) {
for(int i = 0; i < 3; i++) nSegment[i] = fNSegment[i];
}
void G4VScoringMesh::RotateX(G4double delta) {
if(fRotationMatrix == 0) fRotationMatrix = new G4RotationMatrix();
if(!fRotationMatrix) fRotationMatrix = new G4RotationMatrix();
fRotationMatrix->rotateX(delta);
}
void G4VScoringMesh::RotateY(G4double delta) {
if(fRotationMatrix == 0) fRotationMatrix = new G4RotationMatrix();
if(!fRotationMatrix) fRotationMatrix = new G4RotationMatrix();
fRotationMatrix->rotateY(delta);
}
void G4VScoringMesh::RotateZ(G4double delta) {
if(fRotationMatrix == 0) fRotationMatrix = new G4RotationMatrix();
if(!fRotationMatrix) fRotationMatrix = new G4RotationMatrix();
fRotationMatrix->rotateZ(delta);
}
void G4VScoringMesh::SetPrimitiveScorer(G4VPrimitiveScorer * ps) {
void G4VScoringMesh::SetPrimitiveScorer(G4VPrimitiveScorer * prs) {
if(!ReadyForQuantity())
{
G4cerr << "ERROR : G4VScoringMesh::SetPrimitiveScorer() : " << ps->GetName()
G4cerr << "ERROR : G4VScoringMesh::SetPrimitiveScorer() : "
<< prs->GetName()
<< " does not yet have mesh size or number of bins. Set them first." << G4endl
<< "This Method is ignored." << G4endl;
return;
}
if(verboseLevel > 0) G4cout << "G4VScoringMesh::SetPrimitiveScorer() : "
<< ps->GetName() << " is registered."
<< prs->GetName() << " is registered."
<< " 3D size: ("
<< fNSegment[0] << ", "
<< fNSegment[1] << ", "
<< fNSegment[2] << ")" << G4endl;
ps->SetNijk(fNSegment[0], fNSegment[1], fNSegment[2]);
fCurrentPS = ps;
fMFD->RegisterPrimitive(ps);
G4THitsMap<G4double> * map = new G4THitsMap<G4double>(fWorldName, ps->GetName());
fMap[ps->GetName()] = map;
prs->SetNijk(fNSegment[0], fNSegment[1], fNSegment[2]);
fCurrentPS = prs;
fMFD->RegisterPrimitive(prs);
G4THitsMap<G4double> * map = new G4THitsMap<G4double>(fWorldName, prs->GetName());
fMap[prs->GetName()] = map;
}
void G4VScoringMesh::SetFilter(G4VSDFilter * filter) {
if(fCurrentPS == 0) {
if(!fCurrentPS) {
G4cerr << "ERROR : G4VScoringMesh::SetSDFilter() : a quantity must be defined first. This method is ignored." << G4endl;
return;
}
@@ -164,7 +165,7 @@ void G4VScoringMesh::SetFilter(G4VSDFilter * filter) {
void G4VScoringMesh::SetCurrentPrimitiveScorer(const G4String & name) {
fCurrentPS = GetPrimitiveScorer(name);
if(fCurrentPS == 0) {
if(!fCurrentPS) {
G4cerr << "ERROR : G4VScoringMesh::SetCurrentPrimitiveScorer() : The primitive scorer <"
<< name << "> does not found." << G4endl;
}
@@ -186,8 +187,8 @@ G4String G4VScoringMesh::GetPSUnit(const G4String & psname) {
}
G4String G4VScoringMesh::GetCurrentPSUnit(){
G4String unit = "";
if(fCurrentPS == 0) {
G4String unit = "";
if(!fCurrentPS) {
G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : ";
msg += " Current primitive scorer is null.";
G4cerr << msg << G4endl;
@@ -198,7 +199,7 @@ G4String G4VScoringMesh::GetCurrentPSUnit(){
}
void G4VScoringMesh::SetCurrentPSUnit(const G4String& unit){
if(fCurrentPS == 0) {
if(!fCurrentPS) {
G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : ";
msg += " Current primitive scorer is null.";
G4cerr << msg << G4endl;
@@ -221,15 +222,15 @@ void G4VScoringMesh::GetDivisionAxisNames(G4String divisionAxisNames[3]) {
}
G4VPrimitiveScorer * G4VScoringMesh::GetPrimitiveScorer(const G4String & name) {
if(fMFD == 0) return 0;
if(!fMFD) return nullptr;
G4int nps = fMFD->GetNumberOfPrimitives();
for(G4int i = 0; i < nps; i++) {
G4VPrimitiveScorer * ps = fMFD->GetPrimitive(i);
if(name == ps->GetName()) return ps;
G4VPrimitiveScorer * prs = fMFD->GetPrimitive(i);
if(name == prs->GetName()) return prs;
}
return 0;
return nullptr;
}
void G4VScoringMesh::List() const {
@@ -261,25 +262,22 @@ void G4VScoringMesh::List() const {
G4cout << " registered primitve scorers : " << G4endl;
G4int nps = fMFD->GetNumberOfPrimitives();
G4VPrimitiveScorer * ps;
G4VPrimitiveScorer * prs;
for(int i = 0; i < nps; i++) {
ps = fMFD->GetPrimitive(i);
G4cout << " " << i << " " << ps->GetName();
if(ps->GetFilter() != 0) G4cout << " with " << ps->GetFilter()->GetName();
prs = fMFD->GetPrimitive(i);
G4cout << " " << i << " " << prs->GetName();
if(prs->GetFilter() != 0) G4cout << " with " << prs->GetFilter()->GetName();
G4cout << G4endl;
}
}
void G4VScoringMesh::Dump() {
G4cout << "scoring mesh name: " << fWorldName << G4endl;
G4cout << "# of G4THitsMap : " << fMap.size() << G4endl;
std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.begin();
for(; itr != fMap.end(); itr++) {
G4cout << "[" << itr->first << "]" << G4endl;
itr->second->PrintAllHits();
for(auto mp : fMap)
{
G4cout << "[" << mp.first << "]" << G4endl;
mp.second->PrintAllHits();
}
G4cout << G4endl;
+15 -1
View File
@@ -1,4 +1,4 @@
$Id: History 90754 2015-06-09 07:40:58Z gcosmo $
$Id: History 96903 2016-05-17 09:10:58Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,20 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 16th, 2016 A.Dotti (event-V10-02-03)
- Fix typos and bug from bugzilla #1860
April 20th, 2016 G.Cosmo (event-V10-02-02)
- Fixed shadowing compilation warnings in G4GeneralParticleSourceMessenger
for 'ps'.
January 19th, 2016 A.Dotti (event-V10-02-01)
- Introducing G4MultiEventAction to allow multiple
user actions in the same job
December 28th, 2015 M.Asai (event-V10-02-00)
- Code clean-up.
June 8th, 2015 A.Dotti (event-V10-01-08)
- Fixing valgring report
+4 -4
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Event.hh 85265 2014-10-27 09:00:58Z gcosmo $
// $Id: G4Event.hh 94950 2016-01-07 11:53:14Z gcosmo $
//
//
// class description:
@@ -153,7 +153,7 @@ class G4Event
// Returns the event ID
inline void AddPrimaryVertex(G4PrimaryVertex* aPrimaryVertex)
{
if( thePrimaryVertex == 0 )
if( thePrimaryVertex == nullptr )
{ thePrimaryVertex = aPrimaryVertex; }
else
{ thePrimaryVertex->SetNext( aPrimaryVertex ); }
@@ -173,13 +173,13 @@ class G4Event
G4PrimaryVertex* primaryVertex = thePrimaryVertex;
for( G4int j=0; j<i; j++ )
{
if( primaryVertex == 0 ) return 0;
if( !primaryVertex ) return nullptr;
primaryVertex = primaryVertex->GetNext();
}
return primaryVertex;
}
else
{ return 0; }
{ return nullptr; }
}
// Returns i-th primary vertex of the event.
inline G4HCofThisEvent* GetHCofThisEvent() const
+3 -3
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4EventManager.hh 71031 2013-06-10 09:11:38Z gcosmo $
// $Id: G4EventManager.hh 94950 2016-01-07 11:53:14Z gcosmo $
//
//
@@ -71,8 +71,8 @@ class G4EventManager
~G4EventManager();
private:
G4EventManager(const G4EventManager &right);
G4EventManager& operator=(const G4EventManager& right);
G4EventManager(const G4EventManager &right) = delete;
G4EventManager& operator=(const G4EventManager& right) = delete;
public: // with description
void ProcessOneEvent(G4Event* anEvent);
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4MultiEventAction.hh 90212 2016-01-27 18:33:12Z adotti $
//
//---------------------------------------------------------------
//
// G4MultiEventAction.hh
//
// Created on: Jan 17, 2016
// Author: adotti
//
//
// class description:
// This class extends G4UserEventAction and allows multiple
// user-defined tracking actions to be used in the same job.
// The class is a vector of user-defined tracking actions.
// This class owns and manages the dependent user-actions.
// Usage:
// There is no need to explicitly use this class as long as the
// user actions are set via G4UserActionInitialization::SetUserAction
// that can be called several times. Explicitly this is what is happening:
// In user-defined action initialization:
// G4MultiEventAction* action = new G4MultiEventAction;
// action->push_back( G4UserEventActionUPtr( new MyUserEventAction );
// [... add as many as needed ...]
// SetUserAction( action );
// ---------------------------------------------------------------
//
#ifndef G4MULTIEVENTACTION_HH_
#define G4MULTIEVENTACTION_HH_
#include "G4UserEventAction.hh"
#include <vector>
#include <memory>
using G4UserEventActionUPtr=std::unique_ptr<G4UserEventAction>;
using G4UserEventActionVector=std::vector<G4UserEventActionUPtr>;
class G4MultiEventAction : public G4UserEventAction , public G4UserEventActionVector
{
public:
G4MultiEventAction() = default;
virtual ~G4MultiEventAction() override = default;
virtual void SetEventManager(G4EventManager* ) override;
virtual void BeginOfEventAction(const G4Event* ) override;
virtual void EndOfEventAction(const G4Event* ) override;
};
#endif /* SOURCE_EVENT_INCLUDE_G4MULTIEVENTACTION_HH_ */
+5 -5
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleGun.hh 66892 2013-01-17 10:57:59Z gunter $
// $Id: G4ParticleGun.hh 94950 2016-01-07 11:53:14Z gcosmo $
//
#ifndef G4ParticleGun_h
@@ -74,10 +74,10 @@ class G4ParticleGun:public G4VPrimaryGenerator
virtual ~G4ParticleGun();
private:
G4ParticleGun(const G4ParticleGun&);
const G4ParticleGun & operator=(const G4ParticleGun&);
G4int operator==(const G4ParticleGun&) const;
G4int operator!=(const G4ParticleGun&) const;
G4ParticleGun(const G4ParticleGun&) = delete;
const G4ParticleGun & operator=(const G4ParticleGun&) = delete;
G4int operator==(const G4ParticleGun&) const = delete;
G4int operator!=(const G4ParticleGun&) const = delete;
public: // with description
virtual void GeneratePrimaryVertex(G4Event* evt);
+2 -2
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UserEventAction.hh 66892 2013-01-17 10:57:59Z gunter $
// $Id: G4UserEventAction.hh 95248 2016-02-02 09:37:04Z gcosmo $
//
//
//
@@ -53,7 +53,7 @@ class G4UserEventAction
public:
G4UserEventAction();
virtual ~G4UserEventAction();
inline void SetEventManager(G4EventManager* value)
virtual void SetEventManager(G4EventManager* value)
{ fpEventManager = value; }
public: // with description
virtual void BeginOfEventAction(const G4Event* anEvent);
+3 -1
View File
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 81623 2014-06-04 08:10:21Z gcosmo $
# $Id: sources.cmake 95248 2016-02-02 09:37:04Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -79,6 +79,7 @@ GEANT4_DEFINE_MODULE(NAME G4event
G4TrackStack.hh
G4TrajectoryContainer.hh
G4UserEventAction.hh
G4MultiEventAction.hh
G4UserStackingAction.hh
G4VPrimaryGenerator.hh
G4VUserEventInformation.hh
@@ -114,6 +115,7 @@ GEANT4_DEFINE_MODULE(NAME G4event
G4TrackStack.cc
G4TrajectoryContainer.cc
G4UserEventAction.cc
G4MultiEventAction.cc
G4UserStackingAction.cc
G4VPrimaryGenerator.cc
G4GeneralParticleSourceData.cc
+18 -16
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Event.cc 84194 2014-10-10 14:29:58Z gcosmo $
// $Id: G4Event.cc 94950 2016-01-07 11:53:14Z gcosmo $
//
// G4Event
@@ -37,41 +37,43 @@
#include "G4VDigiCollection.hh"
#include "G4ios.hh"
G4ThreadLocal G4Allocator<G4Event> *anEventAllocator = 0;
G4ThreadLocal G4Allocator<G4Event> *anEventAllocator = nullptr;
G4Event::G4Event()
:eventID(0),
thePrimaryVertex(0),numberOfPrimaryVertex(0),
HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
randomNumberStatus(0),validRandomNumberStatus(false),
randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
thePrimaryVertex(nullptr),numberOfPrimaryVertex(0),
HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
eventAborted(false),userInfo(nullptr),
randomNumberStatus(nullptr),validRandomNumberStatus(false),
randomNumberStatusForProcessing(nullptr),validRandomNumberStatusForProcessing(false),
keepTheEvent(false),grips(0)
{
}
G4Event::G4Event(G4int evID)
:eventID(evID),
thePrimaryVertex(0),numberOfPrimaryVertex(0),
HC(0),DC(0),trajectoryContainer(0),eventAborted(false),userInfo(0),
randomNumberStatus(0),validRandomNumberStatus(false),
randomNumberStatusForProcessing(0),validRandomNumberStatusForProcessing(false),
thePrimaryVertex(nullptr),numberOfPrimaryVertex(0),
HC(nullptr),DC(nullptr),trajectoryContainer(nullptr),
eventAborted(false),userInfo(nullptr),
randomNumberStatus(nullptr),validRandomNumberStatus(false),
randomNumberStatusForProcessing(nullptr),validRandomNumberStatusForProcessing(false),
keepTheEvent(false),grips(0)
{
}
G4Event::~G4Event()
{
if(thePrimaryVertex) delete thePrimaryVertex;
if(HC) delete HC;
if(DC) delete DC;
delete thePrimaryVertex;
delete HC;
delete DC;
if(trajectoryContainer)
{
trajectoryContainer->clearAndDestroy();
delete trajectoryContainer;
}
if(userInfo) delete userInfo;
if(validRandomNumberStatus) delete randomNumberStatus;
if(validRandomNumberStatusForProcessing) delete randomNumberStatusForProcessing;
delete userInfo;
delete randomNumberStatus;
delete randomNumberStatusForProcessing;
}
G4int G4Event::operator==(const G4Event &right) const
+24 -25
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4EventManager.cc 71031 2013-06-10 09:11:38Z gcosmo $
// $Id: G4EventManager.cc 94950 2016-01-07 11:53:14Z gcosmo $
//
//
//
@@ -42,12 +42,12 @@
#include "G4Navigator.hh"
#include "Randomize.hh"
G4ThreadLocal G4EventManager* G4EventManager::fpEventManager = 0;
G4ThreadLocal G4EventManager* G4EventManager::fpEventManager = nullptr;
G4EventManager* G4EventManager::GetEventManager()
{ return fpEventManager; }
G4EventManager::G4EventManager()
:currentEvent(0),trajectoryContainer(0),
:currentEvent(nullptr),trajectoryContainer(nullptr),
verboseLevel(0),tracking(false),abortRequested(false),
storetRandomNumberStatusToG4Event(false)
{
@@ -65,17 +65,18 @@ G4EventManager::G4EventManager()
sdManager = G4SDManager::GetSDMpointerIfExist();
stateManager = G4StateManager::GetStateManager();
fpEventManager = this;
userEventAction = 0;
userStackingAction = 0;
userTrackingAction = 0;
userSteppingAction = 0;
userEventAction = nullptr;
userStackingAction = nullptr;
userTrackingAction = nullptr;
userSteppingAction = nullptr;
}
}
// private -> never called
/* private -> never called
G4EventManager::G4EventManager(const G4EventManager&) {;}
G4EventManager& G4EventManager::operator=(const G4EventManager&)
{ return *this; }
*/
G4EventManager::~G4EventManager()
{
@@ -83,7 +84,7 @@ G4EventManager::~G4EventManager()
delete transformer;
delete trackManager;
delete theMessenger;
if(userEventAction) delete userEventAction;
delete userEventAction;
fpEventManager = 0;
}
@@ -94,8 +95,6 @@ G4int G4EventManager::operator==(const G4EventManager &right) const { }
G4int G4EventManager::operator!=(const G4EventManager &right) const { }
*/
void G4EventManager::DoProcessing(G4Event* anEvent)
{
abortRequested = false;
@@ -117,15 +116,15 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
currentEvent->SetRandomNumberStatusForProcessing(randomNumberStatusToG4Event);
}
// Reseting Navigator has been moved to G4Eventmanager, so that resetting
// Reseting Navigator has been moved to G4EventManager, so that resetting
// is now done for every event.
G4ThreeVector center(0,0,0);
G4Navigator* navigator =
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
navigator->LocateGlobalPointAndSetup(center,0,false);
G4Track * track;
G4TrackStatus istop;
G4Track * track = nullptr;
G4TrackStatus istop = fAlive;
#ifdef G4VERBOSE
if ( verboseLevel > 0 )
@@ -139,7 +138,7 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
trackContainer->PrepareNewEvent();
#ifdef G4_STORE_TRAJECTORY
trajectoryContainer = 0;
trajectoryContainer = nullptr;
#endif
sdManager = G4SDManager::GetSDMpointerIfExist();
@@ -169,7 +168,7 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
#endif
G4VTrajectory* previousTrajectory;
while( ( track = trackContainer->PopNextTrack(&previousTrajectory) ) != 0 )
while( ( track = trackContainer->PopNextTrack(&previousTrajectory) ) != 0 ) // Loop checking 12.28.2015 M.Asai
{
#ifdef G4VERBOSE
@@ -195,7 +194,7 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
}
#endif
G4VTrajectory * aTrajectory = 0;
G4VTrajectory * aTrajectory = nullptr;
#ifdef G4_STORE_TRAJECTORY
aTrajectory = trackManager->GimmeTrajectory();
@@ -263,22 +262,22 @@ void G4EventManager::DoProcessing(G4Event* anEvent)
if(userEventAction) userEventAction->EndOfEventAction(currentEvent);
stateManager->SetNewState(G4State_GeomClosed);
currentEvent = 0;
currentEvent = nullptr;
abortRequested = false;
}
void G4EventManager::StackTracks(G4TrackVector *trackVector,G4bool IDhasAlreadySet)
{
G4Track * newTrack;
if( trackVector )
{
size_t n_passedTrack = trackVector->size();
if( n_passedTrack == 0 ) return;
for( size_t i = 0; i < n_passedTrack; i++ )
//size_t n_passedTrack = trackVector->size();
//if( n_passedTrack == 0 ) return;
//for( size_t i = 0; i < n_passedTrack; i++ )
//{
// newTrack = (*trackVector)[ i ];
if( trackVector->size() == 0 ) return;
for( auto newTrack : *trackVector )
{
newTrack = (*trackVector)[ i ];
trackIDCounter++;
if(!IDhasAlreadySet)
{
@@ -83,10 +83,10 @@ namespace {
G4GeneralParticleSourceMessenger* theInstance = 0;
}
G4GeneralParticleSourceMessenger* G4GeneralParticleSourceMessenger::GetInstance(G4GeneralParticleSource* ps)
G4GeneralParticleSourceMessenger* G4GeneralParticleSourceMessenger::GetInstance(G4GeneralParticleSource* psc)
{
G4AutoLock l(&creationM);
if ( theInstance == 0 ) theInstance = new G4GeneralParticleSourceMessenger(ps);
if ( theInstance == 0 ) theInstance = new G4GeneralParticleSourceMessenger(psc);
return theInstance;
}
@@ -1775,7 +1775,7 @@ void G4GeneralParticleSourceMessenger::IonCommand(G4String newValues)
if (ion==0)
{
G4cout << "Ion with Z=" << fAtomicNumber;
G4cout << " A=" << fAtomicMass << "is not be defined" << G4endl;
G4cout << " A=" << fAtomicMass << " is not defined" << G4endl;
}
else
{
@@ -1816,7 +1816,7 @@ void G4GeneralParticleSourceMessenger::IonLvlCommand(G4String newValues)
ion = G4IonTable::GetIonTable()->GetIon(fAtomicNumberL, fAtomicMassL, fIonEnergyLevel);
if (ion == 0) {
G4cout << "Ion with Z=" << fAtomicNumberL;
G4cout << " A=" << fAtomicMass << "is not be defined" << G4endl;
G4cout << " A=" << fAtomicMassL << " is not defined" << G4endl;
} else {
fParticleGun->SetParticleDefinition(ion);
fParticleGun->SetParticleCharge(fIonChargeL*eplus);
@@ -24,26 +24,39 @@
// ********************************************************************
//
//
// $Id: G4AtomicShell.cc,v 1.2 ????
// $Id: G4MultiEventAction.cc 90212 2016-01-27 18:33:12Z adotti $
//
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
//---------------------------------------------------------------
//
// History:
// -----------
// 16 Sept 2001 EG Modified according to a design iteration in the
// LowEnergy category
// G4MultiEventAction.cc
//
// Created on: Jan 17, 2016
// Author: adotti
//
// ---------------------------------------------------------------
//
// -------------------------------------------------------------------
#include "G4AtomicShell.hh"
#include "G4MultiEventAction.hh"
#include <algorithm>
G4AtomicShell::G4AtomicShell(G4int id, G4double energy)
void G4MultiEventAction::SetEventManager(G4EventManager* mgr)
{
identifier = id;
bindingEnergy = energy;
}
std::for_each( begin() , end() ,
[mgr](G4UserEventActionUPtr& e) { e->SetEventManager(mgr); }
);
}
G4AtomicShell::~G4AtomicShell()
{}
void G4MultiEventAction::BeginOfEventAction(const G4Event* evt)
{
std::for_each( begin() , end() ,
[evt](G4UserEventActionUPtr& e) { e->BeginOfEventAction(evt); }
);
}
void G4MultiEventAction::EndOfEventAction(const G4Event* evt)
{
std::for_each( begin() , end() ,
[evt](G4UserEventActionUPtr& e) { e->EndOfEventAction(evt); }
);
}
+36 -28
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleGun.cc 66892 2013-01-17 10:57:59Z gunter $
// $Id: G4ParticleGun.cc 94950 2016-01-07 11:53:14Z gcosmo $
//
// G4ParticleGun
@@ -57,7 +57,7 @@ G4ParticleGun::G4ParticleGun
void G4ParticleGun::SetInitialValues()
{
NumberOfParticlesToBeGenerated = 1;
particle_definition = 0;
particle_definition = nullptr;
G4ThreeVector zero;
particle_momentum_direction = (G4ParticleMomentum)zero;
particle_energy = 0.0;
@@ -74,29 +74,29 @@ G4ParticleGun::~G4ParticleGun()
delete theMessenger;
}
G4ParticleGun::G4ParticleGun(const G4ParticleGun& /*right*/)
:G4VPrimaryGenerator()
{ G4Exception(
"G4ParticleGun::G4ParticleGun","Event0191",FatalException,
"G4ParticleGun : Copy constructor should not be used."); }
const G4ParticleGun& G4ParticleGun::operator=(const G4ParticleGun& right)
{ G4Exception(
"G4ParticleGun::operator=","Event0192",FatalException,
"G4ParticleGun : Equal operator should not be used.");
return right; }
G4int G4ParticleGun::operator==(const G4ParticleGun& /*right*/) const
{ G4Exception(
"G4ParticleGun::operator==","Event0193",FatalException,
"G4ParticleGun : == operator should not be used.");
return true; }
G4int G4ParticleGun::operator!=(const G4ParticleGun& /*right*/) const
{ G4Exception(
"G4ParticleGun::operator!=","Event0193",FatalException,
"G4ParticleGun : != operator should not be used.");
return false; }
//G4ParticleGun::G4ParticleGun(const G4ParticleGun& /*right*/)
//:G4VPrimaryGenerator()
//{ G4Exception(
// "G4ParticleGun::G4ParticleGun","Event0191",FatalException,
// "G4ParticleGun : Copy constructor should not be used."); }
//
//const G4ParticleGun& G4ParticleGun::operator=(const G4ParticleGun& right)
//{ G4Exception(
// "G4ParticleGun::operator=","Event0192",FatalException,
// "G4ParticleGun : Equal operator should not be used.");
// return right; }
//
//G4int G4ParticleGun::operator==(const G4ParticleGun& /*right*/) const
//{ G4Exception(
// "G4ParticleGun::operator==","Event0193",FatalException,
// "G4ParticleGun : == operator should not be used.");
// return true; }
//
//G4int G4ParticleGun::operator!=(const G4ParticleGun& /*right*/) const
//{ G4Exception(
// "G4ParticleGun::operator!=","Event0193",FatalException,
// "G4ParticleGun : != operator should not be used.");
// return false; }
void G4ParticleGun::SetParticleDefinition
(G4ParticleDefinition * aParticleDefinition)
@@ -161,7 +161,7 @@ void G4ParticleGun::SetParticleMomentum(G4double aMomentum)
G4cout << " is now defined in terms Momentum: "
<< aMomentum/GeV << "GeV/c" << G4endl;
}
if(particle_definition==0)
if(!particle_definition)
{
G4cout <<"Particle Definition not defined yet for G4ParticleGun"<< G4endl;
G4cout <<"Zero Mass is assumed"<<G4endl;
@@ -191,7 +191,7 @@ void G4ParticleGun::SetParticleMomentum(G4ParticleMomentum aMomentum)
G4cout << " is now defined in terms Momentum: "
<< aMomentum.mag()/GeV << "GeV/c" << G4endl;
}
if(particle_definition==0)
if(!particle_definition)
{
G4cout <<"Particle Definition not defined yet for G4ParticleGun"<< G4endl;
G4cout <<"Zero Mass is assumed"<<G4endl;
@@ -211,7 +211,15 @@ void G4ParticleGun::SetParticleMomentum(G4ParticleMomentum aMomentum)
void G4ParticleGun::GeneratePrimaryVertex(G4Event* evt)
{
if(particle_definition==0) return;
if(!particle_definition)
{
G4ExceptionDescription ED;
ED << "Particle definition is not defined." << G4endl;
ED << "G4ParticleGun::SetParticleDefinition() has to be invoked beforehand." << G4endl;
G4Exception("G4ParticleGun::GeneratePrimaryVertex()","Event0109",
FatalException, ED);
return;
}
// create a new vertex
G4PrimaryVertex* vertex =
+9 -8
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PrimaryTransformer.cc 72252 2013-07-12 09:04:11Z gcosmo $
// $Id: G4PrimaryTransformer.cc 94950 2016-01-07 11:53:14Z gcosmo $
//
#include "G4PrimaryTransformer.hh"
@@ -42,8 +42,8 @@
G4PrimaryTransformer::G4PrimaryTransformer()
:verboseLevel(0),trackID(0),
unknown(0),unknownParticleDefined(false),
opticalphoton(0),opticalphotonDefined(false),
unknown(nullptr),unknownParticleDefined(false),
opticalphoton(nullptr),opticalphotonDefined(false),
nWarn(0)
{
particleTable = G4ParticleTable::GetParticleTable();
@@ -72,11 +72,12 @@ G4TrackVector* G4PrimaryTransformer::GimmePrimaries(G4Event* anEvent,G4int track
trackID = trackIDCounter;
//TV.clearAndDestroy();
for( size_t ii=0; ii<TV.size();ii++)
{ delete TV[ii]; }
for(auto tr : TV) delete tr;
TV.clear();
//Loop over vertices
G4PrimaryVertex* nextVertex = anEvent->GetPrimaryVertex();
while(nextVertex)
while(nextVertex) // Loop checking 12.28.2015 M.Asai
{
GenerateTracks(nextVertex);
nextVertex = nextVertex->GetNext();
@@ -105,7 +106,7 @@ void G4PrimaryTransformer::GenerateTracks(G4PrimaryVertex* primaryVertex)
#endif
G4PrimaryParticle* primaryParticle = primaryVertex->GetPrimary();
while( primaryParticle != 0 )
while( primaryParticle != 0 ) // Loop checking 12.28.2015 M.Asai
{
GenerateSingleTrack( primaryParticle, X0, Y0, Z0, T0, WV );
primaryParticle = primaryParticle->GetNext();
@@ -128,7 +129,7 @@ void G4PrimaryTransformer::GenerateSingleTrack
}
#endif
G4PrimaryParticle* daughter = primaryParticle->GetDaughter();
while(daughter)
while(daughter) // Loop checking 12.28.2015 M.Asai
{
GenerateSingleTrack(daughter,x0,y0,z0,t0,wv);
daughter = daughter->GetNext();
+49 -1
View File
@@ -17,12 +17,60 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
10-May-2016 - G.Cosmo (externals-V10-02-09)
- Updated to CLHEP-2.3.3.0.
- CLHEP: corrected check for counter range in MixMaxRng::getState().
Avoid hard-coded constant for initialisation of VECTOR_STATE_SIZE in
MixMaxRng, to directly use actual value of "N" from mixmax.
02-May-2016 - G.Cosmo (externals-V10-02-08)
- CLHEP: added symbols 'us' and 'ps' for microsend and picosecond respectively
to SystemOfUnits.h and setSystemOfUnits.cc and converted all symbols and
constants from "static const" to "static constexpr".
28-April-2016 - G.Cosmo (externals-V10-02-07)
- CLHEP: restored skipping of sequences for safer seeds setting in setSeeds()
in MixMaxRng. Changed number of N in mixmax to 17 (was 256) and provided
new skipping coefficients for the new value of N and for the case N=8.
25-April-2016 - G.Cosmo (externals-V10-02-06)
- CLHEP: use seed_spbox() for seeding MixMax with single seed.
21-April-2016 - G.Cosmo (externals-V10-02-05, 04)
- CLHEP: refined fix for sequence skipping; make it optional by adding Boolean
flag argument (true by default) in seed_uniquestream() function in mixmax.cc
to force sequence skipping when setting seeds. Simplified code, removing
compilation guard flags.
Set flag to false by default in MixMaxRng wrapper and defined function
skipSequencesOnce() to optional instruct to apply skipping of sequences
at the next seeds setting.
20-April-2016: G.Cosmo (externals-V10-02-03, 02)
- Updated to CLHEP-2.3.2.2:
o Added use_atomic.h header to use std::atomic if compiler supports it.
o MixMaxRng: corrected initialisation and use of 'numberOfEngines'
when more than one threads calls the constructor.
o HepRandom: revised settings of "defaults" to use a single thread_local
pointer.
- Including tag "zlib-V10-02-01":
o Fix in gzguts.h for Windows with Visual Studio 2015 in 64 bit compilation.
19-April-2016: G.Cosmo (externals-V10-02-01)
- CLHEP: commented out seeds skipping from built-in table in mixmax.cc
(undefined flag SKIPISON), in order to avoid contention in multi-threaded
jobs and simplify seeding procedure. Removed use of obselete 'register'
keyword. Minor code cleanup in MixMaxRng.
11-April-2016: G.Cosmo (externals-V10-02-00)
- CLHEP: use simple loop for flatArray() in MixMaxRng; engine built-in
function turns out to be extremely slow and unefficient.
9-November-2015: G.Cosmo (externals-V10-01-19)
- Updated to CLHEP-2.3.1.1.
- Added MixMaxRng to Randomize.h.
30-October-2015 - G.Cosmo (externals-V10-01-18)
- CLHEP: Fixed default seeding in MixMaxRng::setSeeds().
- CLHEP: fixed default seeding in MixMaxRng::setSeeds().
7-October-2015 - G.Cosmo (externals-V10-01-17)
- Removed internal USolids module. Now USolids/VecGeom can be used only as
+3
View File
@@ -57,6 +57,8 @@ set(G4clhep_HEADERS
include/CLHEP/Random/engineIDulong.h
include/CLHEP/Random/JamesRandom.h
include/CLHEP/Random/mixmax.h
include/CLHEP/Random/mixmax_skip_N8.icc
include/CLHEP/Random/mixmax_skip_N17.icc
include/CLHEP/Random/mixmax_skip_N256.icc
include/CLHEP/Random/MixMaxRng.h
include/CLHEP/Random/MTwistEngine.h
@@ -109,6 +111,7 @@ set(G4clhep_HEADERS
include/CLHEP/Utility/keywords.h
include/CLHEP/Utility/memory.h
include/CLHEP/Utility/noncopyable.h
include/CLHEP/Utility/use_atomic.h
include/CLHEP/Vector/AxisAngle.h
include/CLHEP/Vector/AxisAngle.icc
include/CLHEP/Vector/Boost.h
+55
View File
@@ -17,6 +17,61 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
10 May 2016 - G.Cosmo
- Updated to CLHEP-2.3.3.0.
- Corrected check for counter range in MixMaxRng::getState().
Avoid hard-coded constant for initialisation of VECTOR_STATE_SIZE in
MixMaxRng, to directly use actual value of "N" from mixmax.
02 May 2016 - G.Cosmo
- Added symbols 'us' and 'ps' for microsend and picosecond respectively
to SystemOfUnits.h and setSystemOfUnits.cc and converted all symbols and
constants from "static const" to "static constexpr".
28 April 2016 - G.Cosmo
- Restored skipping of sequences for safer setting of seeds in setSeeds()
in MixMaxRng. Changed number of N in mixmax to 17 (was 256) and provided
new skipping coefficients for the new value of N and for the case N=8.
25 April 2016 - G.Cosmo
- Use seed_spbox() for seeding MixMax with single seed.
21 April 2016 - G.Cosmo
- Refined fix for sequence skipping; make it optional by adding Boolean flag
argument (true by default) in seed_uniquestream() function in mixmax.cc to
force sequence skipping when setting seeds. Simplified code, removing
compilation guard flags.
Set flag to false by default in MixMaxRng wrapper and defined function
skipSequencesOnce() to optional instruct to apply skipping of sequences
at the next seeds setting.
20 April 2016 - G.Cosmo
- Updated to CLHEP-2.3.2.2:
* Utility (L.Garren <garren@fnal.gov>)
o Added use_atomic.h: use std::atomic when the compiler declares it
uses the C++11 standard.
* Random (W.D.Dagenhart <wdd@fnal.gov>)
o MixMaxRng.cc: the uncorrected code might not always yield independent
seeds.
If two threads execute numberOfEngines++ and after both finish that both
execute setSeed, then they will have the same seed. Fixed.
o Random.cc: there is a thread local variable of the type "defaults"
that contains two shared_ptr's in Random.cc. This causes an intermittent
problem on OSX. The complex objects containing the shared_ptr's have been
moved into a list of objects and the now the thread_local only contains a
simple pointer now that points into the list.
Use the new Utility/use_atomic.h header.
19 April 2016 - G.Cosmo
- Commented out sequence skipping from built-in table in mixmax.cc (undefined
flag SKIPISON), in order to avoid contention in multi-threaded jobs and
simplify seeding procedure. Removed use of obselete 'register' keyword.
- Minor code cleanup in MixMaxRng.
11 April 2016 - G.Cosmo
- Use simple loop for flatArray() in MixMaxRng; engine built-in function
turns out to be extremely slot and unefficient.
09 November 2015 - G.Cosmo
- Updated to CLHEP-2.3.1.1.
- Added MixMaxRng to Randomize.h.
+2 -2
View File
@@ -95,11 +95,11 @@ public:
bool get (const std::vector<unsigned long> & v);
bool getState (const std::vector<unsigned long> & v);
static const unsigned int VECTOR_STATE_SIZE = 516; // 2N+4 for MIXMAX
static const unsigned int VECTOR_STATE_SIZE = 2*N+4; // 2N+4 for MIXMAX
private:
// Members defining the current status of the generator.
// Pointer to the current status of the generator.
rng_state_st* fRngState;
};
+5 -4
View File
@@ -40,9 +40,10 @@ namespace CLHEP {
extern "C" {
#endif
const int N = 256;
/* The currently recommended N are 3150, 1260, 508, 256, 240, 88
Since the algorithm is linear in N, the cost per number is almost independent of N.
const int N = 17;
/* The currently recommended N are 3150, 1260, 508, 256, 240, 88, 17, 8
Since the algorithm is linear in N, the cost per number is
almost independent of N.
*/
#ifndef __LP64__
@@ -79,7 +80,7 @@ void print_state(rng_state_t* X);
typedef uint32_t myID_t;
void seed_uniquestream(rng_state_t* X, myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID );
void seed_uniquestream(rng_state_t* X, myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID);
/*
best choice: will make a state vector from which you can get at least 10^100 numbers
guaranteed mathematically to be non-colliding with any other stream prepared from another set of 32bit IDs,
@@ -0,0 +1,289 @@
// $Id:$
// -*- C++ -*-
//
// -----------------------------------------------------------------------
// MixMax Matrix PseudoRandom Number Generator
// --- MixMax ---
// -----------------------------------------------------------------------
//
// The code is being released under GNU Lesser General Public License v3
//
// Generator described in
// N.Z.Akopov, G.K.Savvidy and N.G.Ter-Arutyunian, Matrix Generator of Pseudorandom Numbers,
// J.Comput.Phys. 97, 573 (1991);
// Preprint EPI-867(18)-86, Yerevan Jun.1986;
//
// and
//
// K.Savvidy
// The MIXMAX random number generator
// Comp. Phys. Commun. (2015)
// http://dx.doi.org/10.1016/j.cpc.2015.06.003
//
// -----------------------------------------------------------------------
/*
skipping coefficients for N=17, m=2^36+1 and s=0
*/
{
{ 159701761865468764 , 126615459087983936 , 971935980882445987 , 1266425933430727482 , 330954324138038300 , 1494390944182608462 , 985567525599556189 , 1444303754750856766 , 1592836147366511740 , 944566361294427577 , 6336044263941214 , 686240801639476028 , 1446998785307329212 , 2077656654628400897 , 458344447554229916 , 1731527985347537415 , 1856587133043405783 }, // x^2^512
{ 582338566698838802 , 782718157798125637 , 684912925900277712 , 1271246213246651012 , 564133275057152122 , 1254731637174240011 , 899802366531028440 , 203611955528219606 , 2146610763813957982 , 115972700754870533 , 2092933746397577991 , 1136406621159800137 , 1067897330754616454 , 1722611875894083236 , 1630948851615767512 , 989604548662398765 , 421680943972696470 }, // x^2^513
{ 617097029144871694 , 2275108162235384877 , 1363862259022425560 , 153831723325577176 , 1962207167612439146 , 2011895465932033980 , 1007329645826843776 , 1300917526580470528 , 1171539246226411634 , 836665263844149790 , 1026633245683781179 , 32389807716467901 , 2296276234884428109 , 409297319724863974 , 1911430032287806834 , 916469329336553330 , 65677079513594107 }, // x^2^514
{ 1656997175938683235 , 334384582636879447 , 2289018900497662792 , 1053313217223819648 , 2529561867064419 , 2085279416854675588 , 2246944213774249775 , 917902382070457615 , 505594560851411438 , 1748690703652028000 , 1078212339021286156 , 170401217082007747 , 1552855376842911219 , 2209415219208922654 , 1174711397611724375 , 1342069058820567972 , 577671676013094771 }, // x^2^515
{ 200864199029196267 , 647584785983829858 , 449579673559383642 , 2210795481121719067 , 1185405708665067088 , 310118907549337558 , 1112237647478646030 , 907316892605650051 , 1241087052423417724 , 1441515240516850614 , 13684659557896782 , 1932376613205111310 , 60357690290969298 , 403792989584565525 , 102986206885970367 , 1838760170077135151 , 727651972830521938 }, // x^2^516
{ 2112835707304810889 , 583170948234442322 , 504636752552038260 , 1287047182580144501 , 2197579855548731362 , 1121897458052508302 , 1952770053431596080 , 772611988382900586 , 1985521487785539447 , 1011576935509998521 , 367571328103323233 , 1395044686007468872 , 398356602519830546 , 1118155658788636138 , 1242807300672421078 , 783603574838596371 , 2129902332243215295 }, // x^2^517
{ 476494511866938851 , 1225043666051930516 , 965084907571074277 , 48495729686479132 , 668653785847993343 , 1110923567965684699 , 1480594060141743070 , 1780050366926533029 , 1286523699078185217 , 669624786360998719 , 1865875391054214711 , 1887676069452920579 , 9982283268123603 , 1231842656474052119 , 1913212077924560289 , 1062511441187205188 , 698250642012057138 }, // x^2^518
{ 1052793057808933925 , 1488114650898155736 , 1809655216561165737 , 1766730333219340872 , 1142295800552777206 , 1197008472054994109 , 288311604729845194 , 1252198368803793342 , 1700393396484664348 , 1561218011609178732 , 1039496900875671159 , 1199061431134041566 , 217182459685479427 , 1965769716664277780 , 883713133563637492 , 855967538957706448 , 182946949964136989 }, // x^2^519
{ 521221301273005220 , 732177595172654650 , 1177004708676171981 , 491026482834387582 , 1475491185407701571 , 338551745124704898 , 322679017279562868 , 1102042763149957642 , 1781637400817890058 , 2230976132808504329 , 1647749103867940848 , 363540249136304168 , 1060964616691451642 , 856789607085849123 , 470641990892341750 , 1281772529585552540 , 603420272349730830 }, // x^2^520
{ 1803571173151157726 , 1944596483605820771 , 213094595441099858 , 901693591156501692 , 861915355835676099 , 635260099576893571 , 1982413183327998212 , 1120049474254535333 , 1505283430373136398 , 284189413831487026 , 1271922039532043918 , 154314556649628344 , 52549783574158204 , 584612521732421173 , 1901458131142776860 , 1937288889567974526 , 1212147240165209394 }, // x^2^521
{ 2034564475748864204 , 2101470381626210311 , 2288088283864667246 , 1914963188887983022 , 1095385391183929148 , 945106352371129676 , 1400087958043804470 , 1843694373265941018 , 389168898546209530 , 624173071047154320 , 1627380173012800657 , 1094171310315703468 , 1857806715885218084 , 1326770924244540642 , 2245083043975660260 , 807823933843072560 , 2287413039178247285 }, // x^2^522
{ 1438462501157028417 , 1178282907367658045 , 2151871713069448741 , 2216564753928829884 , 1135646926807917971 , 873250056357106251 , 1665621526869344532 , 1732452289298951455 , 1127204916768538887 , 1653631650320969340 , 1992482205762138263 , 1836865404020205588 , 1595463001888299444 , 958431756408955134 , 2110530659740056614 , 215688460376624015 , 1158251593711172802 }, // x^2^523
{ 1733925877085130548 , 2093555366416251473 , 2234101572813223254 , 27150917859587271 , 2120208241420965005 , 1740681603888968422 , 344809595448125388 , 2297225515944255048 , 2259042601422705288 , 872774782224758302 , 1492625124653803821 , 1721307140915414448 , 331124824482108658 , 120601336292842643 , 1057772943542838223 , 904281382213867256 , 2268149550994572836 }, // x^2^524
{ 1308619451049024014 , 362949499662291350 , 507935491259228365 , 1578906684563693579 , 1147252812024062738 , 170426700812984671 , 2292369007840245901 , 2278676904939144735 , 1661943824935578983 , 1151791566444763239 , 244664648985115502 , 788605939290857339 , 185329244981575100 , 2234030485122694225 , 1354886281367682733 , 1172982108216683874 , 1673999648423090090 }, // x^2^525
{ 12148567885654147 , 1372231622618064454 , 1512411127803286398 , 91088917975722538 , 1479647890243287328 , 720784302152223867 , 796410783806366571 , 581618991323966327 , 850700716339425563 , 930903615199005243 , 1411478967795549943 , 1395258853733301256 , 1287449265209562277 , 2138600707136677508 , 1952689678998032749 , 1536157936222739421 , 1365983300736022067 }, // x^2^526
{ 1614268848379872789 , 1977966741412095904 , 1868426217239032474 , 1603841034660414664 , 1538146046227581261 , 686243317632590721 , 1825936888550743483 , 1880896341340126997 , 368542569942961260 , 127908944176116453 , 2240186396348061575 , 1299238346503882153 , 2102660872371583004 , 1938050823525276998 , 1611779572790548487 , 923339421522954197 , 1640317376822349283 }, // x^2^527
{ 1068274751244808317 , 478761882933885805 , 146343578721548466 , 2122787414678627286 , 478616655821124071 , 1223652533398739090 , 1178267270852093552 , 1585682559495334861 , 448375108812347778 , 28390211070681947 , 1690010627725723003 , 1631513459519602506 , 344109887337730484 , 1228367175232395654 , 1245714930611054419 , 2076109931139359104 , 1028725609142702754 }, // x^2^528
{ 922695624671435383 , 1212395461257377598 , 2004462039540699849 , 1640073156934071824 , 2048256174899844882 , 1784439921745628237 , 1181704167380381729 , 1002268784211250265 , 1203700422140227637 , 414802973276697203 , 1506620899880171251 , 1653959500223714911 , 761577027275676953 , 1394862681050805826 , 283665158959068873 , 1674581989169655504 , 2170268137063855658 }, // x^2^529
{ 1531823228490667160 , 655178204437606577 , 1143440975987174633 , 1469225472530244216 , 1459815855107895954 , 169158503015419167 , 896992338984130145 , 2224392167406479582 , 334969241330017474 , 1210934779672254914 , 958852377915238487 , 916143882424925025 , 1228314367757567546 , 576985231081272085 , 69708611488908557 , 419353864719896559 , 2063012113607020176 }, // x^2^530
{ 1561213794756615274 , 1035561623111560834 , 236042828876112400 , 2227997009011010087 , 69191692217035803 , 680016809348368644 , 304720676536884446 , 402216461956911069 , 579355410310536007 , 2067077610395244217 , 850246508783344249 , 1267387033405622409 , 381166642361949681 , 745560785470896920 , 475789434723626541 , 624301081669895306 , 542440096530351799 }, // x^2^531
{ 292947975657821923 , 1975118192564031841 , 1096919547621493467 , 1963319303199452777 , 1497672437671054944 , 587569660431161322 , 1640139998254479090 , 2075259177632397124 , 1660504006066529017 , 2098448192586763026 , 2110557029504033173 , 1649560687483066215 , 1687307417474238546 , 1953341749861443552 , 1238894388766834138 , 1741784409005434700 , 961090363500770371 }, // x^2^532
{ 1383869753498066511 , 1233178641086644718 , 983298541932470614 , 670427917276364832 , 1594590175512954791 , 1215937832423358959 , 1903793454103261000 , 2172773248760515308 , 536919802769335489 , 1192052568730958579 , 1911240856897478532 , 474283681972418461 , 1641036102716815339 , 1411044907503618945 , 1001175747401094733 , 301211985765609746 , 87149012356549448 }, // x^2^533
{ 261502789562703795 , 2039292976033461220 , 1383214847400482168 , 617091957131872918 , 11536068257558752 , 1594678644021354556 , 75861344789992516 , 571299992729856381 , 1893030021771949746 , 955316100521264931 , 1984661955054505780 , 2011703935837291735 , 1088722461445557653 , 1179450192264585869 , 2187858293377977903 , 925337903456050826 , 646310246691765740 }, // x^2^534
{ 1067110047296065055 , 1681438952663914065 , 1912868211773513420 , 157328871056550869 , 1606539524193585050 , 1826960759022391567 , 333004198356937619 , 1654504867491237582 , 1675004459630487926 , 71936368060300 , 1918748055540842111 , 1831638571780226898 , 1740919230167947613 , 1865657023192411640 , 1938852440014266019 , 294008211664586131 , 1233347209473542392 }, // x^2^535
{ 1793671892574625082 , 1130285389461734712 , 2256576488166743893 , 499935214652909272 , 1154848893191704610 , 2081455429764661190 , 132180046418477201 , 2017092125714317442 , 1267352468781603191 , 1320951561119166755 , 1819380377385314624 , 1968657260504504792 , 795175392323167167 , 138949840583543195 , 2205578352394323161 , 2162095450973436967 , 144991897502595141 }, // x^2^536
{ 683024508151477474 , 1048650848431764111 , 222063671742581704 , 1033879240711051787 , 2065492192337124448 , 1040278918101037386 , 1671617116839141169 , 1142933505587090141 , 578155580871550072 , 1397916094430897857 , 1428297170374867004 , 343607952975225879 , 2212099097846398741 , 659520961168888597 , 1099474129656084832 , 163872983722101162 , 469023960460927874 }, // x^2^537
{ 1156093888444545360 , 477156936151507247 , 340730541722292373 , 1631554541005175777 , 186957487417408624 , 926739184035859811 , 1357420454563306968 , 1018117004392525830 , 363668834887049598 , 562598157996426449 , 1477447398167639388 , 570432714234334068 , 797165670329651828 , 927307345530529305 , 1474634744709399927 , 2245157369991218355 , 586948150323806327 }, // x^2^538
{ 267980979185924701 , 1565212575331069567 , 2036070690586106209 , 850842928652802398 , 1084085447966709199 , 53832993778516816 , 2236093215844622791 , 361324823691972021 , 673008249565884673 , 1820092500335360408 , 2155516028757275328 , 1127096462606937572 , 1358543969239663842 , 2250855440900689232 , 1750872323705159361 , 1362418718801185396 , 766489969361488653 }, // x^2^539
{ 259726699384885201 , 1899046140654817590 , 1306363085361051998 , 2081068431945330598 , 85108856372668378 , 1324347710267860858 , 637751183869623188 , 2248344050276940170 , 2150579538601288819 , 1105694420952032875 , 952722029405414348 , 1555403505154017419 , 2124427035047642831 , 2043566203745579024 , 2297745588334532887 , 383567419144690253 , 295720540923262008 }, // x^2^540
{ 1861487178452566675 , 1408373324284705278 , 1763971337054095719 , 830694774025045496 , 1222854782641346372 , 1367429629279521808 , 646871018425974561 , 594901312199197009 , 1347745885562466060 , 1872975180162717691 , 264288217725438485 , 1587326205070728608 , 636368619535248259 , 1345295891447307881 , 147325724921249282 , 451151671184877984 , 369152850758367779 }, // x^2^541
{ 57601454029724418 , 8965969940832902 , 1015753881352776595 , 1272955433813211634 , 1500099915165437510 , 1505908015386217991 , 2200135170747962774 , 898929787588318880 , 94174721104731682 , 2001843482426425606 , 1296185933469804867 , 2067771350105959635 , 244437767883759705 , 115304829559788030 , 1570793303180703663 , 2075829501594571540 , 1142789736568430590 }, // x^2^542
{ 1666339398200583535 , 352498459116081565 , 1296181205638634316 , 943151467845475937 , 1576590058032732201 , 991197898685844101 , 172929644755996237 , 348073447626095407 , 1119639777406826568 , 569438225411593708 , 2284730591697077199 , 62008449878226744 , 237477582274396799 , 284434691435252140 , 1765995421169394732 , 1594311192946755506 , 604156017409724002 }, // x^2^543
{ 495281382117458539 , 205408453347821044 , 1681558300394231421 , 768174766423516475 , 2178619873339022076 , 765997180179026402 , 102658969211254460 , 895017413823772592 , 415845558640901473 , 601933504588026198 , 969782745266307970 , 855044719798584000 , 2201199786666131647 , 1734600819975899129 , 1006570536931532428 , 1130105133424164395 , 1127782802378551477 }, // x^2^544
{ 2279222264094136096 , 918140621636386578 , 764051053229027870 , 284578302438407812 , 18442247946635388 , 31558521455257101 , 2294641003511473164 , 1698376578572281576 , 1937426563738038511 , 809127821329680664 , 1605067175404678954 , 189108927488132646 , 2042036507825496222 , 311247532621290928 , 1403615118897576721 , 1715491077248039654 , 1885408148480015203 }, // x^2^545
{ 1303703719061282226 , 2273657250242045723 , 1357599208936374367 , 635087130862478000 , 1079733394689912801 , 1118552166016645994 , 606420152917155530 , 1461390879031614972 , 104855646611743091 , 1155586802792637483 , 1332607042374593381 , 485954066105103318 , 755622945227398111 , 100703703472763330 , 2104688739715121722 , 884188331727454949 , 634077400952306173 }, // x^2^546
{ 951241189979241574 , 605016052445461627 , 2017048237067736326 , 989577001336697190 , 729360432477738078 , 1891686993869218661 , 1178287733434616934 , 2257768800220793298 , 386183991328298626 , 1256576692082166247 , 1989644154430757909 , 677803830671194177 , 233612802004492344 , 1711459201958972728 , 1493606889466009749 , 2046914649687863407 , 621460642415971297 }, // x^2^547
{ 1751267799283060659 , 2256655950470869985 , 984875549537277532 , 2146590585318069342 , 1539686266680012185 , 25924698613741241 , 633436588936544176 , 1549785231759087109 , 934442226797007335 , 1754392592879566030 , 1106511892592859350 , 2133384541112231515 , 483183511756818991 , 1106565501063528265 , 1107187069130962112 , 2075632961004138802 , 1789791698038574768 }, // x^2^548
{ 2168119975504999102 , 12966540192424488 , 681037686628849373 , 194933206197471208 , 1333929840850796338 , 2213746149905142918 , 1379421507825630221 , 672612248824101656 , 335325159518504203 , 1891726571269569489 , 838501400504296092 , 1301803583046081493 , 1750320150554937404 , 67761357879073926 , 1985524641824792115 , 1623610528663151019 , 1386176498075642165 }, // x^2^549
{ 1725373491573591435 , 1047415675966614123 , 1624486786194930396 , 1270371958501591477 , 915493804007886656 , 2289688909829684654 , 2049603525909314516 , 148613066066958793 , 726433066490138797 , 1727275655898645687 , 1975538226366019203 , 394922847880149584 , 462814805660060890 , 1087564105835469854 , 293119996590319709 , 561334965874644379 , 1159197305565422760 }, // x^2^550
{ 1167941940931666302 , 186514058829683028 , 284351732075544532 , 1512524808600673716 , 43881750227659649 , 1609741131150076188 , 1125658924019416678 , 1011534154384997338 , 732738003772919984 , 277064895441615462 , 1622677204527889015 , 1938173807800443399 , 2063908410477010918 , 48488552879373011 , 1181372505578038205 , 135655409305671122 , 1938059649851535706 }, // x^2^551
{ 337206759525681069 , 1755948102219815566 , 678765415558248151 , 1298324546232590789 , 484850096725079792 , 1257105102233963714 , 1905953290815779223 , 1631095014301272964 , 27718500263208979 , 850594049252190048 , 583977122492931140 , 1805594056761021711 , 1719584503850087741 , 86179004867644487 , 1270985715490800843 , 644779453772114088 , 1760476987252969926 }, // x^2^552
{ 853995884080236938 , 369111089848434712 , 559743835711047174 , 1594116816433474826 , 35842475217144553 , 2171235383636811428 , 765712905092749171 , 941173958645971457 , 608455896272321575 , 560604720551238557 , 1845649540169134916 , 1718920359984151079 , 1401755957661962268 , 1423907959444825866 , 1098311071256242778 , 1528916661846841494 , 1508764511499232241 }, // x^2^553
{ 1508791960279504205 , 258737323991262817 , 2078642398527055752 , 2047350895402792396 , 1386159783711778842 , 2027047763369412816 , 58440814829283402 , 771612188948247815 , 1023214498156083887 , 844220082620919469 , 868367506978956802 , 460654633908296364 , 2166638508094415965 , 2152060517892743275 , 2195460306854592144 , 541094667496643303 , 2293587356561486979 }, // x^2^554
{ 1214656342962583818 , 757702747146927395 , 2189480375257771121 , 1816527465277679192 , 138815664117127512 , 1431350214961325326 , 1187978151676236367 , 1241806570983467832 , 1284450519130025998 , 1613889771871333389 , 1061608822774622375 , 381417471969594147 , 2180713817066758069 , 1573268990076834701 , 905173682016321866 , 1950470428221045886 , 295485711949393017 }, // x^2^555
{ 819753035519543635 , 538715919221404699 , 2219429537481971437 , 752393850271742164 , 77092035906327214 , 1114501521607776562 , 1781083659997559466 , 2154696941256077128 , 1218985834766672241 , 211616781192221457 , 216411965392177616 , 1670594910477530341 , 714505138692032780 , 2103941244229463221 , 2088317230298558512 , 1289168057502589286 , 1125637208200814412 }, // x^2^556
{ 1962227768978994180 , 1690314396114180321 , 375465114688955302 , 1798066679445937030 , 462818969271150710 , 1000261197673181741 , 449380920277416447 , 2291003141210787002 , 1295168501047080160 , 96762399469569918 , 673992173479089483 , 22635411461259319 , 690222719954237584 , 336145523606337534 , 934574030654348792 , 1843383288751365671 , 1895192556383603959 }, // x^2^557
{ 22617970229773822 , 1482887891197581503 , 190614907712811083 , 693572772014158846 , 2013130701640461017 , 2080394974487399438 , 1946114308346089259 , 990495636788197392 , 1782544219386492119 , 661191434765959775 , 2044311906562246966 , 1069940178504200830 , 1955224049483069684 , 2032802635089013840 , 1312150198687724551 , 1790320974584854699 , 1722451636719440405 }, // x^2^558
{ 844270734204704640 , 144569156478286025 , 458434355726727522 , 54107521005723860 , 1370238437704355388 , 635959790870056500 , 580190401330281055 , 1190738125435083361 , 1508034736034112394 , 384356207961213908 , 2225422022608450401 , 1307978291279169425 , 1836303719023016910 , 1688394455914172152 , 1145318805385872977 , 28214091532568837 , 2271521727551942534 }, // x^2^559
{ 707823463534947110 , 1322853985703915624 , 1283965375707685336 , 1235846354925013921 , 2241994185339373382 , 1492018342988994366 , 354756557339909458 , 2038382297798252220 , 1998256038116472547 , 1191608355457210551 , 431624398742182860 , 979989445521359703 , 1874604718333228361 , 863699730728041575 , 303002850561444625 , 351750811939826058 , 2086150517074464097 }, // x^2^560
{ 938650030581340927 , 1484495848437960060 , 906987191271901948 , 602861889366282296 , 829217328598139608 , 1170659179365524445 , 136537691170306827 , 2263710078069587303 , 1916941180571676310 , 601979432897153599 , 2075793575506860756 , 323119178978530887 , 7962577560787577 , 959899426480760280 , 465731965934497666 , 485390457639864074 , 182578072602393068 }, // x^2^561
{ 845056639071703739 , 2022501832369820141 , 1551830514420859659 , 712651911384419505 , 1901754482233053508 , 771255057924942569 , 1624974410054352307 , 1095555020243807180 , 48292506949982043 , 1924628272072369018 , 354506579070195883 , 2074354629523999876 , 481327135146565647 , 1980060303227111264 , 374025770449242754 , 2197437559867642882 , 1347989415958383967 }, // x^2^562
{ 2284531938332082408 , 2081446697857700129 , 407946796335100046 , 2284742117207953792 , 310471079731850760 , 1290351582175218317 , 356273760688651989 , 1910139122966702303 , 380631662657835885 , 2287374039009394440 , 485797501634087358 , 900166727954042323 , 1169554169155638307 , 1802101457472636718 , 474217730229244850 , 1004410789585399243 , 588639270649921383 }, // x^2^563
{ 1502830393741044692 , 502885788914291282 , 1000641636223469702 , 599101320428395707 , 2179406366865940840 , 358024368445093522 , 1564063948136384394 , 2159233836362830609 , 1080529492271670836 , 737489746809287059 , 779539060254650511 , 567680696243734902 , 803303944361973640 , 1778879099887965284 , 2245121666542231208 , 280989822576167540 , 2256030916132704537 }, // x^2^564
{ 1678854909602034917 , 1362544615060522442 , 1338371892984320209 , 1236016995662152262 , 2266586199968442015 , 1429545066557982811 , 1057272578263945968 , 1902362138019567296 , 2027249515853796780 , 1379458255463795129 , 715456741316196206 , 483096191538955481 , 562452275970679447 , 1899368762554121096 , 1095218941132187764 , 1182616069429316286 , 2041204243971349283 }, // x^2^565
{ 1470384206682188393 , 993056282930013636 , 2186884113482342484 , 1568683072711048719 , 2141576651319216540 , 1545634359639056795 , 1451267712100583056 , 583449252763690840 , 743076343569515666 , 880735478838481309 , 1139615309806234587 , 1405631565601779814 , 1162183658026694832 , 758880015783224342 , 186132385266916884 , 299496669995968613 , 2115484609912800200 }, // x^2^566
{ 2269185097674681740 , 368408303414772947 , 2272053720551708375 , 1632770988466577149 , 2005375285078385494 , 1280199055327212680 , 1821048605091132853 , 1567765420710739271 , 1887232479893207919 , 2230675230841783167 , 1361156385383252011 , 87414071150394174 , 611216773833872434 , 1860713875917257321 , 1409775498386462397 , 1690326679721511537 , 83275546754626406 }, // x^2^567
{ 790112276274407445 , 769228027816192054 , 2205289911751012082 , 696806322595942722 , 1027622205316503460 , 1843245508230762915 , 181348331184190272 , 1685443775553823790 , 765291022909566823 , 1159224061954534775 , 1753833798485424233 , 1131135065567349204 , 1004980355827594316 , 1518506610289278726 , 1077654190664918382 , 2049836184231549381 , 186534172155365157 }, // x^2^568
{ 2214978522047075314 , 1523958231722460737 , 940540633818853829 , 1502207690061290977 , 1973166365192858632 , 834167590580214713 , 193198187070116104 , 1200481096199012868 , 1045382432042256669 , 1043046955924667651 , 1764037894194441387 , 326214257353715662 , 847610851336013740 , 821380410810508534 , 118611704753506829 , 212870724809513245 , 1049669518188822039 }, // x^2^569
{ 1186686984731968114 , 492485282093702769 , 2084974668148141701 , 1954670681979820725 , 158025799762360442 , 1546024887967767275 , 321250855908273132 , 1839134851204623669 , 2276195450093740401 , 216550545714992720 , 1147405869335269365 , 1691809800568592195 , 92303605959988217 , 1444340652242832966 , 1276065726666195728 , 324774933653588943 , 1312430778251072843 }, // x^2^570
{ 1914401401876468669 , 1648868062260221854 , 1464059991570664252 , 875976384406088755 , 859422856357056602 , 1864309596721585546 , 516857141291982496 , 464095730580902783 , 934796258134400377 , 1817127289097008540 , 655971001935077689 , 680288930067826216 , 229080197392071732 , 921859076031383827 , 2242366335784005876 , 2231689867120356867 , 102494160827714957 }, // x^2^571
{ 1047877418576672693 , 850258032575291687 , 545055359259387307 , 939787324567586678 , 588678011951547088 , 397057856974487431 , 226066134643513040 , 2082177109290521202 , 866921181848612589 , 1377167370849823007 , 923546628885112186 , 1369468709683575581 , 163347741879505736 , 63898233712570047 , 1837149445977275412 , 81917523037053887 , 1724871657333737359 }, // x^2^572
{ 2302595391708576272 , 160985864775068781 , 764451814383377581 , 277491655221007957 , 2065357052112797123 , 2022995433719782905 , 1992649094929659709 , 534121146273082282 , 2156280075941140984 , 1374921692284132634 , 7490180772772763 , 724537764516397075 , 1458937057231627989 , 2128708058250265224 , 1343524011236415024 , 1632380201084339158 , 218723970886479505 }, // x^2^573
{ 2117760628529948776 , 2132935432038525560 , 768781595656590901 , 1400974401324013175 , 1245919916200029631 , 1432559837530198229 , 1163713351897028899 , 1923146399637847839 , 1213782762495170404 , 541538612171639467 , 1998922401826244596 , 1231856100509046580 , 579861832524317272 , 342657654818204433 , 1849901794740458260 , 2279916971309950571 , 760499761682595396 }, // x^2^574
{ 2133951096918945939 , 245427172150052114 , 981217690063201632 , 2240543031382098229 , 72038350069308602 , 597184866817343336 , 328644676877024543 , 183469578860761428 , 1484808128953021465 , 1223798115302938004 , 622162521478669994 , 1190522948279756621 , 1770221081272204495 , 300642277489993017 , 323299607262829861 , 1121130797903609296 , 1341151672362966624 }, // x^2^575
{ 978460885885818525 , 1015163128148908540 , 1977562332100546610 , 2245843532918136978 , 52755975506265961 , 105385627927894157 , 1072178687697178180 , 2189119972792037580 , 1846365892857759522 , 509344149142820345 , 1764914861664878049 , 1812095995141658018 , 972953132412161570 , 1195708733082367698 , 49856206632166450 , 1968416938611340445 , 2224505860268693924 }, // x^2^576
{ 327862488024780357 , 1457219179227842324 , 2230322439686492524 , 1014759634574897984 , 268418936182947756 , 1502956125465763704 , 61942509184664792 , 1760829907047336797 , 1772759420678440112 , 213631264477227981 , 1260050930099550098 , 1356809535018841668 , 2084415297676571737 , 392165946698433004 , 823317575518425201 , 1619251312183556482 , 1475671506190286260 }, // x^2^577
{ 1056862459352327285 , 650761739286013201 , 711866770850654745 , 995772669095949341 , 638628037366816307 , 319488467144926010 , 146863433379310830 , 1101916435400125848 , 1403815239053246876 , 1038453114803570080 , 467259301797897322 , 1758832454145478316 , 359553557196445664 , 1487375835680896666 , 76291938912745016 , 844090192831690228 , 793442078170731733 }, // x^2^578
{ 1952837235717320563 , 445430339419636400 , 122525557445898274 , 735595189125576324 , 1842210194389261500 , 1795223307042139024 , 751864575701713084 , 1119184159833325999 , 700766534388037595 , 393549636253210822 , 1662606888175396198 , 777088695141990512 , 1949046976963730503 , 659714914447882016 , 1701619511100158747 , 2106648518620441962 , 2230177471130012298 }, // x^2^579
{ 2242830595691081287 , 2153702821027923023 , 2056432480338738486 , 290410908425161907 , 1981631243730724167 , 1568909835655310667 , 1868498486537085636 , 443377197549410236 , 1989171328893245017 , 832914678880127633 , 122754022462592655 , 2074425172477633432 , 450810432342594695 , 1304742577811847983 , 1915105538864887632 , 398240897735172221 , 854257484180168406 }, // x^2^580
{ 2200340348805749851 , 459904691507133993 , 1398407253135138579 , 2223256024161740360 , 605045994980733172 , 1376873737656823533 , 2154922394517147235 , 1733951063198734927 , 972687456101926553 , 901838082782677970 , 786315965699770073 , 220890454000213916 , 1082354731585990169 , 1575625362271244736 , 1934345059883646897 , 610599809596399831 , 342994941095873735 }, // x^2^581
{ 135197059374104208 , 763606053289129943 , 1762314800446038038 , 1958652087897421237 , 1759073139864458242 , 777882068437388702 , 1929274536720142390 , 911476487406644691 , 2214565556314441473 , 52312220897893321 , 1846728531947717379 , 2200466005983704615 , 262302790665678959 , 2226903910074888712 , 2217869614731681025 , 56279709804267946 , 2290324007417928442 }, // x^2^582
{ 2033888752861355042 , 1032905065687727870 , 1228320602981295572 , 507759480115032778 , 2286473996360684281 , 2214758482416116553 , 1809366838165194032 , 1058372692666396235 , 1752374720633908247 , 783225856075389703 , 1873729037970411918 , 515708137390539649 , 1758253278936485521 , 2232321656689971091 , 54123739319322403 , 1645021409194515326 , 128999663975261693 }, // x^2^583
{ 1548696340275626821 , 1058994430734061174 , 975903143090188182 , 1753221425369032354 , 642770173718849415 , 72871801728857389 , 1532366481913853262 , 1685179220297983661 , 221740024932865141 , 572304397314497403 , 1337436598601163606 , 615711199196774965 , 1856428633974911262 , 2091160220746353073 , 1268041182491440797 , 1823672822413606168 , 85882960870940069 }, // x^2^584
{ 1596386067990045239 , 1082049082776347514 , 964167595689777765 , 2196584899289686937 , 1775478739112084197 , 668585706672723348 , 148931594902619061 , 1989674837193253753 , 548537612282770315 , 1196600058755599499 , 40994948219245722 , 585997221548702784 , 1852642327512527056 , 1962368180715517868 , 647388617327737622 , 1259769006990328711 , 760195312392461746 }, // x^2^585
{ 718683317139573302 , 320255468933257119 , 1602065008785819027 , 811539625884985377 , 473380658706433597 , 1912262500486946501 , 470045053505719659 , 2044632105828108925 , 1926951883673524133 , 2227261383404374216 , 486603446225142281 , 663210447975562680 , 939660586393225605 , 285150104962906352 , 1736759590302217217 , 1557356149606075095 , 202888193082920775 }, // x^2^586
{ 1704252131283387210 , 749862216125654467 , 1151691390735685357 , 1645735627001577084 , 1704474438618968650 , 748171802247682061 , 2192661098187053709 , 687285052039352483 , 854812886608086510 , 1254425642986060904 , 1755448133247766409 , 2011170119775364505 , 2238140979402216154 , 430682510031291698 , 1344094596771993123 , 1487316607310729340 , 572027053290063200 }, // x^2^587
{ 490145643447149312 , 139932608980010944 , 655464257025259880 , 394296759589777370 , 505632773723135101 , 1661411471151623719 , 2151487638856430824 , 1405022191175603197 , 1752924822934387289 , 540705285689857192 , 321557534615604425 , 357668350120260760 , 1216461776875955281 , 227959942379372288 , 1843268809411056088 , 1278964120834620296 , 1475031348508152943 }, // x^2^588
{ 77196441284986546 , 2116432279354126192 , 477307664737255679 , 2054284248076058866 , 1902595507518183399 , 892309383355817071 , 632707825296532637 , 2068144493364120654 , 2269464712931165434 , 1869550090717623995 , 1230295724219128689 , 265213902138950946 , 2035223329405422145 , 1942656580078323795 , 1193709919134967859 , 2129017786957860238 , 1381902932849007959 }, // x^2^589
{ 1250515786673063664 , 1170029995563455371 , 1875333685750981198 , 202301072852130868 , 2043478147118479243 , 1430654884019451218 , 1932432698651776626 , 906545901346634684 , 300667563272986237 , 1419422183404003464 , 1991379549654933852 , 647455449394880739 , 694191473419776108 , 276654368069638649 , 327518818778853777 , 776612031552014882 , 754333675021774044 }, // x^2^590
{ 1494337748978015003 , 2195753570178835409 , 1756395833112881603 , 1391513303657053978 , 1469720991718755668 , 1385546023774706695 , 2174495928889154879 , 1845916193012260560 , 1508599521784450080 , 1646177877887412686 , 1600214236327823295 , 481492506494972498 , 607939032270197735 , 1035787083329757142 , 1867038566495963823 , 1327899656420714797 , 120455193991568778 }, // x^2^591
{ 1272270033586499361 , 1355938084262029033 , 1130547642931602057 , 1571210037203668042 , 109838764087692662 , 665089929034619866 , 1477929841071085716 , 354404882207113353 , 485207799804145872 , 295271887824129191 , 1434571796278931709 , 1640884996563085247 , 349639709072954139 , 2048198598052923555 , 524893036895320686 , 2241615913147991183 , 1476041495950183974 }, // x^2^592
{ 1191478803597513079 , 179928617987606724 , 1893767020776627979 , 2279764014883753334 , 2000307147025567411 , 1317337023680470054 , 2103432586600253524 , 72635103884479033 , 2120393133065940248 , 630577942926446005 , 184690001576938472 , 724734720983686380 , 2222559033240707306 , 957823503700662442 , 1530455664164510916 , 1897774219578829063 , 1565275869726572277 }, // x^2^593
{ 802169516563427070 , 2266388954150660250 , 1016109430849964502 , 425155158957108184 , 1509177586061010059 , 735042889547641844 , 435841014763623437 , 552466077216086185 , 1380304476103110982 , 67287297735634201 , 447647206919187346 , 2068383112520459072 , 1700683878491979663 , 876911219219450197 , 1724440678224620967 , 2161646349907542457 , 1646103618347380320 }, // x^2^594
{ 612487302971671307 , 1375201488802854426 , 381927427343438951 , 522937542366715499 , 344542446499511062 , 2207818055791032517 , 1589757712162343309 , 800577551503529820 , 1901158862710281177 , 282526012842555873 , 978266672216571827 , 851384948740770681 , 1847198461333883874 , 1701120025203313330 , 1579726260607682225 , 425398491832428623 , 470525020962949424 }, // x^2^595
{ 2088490725567484178 , 485853289338907617 , 1031877816384950332 , 2204970857389602283 , 1742289513696508421 , 1887097317304814932 , 611739697091118719 , 620524462574164777 , 866744533296715680 , 113249287824674575 , 1094771911813698402 , 1113977650240159227 , 597674782116109822 , 745608676499086192 , 1626698293359327222 , 1428826314680818479 , 2215603110047911506 }, // x^2^596
{ 376585604887633526 , 1048922386135384477 , 2142424598885808255 , 675251024248975850 , 1545330669815065990 , 1857893574217764638 , 2048982207690498307 , 1533653988510679070 , 335130892749828677 , 104131490905494608 , 2194266840041437356 , 683616020969961024 , 2038987316895996656 , 917297429323765875 , 821082630191764403 , 1666057951671669384 , 1130032032943836952 }, // x^2^597
{ 1041829149523127110 , 1951902012535484719 , 2152661804693326326 , 1269908279296181874 , 971953632796866049 , 1266540697681616989 , 2071865642155459708 , 845692533418042777 , 1241457687074422224 , 161412923983560739 , 390632925491962906 , 353948016710720772 , 2026700469979616031 , 96483949026756707 , 1773219759585896547 , 993715984447404907 , 1829150519300709735 }, // x^2^598
{ 877798478622581516 , 942092329022409512 , 1965158005364305044 , 1441028099309753513 , 500071448451573682 , 1840680567469132321 , 1468971950339879193 , 1438547156759802726 , 549595496973813971 , 390734351826704403 , 1073287705054298510 , 48924576386470253 , 1989283157579117827 , 187450184005400512 , 1949224458829795298 , 1951496711030456157 , 2167858042677531808 }, // x^2^599
{ 1996597802411685974 , 114349701898949545 , 1084220018985830117 , 27462757590845683 , 1081095686730339174 , 2059987003957425282 , 1321806358033656174 , 1828830847664378831 , 1455949950124722259 , 477041639297859939 , 2295506231622178555 , 1152831764620264515 , 396805345192155178 , 2211812614000847756 , 1962229985869550296 , 848640427896833485 , 548986687197667440 }, // x^2^600
{ 491594119422354073 , 1742453895833966377 , 1525602929914324406 , 2076597071019376631 , 865550929971279566 , 997883929562138029 , 610577039659314246 , 1003718639233780963 , 1951174507028809908 , 1185710764340213666 , 1693015712372426191 , 317455835845832474 , 1848795541252464763 , 401332635199514101 , 224456822593358236 , 742409296289707819 , 2118807906613325507 }, // x^2^601
{ 1293009127273644989 , 1124274480353253667 , 1810129434176838306 , 259729045897854950 , 1468101939413453436 , 1111947300756487949 , 501989537109533070 , 1388491866061828170 , 1312270603637319867 , 1615629996017192524 , 2134426516814571448 , 548391958129447766 , 1852805539182613949 , 562903002408545356 , 1582149854427086182 , 1136405868045684314 , 679089614531440081 }, // x^2^602
{ 786115001012233217 , 572934901393961574 , 906662352794537253 , 1146052338661137694 , 1717117579480047687 , 2238979311119472866 , 1282072454711511764 , 913074328950615201 , 1508062462715721091 , 585179548016207318 , 2263240538685112497 , 212602680696443031 , 2286609014980268736 , 2160223566289961256 , 457719410118216561 , 892534882541613344 , 1802928045269113919 }, // x^2^603
{ 412244890005542545 , 882317329387396531 , 1194216517008066508 , 2113679728861695547 , 754826510247388584 , 143906396701128982 , 1624499088946075077 , 1517734354505524658 , 1319665375831884375 , 108068462219720639 , 2061550944874121143 , 1387192717449700004 , 1784206536018821508 , 1531349906234275665 , 37851629185782003 , 1964408593925350957 , 675543575437141874 }, // x^2^604
{ 2224871078409190905 , 1109593689354222314 , 2282026642284422235 , 1526142908234895159 , 1185903712917801891 , 2095637833179633450 , 1684061887934064807 , 1459637973270975973 , 2080524575243813761 , 948583036372588019 , 1196499685761340006 , 1838560132753716756 , 1035066941117701308 , 1633636158414982077 , 2082933534230116545 , 161677865488580416 , 936609732430805584 }, // x^2^605
{ 409257345609329461 , 1002655167281875678 , 18470199587775000 , 2184022032975947208 , 148234944683729763 , 2162572938835480438 , 1216127754790813623 , 1303762224282752882 , 2064136757082740176 , 518955562885803190 , 1212819681300030394 , 486562075491162613 , 1283290324562294532 , 285537074615846742 , 321224661976450451 , 2089560323722387545 , 238275251292120492 }, // x^2^606
{ 2214799429964260023 , 694747922604332887 , 312465276764308387 , 314561248153726635 , 1765153767754864756 , 1092506825381016367 , 1475330654269567868 , 1379961995474423138 , 1380037933141733384 , 767686246763038167 , 2008926192530430712 , 304944109134708306 , 261183406799178779 , 326684916374054817 , 1565573428651338229 , 1920871811367768904 , 2089282340964983664 }, // x^2^607
{ 1133198628406257078 , 977759521511265809 , 1677025924443289061 , 1729641585066757341 , 2008693257322528571 , 1421311051680525446 , 2030362323209952329 , 1921889928974731930 , 1093849407549420400 , 1836335521578497369 , 407868381069619222 , 10208083363410986 , 1550647306879485613 , 1032274398117330349 , 889271835949247699 , 508828554264478304 , 313811787637759042 }, // x^2^608
{ 265345699270236054 , 432199859212969150 , 874558322199992458 , 1131965915049654978 , 298519106167257998 , 10561017697598846 , 1036255447357471766 , 990617823928118898 , 183634792806558724 , 123066866696319933 , 1303845119890513396 , 1915539994626985074 , 2074006245341867746 , 442443726074289720 , 1398504520177556356 , 2177822133301482183 , 1618315631184181685 }, // x^2^609
{ 2281731104267965972 , 1565833165249376146 , 2084133230658243672 , 1466077014346623711 , 2100113102745347532 , 1509772133714278653 , 1072220688498313491 , 698970180110383152 , 1702069119117461364 , 786447122909266339 , 1700725262288581680 , 1201605067747742747 , 1285909410275446050 , 465944984489850383 , 1581258227975449663 , 1468892983675794809 , 698369184018114847 }, // x^2^610
{ 721614432883106726 , 1168570529527401436 , 1558741633956623588 , 625821206916677993 , 1729484582639558993 , 202818544256349027 , 942584755749892262 , 384853745237896372 , 1878778990418394018 , 2006136039057883787 , 2000492489726132701 , 1628427185964600209 , 456608645446900334 , 559232459658214239 , 1425457030239632449 , 287429815653732691 , 1537646113987862352 }, // x^2^611
{ 168932144896498705 , 1584765261048819233 , 505170343346470483 , 1661727371938733976 , 58225995502531476 , 1069662977595621678 , 1534921440358104004 , 1665430445118051718 , 1421063952495178964 , 1964407550412120431 , 271153105959670492 , 1303954744475330405 , 1402417619008570585 , 2067748336717081462 , 635378162740815380 , 1966388298672109925 , 2276135507117268900 }, // x^2^612
{ 209516738545946051 , 126364818200849051 , 1934171883678238548 , 964383175854976730 , 1426910927989095855 , 1225737711393069252 , 545817142750996161 , 1941470598322211846 , 1888603351110522964 , 1693849545801590503 , 1145960696683862080 , 1544154409134561092 , 2057079562609173728 , 333449282037994372 , 2138527354092198252 , 1857839034788608299 , 96149649256385712 }, // x^2^613
{ 1680829537551411728 , 2134567358027244766 , 2233241443836144884 , 882397883456946081 , 1272913220199061746 , 7737651019535212 , 554065101789910033 , 1237958145783195446 , 1349598693130928045 , 1212195573003581110 , 1392362203075907328 , 913027022784782751 , 411026031675105306 , 872967435734543202 , 294712992119516029 , 272260211295161762 , 1636719289988127499 }, // x^2^614
{ 1664102028071512887 , 1120090114167125698 , 678215188753805783 , 2138907996085142066 , 1721907479145867302 , 1086048121088426493 , 282597371457515207 , 2252562071097166874 , 880501568810700587 , 1513947683103494818 , 118765667707656670 , 133926112036721838 , 567919878484948061 , 79410381524546935 , 1454226739666450321 , 1554107108291191805 , 1442417286842488623 }, // x^2^615
{ 1332050352400493680 , 1321101334747797025 , 124286076382368784 , 2016174712781756901 , 1731820299459346863 , 545006347537545995 , 1068874777126444609 , 767902913608305873 , 2267594054719694251 , 1590335123866293983 , 868156357394677648 , 2249143243430804218 , 347528411881171670 , 1754162230470399965 , 2070435897818234391 , 1115080034382184583 , 727133352156610422 }, // x^2^616
{ 355843900790907311 , 363191259548386230 , 1247995738147301243 , 1637822561418229980 , 2161312386590710193 , 827479641142168242 , 551490280055656820 , 116433208177525158 , 219743626260276428 , 1031342298455165770 , 956941458946607562 , 1971095287608216767 , 1197895453910374577 , 758722071093994752 , 777125942555276007 , 1415023106509593626 , 318953060159670820 }, // x^2^617
{ 2116009462654498660 , 816261448355929278 , 2272633719403001435 , 573255612065573253 , 968141095699581750 , 1763511366639175689 , 1173137617258455966 , 481749672060198864 , 750918552038818940 , 519539565364235474 , 1926446971667744959 , 313336000413603815 , 515893570456318246 , 1497339799087374476 , 478287049521531475 , 1236625257683288385 , 359335556903155074 }, // x^2^618
{ 284411256262633501 , 1789336543617378723 , 1511246373802383265 , 937616018328420337 , 138227234082520224 , 1667286674451103850 , 693601919163926025 , 13505785652584434 , 720941360686097746 , 958299499540120680 , 2165799682030822154 , 569950597702024056 , 655621404198221825 , 1755168971312171278 , 2043596507506252973 , 723457099999134940 , 542348768717201728 }, // x^2^619
{ 14465848372683520 , 998603764202551247 , 724938950471219595 , 325209651844259777 , 821482747183096187 , 2233461975545399202 , 1931346739821426382 , 2293325179294131554 , 243302969523090162 , 1510343779638164774 , 959965695881709576 , 1831708054543131034 , 883847853251423712 , 1165812877635303160 , 2007671568816070608 , 44906786919162811 , 1277515245984716365 }, // x^2^620
{ 631454168243258384 , 1518494517880443027 , 2287322260213126417 , 73685056254736833 , 942598569327822559 , 1532992770144658039 , 2229403027115926821 , 842743413258963958 , 1865437000699847820 , 369346269649870812 , 1254468168457467223 , 559290945795297932 , 1457535932113599162 , 1926542806880420086 , 437581909774872900 , 1002726378631501533 , 182139319307728305 }, // x^2^621
{ 1539785164984779758 , 2045565025200148915 , 120085588989386291 , 1851688824536244542 , 1980194980609785714 , 1768302648237998273 , 937420755919973678 , 2210791368804399387 , 328708870574712683 , 1007467584698506438 , 928652866696652949 , 2228808519508067530 , 1642940388306822455 , 1618552641970232946 , 108597732587521580 , 1988412225258659433 , 1660448156453751001 }, // x^2^622
{ 131526482323749840 , 503434317381483751 , 1560765838807596555 , 1027232124412255852 , 654779282895217397 , 2273302731188942421 , 1551720915692515402 , 1826828338382462468 , 604485879763220723 , 1057737165588422306 , 106531819221246981 , 425783162197347937 , 489984741847314768 , 523779814301405487 , 1865105780134618992 , 1677103130386412459 , 318671848522267610 }, // x^2^623
{ 1639089103549084783 , 2260330277551218496 , 754892153485552977 , 2047710903557972804 , 2229320667962732246 , 307697180850646681 , 423771572510991367 , 17754501861697173 , 1238910344976760345 , 339140894113319789 , 1445828176546996833 , 2042997377381022070 , 2207437390435628445 , 551144982338719121 , 384944764939825909 , 1474198471229196249 , 1659242296891127810 }, // x^2^624
{ 795309147716951006 , 1452711178054134843 , 1664782861363981358 , 1006405310566793269 , 971226122955741921 , 752466486101956684 , 1168643572163743942 , 1369730711422397346 , 627654132922219702 , 2104230754718381006 , 1588968809641801416 , 440238626377162178 , 732134947635506053 , 1160506871469695759 , 395151165185992129 , 957703098223865589 , 1844022625316455575 }, // x^2^625
{ 1964890520513046164 , 829237203674997277 , 1045128031232022678 , 930832386865989645 , 501678256081635892 , 917829023495631073 , 881831635034313098 , 394230956869842550 , 71895808688446751 , 1874849501133161758 , 645524260474403693 , 301748792077270066 , 1063834409487547589 , 521966335959428443 , 735272076777014321 , 753999758410424987 , 292792781171616060 }, // x^2^626
{ 1976769506118304887 , 328773719961068411 , 538585052711106822 , 2240145575420715174 , 1291008337036982313 , 1034350880207773432 , 1888353090737342761 , 1978548213503129609 , 743903982747501766 , 2240529593386457105 , 229308641102639039 , 1678061221588734337 , 1248567483083113072 , 1768596733943584627 , 1268676342298500384 , 216631313378191648 , 1830565281699080858 }, // x^2^627
{ 222335339024805767 , 146026382943095887 , 1745991091656491682 , 364572344137903996 , 491711339269051713 , 1355802228883764600 , 2287182613212117809 , 1628584733201147266 , 1730760626189599809 , 1568968802576521126 , 311144633575093285 , 1257985237943883059 , 2071814648333720000 , 687885153740420654 , 134464058021476074 , 1159135545218675174 , 1046016356313666266 }, // x^2^628
{ 2218238585802550263 , 1796073488881922547 , 108147160614248440 , 2147497677742828723 , 940377749228338777 , 166702239352185028 , 14837186174842935 , 1881782378259233528 , 442792017566957734 , 1550966771279227259 , 1902483003501989215 , 660158154476503000 , 673105302791153020 , 749237522153030898 , 904762939332248683 , 1085180116177134000 , 32410680807805190 }, // x^2^629
{ 1565357784323540059 , 2004567400386087250 , 563556471193393347 , 2176504294263508416 , 1354931238262729258 , 1868302215996805633 , 1039100426489789297 , 540592058162156675 , 2043699722662531658 , 1444431990121166178 , 931232743518887886 , 2055389098129788451 , 1235540167366576898 , 1090861860232324736 , 1732281293507875925 , 1285969498415451875 , 1757636524168521125 }, // x^2^630
{ 2235287391127506303 , 1401636021589024058 , 2051095569701746947 , 644542369524563085 , 1717409066688580033 , 839878318363782234 , 964338104498650467 , 193111125860611415 , 41226228181058700 , 659802192172642300 , 481644033258717967 , 1649597320109931775 , 1169882823869469374 , 2274302558105332483 , 318951044439334783 , 1790653470898866515 , 1273274762300650850 }, // x^2^631
{ 300315997535491308 , 2172766343039137706 , 1640387745692897945 , 1527918068635484048 , 882433389130238556 , 519571876740982088 , 840810181955840317 , 967721991925117462 , 757987265005423150 , 692837321139327525 , 1347675233763916865 , 1262263002781039893 , 366275012213686434 , 1720518743710286974 , 788123176573078844 , 118677909193430055 , 331168466283501375 }, // x^2^632
{ 2204724021283944336 , 614667311623152683 , 1844295995732490949 , 810904822281747865 , 1057803411491878257 , 2192784617269518738 , 525328525709235908 , 1625675926696707314 , 2219520795837515346 , 1111578739349697071 , 850264822465802254 , 1875225445537474991 , 447934460789202298 , 1577693216054964532 , 2069208581718856575 , 1844971513814599533 , 1100047974003437056 }, // x^2^633
{ 212063919658939349 , 1955050766498331130 , 1016643445611085361 , 310923000117302398 , 1108559594383531725 , 1574096462279058604 , 2058721019806527059 , 1495555971494333315 , 1290148625133033915 , 1726857770258998357 , 839176472902748525 , 1938011636448040623 , 1509176691584187835 , 1684996881754410913 , 339436873350779373 , 1476161426144378753 , 1443502235558451143 }, // x^2^634
{ 2154146131717687018 , 1161290317713326050 , 362912384144320809 , 1110332862415808487 , 716729690755657231 , 1048283751964241153 , 1336749180461386759 , 2280348028206541371 , 1259918326978354156 , 1980538993489881425 , 1333565492277683625 , 514625871678292821 , 1173265787958600132 , 569893472219264300 , 812175666077334991 , 1255701238860433930 , 79993120593823961 }, // x^2^635
{ 409217992666385378 , 728224420299246128 , 1959936179576785895 , 1444295307550571182 , 998063979246407739 , 554682441648959407 , 2073233365208088525 , 1349861235690939694 , 1097281043663983707 , 1649731108960027223 , 2214398868943408274 , 1449553717147663103 , 2196500661345051527 , 2171871885380914429 , 491427195052411299 , 470657045051378516 , 554494320060727622 }, // x^2^636
{ 2211653713656632985 , 1473087100459732074 , 345838890415354412 , 1445623252958685565 , 1041419654691395738 , 2188283266242968331 , 1417777133392604784 , 1154814074996216406 , 1442989098963226134 , 901383116742510681 , 497212216058355345 , 999731586376214828 , 817831951035275271 , 159325628653133022 , 120914548489015393 , 1449314802372642427 , 471104110110980884 }, // x^2^637
{ 323038291515073224 , 265070044955668299 , 1053676807411822176 , 2247226908652601286 , 2083016828474103062 , 273234004102527575 , 11857926472424922 , 2055314572998661967 , 311921811886787132 , 1870415531374949840 , 21265502209057804 , 678112836970959466 , 926490438737525589 , 2027644346888215584 , 495557988374717777 , 1817993454480752541 , 2141242677896973878 }, // x^2^638
{ 1445163042542523231 , 1767410038768111356 , 462427149761798838 , 1007504177155879483 , 1181224656949316486 , 357022206754812124 , 1898271363493710619 , 1339720449183752193 , 883758224923786172 , 36020177946849132 , 461791639260431974 , 1411405712850290498 , 701758173778161093 , 1222887871945629218 , 1174213062638935911 , 326342461405188581 , 2211032895429848005 } // x^2^639
};
@@ -0,0 +1,290 @@
// $Id:$
// -*- C++ -*-
//
// -----------------------------------------------------------------------
// MixMax Matrix PseudoRandom Number Generator
// --- MixMax ---
// -----------------------------------------------------------------------
//
// The code is being released under GNU Lesser General Public License v3
//
// Generator described in
// N.Z.Akopov, G.K.Savvidy and N.G.Ter-Arutyunian, Matrix Generator of Pseudorandom Numbers,
// J.Comput.Phys. 97, 573 (1991);
// Preprint EPI-867(18)-86, Yerevan Jun.1986;
//
// and
//
// K.Savvidy
// The MIXMAX random number generator
// Comp. Phys. Commun. (2015)
// http://dx.doi.org/10.1016/j.cpc.2015.06.003
//
// -----------------------------------------------------------------------
/*
skipping matrix for N=8
three-parameter generator with m=2^53+1, s=0
*/
{
{ 788472011673754725 , 504392931461020386 , 2277048297991722020 , 536676515745497838 , 2196712233851697653 , 1212351258795831170 , 1507724523659869703 , 1373203865901861126 }, // x^2^256
{ 301950581079941521 , 942161077174856340 , 1709924881683456502 , 1236895465336323765 , 784131775911916825 , 2171381504524099377 , 69364380913386671 , 440003703207898788 }, // x^2^257
{ 1061315900878560816 , 1873403375992171499 , 1313963976151500367 , 2158461035133408282 , 354177604645659842 , 2201500956310676057 , 1511283231369593517 , 1710537319719334784 }, // x^2^258
{ 484634636820034254 , 1735343306326130046 , 1042617204208658777 , 1315652757806699188 , 1735818965585088031 , 1218025205131984512 , 263142304553001512 , 470504461483486782 }, // x^2^259
{ 105094898054487103 , 1166179934879398052 , 549478403625968529 , 1839539169546034080 , 1238452887272042100 , 1236596576663976697 , 1445126777176767961 , 2149640439599954656 }, // x^2^260
{ 343142614350713751 , 314395841028641361 , 407305795294142756 , 2102588657158640086 , 1994177381383943068 , 2026167339952671947 , 2178141325038374546 , 816875395538941274 }, // x^2^261
{ 11587422315470295 , 1312588512564319541 , 386403590131898615 , 2145406743745439617 , 1066349240680408615 , 2267309013399165408 , 791234776596952162 , 792589579928653197 }, // x^2^262
{ 777479078927516621 , 2203518127143989694 , 2196028283463958179 , 200338838404288377 , 1213770307665192822 , 1525788853799045841 , 2089490761795261036 , 942136585769864863 }, // x^2^263
{ 570706406354035563 , 2069840619049671673 , 1886681621518635595 , 2121926485976227427 , 1554412311824497337 , 1342861213369742264 , 2012088082383689899 , 1300501896141952283 }, // x^2^264
{ 1903360804461297810 , 2288340228194315933 , 1079326604544951471 , 2237448347695899 , 2181324518584330084 , 2140280266535186444 , 542417656612271251 , 573440772770857084 }, // x^2^265
{ 1932841970917172987 , 1827771334219024229 , 454668085749693980 , 1998014804297211539 , 159341797328455925 , 1783493636111498748 , 954150855658202309 , 381412810337890295 }, // x^2^266
{ 690155801527911916 , 1761888270497854982 , 95587394727764982 , 1069365478727371590 , 1408585825863833738 , 1043990648653252601 , 1320248147790458921 , 779190308039445494 }, // x^2^267
{ 683509593562709824 , 1042236153556730011 , 1587675433555744236 , 482064858701518015 , 774759967285602519 , 448550294595192330 , 928869768505175149 , 1532427718805330034 }, // x^2^268
{ 370477751932396939 , 840371969475102457 , 994994557979311450 , 2044481694457093504 , 1510082883968755944 , 561017964992626678 , 702590751919484542 , 1880405961758167320 }, // x^2^269
{ 727158450027905164 , 2085743032321553455 , 321803657954407027 , 1227721296924315855 , 1598689912706975699 , 352206360942618355 , 552632372036414045 , 2177787719418349861 }, // x^2^270
{ 1253745299122668947 , 637906236313436366 , 222120991912088984 , 503164359327056698 , 388027580368455654 , 949760161306465252 , 1617219323354638383 , 843651904641103555 }, // x^2^271
{ 1923911694993693089 , 560226400853857945 , 1936701492307784124 , 1748199052509055462 , 33957820815929422 , 1810345236831329961 , 858456818903359817 , 2118432073451085614 }, // x^2^272
{ 626738496840044047 , 617765167241145410 , 19237994901216891 , 685278562362866025 , 2264701957644881648 , 106101523936561452 , 521258113601299909 , 68254162052654336 }, // x^2^273
{ 1781946046930871721 , 770624478957889713 , 845947492851430452 , 2034770066802226795 , 200233197609134431 , 1452052310627261890 , 199322096220977015 , 1585248688520308006 }, // x^2^274
{ 2002476361393000438 , 1271556603469238878 , 1393993756892785163 , 4467157228062902 , 685060284083312779 , 233186243817914320 , 660587782107231470 , 1822548750327614516 }, // x^2^275
{ 2108244183316339465 , 582727018062128117 , 2085162998220028720 , 563349165385645425 , 669238301542279562 , 1954694382853125018 , 715522867478393688 , 702379801834299277 }, // x^2^276
{ 782068661175253984 , 1109041687542966454 , 1810187125967748368 , 365523157605568924 , 1990092834746784634 , 257393889886211077 , 1326087677690717750 , 1230899109047220834 }, // x^2^277
{ 1536503690895567083 , 504143623332155859 , 524236954269530256 , 462032826384579955 , 2005260516806561034 , 2248121905556192570 , 268671724442147378 , 473383641184363051 }, // x^2^278
{ 834444130431663841 , 744266152109888825 , 590933780561931722 , 1291338777345533204 , 2035011573923734843 , 317501560173085699 , 954895309600585114 , 672499611839848105 }, // x^2^279
{ 837016868976810410 , 839274742387313221 , 780259767852426704 , 1994532761732194548 , 1557969934292207103 , 1231730779027967583 , 912163657464699324 , 475287422407563577 }, // x^2^280
{ 1022880011619604803 , 1459303712499474246 , 816446646841872490 , 1773668771889012570 , 282893474599583284 , 1757089265824882286 , 2132893624529371192 , 1869074345988119025 }, // x^2^281
{ 672306820748123999 , 1395780953839561442 , 1973553681028597819 , 386750240478406131 , 105333081837134537 , 954943652501253988 , 558292504172958569 , 813031505616666431 }, // x^2^282
{ 1339661765865469731 , 1464906065206800824 , 1377143956763059459 , 1296294227285817348 , 26783747229133309 , 15123831758228789 , 1062933074617758702 , 1657039368069105353 }, // x^2^283
{ 1027660519995542204 , 1907446071754164500 , 2178640900219028509 , 2174887705519370029 , 2225206340524580963 , 1050436021061817550 , 769010530701912591 , 69450695637452962 }, // x^2^284
{ 1167579235557417927 , 1004551306610441640 , 2157449925047146098 , 440600533910314509 , 742991741006729837 , 418125732478183320 , 1363614321347923904 , 300078070845461992 }, // x^2^285
{ 2049601951722475133 , 133005337847029238 , 304186971272273025 , 2139661323049973724 , 1770237527238983271 , 699618988239135275 , 1001397389017988899 , 1483706709771154393 }, // x^2^286
{ 1569513252219367166 , 1916994012060755629 , 339273280325758544 , 2277665683914515509 , 1604342142068802990 , 1942422166106754341 , 1107593061812383796 , 1634435832337837414 }, // x^2^287
{ 210706878669676227 , 635175214043284086 , 776917991235898803 , 356281689287799394 , 1425905093387722203 , 1857750059153498584 , 1392947404314050147 , 2182961550597679862 }, // x^2^288
{ 1199005391983043471 , 404472206821238006 , 666238670132343789 , 1481356723241855267 , 1231496648796143372 , 1838219270583231503 , 1521036124956777126 , 84337266428046576 }, // x^2^289
{ 1830555445836500332 , 812428396167972179 , 568755150627175700 , 49966429017936543 , 2049600540457279099 , 1268317544880075939 , 777599317727164935 , 1183780428364360568 }, // x^2^290
{ 1133458770227416151 , 1844398892304992046 , 970929079461602910 , 1662108249215799052 , 478828629658121173 , 1538495058922000417 , 1311906645728583872 , 51769387915209644 }, // x^2^291
{ 369578230448236233 , 782029836481090454 , 144995705299552657 , 1524199868270218670 , 488217669629577701 , 1587119896596386118 , 1425190565259289630 , 826359071168357659 }, // x^2^292
{ 2019136696728127016 , 1048649148810883230 , 2004749949593011938 , 810942544842237741 , 1213043404158359968 , 1342796069439195349 , 369708213807778039 , 1472748220298669363 }, // x^2^293
{ 2177083798302496430 , 1503796256140782680 , 2238358145333550683 , 203593728399275042 , 205703753929364380 , 1681042914305437288 , 2062242024433876039 , 293501595822231643 }, // x^2^294
{ 89846022262964187 , 881926222753186517 , 406877599522224183 , 634246809320589194 , 1870825586685077630 , 462019898379233272 , 1933051117396846356 , 1449023606237867375 }, // x^2^295
{ 3446696032160400 , 1161864821806539589 , 964808837353475954 , 546939397855790115 , 907722459758190488 , 962757726761320470 , 1285815466625699166 , 1528430426485367847 }, // x^2^296
{ 1100535663455617606 , 151561917972605849 , 1430340534255315618 , 602378195013145983 , 1526020505064407654 , 433642186903420258 , 1458426016194621281 , 369997457324993082 }, // x^2^297
{ 1044572281354841124 , 609487167355401921 , 715055404894913111 , 1805515509832322624 , 789834738390336644 , 1383034007732524099 , 1496613287887401152 , 886019072466742632 }, // x^2^298
{ 37819714311792148 , 2054786481407342613 , 1914956661080594693 , 1940497164481456358 , 965922306316775730 , 1631436093620104150 , 1713873682350301249 , 1391415491535867529 }, // x^2^299
{ 708495849912990857 , 571708336170966345 , 1880327619849146079 , 1448148826196249782 , 124570492848568181 , 597347942522208170 , 420222381745859474 , 560583396340484075 }, // x^2^300
{ 1550963433810696679 , 145069277966935686 , 1629339925940844247 , 1780563188637252160 , 1106128532322376946 , 231652147891733394 , 2011173486555346539 , 1555515926748290067 }, // x^2^301
{ 635364520808647345 , 1458100457503478471 , 1155792098374175261 , 1202746080177125263 , 399756859533527955 , 518256347279472300 , 1596495908865940726 , 155073836698060827 }, // x^2^302
{ 625845535448002256 , 1103868466048792762 , 4774591603328801 , 2070705472073003365 , 1154377422221763402 , 1282202665473504057 , 554731256752231813 , 1227474830096266635 }, // x^2^303
{ 876744482754218306 , 868276539506925197 , 829864219155081038 , 1969171369611387053 , 1945617946829525712 , 1840299847054821149 , 2293590501601180619 , 886202450232538758 }, // x^2^304
{ 1002658805586069749 , 1951318244588682007 , 315126823664272784 , 1280030551904844190 , 775240578777000869 , 1684343105437572569 , 978506963215340432 , 637650574693518384 }, // x^2^305
{ 979432457956603999 , 1260530652983115482 , 1946701112549761554 , 131010500956804676 , 1506696341331438266 , 746823145128473385 , 1656790250637014085 , 324268558051174183 }, // x^2^306
{ 351151469113138787 , 140308302629015561 , 2137383103334280244 , 1728659755380072682 , 962199643632040481 , 1197298249640415717 , 1038738309744980027 , 665933806758430945 }, // x^2^307
{ 567872053582786618 , 576583701704935966 , 400190914689144093 , 1000114246576758781 , 59658785149987502 , 1876321531663714521 , 587071714224144245 , 1570961360266607321 }, // x^2^308
{ 1880794593726127948 , 1472822173003515236 , 39394489282919262 , 1797956414062729466 , 2022248583473828177 , 1034142978823269584 , 475319275026578831 , 268560799076533340 }, // x^2^309
{ 428959846958695691 , 873827817733352275 , 967974244628146114 , 379757671514435698 , 1657453105703951272 , 1178249096746908050 , 1544833596922417858 , 1226728701647851869 }, // x^2^310
{ 749115335594391473 , 165990191250191116 , 638293485960375803 , 1485793551339244846 , 326395651213318577 , 1241228968737542153 , 1306590561651809509 , 1262671243044191015 }, // x^2^311
{ 2237497971177297230 , 925843085457910427 , 1372168680037608587 , 1729925345006977623 , 1157872351743549918 , 205312857472775018 , 1397050525145413726 , 1791160569977470168 }, // x^2^312
{ 2235240444070219979 , 443212627747770631 , 642911254630239763 , 537775576672600532 , 619783443718011281 , 1451065064137832426 , 2040184580267611651 , 1939863716465189591 }, // x^2^313
{ 908678705050933036 , 1591242364863898049 , 1834632839234433882 , 358861541042313179 , 1602792196645577517 , 621809784014233788 , 220157875365495388 , 136872972425544411 }, // x^2^314
{ 1230849990991258203 , 423652695451705646 , 769617740673346473 , 859717384814713761 , 1223733192958349783 , 929363982417419596 , 2263094111123397933 , 1854443195695139601 }, // x^2^315
{ 1156893085045594838 , 1388783712000510730 , 2088112935468358575 , 545336826223343096 , 1439034209581278105 , 279801622808440468 , 2152771379742047648 , 207221331995086342 }, // x^2^316
{ 1498402897145517819 , 1941267259059958728 , 270365707143490596 , 1212566654420311341 , 993382973533279627 , 1448525898637405197 , 1225148411247171749 , 211486664223965307 }, // x^2^317
{ 86088540808859243 , 1194375216919362501 , 2081057485419999651 , 2103299876302453116 , 152425588435974314 , 701667713217197173 , 1048555768172131473 , 2103277142094652231 }, // x^2^318
{ 1855356366424952210 , 1081691332597436464 , 609941249894072913 , 986792017441346181 , 289373896438088252 , 470376658545800600 , 1117375579392367641 , 1935625758340632926 }, // x^2^319
{ 1170050089957867933 , 1308686772456869298 , 1674906313765571608 , 1464326731050173676 , 40497119027202016 , 1442593023742107967 , 1100942177931282831 , 1460024199156889536 }, // x^2^320
{ 1593324372635135333 , 1751124220276161674 , 1921835203354336412 , 1237664643534502483 , 1322103835966951187 , 1658312460368229755 , 1537664227157675781 , 498445623124875660 }, // x^2^321
{ 1515927140763007881 , 627289680129171564 , 329969347928093767 , 1226876755200911016 , 1125252537457916397 , 2263913901441709448 , 1854011590937779238 , 1470923382375387346 }, // x^2^322
{ 1667320094812495012 , 1385101183505454386 , 1781137568039538835 , 282896000930313637 , 254449706969779138 , 232195004974727664 , 788129385157539908 , 173640545296296723 }, // x^2^323
{ 1025935590673211777 , 1068021612873242937 , 756075084827465992 , 2053699902553183422 , 1878574338078405571 , 1784483770701900383 , 24423148530270471 , 1417344168788009387 }, // x^2^324
{ 1153801351773457887 , 1845544577903742230 , 297727241144859813 , 176755814742023357 , 431437456411004018 , 1577170582795022613 , 242927191126292217 , 649002295735752568 }, // x^2^325
{ 1687195288663497941 , 490947911518336100 , 344530515134218494 , 735620802136881566 , 1858626666800894353 , 517616270162278233 , 1187831803267794970 , 802344586470548574 }, // x^2^326
{ 591761506437429396 , 2284919856729957422 , 2062745832552913508 , 599245274943010194 , 214355454017472712 , 2288175073561083074 , 1914975698503949054 , 2246689342887056995 }, // x^2^327
{ 118006265548731945 , 58024496342916194 , 1173948173914037831 , 1459672590572365387 , 8106269035442777 , 65489039967941369 , 2154450358757882263 , 13667171181254595 }, // x^2^328
{ 178732043725977272 , 781254935208702311 , 1340396333474937182 , 1236603092600645616 , 2141079809370338796 , 208963248081834137 , 146915832059980380 , 1004968557515270642 }, // x^2^329
{ 1714938032014376334 , 34911693439117236 , 461917198749199349 , 882725469526879881 , 2098359896663840801 , 1036165144151865703 , 589532674986917988 , 479021353453889568 }, // x^2^330
{ 1285279925438585209 , 918083833538130378 , 444198560296576474 , 2159929925104625787 , 1728442166996200907 , 1267351811392324441 , 300065718623418119 , 966750349179313465 }, // x^2^331
{ 691725965600999810 , 1198903862620854377 , 1054023539523064816 , 1730769030252351567 , 847557927746600260 , 1744623726004990111 , 1728028892131548567 , 1527543417026037449 }, // x^2^332
{ 409421278860982988 , 997152943070286925 , 20113035122389204 , 2124073936359239181 , 689641531534285085 , 837955831482216973 , 764871009458889678 , 237477127484895051 }, // x^2^333
{ 1982954613247518948 , 402525052522767365 , 933337358422926678 , 493080854378288479 , 440525440695315742 , 403003028386149431 , 697670125655367094 , 170964525981186562 }, // x^2^334
{ 529398608714192567 , 596163766759723405 , 1693861938709526376 , 1944585668867654756 , 1812682954769967560 , 60767399965245612 , 815166115962344167 , 563969885916290380 }, // x^2^335
{ 1031187372526524708 , 1180625910437919643 , 2265520763828990194 , 734290616121570989 , 1798360203053677331 , 513918809740571316 , 1111845956351982313 , 496292905109351318 }, // x^2^336
{ 597139642668139236 , 602335229477270350 , 2026181378829117602 , 346834015572578793 , 1160789964134140335 , 1301839414607152236 , 2023907284977916784 , 212348413306575710 }, // x^2^337
{ 1345655855818044387 , 2034440074737180979 , 1853737556174568843 , 239876295577697304 , 410191818934605386 , 1057480181623603096 , 751583228751027774 , 2164161283235078589 }, // x^2^338
{ 782916240087880616 , 632461621735433608 , 554302637570851993 , 646827976196586488 , 984936791191038328 , 189101705843674879 , 1231562930684236637 , 1297866436871439442 }, // x^2^339
{ 542729751238409888 , 114743443058483761 , 446923874175439190 , 1784413303031332267 , 2155207668460791239 , 1216793859143235269 , 755758137527846441 , 1113251030217301689 }, // x^2^340
{ 1974252091627510392 , 969837876315426579 , 1166645537845176077 , 58837961050277390 , 2215039252761715644 , 1792388646719314587 , 931827086005293683 , 2052759443345265748 }, // x^2^341
{ 1957672635879634849 , 157850341324012958 , 1996189225711295944 , 770677230845634472 , 685295457133592675 , 990906427152295805 , 1489773162377938460 , 1493792842242691854 }, // x^2^342
{ 335178352541380841 , 2080753030175535839 , 1980993384319476437 , 1922341725340555314 , 1801854611701891525 , 1050636885479441377 , 1139320506336756471 , 1807421491907884501 }, // x^2^343
{ 1410693392538517153 , 1734510559237669829 , 635977723417359771 , 117417534576330953 , 581949335702342201 , 921443320968790464 , 2013382175921627265 , 418068097259388303 }, // x^2^344
{ 2006799017678649179 , 291508748634401467 , 1575246852841118587 , 1296651463173792894 , 427683393014212471 , 1730251205926493162 , 1142975105007871390 , 654616289055181196 }, // x^2^345
{ 1310482812890598840 , 1568271209316293982 , 1910822376851082511 , 145332006035575243 , 2083641620344128542 , 305641243824259155 , 931699357032097273 , 1358163282973807602 }, // x^2^346
{ 203591671914458344 , 150640315994823731 , 1210104001019263804 , 1137617598292666595 , 518788118161161048 , 427427087034864633 , 2267425996942054624 , 1099166158796073922 }, // x^2^347
{ 1862849125627532663 , 848558785635718635 , 393472121514472078 , 1503946637617229192 , 251773912133193647 , 1537276995784412057 , 97807326675627886 , 220480179290806390 }, // x^2^348
{ 2030722849231430296 , 925386852951109106 , 2258493939731347427 , 325355008890701175 , 2211934110935234304 , 2100695251205789805 , 79792526001013458 , 2016383789830271786 }, // x^2^349
{ 1673355124255496233 , 605829622903505464 , 1228542874099034520 , 1015802631014783927 , 1733494931859994227 , 1788838665983109057 , 1983390263525924139 , 1279621456293354913 }, // x^2^350
{ 375355249010406023 , 2226360444545513540 , 1601485935029158854 , 775307048261886844 , 1575230599988169482 , 507568577394075327 , 472550439018554047 , 1573416880779995280 }, // x^2^351
{ 1793604322340719497 , 900876283313101202 , 1106634015704688071 , 623388134442470073 , 756750847034786579 , 472358887721577332 , 240998031138313601 , 1212381458468059241 }, // x^2^352
{ 1048596494083818008 , 45192207447474877 , 1764953537532898171 , 583469345207475545 , 868521831479355323 , 1712689121558799082 , 2098493070064932090 , 11903476140390649 }, // x^2^353
{ 1334367269847445617 , 1032625389531499584 , 1346355460833246464 , 1341223378415525065 , 1652514590227965141 , 853738600007198831 , 622763044225564546 , 751613101459281337 }, // x^2^354
{ 1346536569485232478 , 619157040998454361 , 341775769765630858 , 1545361644444920171 , 1997753181309741482 , 852535551069983768 , 2201772957889224940 , 1747479239683846996 }, // x^2^355
{ 881821856749842931 , 33675046554478555 , 441043258144540262 , 1864107211002315878 , 213663804468606377 , 779518916286681744 , 1657015176251964128 , 1234000577072772928 }, // x^2^356
{ 1629037232137607269 , 1568038047649633792 , 1411465989439022663 , 389455395058842604 , 554125259932565321 , 1605109836130735684 , 1642378583819350575 , 1337404045649734167 }, // x^2^357
{ 1928692022246218227 , 1709839397705900172 , 700630607698486301 , 1464616600744793604 , 698264318572727526 , 972092360804013549 , 2049081733964128465 , 2198229595803038387 }, // x^2^358
{ 1880654348547257558 , 1476705685714280205 , 1358445217050910742 , 2111185621663774036 , 1636739834133894487 , 910512677983536376 , 66845511675705871 , 1695023028547036474 }, // x^2^359
{ 111257500244176937 , 1164749420337806778 , 1166974332894526781 , 520872417434967374 , 696274744247027286 , 348013895310105062 , 1324487086784519028 , 1182067459981085649 }, // x^2^360
{ 880019563591625081 , 479309460423160560 , 2270345422042307745 , 1531020453913273139 , 532210261030539504 , 2015761889228124393 , 1438689111032339473 , 833421303749228763 }, // x^2^361
{ 420191162525030866 , 1782561089611052100 , 1478807302767478272 , 1486511393311314542 , 621073904919073855 , 2293504309385886754 , 486980369413926753 , 942401719860595424 }, // x^2^362
{ 1190526561300061469 , 2047316462525294846 , 903824918206430997 , 2295426177377901481 , 1252846238113564593 , 407407998615644808 , 1016356949973556458 , 674141426966719219 }, // x^2^363
{ 761623622570000269 , 1439332434886704951 , 738484131846911685 , 1874411635027107644 , 1939211601959319344 , 1349991128048938045 , 827906853422423950 , 1112511745996420238 }, // x^2^364
{ 2299311859375313539 , 811412470951134827 , 1824477644275216429 , 609286759079343113 , 1668815854850357083 , 1853024803395785531 , 342628901679334892 , 656885820575581689 }, // x^2^365
{ 1968768200502759654 , 2207697622632873672 , 333877204250571240 , 1825003721596803816 , 231274068436011404 , 67864162816683970 , 920739987917013327 , 364997089787786804 }, // x^2^366
{ 1600228928238612241 , 1891355996681428693 , 345506069435244583 , 831623917991345360 , 820753905739539892 , 291219051536293705 , 996522653777018463 , 690836988882320843 }, // x^2^367
{ 2128433195302917443 , 2258551908270133147 , 1944900359985814344 , 755301651871260987 , 2249244053224715807 , 213183467510840932 , 1422154421101518676 , 2143561716009442592 }, // x^2^368
{ 2111630590765421088 , 1742338438433621185 , 1978061232478682889 , 1384461294248544657 , 382413156417648080 , 1513000543034520343 , 496610357000920224 , 170540336394993161 }, // x^2^369
{ 953710384775816150 , 373241079978324282 , 1875300218109942167 , 531374055445910451 , 1071933530880445583 , 2304091651267022678 , 583390025362979170 , 1650108637804634335 }, // x^2^370
{ 38796330778627240 , 1977624500092462310 , 1703944693047603150 , 581151159177297678 , 1565446978680877201 , 2055778084833536373 , 387442693965974364 , 726412997754586449 }, // x^2^371
{ 1701106276069394637 , 1719631306650712702 , 2239104795287078402 , 2004903026767889135 , 867541551723344138 , 1287148152547739714 , 1887416701637869198 , 784675606938273303 }, // x^2^372
{ 1032520486976550776 , 2222277274994263300 , 1203837084685370518 , 295188581138663945 , 1050215667112938784 , 1195285596118246042 , 1855064450188421661 , 925307790505202807 }, // x^2^373
{ 367663880908551601 , 1492063196922845577 , 108612048337902984 , 2244994784910484207 , 2169070514612413282 , 1657441148007580707 , 675484927308642058 , 1557511281364479375 }, // x^2^374
{ 1151413190006835589 , 1166962135325582395 , 2140394835161550851 , 2167104367162208320 , 499956738357355178 , 122105980873608028 , 915356535482190113 , 1225817883376984995 }, // x^2^375
{ 62244764369956530 , 1327648037711645269 , 2126431038102298884 , 89579537089883062 , 689716767095500290 , 86988304153185779 , 2303367798596805069 , 1061566824501406144 }, // x^2^376
{ 1044213527311444176 , 1418635417665178907 , 2007793743021922535 , 1963628267021972080 , 356484661260541427 , 1466730203022742615 , 623283712530571036 , 1783310515116981278 }, // x^2^377
{ 358373709407137905 , 1669217844135429430 , 428340359224799016 , 726809592233492551 , 617152454892179694 , 605641735675631286 , 1200504458695016284 , 932250544422303943 }, // x^2^378
{ 1370040590608919099 , 183625989161271350 , 1513616498293220438 , 1227551255888787812 , 1689871591401186155 , 2050481541516856363 , 277285552999796675 , 2079809588669498313 }, // x^2^379
{ 1078203798498297750 , 265299228133483673 , 891856830230117422 , 1609854933010423233 , 1254100114423142214 , 2100516443474013609 , 653141299032951864 , 700386224544195090 }, // x^2^380
{ 2121154161611385943 , 1476944420325420857 , 483658609816674658 , 2032625465327924991 , 1721001254022682833 , 257037507690493914 , 371371286689212236 , 1797172563593044590 }, // x^2^381
{ 1280087093081453195 , 55429523695727980 , 1669149905620727629 , 781671458488614863 , 1011332931464394757 , 2065298633225451797 , 773182386785959752 , 1610397119075319054 }, // x^2^382
{ 2093229000156826454 , 48633118872508413 , 60670634117803698 , 766861511288322660 , 1325320551222339063 , 1794963613148919766 , 608045453287855300 , 2034742057965522172 } // x^2^383
};
@@ -46,81 +46,81 @@ namespace CLHEP {
//
//
//
static const double Avogadro = 6.02214179e+23/mole;
static constexpr double Avogadro = 6.02214179e+23/mole;
//
// c = 299.792458 mm/ns
// c^2 = 898.7404 (mm/ns)^2
//
static const double c_light = 2.99792458e+8 * m/s;
static const double c_squared = c_light * c_light;
static constexpr double c_light = 2.99792458e+8 * m/s;
static constexpr double c_squared = c_light * c_light;
//
// h = 4.13566e-12 MeV*ns
// hbar = 6.58212e-13 MeV*ns
// hbarc = 197.32705e-12 MeV*mm
//
static const double h_Planck = 6.62606896e-34 * joule*s;
static const double hbar_Planck = h_Planck/twopi;
static const double hbarc = hbar_Planck * c_light;
static const double hbarc_squared = hbarc * hbarc;
static constexpr double h_Planck = 6.62606896e-34 * joule*s;
static constexpr double hbar_Planck = h_Planck/twopi;
static constexpr double hbarc = hbar_Planck * c_light;
static constexpr double hbarc_squared = hbarc * hbarc;
//
//
//
static const double electron_charge = - eplus; // see SystemOfUnits.h
static const double e_squared = eplus * eplus;
static constexpr double electron_charge = - eplus; // see SystemOfUnits.h
static constexpr double e_squared = eplus * eplus;
//
// amu_c2 - atomic equivalent mass unit
// - AKA, unified atomic mass unit (u)
// amu - atomic mass unit
//
static const double electron_mass_c2 = 0.510998910 * MeV;
static const double proton_mass_c2 = 938.272013 * MeV;
static const double neutron_mass_c2 = 939.56536 * MeV;
static const double amu_c2 = 931.494028 * MeV;
static const double amu = amu_c2/c_squared;
static constexpr double electron_mass_c2 = 0.510998910 * MeV;
static constexpr double proton_mass_c2 = 938.272013 * MeV;
static constexpr double neutron_mass_c2 = 939.56536 * MeV;
static constexpr double amu_c2 = 931.494028 * MeV;
static constexpr double amu = amu_c2/c_squared;
//
// permeability of free space mu0 = 2.01334e-16 Mev*(ns*eplus)^2/mm
// permittivity of free space epsil0 = 5.52636e+10 eplus^2/(MeV*mm)
//
static const double mu0 = 4*pi*1.e-7 * henry/m;
static const double epsilon0 = 1./(c_squared*mu0);
static constexpr double mu0 = 4*pi*1.e-7 * henry/m;
static constexpr double epsilon0 = 1./(c_squared*mu0);
//
// electromagnetic coupling = 1.43996e-12 MeV*mm/(eplus^2)
//
static const double elm_coupling = e_squared/(4*pi*epsilon0);
static const double fine_structure_const = elm_coupling/hbarc;
static const double classic_electr_radius = elm_coupling/electron_mass_c2;
static const double electron_Compton_length = hbarc/electron_mass_c2;
static const double Bohr_radius = electron_Compton_length/fine_structure_const;
static constexpr double elm_coupling = e_squared/(4*pi*epsilon0);
static constexpr double fine_structure_const = elm_coupling/hbarc;
static constexpr double classic_electr_radius = elm_coupling/electron_mass_c2;
static constexpr double electron_Compton_length = hbarc/electron_mass_c2;
static constexpr double Bohr_radius = electron_Compton_length/fine_structure_const;
static const double alpha_rcl2 = fine_structure_const
static constexpr double alpha_rcl2 = fine_structure_const
*classic_electr_radius
*classic_electr_radius;
static const double twopi_mc2_rcl2 = twopi*electron_mass_c2
static constexpr double twopi_mc2_rcl2 = twopi*electron_mass_c2
*classic_electr_radius
*classic_electr_radius;
//
//
//
static const double k_Boltzmann = 8.617343e-11 * MeV/kelvin;
static constexpr double k_Boltzmann = 8.617343e-11 * MeV/kelvin;
//
//
//
static const double STP_Temperature = 273.15*kelvin;
static const double STP_Pressure = 1.*atmosphere;
static const double kGasThreshold = 10.*mg/cm3;
static constexpr double STP_Temperature = 273.15*kelvin;
static constexpr double STP_Pressure = 1.*atmosphere;
static constexpr double kGasThreshold = 10.*mg/cm3;
//
//
//
static const double universe_mean_density = 1.e-25*g/cm3;
static constexpr double universe_mean_density = 1.e-25*g/cm3;
} // namespace CLHEP
+140 -137
View File
@@ -24,7 +24,7 @@
// as it is needed for conversion factor : positron charge = e_SI (coulomb)
//
// The others physical constants are defined in the header file :
//PhysicalConstants.h
// PhysicalConstants.h
//
// Authors: M.Maire, S.Giani
//
@@ -41,6 +41,7 @@
// 29.04.08 use PDG 2006 value of e_SI
// 03.11.08 use PDG 2008 value of e_SI
// 19.08.15 added liter and its sub units (mma)
// 12.01.16 added symbols for microsecond (us) and picosecond (ps) (mma)
#ifndef HEP_SYSTEM_OF_UNITS_H
#define HEP_SYSTEM_OF_UNITS_H
@@ -50,265 +51,267 @@ namespace CLHEP {
//
//
//
static const double pi = 3.14159265358979323846;
static const double twopi = 2*pi;
static const double halfpi = pi/2;
static const double pi2 = pi*pi;
static constexpr double pi = 3.14159265358979323846;
static constexpr double twopi = 2*pi;
static constexpr double halfpi = pi/2;
static constexpr double pi2 = pi*pi;
//
// Length [L]
//
static const double millimeter = 1.;
static const double millimeter2 = millimeter*millimeter;
static const double millimeter3 = millimeter*millimeter*millimeter;
static constexpr double millimeter = 1.;
static constexpr double millimeter2 = millimeter*millimeter;
static constexpr double millimeter3 = millimeter*millimeter*millimeter;
static const double centimeter = 10.*millimeter;
static const double centimeter2 = centimeter*centimeter;
static const double centimeter3 = centimeter*centimeter*centimeter;
static constexpr double centimeter = 10.*millimeter;
static constexpr double centimeter2 = centimeter*centimeter;
static constexpr double centimeter3 = centimeter*centimeter*centimeter;
static const double meter = 1000.*millimeter;
static const double meter2 = meter*meter;
static const double meter3 = meter*meter*meter;
static constexpr double meter = 1000.*millimeter;
static constexpr double meter2 = meter*meter;
static constexpr double meter3 = meter*meter*meter;
static const double kilometer = 1000.*meter;
static const double kilometer2 = kilometer*kilometer;
static const double kilometer3 = kilometer*kilometer*kilometer;
static constexpr double kilometer = 1000.*meter;
static constexpr double kilometer2 = kilometer*kilometer;
static constexpr double kilometer3 = kilometer*kilometer*kilometer;
static const double parsec = 3.0856775807e+16*meter;
static constexpr double parsec = 3.0856775807e+16*meter;
static const double micrometer = 1.e-6 *meter;
static const double nanometer = 1.e-9 *meter;
static const double angstrom = 1.e-10*meter;
static const double fermi = 1.e-15*meter;
static constexpr double micrometer = 1.e-6 *meter;
static constexpr double nanometer = 1.e-9 *meter;
static constexpr double angstrom = 1.e-10*meter;
static constexpr double fermi = 1.e-15*meter;
static const double barn = 1.e-28*meter2;
static const double millibarn = 1.e-3 *barn;
static const double microbarn = 1.e-6 *barn;
static const double nanobarn = 1.e-9 *barn;
static const double picobarn = 1.e-12*barn;
static constexpr double barn = 1.e-28*meter2;
static constexpr double millibarn = 1.e-3 *barn;
static constexpr double microbarn = 1.e-6 *barn;
static constexpr double nanobarn = 1.e-9 *barn;
static constexpr double picobarn = 1.e-12*barn;
// symbols
static const double nm = nanometer;
static const double um = micrometer;
static constexpr double nm = nanometer;
static constexpr double um = micrometer;
static const double mm = millimeter;
static const double mm2 = millimeter2;
static const double mm3 = millimeter3;
static constexpr double mm = millimeter;
static constexpr double mm2 = millimeter2;
static constexpr double mm3 = millimeter3;
static const double cm = centimeter;
static const double cm2 = centimeter2;
static const double cm3 = centimeter3;
static constexpr double cm = centimeter;
static constexpr double cm2 = centimeter2;
static constexpr double cm3 = centimeter3;
static const double liter = 1.e+3*cm3;
static const double L = liter;
static const double dL = 1.e-1*liter;
static const double cL = 1.e-2*liter;
static const double mL = 1.e-3*liter;
static constexpr double liter = 1.e+3*cm3;
static constexpr double L = liter;
static constexpr double dL = 1.e-1*liter;
static constexpr double cL = 1.e-2*liter;
static constexpr double mL = 1.e-3*liter;
static const double m = meter;
static const double m2 = meter2;
static const double m3 = meter3;
static constexpr double m = meter;
static constexpr double m2 = meter2;
static constexpr double m3 = meter3;
static const double km = kilometer;
static const double km2 = kilometer2;
static const double km3 = kilometer3;
static constexpr double km = kilometer;
static constexpr double km2 = kilometer2;
static constexpr double km3 = kilometer3;
static const double pc = parsec;
static constexpr double pc = parsec;
//
// Angle
//
static const double radian = 1.;
static const double milliradian = 1.e-3*radian;
static const double degree = (pi/180.0)*radian;
static constexpr double radian = 1.;
static constexpr double milliradian = 1.e-3*radian;
static constexpr double degree = (pi/180.0)*radian;
static const double steradian = 1.;
static constexpr double steradian = 1.;
// symbols
static const double rad = radian;
static const double mrad = milliradian;
static const double sr = steradian;
static const double deg = degree;
static constexpr double rad = radian;
static constexpr double mrad = milliradian;
static constexpr double sr = steradian;
static constexpr double deg = degree;
//
// Time [T]
//
static const double nanosecond = 1.;
static const double second = 1.e+9 *nanosecond;
static const double millisecond = 1.e-3 *second;
static const double microsecond = 1.e-6 *second;
static const double picosecond = 1.e-12*second;
static constexpr double nanosecond = 1.;
static constexpr double second = 1.e+9 *nanosecond;
static constexpr double millisecond = 1.e-3 *second;
static constexpr double microsecond = 1.e-6 *second;
static constexpr double picosecond = 1.e-12*second;
static const double hertz = 1./second;
static const double kilohertz = 1.e+3*hertz;
static const double megahertz = 1.e+6*hertz;
static constexpr double hertz = 1./second;
static constexpr double kilohertz = 1.e+3*hertz;
static constexpr double megahertz = 1.e+6*hertz;
// symbols
static const double ns = nanosecond;
static const double s = second;
static const double ms = millisecond;
static constexpr double ns = nanosecond;
static constexpr double s = second;
static constexpr double ms = millisecond;
static constexpr double us = microsecond;
static constexpr double ps = picosecond;
//
// Electric charge [Q]
//
static const double eplus = 1. ;// positron charge
static const double e_SI = 1.602176487e-19;// positron charge in coulomb
static const double coulomb = eplus/e_SI;// coulomb = 6.24150 e+18 * eplus
static constexpr double eplus = 1. ;// positron charge
static constexpr double e_SI = 1.602176487e-19;// positron charge in coulomb
static constexpr double coulomb = eplus/e_SI;// coulomb = 6.24150 e+18 * eplus
//
// Energy [E]
//
static const double megaelectronvolt = 1. ;
static const double electronvolt = 1.e-6*megaelectronvolt;
static const double kiloelectronvolt = 1.e-3*megaelectronvolt;
static const double gigaelectronvolt = 1.e+3*megaelectronvolt;
static const double teraelectronvolt = 1.e+6*megaelectronvolt;
static const double petaelectronvolt = 1.e+9*megaelectronvolt;
static constexpr double megaelectronvolt = 1. ;
static constexpr double electronvolt = 1.e-6*megaelectronvolt;
static constexpr double kiloelectronvolt = 1.e-3*megaelectronvolt;
static constexpr double gigaelectronvolt = 1.e+3*megaelectronvolt;
static constexpr double teraelectronvolt = 1.e+6*megaelectronvolt;
static constexpr double petaelectronvolt = 1.e+9*megaelectronvolt;
static const double joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV
static constexpr double joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV
// symbols
static const double MeV = megaelectronvolt;
static const double eV = electronvolt;
static const double keV = kiloelectronvolt;
static const double GeV = gigaelectronvolt;
static const double TeV = teraelectronvolt;
static const double PeV = petaelectronvolt;
static constexpr double MeV = megaelectronvolt;
static constexpr double eV = electronvolt;
static constexpr double keV = kiloelectronvolt;
static constexpr double GeV = gigaelectronvolt;
static constexpr double TeV = teraelectronvolt;
static constexpr double PeV = petaelectronvolt;
//
// Mass [E][T^2][L^-2]
//
static const double kilogram = joule*second*second/(meter*meter);
static const double gram = 1.e-3*kilogram;
static const double milligram = 1.e-3*gram;
static constexpr double kilogram = joule*second*second/(meter*meter);
static constexpr double gram = 1.e-3*kilogram;
static constexpr double milligram = 1.e-3*gram;
// symbols
static const double kg = kilogram;
static const double g = gram;
static const double mg = milligram;
static constexpr double kg = kilogram;
static constexpr double g = gram;
static constexpr double mg = milligram;
//
// Power [E][T^-1]
//
static const double watt = joule/second;// watt = 6.24150 e+3 * MeV/ns
static constexpr double watt = joule/second;// watt = 6.24150 e+3 * MeV/ns
//
// Force [E][L^-1]
//
static const double newton = joule/meter;// newton = 6.24150 e+9 * MeV/mm
static constexpr double newton = joule/meter;// newton = 6.24150 e+9 * MeV/mm
//
// Pressure [E][L^-3]
//
#define pascal hep_pascal // a trick to avoid warnings
static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
static constexpr double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
static constexpr double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
static constexpr double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
//
// Electric current [Q][T^-1]
//
static const double ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns
static const double milliampere = 1.e-3*ampere;
static const double microampere = 1.e-6*ampere;
static const double nanoampere = 1.e-9*ampere;
static constexpr double ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns
static constexpr double milliampere = 1.e-3*ampere;
static constexpr double microampere = 1.e-6*ampere;
static constexpr double nanoampere = 1.e-9*ampere;
//
// Electric potential [E][Q^-1]
//
static const double megavolt = megaelectronvolt/eplus;
static const double kilovolt = 1.e-3*megavolt;
static const double volt = 1.e-6*megavolt;
static constexpr double megavolt = megaelectronvolt/eplus;
static constexpr double kilovolt = 1.e-3*megavolt;
static constexpr double volt = 1.e-6*megavolt;
//
// Electric resistance [E][T][Q^-2]
//
static const double ohm = volt/ampere;// ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
static constexpr double ohm = volt/ampere;// ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
//
// Electric capacitance [Q^2][E^-1]
//
static const double farad = coulomb/volt;// farad = 6.24150e+24 * eplus/Megavolt
static const double millifarad = 1.e-3*farad;
static const double microfarad = 1.e-6*farad;
static const double nanofarad = 1.e-9*farad;
static const double picofarad = 1.e-12*farad;
static constexpr double farad = coulomb/volt;// farad = 6.24150e+24 * eplus/Megavolt
static constexpr double millifarad = 1.e-3*farad;
static constexpr double microfarad = 1.e-6*farad;
static constexpr double nanofarad = 1.e-9*farad;
static constexpr double picofarad = 1.e-12*farad;
//
// Magnetic Flux [T][E][Q^-1]
//
static const double weber = volt*second;// weber = 1000*megavolt*ns
static constexpr double weber = volt*second;// weber = 1000*megavolt*ns
//
// Magnetic Field [T][E][Q^-1][L^-2]
//
static const double tesla = volt*second/meter2;// tesla =0.001*megavolt*ns/mm2
static constexpr double tesla = volt*second/meter2;// tesla =0.001*megavolt*ns/mm2
static const double gauss = 1.e-4*tesla;
static const double kilogauss = 1.e-1*tesla;
static constexpr double gauss = 1.e-4*tesla;
static constexpr double kilogauss = 1.e-1*tesla;
//
// Inductance [T^2][E][Q^-2]
//
static const double henry = weber/ampere;// henry = 1.60217e-7*MeV*(ns/eplus)**2
static constexpr double henry = weber/ampere;// henry = 1.60217e-7*MeV*(ns/eplus)**2
//
// Temperature
//
static const double kelvin = 1.;
static constexpr double kelvin = 1.;
//
// Amount of substance
//
static const double mole = 1.;
static constexpr double mole = 1.;
//
// Activity [T^-1]
//
static const double becquerel = 1./second ;
static const double curie = 3.7e+10 * becquerel;
static const double kilobecquerel = 1.e+3*becquerel;
static const double megabecquerel = 1.e+6*becquerel;
static const double gigabecquerel = 1.e+9*becquerel;
static const double millicurie = 1.e-3*curie;
static const double microcurie = 1.e-6*curie;
static const double Bq = becquerel;
static const double kBq = kilobecquerel;
static const double MBq = megabecquerel;
static const double GBq = gigabecquerel;
static const double Ci = curie;
static const double mCi = millicurie;
static const double uCi = microcurie;
static constexpr double becquerel = 1./second ;
static constexpr double curie = 3.7e+10 * becquerel;
static constexpr double kilobecquerel = 1.e+3*becquerel;
static constexpr double megabecquerel = 1.e+6*becquerel;
static constexpr double gigabecquerel = 1.e+9*becquerel;
static constexpr double millicurie = 1.e-3*curie;
static constexpr double microcurie = 1.e-6*curie;
static constexpr double Bq = becquerel;
static constexpr double kBq = kilobecquerel;
static constexpr double MBq = megabecquerel;
static constexpr double GBq = gigabecquerel;
static constexpr double Ci = curie;
static constexpr double mCi = millicurie;
static constexpr double uCi = microcurie;
//
// Absorbed dose [L^2][T^-2]
//
static const double gray = joule/kilogram ;
static const double kilogray = 1.e+3*gray;
static const double milligray = 1.e-3*gray;
static const double microgray = 1.e-6*gray;
static constexpr double gray = joule/kilogram ;
static constexpr double kilogray = 1.e+3*gray;
static constexpr double milligray = 1.e-3*gray;
static constexpr double microgray = 1.e-6*gray;
//
// Luminous intensity [I]
//
static const double candela = 1.;
static constexpr double candela = 1.;
//
// Luminous flux [I]
//
static const double lumen = candela*steradian;
static constexpr double lumen = candela*steradian;
//
// Illuminance [I][L^-2]
//
static const double lux = lumen/meter2;
static constexpr double lux = lumen/meter2;
//
// Miscellaneous
//
static const double perCent = 0.01 ;
static const double perThousand = 0.001;
static const double perMillion = 0.000001;
static constexpr double perCent = 0.01 ;
static constexpr double perThousand = 0.001;
static constexpr double perMillion = 0.000001;
} // namespace CLHEP
+1 -1
View File
@@ -7,7 +7,7 @@
//
// ======================================================================
#if (defined (G4MULTITHREADED) && defined (G4USE_STD11))
#if (defined (G4MULTITHREADED))
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
#include <atomic>
@@ -0,0 +1,28 @@
#ifndef CLHEP_USE_ATOMIC_GUARD_H
#define CLHEP_USE_ATOMIC_GUARD_H
// ======================================================================
//
// Use std::atomic when the compiler declares it uses the C++11 standard
//
// ======================================================================
#if (defined (G4MULTITHREADED))
#if __cplusplus >= 201103L
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7)
#include <atomic>
#define CLHEP_USE_ATOMIC
#elif __clang__
#if __has_feature(c_atomic)
#include <atomic>
#define CLHEP_USE_ATOMIC
#endif
#endif
#endif
#endif
#endif
+9 -8
View File
@@ -53,9 +53,9 @@ std::string MixMaxRng::name() const { return "MixMaxRng"; } // N=" + N
MixMaxRng::MixMaxRng()
: HepRandomEngine()
{
numberOfEngines++;
int numEngines = ++numberOfEngines;
fRngState= rng_alloc();
setSeed(static_cast<long>(numberOfEngines));
setSeed(static_cast<long>(numEngines));
}
MixMaxRng::MixMaxRng(long seed)
@@ -135,7 +135,7 @@ void MixMaxRng::showStatus() const
void MixMaxRng::setSeed(long longSeed, int /* extraSeed */)
{
unsigned long seed0, seed1= 0, seed2= 0, seed3= 0;
unsigned long seed0;
theSeed = longSeed;
if( sizeof(long) > 4) // C standard says long is at least 32-bits
@@ -143,7 +143,7 @@ void MixMaxRng::setSeed(long longSeed, int /* extraSeed */)
else
seed0= longSeed;
seed_uniquestream(this->fRngState, seed3, seed2, seed1, seed0 );
seed_spbox(fRngState, seed0);
}
// Preferred Seeding method
@@ -174,7 +174,7 @@ void MixMaxRng::setSeeds(const long* Seeds, int seedNum)
}
theSeed = Seeds[0];
theSeeds = Seeds;
seed_uniquestream(this->fRngState, seed3, seed2, seed1, seed0 );
seed_uniquestream(fRngState, seed3, seed2, seed1, seed0);
}
double MixMaxRng::flat()
@@ -182,9 +182,10 @@ double MixMaxRng::flat()
return get_next_float(fRngState);
}
void MixMaxRng::flatArray(const int size, double* arrayDbl )
void MixMaxRng::flatArray(const int size, double* vect )
{
fill_array( fRngState, size, arrayDbl );
// fill_array( fRngState, size, arrayDbl );
for (int i=0; i<size; ++i) { vect[i] = flat(); }
}
MixMaxRng::operator unsigned int()
@@ -268,7 +269,7 @@ std::istream & MixMaxRng::getState ( std::istream& is )
<< "\nInput stream is probably mispositioned now.\n";
return is;
}
if ( fRngState->counter < 0 || fRngState->counter > N-1 ) {
if ( fRngState->counter < 0 || fRngState->counter > rng_get_N() ) {
std::cerr << "\nMixMaxRng::getState(): "
<< "vector read wrong value of counter from file!"
<< "\nInput stream is probably mispositioned now.\n";
+132 -33
View File
@@ -24,6 +24,7 @@
#include "CLHEP/Random/StaticRandomStates.h"
#include "CLHEP/Utility/memory.h"
#include "CLHEP/Utility/thread_local.h"
#include "CLHEP/Utility/use_atomic.h"
// -----------------------------
// Static members initialisation
@@ -33,43 +34,141 @@
namespace CLHEP {
namespace {
namespace {
struct defaults {
struct defaults {
defaults( HepRandom & g, HepJamesRandom & e )
: theGenerator( &g, do_nothing_deleter() )
, theEngine ( &e, do_nothing_deleter() )
{ }
defaults()
: theGenerator( &theDefaultGenerator, do_nothing_deleter() )
, theEngine ( &theDefaultEngine, do_nothing_deleter() )
{ }
void resetEngine( HepRandomEngine * newEngine ) {
theEngine.reset( newEngine );
}
defaults(defaults const& other) = delete;
defaults const& operator=(defaults const&) = delete;
void resetEngine( HepRandomEngine & newEngine ) {
theEngine.reset( &newEngine, do_nothing_deleter() );
}
void resetEngine( HepRandomEngine * newEngine ) {
theEngine.reset( newEngine );
}
bool ensureInitialized() {
assert( theGenerator.get() != 0 && theEngine.get() != 0 );
return true;
}
void resetEngine( HepRandomEngine & newEngine ) {
theEngine.reset( &newEngine, do_nothing_deleter() );
}
~defaults()
{ }
bool ensureInitialized() {
assert( theGenerator.get() != 0 && theEngine.get() != 0 );
return true;
}
std::shared_ptr<HepRandom > theGenerator;
std::shared_ptr<HepRandomEngine> theEngine;
}; // defaults
~defaults()
{ }
defaults & theDefaults() {
static CLHEP_THREAD_LOCAL HepRandom theDefaultGenerator;
static CLHEP_THREAD_LOCAL HepJamesRandom theDefaultEngine;
static CLHEP_THREAD_LOCAL defaults theDefaults(theDefaultGenerator, theDefaultEngine);
return theDefaults;
}
private:
} // namespace
HepRandom theDefaultGenerator;
HepJamesRandom theDefaultEngine;
public:
std::shared_ptr<HepRandom > theGenerator;
std::shared_ptr<HepRandomEngine> theEngine;
}; // defaults
#ifdef CLHEP_USE_ATOMIC
// The ThreadSafeDefaultCache is used only by the function named theDefaults.
// It is a singly linked list that is intended to hold one object of
// type "defaults" per thread.
class ThreadSafeDefaultsCache {
public:
ThreadSafeDefaultsCache();
// The destructor deletes the objects of type "defaults"
~ThreadSafeDefaultsCache();
// Creates new objects and adds them to the linked list in a thread safe manner.
defaults* createNewDefaults();
// Note that there are no other functions. No erasing or moving or other accessors.
private:
class DefaultsNode {
public:
DefaultsNode(DefaultsNode* iNext);
DefaultsNode const* next() const { return next_; }
void setNext(DefaultsNode* v) { next_ = v; }
defaults* addressOfDefaults() { return &defaults_; }
private:
DefaultsNode* next_;
defaults defaults_;
};
// points to first node in the linked list
std::atomic<DefaultsNode*> front_;
};
ThreadSafeDefaultsCache::ThreadSafeDefaultsCache() :
front_(nullptr) {
}
defaults* ThreadSafeDefaultsCache::createNewDefaults() {
DefaultsNode* expected = front_.load();
DefaultsNode* newNode = new DefaultsNode(expected);
while (!front_.compare_exchange_strong(expected, newNode)) {
// another thread changed front_ before us so try again
newNode->setNext(expected);
}
return newNode->addressOfDefaults();
}
ThreadSafeDefaultsCache::DefaultsNode::DefaultsNode(DefaultsNode* iNext) :
next_(iNext),
defaults_() {
}
ThreadSafeDefaultsCache::~ThreadSafeDefaultsCache() {
DefaultsNode const* node = front_.load();
while (node) {
DefaultsNode const* next = node->next();
delete node;
node = next;
}
}
defaults & theDefaults() {
// We need to have different engines on different threads because
// the engines are not thread safe. One cannot generate random numbers
// using the same engine on different threads simultaneously.
// Originally we had the defaults object itself as a thread local,
// but that was failing because on Mac OSX there is not full
// support for thread locals yet. Objects containing std::shared_ptr
// in thread local storage were causing failures. So now we create
// a container of them that is a function static (not thread local)
// and the thread local contains only a pointer to an object in the
// container.
static ThreadSafeDefaultsCache defaultsForAllThreads;
// A pointer for each thread to defaults object built for each thread.
static CLHEP_THREAD_LOCAL defaults* theDefaults = defaultsForAllThreads.createNewDefaults();
return *theDefaults;
}
#else
// This version is used with old compilers not supporting atomics.
// In that case, the code should not be executed in more than one thread.
defaults & theDefaults() {
static defaults theDefaults;
return theDefaults;
}
#endif
} // namespace
//---------------------------- HepRandom ---------------------------------
@@ -91,7 +190,7 @@ HepRandom::HepRandom(HepRandomEngine * algorithm)
theDefaults().resetEngine( algorithm );
}
HepRandom::~HepRandom()
HepRandom::~HepRandom()
{ }
double HepRandom::flat()
@@ -112,7 +211,7 @@ std::string HepRandom::name() const {return "HepRandom";}
HepRandomEngine & HepRandom::engine() {
std::cerr << "HepRandom::engine() called -- there is no assigned engine!\n";
return *theDefaults().theEngine.get();
}
}
std::ostream & operator<< (std::ostream & os, const HepRandom & dist) {
return dist.put(os);
@@ -176,12 +275,12 @@ void HepRandom::setTheEngine (HepRandomEngine* theNewEngine)
void HepRandom::saveEngineStatus( const char filename[] )
{
theDefaults().theEngine->saveStatus( filename );
}
}
void HepRandom::restoreEngineStatus( const char filename[] )
{
theDefaults().theEngine->restoreStatus( filename );
}
}
std::ostream& HepRandom::saveFullState ( std::ostream & os ) {
os << *getTheEngine();
@@ -204,7 +303,7 @@ std::istream& HepRandom::restoreStaticRandomStates ( std::istream & is ) {
void HepRandom::showEngineStatus()
{
theDefaults().theEngine->showStatus();
}
}
int HepRandom::createInstance()
{
+7 -3
View File
@@ -254,7 +254,7 @@ inline myuint fmodmulM61(myuint cum, myuint a, myuint b){
inline myuint fmodmulM61(myuint cum, myuint s, myuint a)
{
register myuint o,ph,pl,ah,al;
myuint o,ph,pl,ah,al;
o=(s)*a;
ph = ((s)>>32);
pl = (s) & MASK32;
@@ -379,10 +379,14 @@ myuint apply_bigskip(myuint* Vout, myuint* Vin, myID_t clusterID, myID_t machine
const myuint skipMat[128][N] =
//#if (N==88)
//#if (N==8)
//#include "CLHEP/Random/mixmax_skip_N8.icc"
//#elif (N==17)
#include "CLHEP/Random/mixmax_skip_N17.icc"
//#elif (N==88)
//#include "CLHEP/Random/mixmax_skip_N88.icc" // to make this file, delete all except some chosen 128 rows of the coefficients table
//#elif (N==256)
#include "CLHEP/Random/mixmax_skip_N256.icc"
//#include "CLHEP/Random/mixmax_skip_N256.icc"
//#elif (N==1000)
//#include "CLHEP/Random/mixmax_skip_N1000.icc"
//#elif (N==3150)
+2
View File
@@ -324,9 +324,11 @@ void Evaluator::setSystemOfUnits(double meter,
setVariable("millisecond", milli_ * s);
setVariable("ms", milli_ * s);
setVariable("microsecond", micro_ * s);
setVariable("us", micro_ * s);
setVariable("nanosecond", nano_ * s);
setVariable("ns", nano_ * s);
setVariable("picosecond", pico_ * s);
setVariable("ps", pico_ * s);
// Current
+8
View File
@@ -20,6 +20,14 @@ committal in the CVS repository !
History file for G4 zlib package
--------------------------------
19 April 2015 Gunter Folger (zlib-V10-02-01)
- fix in gzguts.h for Windows; as of Studio 2015 in 64 bit compilation,
_snprintf is no longer provided, but snprintf finally is available.
15 January 2015Gunter Folger (zlib-V10-02-00)
- fix clang compiler warning in inflate.cc: return explicit value
of -1L << 16 (0xffffFFFFffff000L)
10 July 2015 Gunter Folger (zlib-V10-01-01)
- Add type casts to fix windows compilations errors.
+1 -1
View File
@@ -99,7 +99,7 @@
Microsoft more than a decade later!), _snprintf does not guarantee null
termination of the result -- however this is only used in gzlib.c where
the result is assured to fit in the space provided */
#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
# define snprintf _snprintf
#endif
+2 -1
View File
@@ -1465,7 +1465,8 @@ long ZEXPORT inflateMark(z_streamp strm)
{
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
if (strm == Z_NULL || strm->state == Z_NULL) return 0xffffFFFFffff0000L; // shut off clang
// warning from -1L << 16;
state = (struct inflate_state FAR *)strm->state;
return ((long)(state->back) << 16) +
(state->mode == COPY ? state->length :
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History 92635 2015-09-09 13:39:54Z gcosmo $
$Id: History 96863 2016-05-13 13:45:58Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 13th, 2016 G.Cosmo (geomdiv-V10-02-00)
- Updated unit tests.
September 9th, 2015 G.Cosmo (geomdiv-V10-01-07)
- Set as unsupported divisions of polycone and polyhedra in MT-mode.
+156 -1
View File
@@ -1,4 +1,4 @@
$Id: History 93806 2015-11-02 11:21:01Z gcosmo $
$Id: History 97812 2016-06-14 07:57:41Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,161 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 11, 2016 J.Apostolakis - field-V10-02-21
---------------------------
- Restored G4ClassicalRK4 as default stepper for B-field,
(due to performance issues reported in benchmarking.)
June 10, 2016 G.Cosmo - field-V10-02-20
---------------------
- Fixed code indentation in G4HelixMixedStepper;
fixes compilation warnings on gcc-6.1.
June 1, 2016 J.Apostolakis - field-V10-02-19, 18, 17
--------------------------
- Fix in multiple steppers for the size of two C-arrays which hold
intermediate values; they must be at least 8 and at least
'fNumberOfStateVariables' long.
Changed: G4CashKarp,
G4BogackiShampine 23 & 34
G4DormandPrince 745, RK56 & RK78
G4DoLoMcPriRK34
G4FSALBogackiShampine45, G4FSALDormandPrince745
- Made G4CashKarp the default stepper in G4ChordFinder.
- Deleted trial class G4NewChordFinder.
June 1, 2016 J.Apostolakis - field-V10-02-16
--------------------------
- Deleted test code (RkTestRun) due to cmake issues
June 1, 2016 J.Apostolakis - field-V10-02-15 (also -14)
--------------------------
- Made G4ClassicalRK4 the default stepper again in G4ChordFinder
- Fixes in test code (RkTestRun) for new names of classes.
May 31, 2016 J.Apostolakis - field-V10-02-13 (also -12)
--------------------------
- New class G4NewChordFinder, that uses old G4MagIntegratorDriver or
the newer G4FSALIntegratorDriver -- first try, for testing FSAL.
Created new test testNewChordFinder.cc to checks this.
- Renamed new Stepper classes to use 'G4' prefix, including
DormandPrince{745,RK56,RK67} TsitourasRK45 and DoLoMcPriRK34
- Renamed FSAL base classes to use 'G4' prefix & 'Integrat-ion'
FSALMagIntegratorStepper to G4VFSALIntegrationStepper
FSALIntegratorDriver to G4FSALIntegrationDriver
and the experimental FSAL versions of steppers,
FBogackiShampine45.hh to G4FSALBogackiShampine45.hh
FDormandPrince745.hh to G4FSALDormandPrince745.hh
( Note: FSAL steppers remain 'behind' the improved non-FSAL versions.)
- Made DormandPrince745 (DP45) the default stepper (in G4ChordFinder).
May 26, 2016 J.Apostolakis & Som. Banerjee - field-V10-02-11
------------------------------------------
- First version of FSAL classes (as additional classes)
FSAL Integrator Driver : New *concrete*, stand-alone driver
FSAL Integrator Stepper : New base class (separate from G4MagIntegratorStepper)
FBogackiShampine45: FSAL-version of BogackiShampine45 stepper
FDormandPrince745: FSAL-version of FDormandPrince745 stepper
Developed by Somnath Banerjee in GSoC 2015
Context:
* FSAL Stepper's key 'Stepper()' method for Stepping has additional
argument to return the derivative at the end of a step.
If the step was successful, this estimate has the same order of
accuracy as the stepper (i.e. 5th order for a 5th order stepper.)
- FSAL Driver method uses the revised Stepper interface, using
the final (endpoint) derivative for successful steps
as the start derivative for the next step, in case of
continuing of integration.
- New test (RkTestRun.cc) covering FSAL methods, integration
Developed by Somnath Banerjee in GSoC 2015
May 26, 2016 J.Apostolakis - field-V10-02-10
--------------------------
Preparation for addition of FSAL steppers (& driver)
- G4MagIntegratorStepper: Added counter for calls to equation RHS,
with Get/Reset methods.
- Cosmetic fixes in sources.cmake (tabs to spaces)
May 25, 2016 J.Apostolakis & Som. Banerjee - field-V10-02-09
------------------------------------------
- Added new stepper classes embedded RK method:
* DoLoMcPriRK34, 6-stage 3/4 RK (interpolation)
* DormandPrinceRK56, 9-stage 5/6 RK (interpolation, FSAL-able) "6(5)"
* DormandPrinceRK78, 13-stage 7/8 RK (interpolation) "8(7) 13M"
created by Somnath Banerjee as part of GSoC 2015.
May 25, 2016 J.Apostolakis - field-V10-02-08
--------------------------
- Revised testPropagateMagField, to reduce error severity for over-long
steps. An error message is still written if move > (1.+1.0e-9) * step,
but test does not stop.
- G4HelixMixedStepper: Fixes & added new (5th order) stepper choices.
Included (G4)Bogacki-Shampine 23/45 , DormandPrince745,
and newest TsitourasRK45.
May 24, 2016 J.Apostolakis - field-V10-02-06, 07
--------------------------
- Added TsitourasRK45 stepper.
- Made Cash-Karp the default stepper (in G4ChordFinder).
May 23, 2016 J.Apostolakis - field-V10-02-05
--------------------------
- Made DormandPrince745 (DP45) the default stepper (in G4ChordFinder).
May 20, 2016 J.Apostolakis - field-V10-02-04
-------------------------
- Added steppers created by Somnath Banerjee as part of GSoC 2015,
G4BogackiShampine23 (BS23 below), G4BogackiShampine45 (BS45) and
DormandPrince745 (DP45).
These implement third order (BS23) and fifth order (BS45, DP45)
embedded RK tableaus.
- DP45 includes interpolation method, to evaluate the interpolant
('y') at intermediate points of a successful step.
BS45's interpolation method exists, but is not validated (fails).
References:
- BS45 is embedded pair from paper by P. Bogacki and L. F. Shampine:
“An efficient Runge-Kutta (4,5) pair,”
Comput. Math. with Appl., vol. 32, no. 6, pp. 1528, Sep. 1996.
- BS23 is four stage RK method from the paper of P. Bogacki and L. F. Shampine,
“A 3(2) pair of Runge - Kutta formulas,”
Appl. Math. Lett., vol 2, no 4, p.321 (1989).
- DP45 are from Table 2 of J. R. Dormand and P. J. Prince's
“A family of embedded Runge-Kutta formulae,”
Journal of comput. and applied Math., vol. 6, no. 1, pp. 1926, 1980.
May 4, 2016 G.Cosmo - field-V10-02-03
-------------------
- Fixed Clone() signatures in derived Field classes.
More corrections on implementations of operator=() and copy-ctors.
Apr 29, 2016 G.Cosmo - field-V10-02-02
--------------------
- Corrected implementation of operator=() and copy-ctor for G4Field,
G4ElectroMagneticField, G4ElectricField and G4CachedMagneticField.
Feb 25, 2016 P.Gumplinger - field-V10-02-01
-------------------------
- address Problem Report: 1831
change: G4Mag_SpinEqRhs, G4EqEMFieldWithSpin, G4EqEMFieldWithEDM and
G4RepleteEofM.cc from g_BMT = (magMoment/muB)/spin
to g_BMT = (std::abs(magMoment)/muB)/spin
Dec 11, 2015 A.Dotti - field-V10-02-00
--------------------------
Fixing typo in tests/CMakeList.txt file: subdirecotry()
instead of add_subdirectory()
Nov 2, 2015 J.Apostolakis - field-V10-01-15 (fixed)
Oct 22, 2015 J.Apostolakis - field-V10-01-14
--------------------------
@@ -0,0 +1,106 @@
// Bogacki-Shampine - 4 - 3(2) non-FSAL implementation
//
// An implementation of the embedded RK method from the paper
// [1] P. Bogacki and L. F. Shampine, “A 3(2) pair of Runge - Kutta formulas,”
// Appl. Math. Lett., vol. 2, no. 4, pp. 321325, Jan. 1989.
//
// This version does not utilise the FSAL property of the method,
// which would allow the reuse of the last derivative in the next step.
// (Alternative FSAL implementation created with revised interface)
//
// Implemented by Somnath Banerjee
// Work supported by the Google Summer of Code 2015.
// Supervision / code review: John Apostolakis
//
// First version: 20 May 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
//
///////////////////////////////////////////////////////////////////////////////
#ifndef G4BOGACKI_SHAMPINE23_H
#define G4BOGACKI_SHAMPINE23_H
#include "G4MagIntegratorStepper.hh"
class G4BogackiShampine23 : public G4MagIntegratorStepper{
public:
//constructor
G4BogackiShampine23( G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary= true ) ;
//destructor
~G4BogackiShampine23() ;
//Stepper
void Stepper(const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
G4double DistChord() const;
G4int IntegratorOrder() const { return 2; }
G4bool isFSAL() const{ return true; }
G4double *getLastDydx();
G4BogackiShampine23(const G4BogackiShampine23&);
G4BogackiShampine23& operator=(const G4BogackiShampine23&);
private:
G4double *ak2, *ak3, *ak4, *yTemp, *yIn;
// for storing intermediate 'k' values in stepper
G4double *pseudoDydx_for_DistChord;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4BogackiShampine23* fAuxStepper;
// G4int No_of_vars;
// G4double hinit, tinit, tmax, *yinit;
// double hmax, hmin, safe_const, err0, Step_factor;
// void (*derivs)(double, double *, double *);
};
#endif /* G4BogackiShampine23 */
@@ -0,0 +1,107 @@
// An implementation of the embedded RK method from the following paper
// by P. Bogacki and L. F. Shampine:
// “An efficient Runge-Kutta (4,5) pair,”
// Comput. Math. with Appl., vol. 32, no. 6, pp. 1528, Sep. 1996.
//
// An interpolation method provides the value of an intermediate
// point in a step -- if a step was sucessful.
//
// This version can provide the FSAL property of the method,
// which allows the reuse of the last derivative in the next step.
// but only by using the additional method GetLastDyDx.
// (Alternative interface for simpler use of FSAL is under development.)
//
// Design & Implementation by Somnath Banerjee
// Supervision & code review: John Apostolakis
//
// Work supported by the Google Summer of Code 2015.
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
//
///////////////////////////////////////////////////////////////////////////////
#ifndef Bogacki_Shampine_45
#define Bogacki_Shampine_45
#include "G4MagIntegratorStepper.hh"
class G4BogackiShampine45 : public G4MagIntegratorStepper
{
public:
G4BogackiShampine45(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4BogackiShampine45();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
// This Stepper provides 'dense output'. After a successful
// step, it is possible to obtain an estimate of the value
// of the function at an intermediate point of the interval.
// This requires only two additional evaluations of the
// derivative (and thus the field).
inline void SetupInterpolation()
// const G4double yInput[], const G4double dydx[], const G4double Step )
{
SetupInterpolationHigh(); // ( yInput, dydx, Step);
}
//For calculating the output at the tau fraction of Step
inline void Interpolate( // const G4double yInput[],
// const G4double dydx[],
// const G4double Step,
G4double tau,
G4double yOut[]) // Output value
{
InterpolateHigh( tau, yOut);
// InterpolateHigh( yInput, dydx, Step, yOut, tau);
}
void SetupInterpolationHigh();
// Was: ( const G4double yInput[], const G4double, const G4double Step );
// For calculating the output at the tau fraction of Step
void InterpolateHigh( // const G4double yInput[],
// const G4double dydx[],
// const G4double Step,
G4double tau,
G4double yOut[] ) const;
G4double DistChord() const;
G4int IntegratorOrder() const { return 4; }
void GetLastDydx( G4double dyDxLast[] );
void PrepareConstants(); // Initialise the values of the bi[][] array
private :
G4BogackiShampine45(const G4BogackiShampine45&);
G4BogackiShampine45& operator=(const G4BogackiShampine45&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8,
*ak9, *ak10, *ak11, *yTemp, *yIn;
G4double *p[6];
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector, *fLastDyDx,
*fMidVector, *fMidError;
// for DistChord calculations
G4BogackiShampine45* fAuxStepper; // For chord - until interpolation is proven
bool fPreparedInterpolation;
// Class constants
static bool fPreparedConstants;
static G4double bi[12][7];
};
#endif /* defined(__Geant4__G4BogackiShampine45__) */
@@ -67,7 +67,7 @@ class G4CachedMagneticField : public G4MagneticField
void ClearCounts() { fCountCalls = 0; fCountEvaluations=0; }
void ReportStatistics();
virtual G4CachedMagneticField* Clone() const;
virtual G4Field* Clone() const;
private:
G4MagneticField *fpMagneticField;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CashKarpRKF45.hh 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4CashKarpRKF45.hh 97598 2016-06-06 07:19:46Z gcosmo $
//
//
// class G4CashKarpRKF45
@@ -86,7 +86,7 @@ class G4CashKarpRKF45 : public G4MagIntegratorStepper
private:
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *yTemp, *yIn;
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *yTemp, *yIn; // *ak7
// scratch space
G4double fLastStepLength;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DELPHIMagField.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4DELPHIMagField.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4DELPHIMagField
@@ -56,7 +56,7 @@ class G4DELPHIMagField : public G4MagneticField
void GetFieldValue(const G4double yTrack[],
G4double B[] ) const;
G4DELPHIMagField* Clone() const;
G4Field* Clone() const;
};
#endif
@@ -0,0 +1,112 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// DoLoMcPri4(3) RK method - header
// Implements the 6-3-4 non-FSAL method ( 6 stage, 3rd & 4th order embedded RK method )
//
// RK tableau / method develoed by
// Dormand Lockyer McGorrigan Prince
// RK4(3)6FD - forced Non-FSAL
//
// Header, design, implementation by Somnath Banerjee
// Supported by Google in Google Summer of Code 2015.
// Supervision / code review: John Apostolakis
//
// First version: 7 July 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
// G4DoLoMcPriRK34.hh
// Geant4
//
// History
// -----------------------------
// Created by Somnath on 7 July 2015
#ifndef DoLo_McPri_34
#define DoLo_McPri_34
#include "G4MagIntegratorStepper.hh"
class G4DoLoMcPriRK34 : public G4MagIntegratorStepper
{
public:
//Constructor using Equation
G4DoLoMcPriRK34(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4DoLoMcPriRK34();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
//For Preparing the Interpolant and calculating the extra stages
void SetupInterpolation();
void SetupInterpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step );
//For calculating the output at the tau fraction of Step
void Interpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau );
void Interpolate( G4double tau,
G4double yOut[]);
void interpolate(const G4double yInput[],
const G4double dydx[],
G4double yOut[],
G4double Step,
G4double tau ) ;
G4double DistChord() const;
G4int IntegratorOrder() const {return 3; }
private :
G4DoLoMcPriRK34(const G4DoLoMcPriRK34&);
//Copy constructor kept private
G4DoLoMcPriRK34& operator=(const G4DoLoMcPriRK34&);
//assignment operator overloaded
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *yTemp, *yIn;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4DoLoMcPriRK34* fAuxStepper;
};
#endif /* defined(__Geant4__G4DoLoMcPriRK34__) */
@@ -0,0 +1,137 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DormandPrince745.hh 97387 2016-06-02 10:03:42Z gcosmo $
//
// Class desription:
// An implementation of the 5th order embedded RK method from the paper
// J. R. Dormand and P. J. Prince, “A family of embedded Runge-Kutta formulae,”
// Journal of computational and applied …, vol. 6, no. 1, pp. 1926, 1980.
//
// DormandPrince7 - 5(4) embedded RK method
//
// Design & Implementation by Somnath Banerjee
// Supervision & code review: John Apostolakis
//
// Work supported by the Google Summer of Code 2015.
//
// History
// ------------------------------------------
// Created : 25 May 2015. - Somnath
// Revisions :
// * 29 June 2015: Added interpolate() method(s) - Somnath
// * May 2016: Cleanup and first comming in G4 - John Apostolakis
#ifndef Dormand_Prince_745
#define Dormand_Prince_745
#include "G4MagIntegratorStepper.hh"
class G4DormandPrince745 : public G4MagIntegratorStepper
{
public:
G4DormandPrince745(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4DormandPrince745();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
//For Preparing the Interpolant and calculating the extra stages
void SetupInterpolation_low( /* const G4double yInput[],
const G4double dydx[],
const G4double Step */ );
//For calculating the output at the tau fraction of Step
void Interpolate_low( /* const G4double yInput[],
const G4double dydx[],
const G4double Step, */
G4double yOut[],
G4double tau );
inline void SetupInterpolation()
/* ( const G4double yInput[],
const G4double dydx[],
const G4double Step ) */
{
SetupInterpolation_low( /* yInput, dydx, Step */ );
// SetupInterpolation_high( /* yInput, dydx, Step */ );
}
//For calculating the output at the tau fraction of Step
inline void Interpolate(
/* const G4double yInput[],
const G4double dydx[],
const G4double Step, */
G4double tau,
G4double yOut[]
)
{
Interpolate_low( /* yInput, dydx, Step, */ yOut, tau);
// Interpolate_high( /* yInput, dydx, Step, */ yOut, tau);
}
void SetupInterpolation_high( /* const G4double yInput[],
const G4double dydx[],
const G4double Step */ );
//For calculating the output at the tau fraction of Step
void Interpolate_high( /* const G4double yInput[],
const G4double dydx[],
const G4double Step, */
G4double yOut[],
G4double tau );
G4double DistChord() const;
G4double DistChord2() const;
G4double DistChord3() const;
// Enabling method, with common code between implementations (and steppers)
G4double DistLine( G4double yStart[], G4double yMid[], G4double yEnd[] ) const;
G4int IntegratorOrder() const {return 4; }
//New copy constructor
// G4DormandPrince745(const G4DormandPrince745 &);
private :
G4DormandPrince745& operator=(const G4DormandPrince745&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7,
*ak8, *ak9, //For additional stages in the interpolant
*yTemp, *yIn;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fInitialDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4DormandPrince745* fAuxStepper;
};
#endif /* defined(__Geant4__G4DormandPrince745__) */
@@ -0,0 +1,134 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Dormand-Prince RK 6(5) non-FSAL implementation by Somnath Banerjee
// Supervision / code review: John Apostolakis
//
// Sponsored by Google in Google Summer of Code 2015.
//
// First version: 26 June 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
// G4DormandPrince745.cc
// Geant4
//
// History
// -----------------------------
// Created by Somnath on 26 June 2015
//
//
///////////////////////////////////////////////////////////////////////////////
#ifndef DORMAND_PRINCE_RK56_H
#define DORMAND_PRINCE_RK56_H
#include "G4MagIntegratorStepper.hh"
class G4DormandPrinceRK56 : public G4MagIntegratorStepper{
public:
//constructor
G4DormandPrinceRK56( G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary= true ) ;
//destructor
~G4DormandPrinceRK56() ;
//Stepper
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
G4double DistChord() const;
G4int IntegratorOrder() const { return 5; }
G4DormandPrinceRK56(const G4DormandPrinceRK56&);
G4DormandPrinceRK56& operator=(const G4DormandPrinceRK56&);
//For Preparing the Interpolant and calculating the extra stages
void SetupInterpolate_low( const G4double yInput[],
const G4double dydx[],
const G4double Step );
//For calculating the output at the tau fraction of Step
void Interpolate_low( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau );
void SetupInterpolation()
{ SetupInterpolate( fLastInitialVector, fLastDyDx, fLastStepLength); }
inline void SetupInterpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step ){
SetupInterpolate_low( yInput, dydx, Step);
}
//For calculating the output at the tau fraction of Step
inline void Interpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau ){
Interpolate_low( yInput, dydx, Step, yOut, tau);
}
void Interpolate( G4double tau, G4double yOut[])
{ Interpolate( fLastInitialVector, fLastDyDx, fLastStepLength, yOut, tau ); }
void SetupInterpolate_high( const G4double yInput[],
const G4double dydx[],
const G4double Step );
//For calculating the output at the tau fraction of Step
void Interpolate_high( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau );
private:
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8, *ak9; // for storing intermediate 'k' values in stepper
G4double *ak10_low, *ak10, *ak11, * ak12; //For the additional stages of Interpolant
G4double *yTemp, *yIn;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4DormandPrinceRK56* fAuxStepper;
};
#endif /* G4DormandPrinceRK56 */
@@ -23,39 +23,46 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4DormandPrinceRK78.hh
//
// $Id: G4B11GEMCoulombBarrier.hh 67983 2013-03-13 10:42:03Z gcosmo $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (Dec 1999)
//
//J.M. Quesada (July 2009) Coulomb barrier now derives from new class G4GEMCoulombBarrier
// strictly according to Furihata's report
//
#ifndef G4B11GEMCoulombBarrier_h
#define G4B11GEMCoulombBarrier_h 1
// Created by Somnath on 30/06/15.
//#include "G4GEMCoulombBarrierHE.hh"
#include "G4GEMCoulombBarrier.hh"
#include "globals.hh"
//JMQ 200709 now derives from new class G4GEMCoulombBarrier
//class G4B11GEMCoulombBarrier : public G4GEMCoulombBarrierHE
class G4B11GEMCoulombBarrier : public G4GEMCoulombBarrier
#ifndef G4Dormand_Prince_RK78_hh
#define G4Dormand_Prince_RK78_hh
#include "G4MagIntegratorStepper.hh"
class G4DormandPrinceRK78 : public G4MagIntegratorStepper
{
public:
//JMQ 200709
// G4B11GEMCoulombBarrier() : G4GEMCoulombBarrierHE(11,5) {};
G4B11GEMCoulombBarrier() : G4GEMCoulombBarrier(11,5) {};
~G4B11GEMCoulombBarrier() {};
public:
G4DormandPrinceRK78(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4DormandPrinceRK78();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[]) ;
private:
G4B11GEMCoulombBarrier(const G4B11GEMCoulombBarrier & right);
G4double DistChord() const;
G4int IntegratorOrder() const {return 7; }
private :
G4DormandPrinceRK78(const G4DormandPrinceRK78&);
G4DormandPrinceRK78& operator=(const G4DormandPrinceRK78&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8,
*ak9, *ak10, *ak11, *ak12, *ak13,
*yTemp, *yIn;
const G4B11GEMCoulombBarrier & operator=(const G4B11GEMCoulombBarrier & right);
G4bool operator==(const G4B11GEMCoulombBarrier & right) const;
G4bool operator!=(const G4B11GEMCoulombBarrier & right) const;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4DormandPrinceRK78* fAuxStepper;
};
#endif
#endif /* defined(__G4_DormandPrinceRK78_hh) */
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Bogacki-Shampine - 8 - 5(4) FSAL implementation by Somnath Banerjee
// Supervision / code review: John Apostolakis
//
// Sponsored by Google in Google Summer of Code 2015.
//
// First version: 26 May 2015
//
// History
// -----------------------------
// Created by Somnath on 26 May 2015
//
//
///////////////////////////////////////////////////////////////////////////////
#ifndef G4FSAL_Bogacki_Shampine_45_hh
#define G4FSAL_Bogacki_Shampine_45_hh
#include "G4VFSALIntegrationStepper.hh"
class G4FSALBogackiShampine45 : public G4VFSALIntegrationStepper
{
public:
G4FSALBogackiShampine45(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4FSALBogackiShampine45();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[],
G4double nextDydx[]) ;
void interpolate( const G4double yInput[],
const G4double dydx[],
G4double yOut[],
G4double Step,
G4double tau ) ;
G4double DistChord() const;
G4int IntegratorOrder() const { return 4; }
private :
G4FSALBogackiShampine45(const G4FSALBogackiShampine45&);
G4FSALBogackiShampine45& operator=(const G4FSALBogackiShampine45&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8,
*ak9, *ak10, *ak11,
*yTemp, *yIn;
G4double *pseudoDydx_for_DistChord;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4FSALBogackiShampine45* fAuxStepper;
};
#endif /* defined( G4FSAL_Bogacki_Shampine_45_hh ) */
@@ -0,0 +1,84 @@
// DormandPrince7 - 5(4) FSAL implementation by Somnath Banerjee
// Supervision / code review: John Apostolakis
//
// Sponsored by Google in Google Summer of Code 2015.
//
// First version: 25 May 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
//
// $ID: FDormandPrince745.hh $
//
// History
// ----------------------------------------------------
// Created : 25 May 2015. - Somnath
//
// Added interpolate() method: - Somnath
// 29 June 2015
#ifndef FFDormand_Prince_745
#define FFDormand_Prince_745
#include "G4VFSALIntegrationStepper.hh"
class G4FSALDormandPrince745 : public G4VFSALIntegrationStepper
{
public:
G4FSALDormandPrince745(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4FSALDormandPrince745();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[],
G4double nextDydx[]) ;
void interpolate( const G4double yInput[],
const G4double dydx[],
G4double yOut[],
G4double Step,
G4double tau ) ;
//For higher order Interpolant
void SetupInterpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step );
//For calculating the output at the tau fraction of Step
void Interpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau );
G4double DistChord() const;
G4int IntegratorOrder() const {return 4; }
G4bool isFSAL() const{ return true; }
// G4double *getLastDydx();
private :
G4FSALDormandPrince745(const G4FSALDormandPrince745&);
G4FSALDormandPrince745& operator=(const G4FSALDormandPrince745&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7,
*ak8, *ak9, //For additional stages in the interpolant
*yTemp, *yIn;
//Only for use with DistChord :-
G4double *pseudoDydx_for_DistChord;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4FSALDormandPrince745* fAuxStepper;
};
#endif /* defined(__Geant4__FSALDormandPrince745__) */
@@ -0,0 +1,268 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4FSALIntegrationDriver.hh 97387 2016-06-02 10:03:42Z gcosmo $
//
//
// class G4FSALIntegrationDriver
//
// Class description:
//
// Provides a driver that talks to the Integrator Stepper, and insures that
// the error is within acceptable bounds.
// History:
// - Created. J.Apostolakis.
// --------------------------------------------------------------------
#ifndef G4FSALIntegrationDriver_Def
#define G4FSALIntegrationDriver_Def
#include "G4Types.hh"
#include "G4FieldTrack.hh"
#include "G4VFSALIntegrationStepper.hh"
class G4FSALIntegrationDriver
{
public: // with description
G4bool AccurateAdvance(G4FieldTrack& y_current,
G4double hstep,
G4double eps, // Requested y_err/hstep
G4double hinitial=0.0); // Suggested 1st interval
// Above drivers for integrator (Runge-Kutta) with stepsize control.
// Integrates ODE starting values y_current
// from current s (s=s0) to s=s0+h with accuracy eps.
// On output ystart is replaced by value at end of interval.
// The concept is similar to the odeint routine from NRC p.721-722.
G4bool QuickAdvance( G4FieldTrack& y_val, // INOUT
G4double dydx[],
G4double hstep, // IN
G4double& dchord_step,
G4double& dyerr ) ;
// QuickAdvance just tries one Step - it does not ensure accuracy.
G4bool QuickAdvance( G4FieldTrack& y_posvel, // INOUT
G4double dydx[],
G4double hstep, // IN
G4double& dchord_step,
G4double& dyerr_pos_sq,
G4double& dyerr_mom_rel_sq ) ;
// New QuickAdvance that also just tries one Step
// (so also does not ensure accuracy)
// but does return the errors in position and
// momentum (normalised: Delta_Integration(p^2)/(p^2) )
G4FSALIntegrationDriver( G4double hminimum,
G4VFSALIntegrationStepper *pItsStepper,
G4int numberOfComponents=6,
G4int statisticsVerbosity=1);
~G4FSALIntegrationDriver();
// Constructor, destructor.
inline G4double GetHmin() const;
inline G4double Hmin() const; // Obsolete
inline G4double GetSafety() const;
inline G4double GetPshrnk() const;
inline G4double GetPgrow() const;
inline G4double GetErrcon() const;
inline G4int GetNoTotalSteps() const; //Only for debug purposes
inline void GetDerivatives( const G4FieldTrack &y_curr, // const, INput
G4double dydx[] ); // OUTput
// Accessors.
inline void RenewStepperAndAdjust(G4VFSALIntegrationStepper *pItsStepper);
// Sets a new stepper pItsStepper for this driver. Then it calls
// ReSetParameters to reset its parameters accordingly.
inline void ReSetParameters(G4double new_safety= 0.9 );
// i) sets the exponents (pgrow & pshrnk),
// using the current Stepper's order,
// ii) sets the safety
// ii) calculates "errcon" according to the above values.
inline void SetSafety(G4double valS);
inline void SetPshrnk(G4double valPs);
inline void SetPgrow (G4double valPg);
inline void SetErrcon(G4double valEc);
// When setting safety or pgrow, errcon will be set to a
// compatible value.
inline G4double ComputeAndSetErrcon();
inline const G4VFSALIntegrationStepper* GetStepper() const;
inline G4VFSALIntegrationStepper* GetStepper();
void OneGoodStep( G4double ystart[], // Like old RKF45step()
G4double dydx[],
G4double& x,
G4double htry,
G4double eps, // memb variables ?
G4double& hdid,
G4double& hnext ) ;
// This takes one Step that is as large as possible while
// satisfying the accuracy criterion of:
// yerr < eps * |y_end-y_start|
G4double ComputeNewStepSize( G4double errMaxNorm, // normalised error
G4double hstepCurrent); // current step size
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Do not limit the next step's size within a factor of the
// current one.
G4double ComputeNewStepSize_WithinLimits(
G4double errMaxNorm, // normalised error
G4double hstepCurrent); // current step size
// Taking the last step's normalised error, calculate
// a step size for the next step.
// Limit the next step's size within a range around the current one.
inline G4int GetMaxNoSteps() const;
inline void SetMaxNoSteps( G4int val);
// Modify and Get the Maximum number of Steps that can be
// taken for the integration of a single segment -
// (ie a single call to AccurateAdvance).
//---------------------------------------------------------------------
//The following has been introduced by [hackabot] for testing purposes only
inline G4int GetTotalNoStepperCalls() const;
//---------------------------------------------------------------------
public: // without description
inline void SetHmin(G4double newval);
inline void SetVerboseLevel(G4int newLevel);
inline G4double GetVerboseLevel() const;
inline G4double GetSmallestFraction() const;
void SetSmallestFraction( G4double val );
protected: // without description
void WarnSmallStepSize( G4double hnext, G4double hstep,
G4double h, G4double xDone,
G4int noSteps);
void WarnTooManyStep( G4double x1start, G4double x2end, G4double xCurrent);
void WarnEndPointTooFar (G4double endPointDist,
G4double hStepSize ,
G4double epsilonRelative,
G4int debugFlag);
// Issue warnings for undesirable situations
void PrintStatus( const G4double* StartArr,
G4double xstart,
const G4double* CurrentArr,
G4double xcurrent,
G4double requestStep,
G4int subStepNo );
void PrintStatus( const G4FieldTrack& StartFT,
const G4FieldTrack& CurrentFT,
G4double requestStep,
G4int subStepNo );
void PrintStat_Aux( const G4FieldTrack& aFieldTrack,
G4double requestStep,
G4double actualStep,
G4int subStepNo,
G4double subStepSize,
G4double dotVelocities );
// Verbose output for debugging
void PrintStatisticsReport() ;
// Report on the number of steps, maximum errors etc.
#ifdef QUICK_ADV_TWO
G4bool QuickAdvance( G4double yarrin[], // In
const G4double dydx[],
G4double hstep,
G4double yarrout[], // Out
G4double& dchord_step, // Out
G4double& dyerr ); // in length
#endif
private:
G4FSALIntegrationDriver(const G4FSALIntegrationDriver&);
G4FSALIntegrationDriver& operator=(const G4FSALIntegrationDriver&);
// Private copy constructor and assignment operator.
private:
// ---------------------------------------------------------------
// INVARIANTS
G4double fMinimumStep;
// Minimum Step allowed in a Step (in absolute units)
G4double fSmallestFraction; // Expected range 1e-12 to 5e-15;
// Smallest fraction of (existing) curve length - in relative units
// below this fraction the current step will be the last
const G4int fNoIntegrationVariables; // Number of Variables in integration
const G4int fMinNoVars; // Minimum number for FieldTrack
const G4int fNoVars; // Full number of variable
G4int fMaxNoSteps;
static const G4int fMaxStepBase;
G4double safety;
G4double pshrnk; // exponent for shrinking
G4double pgrow; // exponent for growth
G4double errcon;
// Parameters used to grow and shrink trial stepsize.
static const G4double max_stepping_increase;
static const G4double max_stepping_decrease;
// Maximum stepsize increase/decrease factors.
G4int fStatisticsVerboseLevel;
// ---------------------------------------------------------------
// DEPENDENT Objects
G4VFSALIntegrationStepper *pIntStepper;
// ---------------------------------------------------------------
// STATE
G4int fNoTotalSteps, fNoBadSteps, fNoSmallSteps, fNoInitialSmallSteps;
G4double fDyerr_max, fDyerr_mx2;
G4double fDyerrPos_smTot, fDyerrPos_lgTot, fDyerrVel_lgTot;
G4double fSumH_sm, fSumH_lg;
// Step Statistics
G4int fVerboseLevel; // Verbosity level for printing (debug, ..)
// Could be varied during tracking - to help identify issues
//For Test Purposes :-
G4int TotalNoStepperCalls;
};
#include "G4FSALIntegrationDriver.icc"
#endif /* G4FSALIntegrationDriver_Def */
@@ -0,0 +1,178 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4FSALIntegrationDriver.icc 97387 2016-06-02 10:03:42Z gcosmo $
//
// --------------------------------------------------------------------
inline
G4double G4FSALIntegrationDriver::GetHmin() const
{
return fMinimumStep;
}
inline
G4double G4FSALIntegrationDriver::Hmin() const
{
return fMinimumStep;
}
inline
G4double G4FSALIntegrationDriver::GetSafety() const
{
return safety;
}
inline
G4double G4FSALIntegrationDriver::GetPshrnk() const
{
return pshrnk;
}
inline
G4double G4FSALIntegrationDriver::GetPgrow() const
{
return pgrow;
}
inline
G4double G4FSALIntegrationDriver::GetErrcon() const
{
return errcon;
}
inline
void G4FSALIntegrationDriver::SetHmin(G4double newval)
{
fMinimumStep = newval;
}
inline
G4double G4FSALIntegrationDriver::ComputeAndSetErrcon()
{
errcon = std::pow(max_stepping_increase/GetSafety(),1.0/GetPgrow());
return errcon;
}
inline
void G4FSALIntegrationDriver::ReSetParameters(G4double new_safety)
{
safety = new_safety;
pshrnk = -1.0 / pIntStepper->IntegratorOrder();
pgrow = -1.0 / (1.0 + pIntStepper->IntegratorOrder());
ComputeAndSetErrcon();
}
inline
void G4FSALIntegrationDriver::SetSafety(G4double val)
{
safety=val;
ComputeAndSetErrcon();
}
inline
void G4FSALIntegrationDriver::SetPgrow(G4double val)
{
pgrow=val;
ComputeAndSetErrcon();
}
inline
void G4FSALIntegrationDriver::SetErrcon(G4double val)
{
errcon=val;
}
inline
void G4FSALIntegrationDriver::RenewStepperAndAdjust(G4VFSALIntegrationStepper *pItsStepper)
{
pIntStepper = pItsStepper;
ReSetParameters();
}
inline
const G4VFSALIntegrationStepper* G4FSALIntegrationDriver::GetStepper() const
{
return pIntStepper;
}
inline
G4VFSALIntegrationStepper* G4FSALIntegrationDriver::GetStepper()
{
return pIntStepper;
}
inline
G4int G4FSALIntegrationDriver::GetMaxNoSteps() const
{
return fMaxNoSteps;
}
inline
void G4FSALIntegrationDriver::SetMaxNoSteps(G4int val)
{
fMaxNoSteps= val;
}
inline
void G4FSALIntegrationDriver::GetDerivatives(const G4FieldTrack &y_curr, // const, INput
G4double dydx[]) // OUTput
{
G4double tmpValArr[G4FieldTrack::ncompSVEC];
y_curr.DumpToArray( tmpValArr );
pIntStepper -> RightHandSide( tmpValArr , dydx );
}
inline
G4double G4FSALIntegrationDriver::GetVerboseLevel() const
{
return fVerboseLevel;
}
inline
void G4FSALIntegrationDriver::SetVerboseLevel(G4int newLevel)
{
fVerboseLevel= newLevel;
}
inline
G4double G4FSALIntegrationDriver::GetSmallestFraction() const
{
return fSmallestFraction;
}
inline
G4int G4FSALIntegrationDriver::GetNoTotalSteps() const
{
return fNoTotalSteps;
}
inline
G4int G4FSALIntegrationDriver::GetTotalNoStepperCalls() const
{
return TotalNoStepperCalls;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Field.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4Field.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4Field
@@ -83,7 +83,7 @@ class G4Field
G4Field( G4bool gravityOn= false);
G4Field( const G4Field & );
virtual ~G4Field();
inline G4Field& operator = (const G4Field &p);
G4Field& operator = (const G4Field &p);
// A field signature function that can be used to insure
// that the Equation of motion object and the G4Field object
@@ -99,9 +99,11 @@ class G4Field
// Does this field include gravity?
inline void SetGravityActive( G4bool OnOffFlag );
virtual G4Field* Clone() const;
//Implements cloning, needed by G4 MT
virtual G4Field* Clone() const;
// Implements cloning, needed by G4 MT
private:
G4bool fGravityActive;
};
@@ -37,12 +37,20 @@
// it possible to choose other stepper,like G4CashKarpRK45 or G4RKG3_Stepper,
// by setting StepperNumber : new HelixMixedStepper(EqRhs,N)
//
// N=0 G4ExplicitEuler; N=1 G4ImplicitEuler;
// N=2 G4SimpleRunge; N=3 G4SimpleHeum;
// N=4 G4ClassicalRK4; N=5 G4HelixExplicitEuler;
// N=6 G4HelixExplicitEuler; N=7 G4HelixSimpleRunge;
// N=4 G4ClassicalRK4;
// N=6 G4HelixImplicitEuler; N=7 G4HelixSimpleRunge;
// N=8 G4CashKarpRK45; N=9 G4ExactHelixStepper;
// N=10 G4RKG3_Stepper;
// N=10 G4RKG3_Stepper; N=13 G4NystromRK4
// N=23 BogackiShampine23 N=145 TsitourasRK45
// N=45 BogackiShampine45 N=745 DormandPrince745 (ie DoPri5)
//
// For completeness also available are:
// N=11 G4ExplicitEuler N=12 G4ImplicitEuler; -- Likely poor
// N=5 G4HelixExplicitEuler (testing only)
// For recommendations see comments in 'SetupStepper' method.
//
// Note: Like other helix steppers, only applicable in pure magnetic field
//
// History:
// Derived from ExactHelicalStepper 18/05/07
@@ -60,7 +68,7 @@ class G4HelixMixedStepper: public G4MagHelicalStepper
public:
G4HelixMixedStepper(G4Mag_EqRhs *EqRhs,G4int fStepperNumber= -1, G4double Angle_threshold= -1.0);
G4HelixMixedStepper(G4Mag_EqRhs *EqRhs,G4int StepperNumber= -1, G4double Angle_threshold= -1.0);
~G4HelixMixedStepper();
void Stepper( const G4double y[],
@@ -94,8 +102,11 @@ class G4HelixMixedStepper: public G4MagHelicalStepper
G4int IntegratorOrder() const { return 4; }
private:
// Mixed Integration RK4 for 'small' steps
G4MagIntegratorStepper* fRK4Stepper;
G4MagIntegratorStepper* fRK4Stepper;
G4int fStepperNumber; // Int ID of RK stepper
// Threshold angle (in radians ) - above it Helical stepper is used
G4double fAngle_threshold;
private:
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4LineCurrentMagField.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4LineCurrentMagField.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4LineCurrentMagField
@@ -54,7 +54,8 @@ class G4LineCurrentMagField : public G4MagneticField
void GetFieldValue(const G4double yTrack[] ,
G4double B[] ) const;
G4LineCurrentMagField* Clone() const;
G4Field* Clone() const;
private:
G4double fFieldConstant;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MagIntegratorStepper.hh 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4MagIntegratorStepper.hh 97387 2016-06-02 10:03:42Z gcosmo $
//
//
// class G4MagIntegratorStepper
@@ -55,7 +55,10 @@ class G4MagIntegratorStepper
G4MagIntegratorStepper(G4EquationOfMotion *Equation,
G4int numIntegrationVariables,
G4int numStateVariables=12);
G4int numStateVariables=12,
bool isFSAL= false
// , G4int methodOrder
);
virtual ~G4MagIntegratorStepper();
// Constructor and destructor. No actions.
@@ -69,7 +72,7 @@ class G4MagIntegratorStepper
// Integrates ODE starting values y[0 to 6].
// Outputs yout[] and its estimated error yerr[].
virtual G4double DistChord() const = 0;
virtual G4double DistChord() const = 0;
// Estimate the maximum distance of a chord from the true path
// over the segment last integrated.
@@ -87,12 +90,9 @@ class G4MagIntegratorStepper
// Utility method to supply the standard Evaluation of the
// Right Hand side of the associated equation.
inline G4int GetNumberOfVariables() const;
// Get the number of variables that the stepper will integrate over.
// void SetNumberOfVariables(G4int newNo); // Dangerous & obsolete ...
inline G4int GetNumberOfStateVariables() const;
// Get the number of variables of state variables (>= above, integration)
@@ -100,11 +100,25 @@ class G4MagIntegratorStepper
// Returns the order of the integrator
// i.e. its error behaviour is of the order O(h^order).
G4int IntegrationOrder() { return fIntegrationOrder; }
// Replacement method - using new data member
inline G4EquationOfMotion *GetEquationOfMotion();
// As some steppers (eg RKG3) require other methods of Eq_Rhs
// this function allows for access to them.
inline void SetEquationOfMotion(G4EquationOfMotion* newEquation);
inline unsigned long GetfNoRHSCalls(){ return fNoRHSCalls; }
// void IncrementRHSCalls() { fNoRHSCalls++; }
inline void ResetfNORHSCalls(){ fNoRHSCalls = 0; }
// Count number of calls to RHS method(s)
bool IsFSAL() { return fIsFSAL; }
protected:
void SetIntegrationOrder(int order) { fIntegrationOrder= order; }
void SetFSAL( bool flag= true) { fIsFSAL= flag; }
private:
G4MagIntegratorStepper(const G4MagIntegratorStepper&);
@@ -117,6 +131,14 @@ class G4MagIntegratorStepper
const G4int fNoIntegrationVariables; // Number of Variables in integration
const G4int fNoStateVariables; // Number required for FieldTrack
// const G4int fNumberOfVariables;
// Counter for calls to RHS method
mutable unsigned long fNoRHSCalls;
// Parameters of a RK method -- must be shared by all steppers of a type
// -- Invariants for a class
/* const */ int fIntegrationOrder; // all ClassicalRK4 steppers are 4th order
/* const */ bool fIsFSAL; // Depends on RK method & implementation
};
#include "G4MagIntegratorStepper.icc"
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MagIntegratorStepper.icc 66356 2012-12-18 09:02:32Z gcosmo $
// $Id: G4MagIntegratorStepper.icc 97387 2016-06-02 10:03:42Z gcosmo $
//
inline
@@ -58,6 +58,7 @@ inline
void G4MagIntegratorStepper::RightHandSide( const double y[], double dydx[] )
{
fEquation_Rhs-> RightHandSide(y, dydx);
fNoRHSCalls++; // IncrementRHSCalls();
}
inline
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4QuadrupoleMagField.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4QuadrupoleMagField.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4QuadrupoleMagField
@@ -63,7 +63,8 @@ class G4QuadrupoleMagField : public G4MagneticField
void GetFieldValue(const G4double yTrack[],
G4double B[] ) const;
G4QuadrupoleMagField* Clone() const;
G4Field* Clone() const;
private:
G4double fGradient;
@@ -0,0 +1,68 @@
//
// G4TsitourasRK45.hh
// Geant4
//
// Created by hackabot on 11/06/15.
//
//
#ifndef Tsitouras_RK45
#define Tsitouras_RK45
#include "G4MagIntegratorStepper.hh"
class G4TsitourasRK45 : public G4MagIntegratorStepper
{
public:
G4TsitourasRK45(G4EquationOfMotion *EqRhs,
G4int numberOfVariables = 6,
G4bool primary = true);
~G4TsitourasRK45();
void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[] ) ;
void SetupInterpolation( /* const G4double yInput[],
const G4double dydx[],
const G4double Step */ );
//For calculating the output at the tau fraction of Step
void Interpolate( const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double yOut[],
G4double tau );
void interpolate( const G4double yInput[],
const G4double dydx[],
G4double yOut[],
G4double Step,
G4double tau);
G4double DistChord() const;
G4int IntegratorOrder() const {return 4; }
// G4double *getLastDydx();
private :
G4TsitourasRK45(const G4TsitourasRK45&);
G4TsitourasRK45& operator=(const G4TsitourasRK45&);
G4double *ak2, *ak3, *ak4, *ak5, *ak6, *ak7, *ak8, *yTemp, *yIn;
G4double fLastStepLength;
G4double *fLastInitialVector, *fLastFinalVector,
*fLastDyDx, *fMidVector, *fMidError;
// for DistChord calculations
G4TsitourasRK45* fAuxStepper;
};
#endif /* defined(__Geant4__G4TsitourasRK45__) */
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UniformElectricField.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4UniformElectricField.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4UniformElectricField
@@ -63,7 +63,8 @@ class G4UniformElectricField : public G4ElectricField
virtual void GetFieldValue(const G4double pos[4], G4double *field) const;
virtual G4UniformElectricField* Clone() const;
virtual G4Field* Clone() const;
private:
G4double fFieldComponents[6] ;
@@ -70,7 +70,7 @@ class G4UniformGravityField : public G4Field
virtual void GetFieldValue(const G4double Point[4], G4double *field) const;
virtual G4UniformGravityField* Clone() const;
virtual G4Field* Clone() const;
private:
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4UniformMagField.hh 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4UniformMagField.hh 96751 2016-05-04 09:39:38Z gcosmo $
//
//
// class G4UniformMagField
@@ -71,7 +71,7 @@ class G4UniformMagField : public G4MagneticField
G4ThreeVector GetConstantFieldValue() const;
// Return the field value
virtual G4UniformMagField* Clone() const;
virtual G4Field* Clone() const;
private:
@@ -0,0 +1,148 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VFSALIntegrationStepper.hh
//
// class G4VFSALIntegrationStepper
//
// Class description:
// Class similar to G4VMagIntegratorStepper, for steppers which
// estimate the value of the derivative at the projected endpoint
// of integration - at each successful step.
// This ability is known as 'First Same As Last' (FSAL). It
// reduces the number of required calls to the equation's
// RightHandSide method, and, as such the number of calls to the
// (potentially expensive) field evaluation methods.
//
// Based on G4VMagIntegratorStepper
//
// Design/first implementation: Somnath Banerjee, May-Aug 2015,
// Work supported by the Google Summer of Code 2015.
// Supervision/improvement: John Apostolakis 2015-2016
// --------------------------------------------------------------------
#ifndef FSAL_MAGIntegrator_STEPPER
#define FSAL_MAGIntegrator_STEPPER
#include "G4Types.hh"
#include "G4EquationOfMotion.hh"
class G4VFSALIntegrationStepper
{
public: // with description
G4VFSALIntegrationStepper (G4EquationOfMotion* Equation,
G4int numIntegrationVariables,
G4int numStateVariables=12);
virtual ~G4VFSALIntegrationStepper();
// Constructor and destructor. No actions.
virtual void Stepper( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[],
G4double lastDydx[]) = 0 ;
// The stepper for the Runge Kutta integration.
// The stepsize is fixed, with the Step size given by h.
// Integrates ODE starting values y[0 to 6].
// Outputs yout[] and its estimated error yerr[].
virtual G4double DistChord() const = 0;
// Estimate the maximum distance of a chord from the true path
// over the segment last integrated.
virtual void ComputeRightHandSide( const G4double y[], G4double dydx[] );
// Must compute the RightHandSide as in the method below
// Optionally can cache the input y[] and the dydx[] values computed.
// virtual G4bool isFSAL() const = 0;
// //Return true if the stepper uses FSAL (First Same As Last)
// G4double *getLastDydx() {return 0;}
inline void NormaliseTangentVector( G4double vec[6] );
// Simple utility function to (re)normalise 'unit velocity' vector.
inline void NormalisePolarizationVector( G4double vec[12] );
// Simple utility function to (re)normalise 'unit spin' vector.
void RightHandSide( const double y[], double dydx[] );
// Utility method to supply the standard Evaluation of the
// Right Hand side of the associated equation.
inline G4int GetNumberOfVariables() const;
// Get the number of variables that the stepper will integrate over.
// void SetNumberOfVariables(G4int newNo); // Dangerous & obsolete ...
inline G4int GetNumberOfStateVariables() const;
// Get the number of variables of state variables (>= above, integration)
virtual G4int IntegratorOrder() const = 0;
// Returns the order of the integrator
// i.e. its error behaviour is of the order O(h^order).
inline G4EquationOfMotion *GetEquationOfMotion();
// As some steppers (eg RKG3) require other methods of Eq_Rhs
// this function allows for access to them.
inline void SetEquationOfMotion(G4EquationOfMotion* newEquation);
//--- --- For DEBUG --- ---
inline G4int GetfNoRHSCalls(){
return fNoRHSCalls;
}
void increasefNORHSCalls();
inline void ResetfNORHSCalls(){
fNoRHSCalls = 0;
}
//--- --- ///////// --- ---
private:
G4VFSALIntegrationStepper(const G4VFSALIntegrationStepper&);
G4VFSALIntegrationStepper& operator=(const G4VFSALIntegrationStepper&);
// Private copy constructor and assignment operator.
private:
G4EquationOfMotion *fEquation_Rhs;
const G4int fNoIntegrationVariables; // Number of Variables in integration
const G4int fNoStateVariables; // Number required for FieldTrack
//--- --- For DEBUG --- ---
G4int fNoRHSCalls;
//--- --- ///////// --- ---
// const G4int fNumberOfVariables;
};
#include "G4VFSALIntegrationStepper.icc"
#endif /* G4VFSALIntegrationStepper */
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VFSALIntegrationStepper.icc 97387 2016-06-02 10:03:42Z gcosmo $
//
inline
G4EquationOfMotion* G4VFSALIntegrationStepper::GetEquationOfMotion()
{
return fEquation_Rhs;
}
inline void
G4VFSALIntegrationStepper::SetEquationOfMotion(G4EquationOfMotion* newEquation)
{
if( newEquation != 0 )
{
fEquation_Rhs= newEquation;
}
}
inline
G4int G4VFSALIntegrationStepper::GetNumberOfVariables() const
{
return fNoIntegrationVariables;
}
inline
G4int G4VFSALIntegrationStepper::GetNumberOfStateVariables() const
{
return fNoStateVariables;
}
inline
void G4VFSALIntegrationStepper::NormaliseTangentVector( G4double vec[6] )
{
G4double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
if( std::fabs(drds2 - 1.0) > 1.e-14 )
{
G4double normx = 1.0 / std::sqrt(drds2);
for(G4int i=3;i<6;i++) { vec[i] *= normx; }
}
}
inline
void G4VFSALIntegrationStepper::NormalisePolarizationVector( G4double vec[12] )
{
G4double drds2 = vec[9]*vec[9]+vec[10]*vec[10]+vec[11]*vec[11];
if( drds2 > 0. )
{
if( std::fabs(drds2 - 1.0) > 1.e-14 )
{
G4double normx = 1.0 / std::sqrt(drds2);
for(G4int i=9;i<12;i++) { vec[i] *= normx; }
}
}
}
+25 -1
View File
@@ -11,7 +11,7 @@
#
# Generated on : 29/9/2010
#
# $Id: sources.cmake 75774 2013-11-06 09:16:47Z gcosmo $
# $Id: sources.cmake 97598 2016-06-06 07:19:46Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -29,6 +29,8 @@ include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
include(Geant4MacroDefineModule)
GEANT4_DEFINE_MODULE(NAME G4magneticfield
HEADERS
G4BogackiShampine23.hh
G4BogackiShampine45.hh
G4CachedMagneticField.hh
G4CashKarpRKF45.hh
G4ChargeState.hh
@@ -38,6 +40,10 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4ClassicalRK4.hh
G4ConstRK4.hh
G4DELPHIMagField.hh
G4DoLoMcPriRK34.hh
G4DormandPrince745.hh
G4DormandPrinceRK56.hh
G4DormandPrinceRK78.hh
G4ElectricField.hh
G4ElectroMagneticField.hh
G4EqEMFieldWithEDM.hh
@@ -55,6 +61,12 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4FieldManagerStore.hh
G4FieldTrack.hh
G4FieldTrack.icc
G4FSALBogackiShampine45.hh
G4FSALDormandPrince745.hh
G4FSALIntegrationDriver.hh
G4FSALIntegrationDriver.icc
G4VFSALIntegrationStepper.hh
G4VFSALIntegrationStepper.icc
G4HarmonicPolMagField.hh
G4HelixExplicitEuler.hh
G4HelixHeum.hh
@@ -85,10 +97,13 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4SimpleRunge.hh
G4TrialsCounter.hh
G4TrialsCounter.icc
G4TsitourasRK45.hh
G4UniformElectricField.hh
G4UniformGravityField.hh
G4UniformMagField.hh
SOURCES
G4BogackiShampine23.cc
G4BogackiShampine45.cc
G4CachedMagneticField.cc
G4CashKarpRKF45.cc
G4ChargeState.cc
@@ -97,6 +112,10 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4ClassicalRK4.cc
G4ConstRK4.cc
G4DELPHIMagField.cc
G4DoLoMcPriRK34.cc
G4DormandPrince745.cc
G4DormandPrinceRK56.cc
G4DormandPrinceRK78.cc
G4ElectricField.cc
G4ElectroMagneticField.cc
G4EqEMFieldWithEDM.cc
@@ -111,6 +130,10 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4FieldManager.cc
G4FieldManagerStore.cc
G4FieldTrack.cc
G4FSALBogackiShampine45.cc
G4FSALDormandPrince745.cc
G4FSALIntegrationDriver.cc
G4VFSALIntegrationStepper.cc
G4HarmonicPolMagField.cc
G4HelixExplicitEuler.cc
G4HelixHeum.cc
@@ -136,6 +159,7 @@ GEANT4_DEFINE_MODULE(NAME G4magneticfield
G4SimpleHeum.cc
G4SimpleRunge.cc
G4TrialsCounter.cc
G4TsitourasRK45.cc
G4UniformElectricField.cc
G4UniformGravityField.cc
G4UniformMagField.cc
@@ -0,0 +1,213 @@
// Bogacki-Shampine - 4 - 3(2) non-FSAL implementation by Somnath Banerjee
// Supervision / code review: John Apostolakis
//
// Sponsored by Google in Google Summer of Code 2015.
//
// First version: 20 May 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
//
// History
// -----------------------------
// Created by Somnath Banerjee on 20 May 2015
///////////////////////////////////////////////////////////////////////////////
/*
This contains the stepper function of the G4BogackiShampine23 class
The Bogacki shampine method has the following Butcher's tableau
0 |
1/2|1/2
3/4|0 3/4
1 |2/9 1/3 4/9
-------------------
|2/9 1/3 4/9 0
|7/24 1/4 1/3 1/8
*/
#include "G4BogackiShampine23.hh"
#include "G4LineSection.hh"
using namespace std;
//Constructor
G4BogackiShampine23::G4BogackiShampine23(G4EquationOfMotion *EqRhs,
G4int noIntegrationVariables,
G4bool primary)
: G4MagIntegratorStepper(EqRhs, noIntegrationVariables),
fLastStepLength(0.), fAuxStepper(0)
{
const G4int numberOfVariables = noIntegrationVariables;
ak2 = new G4double[numberOfVariables] ;
ak3 = new G4double[numberOfVariables] ;
ak4 = new G4double[numberOfVariables] ;
pseudoDydx_for_DistChord = new G4double[numberOfVariables];
const G4int numStateVars = std::max(noIntegrationVariables,
GetNumberOfStateVariables() );
yTemp = new G4double[numberOfVariables] ;
yIn = new G4double[numberOfVariables] ;
fLastInitialVector = new G4double[numStateVars] ;
fLastFinalVector = new G4double[numStateVars] ;
fLastDyDx = new G4double[numStateVars];
fMidVector = new G4double[numStateVars];
fMidError = new G4double[numStateVars];
if( primary )
{
fAuxStepper = new G4BogackiShampine23(EqRhs, numberOfVariables, !primary);
}
}
//Destructor
G4BogackiShampine23::~G4BogackiShampine23()
{
delete[] ak2;
delete[] ak3;
delete[] ak4;
delete[] yTemp;
delete[] yIn;
delete[] fLastInitialVector;
delete[] fLastFinalVector;
delete[] fLastDyDx;
delete[] fMidVector;
delete[] fMidError;
delete fAuxStepper;
}
//******************************************************************************
//
// Given values for n = 4 variables yIn[0,...,n-1]
// known at x, use the 3rd order Bogacki Shampine method
// to advance the solution over an interval Step
// and return the incremented variables as yOut[0,...,n-1]. Also
// return an estimate of the local truncation error yErr[] using the
// embedded 2nd order method. The user supplies routine
// RightHandSide(y,dydx), which returns derivatives dydx for y .
//******************************************************************************
void
G4BogackiShampine23::Stepper( const G4double yInput[],
const G4double DyDx[],
G4double Step,
G4double yOut[],
G4double yErr[])
{
G4int i;
const G4double b21 = 0.5 ,
b31 = 0. , b32 = 3.0/4.0 ,
b41 = 2.0/9.0, b42 = 1.0/3.0 , b43 = 4.0/9.0;
const G4double dc1 = b41 - 7.0/24.0 , dc2 = b42 - 1.0/4.0 ,
dc3 = b43 - 1.0/3.0 , dc4 = - 0.125 ;
// Initialise time to t0, needed when it is not updated by the integration.
// [ Note: Only for time dependent fields (usually electric)
// is it neccessary to integrate the time.]
yOut[7] = yTemp[7] = yIn[7];
const G4int numberOfVariables= this->GetNumberOfVariables(); // The number of variables to be integrated over
// Saving yInput because yInput and yOut can be aliases for same array
for(i=0;i<numberOfVariables;i++)
{
yIn[i]=yInput[i];
}
// RightHandSide(yIn, dydx) ; // 1st Step --Not doing, getting passed
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + b21*Step*DyDx[i] ;
}
RightHandSide(yTemp, ak2) ; // 2nd Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b31*DyDx[i] + b32*ak2[i]) ;
}
RightHandSide(yTemp, ak3) ; // 3rd Step
for(i=0;i<numberOfVariables;i++)
{
yOut[i] = yIn[i] + Step*(b41*DyDx[i] + b42*ak2[i] + b43*ak3[i]) ;
}
RightHandSide(yOut, ak4) ; // 4th Step
for(i=0;i<numberOfVariables;i++)
{
// yOut[i] = yIn[i] + Step*(c1*DyDx[i]+ c2*ak2[i] + c3*ak3[i] + c4*ak4[i]);
yErr[i] = Step*(dc1*DyDx[i] + dc2*ak2[i] + dc3*ak3[i] +
dc4*ak4[i] ) ;
// Store Input and Final values, for possible use in calculating chord
fLastInitialVector[i] = yIn[i] ;
fLastFinalVector[i] = yOut[i];
fLastDyDx[i] = DyDx[i];
}
// NormaliseTangentVector( yOut ); // Not wanted
fLastStepLength =Step;
return ;
}
G4double G4BogackiShampine23::DistChord() const
{
G4double distLine, distChord;
G4ThreeVector initialPoint, finalPoint, midPoint;
// Store last initial and final points (they will be overwritten in self-Stepper call!)
initialPoint = G4ThreeVector( fLastInitialVector[0],
fLastInitialVector[1], fLastInitialVector[2]);
finalPoint = G4ThreeVector( fLastFinalVector[0],
fLastFinalVector[1], fLastFinalVector[2]);
// Do half a step using StepNoErr
fAuxStepper->Stepper( fLastInitialVector, fLastDyDx, 0.5 * fLastStepLength,
fMidVector, fMidError );
midPoint = G4ThreeVector( fMidVector[0], fMidVector[1], fMidVector[2]);
// Use stored values of Initial and Endpoint + new Midpoint to evaluate
// distance of Chord
if (initialPoint != finalPoint)
{
distLine = G4LineSection::Distline( midPoint, initialPoint, finalPoint );
distChord = distLine;
}
else
{
distChord = (midPoint-initialPoint).mag();
}
return distChord;
}
//------Verified-------
@@ -0,0 +1,583 @@
// Bogacki-Shampine's RK 5(4) non-FSAL implementation by Somnath Banerjee
// Supervision / code review: John Apostolakis
//
// Sponsored by Google in Google Summer of Code 2015.
//
// First version: 25 May 2015
//
// This code is made available subject to the Geant4 license, a copy of
// which is available at
// http://geant4.org/license
//
// History
// -----------------------------
// Created by Somnath Banerjee on May-August 2015
// Improvements by John Apostolakis, May 2016
///////////////////////////////////////////////////////////////////////////////
//
// This is the source file of G4BogackiShampine45 class containing the
// definition of the stepper() method that evaluates one step in
// field propagation.
//
// The Butcher table of the Bogacki-Shampine-8-4-5 method is:
//
// 0 |
// 1/6 | 1/6
// 2/9 | 2/27 4/27
// 3/7 | 183/1372 -162/343 1053/1372
// 2/3 | 68/297 -4/11 42/143 1960/3861
// 3/4 | 597/22528 81/352 63099/585728 58653/366080 4617/20480
// 1 | 174197/959244 -30942/79937 8152137/19744439 666106/1039181 -29421/29068 482048/414219
// 1 | 587/8064 0 4440339/15491840 24353/124800 387/44800 2152/5985 7267/94080
//-------------------------------------------------------------------------------------------------------------------
// 587/8064 0 4440339/15491840 24353/124800 387/44800 2152/5985 7267/94080 0
// 2479/34992 0 123/416 612941/3411720 43/1440 2272/6561 79937/1113912 3293/556956
//
// Do NOT re-indent the lines above - their meaning becomes lost
// ********************************
// Coefficients have been obtained from rksuite.f : http://www.netlib.org/ode/rksuite/
// Note on meaning of label "non-FSAL version":
// This method calculates the deriviative dy/dx at the endpoint of the integration interval at each step.
// as part of its evaluation of the endpoint and its error.
// So this value is available to be returned, for re-use in case of a successful step.
// ( This is done in a 'later' version using a refined interface. )
#include <cassert>
#include "G4BogackiShampine45.hh"
#include "G4LineSection.hh"
G4bool G4BogackiShampine45::fPreparedConstants= false;
G4double G4BogackiShampine45::bi[12][7];
//Constructor
G4BogackiShampine45::G4BogackiShampine45(G4EquationOfMotion *EqRhs,
G4int noIntegrationVariables,
G4bool primary)
: G4MagIntegratorStepper(EqRhs, noIntegrationVariables),
fPreparedInterpolation(false)
{
const G4int numberOfVariables = noIntegrationVariables;
//New Chunk of memory being created for use by the stepper
//aki - for storing intermediate RHS
ak2 = new G4double[numberOfVariables];
ak3 = new G4double[numberOfVariables];
ak4 = new G4double[numberOfVariables];
ak5 = new G4double[numberOfVariables];
ak6 = new G4double[numberOfVariables];
ak7 = new G4double[numberOfVariables];
ak8 = new G4double[numberOfVariables];
ak9 = new G4double[numberOfVariables];
ak10 = new G4double[numberOfVariables];
ak11 = new G4double[numberOfVariables];
for (int i = 0; i < 6; i++) {
p[i]= new G4double[numberOfVariables];
}
assert ( GetNumberOfStateVariables() >= 8 );
const G4int numStateVars = std::max(noIntegrationVariables,
GetNumberOfStateVariables() );
// Must ensure space extra 'state' variables exists - i.e. yIn[7]
yTemp = new G4double[numStateVars];
yIn = new G4double[numStateVars] ;
fLastInitialVector = new G4double[numStateVars] ;
fLastFinalVector = new G4double[numStateVars] ;
fLastDyDx = new G4double[numberOfVariables]; // Only derivatives
fMidVector = new G4double[numberOfVariables]; // new G4double[numStateVars];
fMidError = new G4double[numberOfVariables]; // new G4double[numStateVars];
if( ! fPreparedConstants )
PrepareConstants();
if( primary )
{
fAuxStepper = new G4BogackiShampine45(EqRhs, numberOfVariables, false);
}
}
//Destructor
G4BogackiShampine45::~G4BogackiShampine45(){
//clear all previously allocated memory for stepper and DistChord
delete[] ak2;
delete[] ak3;
delete[] ak4;
delete[] ak5;
delete[] ak6;
delete[] ak7;
delete[] ak8;
delete[] ak9;
delete[] ak10;
delete[] ak11;
for (int i = 0; i < 6; i++) {
delete[] p[i];
}
delete[] yTemp;
delete[] yIn;
delete[] fLastInitialVector;
delete[] fLastFinalVector;
delete[] fLastDyDx;
delete[] fMidVector;
delete[] fMidError;
delete fAuxStepper;
}
// G4double* G4BogackiShampine45::getLastDydx(){
// return ak8;
// }
void
G4BogackiShampine45::GetLastDydx( G4double dyDxLast[] )
{
const G4int numberOfVariables= this->GetNumberOfVariables();
for(G4int i=0; i < numberOfVariables; i++ ){
dyDxLast[i] = ak9[i];
}
}
//Stepper :
// Passing in the value of yInput[],the first time dydx[] and Step length
// Giving back yOut and yErr arrays for output and error respectively
void G4BogackiShampine45::Stepper( const G4double yInput[],
const G4double DyDx[],
G4double Step,
G4double yOut[],
G4double yErr[] )
{
G4int i;
// Constants from the Butcher tableu
const G4double
b21 = 1.0/6.0 ,
b31 = 2.0/27.0 , b32 = 4.0/27.0,
b41 = 183.0/1372.0 , b42 = -162.0/343.0, b43 = 1053.0/1372.0,
b51 = 68.0/297.0, b52 = -4.0/11.0,
b53 = 42.0/143.0, b54 = 1960.0/3861.0,
b61 = 597.0/22528.0, b62 = 81.0/352.0,
b63 = 63099.0/585728.0, b64 = 58653.0/366080.0,
b65 = 4617.0/20480.0,
b71 = 174197.0/959244.0, b72 = -30942.0/79937.0,
b73 = 8152137.0/19744439.0, b74 = 666106.0/1039181.0,
b75 = -29421.0/29068.0, b76 = 482048.0/414219.0,
b81 = 587.0/8064.0, b82 = 0.0,
b83 = 4440339.0/15491840.0, b84 = 24353.0/124800.0,
b85 = 387.0/44800.0, b86 = 2152.0/5985.0,
b87 = 7267.0/94080.0;
// c1 = 2479.0/34992.0,
// c2 = 0.0,
// c3 = 123.0/416.0,
// c4 = 612941.0/3411720.0,
// c5 = 43.0/1440.0,
// c6 = 2272.0/6561.0,
// c7 = 79937.0/1113912.0,
// c8 = 3293.0/556956.0,
// For the embedded higher order method only the difference of values
// taken and is used directly later (instead of defining the last row
// of Butcher table in separate constants and taking the
// difference)
const G4double
dc1 = b81 - 2479.0 / 34992.0 ,
dc2 = 0.0,
dc3 = b83 - 123.0 / 416.0 ,
dc4 = b84 - 612941.0 / 3411720.0,
dc5 = b85 - 43.0 / 1440.0,
dc6 = b86 - 2272.0 / 6561.0,
dc7 = b87 - 79937.0 / 1113912.0,
dc8 = - 3293.0 / 556956.0;
const G4int numberOfVariables= this->GetNumberOfVariables();
// The number of variables to be integrated over
yOut[7] = yTemp[7] = yIn[7];
// Saving yInput because yInput and yOut can be aliases for same array
for(i=0;i<numberOfVariables;i++)
{
yIn[i]=yInput[i];
}
// RightHandSide(yIn, dydx) ;
// 1st Step - Not doing, getting passed
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + b21*Step*DyDx[i] ;
}
RightHandSide(yTemp, ak2) ; // 2nd Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b31*DyDx[i] + b32*ak2[i]) ;
}
RightHandSide(yTemp, ak3) ; // 3rd Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b41*DyDx[i] + b42*ak2[i] + b43*ak3[i]) ;
}
RightHandSide(yTemp, ak4) ; // 4th Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b51*DyDx[i] + b52*ak2[i] + b53*ak3[i] +
b54*ak4[i]) ;
}
RightHandSide(yTemp, ak5) ; // 5th Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b61*DyDx[i] + b62*ak2[i] + b63*ak3[i] +
b64*ak4[i] + b65*ak5[i]) ;
}
RightHandSide(yTemp, ak6) ; // 6th Step
for(i=0;i<numberOfVariables;i++)
{
yTemp[i] = yIn[i] + Step*(b71*DyDx[i] + b72*ak2[i] + b73*ak3[i] +
b74*ak4[i] + b75*ak5[i] + b76*ak6[i]);
}
RightHandSide(yTemp, ak7); //7th Step
for(i=0;i<numberOfVariables;i++)
{
yOut[i] = yIn[i] + Step*(b81*DyDx[i] + b82*ak2[i] + b83*ak3[i] +
b84*ak4[i] + b85*ak5[i] + b86*ak6[i] +
b87*ak7[i]);
}
RightHandSide(yOut, ak8); //8th Step - Final one Using FSAL
for(i=0;i<numberOfVariables;i++)
{
yErr[i] = Step*(dc1*DyDx[i] + dc2*ak2[i] + dc3*ak3[i] + dc4*ak4[i] +
dc5*ak5[i] + dc6*ak6[i] + dc7*ak7[i] + dc8*ak8[i]) ;
// Store Input and Final values, for possible use in calculating chord
fLastInitialVector[i] = yIn[i] ;
fLastFinalVector[i] = yOut[i];
fLastDyDx[i] = DyDx[i];
}
fLastStepLength = Step;
fPreparedInterpolation= false;
return ;
}
//The following has not been tested
//The DistChord() function fot the class - must define it here.
G4double G4BogackiShampine45::DistChord() const
{
G4double distLine, distChord;
G4ThreeVector initialPoint, finalPoint, midPoint;
// Store last initial and final points (they will be overwritten in self-Stepper call!)
initialPoint = G4ThreeVector( fLastInitialVector[0],
fLastInitialVector[1], fLastInitialVector[2]);
finalPoint = G4ThreeVector( fLastFinalVector[0],
fLastFinalVector[1], fLastFinalVector[2]);
#if 1
// Old method -- Do half a step using StepNoErr
fAuxStepper->Stepper( fLastInitialVector, fLastDyDx, 0.5 * fLastStepLength,
fMidVector, fMidError);
#else
// New method -- Using interpolation, requires only 3 extra stages (ie 3 extra field evaluations )
// Use Interpolation, instead of auxiliary stepper to evaluate midpoint
if( ! fPreparedInterpolation ) {
G4BogackiShampine45 *cThis= const_cast<G4BogackiShampine45 *>(this);
cThis-> SetupInterpolationHigh(); // ( fLastInitialVector, fLastDyDx, fLastStepLength );
}
//For calculating the output at the tau fraction of Step
G4double tau = 0.5;
// cThis->InterpolateHigh( /* fLastInitialVector, fLastDyDx, fLastStepLength, */, fMidVector, tau);
// Old arguments: ( /*yInput, dydx, step,*/ yOut, tau );
this->InterpolateHigh( tau, fMidVector );
#endif
midPoint = G4ThreeVector( fMidVector[0], fMidVector[1], fMidVector[2]);
// Use stored values of Initial and Endpoint + new Midpoint to evaluate
// distance of Chord
if (initialPoint != finalPoint)
{
distLine = G4LineSection::Distline( midPoint, initialPoint, finalPoint );
distChord = distLine;
}
else
{
distChord = (midPoint-initialPoint).mag();
}
return distChord;
}
void G4BogackiShampine45::SetupInterpolationHigh()
// ( const G4double *yInput, const G4double *dydx, const G4double Step)
{
//Coefficients for the additional stages :
const G4double
a91 = 455.0/6144.0 ,
a92 = 0.0 ,
a93 = 10256301.0/35409920.0 ,
a94 = 2307361.0/17971200.0 ,
a95 = -387.0/102400.0 ,
a96 = 73.0/5130.0 ,
a97 = -7267.0/215040.0 ,
a98 = 1.0/32.0 ,
a101 = -837888343715.0/13176988637184.0 ,
a102 = 30409415.0/52955362.0 ,
a103 = -48321525963.0/759168069632.0 ,
a104 = 8530738453321.0/197654829557760.0 ,
a105 = 1361640523001.0/1626788720640.0 ,
a106 = -13143060689.0/38604458898.0 ,
a107 = 18700221969.0/379584034816.0 ,
a108 = -5831595.0/847285792.0 ,
a109 = -5183640.0/26477681.0 ,
a111 = 98719073263.0/1551965184000.0 ,
a112 = 1307.0/123552.0 ,
a113 = 4632066559387.0/70181753241600.0 ,
a114 = 7828594302389.0/382182512025600.0 ,
a115 = 40763687.0/11070259200.0 ,
a116 = 34872732407.0/224610586200.0 ,
a117 = -2561897.0/30105600.0 ,
a118 = 1.0/10.0 ,
a119 = -1.0/10.0 ,
a1110 = -1403317093.0/11371610250.0 ;
const G4int numberOfVariables= this->GetNumberOfVariables();
// const G4double *yIn= fLastInitialVector;
const G4double *dydx= fLastDyDx;
const G4double Step = fLastStepLength;
yTemp[7] = yIn[7];
//Evaluate the extra stages :
for(int i=0; i<numberOfVariables; i++){
yTemp[i] = yIn[i] + Step*(a91*dydx[i] + a92*ak2[i] + a93*ak3[i] +
a94*ak4[i] + a95*ak5[i] + a96*ak6[i] +
a97*ak7[i] + a98*ak8[i] );
}
RightHandSide(yTemp, ak9); //9th stage
for(int i=0; i<numberOfVariables; i++){
yTemp[i] = yIn[i] + Step*(a101*dydx[i] + a102*ak2[i] + a103*ak3[i] +
a104*ak4[i] + a105*ak5[i] + a106*ak6[i] +
a107*ak7[i] + a108*ak8[i] + a109*ak9[i] );
}
RightHandSide(yTemp, ak10); //10th stage
for(int i=0; i<numberOfVariables; i++){
yTemp[i] = yIn[i] + Step*(a111*dydx[i] + a112*ak2[i] + a113*ak3[i] +
a114*ak4[i] + a115*ak5[i] + a116*ak6[i] +
a117*ak7[i] + a118*ak8[i] + a119*ak9[i] +
a1110*ak10[i] );
}
RightHandSide(yTemp, ak11); //11th stage
// In future we can restrict the number of variables interpolated
int nwant = numberOfVariables;
// Form the coefficients of the interpolating polynomial in its shifted
// and scaled form. The terms are grouped to minimize the errors
// of the transformation, to cope with ill-conditioning. ( From RKSUITE )
//
for (int l = 0; l < nwant; l++) {
// Coefficient of tau^6
p[5][l] = bi[5][6]*ak5[l] +
((bi[10][6]*ak10[l] + bi[8][6]*ak8[l]) +
(bi[7][6]*ak7[l] + bi[6][6]*ak6[l])) +
((bi[4][6]*ak4[l] + bi[9][6]*ak9[l]) +
(bi[3][6]*ak3[l] + bi[11][6]*ak11[l]) +
bi[1][6]*dydx[l]);
// Coefficient of tau^5
p[4][l] = (bi[10][5]*ak10[l] + bi[9][5]*ak9[l]) +
((bi[7][5]*ak7[l] + bi[6][5]*ak6[l]) +
bi[5][5]*ak5[l]) + ((bi[4][5]*ak4[l] +
bi[8][5]*ak8[l]) + (bi[3][5]*ak3[l] +
bi[11][5]*ak11[l]) + bi[1][5]*dydx[l]);
// Coefficient of tau^4
p[3][l] = ((bi[4][4]*ak4[l] + bi[8][4]*ak8[l]) +
(bi[7][4]*ak7[l] + bi[6][4]*ak6[l]) +
bi[5][4]*ak5[l]) + ((bi[10][4]*ak10[l] +
bi[9][4]*ak9[l]) + (bi[3][4]*ak3[l] +
bi[11][4]*ak11[l]) + bi[1][4]*dydx[l]);
// Coefficient of tau^3
p[2][l] = bi[5][3]*ak5[l] + bi[6][3]*ak6[l] +
((bi[3][3]*ak3[l] + bi[9][3]*ak9[l]) +
(bi[10][3]*ak10[l]+ bi[8][3]*ak8[l]) + bi[1][3]*dydx[l]) +
((bi[4][3]*ak4[l] + bi[11][3]*ak11[l]) + bi[7][3]*ak7[l]);
// Coefficient of tau^2
p[1][l] = bi[5][2]*ak5[l] + ((bi[6][2]*ak6[l] +
bi[8][2]*ak8[l]) + bi[1][2]*dydx[l]) +
((bi[3][2]*ak3[l] + bi[9][2]*ak9[l]) +
bi[10][2]*ak10[l])+ ((bi[4][2]*ak4[l] +
bi[11][2]*ak2[l]) + bi[7][2]*ak7[l]);
}
//
// Scale all the coefficients by the step size.
//
for (int i = 0; i < 6; i++) {
for (int l = 0; l < nwant; l++) {
p[i][l] *= Step;
}
}
fPreparedInterpolation= true;
}
void G4BogackiShampine45::PrepareConstants()
{
for(int i=1; i<= 11; i++)
bi[i][1] = 0.0 ;
for(int i=1; i<=6; i++)
bi[2][i] = 0.0 ;
bi[1][6] = -12134338393.0 / 1050809760.0 ,
bi[1][5] = -1620741229.0 / 50038560.0 ,
bi[1][4] = -2048058893.0 / 59875200.0 ,
bi[1][3] = -87098480009.0 / 5254048800.0 ,
bi[1][2] = -11513270273.0 / 3502699200.0 ,
//
bi[3][6] = -33197340367.0 / 1218433216.0 ,
bi[3][5] = -539868024987.0 / 6092166080.0 ,
bi[3][4] = -39991188681.0 / 374902528.0 ,
bi[3][3] = -69509738227.0 / 1218433216.0 ,
bi[3][2] = -29327744613.0 / 2436866432.0 ,
//
bi[4][6] = -284800997201.0 / 19905339168.0 ,
bi[4][5] = -7896875450471.0 / 165877826400.0 ,
bi[4][4] = -333945812879.0 / 5671036800.0 ,
bi[4][3] = -16209923456237.0 / 497633479200.0 ,
bi[4][2] = -2382590741699.0 / 331755652800.0 ,
//
bi[5][6] = -540919.0 / 741312.0 ,
bi[5][5] = -103626067.0 / 43243200.0 ,
bi[5][4] = -633779.0 / 211200.0 ,
bi[5][3] = -32406787.0 / 18532800.0 ,
bi[5][2] = -36591193.0 / 86486400.0 ,
//
bi[6][6] = 7157998304.0 / 374350977.0 ,
bi[6][5] = 30405842464.0 / 623918295.0 ,
bi[6][4] = 183022264.0 / 5332635.0 ,
bi[6][3] = -3357024032.0 / 1871754885.0 ,
bi[6][2] = -611586736.0 / 89131185.0 ,
//
bi[7][6] = -138073.0 / 9408.0 ,
bi[7][5] = -719433.0 / 15680.0 ,
bi[7][4] = -1620541.0 / 31360.0 ,
bi[7][3] = -385151.0 / 15680.0 ,
bi[7][2] = -65403.0 / 15680.0 ,
//
bi[8][6] = 1245.0 / 64.0 ,
bi[8][5] = 3991.0 / 64.0 ,
bi[8][4] = 4715.0 / 64.0 ,
bi[8][3] = 2501.0 / 64.0 ,
bi[8][2] = 149.0 / 16.0 ,
bi[8][1] = 1.0 ,
//
bi[9][6] = 55.0 / 3.0 ,
bi[9][5] = 71.0 ,
bi[9][4] = 103.0 ,
bi[9][3] = 199.0 / 3.0 ,
bi[9][2] = 16.0 ,
//
bi[10][6] = -1774004627.0 / 75810735.0 ,
bi[10][5] = -1774004627.0 / 25270245.0 ,
bi[10][4] = -26477681.0 / 359975.0 ,
bi[10][3] = -11411880511.0 / 379053675.0 ,
bi[10][2] = -423642896.0 / 126351225.0 ,
//
bi[11][6] = 35.0 ,
bi[11][5] = 105.0 ,
bi[11][4] = 117.0 ,
bi[11][3] = 59.0 ,
bi[11][2] = 12.0 ;
fPreparedConstants= true;
}
void G4BogackiShampine45::InterpolateHigh(G4double tau, G4double *yOut) const
// ( const G4double *yInput, const G4double *dydx, const G4double Step, G4double *yOut, G4double tau)
{
G4int numberOfVariables = this->GetNumberOfVariables();
assert( fPreparedConstants);
G4Exception("G4BogackiShampine45::InterpolateHigh()", "GeomField0001",
FatalException, "Method is not yet validated.");
// const G4double *yIn= fLastInitialVector;
// const G4double *dydx= fLastDyDx;
const G4double Step = fLastStepLength;
// for(G4int i = 0; i< numberOfVariables; i++) yIn[i] = yInput[i];
#if 1
G4int nwant = numberOfVariables;
const G4int norder= 6;
G4int l, k;
for (l = 0; l < nwant; l++) {
yOut[l] = p[norder-1][l] * tau;
}
for (k = norder - 2; k >= 1; k--) {
for (l = 0; l < nwant; l++) {
yOut[l] = ( yOut[l] + p[k][l] ) * tau;
}
}
for (l = 0; l < nwant; l++) {
yOut[l] = ( yOut[l] + Step * ak8[l] ) * tau + yIn[l];
}
// The derivative at the end-point is nextDydx[i] = ak8[i];
#else
// The scheme tries to do the same as the DormandPrince745 routine, but fails
G4double b[12];
const G4double *dydx= fLastDyDx;
G4double tau0 = tau;
for(int iStage=1; iStage<=11; iStage++){ // iStage = stage number
b[iStage] = 0.0;
tau = tau0;
for(int j=6; j>=1; j--){ // j reversed
b[iStage] += bi[iStage][j] * tau;
tau *= tau0;
}
}
for(int i=0; i<numberOfVariables; i++){
yOut[i] = yIn[i] + Step*(b[1] * dydx[i] + b[2] * ak2[i] + b[3] * ak3[i] +
b[4] * ak4[i] + b[5] * ak5[i] + b[6] * ak6[i] +
b[7] * ak7[i] + b[8] * ak8[i] + b[9] * ak9[i] +
b[10] * ak10[i] + b[11] * ak11[i] );
}
#endif
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4CachedMagneticField.cc 68055 2013-03-13 14:43:28Z gcosmo $
// $Id: G4CachedMagneticField.cc 96751 2016-05-04 09:39:38Z gcosmo $
//
// --------------------------------------------------------------------
@@ -37,22 +37,22 @@ G4CachedMagneticField::G4CachedMagneticField(G4MagneticField *pMagField,
fLastValue(DBL_MAX,DBL_MAX,DBL_MAX),
fCountCalls(0), fCountEvaluations(0)
{
fpMagneticField= pMagField;
fpMagneticField= pMagField;
fDistanceConst= distance;
// G4cout << " Cached-B-Field constructor> Distance = " << distance << G4endl;
this->ClearCounts();
}
G4CachedMagneticField* G4CachedMagneticField::Clone() const
G4Field* G4CachedMagneticField::Clone() const
{
//Cannot use copy constructor: I need to clone the associated magnetif field
G4MagneticField* aF = static_cast<G4MagneticField*>(this->fpMagneticField->Clone());
G4CachedMagneticField* cloned = new G4CachedMagneticField( aF ,
this->fDistanceConst );
cloned->fLastLocation = this->fLastLocation;
cloned->fLastValue = this->fLastValue;
return cloned;
// Cannot use copy constructor: I need to clone the associated magnetic field
G4MagneticField* aF = static_cast<G4MagneticField*>(fpMagneticField->Clone());
G4CachedMagneticField* cloned = new G4CachedMagneticField(aF, fDistanceConst);
cloned->fLastLocation = fLastLocation;
cloned->fLastValue = fLastValue;
return cloned;
}
G4CachedMagneticField::~G4CachedMagneticField()
@@ -68,9 +68,9 @@ G4CachedMagneticField::ReportStatistics()
}
G4CachedMagneticField::G4CachedMagneticField(const G4CachedMagneticField &rightCMF)
: G4MagneticField()
: G4MagneticField(rightCMF)
{
fpMagneticField= rightCMF.fpMagneticField;
fpMagneticField= rightCMF.fpMagneticField; // NOTE: sharing pointer here!
fDistanceConst = rightCMF.fDistanceConst;
fLastLocation = rightCMF.fLastLocation;
fLastValue = rightCMF.fLastValue;
@@ -79,7 +79,14 @@ G4CachedMagneticField::G4CachedMagneticField(const G4CachedMagneticField &rightC
G4CachedMagneticField& G4CachedMagneticField::operator = (const G4CachedMagneticField &p)
{
if (&p == this) return *this; *this = p; return *this;
if (&p == this) return *this;
G4MagneticField::operator=(p);
fpMagneticField= p.fpMagneticField; // NOTE: sharing pointer here!
fDistanceConst = p.fDistanceConst;
fLastLocation = p.fLastLocation;
fLastValue = p.fLastValue;
this->ClearCounts();
return *this;
}
void

Some files were not shown because too many files have changed in this diff Show More