Import Geant4 10.3.1 source tree
This commit is contained in:
@@ -1,791 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_CHBOOK
|
||||
#define tools_hbook_CHBOOK
|
||||
|
||||
// A C interface to HBOOK.
|
||||
|
||||
#ifdef WIN32
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
#ifdef TOOLS_HBOOK_F2C_RET_DOUBLE
|
||||
typedef double rret;
|
||||
#else
|
||||
typedef float rret;
|
||||
#endif
|
||||
|
||||
#ifdef TOOLS_HBOOK_F2C_ARG_DOUBLE
|
||||
typedef double rarg;
|
||||
#else
|
||||
typedef float rarg;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
/// functions with only a different name WIN32 versus UNIX //////
|
||||
/////////////////////////////////////////////////////////////////
|
||||
#ifdef WIN32
|
||||
extern "C" void __stdcall ZITOH(int*,int*,int*);
|
||||
extern "C" void __stdcall RZINK(int*,int*,const char *,int);
|
||||
extern "C" void __stdcall HLIMIT(int*);
|
||||
extern "C" void __stdcall HFILL(int*,rarg*,rarg*,rarg*);
|
||||
extern "C" void __stdcall HRIN(int*,int*,int*);
|
||||
extern "C" void __stdcall HNOENT(int*,int*);
|
||||
extern "C" void __stdcall HFNT(int*);
|
||||
extern "C" void __stdcall HGNPAR(int*,const char *,int);
|
||||
extern "C" void __stdcall HGNT(int*,int*,int*);
|
||||
extern "C" void __stdcall HDCOFL();
|
||||
extern "C" void __stdcall HDELET(int*);
|
||||
extern "C" void __stdcall HIJXY(int*,int*,int*,rarg*,rarg*);
|
||||
extern "C" rret __stdcall HIJE(int*,int*,int*);
|
||||
extern "C" rret __stdcall HIJ(int*,int*,int*);
|
||||
extern "C" rret __stdcall HIE(int*,int*);
|
||||
extern "C" void __stdcall HIX(int*,int*,rarg*);
|
||||
extern "C" void __stdcall HXI(int*,rarg*,int*);
|
||||
extern "C" rret __stdcall HI(int*,int*);
|
||||
extern "C" void __stdcall HXYIJ(int*,rarg*,rarg*,int*,int*);
|
||||
extern "C" rret __stdcall HMIN(int*);
|
||||
extern "C" rret __stdcall HMAX(int*);
|
||||
#else
|
||||
extern "C" void zitoh_(int*,int*,int*);
|
||||
extern "C" void rzink_(int*,int*,const char *,int);
|
||||
extern "C" void hlimit_(int*);
|
||||
extern "C" void hfill_(int*,rarg*,rarg*,rarg*);
|
||||
extern "C" void hrin_(int*,int*,int*);
|
||||
extern "C" void hnoent_(int*,int*);
|
||||
extern "C" void hfnt_(int*);
|
||||
extern "C" void hgnpar_(int*,const char *,int);
|
||||
extern "C" void hgnt_(int*,int*,int*);
|
||||
extern "C" void hdcofl_();
|
||||
extern "C" void hdelet_(int*);
|
||||
extern "C" void hijxy_(int*,int*,int*,rarg*,rarg*);
|
||||
extern "C" rret hije_(int*,int*,int*);
|
||||
extern "C" rret hij_(int*,int*,int*);
|
||||
extern "C" rret hie_(int*,int*);
|
||||
extern "C" void hix_(int*,int*,rarg*);
|
||||
extern "C" void hxi_(int*,rarg*,int*);
|
||||
extern "C" rret hi_(int*,int*);
|
||||
extern "C" void hxyij_(int*,rarg*,rarg*,int*,int*);
|
||||
extern "C" rret hmin_(int*);
|
||||
extern "C" rret hmax_(int*);
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
/// functions with a different signature WIN32 versus UNIX //////
|
||||
/////////////////////////////////////////////////////////////////
|
||||
#ifdef WIN32
|
||||
#define DEFCHAR const char*,const int
|
||||
|
||||
extern "C" void __stdcall UHTOC(int*,int*,const char*,const int,int*);
|
||||
extern "C" void __stdcall HROPEN(int*,DEFCHAR,DEFCHAR,DEFCHAR,int*,int*);
|
||||
extern "C" void __stdcall HREND(DEFCHAR);
|
||||
extern "C" void __stdcall HROUT(int*,int*,DEFCHAR);
|
||||
extern "C" void __stdcall HGIVE(int*,DEFCHAR,int*,rarg*,rarg*,int*,rarg*,rarg*,int*,int*);
|
||||
extern "C" void __stdcall HGIVEN(int*,DEFCHAR,int*,DEFCHAR,rarg*,rarg*);
|
||||
extern "C" void __stdcall HBNT(int*,DEFCHAR,DEFCHAR);
|
||||
extern "C" void __stdcall HBNAME(int*,DEFCHAR,int*,DEFCHAR);
|
||||
extern "C" void __stdcall HBNAM(int*,DEFCHAR,int*,DEFCHAR,int*);
|
||||
extern "C" void __stdcall HBOOK1(int*,DEFCHAR,int*,rarg*,rarg*,rarg*);
|
||||
extern "C" void __stdcall HBOOK2(int*,DEFCHAR,int*,rarg*,rarg*,int*,rarg*,rarg*,rarg*);
|
||||
extern "C" void __stdcall HBOOKB(int*,DEFCHAR,int*,rarg*,rarg*);
|
||||
extern "C" void __stdcall HBPROF(int*,DEFCHAR,int*,rarg*,rarg*,rarg*,rarg*,DEFCHAR);
|
||||
extern "C" void __stdcall HCDIR(DEFCHAR,DEFCHAR);
|
||||
extern "C" void __stdcall HLDIR(DEFCHAR,DEFCHAR);
|
||||
extern "C" void __stdcall HMDIR(DEFCHAR,DEFCHAR);
|
||||
extern "C" void __stdcall HDDIR(DEFCHAR);
|
||||
extern "C" rret __stdcall HSTATI(int*,int*,DEFCHAR,int*);
|
||||
extern "C" void __stdcall HRESET(int*,DEFCHAR);
|
||||
extern "C" void __stdcall HOPERA(int*,DEFCHAR,int*,int*,rarg*,rarg*);
|
||||
extern "C" void __stdcall HKIND(int*,int*,DEFCHAR);
|
||||
|
||||
#undef DEFCHAR
|
||||
|
||||
#define PASSCHAR(a_string) a_string,::strlen(a_string)
|
||||
#else
|
||||
typedef const char* DEFCHAR;
|
||||
|
||||
extern "C" void uhtoc_(int*,int*,const char*,int*,int);
|
||||
extern "C" void hropen_(int*,DEFCHAR,DEFCHAR,DEFCHAR,int*,int*,int,int,int);
|
||||
extern "C" void hrend_(DEFCHAR,int);
|
||||
extern "C" void hrout_(int*,int*,DEFCHAR,int);
|
||||
extern "C" void hgive_(int*,DEFCHAR,int*,rarg*,rarg*,int*,rarg*,rarg*,int*,int*,int);
|
||||
extern "C" void hgiven_(int*,DEFCHAR,int*,DEFCHAR,rarg*,rarg*,int,int);
|
||||
extern "C" void hbnt_(int*,DEFCHAR,DEFCHAR,int,int);
|
||||
extern "C" void hbname_(int*,DEFCHAR,int*,DEFCHAR,int,int);
|
||||
extern "C" void hbnam_(int*,DEFCHAR,int*,DEFCHAR,int*,int,int);
|
||||
extern "C" void hbook1_(int*,DEFCHAR,int*,rarg*,rarg*,rarg*,int);
|
||||
extern "C" void hbook2_(int*,DEFCHAR,int*,rarg*,rarg*,int*,rarg*,rarg*,rarg*,int);
|
||||
extern "C" void hbookb_(int*,DEFCHAR,int*,rarg*,rarg*,int);
|
||||
extern "C" void hbprof_(int*,DEFCHAR,int*,rarg*,rarg*,rarg*,rarg*,DEFCHAR,int,int);
|
||||
extern "C" void hcdir_(DEFCHAR,DEFCHAR ,int,int);
|
||||
extern "C" void hldir_(DEFCHAR,DEFCHAR ,int,int);
|
||||
extern "C" void hmdir_(DEFCHAR,DEFCHAR ,int,int);
|
||||
extern "C" void hddir_(DEFCHAR,int);
|
||||
extern "C" rret hstati_(int*,int*,DEFCHAR,int*,int);
|
||||
extern "C" void hreset_(int*,DEFCHAR,int);
|
||||
extern "C" void hopera_(int*,DEFCHAR,int*,int*,rarg*,rarg*,int);
|
||||
extern "C" void hkind_(int*,int*,DEFCHAR,int);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
extern "C" int PAWC[1];
|
||||
extern "C" int QUEST[100];
|
||||
extern "C" int HCBOOK[51];
|
||||
extern "C" int RZCL[11];
|
||||
//extern "C" int HCBITS[37];
|
||||
#else
|
||||
extern "C" int pawc_[1];
|
||||
extern "C" int quest_[100];
|
||||
extern "C" int hcbook_[51];
|
||||
extern "C" int rzcl_[11];
|
||||
//extern "C" int hcbits_[37];
|
||||
#endif
|
||||
|
||||
}}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// our wrapping /////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstring> //memset
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// package //////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
inline void CHLIMIT(int a_num) {
|
||||
#ifdef WIN32
|
||||
HLIMIT(&a_num);
|
||||
#else
|
||||
hlimit_(&a_num);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHDELET(int a_id){
|
||||
#ifdef WIN32
|
||||
HDELET(&a_id);
|
||||
#else
|
||||
hdelet_(&a_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHDCOFL() {
|
||||
#ifdef WIN32
|
||||
HDCOFL();
|
||||
#else
|
||||
hdcofl_();
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CRZINK(int a_key,int a_cycle,const std::string& a_opts) {
|
||||
#ifdef WIN32
|
||||
RZINK(&a_key,&a_cycle,PASSCHAR(a_opts.c_str()));
|
||||
#else
|
||||
rzink_(&a_key,&a_cycle,a_opts.c_str(),a_opts.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CZITOH(int* a1,int* a2,int* a3) {
|
||||
#ifdef WIN32
|
||||
ZITOH(a1,a2,a3);
|
||||
#else
|
||||
zitoh_(a1,a2,a3);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int* get_pawc() {
|
||||
#ifdef WIN32
|
||||
return PAWC;
|
||||
#else
|
||||
return pawc_;
|
||||
#endif
|
||||
}
|
||||
inline int* get_quest() {
|
||||
#ifdef WIN32
|
||||
return QUEST;
|
||||
#else
|
||||
return quest_;
|
||||
#endif
|
||||
}
|
||||
//inline int* get_hcbits() {
|
||||
//#ifdef WIN32
|
||||
// return HCBITS;
|
||||
//#else
|
||||
// return hcbits_;
|
||||
//#endif
|
||||
//}
|
||||
inline int* get_hcbook() {
|
||||
#ifdef WIN32
|
||||
return HCBOOK;
|
||||
#else
|
||||
return hcbook_;
|
||||
#endif
|
||||
}
|
||||
inline int* get_rzcl() {
|
||||
#ifdef WIN32
|
||||
return RZCL;
|
||||
#else
|
||||
return rzcl_;
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// file /////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
inline int CHROPEN(int a1,const std::string& a2,const std::string& a3,const std::string& a4,int a5) {
|
||||
int ier = 0;
|
||||
#ifdef WIN32
|
||||
HROPEN(&a1,PASSCHAR(a2.c_str()),PASSCHAR(a3.c_str()),PASSCHAR(a4.c_str()),&a5,&ier);
|
||||
#else
|
||||
hropen_(&a1,a2.c_str(),a3.c_str(),a4.c_str(),&a5,&ier,a2.size(),a3.size(),a4.size());
|
||||
#endif
|
||||
return ier;
|
||||
}
|
||||
|
||||
|
||||
inline void CHRIN(int a_id,int a_cycle,int a_offset){
|
||||
#ifdef WIN32
|
||||
HRIN(&a_id,&a_cycle,&a_offset);
|
||||
#else
|
||||
hrin_(&a_id,&a_cycle,&a_offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHROUT(int a1,int a2,const std::string& a3) {
|
||||
#ifdef WIN32
|
||||
HROUT(&a1,&a2,PASSCHAR(a3.c_str()));
|
||||
#else
|
||||
hrout_(&a1,&a2,a3.c_str(),a3.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHREND(const std::string& a1) {
|
||||
#ifdef WIN32
|
||||
HREND(PASSCHAR(a1.c_str()));
|
||||
#else
|
||||
hrend_(a1.c_str(),a1.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHCDIR(const std::string& a1,const std::string& a2) {
|
||||
#ifdef WIN32
|
||||
HCDIR(PASSCHAR(a1.c_str()),PASSCHAR(a2.c_str()));
|
||||
#else
|
||||
hcdir_(a1.c_str(),a2.c_str(),a1.size(),a2.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHLDIR(const std::string& a1,const std::string& a2) {
|
||||
#ifdef WIN32
|
||||
HLDIR(PASSCHAR(a1.c_str()),PASSCHAR(a2.c_str()));
|
||||
#else
|
||||
hldir_(a1.c_str(),a2.c_str(),a1.size(),a2.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHPWDF(char* a_pwd) { //must be 1024 allocated.
|
||||
int l = 1024;
|
||||
{for(int i=0;i<l;i++) a_pwd[i] = 0;}
|
||||
static const char a2[] = "R";
|
||||
#ifdef WIN32
|
||||
HCDIR(a_pwd,l,a2,1);
|
||||
#else
|
||||
hcdir_(a_pwd,a2,l,1);
|
||||
#endif
|
||||
/*int len=0;*/
|
||||
{for(int i=l-1;i>0;i--) {
|
||||
if(a_pwd[i]==0) continue;
|
||||
if(a_pwd[i]!=' ') {/*len=i;*/break;}
|
||||
a_pwd[i] = 0;
|
||||
}}
|
||||
}
|
||||
|
||||
inline std::string CHPWD() {
|
||||
char pwd[1024];
|
||||
CHPWDF(pwd);
|
||||
return pwd;
|
||||
}
|
||||
|
||||
inline void CHMDIR(const std::string& a1,const std::string& a2) {
|
||||
#ifdef WIN32
|
||||
HMDIR(PASSCHAR(a1.c_str()),PASSCHAR(a2.c_str()));
|
||||
#else
|
||||
hmdir_(a1.c_str(),a2.c_str(),a1.size(),a2.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHDDIR(const std::string& a1) {
|
||||
#ifdef WIN32
|
||||
HDDIR(PASSCHAR(a1.c_str()));
|
||||
#else
|
||||
hddir_(a1.c_str(),a1.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHDIRS(bool a_PAWC,std::vector<std::string>& a_dirs){
|
||||
a_dirs.clear();
|
||||
|
||||
int* pawc = get_pawc();
|
||||
|
||||
if(a_PAWC) {
|
||||
|
||||
int* iq = &(pawc[17]);
|
||||
|
||||
int* lq = &(pawc[9]);
|
||||
int lcdir = get_hcbook()[6];
|
||||
int lf = lq[lcdir-1];
|
||||
while(lf!=0) {
|
||||
|
||||
int ncw = 4;
|
||||
//int ihdir[4];
|
||||
//CZITOH(iq+lf+1,ihdir,&ncw);
|
||||
int* ihdir = iq+lf+1;
|
||||
|
||||
char chdir[17];
|
||||
{for(int i=0;i<17;i++) chdir[i] = 0;}
|
||||
int nch=16;
|
||||
#ifdef WIN32
|
||||
UHTOC(ihdir,&ncw,chdir,16,&nch);
|
||||
#else
|
||||
uhtoc_(ihdir,&ncw,chdir,&nch,16);
|
||||
#endif
|
||||
{for(int i=17-1;i>0;i--) {
|
||||
if(chdir[i]==0) continue;
|
||||
if(chdir[i]!=' ') break;
|
||||
chdir[i] = 0;
|
||||
}}
|
||||
|
||||
a_dirs.push_back(chdir);
|
||||
|
||||
lf = lq[lf];
|
||||
}
|
||||
|
||||
} else { //On a UNIT.
|
||||
|
||||
int* iq = &(pawc[17]);
|
||||
|
||||
const int KLS = 26;
|
||||
const int KNSD = 23;
|
||||
int lcdir = get_rzcl()[2];
|
||||
int ls = iq[lcdir+KLS];
|
||||
int ndir = iq[lcdir+KNSD];
|
||||
for (int k=0;k<ndir;k++) {
|
||||
lcdir = get_rzcl()[2];
|
||||
int ncw = 4;
|
||||
int ihdir[4];
|
||||
CZITOH(iq+(lcdir+ls+7*k),ihdir,&ncw);
|
||||
|
||||
char chdir[17];
|
||||
{for(int i=0;i<17;i++) chdir[i] = 0;}
|
||||
int nch=16;
|
||||
#ifdef WIN32
|
||||
UHTOC(ihdir,&ncw,chdir,16,&nch);
|
||||
#else
|
||||
uhtoc_(ihdir,&ncw,chdir,&nch,16);
|
||||
#endif
|
||||
{for(int i=17-1;i>0;i--) {
|
||||
if(chdir[i]==0) continue;
|
||||
if(chdir[i]!=' ') break;
|
||||
chdir[i] = 0;
|
||||
}}
|
||||
|
||||
a_dirs.push_back(chdir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline std::vector<int> CHKEYS(){
|
||||
// Apply on a //LUN<unit> directory.
|
||||
std::vector<int> keys;
|
||||
int* quest = get_quest();
|
||||
for (int key=1;key<1000000;key++) {
|
||||
CRZINK(key,0,"S");
|
||||
if(quest[0]) break;
|
||||
if(quest[13] & 8) continue;
|
||||
int id = quest[20];
|
||||
keys.push_back(id);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
inline bool CHEDIR(const std::string& a_dir,bool a_PAWC){
|
||||
std::vector<std::string> drs;
|
||||
CHDIRS(a_PAWC,drs);
|
||||
std::vector<std::string>::iterator it;
|
||||
for(it=drs.begin();it!=drs.end();++it){
|
||||
if(a_dir==(*it)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// histogram ////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
inline void CHBOOK1(int a_id,const std::string& a_title,int a_xnum,rarg a_xmin,rarg a_xmax,rarg a_vmx = 0) {
|
||||
#ifdef WIN32
|
||||
HBOOK1(&a_id,PASSCHAR(a_title.c_str()),&a_xnum,&a_xmin,&a_xmax,&a_vmx);
|
||||
#else
|
||||
hbook1_(&a_id,a_title.c_str(),&a_xnum,&a_xmin,&a_xmax,&a_vmx,a_title.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHBOOK2(int a_id,const std::string& a_title,int a_xnum,rarg a_xmin,rarg a_xmax,int a_ynum,rarg a_ymin,rarg a_ymax,rarg a_vmx = 0) {
|
||||
#ifdef WIN32
|
||||
HBOOK2(&a_id,PASSCHAR(a_title.c_str()),
|
||||
&a_xnum,&a_xmin,&a_xmax,&a_ynum,&a_ymin,&a_ymax,&a_vmx);
|
||||
#else
|
||||
hbook2_(&a_id,a_title.c_str(),
|
||||
&a_xnum,&a_xmin,&a_xmax,&a_ynum,&a_ymin,&a_ymax,&a_vmx,
|
||||
a_title.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool CHBOOKB(
|
||||
int a_id
|
||||
,const std::string& a_title
|
||||
,const std::vector<rarg>& a_edges
|
||||
,rarg a_vmx = 0
|
||||
) {
|
||||
if(!a_edges.size()) return false;
|
||||
|
||||
int edgen = (int)a_edges.size();
|
||||
rarg* edges = new rarg[edgen];
|
||||
for(int i=0;i<edgen;i++) edges[i] = a_edges[i];
|
||||
|
||||
int ncx = edgen-1;
|
||||
#ifdef WIN32
|
||||
HBOOKB(&a_id,PASSCHAR(a_title.c_str()),&ncx,edges,&a_vmx);
|
||||
#else
|
||||
hbookb_(&a_id,a_title.c_str(),&ncx,edges,&a_vmx,a_title.size());
|
||||
#endif
|
||||
delete [] edges;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline void CHBPROF(
|
||||
int a_id
|
||||
,const std::string& a_title
|
||||
,int a_xnum,rarg a_xmin,rarg a_xmax
|
||||
,rarg a_ymin,rarg a_ymax
|
||||
,const std::string& a_opts
|
||||
) {
|
||||
#ifdef WIN32
|
||||
HBPROF(&a_id,PASSCHAR(a_title.c_str()),
|
||||
&a_xnum,&a_xmin,&a_xmax,&a_ymin,&a_ymax,
|
||||
PASSCHAR(a_opts.c_str()));
|
||||
#else
|
||||
hbprof_(&a_id,a_title.c_str(),
|
||||
&a_xnum,&a_xmin,&a_xmax,&a_ymin,&a_ymax,
|
||||
a_opts.c_str(),a_title.size(),a_opts.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHGIVE(
|
||||
int a_id
|
||||
,std::string& a_title
|
||||
,int& a_xnum
|
||||
,rarg& a_xmin
|
||||
,rarg& a_xmax
|
||||
,int& a_ynum
|
||||
,rarg& a_ymin
|
||||
,rarg& a_ymax
|
||||
){
|
||||
char chtitl[128];
|
||||
int ncx,ncy;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
int nwt,idb;
|
||||
#ifdef WIN32
|
||||
HGIVE(&a_id,chtitl,80,&ncx,&xmin,&xmax,&ncy,&ymin,&ymax,&nwt,&idb);
|
||||
#else
|
||||
hgive_(&a_id,chtitl,&ncx,&xmin,&xmax,&ncy,&ymin,&ymax,&nwt,&idb,80);
|
||||
#endif
|
||||
chtitl[4*nwt] = 0;
|
||||
a_title = chtitl;
|
||||
a_xnum = ncx;
|
||||
a_xmin = xmin;
|
||||
a_xmax = xmax;
|
||||
a_ynum = ncy;
|
||||
a_ymin = ymin;
|
||||
a_ymax = ymax;
|
||||
}
|
||||
|
||||
inline void CHGIVE( //without title.
|
||||
int a_id
|
||||
,int& a_xnum
|
||||
,rarg& a_xmin
|
||||
,rarg& a_xmax
|
||||
,int& a_ynum
|
||||
,rarg& a_ymin
|
||||
,rarg& a_ymax
|
||||
){
|
||||
char chtitl[128];
|
||||
int ncx,ncy;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
int nwt,idb;
|
||||
#ifdef WIN32
|
||||
HGIVE(&a_id,chtitl,80,&ncx,&xmin,&xmax,&ncy,&ymin,&ymax,&nwt,&idb);
|
||||
#else
|
||||
hgive_(&a_id,chtitl,&ncx,&xmin,&xmax,&ncy,&ymin,&ymax,&nwt,&idb,80);
|
||||
#endif
|
||||
a_xnum = ncx;
|
||||
a_xmin = xmin;
|
||||
a_xmax = xmax;
|
||||
a_ynum = ncy;
|
||||
a_ymin = ymin;
|
||||
a_ymax = ymax;
|
||||
}
|
||||
|
||||
inline int CHNOENT(int a_id){
|
||||
int nentries;
|
||||
#ifdef WIN32
|
||||
HNOENT(&a_id,&nentries);
|
||||
#else
|
||||
hnoent_(&a_id,&nentries);
|
||||
#endif
|
||||
return nentries;
|
||||
}
|
||||
|
||||
inline void CHFILL(int a_id,rarg a_x,rarg a_y,rarg a_w){
|
||||
#ifdef WIN32
|
||||
HFILL(&a_id,&a_x,&a_y,&a_w);
|
||||
#else
|
||||
hfill_(&a_id,&a_x,&a_y,&a_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHI(int a_id,int a_i){
|
||||
#ifdef WIN32
|
||||
return HI(&a_id,&a_i);
|
||||
#else
|
||||
return hi_(&a_id,&a_i);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHIE(int a_id,int a_i){
|
||||
#ifdef WIN32
|
||||
return HIE(&a_id,&a_i);
|
||||
#else
|
||||
return hie_(&a_id,&a_i);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHIJ(int a_id,int a_i,int a_j){
|
||||
#ifdef WIN32
|
||||
return HIJ(&a_id,&a_i,&a_j);
|
||||
#else
|
||||
return hij_(&a_id,&a_i,&a_j);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHIJE(int a_id,int a_i,int a_j){
|
||||
#ifdef WIN32
|
||||
return HIJE(&a_id,&a_i,&a_j);
|
||||
#else
|
||||
return hije_(&a_id,&a_i,&a_j);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHIX(int a_id,int a_i){
|
||||
rarg x;
|
||||
#ifdef WIN32
|
||||
HIX(&a_id,&a_i,&x);
|
||||
#else
|
||||
hix_(&a_id,&a_i,&x);
|
||||
#endif
|
||||
return x;
|
||||
}
|
||||
|
||||
inline void CHIJXY(int a_id,int a_i,int a_j,rarg& aX,rarg& aY){
|
||||
rarg x,y;
|
||||
#ifdef WIN32
|
||||
HIJXY(&a_id,&a_i,&a_j,&x,&y);
|
||||
#else
|
||||
hijxy_(&a_id,&a_i,&a_j,&x,&y);
|
||||
#endif
|
||||
aX = x;
|
||||
aY = y;
|
||||
}
|
||||
|
||||
inline int CHXI(int a_id,rarg a_x){
|
||||
int i;
|
||||
#ifdef WIN32
|
||||
HXI(&a_id,&a_x,&i);
|
||||
#else
|
||||
hxi_(&a_id,&a_x,&i);
|
||||
#endif
|
||||
return i;
|
||||
}
|
||||
|
||||
inline void CHXYIJ(int a_id,rarg a_x,rarg a_y,int& aI,int& aJ){
|
||||
int i,j;
|
||||
#ifdef WIN32
|
||||
HXYIJ(&a_id,&a_x,&a_y,&i,&j);
|
||||
#else
|
||||
hxyij_(&a_id,&a_x,&a_y,&i,&j);
|
||||
#endif
|
||||
aI = i;
|
||||
aJ = j;
|
||||
}
|
||||
|
||||
inline rret CHMIN(int a_id){
|
||||
#ifdef WIN32
|
||||
return HMIN(&a_id);
|
||||
#else
|
||||
return hmin_(&a_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHMAX(int a_id){
|
||||
#ifdef WIN32
|
||||
return HMAX(&a_id);
|
||||
#else
|
||||
return hmax_(&a_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline rret CHSTATI(int a_id,int a_what,const std::string& aChoice,int a_num){
|
||||
#ifdef WIN32
|
||||
return HSTATI(&a_id,&a_what,PASSCHAR(aChoice.c_str()),&a_num);
|
||||
#else
|
||||
return hstati_(&a_id,&a_what,aChoice.c_str(),&a_num,aChoice.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHRESET(int a_id,const std::string& a_title){
|
||||
#ifdef WIN32
|
||||
HRESET(&a_id,PASSCHAR(a_title.c_str()));
|
||||
#else
|
||||
hreset_(&a_id,a_title.c_str(),a_title.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// Tuple ////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
inline void CHBNT(int a1,const std::string& a2,const std::string& a3) {
|
||||
#ifdef WIN32
|
||||
HBNT(&a1,PASSCHAR(a2.c_str()),PASSCHAR(a3.c_str()));
|
||||
#else
|
||||
hbnt_(&a1,a2.c_str(),a3.c_str(),a2.size(),a3.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHBNAME(int a1,const std::string& a2,void* a3,const std::string& a4) {
|
||||
#ifdef WIN32
|
||||
HBNAME(&a1,PASSCHAR(a2.c_str()),(int*)a3,PASSCHAR(a4.c_str()));
|
||||
#else
|
||||
hbname_(&a1,a2.c_str(),(int*)a3,a4.c_str(),a2.size(),a4.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHBNAM(int a1,const std::string& a2,void* a3,const std::string& a4,int a5) {
|
||||
#ifdef WIN32
|
||||
HBNAM(&a1,PASSCHAR(a2.c_str()),(int*)a3,PASSCHAR(a4.c_str()),&a5);
|
||||
#else
|
||||
hbnam_(&a1,a2.c_str(),(int*)a3,a4.c_str(),&a5,a2.size(),a4.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHGNPAR(int a1,const std::string& a2) {
|
||||
#ifdef WIN32
|
||||
HGNPAR(&a1,PASSCHAR(a2.c_str()));
|
||||
#else
|
||||
hgnpar_(&a1,a2.c_str(),a2.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CHFNT(int a1) {
|
||||
#ifdef WIN32
|
||||
HFNT(&a1);
|
||||
#else
|
||||
hfnt_(&a1);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int CHGIVEN(
|
||||
int a_id
|
||||
,std::string& a_title
|
||||
,std::vector<std::string>& aColumns
|
||||
){
|
||||
// Get number of columns :
|
||||
char chtitl[128];
|
||||
int nvar = 0;
|
||||
rarg rmin[1000],rmax[1000];
|
||||
#ifdef WIN32
|
||||
HGIVEN(&a_id,chtitl,80,&nvar,PASSCHAR(""),rmin,rmax);
|
||||
#else
|
||||
hgiven_(&a_id,chtitl,&nvar,"",rmin,rmax,80,0);
|
||||
#endif
|
||||
|
||||
// Get title and columns name :
|
||||
const int Nchar = 9;
|
||||
char* chtag_out = new char[nvar*Nchar+1];
|
||||
chtag_out[nvar*Nchar]=0;
|
||||
int i;
|
||||
for (i=0;i<=80;i++)chtitl[i]=0;
|
||||
#ifdef WIN32
|
||||
HGIVEN(&a_id,chtitl,80,&nvar,chtag_out,Nchar,rmin,rmax);
|
||||
#else
|
||||
hgiven_(&a_id,chtitl,&nvar,chtag_out,rmin,rmax,80,Nchar);
|
||||
#endif
|
||||
for (i=80;i>0;i--) {if (chtitl[i] == ' ') chtitl[i] = 0; }
|
||||
|
||||
a_title = chtitl;
|
||||
|
||||
aColumns.clear();
|
||||
char* name = chtag_out;
|
||||
for(i=0; i<nvar;i++) {
|
||||
name[Nchar-1] = 0;
|
||||
int first = 0;
|
||||
int last = 0;
|
||||
// suppress trailing blanks
|
||||
int j;
|
||||
for (j=Nchar-2;j>0;j--) {
|
||||
if (name[j] == ' ' && last == 0) name[j] = 0;
|
||||
else last = j;
|
||||
}
|
||||
// suppress heading blanks
|
||||
for (j=0;j<Nchar;j++) {
|
||||
if (name[j] != ' ') break;
|
||||
first = j+1;
|
||||
}
|
||||
aColumns.push_back(name+first);
|
||||
name += Nchar;
|
||||
}
|
||||
|
||||
return nvar;
|
||||
}
|
||||
|
||||
inline int CHGNT(int a_id,int a_row){
|
||||
int ier = 0;
|
||||
#ifdef WIN32
|
||||
HGNT(&a_id,&a_row,&ier);
|
||||
#else
|
||||
hgnt_(&a_id,&a_row,&ier);
|
||||
#endif
|
||||
return ier;
|
||||
}
|
||||
|
||||
inline void CHOPERA(int a_id1,const std::string& a_opts,int a_id2,int a_id3,rarg a_c1,rarg a_c2) {
|
||||
#ifdef WIN32
|
||||
HOPERA(&a_id1,PASSCHAR(a_opts.c_str()),&a_id2,&a_id3,&a_c1,&a_c2);
|
||||
#else
|
||||
hopera_(&a_id1,a_opts.c_str(),&a_id2,&a_id3,&a_c1,&a_c2,a_opts.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#ifdef WIN32
|
||||
#undef PASSCHAR
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,158 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_axis
|
||||
#define tools_hbook_axis
|
||||
|
||||
#include "CHBOOK"
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class axis {
|
||||
public:
|
||||
enum { UNDERFLOW_BIN = -2, OVERFLOW_BIN = -1 };
|
||||
public:
|
||||
axis(const std::string& a_path,int aID,
|
||||
int aDimension,bool aIsX,bool aFixed)
|
||||
:m_path(a_path),m_id(aID)
|
||||
,m_dimension(aDimension),m_is_x(aIsX),m_fixed(aFixed)
|
||||
{}
|
||||
virtual ~axis(){}
|
||||
public:
|
||||
axis(const axis& a_from)
|
||||
:m_path(a_from.m_path),m_id(a_from.m_id),m_dimension(a_from.m_dimension)
|
||||
,m_is_x(a_from.m_is_x),m_fixed(a_from.m_fixed)
|
||||
{}
|
||||
axis& operator=(const axis& a_from){
|
||||
m_path = a_from.m_path;
|
||||
m_id = a_from.m_id;
|
||||
m_dimension = a_from.m_dimension;
|
||||
m_is_x = a_from.m_is_x;
|
||||
m_fixed = a_from.m_fixed;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
bool is_fixed_binning() const {return m_fixed;}
|
||||
rarg lower_edge() const {
|
||||
int xn,yn;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
cd_beg();
|
||||
CHGIVE(m_id,xn,xmin,xmax,yn,ymin,ymax);
|
||||
cd_end();
|
||||
return m_is_x?xmin:ymin;
|
||||
}
|
||||
rarg upper_edge() const {
|
||||
int xn,yn;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
cd_beg();
|
||||
CHGIVE(m_id,xn,xmin,xmax,yn,ymin,ymax);
|
||||
cd_end();
|
||||
return m_is_x?xmax:ymax;
|
||||
}
|
||||
|
||||
int bins() const {
|
||||
int xn,yn;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
cd_beg();
|
||||
CHGIVE(m_id,xn,xmin,xmax,yn,ymin,ymax);
|
||||
cd_end();
|
||||
return m_is_x?xn:yn;
|
||||
}
|
||||
|
||||
rret bin_lower_edge(int a_index) const {
|
||||
int index = a_index + 1; //HBOOK counts in [1,NX]
|
||||
if(m_dimension==1) {
|
||||
cd_beg();
|
||||
rret v = CHIX(m_id,index);
|
||||
cd_end();
|
||||
return v;
|
||||
} else { //dimension 2
|
||||
rarg x,y;
|
||||
if(m_is_x) {
|
||||
cd_beg();
|
||||
CHIJXY(m_id,index,1,x,y);
|
||||
cd_end();
|
||||
return x;
|
||||
} else {
|
||||
cd_beg();
|
||||
CHIJXY(m_id,1,index,x,y);
|
||||
cd_end();
|
||||
return y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rret bin_upper_edge(int a_index) const {
|
||||
//FIXME : is it correct to ask for the lower bound of the next bin ?
|
||||
int index = a_index + 1 + 1; //HBOOK counts in [1,NX]
|
||||
if(m_dimension==1) {
|
||||
cd_beg();
|
||||
rret v = CHIX(m_id,index);
|
||||
cd_end();
|
||||
return v;
|
||||
} else { //dimension 2
|
||||
rarg x,y;
|
||||
if(m_is_x) {
|
||||
cd_beg();
|
||||
CHIJXY(m_id,index,1,x,y);
|
||||
cd_end();
|
||||
return x;
|
||||
} else {
|
||||
cd_beg();
|
||||
CHIJXY(m_id,1,index,x,y);
|
||||
cd_end();
|
||||
return y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rret bin_width(int a_index) const {
|
||||
return bin_upper_edge(a_index) - bin_lower_edge(a_index);
|
||||
}
|
||||
|
||||
int coord_to_index(rarg aCoord) const {
|
||||
if(m_dimension==1) {
|
||||
cd_beg();
|
||||
int v = CHXI(m_id,aCoord)-1; //HBOOK counts in [1,NX]
|
||||
cd_end();
|
||||
return v;
|
||||
} else { //dimension 2
|
||||
int i,j;
|
||||
if(m_is_x) {
|
||||
cd_beg();
|
||||
CHXYIJ(m_id,aCoord,0,i,j);
|
||||
cd_end();
|
||||
return i-1;
|
||||
} else {
|
||||
cd_beg();
|
||||
CHXYIJ(m_id,0,aCoord,i,j);
|
||||
cd_end();
|
||||
return j-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rret bin_center(int a_index) const {
|
||||
return (bin_lower_edge(a_index) + bin_upper_edge(a_index))/2;
|
||||
}
|
||||
|
||||
private:
|
||||
void cd_beg() const {
|
||||
axis& self = const_cast<axis&>(*this);
|
||||
CHPWDF(self.m_tmp);
|
||||
CHCDIR(m_path," ");
|
||||
}
|
||||
void cd_end() const {CHCDIR(m_tmp," ");}
|
||||
private:
|
||||
std::string m_path;
|
||||
int m_id;
|
||||
int m_dimension;
|
||||
bool m_is_x;
|
||||
bool m_fixed;
|
||||
char m_tmp[1024];
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -1,155 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_base_histo
|
||||
#define tools_hbook_base_histo
|
||||
|
||||
#include "axis"
|
||||
|
||||
#include <map> //for annotations
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class base_histo {
|
||||
protected:
|
||||
base_histo(int aID):m_path(CHPWD()),m_id(aID){}
|
||||
virtual ~base_histo(){}
|
||||
protected:
|
||||
base_histo(const base_histo& a_from)
|
||||
:m_path(a_from.m_path)
|
||||
,m_id(a_from.m_id)
|
||||
,m_annotations(a_from.m_annotations)
|
||||
{}
|
||||
base_histo& operator=(const base_histo& a_from){
|
||||
m_path = a_from.m_path;
|
||||
m_id = a_from.m_id;
|
||||
m_annotations = a_from.m_annotations;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
int hbook_id() const {return m_id;}
|
||||
|
||||
bool scale(rarg aScale) {
|
||||
//FIXME : Do we want the E option ?
|
||||
cd_beg();
|
||||
CHOPERA(m_id,"+E",m_id,m_id,aScale,0);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool add(const base_histo& a_histo,rarg a_1 = 1,rarg a_2 = 1){
|
||||
// this = a_1*this + a_2*a_histo
|
||||
//NOTE : it is assumed that m_id and a_histo.m_id are in the
|
||||
// same HBOOK directory.
|
||||
cd_beg();
|
||||
CHOPERA(m_id,"+E",a_histo.m_id,m_id,a_1,a_2);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
bool subtract(const base_histo& a_histo,rarg a_1 = 1,rarg a_2 = 1){
|
||||
// this = a_1*this - a_2*a_histo
|
||||
//NOTE : it is assumed that m_id and a_histo.m_id are in the
|
||||
// same HBOOK directory.
|
||||
cd_beg();
|
||||
CHOPERA(m_id,"-E",a_histo.m_id,m_id,a_1,a_2);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
bool multiply(const base_histo& a_histo,rarg a_1 = 1,rarg a_2 = 1){
|
||||
// this = a_1*this * a_2*a_histo
|
||||
//NOTE : it is assumed that m_id and a_histo.m_id are in the
|
||||
// same HBOOK directory.
|
||||
cd_beg();
|
||||
CHOPERA(m_id,"*E",a_histo.m_id,m_id,a_1,a_2);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
bool divide(const base_histo& a_histo,rarg a_1 = 1,rarg a_2 = 1){
|
||||
// this = a_1*this / a_2*a_histo
|
||||
//NOTE : it is assumed that m_id and a_histo.m_id are in the
|
||||
// same HBOOK directory.
|
||||
cd_beg();
|
||||
CHOPERA(m_id,"/E",a_histo.m_id,m_id,a_1,a_2);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string title() const {
|
||||
std::string _title;
|
||||
int ncx,ncy;
|
||||
rarg xmin,xmax,ymin,ymax;
|
||||
cd_beg();
|
||||
CHGIVE(m_id,_title,ncx,xmin,xmax,ncy,ymin,ymax);
|
||||
cd_end();
|
||||
return _title;
|
||||
}
|
||||
bool reset() {
|
||||
cd_beg();
|
||||
CHRESET(m_id," ");
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
int all_entries() const {
|
||||
cd_beg();
|
||||
int v = CHNOENT(m_id);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
|
||||
public: //annotations :
|
||||
typedef std::map<std::string,std::string> annotations_t;
|
||||
const annotations_t& annotations() const {return m_annotations;}
|
||||
annotations_t annotations() {return m_annotations;}
|
||||
|
||||
void add_annotation(const std::string& a_key,const std::string& a_value) {
|
||||
m_annotations[a_key] = a_value; //override if a_key already exists.
|
||||
}
|
||||
bool annotation(const std::string& a_key,std::string& a_value) const {
|
||||
annotations_t::const_iterator it = m_annotations.find(a_key);
|
||||
if(it==m_annotations.end()) {a_value.clear();return false;}
|
||||
a_value = (*it).second;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
void cd_beg() const{
|
||||
base_histo& self = const_cast<base_histo&>(*this);
|
||||
CHPWDF(self.m_tmp);
|
||||
CHCDIR(m_path," ");
|
||||
}
|
||||
void cd_end() const {CHCDIR(m_tmp," ");}
|
||||
protected:
|
||||
static int hindex(int aIndex,const hbook::axis& aAxis){
|
||||
if(aIndex==hbook::axis::UNDERFLOW_BIN)
|
||||
return 0;
|
||||
else if(aIndex==hbook::axis::OVERFLOW_BIN)
|
||||
return aAxis.bins()+1;
|
||||
else
|
||||
return aIndex+1;
|
||||
}
|
||||
protected:
|
||||
std::string m_path;
|
||||
int m_id;
|
||||
char m_tmp[1024];
|
||||
// etc :
|
||||
annotations_t m_annotations;
|
||||
};
|
||||
|
||||
// predefined annotation keys :
|
||||
inline const std::string& key_axis_x_title() {
|
||||
static const std::string s_v("axis_x.title");
|
||||
return s_v;
|
||||
}
|
||||
inline const std::string& key_axis_y_title() {
|
||||
static const std::string s_v("axis_y.title");
|
||||
return s_v;
|
||||
}
|
||||
inline const std::string& key_axis_z_title() {
|
||||
static const std::string s_v("axis_z.title");
|
||||
return s_v;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -1,160 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_h1
|
||||
#define tools_hbook_h1
|
||||
|
||||
#include "base_histo"
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class h1 : public base_histo {
|
||||
public:
|
||||
h1(int aID,const std::string& a_title,
|
||||
int aXnumber,rarg aXmin,rarg aXmax)
|
||||
:base_histo(aID)
|
||||
,m_axis(m_path,aID,1,true,true)
|
||||
{
|
||||
//m_axis.copy(fHistogram.getAxis(0));
|
||||
cd_beg();
|
||||
CHBOOK1(m_id,a_title,aXnumber,aXmin,aXmax);
|
||||
cd_end();
|
||||
}
|
||||
h1(int aID,const std::string& a_title,
|
||||
const std::vector<rarg>& a_edges)
|
||||
:base_histo(aID)
|
||||
,m_axis(m_path,aID,1,true,false)
|
||||
{
|
||||
cd_beg();
|
||||
CHBOOKB(m_id,a_title,a_edges);
|
||||
cd_end();
|
||||
}
|
||||
virtual ~h1(){
|
||||
cd_beg();
|
||||
CHDELET(m_id);
|
||||
cd_end();
|
||||
}
|
||||
private:
|
||||
h1(const h1& a_from)
|
||||
:base_histo(a_from)
|
||||
,m_axis(a_from.m_axis)
|
||||
{}
|
||||
h1& operator=(const h1& a_from){
|
||||
base_histo::operator=(a_from);
|
||||
m_axis = a_from.m_axis;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
bool configure(int aXnumber,rarg aXmin,rarg aXmax){
|
||||
cd_beg();
|
||||
CHBOOK1(m_id,title(),aXnumber,aXmin,aXmax);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
bool configure(const std::vector<rarg>& a_edges){
|
||||
cd_beg();
|
||||
CHBOOKB(m_id,title(),a_edges);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
//bool set_title(const std::string& a_title) {
|
||||
// return false;
|
||||
//}
|
||||
int dimension() const {return 1;}
|
||||
|
||||
rret sum_bin_heights() const {
|
||||
int NX = axis().bins();
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int i=1;i<=NX;i++) {
|
||||
w += CHI(m_id,i);
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret sum_all_bin_heights() const {
|
||||
int NX1 = axis().bins()+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int i=0;i<=NX1;i++) {
|
||||
w += CHI(m_id,i);
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret sum_extra_bin_heights() const {
|
||||
int NX1 = axis().bins()+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
w += CHI(m_id,0);
|
||||
w += CHI(m_id,NX1);
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
|
||||
rret min_bin_height() const {
|
||||
cd_beg();
|
||||
rret v = CHMIN(m_id);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret max_bin_height() const {
|
||||
cd_beg();
|
||||
rret v = CHMAX(m_id);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
|
||||
void fill(rarg aX,rarg aWeight = 1) {
|
||||
cd_beg();
|
||||
CHFILL(m_id,aX,0,aWeight);
|
||||
cd_end();
|
||||
}
|
||||
|
||||
// optimization :
|
||||
void fill_beg() const {cd_beg();}
|
||||
void fill_fast(rarg aX,rarg aWeight = 1) {
|
||||
CHFILL(m_id,aX,0,aWeight);
|
||||
}
|
||||
void fill_end() const {cd_end();}
|
||||
|
||||
rret bin_height(int aIndex) const {
|
||||
cd_beg();
|
||||
rret v = CHI(m_id,hindex(aIndex,axis()));
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret bin_error(int aIndex) const {
|
||||
cd_beg();
|
||||
rret v = CHIE(m_id,aIndex+1);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
|
||||
rret mean() const {
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,1," ",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret rms() const {
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,2," ",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
|
||||
hbook::axis& axis() {return m_axis;}
|
||||
const hbook::axis& axis() const {return m_axis;}
|
||||
int coord_to_index(rarg aCoord) const {
|
||||
return m_axis.coord_to_index(aCoord);
|
||||
}
|
||||
protected:
|
||||
hbook::axis m_axis;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -1,202 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_h2
|
||||
#define tools_hbook_h2
|
||||
|
||||
#include "base_histo"
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class h2 : public base_histo {
|
||||
public:
|
||||
h2(int aID,const std::string& aTitle,
|
||||
int aXnumber,rarg aXmin,rarg aXmax,
|
||||
int aYnumber,rarg aYmin,rarg aYmax)
|
||||
:base_histo(aID)
|
||||
,m_axis_x(m_path,aID,2,true,true)
|
||||
,m_axis_y(m_path,aID,2,false,true)
|
||||
{
|
||||
//m_axis_x.copy(fHistogram.getAxis(0));
|
||||
//m_axis_y.copy(fHistogram.getAxis(1));
|
||||
cd_beg();
|
||||
CHBOOK2(m_id,aTitle,aXnumber,aXmin,aXmax,
|
||||
aYnumber,aYmin,aYmax);
|
||||
cd_end();
|
||||
}
|
||||
virtual ~h2(){
|
||||
cd_beg();
|
||||
CHDELET(m_id);
|
||||
cd_end();
|
||||
}
|
||||
private:
|
||||
h2(const h2& a_from)
|
||||
:base_histo(a_from)
|
||||
,m_axis_x(a_from.m_axis_x)
|
||||
,m_axis_y(a_from.m_axis_y)
|
||||
{}
|
||||
h2& operator=(const h2& a_from){
|
||||
base_histo::operator=(a_from);
|
||||
m_axis_x = a_from.m_axis_x;
|
||||
m_axis_y = a_from.m_axis_y;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
bool configure(int aXnumber,rarg aXmin,rarg aXmax,
|
||||
int aYnumber,rarg aYmin,rarg aYmax){
|
||||
cd_beg();
|
||||
CHBOOK2(m_id,title(),aXnumber,aXmin,aXmax,aYnumber,aYmin,aYmax);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
void fill(rarg aX,rarg aY,rarg aWeight = 1) {
|
||||
cd_beg();
|
||||
CHFILL(m_id,aX,aY,aWeight);
|
||||
cd_end();
|
||||
}
|
||||
|
||||
// optimization :
|
||||
void fill_beg() const {cd_beg();}
|
||||
void fill_fast(rarg aX,rarg aY,rarg aWeight = 1) {
|
||||
CHFILL(m_id,aX,aY,aWeight);
|
||||
}
|
||||
void fill_end() const {cd_end();}
|
||||
|
||||
int dimension() const {return 2;}
|
||||
|
||||
rret mean_x() const {
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,1,"PROX",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret mean_y() const{
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,1,"PROY",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret rms_x() const {
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,2,"PROX",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret rms_y() const {
|
||||
cd_beg();
|
||||
rret v = CHSTATI(m_id,2,"PROY",0);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
const hbook::axis& axis_x() const {return m_axis_x;}
|
||||
hbook::axis& axis_x() {return m_axis_x;}
|
||||
const hbook::axis& axis_y() const {return m_axis_y;}
|
||||
hbook::axis& axis_y() {return m_axis_y;}
|
||||
int coord_to_index_x(rarg aCoordX) const {
|
||||
return m_axis_x.coord_to_index(aCoordX);
|
||||
}
|
||||
int coord_to_index_y(rarg aCoordY) const {
|
||||
return m_axis_y.coord_to_index(aCoordY);
|
||||
}
|
||||
rret min_bin_height() const {
|
||||
cd_beg();
|
||||
rret v = CHMIN(m_id);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret max_bin_height() const {
|
||||
cd_beg();
|
||||
rret v = CHMAX(m_id);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret bin_height(int aIndexX,int aIndexY) const {
|
||||
cd_beg();
|
||||
rret v = CHIJ(m_id,hindex(aIndexX,axis_x()),hindex(aIndexY,axis_y()));
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret sum_bin_heights() const {
|
||||
int NX = axis_x().bins();
|
||||
int NY = axis_y().bins();
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int i=1;i<=NX;i++) {
|
||||
for(int j=1;j<=NY;j++) {
|
||||
w += CHIJ(m_id,i,j);
|
||||
}
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret sum_all_bin_heights() const {
|
||||
int NX1 = axis_x().bins()+1;
|
||||
int NY1 = axis_y().bins()+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int i=0;i<=NX1;i++) {
|
||||
for(int j=0;j<=NY1;j++) {
|
||||
w += CHIJ(m_id,i,j);
|
||||
}
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret sum_extra_bin_heights() const {
|
||||
int NX = axis_x().bins();
|
||||
int NY = axis_y().bins();
|
||||
int NX1 = NX+1;
|
||||
int NY1 = NY+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
{for(int j=0;j<=NY1;j++) {
|
||||
w += CHIJ(m_id,0,j);
|
||||
}}
|
||||
for(int i=1;i<=NX;i++) {
|
||||
w += CHIJ(m_id,i,0);
|
||||
w += CHIJ(m_id,i,NY1);
|
||||
}
|
||||
{for(int j=0;j<=NY1;j++) {
|
||||
w += CHIJ(m_id,NX1,j);
|
||||
}}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret bin_error(int aIndexX,int aIndexY) const {
|
||||
cd_beg();
|
||||
rret v = CHIJE(m_id,aIndexX+1,aIndexY+1);
|
||||
cd_end();
|
||||
return v;
|
||||
}
|
||||
rret bin_height_x(int aIndexX) const {
|
||||
int i = hindex(aIndexX,axis_x());
|
||||
int NY1 = axis_y().bins()+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int j=0;j<=NY1;j++) {
|
||||
w += CHIJ(m_id,i,j);
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
rret bin_height_y(int aIndexY) const {
|
||||
int j = hindex(aIndexY,axis_y());
|
||||
int NX1 = axis_x().bins()+1;
|
||||
rret w = 0;
|
||||
cd_beg();
|
||||
for(int i=0;i<=NX1;i++) {
|
||||
w += CHIJ(m_id,i,j);
|
||||
}
|
||||
cd_end();
|
||||
return w;
|
||||
}
|
||||
protected:
|
||||
hbook::axis m_axis_x;
|
||||
hbook::axis m_axis_y;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -1,80 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_p1
|
||||
#define tools_hbook_p1
|
||||
|
||||
#include "base_histo"
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class p1 : public base_histo {
|
||||
public:
|
||||
p1(int aID,const std::string& aTitle,
|
||||
int aXnumber,rarg aXmin,rarg aXmax,
|
||||
rarg aVmin,rarg aVmax)
|
||||
:base_histo(aID)
|
||||
,m_axis(m_path,aID,1,true,true)
|
||||
{
|
||||
cd_beg();
|
||||
CHBPROF(m_id,aTitle,
|
||||
aXnumber,aXmin,aXmax,
|
||||
aVmin,aVmax,
|
||||
""); //FIXME : or "S" or "T" ?
|
||||
cd_end();
|
||||
}
|
||||
virtual ~p1(){
|
||||
cd_beg();
|
||||
CHDELET(m_id);
|
||||
cd_end();
|
||||
}
|
||||
private:
|
||||
p1(const p1& a_from)
|
||||
:base_histo(a_from)
|
||||
,m_axis(a_from.m_axis)
|
||||
{}
|
||||
p1& operator=(const p1& a_from){
|
||||
base_histo::operator=(a_from);
|
||||
m_axis = a_from.m_axis;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
bool configure(int aXnumber,rarg aXmin,rarg aXmax,rarg aVmin,rarg aVmax){
|
||||
cd_beg();
|
||||
CHBPROF(m_id,title(),
|
||||
aXnumber,aXmin,aXmax,
|
||||
aVmin,aVmax,
|
||||
""); //FIXME : or "S" or "T" ?
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
void fill(rarg aX,rarg aY,rarg aWeight = 1) {
|
||||
cd_beg();
|
||||
CHFILL(m_id,aX,aY,aWeight);
|
||||
cd_end();
|
||||
}
|
||||
|
||||
// optimization :
|
||||
void fill_beg() const {cd_beg();}
|
||||
void fill_fast(rarg aX,rarg aY,rarg aWeight = 1) {
|
||||
CHFILL(m_id,aX,aY,aWeight);
|
||||
}
|
||||
void fill_end() const {cd_end();}
|
||||
|
||||
int dimension() const {return 1;}
|
||||
|
||||
const hbook::axis& axis() const {return m_axis;}
|
||||
hbook::axis& axis() {return m_axis;}
|
||||
|
||||
int coord_to_index(rarg aCoord) const {
|
||||
return m_axis.coord_to_index(aCoord);
|
||||
}
|
||||
protected:
|
||||
hbook::axis m_axis;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -1,263 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_wfile
|
||||
#define tools_hbook_wfile
|
||||
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
|
||||
#include "CHBOOK"
|
||||
#include <tools/srep>
|
||||
#include <tools/sout>
|
||||
|
||||
#ifdef WIN32
|
||||
extern "C" void __stdcall OCLOSE(int*);
|
||||
#else
|
||||
extern "C" void oclose_(int*);
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class wfile {
|
||||
public:
|
||||
wfile(std::ostream& a_out,const std::string& a_file,
|
||||
unsigned int a_unit = 1,bool a_verbose = false)
|
||||
:m_out(a_out)
|
||||
,m_verbose(a_verbose)
|
||||
,m_file_name(a_file)
|
||||
,m_is_valid(false)
|
||||
,m_unit(0)
|
||||
{
|
||||
std::string opts("NQ");
|
||||
// maximum number of records
|
||||
get_quest()[9] = 65000;
|
||||
int record_size = 1024;
|
||||
|
||||
m_dir = "LUN";
|
||||
{std::ostringstream strm;
|
||||
strm << a_unit;
|
||||
m_dir += strm.str();}
|
||||
|
||||
//FIXME : we should check if m_dir already exists.
|
||||
|
||||
int ier = CHROPEN(a_unit,m_dir,m_file_name,opts,record_size);
|
||||
if(ier) {
|
||||
m_out << "tools::hbook::wfile :"
|
||||
<< " error on hropen, code " << ier
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if(get_quest()[0]) {
|
||||
m_out << "tools::hbook::wfile :"
|
||||
<< " error, cannot open file " << a_file
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_verbose) {
|
||||
m_out << "tools::hbook::wfile :"
|
||||
<< " file " << a_file << " opened."
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
CHCDIR("//PAWC"," ");
|
||||
if(CHEDIR(m_dir,true)) CHDDIR(m_dir);
|
||||
CHMDIR(m_dir," ");
|
||||
|
||||
CHCDIR("//PAWC/"+m_dir," ");
|
||||
|
||||
m_unit = a_unit;
|
||||
m_is_valid = true;
|
||||
}
|
||||
virtual ~wfile() {
|
||||
if(m_verbose) {
|
||||
m_out << "tools::hbook::wfile::~wfile : cleanup..." << std::endl;
|
||||
}
|
||||
|
||||
//rootFolder().clear();
|
||||
|
||||
if(m_is_valid) {
|
||||
|
||||
//CHDELET(0);
|
||||
if(m_verbose) {
|
||||
m_out << "tools::hbook::wfile::~wfile : hrend..." << std::endl;
|
||||
}
|
||||
CHREND(m_dir);
|
||||
#ifdef WIN32
|
||||
OCLOSE(&m_unit);
|
||||
#else
|
||||
oclose_(&m_unit);
|
||||
#endif
|
||||
m_unit = 0;
|
||||
|
||||
CHCDIR("//PAWC"," ");
|
||||
if(CHEDIR(m_dir,true)) CHDDIR(m_dir);
|
||||
|
||||
}
|
||||
|
||||
if(m_verbose) {
|
||||
m_out << "tools::hbook::wfile::~wfile : end." << std::endl;
|
||||
}
|
||||
}
|
||||
private:
|
||||
wfile(const wfile& a_from):m_out(a_from.m_out){}
|
||||
wfile& operator=(const wfile&){return *this;}
|
||||
public:
|
||||
const std::string& store_name() const {return m_file_name;}
|
||||
bool is_valid() const {return m_is_valid;}
|
||||
bool write() {
|
||||
if(!m_is_valid) return false;
|
||||
|
||||
std::string pwd = CHPWD();
|
||||
|
||||
CHCDIR("//PAWC/"+m_dir," ");
|
||||
CHCDIR("//"+m_dir," ");
|
||||
CHROUT(0,0,"T");
|
||||
|
||||
//CHLDIR("//PAWC/"+m_dir,"T");
|
||||
//CHLDIR("//"+m_dir,"T");
|
||||
|
||||
CHCDIR(pwd," ");
|
||||
|
||||
return true;
|
||||
}
|
||||
bool close() {
|
||||
if(!m_is_valid) return true; //done or not opened.
|
||||
CHREND(m_dir);
|
||||
#ifdef WIN32
|
||||
OCLOSE(&m_unit);
|
||||
#else
|
||||
oclose_(&m_unit);
|
||||
#endif
|
||||
m_unit = 0;
|
||||
m_is_valid = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cd_home(){
|
||||
if(!m_is_valid) return false;
|
||||
CHCDIR("//PAWC/"+m_dir," ");
|
||||
return true;
|
||||
}
|
||||
bool cd_up(){
|
||||
if(!m_is_valid) return false;
|
||||
|
||||
std::string pwd = CHPWD(); // pwd should be //PAWC/LUN<unit>/<something>
|
||||
if(pwd.substr(0,10)!="//PAWC/LUN") {
|
||||
m_out << "tools::hbook::wfile::cd_up :"
|
||||
<< " current directory " << tools::sout(pwd)
|
||||
<< " is not under //PAWC/LUN."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// look if not under //PAWC/LUN<unit> :
|
||||
{std::string s = pwd;
|
||||
tools::replace(s,"//PAWC/LUN","");
|
||||
if(s.find('/')==std::string::npos) return true;} //Can't cd. But it is ok.
|
||||
|
||||
CHCDIR("\\"," "); //cd up under //PAWC/LUN<unit>/<something>
|
||||
std::string pwd2 = CHPWD();
|
||||
|
||||
std::string s = pwd;
|
||||
tools::replace(s,"//PAWC","/");
|
||||
// s should be //LUN<unit>/<something>
|
||||
|
||||
CHCDIR(s," ");
|
||||
CHCDIR("\\"," "); //cd up under //LUN<unit>/<something>
|
||||
|
||||
CHCDIR(pwd2," ");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool mkdir(const std::string& a_name){
|
||||
// create a directory under
|
||||
// //LUN<unit>/<something>
|
||||
// and
|
||||
// //PAWC/LUN<unit>/<something>
|
||||
|
||||
if(!m_is_valid) return false;
|
||||
|
||||
// a_name should not be a path.
|
||||
if(a_name.find('/')!=std::string::npos) {
|
||||
m_out << "tools::hbook::wfile::mkdir :"
|
||||
<< " " << tools::sout(a_name) << " should not be a path."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(a_name.find('.')!=std::string::npos) {
|
||||
m_out << "tools::hbook::wfile::mkdir :"
|
||||
<< " " << tools::sout(a_name) << " should not be a path."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(a_name.empty()) return true;
|
||||
|
||||
std::string pwd = CHPWD(); // pwd should be //PAWC/LUN<unit>/<something>
|
||||
if(pwd.substr(0,10)!="//PAWC/LUN") {
|
||||
m_out << "tools::hbook::wfile::mkdir :"
|
||||
<< " current directory " << tools::sout(pwd)
|
||||
<< " is not under //PAWC/LUN."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(CHEDIR(a_name,true)) {
|
||||
//we assume that a_name is also here under //LUN<unit>/<something>
|
||||
return true;
|
||||
}
|
||||
|
||||
CHMDIR(a_name," ");
|
||||
|
||||
std::string s = pwd;
|
||||
tools::replace(s,"//PAWC","/");
|
||||
// s should be //LUN<unit>/<something>
|
||||
|
||||
CHCDIR(s," ");
|
||||
CHMDIR(a_name," ");
|
||||
|
||||
CHCDIR(pwd," ");
|
||||
|
||||
return true;
|
||||
}
|
||||
bool mkcd(const std::string& a_name){
|
||||
if(!mkdir(a_name)) return false;
|
||||
CHCDIR(a_name," ");
|
||||
return true;
|
||||
}
|
||||
bool cd(const std::string& a_name){
|
||||
CHCDIR(a_name," ");
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::ostream& m_out;
|
||||
bool m_verbose;
|
||||
std::string m_file_name;
|
||||
bool m_is_valid;
|
||||
std::string m_dir;
|
||||
int m_unit;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
// NOTE :
|
||||
// For doing RZ write :
|
||||
// - A //LUN<unit> has to be open.
|
||||
// - We create a //PAWC/LUN<unit> under //PAWC.
|
||||
// - The hierarchy is done in //PAWC/LUN<unit> and histos
|
||||
// are booked here. (A HBOOK1 books anyway in a directory under //PAWC).
|
||||
// - The //PAWC/LUN<unit> structure has to be duplicated under //LUN<unit>.
|
||||
// - Then a global CHROUT(0,0,"T") can be done after doing :
|
||||
// CHCDIR("//PAWC/LUN<unit>"," ")
|
||||
// CHCDIR("//LUN<unit>"," ")
|
||||
|
||||
//exlib_build_use inlib
|
||||
@@ -1,241 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_hbook_wntuple
|
||||
#define tools_hbook_wntuple
|
||||
|
||||
// A class to write an HBOOK ntuple.
|
||||
|
||||
#include <tools/vmanip>
|
||||
#include <tools/vfind>
|
||||
#include <tools/srep>
|
||||
#include <tools/sto>
|
||||
#include <tools/scast>
|
||||
#include <tools/stype>
|
||||
#include <tools/sout>
|
||||
#include <tools/num2s>
|
||||
#include <tools/ntuple_booking>
|
||||
|
||||
#include "CHBOOK"
|
||||
|
||||
#ifdef WIN32
|
||||
extern "C" int NTUC[1];
|
||||
#else
|
||||
extern "C" int ntuc_[1];
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace hbook {
|
||||
|
||||
class wntuple {
|
||||
|
||||
protected:
|
||||
class icol {
|
||||
public:
|
||||
virtual ~icol(){}
|
||||
public:
|
||||
virtual void* cast(const std::string&) const = 0;
|
||||
virtual const std::string& s_cls() const = 0;
|
||||
public:
|
||||
virtual const std::string& name() const = 0; //for find_named
|
||||
};
|
||||
|
||||
public:
|
||||
template <class T>
|
||||
class column : public virtual icol {
|
||||
public:
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v
|
||||
("tools::hbook::wntuple::column<"+tools::stype(T())+">");
|
||||
return s_v;
|
||||
}
|
||||
public: //icol
|
||||
virtual void* cast(const std::string& a_class) const {
|
||||
if(void* p = tools::cmp_cast< column<T> >(this,a_class)) return p;
|
||||
else return 0;
|
||||
}
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
virtual const std::string& name() const {return m_name;}
|
||||
public:
|
||||
column(const std::string& a_name)
|
||||
:m_name(a_name),m_tmp(0)
|
||||
{}
|
||||
virtual ~column(){}
|
||||
protected:
|
||||
column(const column& a_from)
|
||||
:icol(a_from),m_name(a_from.m_name),m_tmp(a_from.m_tmp)
|
||||
{}
|
||||
column& operator=(const column& a_from){
|
||||
m_name = a_from.m_name;
|
||||
m_tmp = a_from.m_tmp;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
void set_address(T* a_pos) {m_tmp = a_pos;}
|
||||
bool fill(const T& a_value) {*m_tmp = a_value;return true;}
|
||||
protected:
|
||||
std::string m_name;
|
||||
T* m_tmp;
|
||||
};
|
||||
|
||||
public:
|
||||
wntuple(int a_id,const std::string& a_title)
|
||||
:m_path(CHPWD()),m_id(a_id),m_path_file(CHPWD())
|
||||
{
|
||||
// WARNING : the below assumes that we are under //PAWC/<something>
|
||||
// and that a //<something> exists and is attached to a file.
|
||||
tools::replace(m_path_file,"//PAWC","/");
|
||||
cd_beg();
|
||||
CHBNT(m_id,a_title," ");
|
||||
cd_end();
|
||||
}
|
||||
|
||||
wntuple(int a_id,std::ostream& a_out,const tools::ntuple_booking& a_bkg)
|
||||
:m_path(CHPWD()),m_id(a_id),m_path_file(CHPWD())
|
||||
{
|
||||
// WARNING : the below assumes that we are under //PAWC/<something>
|
||||
// and that a //<something> exists and is attached to a file.
|
||||
tools::replace(m_path_file,"//PAWC","/");
|
||||
cd_beg();
|
||||
CHBNT(m_id,a_bkg.title()," ");
|
||||
cd_end();
|
||||
|
||||
const std::vector<tools::column_booking>& cols = a_bkg.columns();
|
||||
std::vector<tools::column_booking>::const_iterator it;
|
||||
for(it=cols.begin();it!=cols.end();++it){
|
||||
|
||||
if((*it).cls_id()==tools::_cid(int(0))) {
|
||||
create_column<int>((*it).name());
|
||||
} else if((*it).cls_id()==tools::_cid(float(0))) {
|
||||
create_column<float>((*it).name());
|
||||
} else if((*it).cls_id()==tools::_cid(double(0))) {
|
||||
create_column<double>((*it).name());
|
||||
|
||||
} else {
|
||||
a_out << "tools::hbook::wntuple :"
|
||||
<< " for column " << tools::sout((*it).name())
|
||||
<< ", type with cid " << (*it).cls_id() << " not yet handled."
|
||||
<< std::endl;
|
||||
//throw
|
||||
tools::clear<icol>(m_cols);
|
||||
//FIXME : should undo the calls to CHBNAME.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~wntuple(){
|
||||
cd_beg();
|
||||
CHDELET(m_id);
|
||||
cd_end();
|
||||
tools::clear<icol>(m_cols);
|
||||
}
|
||||
protected:
|
||||
//Can we copy the HBOOK object ?
|
||||
wntuple(const wntuple& a_from)
|
||||
:m_path(a_from.m_path),m_id(a_from.m_id)
|
||||
{}
|
||||
wntuple& operator=(const wntuple& a_from){
|
||||
m_path = a_from.m_path;
|
||||
m_id = a_from.m_id;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
template <class T>
|
||||
column<T>* create_column(const std::string& a_name) {
|
||||
if(tools::find_named<icol>(m_cols,a_name)) return 0;
|
||||
|
||||
std::string block("blk"); //8 chars max.
|
||||
if(!tools::numas<unsigned int>(m_cols.size(),block)){}
|
||||
if(block.size()>8) return 0;
|
||||
|
||||
column<T>* col = new column<T>(a_name);
|
||||
|
||||
#ifdef WIN32
|
||||
int nvar = NTUC[0];
|
||||
char* pos = ((char*)NTUC)+8+8*nvar;
|
||||
NTUC[0]++;
|
||||
#else
|
||||
int nvar = ntuc_[0];
|
||||
char* pos = ((char*)ntuc_)+8+8*nvar;
|
||||
ntuc_[0]++;
|
||||
#endif
|
||||
|
||||
col->set_address((T*)pos);
|
||||
|
||||
cd_beg();
|
||||
CHBNAME(m_id,block,pos,a_name+":"+h_type(T()));
|
||||
cd_end();
|
||||
|
||||
m_cols.push_back(col);
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
bool add_row() {
|
||||
cd_beg();
|
||||
CHFNT(m_id);
|
||||
cd_end();
|
||||
return true;
|
||||
}
|
||||
|
||||
// optimization :
|
||||
void add_row_beg() const {cd_beg();}
|
||||
bool add_row_fast() {CHFNT(m_id);return true;}
|
||||
void add_row_end() const {cd_end();}
|
||||
|
||||
|
||||
template <class T>
|
||||
column<T>* find_column(const std::string& a_name) {
|
||||
icol* col = tools::find_named<icol>(m_cols,a_name);
|
||||
if(!col) return 0;
|
||||
return tools::safe_cast<icol, column<T> >(*col);
|
||||
}
|
||||
|
||||
//std::string title() const {
|
||||
// std::string title;
|
||||
// int ncx,ncy;
|
||||
// rarg xmin,xmax,ymin,ymax;
|
||||
// cd_beg();
|
||||
// CHGIVE(m_id,title,ncx,xmin,xmax,ncy,ymin,ymax);
|
||||
// cd_end();
|
||||
// return title;
|
||||
//}
|
||||
|
||||
const std::vector<icol*>& columns() const {return m_cols;}
|
||||
|
||||
protected:
|
||||
static const std::string& h_type(int) {
|
||||
static const std::string s_v("I*4");
|
||||
return s_v;
|
||||
}
|
||||
static const std::string& h_type(float) {
|
||||
static const std::string s_v("R*4");
|
||||
return s_v;
|
||||
}
|
||||
static const std::string& h_type(double) {
|
||||
static const std::string s_v("R*8");
|
||||
return s_v;
|
||||
}
|
||||
|
||||
protected:
|
||||
void cd_beg() const{
|
||||
wntuple& self = const_cast<wntuple&>(*this);
|
||||
CHPWDF(self.m_tmp);
|
||||
CHCDIR(m_path," ");
|
||||
CHCDIR(m_path_file," "); // cd on file.
|
||||
}
|
||||
void cd_end() const {CHCDIR(m_tmp," ");}
|
||||
protected:
|
||||
std::string m_path;
|
||||
int m_id;
|
||||
std::string m_path_file;
|
||||
char m_tmp[1024];
|
||||
std::vector<icol*> m_cols;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
//exlib_build_use inlib
|
||||
@@ -1,77 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_mpi_world
|
||||
#define tools_mpi_world
|
||||
|
||||
// code to wrap MPI global things by having an interface (inlib::mpi).
|
||||
|
||||
#include <tools/impi_world>
|
||||
|
||||
#ifdef TOOLS_USE_NATIVE_MPI
|
||||
#include <mpi.h>
|
||||
#else
|
||||
#include "dummy_mpi.h"
|
||||
#endif
|
||||
|
||||
#ifdef TOOLS_MEM
|
||||
#include <tools/mem>
|
||||
#endif
|
||||
|
||||
namespace tools {
|
||||
namespace mpi {
|
||||
|
||||
class world : public virtual tools::impi_world {
|
||||
typedef tools::impi_world parent;
|
||||
#ifdef TOOLS_MEM
|
||||
protected:
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v("tools::mpi::world");
|
||||
return s_v;
|
||||
}
|
||||
#endif
|
||||
public:
|
||||
virtual bool init(int* a_argc,char*** a_argv) {
|
||||
if(::MPI_Init(a_argc,a_argv)!=MPI_SUCCESS) return false;
|
||||
return true;
|
||||
}
|
||||
virtual bool rank(int& a_rank) const {
|
||||
if(::MPI_Comm_rank(MPI_COMM_WORLD,&a_rank)!=MPI_SUCCESS) {a_rank=-1;return false;}
|
||||
return true;
|
||||
}
|
||||
virtual bool size(int& a_size) const {
|
||||
if(::MPI_Comm_size(MPI_COMM_WORLD,&a_size)!=MPI_SUCCESS) {a_size=0;return false;}
|
||||
return true;
|
||||
}
|
||||
virtual bool processor_name(std::string& a_s) const {
|
||||
char name[MPI_MAX_PROCESSOR_NAME];
|
||||
int lname;
|
||||
if(::MPI_Get_processor_name(name,&lname)!=MPI_SUCCESS) {a_s.clear();return false;}
|
||||
a_s = std::string(name);
|
||||
return true;
|
||||
}
|
||||
public:
|
||||
world() {
|
||||
#ifdef TOOLS_MEM
|
||||
tools::mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
virtual ~world(){
|
||||
#ifdef TOOLS_MEM
|
||||
tools::mem::decrement(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
protected:
|
||||
world(const world& a_from):parent(a_from) {
|
||||
#ifdef TOOLS_MEM
|
||||
tools::mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
world& operator=(const world&) {return *this;}
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
//exlib_build_use inlib mpi
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_zfunc
|
||||
#define tools_zfunc
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace tools {
|
||||
|
||||
typedef bool (*unzip_func)(std::ostream&,
|
||||
unsigned int,const char*,
|
||||
unsigned int,char*,
|
||||
unsigned int&);
|
||||
|
||||
typedef bool (*zip_func)(std::ostream&,
|
||||
unsigned int,
|
||||
unsigned int,const char*,
|
||||
unsigned int,char*,
|
||||
unsigned int&);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,18 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# CMakeLists.txt
|
||||
# Module : G4analysis
|
||||
# Package: Geant4.src.G4analysis.G4analysismng
|
||||
#
|
||||
# CMakeLists.txt for building a single granular library.
|
||||
#
|
||||
# Created on : 15/07/2013
|
||||
#
|
||||
# $Id: CMakeLists.txt 92606 2015-09-08 12:34:01Z ihrivnac $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if(GEANT4_BUILD_GRANULAR_LIBS)
|
||||
include(Geant4MacroLibraryTargets)
|
||||
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
|
||||
endif()
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# $Id: GNUmakefile 66356 2012-12-18 09:02:32Z gcosmo $
|
||||
# --------------------------------------------------------------------
|
||||
# GNUmakefile for analysis/management sub-library.
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
name := G4parameters
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/intercoms/include \
|
||||
-I$(G4BASE)/analysis/g4tools/include \
|
||||
-I$(G4BASE)/analysis/management/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
@@ -1,50 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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$
|
||||
|
||||
// Author: Ivana Hrivnacova, 04/07/2012 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4MergeMode_h
|
||||
#define G4MergeMode_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// Enumeration for definition available binning schemes
|
||||
|
||||
enum class G4MergeMode {
|
||||
kAddition,
|
||||
kMultiplication,
|
||||
kUser
|
||||
};
|
||||
|
||||
// Utility function
|
||||
namespace G4Analysis {
|
||||
|
||||
G4MergeMode GetMergeMode(const G4String& mergeModeName);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,74 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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$
|
||||
|
||||
// Class template for parameters handled by Geant4 analysis
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 07/09/2015 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4Parameter_h
|
||||
#define G4Parameter_h 1
|
||||
|
||||
#include "G4VParameter.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
template <typename T>
|
||||
class G4Parameter : public G4VParameter
|
||||
{
|
||||
public:
|
||||
G4Parameter(const G4String& name, T initValue,
|
||||
G4MergeMode mergeMode = G4MergeMode::kAddition);
|
||||
G4Parameter(const G4Parameter& rhs);
|
||||
G4Parameter() = delete;
|
||||
virtual ~G4Parameter();
|
||||
|
||||
// operators
|
||||
G4Parameter<T>& operator= (const G4Parameter<T>& rhs);
|
||||
G4Parameter<T>& operator+=(const G4Parameter<T>& rhs);
|
||||
G4Parameter<T>& operator*=(const G4Parameter<T>& rhs);
|
||||
|
||||
G4Parameter<T>& operator= (const T& rhs);
|
||||
G4Parameter<T>& operator+=(const T& rhs);
|
||||
G4Parameter<T>& operator*=(const T& rhs);
|
||||
|
||||
// methods
|
||||
virtual void Merge(const G4VParameter& other) final;
|
||||
virtual void Reset() final;
|
||||
|
||||
// get methods
|
||||
T GetValue() const;
|
||||
|
||||
private:
|
||||
// data members
|
||||
T fValue;
|
||||
T fInitValue;
|
||||
};
|
||||
|
||||
// inline functions
|
||||
|
||||
#include "G4Parameter.icc"
|
||||
|
||||
#endif
|
||||
@@ -1,146 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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$
|
||||
|
||||
//
|
||||
// public functions
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>::G4Parameter(const G4String& name, T initValue, G4MergeMode mergeMode)
|
||||
: G4VParameter(name, mergeMode),
|
||||
fValue(initValue),
|
||||
fInitValue(initValue)
|
||||
{}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>::G4Parameter(const G4Parameter& rhs)
|
||||
: G4VParameter(rhs),
|
||||
fValue(rhs.fValue),
|
||||
fInitValue(rhs.fInitValue)
|
||||
{}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>::~G4Parameter()
|
||||
{}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator=(const G4Parameter<T>& rhs)
|
||||
{
|
||||
// check assignment to self
|
||||
if (this == &rhs) return *this;
|
||||
|
||||
// base class assignment
|
||||
G4VParameter::operator=(rhs);
|
||||
|
||||
// this class data assignment
|
||||
fValue = rhs.fValue;
|
||||
fInitValue = rhs.fInitValue;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator+=(const G4Parameter<T>& rhs)
|
||||
{
|
||||
// only update the value from rhs
|
||||
fValue += rhs.fValue;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator*=(const G4Parameter<T>& rhs)
|
||||
{
|
||||
// only update the value from rhs
|
||||
fValue *= rhs.fValue;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator=(const T& value)
|
||||
{
|
||||
// only update the value
|
||||
fValue = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator+=(const T& value)
|
||||
{
|
||||
// only update the value
|
||||
fValue += value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>&
|
||||
G4Parameter<T>::operator*=(const T& value)
|
||||
{
|
||||
// only update the value from rhs
|
||||
fValue *= value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4Parameter<T>::Merge(const G4VParameter& other)
|
||||
{
|
||||
if ( fMergeMode == G4MergeMode::kAddition ) {
|
||||
fValue += static_cast<const G4Parameter<T>&>(other).fValue;
|
||||
}
|
||||
else if ( fMergeMode == G4MergeMode::kMultiplication ) {
|
||||
fValue *= static_cast<const G4Parameter<T>&>(other).fValue;
|
||||
}
|
||||
// no operation is performed if User merge mode
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4Parameter<T>::Reset()
|
||||
{
|
||||
fValue = fInitValue;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
T G4Parameter<T>::GetValue() const
|
||||
{
|
||||
return fValue;
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParameterManager.hh 91012 2015-06-15 10:38:07Z ihrivnac $
|
||||
|
||||
// The common implementation of analysis manager classes.
|
||||
|
||||
// Author: Ivana Hrivnacova, 07/09/2015 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4ParameterManager_h
|
||||
#define G4ParameterManager_h 1
|
||||
|
||||
#include "G4Parameter.hh"
|
||||
#include "G4AnalysisManagerState.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class G4AnalysisManagerState;
|
||||
class G4VParameter;
|
||||
|
||||
class G4ParameterManager
|
||||
{
|
||||
public:
|
||||
G4ParameterManager(G4bool isMaster = true);
|
||||
virtual ~G4ParameterManager();
|
||||
|
||||
// static methods
|
||||
static G4ParameterManager* Instance();
|
||||
|
||||
// Methods
|
||||
|
||||
// Requirements for parameter type:
|
||||
// Must have defined operators: +, ==, +=, *=
|
||||
template <typename T>
|
||||
void CreateParameter(const G4String& name, T value,
|
||||
G4MergeMode mergeMode = G4MergeMode::kAddition);
|
||||
|
||||
template <typename T>
|
||||
void RegisterParameter(G4Parameter<T>& parameter);
|
||||
|
||||
template <typename T>
|
||||
G4Parameter<T>* GetParameter(const G4String& name, G4bool warn = true) const;
|
||||
|
||||
// Handling user defined parameters
|
||||
void RegisterParameter(G4VParameter* parameter);
|
||||
G4VParameter* GetParameter(const G4String& name, G4bool warn = true) const;
|
||||
|
||||
|
||||
// Iterators not (yet) provided
|
||||
|
||||
// Methods for merging
|
||||
//G4bool MergeImpl(tools::histo::hmpi* hmpi);
|
||||
void Merge();
|
||||
void Reset();
|
||||
|
||||
private:
|
||||
// static data members
|
||||
static G4ParameterManager* fgMasterInstance;
|
||||
static G4ThreadLocal G4ParameterManager* fgInstance;
|
||||
|
||||
// data members
|
||||
const G4AnalysisManagerState fState;
|
||||
std::map<G4String, G4VParameter*> fMap;
|
||||
std::vector<G4VParameter*> fParametersToDelete;
|
||||
};
|
||||
|
||||
#include "G4ParameterManager.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParameterManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
#include <tools/cids>
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4ParameterManager::CreateParameter(
|
||||
const G4String& name, T value, G4MergeMode mergeMode)
|
||||
{
|
||||
G4VParameter* parameter = new G4Parameter<T>(name, value, mergeMode);
|
||||
fMap[name] = parameter;
|
||||
fParametersToDelete.push_back(parameter);
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
void G4ParameterManager::RegisterParameter(G4Parameter<T>& parameter)
|
||||
{
|
||||
fMap[parameter.GetName()] = ¶meter;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
template <typename T>
|
||||
G4Parameter<T>*
|
||||
G4ParameterManager::GetParameter(const G4String& name, G4bool warn) const
|
||||
{
|
||||
// get G4VParammeter from the map
|
||||
auto parameter = GetParameter(name, warn);
|
||||
if ( ! parameter ) return 0;
|
||||
|
||||
// check type
|
||||
G4Parameter<T>* tparameter = dynamic_cast<G4Parameter<T>*>(parameter);
|
||||
if ( ! tparameter ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "parameter " << name << " has different type";
|
||||
G4Exception("G4ParameterManager::GetParameter<T>",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return tparameter;
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4CsvNtupleManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
// Value type independent base class for parameters handled by Geant4 analysis
|
||||
//
|
||||
// Author: Ivana Hrivnacova, 04/09/2015 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifndef G4VParameter_h
|
||||
#define G4VParameter_h 1
|
||||
|
||||
#include "tools/cids"
|
||||
|
||||
#include "G4MergeMode.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
|
||||
class G4VParameter
|
||||
{
|
||||
public:
|
||||
G4VParameter(const G4String& name,
|
||||
G4MergeMode mergeMode = G4MergeMode::kAddition);
|
||||
G4VParameter(const G4VParameter& rhs);
|
||||
G4VParameter() = delete;
|
||||
virtual ~G4VParameter() {}
|
||||
|
||||
// operators
|
||||
G4VParameter& operator=(const G4VParameter& rhs);
|
||||
|
||||
// methods
|
||||
virtual void Merge(const G4VParameter& other) = 0;
|
||||
virtual void Reset() = 0;
|
||||
|
||||
// get methods
|
||||
G4String GetName() const;
|
||||
G4MergeMode GetMergeMode() const;
|
||||
|
||||
protected:
|
||||
G4String fName;
|
||||
G4MergeMode fMergeMode;
|
||||
};
|
||||
|
||||
#include "G4VParameter.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParameterManager.hh 70604 2013-06-03 11:27:06Z ihrivnac $
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline G4VParameter::G4VParameter(const G4String& name, G4MergeMode mergeMode)
|
||||
: fName(name), fMergeMode(mergeMode)
|
||||
{}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline G4VParameter::G4VParameter(const G4VParameter& rhs)
|
||||
: fName(rhs.fName), fMergeMode(rhs.fMergeMode)
|
||||
{}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline G4VParameter& G4VParameter::operator=(const G4VParameter& rhs)
|
||||
{
|
||||
fName = rhs.fName;
|
||||
fMergeMode = rhs.fMergeMode;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline G4String G4VParameter::GetName() const
|
||||
{
|
||||
return fName;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
inline G4MergeMode G4VParameter::GetMergeMode() const
|
||||
{
|
||||
return fMergeMode;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# sources.cmake
|
||||
# Module : G4hntools
|
||||
# Package: Geant4.src.G4analysis.G4hntools
|
||||
#
|
||||
# Sources description for a library.
|
||||
# Lists the sources and headers of the code explicitely.
|
||||
# Lists include paths needed.
|
||||
# Lists the internal granular and global dependencies of the library.
|
||||
# Source specific properties should be added at the end.
|
||||
#
|
||||
# Generated on : 15/07/2013
|
||||
#
|
||||
# $Id: sources.cmake 91489 2015-07-20 12:53:29Z ihrivnac $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# List external includes needed.
|
||||
include_directories(${CLHEP_INCLUDE_DIRS})
|
||||
|
||||
# List internal includes needed.
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/g4tools/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/management/include)
|
||||
|
||||
#
|
||||
# Define the Geant4 Module.
|
||||
#
|
||||
|
||||
include(Geant4MacroDefineModule)
|
||||
GEANT4_DEFINE_MODULE(NAME G4hntools
|
||||
HEADERS
|
||||
G4MergeMode.hh
|
||||
G4ParameterManager.hh
|
||||
G4ParameterManager.icc
|
||||
G4Parameter.hh
|
||||
G4Parameter.icc
|
||||
G4VParameter.hh
|
||||
G4VParameter.icc
|
||||
SOURCES
|
||||
G4MergeMode.cc
|
||||
G4ParameterManager.cc
|
||||
GRANULAR_DEPENDENCIES
|
||||
G4globman
|
||||
G4intercoms
|
||||
G4analysismng
|
||||
GLOBAL_DEPENDENCIES
|
||||
G4global
|
||||
G4intercoms
|
||||
LINK_LIBRARIES
|
||||
)
|
||||
|
||||
# List any source specific properties here
|
||||
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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:$
|
||||
|
||||
// Author: Ivana Hrivnacova, 22/08/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#include "G4MergeMode.hh"
|
||||
|
||||
namespace G4Analysis
|
||||
{
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4MergeMode GetMergeMode(const G4String& mergeModeName) {
|
||||
if ( mergeModeName == "+" ) { return G4MergeMode::kAddition; }
|
||||
else if ( mergeModeName == "*" ) { return G4MergeMode::kMultiplication; }
|
||||
else if ( mergeModeName == "user" ) { return G4MergeMode::kUser; }
|
||||
else {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< " \"" << mergeModeName << "\" merge mode is not supported." << G4endl
|
||||
<< " " << "Addition will be applied.";
|
||||
G4Exception("G4Analysis::GetMergeMode",
|
||||
"Analysis_W013", JustWarning, description);
|
||||
return G4MergeMode::kAddition;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ParameterManager.cc 91116 2015-06-20 12:33:45Z ihrivnac $
|
||||
|
||||
// Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#include "G4ParameterManager.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
// mutex in a file scope
|
||||
|
||||
namespace {
|
||||
//Mutex to lock master manager when merging parameters
|
||||
G4Mutex mergeMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4ParameterManager* G4ParameterManager::fgMasterInstance = nullptr;
|
||||
G4ThreadLocal G4ParameterManager* G4ParameterManager::fgInstance = nullptr;
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4ParameterManager* G4ParameterManager::Instance()
|
||||
{
|
||||
if ( fgInstance == nullptr ) {
|
||||
G4bool isMaster = ! G4Threading::IsWorkerThread();
|
||||
fgInstance = new G4ParameterManager(isMaster);
|
||||
}
|
||||
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4ParameterManager::G4ParameterManager(G4bool isMaster)
|
||||
: fState("Parameter", isMaster),
|
||||
fMap()
|
||||
{
|
||||
if ( ( isMaster && fgMasterInstance ) || ( fgInstance ) ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< " "
|
||||
<< "G4ParameterAnalysisManager already exists."
|
||||
<< "Cannot create another instance.";
|
||||
G4Exception("G4ParameterAnalysisManager::G4ParameterAnalysisManager()",
|
||||
"Analysis_F001", FatalException, description);
|
||||
}
|
||||
if ( isMaster ) fgMasterInstance = this;
|
||||
fgInstance = this;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4ParameterManager::~G4ParameterManager()
|
||||
{
|
||||
// delete only parameters create by the mager itself
|
||||
for ( auto it : fParametersToDelete ) {
|
||||
delete it;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// public methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void G4ParameterManager::RegisterParameter(G4VParameter* parameter)
|
||||
{
|
||||
fMap[parameter->GetName()] = parameter;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4VParameter*
|
||||
G4ParameterManager::GetParameter(const G4String& name, G4bool warn) const
|
||||
{
|
||||
// get G4VParammeter from the map
|
||||
auto it = fMap.find(name);
|
||||
if ( it == fMap.end() ) {
|
||||
if ( warn) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "parameter " << name << " does not exist.";
|
||||
G4Exception("G4ParameterManager::GetParameter",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
// //_____________________________________________________________________________
|
||||
// G4bool G4ParameterManager::MergeImpl(tools::histo::hmpi* hmpi)
|
||||
// {
|
||||
// // tbd
|
||||
// return false;
|
||||
// }
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void G4ParameterManager::Merge()
|
||||
{
|
||||
// Do nothing if there are no parameters registered
|
||||
// or if master thread
|
||||
if ( (! fMap.size()) || (! G4Threading::IsWorkerThread()) ) return;
|
||||
|
||||
// The manager on mastter must exist
|
||||
if ( ! fgMasterInstance ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< " " << "No master G4ParameterManager instance exists."
|
||||
<< G4endl
|
||||
<< " " << "Parameters will not be merged.";
|
||||
G4Exception("G4ParameterManager::Merge()",
|
||||
"Analysis_W031", JustWarning, description);
|
||||
return;
|
||||
}
|
||||
|
||||
// The worker manager just merges its parameters to the master
|
||||
// This operation needs a lock
|
||||
G4cout << "Go to merge parameters" << G4endl;
|
||||
G4AutoLock lock(&mergeMutex);
|
||||
|
||||
// the other manager has the map with identical keys
|
||||
auto it = fMap.begin();
|
||||
for ( auto itMaster : fgMasterInstance->fMap ) {
|
||||
// G4VParameter* parameter = (it++)->second;
|
||||
// G4VParameter* masterParameter = itMaster->second;
|
||||
// masterParameter->Merge(*(parameter));
|
||||
itMaster.second->Merge(*((it++)->second));
|
||||
}
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void G4ParameterManager::Reset()
|
||||
{
|
||||
// Reset histograms and profiles
|
||||
|
||||
for ( auto it : fMap ) {
|
||||
it.second->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4LPhysicsFreeVector.icc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------
|
||||
//
|
||||
// Class G4LPhysicsFreeVector -- source file
|
||||
//
|
||||
// Derived from base class G4PhysicsVector
|
||||
// This is a free vector for Low Energy Physics cross section data.
|
||||
// The class name includes an "L" to distinguish it from other groups
|
||||
// who may wish to implement a free vector in a different way.
|
||||
// A subdivision method is used to find the energy|momentum bin.
|
||||
//
|
||||
// F.W. Jones, TRIUMF, 04-JUN-96
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
inline
|
||||
void G4LPhysicsFreeVector::PutValues(size_t binNumber,
|
||||
G4double binValue, G4double dataValue)
|
||||
// G4PhysicsVector has PutValue() but it is inconvenient.
|
||||
// Want to simultaneously fill the bin and data vectors.
|
||||
{
|
||||
binVector[binNumber] = binValue;
|
||||
dataVector[binNumber] = dataValue;
|
||||
if(binNumber == 0)
|
||||
{ edgeMin = binValue; }
|
||||
else if( numberOfNodes - 1 == binNumber)
|
||||
{ edgeMax = binValue; }
|
||||
}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PhysicsOrderedFreeVector.icc 93409 2015-10-21 13:26:27Z gcosmo $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Inline Functions Definitions
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// File: G4PhysicsOrderedFreeVector.icc
|
||||
// Version: 1.0
|
||||
// Author: Juliet Armstrong
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
// Updated:
|
||||
// 2000-11-11 by H.Kurashige
|
||||
// > use STL vector for dataVector and binVector
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////
|
||||
// Inline methods
|
||||
////////////////////
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxValue()
|
||||
{
|
||||
return dataVector.back();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinValue()
|
||||
{
|
||||
return dataVector.front();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy()
|
||||
{
|
||||
return binVector.back();
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy()
|
||||
{
|
||||
return binVector.front();
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PhysicsLnVector.cc 93409 2015-10-21 13:26:27Z gcosmo $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// G4PhysicsLnVector.cc
|
||||
//
|
||||
// 27 Apr 1999 - M.G.Pia: Created from G4PhysicsLogVector
|
||||
// 19 Jun 2009 - V.Ivanchenko : removed hidden bin
|
||||
// 02 Oct. 2013 V.Ivanchenko : Remove FindBinLocation method
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4PhysicsLnVector.hh"
|
||||
#include "G4Exp.hh"
|
||||
|
||||
G4PhysicsLnVector::G4PhysicsLnVector()
|
||||
: G4PhysicsVector()
|
||||
{
|
||||
type = T_G4PhysicsLogVector;
|
||||
}
|
||||
|
||||
G4PhysicsLnVector::G4PhysicsLnVector(size_t theNbin)
|
||||
: G4PhysicsVector()
|
||||
{
|
||||
type = T_G4PhysicsLogVector;
|
||||
|
||||
numberOfNodes = theNbin + 1;
|
||||
dataVector.reserve(numberOfNodes);
|
||||
binVector.reserve(numberOfNodes);
|
||||
|
||||
for (size_t i=0; i<numberOfNodes; ++i)
|
||||
{
|
||||
binVector.push_back(0.0);
|
||||
dataVector.push_back(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
G4PhysicsLnVector::G4PhysicsLnVector(G4double theEmin,
|
||||
G4double theEmax, size_t theNbin)
|
||||
: G4PhysicsVector()
|
||||
{
|
||||
type = T_G4PhysicsLnVector;
|
||||
|
||||
dBin = G4Log(theEmax/theEmin)/theNbin;
|
||||
baseBin = G4Log(theEmin)/dBin;
|
||||
numberOfNodes = theNbin + 1;
|
||||
dataVector.reserve(numberOfNodes);
|
||||
binVector.reserve(numberOfNodes);
|
||||
|
||||
binVector.push_back(theEmin);
|
||||
dataVector.push_back(0.0);
|
||||
|
||||
for (size_t i=1; i<numberOfNodes-1; ++i)
|
||||
{
|
||||
binVector.push_back(G4Exp((baseBin+i)*dBin));
|
||||
dataVector.push_back(0.0);
|
||||
}
|
||||
binVector.push_back(theEmax);
|
||||
dataVector.push_back(0.0);
|
||||
|
||||
edgeMin = binVector[0];
|
||||
edgeMax = binVector[numberOfNodes-1];
|
||||
}
|
||||
|
||||
G4PhysicsLnVector::~G4PhysicsLnVector(){}
|
||||
|
||||
G4bool G4PhysicsLnVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
{
|
||||
G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
|
||||
if (success)
|
||||
{
|
||||
G4double theEmin = binVector[0];
|
||||
dBin = G4Log(binVector[1]/theEmin);
|
||||
baseBin = G4Log(theEmin)/dBin;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
void G4PhysicsLnVector::ScaleVector(G4double factorE, G4double factorV)
|
||||
{
|
||||
G4PhysicsVector::ScaleVector(factorE, factorV);
|
||||
G4double theEmin = binVector[0];
|
||||
dBin = G4Log(binVector[1]/theEmin);
|
||||
baseBin = G4Log(theEmin)/dBin;
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4UIQt.hh'
|
||||
**
|
||||
** Created: Mon Nov 28 16:38:20 2016
|
||||
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../include/G4UIQt.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4UIQt.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 63
|
||||
#error "This file was generated using the moc from 4.8.4. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_G4UIQt[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
25, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
8, 7, 7, 7, 0x08,
|
||||
22, 7, 7, 7, 0x08,
|
||||
44, 7, 7, 7, 0x08,
|
||||
65, 7, 7, 7, 0x08,
|
||||
95, 90, 7, 7, 0x08,
|
||||
126, 7, 7, 7, 0x08,
|
||||
150, 7, 7, 7, 0x08,
|
||||
173, 7, 7, 7, 0x08,
|
||||
202, 7, 7, 7, 0x08,
|
||||
221, 7, 7, 7, 0x08,
|
||||
246, 7, 7, 7, 0x08,
|
||||
274, 7, 7, 7, 0x08,
|
||||
295, 7, 7, 7, 0x08,
|
||||
326, 7, 7, 7, 0x08,
|
||||
354, 7, 7, 7, 0x08,
|
||||
382, 7, 7, 7, 0x08,
|
||||
404, 7, 7, 7, 0x08,
|
||||
426, 7, 7, 7, 0x08,
|
||||
457, 7, 7, 7, 0x08,
|
||||
487, 7, 7, 7, 0x08,
|
||||
515, 7, 7, 7, 0x08,
|
||||
543, 7, 7, 7, 0x08,
|
||||
569, 7, 7, 7, 0x08,
|
||||
595, 7, 7, 7, 0x08,
|
||||
629, 7, 7, 7, 0x08,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4UIQt[] = {
|
||||
"G4UIQt\0\0ExitSession()\0ClearButtonCallback()\0"
|
||||
"SaveOutputCallback()\0CommandEnteredCallback()\0"
|
||||
"text\0CommandEditedCallback(QString)\0"
|
||||
"ButtonCallback(QString)\0HelpTreeClicCallback()\0"
|
||||
"HelpTreeDoubleClicCallback()\0"
|
||||
"ShowHelpCallback()\0CommandHistoryCallback()\0"
|
||||
"LookForHelpStringCallback()\0"
|
||||
"UpdateTabWidget(int)\0"
|
||||
"ResizeTabWidget(QResizeEvent*)\0"
|
||||
"CoutFilterCallback(QString)\0"
|
||||
"ThreadComboBoxCallback(int)\0"
|
||||
"TabCloseCallback(int)\0ToolBoxActivated(int)\0"
|
||||
"VisParameterCallback(QWidget*)\0"
|
||||
"ChangeColorCallback(QWidget*)\0"
|
||||
"ChangeCursorAction(QString)\0"
|
||||
"ChangeSurfaceStyle(QString)\0"
|
||||
"OpenIconCallback(QString)\0"
|
||||
"SaveIconCallback(QString)\0"
|
||||
"ViewerPropertiesIconCallback(int)\0"
|
||||
"ChangePerspectiveOrtho(QString)\0"
|
||||
};
|
||||
|
||||
void G4UIQt::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Q_ASSERT(staticMetaObject.cast(_o));
|
||||
G4UIQt *_t = static_cast<G4UIQt *>(_o);
|
||||
switch (_id) {
|
||||
case 0: _t->ExitSession(); break;
|
||||
case 1: _t->ClearButtonCallback(); break;
|
||||
case 2: _t->SaveOutputCallback(); break;
|
||||
case 3: _t->CommandEnteredCallback(); break;
|
||||
case 4: _t->CommandEditedCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 5: _t->ButtonCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 6: _t->HelpTreeClicCallback(); break;
|
||||
case 7: _t->HelpTreeDoubleClicCallback(); break;
|
||||
case 8: _t->ShowHelpCallback(); break;
|
||||
case 9: _t->CommandHistoryCallback(); break;
|
||||
case 10: _t->LookForHelpStringCallback(); break;
|
||||
case 11: _t->UpdateTabWidget((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 12: _t->ResizeTabWidget((*reinterpret_cast< QResizeEvent*(*)>(_a[1]))); break;
|
||||
case 13: _t->CoutFilterCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 14: _t->ThreadComboBoxCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 15: _t->TabCloseCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 16: _t->ToolBoxActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 17: _t->VisParameterCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
|
||||
case 18: _t->ChangeColorCallback((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
|
||||
case 19: _t->ChangeCursorAction((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 20: _t->ChangeSurfaceStyle((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 21: _t->OpenIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 22: _t->SaveIconCallback((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 23: _t->ViewerPropertiesIconCallback((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 24: _t->ChangePerspectiveOrtho((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData G4UIQt::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject G4UIQt::staticMetaObject = {
|
||||
{ &QObject::staticMetaObject, qt_meta_stringdata_G4UIQt,
|
||||
qt_meta_data_G4UIQt, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &G4UIQt::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *G4UIQt::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4UIQt::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4UIQt))
|
||||
return static_cast<void*>(const_cast< G4UIQt*>(this));
|
||||
if (!strcmp(_clname, "G4VBasicShell"))
|
||||
return static_cast< G4VBasicShell*>(const_cast< G4UIQt*>(this));
|
||||
if (!strcmp(_clname, "G4VInteractiveSession"))
|
||||
return static_cast< G4VInteractiveSession*>(const_cast< G4UIQt*>(this));
|
||||
return QObject::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4UIQt::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QObject::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 25)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 25;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
@@ -1,156 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// ---------------- G4PDefSplitter ----------------
|
||||
//
|
||||
// Utility template class for splitting RW data for thread-safety from
|
||||
// classes: G4ParticleDefinition, G4VDecayChannel.
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// History:
|
||||
// 01.25.2009 Xin Dong: First implementation from automatic MT conversion.
|
||||
// ------------------------------------------------------------
|
||||
#ifndef G4PDEFSPLITTER_HH
|
||||
#define G4PDEFSPLITTER_HH
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "pwdefs.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
template <class T> // T is the private data from the object to be split
|
||||
class G4PDefSplitter
|
||||
{
|
||||
public:
|
||||
|
||||
G4PDefSplitter() : totalobj(0) {
|
||||
G4MUTEXINIT(mutex);
|
||||
}
|
||||
|
||||
G4int CreateSubInstance()
|
||||
// Invoked by the master or work thread to create a new subinstance
|
||||
// whenever a new split class instance is created. For each worker
|
||||
// thread, ions are created dynamically.
|
||||
{
|
||||
G4AutoLock l(&mutex);
|
||||
totalobj++;
|
||||
if (totalobj > slavetotalspace) {
|
||||
l.unlock();
|
||||
NewSubInstances();
|
||||
l.lock();
|
||||
}
|
||||
return (totalobj - 1);
|
||||
}
|
||||
|
||||
void NewSubInstances()
|
||||
// Invoked by each worker thread to grow the subinstance array and
|
||||
// initialize each new subinstance using a particular method defined
|
||||
// by the subclass.
|
||||
{
|
||||
G4AutoLock l(&mutex);
|
||||
if (slavetotalspace >= totalobj) { return; }
|
||||
G4int originaltotalspace = slavetotalspace;
|
||||
slavetotalspace = totalobj + 512;
|
||||
offset = (T *) realloc(offset, slavetotalspace * sizeof(T));
|
||||
|
||||
if (offset == 0)
|
||||
{
|
||||
G4Exception("G4PDefSplitter::NewSubInstances()",
|
||||
"OutOfMemory", FatalException, "Cannot malloc space!");
|
||||
}
|
||||
|
||||
for (G4int i = originaltotalspace; i < slavetotalspace; i++)
|
||||
{
|
||||
offset[i].initialize();
|
||||
}
|
||||
}
|
||||
|
||||
void FreeSlave()
|
||||
// Invoked by all threads to free the subinstance array.
|
||||
{
|
||||
if (!offset) { return; }
|
||||
free(offset);
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
|
||||
T* GetOffset() { return offset; }
|
||||
|
||||
void UseWorkArea( T* newOffset ) // , G4int numObjects, G4int numSpace)
|
||||
{
|
||||
// Use recycled work area - which was created previously
|
||||
if( offset && offset!=newOffset )
|
||||
{
|
||||
if( newOffset != offset )
|
||||
{
|
||||
G4Exception("G4PDefSplitter::UseWorkspace()",
|
||||
"TwoWorkspaces", FatalException,
|
||||
"Thread already has workspace - cannot use another.");
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("G4PDefSplitter::UseWorkspace()",
|
||||
"TwoWorkspaces", JustWarning,
|
||||
"Thread already has a workspace - trying to set the same again.");
|
||||
}
|
||||
}
|
||||
offset= newOffset;
|
||||
// totalobj= numObjects;
|
||||
// totalspace= numSpace;
|
||||
}
|
||||
|
||||
T* FreeWorkArea() // G4int* numObjects, G4int* numSpace)
|
||||
{
|
||||
// Detach this thread from this Location
|
||||
// The object which calls this method is responsible for it.
|
||||
//
|
||||
T* offsetRet= offset;
|
||||
|
||||
offset= 0;
|
||||
|
||||
return offsetRet;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
G4PART_DLL G4ThreadLocalStatic G4int slavetotalspace;
|
||||
G4PART_DLL G4ThreadLocalStatic T* offset;
|
||||
|
||||
private:
|
||||
|
||||
G4int totalobj;
|
||||
G4Mutex mutex;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,127 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DNADamages.hh 85244 2014-10-27 08:24:13Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros, kara@cenbg.in2p3.fr
|
||||
|
||||
// The code is developed in the framework of the ESA AO7146
|
||||
//
|
||||
// We would be very happy hearing from you, send us your feedback! :)
|
||||
//
|
||||
// In order for Geant4-DNA to be maintained and still open-source,
|
||||
// article citations are crucial.
|
||||
// If you use Geant4-DNA chemistry and you publish papers about your software,
|
||||
// in addition to the general paper on Geant4-DNA:
|
||||
//
|
||||
// Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
|
||||
//
|
||||
// we would be very happy if you could please also cite the following
|
||||
// reference papers on chemistry:
|
||||
//
|
||||
// J. Comput. Phys. 274 (2014) 841-882
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
|
||||
#ifndef G4DNADAMAGES_HH
|
||||
#define G4DNADAMAGES_HH 1
|
||||
|
||||
#include "G4Molecule.hh"
|
||||
|
||||
class G4VDNAHit
|
||||
{
|
||||
public :
|
||||
G4VDNAHit(){;}
|
||||
virtual ~G4VDNAHit(){;}
|
||||
};
|
||||
|
||||
class G4DNAIndirectHit : public G4VDNAHit
|
||||
{
|
||||
public :
|
||||
G4DNAIndirectHit(const G4String& baseName, const G4Molecule* molecule,
|
||||
const G4ThreeVector& position, G4double time);
|
||||
virtual ~G4DNAIndirectHit();
|
||||
|
||||
inline const G4Molecule* GetMolecule() {return fpMolecule;}
|
||||
inline const G4ThreeVector& GetPosition() {return fPosition;}
|
||||
inline const G4String& GetBaseName() {return fBaseName;}
|
||||
inline double GetTime() {return fTime;}
|
||||
|
||||
void Print();
|
||||
|
||||
protected :
|
||||
const G4Molecule* fpMolecule;
|
||||
G4ThreeVector fPosition;
|
||||
G4double fTime;
|
||||
G4String fBaseName;
|
||||
};
|
||||
|
||||
class G4DNADamages
|
||||
{
|
||||
public:
|
||||
static G4DNADamages* Instance();
|
||||
static void DeleteInstance();
|
||||
|
||||
virtual void Reset();
|
||||
|
||||
//void AddDirectDamage();
|
||||
virtual void AddIndirectDamage(const G4String& baseName,const G4Molecule* molecule,
|
||||
const G4ThreeVector& position, double time);
|
||||
|
||||
inline const std::vector<G4DNAIndirectHit*>* GetIndirectHits();
|
||||
inline virtual int GetNIndirectHits() const
|
||||
{
|
||||
if(fJustCountDamage)
|
||||
return fNIndirectDamages;
|
||||
|
||||
return fIndirectHits.size();
|
||||
}
|
||||
|
||||
inline virtual void SetOnlyCountDamages(bool flag = true)
|
||||
{
|
||||
fJustCountDamage = flag;
|
||||
}
|
||||
|
||||
inline virtual bool OnlyCountDamages() const
|
||||
{
|
||||
return fJustCountDamage;
|
||||
}
|
||||
|
||||
protected :
|
||||
G4DNADamages();
|
||||
static G4ThreadLocal G4DNADamages* fpInstance;
|
||||
virtual ~G4DNADamages();
|
||||
|
||||
G4bool fJustCountDamage;
|
||||
G4int fNIndirectDamages;
|
||||
std::vector<G4DNAIndirectHit*> fIndirectHits;
|
||||
std::map<G4Molecule, const G4Molecule*> fMolMap;
|
||||
};
|
||||
|
||||
inline const std::vector<G4DNAIndirectHit*>* G4DNADamages::GetIndirectHits()
|
||||
{
|
||||
return &fIndirectHits;
|
||||
}
|
||||
|
||||
#endif // G4DNADAMAGES_HH
|
||||
@@ -1,122 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DNADamages.cc 85244 2014-10-27 08:24:13Z gcosmo $
|
||||
//
|
||||
#include "G4DNADamages.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
G4ThreadLocal G4DNADamages* G4DNADamages::fpInstance(0);
|
||||
|
||||
G4DNAIndirectHit::G4DNAIndirectHit(const G4String& baseName,
|
||||
const G4Molecule* molecule,
|
||||
const G4ThreeVector& position,
|
||||
G4double time) :
|
||||
G4VDNAHit(), fpMolecule(molecule)
|
||||
{
|
||||
fBaseName = baseName;
|
||||
fPosition = position;
|
||||
fTime = time;
|
||||
}
|
||||
|
||||
G4DNAIndirectHit::~G4DNAIndirectHit()
|
||||
{
|
||||
if (fpMolecule) delete fpMolecule;
|
||||
fpMolecule = 0;
|
||||
}
|
||||
|
||||
void G4DNAIndirectHit::Print()
|
||||
{
|
||||
G4cout << "Reaction : " << fpMolecule->GetName() << " + " << fBaseName
|
||||
<< " at position : " << G4BestUnit(fPosition, "Length")
|
||||
<< " and time : " << G4BestUnit(fTime, "Time") << G4endl;
|
||||
}
|
||||
|
||||
G4DNADamages* G4DNADamages::Instance()
|
||||
{
|
||||
if (!fpInstance) new G4DNADamages();
|
||||
|
||||
return fpInstance;
|
||||
}
|
||||
|
||||
G4DNADamages::G4DNADamages()
|
||||
{
|
||||
fJustCountDamage = false;
|
||||
fNIndirectDamages = 0;
|
||||
fpInstance = this;
|
||||
}
|
||||
|
||||
G4DNADamages::~G4DNADamages()
|
||||
{
|
||||
for (int i = 0; i < (int) fIndirectHits.size(); i++)
|
||||
{
|
||||
if (fIndirectHits[i]) delete fIndirectHits[i];
|
||||
}
|
||||
fIndirectHits.clear();
|
||||
}
|
||||
|
||||
void G4DNADamages::DeleteInstance()
|
||||
{
|
||||
if (fpInstance) delete fpInstance;
|
||||
fpInstance = 0;
|
||||
}
|
||||
|
||||
void G4DNADamages::Reset()
|
||||
{
|
||||
fNIndirectDamages = 0;
|
||||
for (int i = 0; i < (int) fIndirectHits.size(); i++)
|
||||
{
|
||||
if (fIndirectHits[i]) delete fIndirectHits[i];
|
||||
}
|
||||
fIndirectHits.clear();
|
||||
}
|
||||
|
||||
void G4DNADamages::AddIndirectDamage(const G4String& baseName,
|
||||
const G4Molecule* molecule,
|
||||
const G4ThreeVector& position,
|
||||
G4double time)
|
||||
{
|
||||
if (fJustCountDamage)
|
||||
{
|
||||
fNIndirectDamages++;
|
||||
return;
|
||||
}
|
||||
|
||||
G4DNAIndirectHit* indirectHit = 0;
|
||||
std::map<G4Molecule, const G4Molecule*>::iterator it = fMolMap.find(
|
||||
*molecule);
|
||||
|
||||
if (it == fMolMap.end())
|
||||
{
|
||||
G4Molecule* mol(0);
|
||||
fMolMap[*molecule] = (mol = new G4Molecule(*molecule));
|
||||
indirectHit = new G4DNAIndirectHit(baseName, mol, position, time);
|
||||
}
|
||||
else
|
||||
{
|
||||
indirectHit = new G4DNAIndirectHit(baseName, it->second, position, time);
|
||||
}
|
||||
fIndirectHits.push_back(indirectHit);
|
||||
}
|
||||
-80
@@ -1,80 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ContinuumGammaDeexcitation.hh 85841 2014-11-05 15:35:06Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4ContinuumGammaDeexcitation
|
||||
//
|
||||
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
|
||||
// Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// Class G4ContinuumGammaDeexcitation.hh
|
||||
//
|
||||
#ifndef G4ContinuumGammaDeexcitation_hh
|
||||
#define G4ContinuumGammaDeexcitation_hh 1
|
||||
|
||||
#include "G4VGammaDeexcitation.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4ContinuumGammaTransition.hh"
|
||||
#include "G4Fragment.hh"
|
||||
|
||||
class G4NuclearLevelManager;
|
||||
class G4NuclearLevelStore;
|
||||
class G4DiscreteGammaTransition;
|
||||
|
||||
class G4ContinuumGammaDeexcitation : public G4VGammaDeexcitation
|
||||
{
|
||||
public:
|
||||
|
||||
G4ContinuumGammaDeexcitation();
|
||||
|
||||
virtual ~G4ContinuumGammaDeexcitation();
|
||||
|
||||
virtual G4bool CanDoTransition(G4Fragment* aNucleus);
|
||||
|
||||
private:
|
||||
|
||||
G4int nucleusZ;
|
||||
G4int nucleusA;
|
||||
G4NuclearLevelStore* store;
|
||||
G4NuclearLevelManager* levelManager;
|
||||
G4ContinuumGammaTransition* ctransition;
|
||||
};
|
||||
|
||||
#endif
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ContinuumGammaTransition.hh 87017 2014-11-21 16:26:26Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4ContinuumGammaTransition
|
||||
//
|
||||
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
|
||||
// Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
// 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Header file for G4ContinuumGammaTransition
|
||||
//
|
||||
|
||||
#ifndef G4ContinuumGammaTransition_hh
|
||||
#define G4ContinuumGammaTransition_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VGammaTransition.hh"
|
||||
#include "G4ConstantLevelDensityParameter.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4NuclearLevelManager;
|
||||
class G4Pow;
|
||||
|
||||
class G4ContinuumGammaTransition : public G4VGammaTransition
|
||||
{
|
||||
public:
|
||||
|
||||
G4ContinuumGammaTransition(const G4NuclearLevelManager* manager,
|
||||
G4int Z, G4int A, G4double exc, G4int ver);
|
||||
|
||||
virtual ~G4ContinuumGammaTransition();
|
||||
|
||||
virtual void SetEnergyFrom(G4double energy);
|
||||
virtual G4double GetGammaEnergy();
|
||||
virtual G4double GetGammaCreationTime();
|
||||
virtual void SelectGamma();
|
||||
|
||||
void Update(const G4NuclearLevelManager* manager,
|
||||
G4int Z, G4int A, G4double exc);
|
||||
|
||||
private:
|
||||
|
||||
G4double E1Pdf(G4double energy);
|
||||
G4double GammaTime();
|
||||
|
||||
G4int nucleusA;
|
||||
G4int nucleusZ;
|
||||
G4int nBins;
|
||||
G4int verbose;
|
||||
|
||||
G4double eMin;
|
||||
G4double eMax;
|
||||
G4double minLevelE;
|
||||
G4double excitation;
|
||||
G4double eGamma;
|
||||
G4double gammaCreationTime;
|
||||
G4double energyGDR2;
|
||||
G4double widthGDR;
|
||||
G4double widthGDR2;
|
||||
|
||||
std::vector<G4double> sampleArray;
|
||||
|
||||
const G4NuclearLevelManager* levelManager;
|
||||
G4Pow* g4pow;
|
||||
G4ConstantLevelDensityParameter ldPar;
|
||||
};
|
||||
|
||||
#endif
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DiscreteGammaDeexcitation.hh 85841 2014-11-05 15:35:06Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4DiscreteGammaDeexcitation
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 8 March 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// added the following as part if the IC implementation
|
||||
// void SetICM(G4bool hl) { _icm = hl; };
|
||||
// void SetRDM(G4bool hl) { _rdm = hl; };
|
||||
// void SetHL(G4double hl) { _max_hl = hl; };
|
||||
// private:
|
||||
// G4double _max_hl;
|
||||
// G4bool _icm;
|
||||
// G4bool _rdm;
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4DiscreteGammaDeexcitation_hh
|
||||
#define G4DiscreteGammaDeexcitation_hh
|
||||
|
||||
#include "G4VGammaDeexcitation.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4DiscreteGammaTransition.hh"
|
||||
#include "G4Fragment.hh"
|
||||
|
||||
class G4NuclearLevelManager;
|
||||
class G4NuclearLevelStore;
|
||||
class G4DiscreteGammaTransition;
|
||||
|
||||
class G4DiscreteGammaDeexcitation : public G4VGammaDeexcitation {
|
||||
public:
|
||||
|
||||
G4DiscreteGammaDeexcitation();
|
||||
|
||||
virtual ~G4DiscreteGammaDeexcitation();
|
||||
|
||||
virtual G4bool CanDoTransition(G4Fragment* nucleus);
|
||||
|
||||
inline void SetICM(G4bool hl) { icm = hl; };
|
||||
|
||||
inline void SetRDM(G4bool hl) { rdm = hl; };
|
||||
|
||||
inline void SetHL(G4double hl) { maxhl = hl; };
|
||||
|
||||
private:
|
||||
|
||||
G4int nucleusZ;
|
||||
G4int nucleusA;
|
||||
G4double maxhl;
|
||||
G4bool icm;
|
||||
G4bool rdm;
|
||||
G4NuclearLevelStore* store;
|
||||
G4NuclearLevelManager* levelManager;
|
||||
G4DiscreteGammaTransition* dtransition;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DiscreteGammaTransition.hh 85841 2014-11-05 15:35:06Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4DiscreteGammaTransition
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
// added
|
||||
// 1) SetRDM () to switch on/off IC process
|
||||
// 2) GetOrbitNumber () to return the CE oribit number
|
||||
// 3) GetBondEnergy() for the converted e-
|
||||
// 4) IsaGamma() to separate CE from gamma
|
||||
//
|
||||
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// i) added G4int _nucleusZ initialise it through the constructor
|
||||
// ii) modified SelectGamma() to allow the generation of conversion electrons
|
||||
// iii) added #include G4AtomicShells.hh
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
//
|
||||
//
|
||||
// 19 April 2010, J. M. Quesada.
|
||||
// Corrections added for taking into account mismatch between tabulated
|
||||
// gamma energies and level energy differences (fake photons eliminated)
|
||||
//
|
||||
// 6 October 2010, M. Kelsey
|
||||
// Store NuclearLevel as const-reference, not as copied value.
|
||||
//
|
||||
// 5 May 2011, V.Ivanchenko removed unused constructor
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4DiscreteGammaTransition_hh
|
||||
#define G4DiscreteGammaTransition_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VGammaTransition.hh"
|
||||
|
||||
class G4NuclearLevel;
|
||||
class G4NuclearLevelManager;
|
||||
|
||||
|
||||
class G4DiscreteGammaTransition : public G4VGammaTransition
|
||||
{
|
||||
public:
|
||||
|
||||
G4DiscreteGammaTransition(const G4NuclearLevel* level,
|
||||
G4int Z, G4int ver);
|
||||
|
||||
virtual ~G4DiscreteGammaTransition();
|
||||
|
||||
virtual void SetEnergyFrom(G4double energy);
|
||||
virtual G4double GetGammaEnergy();
|
||||
virtual G4double GetGammaCreationTime();
|
||||
virtual void SelectGamma();
|
||||
|
||||
inline void SetICM(G4bool ic) { icm = ic; };
|
||||
inline G4bool GetICM() const { return icm;};
|
||||
inline G4double GetBondEnergy () { return bondE;};
|
||||
inline G4int GetOrbitNumber () { return orbitE;};
|
||||
inline G4bool IsAGamma() { return aGamma;};
|
||||
|
||||
inline void Update(const G4NuclearLevel* level, G4int Z)
|
||||
{
|
||||
aLevel = level;
|
||||
nucleusZ = Z;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
G4int nucleusZ;
|
||||
G4int orbitE;
|
||||
G4int verbose;
|
||||
|
||||
G4double bondE;
|
||||
G4double gammaEnergy;
|
||||
G4double excitation;
|
||||
G4double gammaCreationTime;
|
||||
|
||||
G4bool aGamma;
|
||||
G4bool icm;
|
||||
|
||||
const G4NuclearLevel* aLevel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
-84
@@ -1,84 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4E1Probability.hh 88709 2015-03-06 15:33:12Z gcosmo $
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
// Geant4 header G4E1Probability
|
||||
//
|
||||
// by V. Lara (May 2003)
|
||||
//
|
||||
// Modifications:
|
||||
// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
|
||||
// by usage of G4Pow, integer A and introduction of const members
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef G4E1Probability_hh
|
||||
#define G4E1Probability_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VEmissionProbability.hh"
|
||||
#include "G4Fragment.hh"
|
||||
|
||||
class G4Pow;
|
||||
|
||||
class G4E1Probability : public G4VEmissionProbability
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4E1Probability();
|
||||
|
||||
virtual ~G4E1Probability();
|
||||
|
||||
G4double EmissionProbability(const G4Fragment& frag, G4double excite);
|
||||
G4double EmissionProbDensity(const G4Fragment& frag, G4double ePhoton);
|
||||
|
||||
private:
|
||||
|
||||
G4E1Probability(const G4E1Probability& right);
|
||||
|
||||
const G4E1Probability& operator=(const G4E1Probability& right);
|
||||
G4bool operator==(const G4E1Probability& right) const;
|
||||
G4bool operator!=(const G4E1Probability& right) const;
|
||||
|
||||
// Integrator (simple Gaussian quadrature)
|
||||
G4double EmissionIntegration(const G4Fragment& frag,
|
||||
G4double lowLim, G4double upLim);
|
||||
|
||||
// members
|
||||
G4Pow* fG4pow;
|
||||
G4double theLevelDensityPerNucleon;
|
||||
G4double normC;
|
||||
G4double aLevelDensityParam;
|
||||
G4double sigma0;
|
||||
G4double Egdp;
|
||||
G4double GammaR;
|
||||
G4int Afrag;
|
||||
};
|
||||
|
||||
#endif
|
||||
-177
@@ -1,177 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevel.hh 86986 2014-11-21 13:00:05Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4NuclearLevel
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 25 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
// 06 Oct 2010, M. Kelsey (kelsey@slac.stanford.edu)
|
||||
// Add friendship for G4NuclearLevelManager; define private
|
||||
// constructors without vectors.
|
||||
//
|
||||
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added K->N+ internal conversion coefficiencies and their access
|
||||
// functions
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added half-life, angular momentum, parity, emissioni type
|
||||
// reading from experimental data.
|
||||
//
|
||||
// 28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4NUCLEARLEVEL_HH
|
||||
#define G4NUCLEARLEVEL_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4NuclearLevel
|
||||
{
|
||||
|
||||
public:
|
||||
G4NuclearLevel(G4double energy, G4double halfLife,
|
||||
G4double angularMomentum, const std::vector<G4double>& eGamma,
|
||||
const std::vector<G4double>& wGamma, const std::vector<G4double>& polarities,
|
||||
const std::vector<G4double>& kCC, const std::vector<G4double>& l1CC,
|
||||
const std::vector<G4double>& l2CC, const std::vector<G4double>& l3CC,
|
||||
const std::vector<G4double>& m1CC, const std::vector<G4double>& m2CC,
|
||||
const std::vector<G4double>& m3CC, const std::vector<G4double>& m4CC,
|
||||
const std::vector<G4double>& m5CC, const std::vector<G4double>& nPlusCC,
|
||||
const std::vector<G4double>& totalCC);
|
||||
|
||||
~G4NuclearLevel();
|
||||
|
||||
const std::vector<G4double>& GammaEnergies() const;
|
||||
|
||||
const std::vector<G4double>& GammaWeights() const;
|
||||
|
||||
const std::vector<G4double>& GammaProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& GammaCumulativeProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& GammaPolarities() const;
|
||||
|
||||
const std::vector<G4double>& KConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& L1ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& L2ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& L3ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& M1ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& M2ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& M3ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& M4ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& M5ConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& NPlusConvertionProbabilities() const;
|
||||
|
||||
const std::vector<G4double>& TotalConvertionProbabilities() const;
|
||||
|
||||
G4double Energy() const;
|
||||
|
||||
G4double AngularMomentum() const;
|
||||
|
||||
G4double HalfLife() const;
|
||||
|
||||
G4int NumberOfGammas() const;
|
||||
|
||||
void PrintAll() const;
|
||||
|
||||
void PrintLevels() const;
|
||||
|
||||
G4bool operator==(const G4NuclearLevel &right) const;
|
||||
G4bool operator!=(const G4NuclearLevel &right) const;
|
||||
G4bool operator<(const G4NuclearLevel &right) const;
|
||||
G4NuclearLevel& operator=(const G4NuclearLevel &right);
|
||||
|
||||
G4NuclearLevel(const G4NuclearLevel &right);
|
||||
|
||||
private:
|
||||
|
||||
friend class G4NuclearLevelManager;
|
||||
|
||||
G4NuclearLevel();
|
||||
|
||||
G4NuclearLevel(G4double energy, G4double halfLife,
|
||||
G4double angularMomentum);
|
||||
|
||||
void Finalize();
|
||||
|
||||
void MakeProbabilities();
|
||||
void MakeCumProb();
|
||||
|
||||
G4int Increment(G4int aF);
|
||||
|
||||
std::vector<G4double> _energies;
|
||||
std::vector<G4double> _weights;
|
||||
std::vector<G4double> _prob;
|
||||
std::vector<G4double> _cumProb;
|
||||
std::vector<G4double> _polarities;
|
||||
std::vector<G4double> _kCC;
|
||||
std::vector<G4double> _l1CC;
|
||||
std::vector<G4double> _l2CC;
|
||||
std::vector<G4double> _l3CC;
|
||||
std::vector<G4double> _m1CC;
|
||||
std::vector<G4double> _m2CC;
|
||||
std::vector<G4double> _m3CC;
|
||||
std::vector<G4double> _m4CC;
|
||||
std::vector<G4double> _m5CC;
|
||||
std::vector<G4double> _nPlusCC;
|
||||
std::vector<G4double> _totalCC;
|
||||
|
||||
G4double _energy;
|
||||
G4double _halfLife;
|
||||
G4double _angularMomentum;
|
||||
G4int _nGammas;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-140
@@ -1,140 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevelManager.hh 87163 2014-11-26 08:46:54Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4NuclearLevelManager
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 25 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added K->N+ internal conversion coefficiencies and their access
|
||||
// functions
|
||||
//
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added half-life, angular momentum, parity, emissioni type
|
||||
// reading from experimental data.
|
||||
// 02 May 2003, Vladimir Ivanchenko remove rublic copy contructor
|
||||
// 06 Oct 2010, M. Kelsey -- Use object storage, not pointers, drop
|
||||
// public access to list
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4NUCLEARLEVELMANAGER_HH
|
||||
#define G4NUCLEARLEVELMANAGER_HH 1
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4PtrLevelVector.hh"
|
||||
|
||||
class G4NuclearLevel;
|
||||
|
||||
|
||||
class G4NuclearLevelManager
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4NuclearLevelManager(G4int Z, G4int A, const G4String& filename);
|
||||
G4NuclearLevelManager(const G4NuclearLevelManager & right);
|
||||
|
||||
~G4NuclearLevelManager();
|
||||
|
||||
void SetNucleus(G4int Z, G4int A, const G4String& filename);
|
||||
|
||||
inline G4bool IsValid() const { return _validity; }
|
||||
|
||||
inline G4int NumberOfLevels() const { return (_levels ? _levels->size() : 0); }
|
||||
|
||||
const G4NuclearLevel* GetLevel(G4int i) const;
|
||||
|
||||
const G4NuclearLevel* NearestLevel(G4double energy,
|
||||
G4double eDiffMax=1.e+8) const;
|
||||
|
||||
const G4NuclearLevel* LowestLevel() const;
|
||||
const G4NuclearLevel* HighestLevel() const;
|
||||
|
||||
G4double MinLevelEnergy() const;
|
||||
G4double MaxLevelEnergy() const;
|
||||
|
||||
void PrintLevels();
|
||||
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
const G4NuclearLevelManager& operator=(const G4NuclearLevelManager &right);
|
||||
G4bool operator==(const G4NuclearLevelManager &right) const;
|
||||
G4bool operator!=(const G4NuclearLevelManager &right) const;
|
||||
|
||||
G4bool Read(std::ifstream& aDataFile);
|
||||
G4bool ReadDataLine(std::ifstream& dataFile);
|
||||
G4bool ReadDataItem(std::istream& dataFile, G4double& x);
|
||||
void ProcessDataLine();
|
||||
|
||||
void MakeLevels(const G4String& filename);
|
||||
void ClearLevels();
|
||||
|
||||
G4NuclearLevel* UseLevelOrMakeNew(G4NuclearLevel* level);
|
||||
void AddDataToLevel(G4NuclearLevel* level);
|
||||
void FinishLevel(G4NuclearLevel* level);
|
||||
|
||||
G4int _nucleusA;
|
||||
G4int _nucleusZ;
|
||||
//G4String _fileName;
|
||||
G4bool _validity;
|
||||
G4PtrLevelVector* _levels;
|
||||
|
||||
// Buffers for reading data file
|
||||
//char buffer[30]; // For doubles in scientific notation
|
||||
static G4double _levelEnergy;
|
||||
static G4double _gammaEnergy;
|
||||
static G4double _probability;
|
||||
static G4double _polarity;
|
||||
static G4double _halfLife;
|
||||
static G4double _angularMomentum;
|
||||
static G4double _kCC;
|
||||
static G4double _l1CC;
|
||||
static G4double _l2CC;
|
||||
static G4double _l3CC;
|
||||
static G4double _m1CC;
|
||||
static G4double _m2CC;
|
||||
static G4double _m3CC;
|
||||
static G4double _m4CC;
|
||||
static G4double _m5CC;
|
||||
static G4double _nPlusCC;
|
||||
static G4double _totalCC;
|
||||
};
|
||||
|
||||
#endif
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevelStore.hh 88406 2015-02-18 09:13:29Z gcosmo $
|
||||
//
|
||||
// 04-10-2010 M. Kelsey -- Replace G4String keys with integers (ZZZAAA),
|
||||
// move string operation to GenerateFilename()
|
||||
// 17-11-2010 V. Ivanchenko - make as a classical singleton.
|
||||
//
|
||||
// 17-10-2011 L. Desorgher -- Allow the user to replace the radioactive
|
||||
// decay data provided in Geant4 by its own data file for
|
||||
// a given isotope
|
||||
// 06-01-2012 V. Ivanchenko - added nuclear level data structure for
|
||||
// usage in HEP where internal conversion is neglected;
|
||||
// cleanup the code; new method GetLevelManager
|
||||
// 19-11-2014 M. Asai - protection against reading the same file from
|
||||
// more than one worker threads
|
||||
|
||||
#ifndef G4NuclearLevelStore_hh
|
||||
#define G4NuclearLevelStore_hh 1
|
||||
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
#include "G4ThreadLocalSingleton.hh"
|
||||
#include "globals.hh"
|
||||
#include <map>
|
||||
|
||||
class G4NuclearLevelStore
|
||||
{
|
||||
|
||||
friend class G4ThreadLocalSingleton<G4NuclearLevelStore>;
|
||||
|
||||
private:
|
||||
|
||||
G4NuclearLevelStore();
|
||||
|
||||
public:
|
||||
|
||||
static G4NuclearLevelStore* GetInstance();
|
||||
|
||||
G4NuclearLevelManager* GetManager(G4int Z, G4int A);
|
||||
|
||||
~G4NuclearLevelStore();
|
||||
|
||||
void AddUserEvaporationDataFile(G4int Z, G4int A,
|
||||
const G4String& filename);
|
||||
|
||||
private:
|
||||
|
||||
G4int GenerateKey(G4int Z, G4int A) const { return Z*1000+A; }
|
||||
|
||||
G4String GenerateFileName(G4int Z, G4int A) const;
|
||||
|
||||
typedef std::map<G4int,G4NuclearLevelManager*> ManagersMap;
|
||||
|
||||
ManagersMap theManagers;
|
||||
|
||||
G4String dirName;
|
||||
|
||||
static G4ThreadLocal G4NuclearLevelStore* theInstance;
|
||||
#ifdef G4MULTITHREADED
|
||||
static G4NuclearLevelStore* theShadowInstance;
|
||||
#endif
|
||||
|
||||
G4bool userFiles;
|
||||
std::map<G4int, G4String> theUserDataFiles;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
public:
|
||||
static G4Mutex nuclearLevelStoreMutex;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PhotonEvaporationOLD.hh 89158 2015-03-21 19:15:25Z vnivanch $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4PhotonEvaporationOLD
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
//Modifications:
|
||||
//
|
||||
// 18 October 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
//
|
||||
// Implementation of Internal Convertion process in discrete deexcitation
|
||||
// The following public methods have been added.
|
||||
//
|
||||
// void SetICM (G4bool);
|
||||
// void RDMForced(G4bool);
|
||||
// void SetMaxHalfLife(G4double) ;
|
||||
// void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
|
||||
// G4ElectronOccupancy GetEOccupancy () ;
|
||||
// G4int GetVacantShellNumber () { return _vShellNumber;};
|
||||
//
|
||||
// and the following priivate menbers
|
||||
//
|
||||
// G4ElectronOccupancy _eOccupancy;
|
||||
// G4int _vShellNumber;
|
||||
//
|
||||
// 11 May 2010, V.Ivanchenko added EmittedFragment and BreakUpFragment
|
||||
// methods
|
||||
//
|
||||
// 22 October 2015, V.Ivanchenko renamed to G4PhotonEvaporationOLD
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4PHOTONEVAPORATIONOLD_HH
|
||||
#define G4PHOTONEVAPORATIONOLD_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VEvaporationChannel.hh"
|
||||
#include "G4VEmissionProbability.hh"
|
||||
#include "G4VGammaDeexcitation.hh"
|
||||
#include "G4ElectronOccupancy.hh"
|
||||
|
||||
class G4Fragment;
|
||||
|
||||
class G4PhotonEvaporationOLD : public G4VEvaporationChannel {
|
||||
|
||||
public:
|
||||
|
||||
G4PhotonEvaporationOLD(const G4String & aName = "");
|
||||
|
||||
virtual ~G4PhotonEvaporationOLD();
|
||||
|
||||
// returns one gamma or e-
|
||||
virtual G4Fragment* EmittedFragment(G4Fragment* theNucleus);
|
||||
|
||||
// returns "false", emitted gamma and e- are added to the results
|
||||
virtual G4bool
|
||||
BreakUpChain(G4FragmentVector* theResult, G4Fragment* theNucleus);
|
||||
|
||||
// emitted gamma and e- are added to the results
|
||||
virtual G4FragmentVector* BreakUpFragment(G4Fragment* theNucleus);
|
||||
|
||||
// emitted gamma, e-, and residual fragment are added to the results
|
||||
virtual G4FragmentVector * BreakItUp(const G4Fragment & nucleus);
|
||||
|
||||
// emitted gamma, e-, and residual fragment are added to the results
|
||||
virtual G4FragmentVector * BreakUp(const G4Fragment & nucleus);
|
||||
|
||||
virtual G4double GetEmissionProbability(G4Fragment* theNucleus);
|
||||
|
||||
virtual void SetEmissionStrategy(G4VEmissionProbability * probAlgorithm);
|
||||
|
||||
void SetVerboseLevel(G4int verbose);
|
||||
|
||||
virtual void SetICM (G4bool);
|
||||
|
||||
virtual void RDMForced (G4bool);
|
||||
|
||||
void SetMaxHalfLife(G4double);
|
||||
|
||||
void SetTimeLimit(G4double value);
|
||||
|
||||
void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
|
||||
|
||||
inline G4ElectronOccupancy GetEOccupancy () { return eOccupancy;} ;
|
||||
|
||||
inline G4int GetVacantShellNumber () { return vShellNumber;};
|
||||
|
||||
private:
|
||||
|
||||
G4int verbose;
|
||||
G4bool myOwnProbAlgorithm;
|
||||
G4VEmissionProbability * probAlgorithm;
|
||||
G4VGammaDeexcitation * discrDeexcitation;
|
||||
G4VGammaDeexcitation * contDeexcitation;
|
||||
|
||||
G4ElectronOccupancy eOccupancy;
|
||||
G4int vShellNumber;
|
||||
|
||||
G4Fragment* nucleus;
|
||||
G4double gammaE;
|
||||
|
||||
G4PhotonEvaporationOLD(const G4PhotonEvaporationOLD & right);
|
||||
const G4PhotonEvaporationOLD & operator = (const G4PhotonEvaporationOLD & right);
|
||||
|
||||
G4bool operator == (const G4PhotonEvaporationOLD & right) const;
|
||||
G4bool operator != (const G4PhotonEvaporationOLD & right) const;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
-53
@@ -1,53 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PtrLevelVector.hh 67983 2013-03-13 10:42:03Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4PtrLevelVector
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 25 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4PTRLEVELVECTOR_HH
|
||||
#define G4PTRLEVELVECTOR_HH 1
|
||||
|
||||
#include "G4NuclearLevel.hh"
|
||||
#include <vector>
|
||||
|
||||
typedef std::vector<G4NuclearLevel *> G4PtrLevelVector;
|
||||
struct DeleteLevel { void operator () (G4NuclearLevel * aL) {delete aL;} };
|
||||
|
||||
#endif
|
||||
|
||||
-124
@@ -1,124 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VGammaDeexcitation.hh 88191 2015-02-02 17:27:37Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4VGammaDeexcitation
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
//
|
||||
// 21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Modified GenerateGamma() and UpdateUncleus() for implementation
|
||||
// of Internal Conversion processs
|
||||
//
|
||||
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added SetEO () , GetEO(), UpdateElectrons() to allow the assignment
|
||||
// and modification of electron configuration.
|
||||
//
|
||||
// 18 October 2002, F. Lei
|
||||
// Added GetVaccantSN() and _vSN in order to link to ARM in low-e em
|
||||
// _vSN is updated in UpdateElectron()
|
||||
// Added SetVaccantSN(). It is need to to re-set _vSN after each
|
||||
// IC happened.
|
||||
//
|
||||
// 28 April 2010, V.Ivanchenko cleanup methods
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4VGAMMADEEXCITATION_HH
|
||||
#define G4VGAMMADEEXCITATION_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VGammaTransition.hh"
|
||||
#include "G4Fragment.hh"
|
||||
#include "G4FragmentVector.hh"
|
||||
#include "G4ElectronOccupancy.hh"
|
||||
|
||||
class G4VGammaDeexcitation {
|
||||
|
||||
public:
|
||||
|
||||
G4VGammaDeexcitation();
|
||||
|
||||
virtual ~G4VGammaDeexcitation();
|
||||
|
||||
virtual G4bool CanDoTransition(G4Fragment* aNucleus) = 0;
|
||||
|
||||
// Chain of gamma transitions
|
||||
void DoChain(G4FragmentVector*, G4Fragment* nucleus);
|
||||
|
||||
G4Fragment * GenerateGamma(G4Fragment* nucleus);
|
||||
|
||||
inline void SetVerboseLevel(G4int verbose){ _verbose = verbose; };
|
||||
|
||||
//inline void Initialise();
|
||||
|
||||
inline void SetEO(G4ElectronOccupancy eo) { _electronO = eo; };
|
||||
inline void SetVaccantSN( G4int val ) { _vSN = val;};
|
||||
|
||||
inline G4ElectronOccupancy GetEO() { return _electronO; };
|
||||
inline G4int GetVacantSN() { return _vSN;};
|
||||
|
||||
inline void SetTimeLimit(G4double value) { _timeLimit = value; }
|
||||
|
||||
protected:
|
||||
|
||||
G4VGammaTransition* _transition;
|
||||
G4int _verbose;
|
||||
G4double _tolerance;
|
||||
G4double _timeLimit;
|
||||
|
||||
private:
|
||||
|
||||
G4VGammaDeexcitation(const G4VGammaDeexcitation & right);
|
||||
const G4VGammaDeexcitation & operator = (const G4VGammaDeexcitation & right);
|
||||
G4bool operator == (const G4VGammaDeexcitation & right) const;
|
||||
G4bool operator != (const G4VGammaDeexcitation & right) const;
|
||||
|
||||
G4ElectronOccupancy _electronO;
|
||||
G4int _vSN;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ContinuumGammaDeexcitation.cc 87585 2014-12-11 14:22:21Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4ContinuumGammaDeexcitation
|
||||
//
|
||||
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
|
||||
// Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager
|
||||
//
|
||||
// 19 April 2010 J. M. Quesada: smaller value of tolerance parameter
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// Class G4ContinuumGammaDeexcitation.cc
|
||||
//
|
||||
// Concrete class derived from G4VGammaDeexcitation
|
||||
//
|
||||
//
|
||||
#include "G4ContinuumGammaDeexcitation.hh"
|
||||
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4ContinuumGammaTransition.hh"
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
#include "G4Fragment.hh"
|
||||
#include "G4ConstantLevelDensityParameter.hh"
|
||||
|
||||
G4ContinuumGammaDeexcitation::G4ContinuumGammaDeexcitation()
|
||||
: nucleusZ(0), nucleusA(0), levelManager(0), ctransition(0)
|
||||
{
|
||||
store = G4NuclearLevelStore::GetInstance();
|
||||
}
|
||||
|
||||
G4ContinuumGammaDeexcitation::~G4ContinuumGammaDeexcitation()
|
||||
{}
|
||||
|
||||
G4bool G4ContinuumGammaDeexcitation::CanDoTransition(G4Fragment* nucleus)
|
||||
{
|
||||
G4int Z = nucleus->GetZ_asInt();
|
||||
G4int A = nucleus->GetA_asInt();
|
||||
G4double excitation = nucleus->GetExcitationEnergy();
|
||||
|
||||
if (excitation <= _tolerance) {
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition fails; Z= " << Z
|
||||
<< " A= " << A << " Eex(meV)= " << excitation << G4endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nucleusA != A || nucleusZ != Z) {
|
||||
levelManager = store->GetManager(Z,A);
|
||||
nucleusA = A;
|
||||
nucleusZ = Z;
|
||||
}
|
||||
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4ContinuumGammaDeexcitation: "
|
||||
<< " Z= " << Z << " A= " << A << " Eex= " << excitation
|
||||
<< G4endl;
|
||||
}
|
||||
if (levelManager && excitation <= levelManager->MaxLevelEnergy() + _tolerance) {
|
||||
if (_verbose > 0) {
|
||||
G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation "
|
||||
<< excitation << " below max discrete level "
|
||||
<< levelManager->MaxLevelEnergy() << G4endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!ctransition) {
|
||||
ctransition =
|
||||
new G4ContinuumGammaTransition(levelManager,Z,A,excitation,_verbose);
|
||||
_transition = ctransition;
|
||||
} else {
|
||||
ctransition->Update(levelManager,Z,A,excitation);
|
||||
}
|
||||
/*
|
||||
G4cout <<"G4ContinuumGammaDeexcitation::CanDoTransition: "
|
||||
<< " Eex(MeV)= " << excitation
|
||||
<< " Emax(MeV)= " << levelManager->MaxLevelEnergy()
|
||||
<< " Z= " << Z << " A= " << A << G4endl;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-244
@@ -1,244 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ContinuumGammaTransition.cc 91886 2015-08-10 07:08:25Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4ContinuumGammaTransition
|
||||
//
|
||||
// Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu)
|
||||
// Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
// 02 May 2003, V. Ivanchenko change interface to G4NuclearlevelManager
|
||||
// 06 Oct 2010, M. Kelsey -- follow changes to G4NuclearLevelManager
|
||||
// 17 Nov 2010, V. Ivanchenko use exponential law for sampling of time
|
||||
// and extra cleanup
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Class G4ContinuumGammaTransition.cc
|
||||
//
|
||||
|
||||
#include "G4ContinuumGammaTransition.hh"
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "G4Log.hh"
|
||||
|
||||
//static const G4double normC = CLHEP::millibarn/
|
||||
// (CLHEP::pi*CLHEP::hbarc*CLHEP::pi*CLHEP::hbarc);
|
||||
static const G4double factor = 5;
|
||||
static const G4double tolerance = 0.1*CLHEP::keV;
|
||||
|
||||
G4ContinuumGammaTransition::G4ContinuumGammaTransition(
|
||||
const G4NuclearLevelManager* manager,
|
||||
G4int Z, G4int A, G4double exc, G4int verb)
|
||||
{
|
||||
nBins = 100;
|
||||
verbose = verb;
|
||||
eMin = keV;
|
||||
eMax = minLevelE = eGamma = gammaCreationTime = 0.0;
|
||||
sampleArray.resize(nBins+1,0.0);
|
||||
g4pow = G4Pow::GetInstance();
|
||||
Update(manager, Z, A, exc);
|
||||
}
|
||||
|
||||
G4ContinuumGammaTransition::~G4ContinuumGammaTransition()
|
||||
{}
|
||||
|
||||
void G4ContinuumGammaTransition::Update(const G4NuclearLevelManager* manager,
|
||||
G4int Z, G4int A, G4double exc)
|
||||
{
|
||||
levelManager = manager;
|
||||
nucleusZ = Z;
|
||||
nucleusA = A;
|
||||
excitation = exc;
|
||||
eGamma = 0.;
|
||||
gammaCreationTime = 0.;
|
||||
|
||||
minLevelE = DBL_MAX;
|
||||
if(levelManager) {
|
||||
minLevelE = std::max(0.5*levelManager->MinLevelEnergy(), tolerance);
|
||||
}
|
||||
// Energy range for photon generation;
|
||||
// upper limit is defined 5*Gamma(GDR) from GDR peak
|
||||
// Giant Dipole Resonance energy
|
||||
G4double energyGDR = (40.3 / g4pow->powZ(nucleusA,0.2) ) * MeV;
|
||||
energyGDR2 = energyGDR*energyGDR;
|
||||
// Giant Dipole Resonance width
|
||||
widthGDR = 0.30 * energyGDR;
|
||||
widthGDR2 = widthGDR*widthGDR;
|
||||
// Extend
|
||||
eMax = energyGDR + factor * widthGDR;
|
||||
if (eMax > excitation) { eMax = excitation; }
|
||||
}
|
||||
|
||||
void G4ContinuumGammaTransition::SelectGamma()
|
||||
{
|
||||
eGamma = 0.;
|
||||
sampleArray[0] = 0.0;
|
||||
G4int i;
|
||||
G4double del = (eMax - eMin) / G4double(nBins);
|
||||
G4double sum = 0;
|
||||
G4double w1 = E1Pdf(eMin);
|
||||
G4double w2;
|
||||
//G4cout << eMin << " " << eMax << " " << del << G4endl;
|
||||
for (i=1; i<=nBins; i++) {
|
||||
G4double e = eMin + del * i;
|
||||
w2 = E1Pdf(e);
|
||||
sum += 0.5*(w1 + w2);
|
||||
w1 = w2;
|
||||
sampleArray[i] = sum;
|
||||
if(verbose > 1) {
|
||||
G4cout << "*---* G4ContinuumTransition: e = " << e
|
||||
<< " pdf = " << sampleArray[i] << G4endl;
|
||||
}
|
||||
}
|
||||
sum *= G4UniformRand();
|
||||
eGamma = eMax;
|
||||
for (i=1; i<=nBins; i++) {
|
||||
if(sum <= sampleArray[i]) {
|
||||
eGamma = eMin + del * i;
|
||||
G4double w = sampleArray[i] - sampleArray[i-1];
|
||||
//G4cout << eGamma << " " << w << G4endl;
|
||||
if(w != 0.0) {
|
||||
eGamma -= (sampleArray[i] - sum)*del/w;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
G4double finalExcitation = excitation - eGamma;
|
||||
|
||||
if(verbose > 1) {
|
||||
G4cout << "*---*---* G4ContinuumTransition: eGamma = " << eGamma
|
||||
<< " finalExcitation = " << finalExcitation << G4endl;
|
||||
}
|
||||
|
||||
if(finalExcitation <= minLevelE) {
|
||||
eGamma = excitation;
|
||||
|
||||
} else {
|
||||
finalExcitation = levelManager->NearestLevel(finalExcitation)->Energy();
|
||||
eGamma = excitation - finalExcitation;
|
||||
}
|
||||
|
||||
gammaCreationTime = GammaTime();
|
||||
|
||||
if(verbose > 1) {
|
||||
G4cout << "*---*---* G4ContinuumTransition: gammaCreationTime = "
|
||||
<< gammaCreationTime/second << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4double G4ContinuumGammaTransition::GetGammaEnergy()
|
||||
{
|
||||
return eGamma;
|
||||
}
|
||||
|
||||
G4double G4ContinuumGammaTransition::GetGammaCreationTime()
|
||||
{
|
||||
return gammaCreationTime;
|
||||
}
|
||||
|
||||
void G4ContinuumGammaTransition::SetEnergyFrom(G4double energy)
|
||||
{
|
||||
excitation = energy;
|
||||
}
|
||||
|
||||
G4double G4ContinuumGammaTransition::E1Pdf(G4double e)
|
||||
{
|
||||
G4double theProb = 0.0;
|
||||
G4double U = excitation - e;
|
||||
|
||||
if(U < 0.0) { return theProb; }
|
||||
|
||||
G4double aLevelDensityParam =
|
||||
ldPar.LevelDensityParameter(nucleusA,nucleusZ,excitation);
|
||||
|
||||
//G4double levelDensBef = G4Exp(2.0*std::sqrt(aLevelDensityParam*excitation));
|
||||
//G4double levelDensAft = G4Exp(2.0*std::sqrt(aLevelDensityParam*(excitation - e)));
|
||||
G4double coeff = G4Exp(2.0*(std::sqrt(aLevelDensityParam*U)
|
||||
- std::sqrt(aLevelDensityParam*excitation)));
|
||||
|
||||
//if(verbose > 20)
|
||||
// G4cout << nucleusA << " LevelDensityParameter = " << aLevelDensityParam
|
||||
// << " Bef Aft " << levelDensBef << " " << levelDensAft << G4endl;
|
||||
|
||||
// Now form the probability density
|
||||
// Define constants for the photoabsorption cross-section (the reverse
|
||||
// process of our de-excitation)
|
||||
|
||||
G4double sigma0 = 2.5 * nucleusA;
|
||||
|
||||
G4double e2 = e*e;
|
||||
G4double numerator = sigma0 * e2 * widthGDR2;
|
||||
G4double denominator = (e2 - energyGDR2)* (e2 - energyGDR2) + widthGDR2*e2;
|
||||
// if (denominator < 1.0e-9) denominator = 1.0e-9;
|
||||
|
||||
G4double sigmaAbs = numerator/denominator;
|
||||
|
||||
if(verbose > 2) {
|
||||
G4cout << "E_GDR(MeV)= " << std::sqrt(energyGDR2) << " W_GDR(MeV)= " << widthGDR
|
||||
<< " sigAbs= " << sigmaAbs
|
||||
<< " E(MeV)= " << e << " coeff= " << coeff
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
theProb = sigmaAbs * e2 * coeff;
|
||||
|
||||
return theProb;
|
||||
}
|
||||
|
||||
G4double G4ContinuumGammaTransition::GammaTime()
|
||||
{
|
||||
G4double tau = hbar_Planck/widthGDR;
|
||||
G4double creationTime = -tau*G4Log(G4UniformRand());
|
||||
|
||||
return creationTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-135
@@ -1,135 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DiscreteGammaDeexcitation.cc 88191 2015-02-02 17:27:37Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4DiscreteGammaDeexcitation
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
// 8 March 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added the following as part if the IC implementation
|
||||
// void SetICM(G4bool hl) { _icm = hl; };
|
||||
// void SetRDM(G4bool hl) { _rdm = hl; };
|
||||
// void SetHL(G4double hl) { _max_hl = hl; };
|
||||
// Changed in CreateTransition() from
|
||||
// return new G4DiscreteGammaTransition(*level);
|
||||
// To
|
||||
// return new G4DiscreteGammaTransition(*level,Z);
|
||||
// Added in CanDoTransition
|
||||
// if (level->HalfLife() > _max_hl && !_rdm ) canDo = false;
|
||||
//
|
||||
// 3 November 2011 L. Desorgher
|
||||
// remove the Z<= 98 limit
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4DiscreteGammaDeexcitation.hh"
|
||||
#include "G4DiscreteGammaTransition.hh"
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4DiscreteGammaDeexcitation::G4DiscreteGammaDeexcitation():
|
||||
nucleusZ(0), nucleusA(0), maxhl(1e-6*CLHEP::second), icm(false),
|
||||
rdm(false), levelManager(0), dtransition(0)
|
||||
{
|
||||
store = G4NuclearLevelStore::GetInstance();
|
||||
}
|
||||
|
||||
G4DiscreteGammaDeexcitation::~G4DiscreteGammaDeexcitation()
|
||||
{}
|
||||
|
||||
G4bool G4DiscreteGammaDeexcitation::CanDoTransition(G4Fragment* nucleus)
|
||||
{
|
||||
G4int Z = nucleus->GetZ_asInt();
|
||||
G4int A = nucleus->GetA_asInt();
|
||||
G4double excitation = nucleus->GetExcitationEnergy();
|
||||
|
||||
if(excitation <= _tolerance) {
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition fails; Z= " << Z
|
||||
<< " A= " << A << " Eex(meV)= " << excitation/MeV << G4endl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nucleusA != A || nucleusZ != Z) {
|
||||
levelManager = store->GetManager(Z,A);
|
||||
nucleusA = A;
|
||||
nucleusZ = Z;
|
||||
}
|
||||
if(!levelManager ||
|
||||
excitation > levelManager->MaxLevelEnergy() + _tolerance) { return false; }
|
||||
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition "
|
||||
<< " Z= " << Z << " A= " << A << " Eex= " << excitation
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
const G4NuclearLevel* level = levelManager->NearestLevel(excitation);
|
||||
|
||||
// long lived level
|
||||
if (!level || level->HalfLife() > maxhl) { return false; }
|
||||
// if (!level || (level->HalfLife() > maxhl && !rdm) ) { return false; }
|
||||
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4DiscreteGammaDeexcitation: Elevel(MeV)= "
|
||||
<< level->Energy()/MeV << ", Eex(MeV)= " << excitation << G4endl;
|
||||
}
|
||||
if(!_transition) {
|
||||
dtransition = new G4DiscreteGammaTransition(level,Z,_verbose);
|
||||
dtransition->SetICM(icm);
|
||||
_transition = dtransition;
|
||||
} else {
|
||||
dtransition->Update(level,Z);
|
||||
}
|
||||
// control on ICM
|
||||
if(level->HalfLife() > _timeLimit) {
|
||||
dtransition->SetICM(true);
|
||||
} else {
|
||||
dtransition->SetICM(icm);
|
||||
}
|
||||
|
||||
dtransition->SetEnergyFrom(excitation);
|
||||
|
||||
if (_verbose > 1) {
|
||||
G4cout << "CanDoTransition done: Eex(MeV)= "
|
||||
<< excitation/MeV << ", level enrgies: Emin(MeV)= "
|
||||
<< levelManager->MinLevelEnergy()/MeV << " Emax(MeV)= "
|
||||
<< levelManager->MaxLevelEnergy()/MeV << G4endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
-255
@@ -1,255 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4DiscreteGammaTransition.cc 91886 2015-08-10 07:08:25Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4DiscreteGammaTransition
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
//
|
||||
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// i) added G4int _nucleusZ initialise it through the constructor
|
||||
// ii) modified SelectGamma() to allow the generation of
|
||||
// conversion e-
|
||||
// iii) added #include G4AtomicShells.hh
|
||||
//
|
||||
// 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added renormalization to determine whether transition leads to
|
||||
// electron or gamma in SelectGamma()
|
||||
//
|
||||
// 19 April 2010, J. M. Quesada.
|
||||
// Corrections added for taking into account mismatch between
|
||||
// tabulated gamma energies and level energy differences
|
||||
// (fake photons eliminated)
|
||||
//
|
||||
// 9 May 2010, V.Ivanchenko
|
||||
// Removed unphysical corretions of gamma energy; fixed default
|
||||
// particle as gamma; do not subtract bounding energy in case of
|
||||
// electron emmision
|
||||
//
|
||||
// 3 November 2011, L. Desorgher
|
||||
// Extend the use of the code for Z>100 by not calling
|
||||
// G4AtomicShells::GetBindingEnergy for Z>100
|
||||
// For Z>100 the binding energy is set to 0 and atomic
|
||||
// relaxation is not simulated in G4RadDecay
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4DiscreteGammaTransition.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4AtomicShells.hh"
|
||||
#include "G4NuclearLevel.hh"
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "G4Log.hh"
|
||||
|
||||
static const G4double tolerance = 0.1*CLHEP::keV;
|
||||
|
||||
G4DiscreteGammaTransition::G4DiscreteGammaTransition(
|
||||
const G4NuclearLevel* level, G4int Z, G4int verb)
|
||||
: orbitE(-1), bondE(0.), gammaEnergy(0.), excitation(0.),
|
||||
gammaCreationTime(0.), aGamma(true), icm(false)
|
||||
{
|
||||
verbose = verb;
|
||||
Update(level, Z);
|
||||
}
|
||||
|
||||
G4DiscreteGammaTransition::~G4DiscreteGammaTransition()
|
||||
{}
|
||||
|
||||
void G4DiscreteGammaTransition::SelectGamma()
|
||||
{
|
||||
// default gamma
|
||||
aGamma = true;
|
||||
gammaEnergy = 0.;
|
||||
|
||||
G4int nGammas = aLevel->NumberOfGammas();
|
||||
if (nGammas > 0) {
|
||||
G4int iGamma = 0;
|
||||
if(1 < nGammas) {
|
||||
G4double random = G4UniformRand();
|
||||
|
||||
//G4cout << "G4DiscreteGammaTransition::SelectGamma N= "
|
||||
// << nGammas << " rand= " << random << G4endl;
|
||||
for(iGamma=0; iGamma<nGammas; ++iGamma) {
|
||||
//G4cout << iGamma << " prob= "
|
||||
// << (aLevel->GammaCumulativeProbabilities())[iGamma] << G4endl;
|
||||
if(random <= (aLevel->GammaCumulativeProbabilities())[iGamma])
|
||||
{ break; }
|
||||
}
|
||||
}
|
||||
/*
|
||||
G4cout << "Elevel(MeV)= " << aLevel->Energy()
|
||||
<< " Etran(MeV)= " << (aLevel->GammaEnergies())[iGamma]
|
||||
<< " Eexc(MeV)= " << excitation << G4endl;
|
||||
*/
|
||||
// VI 2014: initial excitation energy may be not exactly energy of the level
|
||||
// final excitation energy is always energy of some level or zero
|
||||
// transition to the ground state should be always equal to
|
||||
// the excitation energy
|
||||
gammaEnergy = (aLevel->GammaEnergies())[iGamma]
|
||||
+ excitation - aLevel->Energy();
|
||||
|
||||
// this check is needed to remove cases when nucleaus is left in
|
||||
// slightly excited state which will require very low energy
|
||||
// gamma emission
|
||||
if(excitation <= gammaEnergy + tolerance) { gammaEnergy = excitation; }
|
||||
//JMQ:
|
||||
//1)If chosen gamma energy is close enough to excitation energy,
|
||||
// the later is used instead for gamma dacey to gs (it guarantees
|
||||
// energy conservation)
|
||||
//2)For energy conservation, level energy differences instead of
|
||||
// tabulated gamma energies must be used (origin of final fake photons)
|
||||
|
||||
// VI: remove fake photons - applied only for the last transition
|
||||
// do not applied on each transition
|
||||
//if(std::fabs(excitation - gammaEnergy) < tolerance) {
|
||||
// gammaEnergy = excitation;
|
||||
//}
|
||||
|
||||
// JMQ: Warning: the following check is needed to avoid loops:
|
||||
// Due essentially to missing nuclear levels in data files, it is
|
||||
// possible that gammaEnergy is so low as the nucleus doesn't change
|
||||
// its level after the transition.
|
||||
// When such case is found, force the full deexcitation of the nucleus.
|
||||
//
|
||||
// NOTE: you should force the transition to the next lower level,
|
||||
// but this change needs a more complex revision of actual
|
||||
// design.
|
||||
// I leave this for a later revision.
|
||||
|
||||
// VI: the check is needed to remove very low-energy gamma
|
||||
if (gammaEnergy <= tolerance) { gammaEnergy = excitation; }
|
||||
/*
|
||||
G4cout << "G4DiscreteGammaTransition::SelectGamma: " << gammaEnergy
|
||||
<< " Eexc= " << excitation
|
||||
<< " icm: " << icm << G4endl;
|
||||
*/
|
||||
// now decide whether Internal Coversion electron should be emitted instead
|
||||
if (icm) {
|
||||
G4double random = G4UniformRand();
|
||||
if ( random <= (aLevel->TotalConvertionProbabilities())[iGamma]
|
||||
*(aLevel->GammaWeights())[iGamma]
|
||||
/((aLevel->TotalConvertionProbabilities())[iGamma]
|
||||
*(aLevel->GammaWeights())[iGamma]
|
||||
+(aLevel->GammaWeights())[iGamma]))
|
||||
{
|
||||
G4int iShell = 9;
|
||||
random = G4UniformRand() ;
|
||||
if ( random <= (aLevel->KConvertionProbabilities())[iGamma])
|
||||
{ iShell = 0;}
|
||||
else if ( random <= (aLevel->L1ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 1;}
|
||||
else if ( random <= (aLevel->L2ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 2;}
|
||||
else if ( random <= (aLevel->L3ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 3;}
|
||||
else if ( random <= (aLevel->M1ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 4;}
|
||||
else if ( random <= (aLevel->M2ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 5;}
|
||||
else if ( random <= (aLevel->M3ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 6;}
|
||||
else if ( random <= (aLevel->M4ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 7;}
|
||||
else if ( random <= (aLevel->M5ConvertionProbabilities())[iGamma])
|
||||
{ iShell = 8;}
|
||||
// the following is needed to match the ishell to that used in
|
||||
// G4AtomicShells
|
||||
if ( iShell == 9) {
|
||||
if ( (nucleusZ < 28) && (nucleusZ > 20)) {
|
||||
iShell--;
|
||||
} else if ( nucleusZ == 20 || nucleusZ == 19 ) {
|
||||
iShell = iShell -2;
|
||||
}
|
||||
}
|
||||
//L.Desorgher 02/11/2011
|
||||
//Atomic shell information is available in Geant4 only up top Z=100
|
||||
//To extend the photo evaporation code to Z>100 the call
|
||||
// to G4AtomicShells::GetBindingEnergy should be forbidden for Z>100
|
||||
bondE = 0.;
|
||||
if (nucleusZ <=100) {
|
||||
bondE = G4AtomicShells::GetBindingEnergy(nucleusZ, iShell);
|
||||
}
|
||||
if (verbose > 1) {
|
||||
G4cout << "G4DiscreteGammaTransition: nucleusZ = " <<nucleusZ
|
||||
<< " , iShell = " << iShell
|
||||
<< " , Shell binding energy = " << bondE/keV
|
||||
<< " keV " << G4endl;
|
||||
}
|
||||
|
||||
// last check on energy
|
||||
if(gammaEnergy > bondE + tolerance) {
|
||||
orbitE = iShell;
|
||||
aGamma = false ; // emitted is not a gamma now
|
||||
gammaEnergy -= bondE;
|
||||
}
|
||||
//G4cout << "gammaEnergy = " << gammaEnergy << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4double tau = aLevel->HalfLife() / G4Pow::GetInstance()->logZ(2);
|
||||
|
||||
//09.05.2010 VI rewrite samling of decay time
|
||||
// assuming ordinary exponential low
|
||||
gammaCreationTime = 0.;
|
||||
if(tau > 0.0) { gammaCreationTime = -tau*G4Log(G4UniformRand()); }
|
||||
}
|
||||
//G4cout << "G4DiscreteGammaTransition end nGamma= " << nGammas
|
||||
// << " Egamma= " << gammaEnergy << G4endl;
|
||||
}
|
||||
|
||||
G4double G4DiscreteGammaTransition::GetGammaEnergy()
|
||||
{
|
||||
return gammaEnergy;
|
||||
}
|
||||
|
||||
G4double G4DiscreteGammaTransition::GetGammaCreationTime()
|
||||
{
|
||||
return gammaCreationTime;
|
||||
}
|
||||
|
||||
void G4DiscreteGammaTransition::SetEnergyFrom(G4double energy)
|
||||
{
|
||||
excitation = energy;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-165
@@ -1,165 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4E1Probability.cc 92144 2015-08-19 14:25:18Z gcosmo $
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
// Geant4 class G4E1Probability
|
||||
//
|
||||
// by V. Lara (May 2003)
|
||||
//
|
||||
// Modifications:
|
||||
// 18.05.2010 V.Ivanchenko trying to speedup the most slow method
|
||||
// by usage of G4Pow, integer A and introduction of const members
|
||||
// 17.11.2010 V.Ivanchenko perform general cleanup and simplification
|
||||
// of integration method; low-limit of integration is defined
|
||||
// by gamma energy or is zero (was always zero before)
|
||||
//
|
||||
|
||||
#include "G4E1Probability.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
static const G4double tolerance = 0.1*CLHEP::keV;
|
||||
|
||||
G4E1Probability::G4E1Probability():G4VEmissionProbability()
|
||||
{
|
||||
G4double x = CLHEP::pi*CLHEP::hbarc;
|
||||
normC = 1.0 / (x*x);
|
||||
theLevelDensityPerNucleon = 0.125/MeV;
|
||||
aLevelDensityParam = sigma0 = Egdp = GammaR = 0.0;
|
||||
Afrag = 0;
|
||||
fG4pow = G4Pow::GetInstance();
|
||||
}
|
||||
|
||||
G4E1Probability::~G4E1Probability()
|
||||
{}
|
||||
|
||||
|
||||
G4double G4E1Probability::EmissionProbDensity(const G4Fragment& frag,
|
||||
G4double gammaE)
|
||||
{
|
||||
// Calculate the probability density here
|
||||
|
||||
// From nuclear fragment properties and the excitation energy, calculate
|
||||
// the probability density for photon evaporation from U to U - gammaE
|
||||
// (U = nucleus excitation energy, gammaE = total evaporated photon
|
||||
// energy). Fragment = nuclear fragment BEFORE de-excitation
|
||||
|
||||
G4double theProb = 0.0;
|
||||
|
||||
if(gammaE > tolerance) {
|
||||
|
||||
G4double Uexcite = frag.GetExcitationEnergy();
|
||||
G4double U = std::max(0.0, Uexcite - gammaE);
|
||||
|
||||
// Need a level density parameter.
|
||||
// For now, just use the constant approximation (not reliable near magic
|
||||
// nuclei) - is equivalent to G4ConstantLevelDensityParameter class
|
||||
|
||||
if(Afrag != frag.GetA_asInt()) {
|
||||
Afrag = frag.GetA_asInt();
|
||||
aLevelDensityParam = Afrag*theLevelDensityPerNucleon;
|
||||
|
||||
// Define constants for the photoabsorption cross-section (the reverse
|
||||
// process of our de-excitation)
|
||||
sigma0 = 2.5 * Afrag * millibarn;
|
||||
Egdp = (40.3 / fG4pow->powZ(Afrag,0.2) )*MeV;
|
||||
GammaR = 0.30 * Egdp;
|
||||
}
|
||||
// VI reduce number of calls to exp
|
||||
G4double levelDens =
|
||||
G4Exp(2*(std::sqrt(aLevelDensityParam*U)-
|
||||
std::sqrt(aLevelDensityParam*Uexcite)));
|
||||
|
||||
//G4cout<<" Uexcite, gammaE = "<<Uexcite<<" "<<gammaE<<G4endl;
|
||||
//cout<<" lev density param = "<<aLevelDensityParam<<G4endl;
|
||||
//cout<<" level densities = "<<levelDensBef<<" "<<levelDensAft<<G4endl;
|
||||
//cout<<" sigma0 = "<<sigma0<<G4endl;
|
||||
//cout<<" Egdp, GammaR = "<<Egdp<<" "<<GammaR<<G4endl;
|
||||
//cout<<" normC = "<<normC<<G4endl;
|
||||
|
||||
// VI implementation 18.05.2010
|
||||
G4double gammaE2 = gammaE*gammaE;
|
||||
G4double gammaR2 = gammaE2*GammaR*GammaR;
|
||||
G4double egdp2 = gammaE2 - Egdp*Egdp;
|
||||
G4double sigmaAbs = sigma0*gammaR2/(egdp2*egdp2 + gammaR2);
|
||||
theProb = normC * sigmaAbs * gammaE2 * levelDens;
|
||||
|
||||
//G4cout<<" sigmaAbs = "<<sigmaAbs <<" Probability = "<<theProb<<G4endl;
|
||||
}
|
||||
return theProb;
|
||||
}
|
||||
|
||||
G4double G4E1Probability::EmissionProbability(const G4Fragment& frag,
|
||||
G4double gammaE)
|
||||
{
|
||||
// From nuclear fragment properties and the excitation energy, calculate
|
||||
// the probability for photon evaporation down to last ground level.
|
||||
// fragment = nuclear fragment BEFORE de-excitation
|
||||
|
||||
G4double upperLim = gammaE;
|
||||
G4double lowerLim = 0.0;
|
||||
|
||||
//G4cout << "G4E1Probability::EmissionProbability: Emin= " << lowerLim
|
||||
// << " Emax= " << upperLim << G4endl;
|
||||
if( upperLim - lowerLim <= tolerance) { return 0.0; }
|
||||
|
||||
// Need to integrate EmissionProbDensity from lowerLim to upperLim
|
||||
// and multiply by factor 3 (?!)
|
||||
|
||||
G4double integ = EmissionIntegration(frag,lowerLim,upperLim);
|
||||
return integ;
|
||||
}
|
||||
|
||||
G4double G4E1Probability::EmissionIntegration(const G4Fragment& frag,
|
||||
G4double lowLim, G4double upLim)
|
||||
|
||||
{
|
||||
// Simple integration
|
||||
// VI replace by direct integration over 100 point
|
||||
|
||||
static const G4int numIters = 100;
|
||||
G4double Step = (upLim-lowLim)/G4double(numIters);
|
||||
|
||||
G4double res = 0.0;
|
||||
G4double x = lowLim - 0.5*Step;
|
||||
|
||||
for(G4int i = 0; i < numIters; ++i) {
|
||||
x += Step;
|
||||
res += EmissionProbDensity(frag, x);
|
||||
}
|
||||
|
||||
if(res > 0.0) { res *= Step; }
|
||||
else { res = 0.0; }
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
-350
@@ -1,350 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevel.cc 86986 2014-11-21 13:00:05Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, IT Division, ASD group
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4NuclearLevel
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 24 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
// 06 Oct 2010, M. Kelsey (kelsey@slac.stanford.edu)
|
||||
// Add friendship for G4NuclearLevelManager; define private
|
||||
// constructors without vectors.
|
||||
//
|
||||
// 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added IC probability when calculate the channel probabilities in
|
||||
// MakeProbabilities().
|
||||
//
|
||||
// 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Added K->N+ internal conversion coefficiencies and their access
|
||||
// functions.
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added half-life, angular momentum, parity, emissioni type
|
||||
// reading from experimental data.
|
||||
//
|
||||
// 28 October 2010, V.Ivanchenko moved copy constructor to source, cleanup
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4NuclearLevel.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4int G4NuclearLevel::Increment(G4int aF)
|
||||
{
|
||||
static G4ThreadLocal G4int instanceCount = 0;
|
||||
instanceCount+=aF;
|
||||
return instanceCount;
|
||||
}
|
||||
|
||||
G4NuclearLevel::G4NuclearLevel()
|
||||
: _energy(0.), _halfLife(0.), _angularMomentum(0.), _nGammas(0) {
|
||||
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
|
||||
}
|
||||
|
||||
G4NuclearLevel::G4NuclearLevel(G4double energy, G4double halfLife,
|
||||
G4double angularMomentum)
|
||||
: _energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum),
|
||||
_nGammas(0) {
|
||||
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
|
||||
}
|
||||
|
||||
G4NuclearLevel::G4NuclearLevel(G4double energy, G4double halfLife,
|
||||
G4double angularMomentum,
|
||||
const std::vector<G4double>& eGamma,
|
||||
const std::vector<G4double>& wGamma,
|
||||
const std::vector<G4double>& polarities,
|
||||
const std::vector<G4double>& kCC, const std::vector<G4double>& l1CC,
|
||||
const std::vector<G4double>& l2CC, const std::vector<G4double>& l3CC,
|
||||
const std::vector<G4double>& m1CC, const std::vector<G4double>& m2CC,
|
||||
const std::vector<G4double>& m3CC, const std::vector<G4double>& m4CC,
|
||||
const std::vector<G4double>& m5CC, const std::vector<G4double>& nPlusCC,
|
||||
const std::vector<G4double>& totalCC)
|
||||
|
||||
: _energies(eGamma), _weights(wGamma), _polarities(polarities),
|
||||
_kCC(kCC), _l1CC(l1CC), _l2CC(l2CC), _l3CC(l3CC),
|
||||
_m1CC(m1CC), _m2CC(m2CC), _m3CC(m3CC), _m4CC(m4CC), _m5CC(m5CC),
|
||||
_nPlusCC(nPlusCC), _totalCC(totalCC),
|
||||
_energy(energy), _halfLife(halfLife), _angularMomentum(angularMomentum)
|
||||
{
|
||||
Finalize();
|
||||
// G4cout << "####### Incrementing "<<Increment(1)<<G4endl;
|
||||
}
|
||||
|
||||
G4NuclearLevel::~G4NuclearLevel()
|
||||
{
|
||||
// G4cout << "####### Decrementing "<<Increment(-1)<<G4endl;
|
||||
}
|
||||
|
||||
G4bool G4NuclearLevel::operator==(const G4NuclearLevel &right) const
|
||||
{
|
||||
return (this == (G4NuclearLevel *) &right);
|
||||
}
|
||||
|
||||
|
||||
G4bool G4NuclearLevel::operator!=(const G4NuclearLevel &right) const
|
||||
{
|
||||
return (this != (G4NuclearLevel *) &right);
|
||||
}
|
||||
|
||||
G4bool G4NuclearLevel::operator<(const G4NuclearLevel &right) const
|
||||
{
|
||||
if (_energy < right.Energy()) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::GammaEnergies() const
|
||||
{
|
||||
return _energies;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::GammaWeights() const
|
||||
{
|
||||
return _weights;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::GammaProbabilities() const
|
||||
{
|
||||
return _prob;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::GammaCumulativeProbabilities() const
|
||||
{
|
||||
return _cumProb;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::GammaPolarities() const
|
||||
{
|
||||
return _polarities;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::KConvertionProbabilities() const
|
||||
{
|
||||
return _kCC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::L1ConvertionProbabilities() const
|
||||
{
|
||||
return _l1CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::L2ConvertionProbabilities() const
|
||||
{
|
||||
return _l2CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::L3ConvertionProbabilities() const
|
||||
{
|
||||
return _l3CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::M1ConvertionProbabilities() const
|
||||
{
|
||||
return _m1CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::M2ConvertionProbabilities() const
|
||||
{
|
||||
return _m2CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::M3ConvertionProbabilities() const
|
||||
{
|
||||
return _m3CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::M4ConvertionProbabilities() const
|
||||
{
|
||||
return _m4CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::M5ConvertionProbabilities() const
|
||||
{
|
||||
return _m5CC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::NPlusConvertionProbabilities() const
|
||||
{
|
||||
return _nPlusCC;
|
||||
}
|
||||
|
||||
const std::vector<G4double>& G4NuclearLevel::TotalConvertionProbabilities() const
|
||||
{
|
||||
return _totalCC;
|
||||
}
|
||||
|
||||
G4double G4NuclearLevel::Energy() const
|
||||
{
|
||||
return _energy;
|
||||
}
|
||||
|
||||
G4double G4NuclearLevel::AngularMomentum() const
|
||||
{
|
||||
return _angularMomentum;
|
||||
}
|
||||
|
||||
G4double G4NuclearLevel::HalfLife() const
|
||||
{
|
||||
return _halfLife;
|
||||
}
|
||||
|
||||
G4int G4NuclearLevel::NumberOfGammas() const
|
||||
{
|
||||
return _nGammas;
|
||||
}
|
||||
|
||||
void G4NuclearLevel::PrintAll() const
|
||||
{
|
||||
G4cout << "---- Level energy = " << _energy << ", angular momentum = "
|
||||
<< _angularMomentum << ", half life " << _halfLife
|
||||
<< ", " << _nGammas << " photons" << G4endl;
|
||||
G4int i;
|
||||
G4cout << " Gammas: ";
|
||||
for (i=0; i<_nGammas; i++) { G4cout << _energies[i] << " "; }
|
||||
G4cout << G4endl << " Weights: ";
|
||||
for (i=0; i<_nGammas; i++) { G4cout << _weights[i] << " "; }
|
||||
G4cout << G4endl << " Relative transition probabilities ";
|
||||
for (i=0; i<_nGammas; i++) { G4cout << _prob[i] << " "; }
|
||||
G4cout << G4endl << " Cumulative probabilities: ";
|
||||
for (i=0; i<_nGammas; i++) { G4cout << _cumProb[i] << " "; }
|
||||
G4cout << G4endl << " Polarities: ";
|
||||
for (i=0; i<_nGammas; i++) { G4cout << _polarities[i] << " "; }
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
void G4NuclearLevel::PrintLevels() const
|
||||
{
|
||||
G4cout << " Eexc(MeV)= " << _energy
|
||||
<< " Time(ns)= " << _halfLife/ns << " Ntrans= " << _nGammas
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
void G4NuclearLevel::Finalize() {
|
||||
_nGammas = _energies.size();
|
||||
MakeProbabilities();
|
||||
MakeCumProb();
|
||||
}
|
||||
|
||||
void G4NuclearLevel::MakeProbabilities()
|
||||
{
|
||||
G4double sum = 0.;
|
||||
G4int i = 0;
|
||||
for (i=0; i<_nGammas; i++) {
|
||||
sum += _weights[i]*(1.+_totalCC[i]);
|
||||
}
|
||||
|
||||
if (sum <= 0.) _prob.resize(_nGammas, 1./_nGammas); // Fast fill
|
||||
else {
|
||||
_prob.reserve(_nGammas);
|
||||
for (i=0; i<_nGammas; i++) {
|
||||
_prob.push_back(_weights[i]*(1.+_totalCC[i])/sum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void G4NuclearLevel::MakeCumProb()
|
||||
{
|
||||
if (_nGammas <= 0) return;
|
||||
|
||||
_cumProb.reserve(_nGammas);
|
||||
|
||||
G4double sum = _prob[0];
|
||||
_cumProb.push_back(sum);
|
||||
|
||||
for (G4int i=1; i<_nGammas; i++) {
|
||||
sum += _prob[i];
|
||||
_cumProb.push_back(sum);
|
||||
}
|
||||
}
|
||||
|
||||
G4NuclearLevel& G4NuclearLevel::operator=(const G4NuclearLevel &right)
|
||||
{
|
||||
if(this != &right)
|
||||
{
|
||||
_energies = right._energies;
|
||||
_weights =right._weights;
|
||||
_prob =right._prob;
|
||||
_cumProb =right._cumProb;
|
||||
_polarities =right._polarities;
|
||||
_kCC = right._kCC;
|
||||
_l1CC =right._l1CC;
|
||||
_l2CC =right._l2CC;
|
||||
_l3CC =right._l3CC;
|
||||
_m1CC = right._m1CC;
|
||||
_m2CC = right._m2CC;
|
||||
_m3CC = right._m3CC;
|
||||
_m4CC = right._m4CC;
|
||||
_m5CC = right._m5CC;
|
||||
_nPlusCC = right._nPlusCC;
|
||||
_totalCC = right._totalCC;
|
||||
_energy = right._energy;
|
||||
_halfLife = right._halfLife;
|
||||
_angularMomentum = right._angularMomentum;
|
||||
_nGammas = right._nGammas;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4NuclearLevel::G4NuclearLevel(const G4NuclearLevel &right)
|
||||
{
|
||||
_energies = right._energies;
|
||||
_weights =right._weights;
|
||||
_prob =right._prob;
|
||||
_cumProb =right._cumProb;
|
||||
_polarities =right._polarities;
|
||||
_kCC = right._kCC;
|
||||
_l1CC =right._l1CC;
|
||||
_l2CC =right._l2CC;
|
||||
_l3CC =right._l3CC;
|
||||
_m1CC = right._m1CC;
|
||||
_m2CC = right._m2CC;
|
||||
_m3CC = right._m3CC;
|
||||
_m4CC = right._m4CC;
|
||||
_m5CC = right._m5CC;
|
||||
_nPlusCC = right._nPlusCC;
|
||||
_totalCC = right._totalCC;
|
||||
_energy = right._energy;
|
||||
_halfLife = right._halfLife;
|
||||
_angularMomentum = right._angularMomentum;
|
||||
_nGammas = right._nGammas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-428
@@ -1,428 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevelManager.cc 93357 2015-10-19 13:40:13Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4NuclearLevelManager
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 24 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added half-life, angular momentum, parity, emissioni type
|
||||
// reading from experimental data.
|
||||
// 02 May 2003, Vladimir Ivanchenko remove rublic copy constructor
|
||||
// 06 Oct 2010, M. Kelsey -- Use object storage, not pointers, drop
|
||||
// public access to list, simplify list construction
|
||||
// -------------------------------------------------------------------
|
||||
#include <stdlib.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4NuclearLevel.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4HadronicException.hh"
|
||||
#include "G4HadTmpUtil.hh"
|
||||
#include "G4NucleiProperties.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
|
||||
G4double G4NuclearLevelManager::_levelEnergy=0.;
|
||||
G4double G4NuclearLevelManager::_gammaEnergy=0.;
|
||||
G4double G4NuclearLevelManager::_probability=0.;
|
||||
G4double G4NuclearLevelManager::_polarity=0.;
|
||||
G4double G4NuclearLevelManager::_halfLife=0.;
|
||||
G4double G4NuclearLevelManager::_angularMomentum=0.;
|
||||
G4double G4NuclearLevelManager::_kCC=0.;
|
||||
G4double G4NuclearLevelManager::_l1CC=0.;
|
||||
G4double G4NuclearLevelManager::_l2CC=0.;
|
||||
G4double G4NuclearLevelManager::_l3CC=0.;
|
||||
G4double G4NuclearLevelManager::_m1CC=0.;
|
||||
G4double G4NuclearLevelManager::_m2CC=0.;
|
||||
G4double G4NuclearLevelManager::_m3CC=0.;
|
||||
G4double G4NuclearLevelManager::_m4CC=0.;
|
||||
G4double G4NuclearLevelManager::_m5CC=0.;
|
||||
G4double G4NuclearLevelManager::_nPlusCC=0.;
|
||||
G4double G4NuclearLevelManager::_totalCC=0.;
|
||||
|
||||
G4NuclearLevelManager::G4NuclearLevelManager(G4int Z, G4int A,
|
||||
const G4String& filename) :
|
||||
_nucleusA(A), _nucleusZ(Z), _validity(false),
|
||||
_levels(0)
|
||||
{
|
||||
if (A <= 0 || Z <= 0 || Z > A ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__,
|
||||
"==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
|
||||
}
|
||||
MakeLevels(filename);
|
||||
/*
|
||||
G4cout << "+++++ New G4NuclearLevelManager Z= " << Z << " A= " << A
|
||||
<< " " << _levels;
|
||||
if(_levels) { G4cout << " Nlevels= " << _levels->size(); }
|
||||
G4cout << G4endl;
|
||||
*/
|
||||
}
|
||||
|
||||
G4NuclearLevelManager::~G4NuclearLevelManager()
|
||||
{
|
||||
ClearLevels();
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::SetNucleus(G4int Z, G4int A, const G4String& filename)
|
||||
{
|
||||
if (A <= 0 || Z <= 0 || Z > A ) {
|
||||
throw G4HadronicException(__FILE__, __LINE__,
|
||||
"==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
|
||||
}
|
||||
if (_nucleusZ != Z || _nucleusA != A)
|
||||
{
|
||||
_nucleusA = A;
|
||||
_nucleusZ = Z;
|
||||
MakeLevels(filename);
|
||||
}
|
||||
}
|
||||
|
||||
const G4NuclearLevel* G4NuclearLevelManager::GetLevel(G4int i) const {
|
||||
return (i>=0 && i<NumberOfLevels()) ? (*_levels)[i] : 0;
|
||||
}
|
||||
|
||||
const G4NuclearLevel*
|
||||
G4NuclearLevelManager::NearestLevel(G4double energy, G4double) const
|
||||
{
|
||||
if (NumberOfLevels() <= 0) return 0;
|
||||
|
||||
G4int iNear = -1;
|
||||
|
||||
//G4cout << "G4NuclearLevelManager::NearestLevel E(MeV)= "
|
||||
// << energy/MeV << " dEmax(MeV)= " << eDiffMax/MeV << G4endl;
|
||||
|
||||
G4double diff = 1.e+10;
|
||||
for (unsigned int i=0; i<_levels->size(); ++i)
|
||||
{
|
||||
G4double e = GetLevel(i)->Energy();
|
||||
G4double eDiff = std::fabs(e - energy);
|
||||
//G4cout << i << ". eDiff(MeV)= " << eDiff/MeV << G4endl;
|
||||
if (eDiff <= diff)
|
||||
{
|
||||
diff = eDiff;
|
||||
iNear = i;
|
||||
}
|
||||
}
|
||||
|
||||
return GetLevel(iNear); // Includes range checking on iNear
|
||||
}
|
||||
|
||||
G4double G4NuclearLevelManager::MinLevelEnergy() const
|
||||
{
|
||||
return (NumberOfLevels() > 0) ? _levels->front()->Energy() : 9999.*GeV;
|
||||
}
|
||||
|
||||
G4double G4NuclearLevelManager::MaxLevelEnergy() const
|
||||
{
|
||||
return (NumberOfLevels() > 0) ? _levels->back()->Energy() : 0.*GeV;
|
||||
}
|
||||
|
||||
const G4NuclearLevel* G4NuclearLevelManager::HighestLevel() const
|
||||
{
|
||||
return (NumberOfLevels() > 0) ? _levels->front() : 0;
|
||||
}
|
||||
|
||||
const G4NuclearLevel* G4NuclearLevelManager::LowestLevel() const
|
||||
{
|
||||
return (NumberOfLevels() > 0) ? _levels->back() : 0;
|
||||
}
|
||||
|
||||
G4bool G4NuclearLevelManager::Read(std::ifstream& dataFile)
|
||||
{
|
||||
G4bool goodRead = ReadDataLine(dataFile);
|
||||
|
||||
if (goodRead) ProcessDataLine();
|
||||
return goodRead;
|
||||
}
|
||||
|
||||
// NOTE: Standard stream I/O generates a 45 byte std::string per item!
|
||||
|
||||
G4bool G4NuclearLevelManager::ReadDataLine(std::ifstream& dataFile) {
|
||||
/***** DO NOT USE REGULAR STREAM I/O
|
||||
G4bool result = true;
|
||||
if (dataFile >> _levelEnergy)
|
||||
{
|
||||
dataFile >> _gammaEnergy >> _probability >> _polarity >> _halfLife
|
||||
>> _angularMomentum >> _totalCC >> _kCC >> _l1CC >> _l2CC
|
||||
>> _l3CC >> _m1CC >> _m2CC >> _m3CC >> _m4CC >> _m5CC
|
||||
>> _nPlusCC;
|
||||
}
|
||||
else result = false;
|
||||
*****/
|
||||
|
||||
// Each item will return iostream status
|
||||
return (ReadDataItem(dataFile, _levelEnergy) &&
|
||||
ReadDataItem(dataFile, _gammaEnergy) &&
|
||||
ReadDataItem(dataFile, _probability) &&
|
||||
ReadDataItem(dataFile, _polarity) &&
|
||||
ReadDataItem(dataFile, _halfLife) &&
|
||||
ReadDataItem(dataFile, _angularMomentum) &&
|
||||
ReadDataItem(dataFile, _totalCC) &&
|
||||
ReadDataItem(dataFile, _kCC) &&
|
||||
ReadDataItem(dataFile, _l1CC) &&
|
||||
ReadDataItem(dataFile, _l2CC) &&
|
||||
ReadDataItem(dataFile, _l3CC) &&
|
||||
ReadDataItem(dataFile, _m1CC) &&
|
||||
ReadDataItem(dataFile, _m2CC) &&
|
||||
ReadDataItem(dataFile, _m3CC) &&
|
||||
ReadDataItem(dataFile, _m4CC) &&
|
||||
ReadDataItem(dataFile, _m5CC) &&
|
||||
ReadDataItem(dataFile, _nPlusCC) );
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4NuclearLevelManager::ReadDataItem(std::istream& dataFile, G4double& x)
|
||||
{
|
||||
// G4bool okay = (dataFile >> buffer) != 0; // Get next token
|
||||
// if (okay) x = strtod(buffer, NULL);
|
||||
char buffer[30];
|
||||
for(G4int i=0; i<30; ++i) { buffer[i] = 0; }
|
||||
G4bool okay = true;
|
||||
dataFile >> buffer;
|
||||
if(dataFile.fail()) { okay = false; }
|
||||
else { x = strtod(buffer, NULL); }
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::ProcessDataLine()
|
||||
{
|
||||
const G4double minProbability = 1e-8;
|
||||
|
||||
// Assign units for dimensional quantities
|
||||
_levelEnergy *= keV;
|
||||
_gammaEnergy *= keV;
|
||||
_halfLife *= second;
|
||||
|
||||
// The following adjustment is needed to take care of anomalies in
|
||||
// data files, where some transitions show up with relative probability
|
||||
// zero
|
||||
if (_probability < minProbability) _probability = minProbability;
|
||||
// the folowwing is to convert icc probability to accumulative ones
|
||||
_l1CC += _kCC;
|
||||
_l2CC += _l1CC;
|
||||
_l3CC += _l2CC;
|
||||
_m1CC += _l3CC;
|
||||
_m2CC += _m1CC;
|
||||
_m3CC += _m2CC;
|
||||
_m4CC += _m3CC;
|
||||
_m5CC += _m4CC;
|
||||
_nPlusCC += _m5CC;
|
||||
|
||||
if (_nPlusCC!=0) { // Normalize to probabilities
|
||||
_kCC /= _nPlusCC;
|
||||
_l1CC /= _nPlusCC;
|
||||
_l2CC /= _nPlusCC;
|
||||
_l3CC /= _nPlusCC;
|
||||
_m1CC /= _nPlusCC;
|
||||
_m2CC /= _nPlusCC;
|
||||
_m3CC /= _nPlusCC;
|
||||
_m4CC /= _nPlusCC;
|
||||
_m5CC /= _nPlusCC;
|
||||
_nPlusCC /= _nPlusCC;
|
||||
} else { // Total was zero, reset to unity
|
||||
_kCC = 1;
|
||||
_l1CC = 1;
|
||||
_l2CC = 1;
|
||||
_l3CC = 1;
|
||||
_m1CC = 1;
|
||||
_m2CC = 1;
|
||||
_m3CC = 1;
|
||||
_m4CC = 1;
|
||||
_m5CC = 1;
|
||||
_nPlusCC = 1;
|
||||
}
|
||||
|
||||
// G4cout << "Read " << _levelEnergy << " " << _gammaEnergy << " " << _probability << G4endl;
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::ClearLevels()
|
||||
{
|
||||
_validity = false;
|
||||
|
||||
if (NumberOfLevels() > 0) {
|
||||
std::for_each(_levels->begin(), _levels->end(), DeleteLevel());
|
||||
_levels->clear();
|
||||
}
|
||||
|
||||
delete _levels;
|
||||
_levels = 0;
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::MakeLevels(const G4String& filename)
|
||||
{
|
||||
_validity = false;
|
||||
if (NumberOfLevels() > 0) ClearLevels(); // Discard existing data
|
||||
|
||||
std::ifstream inFile(filename, std::ios::in);
|
||||
if (! inFile)
|
||||
{
|
||||
#ifdef GAMMAFILEWARNING
|
||||
if (_nucleusZ > 10) G4cout << " G4NuclearLevelManager: nuclide ("
|
||||
<< _nucleusZ << "," << _nucleusA
|
||||
<< ") does not have a gamma levels file" << G4endl;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
_levels = new G4PtrLevelVector;
|
||||
|
||||
// Read individual gamma data and fill levels for this nucleus
|
||||
|
||||
G4NuclearLevel* thisLevel = 0;
|
||||
G4int nData = 0;
|
||||
|
||||
// Loop checking, 05-Aug-2015, Vladimir Ivanchenko
|
||||
while (Read(inFile)) {
|
||||
thisLevel = UseLevelOrMakeNew(thisLevel); // May create new pointer
|
||||
AddDataToLevel(thisLevel);
|
||||
nData++; // For debugging purposes
|
||||
}
|
||||
|
||||
FinishLevel(thisLevel); // Final must be completed by hand
|
||||
|
||||
// ---- MGP ---- Don't forget to close the file
|
||||
inFile.close();
|
||||
|
||||
// G4cout << " ==== MakeLevels ===== " << nData << " data read " << G4endl;
|
||||
|
||||
G4PtrSort<G4NuclearLevel>(_levels);
|
||||
|
||||
_validity = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
G4NuclearLevel*
|
||||
G4NuclearLevelManager::UseLevelOrMakeNew(G4NuclearLevel* level)
|
||||
{
|
||||
if (level && _levelEnergy == level->Energy()) return level; // No change
|
||||
|
||||
if (level) FinishLevel(level); // Save what we have up to now
|
||||
|
||||
// G4cout << "Making a new level... " << _levelEnergy << G4endl;
|
||||
return new G4NuclearLevel(_levelEnergy, _halfLife, _angularMomentum);
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::AddDataToLevel(G4NuclearLevel* level)
|
||||
{
|
||||
if (!level) return; // Sanity check
|
||||
|
||||
level->_energies.push_back(_gammaEnergy);
|
||||
level->_weights.push_back(_probability);
|
||||
level->_polarities.push_back(_polarity);
|
||||
level->_kCC.push_back(_kCC);
|
||||
level->_l1CC.push_back(_l1CC);
|
||||
level->_l2CC.push_back(_l2CC);
|
||||
level->_l3CC.push_back(_l3CC);
|
||||
level->_m1CC.push_back(_m1CC);
|
||||
level->_m2CC.push_back(_m2CC);
|
||||
level->_m3CC.push_back(_m3CC);
|
||||
level->_m4CC.push_back(_m4CC);
|
||||
level->_m5CC.push_back(_m5CC);
|
||||
level->_nPlusCC.push_back(_nPlusCC);
|
||||
level->_totalCC.push_back(_totalCC);
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::FinishLevel(G4NuclearLevel* level)
|
||||
{
|
||||
if (!level || !_levels) return; // Sanity check
|
||||
|
||||
level->Finalize();
|
||||
_levels->push_back(level);
|
||||
}
|
||||
|
||||
|
||||
void G4NuclearLevelManager::PrintAll()
|
||||
{
|
||||
G4int nLevels = NumberOfLevels();
|
||||
|
||||
G4cout << " ==== G4NuclearLevelManager ==== (" << _nucleusZ << ", " << _nucleusA
|
||||
<< ") has " << nLevels << " levels" << G4endl
|
||||
<< "Highest level is at energy " << MaxLevelEnergy() << " MeV "
|
||||
<< G4endl << "Lowest level is at energy " << MinLevelEnergy()
|
||||
<< " MeV " << G4endl;
|
||||
|
||||
for (G4int i=0; i<nLevels; ++i) {
|
||||
GetLevel(i)->PrintAll();
|
||||
}
|
||||
}
|
||||
|
||||
void G4NuclearLevelManager::PrintLevels()
|
||||
{
|
||||
G4int nLevels = NumberOfLevels();
|
||||
G4double efermi = G4NucleiProperties::GetNuclearMass(_nucleusA-1, _nucleusZ)
|
||||
+ neutron_mass_c2 -
|
||||
G4NucleiProperties::GetNuclearMass(_nucleusA, _nucleusZ);
|
||||
|
||||
G4cout << "Z= " << _nucleusZ << " A= " << _nucleusA
|
||||
<< " " << nLevels << " levels"
|
||||
<< " Efermi(MeV)= " << efermi << G4endl;
|
||||
|
||||
for (G4int i=0; i<nLevels; ++i) {
|
||||
GetLevel(i)->PrintLevels();
|
||||
}
|
||||
}
|
||||
|
||||
G4NuclearLevelManager::G4NuclearLevelManager(const G4NuclearLevelManager &right)
|
||||
{
|
||||
_nucleusA = right._nucleusA;
|
||||
_nucleusZ = right._nucleusZ;
|
||||
_validity = right._validity;
|
||||
|
||||
if (right._levels != 0)
|
||||
{
|
||||
_levels = new G4PtrLevelVector;
|
||||
G4int n = right._levels->size();
|
||||
G4int i;
|
||||
for (i=0; i<n; ++i)
|
||||
{
|
||||
_levels->push_back(new G4NuclearLevel(*(right.GetLevel(i))));
|
||||
}
|
||||
G4PtrSort<G4NuclearLevel>(_levels);
|
||||
}
|
||||
else
|
||||
{
|
||||
_levels = 0;
|
||||
}
|
||||
}
|
||||
|
||||
-188
@@ -1,188 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4NuclearLevelStore.cc 88406 2015-02-18 09:13:29Z gcosmo $
|
||||
//
|
||||
// 06-10-2010 M. Kelsey -- Drop static data members.
|
||||
// 17-11-2010 V. Ivanchenko - make as a classical singleton.
|
||||
// 17-10-2011 V. L. Desorgher - allows to define separate datafile for
|
||||
// given isotope
|
||||
// 06-01-2012 V. Ivanchenko - cleanup the code; new method GetLevelManager
|
||||
// 19-11-2014 M. Asai - protection against reading the same file from
|
||||
// more than one worker threads
|
||||
//
|
||||
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
G4ThreadLocal G4NuclearLevelStore* G4NuclearLevelStore::theInstance = 0;
|
||||
#ifdef G4MULTITHREADED
|
||||
G4NuclearLevelStore* G4NuclearLevelStore::theShadowInstance = 0;
|
||||
G4Mutex G4NuclearLevelStore::nuclearLevelStoreMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
G4NuclearLevelStore* G4NuclearLevelStore::GetInstance()
|
||||
{
|
||||
if(!theInstance) {
|
||||
static G4ThreadLocalSingleton<G4NuclearLevelStore> inst;
|
||||
theInstance = inst.Instance();
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
if(!theShadowInstance) {
|
||||
static G4NuclearLevelStore shadowInst;
|
||||
theShadowInstance = &shadowInst;
|
||||
}
|
||||
#endif
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
G4NuclearLevelStore::G4NuclearLevelStore()
|
||||
{
|
||||
userFiles = false;
|
||||
char* env = getenv("G4LEVELGAMMADATA");
|
||||
if (env == 0)
|
||||
{
|
||||
G4cout << "G4NuclarLevelStore: please set the G4LEVELGAMMADATA environment variable\n";
|
||||
dirName = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
dirName = env;
|
||||
dirName += '/';
|
||||
}
|
||||
}
|
||||
|
||||
G4NuclearLevelStore::~G4NuclearLevelStore()
|
||||
{
|
||||
#ifdef G4MULTITHREADED
|
||||
if(this==theShadowInstance) // G4NuclearLevelManager object should be deleted only by the master
|
||||
{
|
||||
#endif
|
||||
ManagersMap::iterator i;
|
||||
for (i = theManagers.begin(); i != theManagers.end(); ++i)
|
||||
{ delete i->second; }
|
||||
#ifdef G4MULTITHREADED
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
G4NuclearLevelStore::AddUserEvaporationDataFile(G4int Z, G4int A,
|
||||
const G4String& filename)
|
||||
{
|
||||
if (Z<1 || A<2) {
|
||||
G4cout<<"G4NuclearLevelStore::AddUserEvaporationDataFile "
|
||||
<<" Z= " << Z << " and A= " << A << " not valid!"<<G4endl;
|
||||
}
|
||||
|
||||
std::ifstream DecaySchemeFile(filename);
|
||||
if (DecaySchemeFile){
|
||||
G4int ID_ion=Z*1000+A;//A*1000+Z;
|
||||
theUserDataFiles[ID_ion]=filename;
|
||||
userFiles = true;
|
||||
}
|
||||
else {
|
||||
G4cout<<"The file "<<filename<<" does not exist!"<<G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4String
|
||||
G4NuclearLevelStore::GenerateFileName(G4int Z, G4int A) const
|
||||
{
|
||||
std::ostringstream streamName;
|
||||
streamName << 'z' << Z << ".a" << A;
|
||||
G4String name(streamName.str());
|
||||
return name;
|
||||
}
|
||||
|
||||
G4NuclearLevelManager*
|
||||
G4NuclearLevelStore::GetManager(G4int Z, G4int A)
|
||||
{
|
||||
G4NuclearLevelManager * result = 0;
|
||||
if (A < 1 || Z < 1 || A < Z)
|
||||
{
|
||||
//G4cout << "G4NuclearLevelStore::GetManager: Wrong values Z = " << Z
|
||||
// << " A = " << A << '\n';
|
||||
return result;
|
||||
}
|
||||
|
||||
// Generate the key = filename
|
||||
G4int key = Z*1000+A; //GenerateKey(Z,A);
|
||||
|
||||
// Check if already exists that key
|
||||
ManagersMap::iterator idx = theManagers.find(key);
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
// If doesn't exists then check the master
|
||||
if ( idx == theManagers.end() )
|
||||
{
|
||||
G4MUTEXLOCK(&G4NuclearLevelStore::nuclearLevelStoreMutex);
|
||||
ManagersMap::iterator idxS = theShadowInstance->theManagers.find(key);
|
||||
if ( idxS == theShadowInstance->theManagers.end() )
|
||||
{
|
||||
// If doesn't exists then create it
|
||||
G4String file = dirName + GenerateFileName(Z,A);
|
||||
|
||||
//Check if data have been provided by the user
|
||||
if(userFiles) {
|
||||
G4String file1 = theUserDataFiles[key];//1000*A+Z];
|
||||
if (file1 != "") { file = file1; }
|
||||
}
|
||||
result = new G4NuclearLevelManager(Z,A,file);
|
||||
theShadowInstance->theManagers.insert(std::make_pair(key,result));
|
||||
}
|
||||
else
|
||||
{
|
||||
// if it exists in the master
|
||||
result = idxS->second;
|
||||
}
|
||||
// register to the local map
|
||||
theManagers.insert(std::make_pair(key,result));
|
||||
G4MUTEXUNLOCK(&G4NuclearLevelStore::nuclearLevelStoreMutex);
|
||||
}
|
||||
#else
|
||||
// If doesn't exists then create it
|
||||
if ( idx == theManagers.end() )
|
||||
{
|
||||
G4String file = dirName + GenerateFileName(Z,A);
|
||||
|
||||
//Check if data have been provided by the user
|
||||
if(userFiles) {
|
||||
G4String file1 = theUserDataFiles[key];//1000*A+Z];
|
||||
if (file1 != "") { file = file1; }
|
||||
}
|
||||
result = new G4NuclearLevelManager(Z,A,file);
|
||||
theManagers.insert(std::make_pair(key,result));
|
||||
}
|
||||
#endif
|
||||
else
|
||||
// But if it exists...
|
||||
{
|
||||
result = idx->second;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
-248
@@ -1,248 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PhotonEvaporationOLD.cc 91873 2015-08-07 17:50:24Z vnivanch $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4PhotonEvaporationOLD
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
|
||||
//
|
||||
// Implementation of Internal Convertion process in discrete deexcitation
|
||||
// The following public methods have been added.
|
||||
//
|
||||
// void SetICM (G4bool);
|
||||
// void CallFromRDM(G4bool);
|
||||
// void SetMaxHalfLife(G4double) ;
|
||||
// void SetEOccupancy( G4ElectronOccupancy eOccupancy) ;
|
||||
// G4ElectronOccupancy GetEOccupancy () ;
|
||||
//
|
||||
// 11 May 2010, V.Ivanchenko add implementation of EmittedFragment and
|
||||
// BreakUpFragment methods; cleanup logic
|
||||
//
|
||||
// 22 October 2015, V.Ivanchenko renamed to G4PhotonEvaporationOLD
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#include "G4PhotonEvaporationOLD.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
#include "G4VGammaTransition.hh"
|
||||
#include "G4Fragment.hh"
|
||||
#include "G4FragmentVector.hh"
|
||||
#include "G4ContinuumGammaDeexcitation.hh"
|
||||
#include "G4DiscreteGammaDeexcitation.hh"
|
||||
#include "G4E1Probability.hh"
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
|
||||
static const G4double tolerance = 0.1*CLHEP::keV;
|
||||
|
||||
G4PhotonEvaporationOLD::G4PhotonEvaporationOLD(const G4String & aName)
|
||||
: G4VEvaporationChannel(aName),
|
||||
verbose(0), myOwnProbAlgorithm(true),
|
||||
eOccupancy(0), vShellNumber(-1), gammaE(0.)
|
||||
{
|
||||
G4Exception ("G4PhotonEvaporationOLD: ", "had001", JustWarning,
|
||||
"This class is obsolete and will be removed for the next public release");
|
||||
|
||||
probAlgorithm = new G4E1Probability;
|
||||
contDeexcitation = new G4ContinuumGammaDeexcitation;
|
||||
G4DiscreteGammaDeexcitation* p = new G4DiscreteGammaDeexcitation();
|
||||
discrDeexcitation = p;
|
||||
|
||||
p->SetICM(false);
|
||||
|
||||
// Time limits
|
||||
G4double timeLimit = DBL_MAX;
|
||||
char* env = getenv("G4AddTimeLimitToPhotonEvaporation");
|
||||
if(env) { timeLimit = 1.e-16*second; }
|
||||
|
||||
// Time for short-cut simulation of photon evaporationOLD
|
||||
p->SetTimeLimit(timeLimit);
|
||||
|
||||
// Default time limit for isomere production
|
||||
SetMaxHalfLife(DBL_MAX);
|
||||
// SetMaxHalfLife(1.e-6*second);
|
||||
|
||||
nucleus = 0;
|
||||
}
|
||||
|
||||
G4PhotonEvaporationOLD::~G4PhotonEvaporationOLD()
|
||||
{
|
||||
if(myOwnProbAlgorithm) delete probAlgorithm;
|
||||
delete discrDeexcitation;
|
||||
delete contDeexcitation;
|
||||
}
|
||||
|
||||
G4Fragment* G4PhotonEvaporationOLD::EmittedFragment(G4Fragment* aNucleus)
|
||||
{
|
||||
//G4cout << "G4PhotonEvaporationOLD::EmittedFragment" << G4endl;
|
||||
vShellNumber = -1;
|
||||
G4Fragment* gamma = 0;
|
||||
if(contDeexcitation->CanDoTransition(aNucleus)) {
|
||||
gamma = contDeexcitation->GenerateGamma(aNucleus);
|
||||
if(gamma && verbose > 1) {
|
||||
G4cout << "G4PhotonEvaporationOLD::EmittedFragment continium deex: "
|
||||
<< gamma << G4endl;
|
||||
G4cout << " Residual: " << aNucleus << G4endl;
|
||||
}
|
||||
} else if(discrDeexcitation->CanDoTransition(aNucleus)) {
|
||||
|
||||
// Do one photon emission by the discrete deexcitation
|
||||
gamma = discrDeexcitation->GenerateGamma(aNucleus);
|
||||
if(gamma) {
|
||||
vShellNumber = discrDeexcitation->GetVacantSN();
|
||||
if (verbose > 1) {
|
||||
G4cout << "G4PhotonEvaporationOLD::EmittedFragment discrete deex: "
|
||||
<< gamma << G4endl;
|
||||
G4cout << " Residual: " << aNucleus << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
return gamma;
|
||||
}
|
||||
|
||||
G4bool G4PhotonEvaporationOLD::BreakUpChain(G4FragmentVector* products,
|
||||
G4Fragment* aNucleus)
|
||||
{
|
||||
//G4cout << "G4PhotonEvaporationOLD::BreakUpChain" << G4endl;
|
||||
G4Fragment* gamma = 0;
|
||||
// one continues emission is not excluded
|
||||
if(contDeexcitation->CanDoTransition(aNucleus)) {
|
||||
gamma = contDeexcitation->GenerateGamma(aNucleus);
|
||||
if(gamma) {
|
||||
if (verbose > 1) {
|
||||
G4cout << "G4PhotonEvaporationOLD::EmittedFragment continium deex: "
|
||||
<< gamma << G4endl;
|
||||
G4cout << " Residual: " << aNucleus << G4endl;
|
||||
}
|
||||
products->push_back(gamma);
|
||||
}
|
||||
}
|
||||
// main emissions are discrete
|
||||
discrDeexcitation->DoChain(products, aNucleus);
|
||||
return false;
|
||||
}
|
||||
|
||||
G4FragmentVector* G4PhotonEvaporationOLD::BreakUpFragment(G4Fragment* aNucleus)
|
||||
{
|
||||
//G4cout << "G4PhotonEvaporationOLD::BreakUpFragment" << G4endl;
|
||||
G4FragmentVector* products = new G4FragmentVector();
|
||||
BreakUpChain(products, aNucleus);
|
||||
return products;
|
||||
}
|
||||
|
||||
G4FragmentVector* G4PhotonEvaporationOLD::BreakUp(const G4Fragment& theNucleus)
|
||||
{
|
||||
//G4cout << "G4PhotonEvaporationOLD::BreakUp" << G4endl;
|
||||
G4Fragment* aNucleus = new G4Fragment(theNucleus);
|
||||
G4FragmentVector* products = new G4FragmentVector();
|
||||
//discrDeexcitation->DoChain(products, aNucleus);
|
||||
BreakUpChain(products, aNucleus);
|
||||
products->push_back(aNucleus);
|
||||
return products;
|
||||
}
|
||||
|
||||
G4FragmentVector* G4PhotonEvaporationOLD::BreakItUp(const G4Fragment& theNucleus)
|
||||
{
|
||||
//G4cout << "G4PhotonEvaporationOLD::BreakItUp" << G4endl;
|
||||
G4Fragment* aNucleus = new G4Fragment(theNucleus);
|
||||
G4FragmentVector* products = new G4FragmentVector();
|
||||
BreakUpChain(products, aNucleus);
|
||||
products->push_back(aNucleus);
|
||||
return products;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4PhotonEvaporationOLD::GetEmissionProbability(G4Fragment* theNucleus)
|
||||
{
|
||||
G4double prob = 0.0;
|
||||
G4int Z = theNucleus->GetZ_asInt();
|
||||
G4int A = theNucleus->GetA_asInt();
|
||||
G4double eexc = theNucleus->GetExcitationEnergy();
|
||||
if(0 < Z && Z < A && eexc > tolerance) {
|
||||
prob = probAlgorithm->EmissionProbability(*theNucleus, eexc);
|
||||
}
|
||||
return prob;
|
||||
}
|
||||
|
||||
void
|
||||
G4PhotonEvaporationOLD::SetEmissionStrategy(G4VEmissionProbability * alg)
|
||||
{
|
||||
if(myOwnProbAlgorithm) { delete probAlgorithm; }
|
||||
probAlgorithm = alg;
|
||||
myOwnProbAlgorithm = false;
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::SetVerboseLevel(G4int verb)
|
||||
{
|
||||
verbose = verb;
|
||||
contDeexcitation->SetVerboseLevel(verbose);
|
||||
discrDeexcitation->SetVerboseLevel(verbose);
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::SetICM(G4bool ic)
|
||||
{
|
||||
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetICM(ic);
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::SetMaxHalfLife(G4double hl)
|
||||
{
|
||||
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetHL(hl);
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::SetTimeLimit(G4double val)
|
||||
{
|
||||
discrDeexcitation->SetTimeLimit(val);
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::RDMForced(G4bool fromRDM)
|
||||
{
|
||||
static_cast<G4DiscreteGammaDeexcitation*>(discrDeexcitation)->SetRDM(fromRDM);
|
||||
}
|
||||
|
||||
void G4PhotonEvaporationOLD::SetEOccupancy(G4ElectronOccupancy eo)
|
||||
{
|
||||
discrDeexcitation->SetEO(eo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-214
@@ -1,214 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4VGammaDeexcitation.cc 94676 2015-12-02 09:51:20Z gunter $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
//
|
||||
// CERN, Geneva, Switzerland
|
||||
//
|
||||
// File name: G4VGammaDeexcitation
|
||||
//
|
||||
// Author: Maria Grazia Pia (pia@genova.infn.it)
|
||||
//
|
||||
// Creation date: 23 October 1998
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
|
||||
// Modified GenerateGamma() and UpdateUncleus() for implementation
|
||||
// of Internal Conversion processs
|
||||
//
|
||||
// 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
|
||||
// Added creation time evaluation for products of evaporation
|
||||
//
|
||||
// 19 April 2010, J. M. Quesada calculations in CM system
|
||||
// pending final boost to lab system (not critical)
|
||||
//
|
||||
// 23 April 2010, V.Ivanchenko rewite kinematic part using PDG formula
|
||||
// for 2-body decay
|
||||
//
|
||||
// 07 May 2011, V.Ivanchenko implement check ICM flag - produce or not e-
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4VGammaDeexcitation.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
#include "G4VGammaTransition.hh"
|
||||
#include "G4Fragment.hh"
|
||||
#include "G4FragmentVector.hh"
|
||||
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4IonTable.hh"
|
||||
|
||||
#include "G4DiscreteGammaTransition.hh"
|
||||
|
||||
|
||||
G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
|
||||
_electronO (0), _vSN(-1)
|
||||
{
|
||||
_tolerance = 0.1*CLHEP::keV;
|
||||
_timeLimit = DBL_MAX;
|
||||
}
|
||||
|
||||
G4VGammaDeexcitation::~G4VGammaDeexcitation()
|
||||
{
|
||||
delete _transition;
|
||||
}
|
||||
|
||||
void G4VGammaDeexcitation::DoChain(G4FragmentVector* products,
|
||||
G4Fragment* nucleus)
|
||||
{
|
||||
if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
|
||||
|
||||
if(CanDoTransition(nucleus)) {
|
||||
for(size_t i=0; i<100; ++i) {
|
||||
_transition->SetEnergyFrom(nucleus->GetExcitationEnergy());
|
||||
G4Fragment* gamma = GenerateGamma(nucleus);
|
||||
if (gamma) { products->push_back(gamma); }
|
||||
else { break; }
|
||||
//G4cout << i << ". Egamma(MeV)= " << gamma->GetMomentum().e()
|
||||
// << "; new Eex(MeV)= " << nucleus->GetExcitationEnergy()
|
||||
// << G4endl;
|
||||
if(nucleus->GetExcitationEnergy() <= _tolerance) { break; }
|
||||
}
|
||||
}
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4VGammaDeexcitation::DoChain - end" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
G4Fragment* G4VGammaDeexcitation::GenerateGamma(G4Fragment* aNucleus)
|
||||
{
|
||||
G4Fragment * thePhoton = 0;
|
||||
_vSN = -1;
|
||||
|
||||
_transition->SelectGamma(); // it can be conversion electron too
|
||||
|
||||
G4double etrans = _transition->GetGammaEnergy();
|
||||
|
||||
//L.Desorgher 05/01/2015 need to add the bond energy for correct
|
||||
// computation of a transition in case of ICM
|
||||
G4DiscreteGammaTransition* dtransition =
|
||||
dynamic_cast <G4DiscreteGammaTransition*> (_transition);
|
||||
G4double bond_energy=0.;
|
||||
|
||||
if (dtransition && !dtransition->IsAGamma()) {
|
||||
bond_energy = dtransition->GetBondEnergy();
|
||||
}
|
||||
etrans += bond_energy;
|
||||
//G4cout << "G4VGammaDeexcitation::GenerateGamma - Etrans(MeV)= "
|
||||
// << etrans << G4endl;
|
||||
if(etrans <= 0.0) { return thePhoton; }
|
||||
|
||||
// final excitation
|
||||
G4double excitation = aNucleus->GetExcitationEnergy() - etrans;
|
||||
if(excitation <= _tolerance) { excitation = 0.0; }
|
||||
|
||||
G4double gammaTime = _transition->GetGammaCreationTime();
|
||||
if (_verbose > 1) {
|
||||
G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= "
|
||||
<< etrans << "; Time(ns)= " << gammaTime/CLHEP::ns
|
||||
<< "; left Eexc(MeV)= " << excitation << G4endl;
|
||||
}
|
||||
|
||||
// Do complete Lorentz computation
|
||||
G4LorentzVector lv = aNucleus->GetMomentum();
|
||||
G4double Mass = aNucleus->GetGroundStateMass() + excitation;
|
||||
|
||||
// select secondary
|
||||
G4ParticleDefinition* gamma = G4Gamma::Gamma();
|
||||
|
||||
if (dtransition && !dtransition->IsAGamma() ) {
|
||||
gamma = G4Electron::Electron();
|
||||
_vSN = dtransition->GetOrbitNumber();
|
||||
_electronO.RemoveElectron(_vSN);
|
||||
//L. Desorgher 05/01/2015 need to remove atomic bond energy
|
||||
// of the IC electron
|
||||
lv += G4LorentzVector(0.0,0.0,0.0,
|
||||
CLHEP::electron_mass_c2 - bond_energy);
|
||||
}
|
||||
|
||||
G4double cosTheta = 1. - 2. * G4UniformRand();
|
||||
G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
|
||||
G4double phi = twopi * G4UniformRand();
|
||||
|
||||
G4double eMass = gamma->GetPDGMass();
|
||||
G4LorentzVector Gamma4P;
|
||||
/*
|
||||
G4cout << " Mass= " << eMass << " t= " << gammaTime
|
||||
<< " tlim= " << _timeLimit << G4endl;
|
||||
*/
|
||||
// 2-body decay in rest frame
|
||||
G4double Ecm = lv.mag();
|
||||
G4ThreeVector bst = lv.boostVector();
|
||||
|
||||
G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
|
||||
if(GammaEnergy < eMass) { GammaEnergy = eMass; }
|
||||
|
||||
G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
|
||||
Gamma4P.set(mom * sinTheta * std::cos(phi),
|
||||
mom * sinTheta * std::sin(phi),
|
||||
mom * cosTheta, GammaEnergy);
|
||||
|
||||
// Lab system in normal case (_timeLimit = DBL_MAX)
|
||||
if(gammaTime <= _timeLimit) {
|
||||
Gamma4P.boost(bst);
|
||||
lv -= Gamma4P;
|
||||
} else {
|
||||
// In exceptional case sample decay at rest at not correct position
|
||||
// of stopping ion, 4-momentum balance is breaked but gamma energy
|
||||
// is correct
|
||||
lv -= Gamma4P;
|
||||
G4double E = lv.e();
|
||||
G4double P2= (E - Mass)*(E + Mass);
|
||||
G4ThreeVector v = lv.vect().unit();
|
||||
G4double p = 0.0;
|
||||
if(P2 > 0.0) { p = std::sqrt(P2); }
|
||||
else { E = Mass; }
|
||||
lv.set(v.x()*p, v.y()*p, v.z()*p, E);
|
||||
}
|
||||
|
||||
// modified primary fragment
|
||||
gammaTime += aNucleus->GetCreationTime();
|
||||
aNucleus->SetMomentum(lv);
|
||||
aNucleus->SetCreationTime(gammaTime);
|
||||
|
||||
// gamma or e- are produced
|
||||
thePhoton = new G4Fragment(Gamma4P,gamma);
|
||||
thePhoton->SetCreationTime(gammaTime);
|
||||
|
||||
//G4cout << "G4VGammaDeexcitation::GenerateGamma : " << thePhoton << G4endl;
|
||||
//G4cout << " Left nucleus: " << aNucleus << G4endl;
|
||||
return thePhoton;
|
||||
}
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4PomeronCrossSection_h
|
||||
#define G4PomeronCrossSection_h 1
|
||||
//
|
||||
// $Id: G4PomeronCrossSection.hh 96952 2016-05-18 12:21:34Z gcosmo $
|
||||
//
|
||||
#include "G4Proton.hh"
|
||||
#include "G4Neutron.hh"
|
||||
|
||||
#include "G4PionPlus.hh"
|
||||
#include "G4PionMinus.hh"
|
||||
#include "G4PionZero.hh"
|
||||
|
||||
#include "G4KaonPlus.hh"
|
||||
#include "G4KaonMinus.hh"
|
||||
#include "G4KaonZero.hh"
|
||||
#include "G4KaonZeroShort.hh"
|
||||
#include "G4KaonZeroLong.hh"
|
||||
#include "G4Gamma.hh"
|
||||
|
||||
class G4PomeronCrossSection
|
||||
{
|
||||
|
||||
public:
|
||||
G4PomeronCrossSection(const G4ParticleDefinition * );
|
||||
G4PomeronCrossSection(const G4Proton * );
|
||||
G4PomeronCrossSection(const G4Neutron * );
|
||||
|
||||
G4PomeronCrossSection(const G4PionPlus * );
|
||||
G4PomeronCrossSection(const G4PionMinus * );
|
||||
G4PomeronCrossSection(const G4PionZero * );
|
||||
|
||||
G4PomeronCrossSection(const G4KaonPlus * );
|
||||
G4PomeronCrossSection(const G4KaonMinus * );
|
||||
G4PomeronCrossSection(const G4KaonZero * );
|
||||
G4PomeronCrossSection(const G4KaonZeroLong * );
|
||||
G4PomeronCrossSection(const G4KaonZeroShort * );
|
||||
|
||||
G4PomeronCrossSection(const G4Gamma * );
|
||||
|
||||
~G4PomeronCrossSection();
|
||||
// s = (center of mass energy)**2
|
||||
G4double GetTotalCrossSection(const G4double s);
|
||||
G4double GetDiffractiveCrossSection(const G4double s);
|
||||
G4double GetElasticCrossSection(const G4double s);
|
||||
G4double GetInelasticCrossSection(const G4double s);
|
||||
|
||||
G4double GetTotalProbability(const G4double s,
|
||||
const G4double impactsquare);
|
||||
G4double GetDiffractiveProbability(const G4double s,
|
||||
const G4double impactsquare);
|
||||
G4double GetNondiffractiveProbability(const G4double s,
|
||||
const G4double impactsquare);
|
||||
G4double GetElasticProbability(const G4double s,
|
||||
const G4double impactsquare);
|
||||
|
||||
G4double GetInelasticProbability(const G4double s,
|
||||
const G4double impactsquare);
|
||||
|
||||
G4double GetCutPomeronProbability(const G4double s,
|
||||
const G4double impactsquare, const G4int nPomerons);
|
||||
|
||||
void Setgamma(const G4double agam); // temporary only! GF.
|
||||
G4double SoftEikonal(G4double s, G4double impactsquare);
|
||||
G4double HardEikonal(G4double s, G4double impactsquare);
|
||||
|
||||
void Pomeron_S(G4double apomeron_S){ pomeron_S = apomeron_S;}
|
||||
void Pomeron_Gamma(G4double apomeron_Gamma){ pomeron_Gamma = apomeron_Gamma;}
|
||||
void Pomeron_C(G4double apomeron_C){ pomeron_C = apomeron_C;}
|
||||
void Pomeron_Rsquare(G4double apomeron_Rsquare){ pomeron_Rsquare = apomeron_Rsquare;}
|
||||
void Pomeron_Alpha(G4double apomeron_Alpha){ pomeron_Alpha = apomeron_Alpha;}
|
||||
void Pomeron_Alphaprime(G4double apomeron_Alphaprime){ pomeron_Alphaprime = apomeron_Alphaprime;}
|
||||
void Pomeron_Gamma_Hard(G4double apomeron_Gamma_Hard){ pomeron_Gamma_Hard = apomeron_Gamma_Hard;}
|
||||
void Pomeron_Alpha_Hard(G4double apomeron_Alpha_Hard){ pomeron_Alpha_Hard = apomeron_Alpha_Hard;}
|
||||
|
||||
private:
|
||||
G4double PowerSoft(const G4double s);
|
||||
G4double PowerHard(const G4double s);
|
||||
G4double LambdaSoft(const G4double s);
|
||||
G4double LambdaHard(const G4double s);
|
||||
G4double Zsoft(const G4double s);
|
||||
G4double Zhard(const G4double s);
|
||||
|
||||
G4PomeronCrossSection();
|
||||
void InitForNucleon();
|
||||
void InitForPion();
|
||||
void InitForKaon();
|
||||
void InitForGamma();
|
||||
|
||||
G4double Expand(G4double z);
|
||||
inline G4double Z(const G4double Scms);
|
||||
inline G4double SigP(const G4double Scms);
|
||||
inline G4double Power(const G4double Scms);
|
||||
inline G4double Lambda(const G4double s);
|
||||
inline G4double Eikonal(const G4double s,const G4double impactsquare);
|
||||
|
||||
G4double pomeron_Alpha;
|
||||
G4double pomeron_Alpha_Hard;
|
||||
G4double pomeron_Alphaprime;
|
||||
G4double pomeron_C;
|
||||
G4double pomeron_Gamma;
|
||||
G4double pomeron_Gamma_Hard;
|
||||
G4double pomeron_Rsquare;
|
||||
G4double pomeron_S;
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
@@ -1,321 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PomeronCrossSection.cc 96952 2016-05-18 12:21:34Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4PomeronCrossSection.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Log.hh"
|
||||
|
||||
|
||||
G4PomeronCrossSection::G4PomeronCrossSection() :
|
||||
pomeron_Alpha(0), pomeron_Alpha_Hard(0), pomeron_Alphaprime(0),
|
||||
pomeron_C(0), pomeron_Gamma(0), pomeron_Gamma_Hard(0),
|
||||
pomeron_Rsquare(0), pomeron_S(0)
|
||||
{}
|
||||
|
||||
|
||||
G4PomeronCrossSection::~G4PomeronCrossSection()
|
||||
{;}
|
||||
//**********************************************************************************************
|
||||
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4ParticleDefinition * particle)
|
||||
{
|
||||
G4int Encoding = std::abs(particle->GetPDGEncoding());
|
||||
|
||||
if (std::abs(particle->GetBaryonNumber())!=0)
|
||||
InitForNucleon();
|
||||
else if (Encoding/100== 3 || Encoding/10 == 3)
|
||||
InitForKaon();
|
||||
else
|
||||
InitForPion();
|
||||
}
|
||||
|
||||
//**********************************************************************************************
|
||||
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4Proton * )
|
||||
{
|
||||
InitForNucleon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4Neutron * )
|
||||
{
|
||||
InitForNucleon();
|
||||
}
|
||||
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4PionPlus * )
|
||||
{
|
||||
InitForPion();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4PionMinus * )
|
||||
{
|
||||
InitForPion();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4PionZero * )
|
||||
{
|
||||
InitForPion();
|
||||
}
|
||||
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4KaonPlus * )
|
||||
{
|
||||
InitForKaon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4KaonMinus * )
|
||||
{
|
||||
InitForKaon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4KaonZero * )
|
||||
{
|
||||
InitForKaon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4KaonZeroLong * )
|
||||
{
|
||||
InitForKaon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4KaonZeroShort * )
|
||||
{
|
||||
InitForKaon();
|
||||
}
|
||||
G4PomeronCrossSection::G4PomeronCrossSection(const G4Gamma * )
|
||||
{
|
||||
InitForGamma();
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetTotalCrossSection(const G4double S)
|
||||
{
|
||||
G4double FZ2= Expand(Z(S)/2);
|
||||
return SigP(S) * FZ2;
|
||||
}
|
||||
|
||||
|
||||
G4double G4PomeronCrossSection::GetElasticCrossSection(const G4double S)
|
||||
{
|
||||
return SigP(S)/pomeron_C *(Expand(Z(S)/2) - Expand(Z(S)));
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetDiffractiveCrossSection(const G4double S)
|
||||
{
|
||||
return ( pomeron_C -1) * GetElasticCrossSection(S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetInelasticCrossSection(const G4double S)
|
||||
{
|
||||
return GetTotalCrossSection(S) - GetElasticCrossSection(S);
|
||||
}
|
||||
|
||||
//-------------------------Probabilities ----------------------------
|
||||
|
||||
G4double G4PomeronCrossSection::GetTotalProbability(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return 2/pomeron_C*(1-G4Exp(-1*Eikonal(S,impactsquare)));
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetDiffractiveProbability(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return (pomeron_C-1)/pomeron_C *
|
||||
(GetTotalProbability(S,impactsquare) -
|
||||
GetNondiffractiveProbability(S,impactsquare));
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetNondiffractiveProbability(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return (1-G4Exp(-2*Eikonal(S,impactsquare)))/pomeron_C;
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetElasticProbability(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return (GetTotalProbability(S,impactsquare) -
|
||||
GetInelasticProbability(S,impactsquare));
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetInelasticProbability(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return GetNondiffractiveProbability(S,impactsquare) +
|
||||
GetDiffractiveProbability(S,impactsquare);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::GetCutPomeronProbability(const G4double S,
|
||||
const G4double impactsquare, const G4int nPomerons)
|
||||
{
|
||||
G4double factorial=G4Pow::GetInstance()->factorial(nPomerons);
|
||||
|
||||
return G4Exp(-2*Eikonal(S,impactsquare))/pomeron_C*
|
||||
G4Pow::GetInstance()->powN(2*Eikonal(S,impactsquare),nPomerons)/factorial;
|
||||
}
|
||||
|
||||
// ---------------Temporary --- GF
|
||||
void G4PomeronCrossSection::Setgamma(const G4double agam)
|
||||
{
|
||||
pomeron_Gamma=agam/GeV/GeV;
|
||||
}
|
||||
|
||||
|
||||
//----------------- private/Implementation methods
|
||||
|
||||
void G4PomeronCrossSection::InitForNucleon()
|
||||
{
|
||||
// pomeron_S= 3.0*GeV*GeV;
|
||||
pomeron_S= 2.7*GeV*GeV;
|
||||
// pomeron_Gamma= 2.16/GeV/GeV;
|
||||
// pomeron_Gamma= 3.96/GeV/GeV;
|
||||
pomeron_Gamma= (2.6+3.96)/GeV/GeV;
|
||||
pomeron_C= 1.4;
|
||||
pomeron_Rsquare= 3.56/GeV/GeV;
|
||||
// pomeron_Alpha= 1.0808;
|
||||
pomeron_Alpha= 0.9808;
|
||||
pomeron_Alphaprime= 0.25/GeV/GeV;
|
||||
pomeron_Gamma_Hard = 0.0002/GeV/GeV; // Note! if pomeron_Gamma_Hard != 0 to fit total pp-crosscection
|
||||
// pomeron_Gamma_Soft shold be 2.35/GeV/GeV
|
||||
pomeron_Alpha_Hard = 1.47;
|
||||
}
|
||||
|
||||
void G4PomeronCrossSection::InitForPion()
|
||||
{
|
||||
pomeron_S= 1.5*GeV*GeV;
|
||||
// pomeron_Gamma= 1.46/GeV/GeV;
|
||||
pomeron_Gamma= 2.17/GeV/GeV;
|
||||
pomeron_C= 1.6;
|
||||
pomeron_Rsquare= 2.36/GeV/GeV;
|
||||
pomeron_Alpha= 1.0808;
|
||||
pomeron_Alphaprime= 0.25/GeV/GeV;
|
||||
pomeron_Gamma_Hard = 0.0002/GeV/GeV;
|
||||
pomeron_Alpha_Hard = 1.47;
|
||||
}
|
||||
|
||||
void G4PomeronCrossSection::InitForKaon()
|
||||
{
|
||||
pomeron_S= 2.3*GeV*GeV;
|
||||
// pomeron_Gamma= 1.31/GeV/GeV;
|
||||
pomeron_Gamma= 1.92/GeV/GeV;
|
||||
pomeron_C= 1.8;
|
||||
pomeron_Rsquare= 1.96/GeV/GeV;
|
||||
pomeron_Alpha= 1.0808;
|
||||
pomeron_Alphaprime= 0.25/GeV/GeV;
|
||||
pomeron_Gamma_Hard = 0.0002/GeV/GeV;
|
||||
pomeron_Alpha_Hard = 1.47;
|
||||
}
|
||||
|
||||
void G4PomeronCrossSection::InitForGamma()
|
||||
{
|
||||
pomeron_S= 1.7*GeV*GeV;
|
||||
// pomeron_Gamma= 1.42/GeV/GeV;
|
||||
pomeron_Gamma= 2.07/GeV/GeV;
|
||||
pomeron_C= 1.7;
|
||||
pomeron_Rsquare= 2.16/GeV/GeV;
|
||||
pomeron_Alpha= 1.0808;
|
||||
pomeron_Alphaprime= 0.25/GeV/GeV;
|
||||
pomeron_Gamma_Hard = 0.0002/GeV/GeV;
|
||||
pomeron_Alpha_Hard = 1.47;
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Expand(G4double z)
|
||||
{
|
||||
|
||||
G4double sum=1.;
|
||||
G4double current=1.;
|
||||
for (G4int j=2; j<21; j++ )
|
||||
{
|
||||
current *= -z *(j-1)/sqr(j);
|
||||
sum+=current;
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Power(const G4double S)
|
||||
{
|
||||
return pomeron_Gamma * G4Pow::GetInstance()->powA(S/pomeron_S, pomeron_Alpha -1);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Z(const G4double S)
|
||||
{
|
||||
return 2*pomeron_C * Power(S) / Lambda(S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Lambda(const G4double S)
|
||||
{
|
||||
return pomeron_Rsquare+pomeron_Alphaprime*G4Log(S/pomeron_S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::SigP(const G4double S)
|
||||
{
|
||||
return 8 * pi * hbarc_squared * Power(S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Eikonal(const G4double S,
|
||||
const G4double impactsquare)
|
||||
{
|
||||
return Z(S)/2 * G4Exp(-impactsquare/(4*Lambda(S)*hbarc_squared));
|
||||
}
|
||||
//*************************************************************************************************
|
||||
G4double G4PomeronCrossSection::PowerSoft(const G4double S)
|
||||
{
|
||||
return pomeron_Gamma * G4Pow::GetInstance()->powA(S/pomeron_S, pomeron_Alpha -1);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::PowerHard(const G4double S)
|
||||
{
|
||||
return pomeron_Gamma_Hard*G4Pow::GetInstance()->powA(S/pomeron_S, pomeron_Alpha_Hard -1);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::LambdaSoft(const G4double S)
|
||||
{
|
||||
return pomeron_Rsquare+pomeron_Alphaprime*G4Log(S/pomeron_S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::LambdaHard(const G4double /*S*/)
|
||||
{
|
||||
return pomeron_Rsquare; //+pomeron_Alphaprime*G4Log(s/pomeron_S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Zsoft(const G4double S)
|
||||
{
|
||||
return 2*pomeron_C*PowerHard(S) / LambdaSoft(S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::Zhard(const G4double S)
|
||||
{
|
||||
return 2*pomeron_C*PowerHard(S)/LambdaHard(S);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::SoftEikonal(G4double S, G4double impactsquare)
|
||||
{
|
||||
return Zsoft(S)/2*G4Exp(-impactsquare/LambdaSoft(S)/hbarc_squared/4);
|
||||
}
|
||||
|
||||
G4double G4PomeronCrossSection::HardEikonal(G4double S, G4double impactsquare)
|
||||
{
|
||||
return Zhard(S)/2*G4Exp(-impactsquare/LambdaHard(S)/hbarc_squared/4);
|
||||
}
|
||||
|
||||
//*************************************************************************************************
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4PreCompoundFragmentVector.icc 68028 2013-03-13 13:48:15Z gcosmo $
|
||||
//
|
||||
// Hadronic Process: Nuclear Preequilibrium
|
||||
// by V. Lara
|
||||
//
|
||||
// Modif (03 September 2008) by J. M. Quesada for external choice of inverse
|
||||
// cross section option
|
||||
// JMQ (06 September 2008) Also external choice has been added for:
|
||||
// - superimposed Coulomb barrier (if useSICB=true)
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4AlphaDecayChannel_h
|
||||
#define G4AlphaDecayChannel_h 1
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4AlphaDecayChannel.hh
|
||||
//
|
||||
// Version: 0.b.3
|
||||
// Date: 29/02/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4AlphaDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Alpha decay proceess.
|
||||
//
|
||||
// class description - end
|
||||
public:
|
||||
G4AlphaDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theEndPointEnergy=0.0,
|
||||
G4double theDaughterExcitation=0.0) :
|
||||
G4NuclearDecayChannel (Alpha, Verbose, theParentNucleus, theBR,
|
||||
theEndPointEnergy,
|
||||
(theParentNucleus->GetBaryonNumber())-4,
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-2,
|
||||
theDaughterExcitation, "alpha")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout <<"G4AlphaDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4AlphaDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4BetaMinusDecayChannel_h
|
||||
#define G4BetaMinusDecayChannel_h 1
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4BetaMinusDecayChannel.hh
|
||||
//
|
||||
// Version: 0.b.3
|
||||
// Date: 29/02/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4BetaMinusDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Beta- decay proceess.
|
||||
//
|
||||
// class description - end
|
||||
public:
|
||||
G4BetaMinusDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theEndPointEnergy=0.0,
|
||||
G4double theDaughterExcitation=0.0,
|
||||
G4double theFFN=1.0,
|
||||
G4bool theBetaSimple = false,
|
||||
G4RandGeneral* theRandEnergy = 0):
|
||||
G4NuclearDecayChannel (BetaMinus, Verbose, theParentNucleus, theBR,
|
||||
theFFN,
|
||||
theBetaSimple,
|
||||
theRandEnergy,
|
||||
theEndPointEnergy,
|
||||
theParentNucleus->GetBaryonNumber(),
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)+1,
|
||||
theDaughterExcitation, "e-", "anti_nu_e")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout <<"G4BetaMinusDecayChannel constructor" <<G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4BetaMinusDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4BetaPlusDecayChannel_h
|
||||
#define G4BetaPlusDecayChannel_h 1
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4BetaPlusDecayChannel.hh
|
||||
//
|
||||
// Version: 0.b.3
|
||||
// Date: 29/02/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4BetaPlusDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Beta+ decay proceess.
|
||||
//
|
||||
// class description - end
|
||||
//
|
||||
//
|
||||
public:
|
||||
G4BetaPlusDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theEndPointEnergy=0.0,
|
||||
G4double theDaughterExcitation=0.0,
|
||||
G4double theFFN=0.0,
|
||||
G4bool theBetaSimple = false,
|
||||
G4RandGeneral* theRandEnergy = 0) :
|
||||
G4NuclearDecayChannel (BetaPlus,
|
||||
Verbose,
|
||||
theParentNucleus,
|
||||
theBR,
|
||||
theFFN,
|
||||
theBetaSimple,
|
||||
theRandEnergy,
|
||||
theEndPointEnergy,
|
||||
theParentNucleus->GetBaryonNumber(),
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-1,
|
||||
theDaughterExcitation, "e+", "nu_e")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout <<"G4BetaPlusDecayChannel constructor" <<G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4BetaPlusDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4ITDecayChannel_h
|
||||
#define G4ITDecayChannel_h 1
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
|
||||
class G4ITDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Specific decay channel for isomeric transitions
|
||||
//
|
||||
// class description - end
|
||||
|
||||
public:
|
||||
G4ITDecayChannel(G4int Verbose, const G4Ions* theParentNucleus,
|
||||
G4double theBR)
|
||||
: G4NuclearDecayChannel(IT, Verbose, theParentNucleus, theBR, 0.0,
|
||||
theParentNucleus->GetBaryonNumber(),
|
||||
G4int(theParentNucleus->GetPDGCharge()/CLHEP::eplus),
|
||||
theParentNucleus->GetExcitationEnergy())
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1)
|
||||
G4cout << "G4ITDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4ITDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4KshellECDecayChannel_h
|
||||
#define G4KshellECDecayChannel_h 1
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4KshellECDecayChannel.hh
|
||||
//
|
||||
// Version: 0.b.3
|
||||
// Date: 29/02/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4KshellECDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Electron Capture proceess with electron from the K shell
|
||||
//
|
||||
// class description - end
|
||||
|
||||
public:
|
||||
G4KshellECDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theQtransit=0.0,
|
||||
G4double theDaughterExcitation=0.0) :
|
||||
G4NuclearDecayChannel (KshellEC, Verbose, theParentNucleus, theBR,
|
||||
theQtransit, theParentNucleus->GetBaryonNumber(),
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-1,
|
||||
theDaughterExcitation, "nu_e")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout <<"G4KshellECDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4KshellECDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4LshellECDecayChannel_h
|
||||
#define G4LshellECDecayChannel_h 1
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4LshellECDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Electron Capture proceess with electron from the L shell
|
||||
//
|
||||
// class description - end
|
||||
|
||||
public:
|
||||
G4LshellECDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,G4double theQtransit=0.0,
|
||||
G4double theDaughterExcitation=0.0) :
|
||||
G4NuclearDecayChannel (LshellEC, Verbose, theParentNucleus, theBR,
|
||||
theQtransit, theParentNucleus->GetBaryonNumber(),
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-1,
|
||||
theDaughterExcitation,
|
||||
"nu_e")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cerr <<"G4LshellECDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4LshellECDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4MshellECDecayChannel_h
|
||||
#define G4MshellECDecayChannel_h 1
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4MshellECDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Electron Capture proceess with electron from the M shell
|
||||
//
|
||||
// class description - end
|
||||
|
||||
public:
|
||||
G4MshellECDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,G4double theQtransit=0.0,
|
||||
G4double theDaughterExcitation=0.0) :
|
||||
G4NuclearDecayChannel (MshellEC, Verbose, theParentNucleus, theBR,
|
||||
theQtransit, theParentNucleus->GetBaryonNumber(),
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-1,
|
||||
theDaughterExcitation,
|
||||
"nu_e")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cerr <<"G4MshellECDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4MshellECDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#ifndef G4NuclearDecayChannel_h
|
||||
#define G4NuclearDecayChannel_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VDecayChannel.hh"
|
||||
#include "G4Ions.hh"
|
||||
#include "G4IonTable.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4GeneralPhaseSpaceDecay.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
|
||||
class G4NuclearDecayChannel : public G4GeneralPhaseSpaceDecay
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// G4NuclearDecayChannel is a derived class from G4GeneralPhaseSpaceDecay,
|
||||
// itself a derived class from G4VDecayChannel. It provides the required
|
||||
// decay channels for all nuclear decay modes and through the DecayIt()
|
||||
// member function returns the decay products.
|
||||
//
|
||||
// class description - end
|
||||
|
||||
public: // with description
|
||||
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose)
|
||||
: G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),Qtransition(0) {;}
|
||||
// default constructor
|
||||
|
||||
// Decay channel ctor with one decay product
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
|
||||
const G4ParticleDefinition* theParentNucleus,
|
||||
const G4double theBR,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation);
|
||||
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
|
||||
const G4ParticleDefinition* theParentNucleus,
|
||||
G4double theBR,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1);
|
||||
// constructor decay channel with two decay products
|
||||
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode, G4int Verbose,
|
||||
const G4ParticleDefinition* theParentNucleus,
|
||||
G4double theBR, G4double theFFN,
|
||||
G4bool betaS, G4RandGeneral* randBeta,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1,
|
||||
const G4String theDaughterName2);
|
||||
// constructor decay channel with three decay product
|
||||
|
||||
virtual ~G4NuclearDecayChannel();
|
||||
|
||||
// Returns the decay products
|
||||
G4DecayProducts* DecayIt(G4double);
|
||||
|
||||
// Set the half-life threshold for isomer production
|
||||
void SetHLThreshold(G4double hl) {halflifethreshold = hl;}
|
||||
|
||||
// Enable/disable ICM
|
||||
void SetICM(G4bool icm) {applyICM = icm;}
|
||||
|
||||
// Enable/disable ARM
|
||||
void SetARM (G4bool arm) {applyARM = arm;}
|
||||
|
||||
inline G4RadioactiveDecayMode GetDecayMode () {return decayMode;}
|
||||
// Returns the decay mode
|
||||
|
||||
inline G4double GetDaughterExcitation () {return daughterExcitation;}
|
||||
// Returns the excitaion energy of the daughter nuclide
|
||||
|
||||
inline G4ParticleDefinition* GetDaughterNucleus () {return daughterNucleus;}
|
||||
// Returns the daughter nuclide.
|
||||
|
||||
private:
|
||||
G4NuclearDecayChannel(const G4String& theName, const G4String& theParentName,
|
||||
G4double theBR, G4int theNumberOfDaughters,
|
||||
const G4String theDaughterName1,
|
||||
const G4String theDaughterName2,
|
||||
const G4String theDaughterName3,
|
||||
const G4String theDaughterName4);
|
||||
|
||||
G4NuclearDecayChannel(const G4String& theParentName,
|
||||
G4double theBR, G4int theNumberOfDaughters,
|
||||
const G4String& theDaughterName1,
|
||||
const G4String& theDaughterName2 = "",
|
||||
const G4String& theDaughterName3 = "");
|
||||
|
||||
G4NuclearDecayChannel(const G4String& theParentName,
|
||||
G4double theParentMass, G4double theBR,
|
||||
G4int theNumberOfDaughters,
|
||||
const G4String& theDaughterName1,
|
||||
const G4String& theDaughterName2 = "",
|
||||
const G4String& theDaughterName3 = "");
|
||||
|
||||
void FillDaughterNucleus(G4int index, G4int A, G4int Z,
|
||||
const G4double theDaughterExcitation);
|
||||
|
||||
G4DecayProducts* BetaDecayIt();
|
||||
// to replace the ThreeBodyDecayIt() to generate the correct beta spectrum
|
||||
|
||||
// Add copy and assignment prototypes even though no dynamic allocation
|
||||
// of class members
|
||||
G4NuclearDecayChannel(const G4NuclearDecayChannel &right);
|
||||
G4NuclearDecayChannel& operator=(const G4NuclearDecayChannel &right);
|
||||
|
||||
protected:
|
||||
//Data members marked with G4ThreadLocal are not invariant among threads
|
||||
//Need to make them TLS
|
||||
const G4RadioactiveDecayMode decayMode;
|
||||
static const G4double pTolerance;
|
||||
static const G4double levelTolerance;
|
||||
G4double daughterExcitation;
|
||||
G4int daughterA;
|
||||
G4int daughterZ;
|
||||
G4ParticleDefinition* daughterNucleus;
|
||||
static G4ThreadLocal G4DynamicParticle* dynamicDaughter;
|
||||
const G4double Qtransition;
|
||||
G4double halflifethreshold;
|
||||
G4bool applyICM;
|
||||
G4bool applyARM;
|
||||
G4RandGeneral* RandomEnergy; // not dynamically allocated
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4ProtonDecayChannel_h
|
||||
#define G4ProtonDecayChannel_h 1
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULE: G4ProtonDecayChannel.hh
|
||||
// Author: L.G. Sarmiento
|
||||
//
|
||||
// Based almost one to one on G4AlphaDecayChannel
|
||||
//
|
||||
// Version: 0.b.3
|
||||
// Date: 29/02/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 28 July 2014, Created by L.G. Sarmiento based almost one to one on
|
||||
// G4AlphaDecayChannel
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4RadioactiveDecayMode.hh"
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
class G4ProtonDecayChannel : public G4NuclearDecayChannel
|
||||
{
|
||||
// class description
|
||||
//
|
||||
// Derived class from G4NuclearDecayChannel. It is specific for
|
||||
// Proton decay proceess. Based on the Alpha decay process.
|
||||
//
|
||||
// class description - end
|
||||
public:
|
||||
G4ProtonDecayChannel (G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
G4double theBR,
|
||||
G4double theEndPointEnergy=0.0,
|
||||
G4double theDaughterExcitation=0.0) :
|
||||
G4NuclearDecayChannel (Proton, Verbose, theParentNucleus, theBR,
|
||||
theEndPointEnergy,
|
||||
(theParentNucleus->GetBaryonNumber())-1,
|
||||
int(theParentNucleus->GetPDGCharge()/CLHEP::eplus)-1,
|
||||
theDaughterExcitation, "proton")
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1)
|
||||
G4cout <<"G4ProtonDecayChannel constructor" << G4endl;
|
||||
#endif
|
||||
}
|
||||
~G4ProtonDecayChannel () {;}
|
||||
};
|
||||
#endif
|
||||
@@ -1,627 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// MODULES: G4NuclearDecayChannel.cc
|
||||
//
|
||||
// Version: 0.b.4
|
||||
// Date: 14/04/00
|
||||
// Author: F Lei & P R Truscott
|
||||
// Organisation: DERA UK
|
||||
// Customer: ESA/ESTEC, NOORDWIJK
|
||||
// Contract: 12115/96/JG/NL Work Order No. 3
|
||||
//
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 29 February 2000, P R Truscott, DERA UK
|
||||
// 0.b.3 release.
|
||||
//
|
||||
// 18 October 2002, F Lei
|
||||
// modified link metheds in DecayIt() to G4PhotoEvaporation() in order to
|
||||
// use the new Internal Coversion feature.
|
||||
// 13 April 2000, F Lei, DERA UK
|
||||
// Changes made are:
|
||||
// 1) Use PhotonEvaporation instead of DiscreteGammaDeexcitation
|
||||
// 2) verbose control
|
||||
//
|
||||
// 17 October 2011, L. Desorgher
|
||||
// -Allow the atomic relaxation after de-excitation of exited
|
||||
// nuclei even for beta and alpha
|
||||
// decay. Bug found and solution proposed by Ko Abe.
|
||||
// -Set halflifethreshold by default to a negative value
|
||||
//
|
||||
// 20 November 2011, V.Ivanchenko
|
||||
// - Migration to new design of atomic deexcitation
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4NuclearLevelManager.hh"
|
||||
#include "G4NuclearLevelStore.hh"
|
||||
#include "G4NuclearDecayChannel.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4DecayProducts.hh"
|
||||
#include "G4DecayTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4ParticleChangeForRadDecay.hh"
|
||||
#include "G4IonTable.hh"
|
||||
#include "G4PhotonEvaporation.hh"
|
||||
|
||||
#include "G4VAtomDeexcitation.hh"
|
||||
#include "G4AtomicShells.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
|
||||
//Model const parameters
|
||||
const G4double G4NuclearDecayChannel:: pTolerance = 0.001;
|
||||
const G4double G4NuclearDecayChannel:: levelTolerance = 2.0*keV;
|
||||
//const G4bool G4NuclearDecayChannel:: FermiOn = true;
|
||||
|
||||
//This is a kind of "cache"
|
||||
G4ThreadLocal G4DynamicParticle* G4NuclearDecayChannel::dynamicDaughter = 0;
|
||||
|
||||
// Constructor for one decay product (the nucleus)
|
||||
G4NuclearDecayChannel::
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode,
|
||||
G4int Verbose,
|
||||
const G4ParticleDefinition* theParentNucleus,
|
||||
const G4double theBR,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation)
|
||||
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
|
||||
Qtransition(theQtransition), RandomEnergy(0)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4NuclearDecayChannel constructor for " << G4int(theMode)
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
SetParent(theParentNucleus);
|
||||
CheckAndFillParent();
|
||||
G4MT_parent_mass = theParentNucleus->GetPDGMass();
|
||||
SetBR(theBR);
|
||||
SetNumberOfDaughters (1);
|
||||
FillDaughterNucleus(0, A, Z, theDaughterExcitation);
|
||||
halflifethreshold = nanosecond;
|
||||
applyICM = true;
|
||||
applyARM = true;
|
||||
CheckAndFillDaughters();
|
||||
}
|
||||
|
||||
// Constructor for a daughter nucleus and one other particle.
|
||||
//
|
||||
G4NuclearDecayChannel::
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode& theMode,
|
||||
G4int Verbose,
|
||||
const G4ParticleDefinition* theParentNucleus,
|
||||
const G4double theBR,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1)
|
||||
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
|
||||
Qtransition(theQtransition), RandomEnergy(0)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4NuclearDecayChannel constructor for " << G4int(theMode)
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
SetParent(theParentNucleus);
|
||||
CheckAndFillParent();
|
||||
G4MT_parent_mass = theParentNucleus->GetPDGMass();
|
||||
SetBR(theBR);
|
||||
SetNumberOfDaughters (2);
|
||||
SetDaughter(0, theDaughterName1);
|
||||
FillDaughterNucleus(1, A, Z, theDaughterExcitation);
|
||||
halflifethreshold = nanosecond;
|
||||
applyICM = true;
|
||||
applyARM = true;
|
||||
CheckAndFillDaughters();
|
||||
}
|
||||
|
||||
// Constructor for a daughter nucleus and two other particles
|
||||
//
|
||||
G4NuclearDecayChannel::
|
||||
G4NuclearDecayChannel(const G4RadioactiveDecayMode &theMode,
|
||||
G4int Verbose,
|
||||
const G4ParticleDefinition *theParentNucleus,
|
||||
const G4double theBR,
|
||||
G4double /* theFFN */,
|
||||
G4bool /* betaS */,
|
||||
G4RandGeneral* randBeta,
|
||||
const G4double theQtransition,
|
||||
const G4int A, const G4int Z,
|
||||
const G4double theDaughterExcitation,
|
||||
const G4String theDaughterName1,
|
||||
const G4String theDaughterName2)
|
||||
:G4GeneralPhaseSpaceDecay(Verbose), decayMode(theMode),
|
||||
Qtransition(theQtransition)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel() > 1) {
|
||||
G4cout << "G4NuclearDecayChannel constructor for " << G4int(theMode)
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
SetParent(theParentNucleus);
|
||||
CheckAndFillParent();
|
||||
G4MT_parent_mass = theParentNucleus->GetPDGMass();
|
||||
SetBR (theBR);
|
||||
SetNumberOfDaughters (3);
|
||||
SetDaughter(0, theDaughterName1);
|
||||
SetDaughter(2, theDaughterName2);
|
||||
FillDaughterNucleus(1, A, Z, theDaughterExcitation);
|
||||
RandomEnergy = randBeta;
|
||||
|
||||
halflifethreshold = nanosecond;
|
||||
applyICM = true;
|
||||
applyARM = true;
|
||||
CheckAndFillDaughters();
|
||||
}
|
||||
|
||||
G4NuclearDecayChannel::~G4NuclearDecayChannel()
|
||||
{}
|
||||
|
||||
void G4NuclearDecayChannel::FillDaughterNucleus(G4int index, G4int A, G4int Z,
|
||||
const G4double theDaughterExcitation)
|
||||
{
|
||||
// Determine if the proposed daughter nucleus has a sensible A, Z and
|
||||
// excitation energy.
|
||||
if (A < 1 || Z < 0 || theDaughterExcitation < 0.0) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Inappropriate values of daughter A, Z or excitation: "
|
||||
<< A << " , " << Z << " , " << theDaughterExcitation*MeV << " MeV "
|
||||
<< G4endl;
|
||||
G4Exception("G4NuclearDecayChannel::FillDaughterNucleus()", "HAD_RDM_006",
|
||||
FatalException, ed);
|
||||
}
|
||||
|
||||
// Save A and Z to local variables. Find the GROUND STATE of the daughter
|
||||
// nucleus and save this, as an ion, in the array of daughters.
|
||||
daughterA = A;
|
||||
daughterZ = Z;
|
||||
if (Z == 1 && A == 1) {
|
||||
daughterNucleus = G4Proton::Definition();
|
||||
} else if (Z == 0 && A == 1) {
|
||||
daughterNucleus = G4Neutron::Definition();
|
||||
} else {
|
||||
G4IonTable *theIonTable =
|
||||
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
|
||||
// GetIon with only Z and A arguments returns ground state
|
||||
daughterNucleus = theIonTable->GetIon(daughterZ, daughterA);
|
||||
}
|
||||
|
||||
daughterExcitation = theDaughterExcitation;
|
||||
SetDaughter(index, daughterNucleus);
|
||||
}
|
||||
|
||||
G4DecayProducts* G4NuclearDecayChannel::DecayIt(G4double)
|
||||
{
|
||||
G4double deltaM;
|
||||
if (decayMode == 1) { // beta- decay
|
||||
deltaM = CLHEP::electron_mass_c2;
|
||||
} else if (decayMode == 2) { // beta+ decay
|
||||
deltaM = 2.*CLHEP::electron_mass_c2;
|
||||
} else if (decayMode < 6 && decayMode > 2) { // EC
|
||||
deltaM = -CLHEP::electron_mass_c2;
|
||||
} else { // all others
|
||||
deltaM = 0.0;
|
||||
}
|
||||
|
||||
// Mass available for decay in rest frame of parent after correcting for
|
||||
// the appropriate number of electron masses and reserving the daughter
|
||||
// excitation energy to be applied later
|
||||
G4double massOfParent = G4MT_parent->GetPDGMass(); // PDG mass includes excitation energy
|
||||
SetParentMass(massOfParent - deltaM - daughterExcitation);
|
||||
|
||||
// Define a product vector.
|
||||
G4DecayProducts* products = 0;
|
||||
|
||||
// Depending upon the number of daughters, select the appropriate decay
|
||||
// kinematics scheme.
|
||||
switch (numberOfDaughters) {
|
||||
case 0:
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << " No daughters defined " << G4endl;
|
||||
G4Exception("G4NuclearDecayChannel::DecayIt()", "HAD_RDM_005",
|
||||
JustWarning, ed);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
products = OneBodyDecayIt();
|
||||
break;
|
||||
case 2:
|
||||
products = TwoBodyDecayIt();
|
||||
break;
|
||||
case 3:
|
||||
products = BetaDecayIt();
|
||||
break;
|
||||
default:
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << " More than 3 daughters in decay: N = " << numberOfDaughters
|
||||
<< G4endl;
|
||||
G4Exception("G4NuclearDecayChannel::DecayIt()", "HAD_RDM_007",
|
||||
FatalException, ed);
|
||||
}
|
||||
}
|
||||
|
||||
if (products == 0) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << " Parent nucleus " << *parent_name << " was not decayed " << G4endl;
|
||||
G4Exception("G4NuclearDecayChannel::DecayIt()", "HAD_RDM_008",
|
||||
JustWarning, ed);
|
||||
DumpInfo();
|
||||
} else {
|
||||
// If the decay is to an excited state of the daughter nuclide, the photon
|
||||
// evaporation process must be applied.
|
||||
|
||||
// Need to hold the shell idex after ICM
|
||||
G4int shellIndex = -1;
|
||||
if (daughterExcitation > 0.0) {
|
||||
// Pop the daughter nucleus off the product vector to get its 4-momentum
|
||||
dynamicDaughter = products->PopProducts();
|
||||
G4LorentzVector daughterMomentum = dynamicDaughter->Get4Momentum();
|
||||
if (dynamicDaughter) delete dynamicDaughter;
|
||||
|
||||
// Using daughter nucleus, set up a G4Fragment for photon evaporatation
|
||||
if (decayMode == 0) {
|
||||
G4double exe = ((const G4Ions*)(G4MT_parent))->GetExcitationEnergy();
|
||||
daughterMomentum.setE(daughterMomentum.e() + exe);
|
||||
}
|
||||
G4Fragment nucleus(daughterA, daughterZ, daughterMomentum);
|
||||
|
||||
G4PhotonEvaporation* deexcitation = new G4PhotonEvaporation;
|
||||
deexcitation->SetVerboseLevel(GetVerboseLevel());
|
||||
|
||||
// switch on/off internal electron conversion
|
||||
deexcitation->SetICM(applyICM);
|
||||
|
||||
// In IT mode, we need to force the transition
|
||||
if (decayMode == 0) {
|
||||
deexcitation->RDMForced(true);
|
||||
// at this point, de-excitation will occur even if IT state is long-lived (>1ns)
|
||||
// Why does it need to be forced?
|
||||
} else {
|
||||
// Not forced, but decay will still happen if lifetime < 1 ns,
|
||||
// otherwise no gamma decay is performed
|
||||
deexcitation->RDMForced(false);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// Apply photon evaporation if Isomeric Transition is indicated. //
|
||||
// Use G4PhotonEvaporation::BreakUp() which does only one transition. //
|
||||
// This allows IC to be done. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4IonTable* theIonTable =
|
||||
(G4IonTable*)(G4ParticleTable::GetParticleTable()->GetIonTable());
|
||||
G4ParticleDefinition* daughterIon = 0;
|
||||
|
||||
if (decayMode != 0) {
|
||||
daughterIon = theIonTable->GetIon(daughterZ, daughterA, daughterExcitation);
|
||||
|
||||
} else {
|
||||
// The fragment vector from photon evaporation contains the list of
|
||||
// evaporated gammas, some of which may have been replaced by conversion
|
||||
// electrons. The last element is the residual nucleus.
|
||||
// Note: try photoEvapProducts as a name instead of gammas
|
||||
G4FragmentVector* gammas = deexcitation->BreakUp(nucleus);
|
||||
G4int nFrags = G4int(gammas->size());
|
||||
G4double eOrGammaEnergy = 0.0;
|
||||
|
||||
if (nFrags < 1) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << nFrags << " No fragments produced by photon evaporation. " << G4endl;
|
||||
G4Exception("G4NuclearDecayChannel::DecayIt()","HAD_RDM_012",
|
||||
FatalException, ed);
|
||||
} else if (nFrags > 1) {
|
||||
// Add gamma/e- to the decay product. The angular distribution of this
|
||||
// particle is assumed to be isotropic
|
||||
G4Fragment* eOrGamma;
|
||||
G4DynamicParticle* eOrGammaDyn;
|
||||
for (G4int i = 0; i < nFrags - 1; i++) {
|
||||
eOrGamma = gammas->operator[](i);
|
||||
eOrGammaDyn = new G4DynamicParticle(eOrGamma->GetParticleDefinition(),
|
||||
eOrGamma->GetMomentum() );
|
||||
eOrGammaDyn->SetProperTime(eOrGamma->GetCreationTime() );
|
||||
products->PushProducts(eOrGammaDyn);
|
||||
eOrGammaEnergy += eOrGamma->GetMomentum().e();
|
||||
}
|
||||
}
|
||||
|
||||
G4double finalDaughterExcitation =
|
||||
gammas->operator[](nFrags-1)->GetExcitationEnergy();
|
||||
if (finalDaughterExcitation <= 1.0*keV) finalDaughterExcitation = 0;
|
||||
|
||||
// Get new ion with excitation energy reduced by emitted gamma energy
|
||||
daughterIon =
|
||||
theIonTable->GetIon(daughterZ, daughterA, finalDaughterExcitation);
|
||||
daughterMomentum.setE(daughterMomentum.e() - eOrGammaEnergy);
|
||||
|
||||
// Delete/reset variables associated with the gammas.
|
||||
while (!gammas->empty() ) { /* Loop checking, 01.09.2015, D.Wright */
|
||||
delete *(gammas->end()-1);
|
||||
gammas->pop_back();
|
||||
}
|
||||
delete gammas;
|
||||
} // end if decayMode == 0
|
||||
|
||||
G4ThreeVector const daughterMomentum1(static_cast<const G4LorentzVector> (daughterMomentum));
|
||||
dynamicDaughter = new G4DynamicParticle(daughterIon, daughterMomentum1);
|
||||
products->PushProducts(dynamicDaughter);
|
||||
|
||||
// retrieve the ICM shell index
|
||||
shellIndex = deexcitation->GetVacantShellNumber();
|
||||
|
||||
delete deexcitation;
|
||||
} // if daughter excitation > 0
|
||||
|
||||
// Now take care of the EC products which have to go through the ARM
|
||||
G4int eShell = -1;
|
||||
if (decayMode == 3 || decayMode == 4 || decayMode == 5) {
|
||||
switch (decayMode)
|
||||
{
|
||||
case KshellEC:
|
||||
{
|
||||
eShell = 0; // --> 0 from 1 (f.lei 30/4/2008)
|
||||
}
|
||||
break;
|
||||
case LshellEC:
|
||||
{
|
||||
eShell = G4int(G4UniformRand()*3)+1;
|
||||
}
|
||||
break;
|
||||
case MshellEC:
|
||||
{
|
||||
// limit the shell index to 6 as specified by the ARM (F.Lei 06/05/2010)
|
||||
// eShell = G4int(G4UniformRand()*5)+4;
|
||||
eShell = G4int(G4UniformRand()*3)+4;
|
||||
}
|
||||
break;
|
||||
case RDM_ERROR:
|
||||
default:
|
||||
G4Exception("G4NuclearDecayChannel::DecayIt()", "HAD_RDM_009",
|
||||
FatalException, "Incorrect decay mode selection");
|
||||
}
|
||||
} else {
|
||||
// For other cases eShell comes from shellIndex resulting from the photo decay
|
||||
// modeled by G4PhotonEvaporation* de-excitation (see above)
|
||||
eShell = shellIndex;
|
||||
}
|
||||
|
||||
// now apply ARM if it is requested and there is a vaccancy
|
||||
if (applyARM && eShell != -1) {
|
||||
G4int aZ = daughterZ;
|
||||
|
||||
// V.Ivanchenko migration to new interface to atomic deexcitation
|
||||
// no check on index of G4MaterialCutsCouple, simplified
|
||||
// check on secondary energy Esec < 0.1 keV
|
||||
G4VAtomDeexcitation* atomDeex =
|
||||
G4LossTableManager::Instance()->AtomDeexcitation();
|
||||
if (atomDeex) {
|
||||
if(atomDeex->IsFluoActive() && aZ > 5 && aZ < 100) { // only applies to 5< Z <100
|
||||
if (eShell >= G4AtomicShells::GetNumberOfShells(aZ)){
|
||||
eShell = G4AtomicShells::GetNumberOfShells(aZ)-1;
|
||||
}
|
||||
G4AtomicShellEnumerator as = G4AtomicShellEnumerator(eShell);
|
||||
const G4AtomicShell* shell = atomDeex->GetAtomicShell(aZ, as);
|
||||
std::vector<G4DynamicParticle*> armProducts;
|
||||
|
||||
// VI, SI
|
||||
// Allows fixing of Bugzilla 1727
|
||||
//const G4double deexLimit = 0.1*keV;
|
||||
G4double deexLimit = 0.1*keV;
|
||||
if (G4EmParameters::Instance()->DeexcitationIgnoreCut()) deexLimit =0.;
|
||||
//
|
||||
|
||||
atomDeex->GenerateParticles(&armProducts, shell, aZ, deexLimit, deexLimit);
|
||||
size_t narm = armProducts.size();
|
||||
if (narm > 0) {
|
||||
// L.Desorgher: need to initialize dynamicDaughter in some decay
|
||||
// cases (for example Hg194)
|
||||
dynamicDaughter = products->PopProducts();
|
||||
G4ThreeVector bst = dynamicDaughter->Get4Momentum().boostVector();
|
||||
for (size_t i = 0; i<narm; ++i) {
|
||||
G4DynamicParticle* dp = armProducts[i];
|
||||
G4LorentzVector lv = dp->Get4Momentum().boost(bst);
|
||||
dp->Set4Momentum(lv);
|
||||
products->PushProducts(dp);
|
||||
}
|
||||
products->PushProducts(dynamicDaughter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Parent nucleus decayed
|
||||
/*
|
||||
if (atomDeex && aZ > 5 && aZ < 100) { // only applies to 5< Z <100
|
||||
// Retrieve the corresponding identifier and binding energy of the selected shell
|
||||
const G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance();
|
||||
|
||||
//check that eShell is smaller than the max number of shells
|
||||
//this to avoid a warning from transitionManager(otherwise the output is the same)
|
||||
//Correction to Bug 1662. L Desorgher (04/02/2011)
|
||||
if (eShell >= transitionManager->NumberOfShells(aZ)){
|
||||
eShell=transitionManager->NumberOfShells(aZ)-1;
|
||||
}
|
||||
|
||||
const G4AtomicShell* shell = transitionManager->Shell(aZ, eShell);
|
||||
G4double bindingEnergy = shell->BindingEnergy();
|
||||
G4int shellId = shell->ShellId();
|
||||
|
||||
G4AtomicDeexcitation* atomDeex = new G4AtomicDeexcitation();
|
||||
//the default is no Auger electron generation.
|
||||
// Switch it on/off here!
|
||||
atomDeex->ActivateAugerElectronProduction(true);
|
||||
std::vector<G4DynamicParticle*>* armProducts = atomDeex->GenerateParticles(aZ,shellId);
|
||||
|
||||
// pop up the daughter before insertion;
|
||||
// f.lei (30/04/2008) check if the total kinetic energy is less than
|
||||
// the shell binding energy; if true add the difference to the daughter to conserve the energy
|
||||
dynamicDaughter = products->PopProducts();
|
||||
G4double tARMEnergy = 0.0;
|
||||
for (size_t i = 0; i < armProducts->size(); i++) {
|
||||
products->PushProducts ((*armProducts)[i]);
|
||||
tARMEnergy += (*armProducts)[i]->GetKineticEnergy();
|
||||
}
|
||||
if ((bindingEnergy - tARMEnergy) > 0.1*keV){
|
||||
G4double dEnergy = dynamicDaughter->GetKineticEnergy() + (bindingEnergy - tARMEnergy);
|
||||
dynamicDaughter->SetKineticEnergy(dEnergy);
|
||||
}
|
||||
products->PushProducts(dynamicDaughter);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>0)
|
||||
{
|
||||
G4cout <<"G4NuclearDecayChannel::Selected shell number for ARM = " <<shellId <<G4endl;
|
||||
G4cout <<"G4NuclearDecayChannel::ARM products = " <<armProducts->size()<<G4endl;
|
||||
G4cout <<" The binding energy = " << bindingEnergy << G4endl;
|
||||
G4cout <<" Total ARM particle kinetic energy = " << tARMEnergy << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
delete armProducts;
|
||||
delete atomDeex;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
G4DecayProducts* G4NuclearDecayChannel::BetaDecayIt()
|
||||
{
|
||||
G4double pmass = GetParentMass();
|
||||
|
||||
G4double daughtermass[3];
|
||||
for (G4int index = 0; index < 3; index++) {
|
||||
daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
|
||||
}
|
||||
|
||||
// Add excitation energy so daughter can be decayed later
|
||||
daughtermass[1] += daughterExcitation;
|
||||
|
||||
// Create parent G4DynamicParticle at rest and create products
|
||||
G4ParticleMomentum dummy;
|
||||
G4DynamicParticle parentParticle(G4MT_parent, dummy, 0.0);
|
||||
G4DecayProducts* products = new G4DecayProducts(parentParticle);
|
||||
|
||||
// faster method as suggested by Dirk Kruecker of FZ-Julich
|
||||
G4double daughtermomentum[3];
|
||||
G4double daughterenergy[3];
|
||||
// Use the histogram distribution to generate the beta energy
|
||||
// 0 = electron, 1 = daughter, 2 = neutrino
|
||||
daughterenergy[0] = Qtransition*RandomEnergy->shoot(G4Random::getTheEngine());
|
||||
daughtermomentum[0] = std::sqrt(daughterenergy[0]*(daughterenergy[0] + 2.*daughtermass[0]) );
|
||||
|
||||
// neutrino energy distribution is flat within the kinematical limits
|
||||
G4double rd = 2.*G4UniformRand() - 1.;
|
||||
// limits
|
||||
G4double Mme = daughtermass[1] + Qtransition;
|
||||
G4double K = 0.5 - daughtermass[1]*daughtermass[1]/(2*Mme*Mme-4*pmass*daughterenergy[0]);
|
||||
|
||||
daughterenergy[2] = K * (Mme - daughterenergy[0] + rd*daughtermomentum[0]);
|
||||
daughtermomentum[2] = daughterenergy[2];
|
||||
|
||||
// the recoil nucleus
|
||||
daughterenergy[1] = Qtransition - daughterenergy[0] - daughterenergy[2];
|
||||
G4double recoilmomentumsquared =
|
||||
daughterenergy[1]*(daughterenergy[1] + 2.0*daughtermass[1]);
|
||||
if (recoilmomentumsquared < 0.0) recoilmomentumsquared = 0.0;
|
||||
daughtermomentum[1] = std::sqrt(recoilmomentumsquared);
|
||||
|
||||
// output message
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << " G4NuclearDecayChannel::BetaDecayIt() " << G4endl;
|
||||
G4cout <<" e- momentum: " <<daughtermomentum[0]/GeV <<" [GeV/c]" <<G4endl;
|
||||
G4cout <<" daughter momentum: " <<daughtermomentum[1]/GeV <<" [GeV/c]" <<G4endl;
|
||||
G4cout <<" nu momentum: " <<daughtermomentum[2]/GeV <<" [GeV/c]" <<G4endl;
|
||||
G4cout <<" e- energy: " << daughtermass[0] + daughterenergy[0] << G4endl;
|
||||
G4cout <<" daughter energy: " << daughtermass[1] + daughterenergy[1] << G4endl;
|
||||
G4cout <<" nu energy: " << daughtermass[2] + daughterenergy[2] << G4endl;
|
||||
G4cout <<" total of daughter energies: " << daughtermass[0] + daughtermass[1] +
|
||||
daughtermass[2] + daughterenergy[0] + daughterenergy[1] + daughterenergy[2]
|
||||
<< G4endl;
|
||||
}
|
||||
//create daughter G4DynamicParticle
|
||||
G4double costheta, sintheta, phi, sinphi, cosphi;
|
||||
G4double costhetan, sinthetan, phin, sinphin, cosphin;
|
||||
costheta = 2.*G4UniformRand()-1.0;
|
||||
sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
|
||||
phi = twopi*G4UniformRand()*rad;
|
||||
sinphi = std::sin(phi);
|
||||
cosphi = std::cos(phi);
|
||||
// electron chosen isotropically
|
||||
G4ParticleMomentum direction0(sintheta*cosphi,sintheta*sinphi,costheta);
|
||||
G4DynamicParticle * daughterparticle
|
||||
= new G4DynamicParticle( G4MT_daughters[0], direction0*daughtermomentum[0]);
|
||||
products->PushProducts(daughterparticle);
|
||||
// cos of angle between electron and neutrino
|
||||
costhetan = (daughtermomentum[1]*daughtermomentum[1]-
|
||||
daughtermomentum[2]*daughtermomentum[2]-
|
||||
daughtermomentum[0]*daughtermomentum[0])/
|
||||
(2.0*daughtermomentum[2]*daughtermomentum[0]);
|
||||
|
||||
if (costhetan > 1.) costhetan = 1.;
|
||||
if (costhetan < -1.) costhetan = -1.;
|
||||
sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
|
||||
phin = twopi*G4UniformRand()*rad;
|
||||
sinphin = std::sin(phin);
|
||||
cosphin = std::cos(phin);
|
||||
G4ParticleMomentum direction2;
|
||||
direction2.setX(sinthetan*cosphin*costheta*cosphi -
|
||||
sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
|
||||
direction2.setY(sinthetan*cosphin*costheta*sinphi +
|
||||
sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
|
||||
direction2.setZ(-sinthetan*cosphin*sintheta + costhetan*costheta);
|
||||
daughterparticle = new G4DynamicParticle(G4MT_daughters[2],
|
||||
direction2*(daughtermomentum[2]/direction2.mag()));
|
||||
products->PushProducts(daughterparticle);
|
||||
// daughter nucleus p = - (p_e + p_nu )
|
||||
daughterparticle =
|
||||
new G4DynamicParticle(G4MT_daughters[1],
|
||||
(direction0*daughtermomentum[0] +
|
||||
direction2*(daughtermomentum[2]/direction2.mag()))*(-1.0));
|
||||
products->PushProducts(daughterparticle);
|
||||
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << "G4NuclearDecayChannel::BetaDecayIt ";
|
||||
G4cout << " create decay products in rest frame " <<G4endl;
|
||||
products->DumpInfo();
|
||||
}
|
||||
return products;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// Copyright FreeHEP, 2005.
|
||||
|
||||
#include "cheprep/GZIPOutputStreamBuffer.h"
|
||||
#include "cheprep/GZIPOutputStream.h"
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
* @version $Id: GZIPOutputStream.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
*/
|
||||
namespace cheprep {
|
||||
|
||||
using namespace std;
|
||||
|
||||
GZIPOutputStream::GZIPOutputStream(ostream &os)
|
||||
: std::ostream(NULL) {
|
||||
|
||||
buffer = new GZIPOutputStreamBuffer(os.rdbuf());
|
||||
init(buffer);
|
||||
}
|
||||
|
||||
|
||||
void GZIPOutputStream::setFilename(const string &filename) {
|
||||
buffer->setFilename(filename);
|
||||
}
|
||||
|
||||
void GZIPOutputStream::setComment(const string &comment) {
|
||||
buffer->setComment(comment);
|
||||
}
|
||||
|
||||
void GZIPOutputStream::close() {
|
||||
buffer->close();
|
||||
}
|
||||
|
||||
|
||||
GZIPOutputStream::~GZIPOutputStream() {
|
||||
delete buffer;
|
||||
}
|
||||
|
||||
} // cheprep
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright FreeHEP, 2005.
|
||||
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
#include "cheprep/ZipOutputStreamBuffer.h"
|
||||
#include "cheprep/ZipOutputStream.h"
|
||||
|
||||
/**
|
||||
* @author Mark Donszelmann
|
||||
* @version $Id: ZipOutputStream.cc 66373 2012-12-18 09:41:34Z gcosmo $
|
||||
*/
|
||||
namespace cheprep {
|
||||
|
||||
ZipOutputStream::ZipOutputStream(std::ostream& os) : std::ostream(0) {
|
||||
buffer = new ZipOutputStreamBuffer(os.rdbuf());
|
||||
|
||||
init(buffer);
|
||||
}
|
||||
|
||||
void ZipOutputStream::closeEntry() {
|
||||
buffer->closeEntry();
|
||||
}
|
||||
|
||||
|
||||
void ZipOutputStream::close() {
|
||||
buffer->close();
|
||||
}
|
||||
|
||||
void ZipOutputStream::putNextEntry(const std::string& name, bool compress) {
|
||||
buffer->putNextEntry(name, compress);
|
||||
}
|
||||
|
||||
void ZipOutputStream::setComment(const std::string& comment ) {
|
||||
buffer->setComment(comment);
|
||||
}
|
||||
|
||||
ZipOutputStream::~ZipOutputStream() {
|
||||
close();
|
||||
delete buffer;
|
||||
}
|
||||
|
||||
} // cheprep
|
||||
@@ -1,101 +0,0 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4OpenGLQtExportDialog.hh'
|
||||
**
|
||||
** Created: Tue Nov 22 09:56:58 2016
|
||||
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../include/G4OpenGLQtExportDialog.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4OpenGLQtExportDialog.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 63
|
||||
#error "This file was generated using the moc from 4.8.4. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_G4OpenGLQtExportDialog[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
4, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
24, 23, 23, 23, 0x0a,
|
||||
40, 23, 23, 23, 0x0a,
|
||||
58, 23, 23, 23, 0x0a,
|
||||
84, 23, 23, 23, 0x0a,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4OpenGLQtExportDialog[] = {
|
||||
"G4OpenGLQtExportDialog\0\0changeSizeBox()\0"
|
||||
"changeVectorEPS()\0textWidthChanged(QString)\0"
|
||||
"textHeightChanged(QString)\0"
|
||||
};
|
||||
|
||||
void G4OpenGLQtExportDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Q_ASSERT(staticMetaObject.cast(_o));
|
||||
G4OpenGLQtExportDialog *_t = static_cast<G4OpenGLQtExportDialog *>(_o);
|
||||
switch (_id) {
|
||||
case 0: _t->changeSizeBox(); break;
|
||||
case 1: _t->changeVectorEPS(); break;
|
||||
case 2: _t->textWidthChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
case 3: _t->textHeightChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData G4OpenGLQtExportDialog::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject G4OpenGLQtExportDialog::staticMetaObject = {
|
||||
{ &QDialog::staticMetaObject, qt_meta_stringdata_G4OpenGLQtExportDialog,
|
||||
qt_meta_data_G4OpenGLQtExportDialog, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &G4OpenGLQtExportDialog::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *G4OpenGLQtExportDialog::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4OpenGLQtExportDialog::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtExportDialog))
|
||||
return static_cast<void*>(const_cast< G4OpenGLQtExportDialog*>(this));
|
||||
return QDialog::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4OpenGLQtExportDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QDialog::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 4)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 4;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
@@ -1,121 +0,0 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4OpenGLQtMovieDialog.hh'
|
||||
**
|
||||
** Created: Tue Nov 22 09:56:58 2016
|
||||
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../include/G4OpenGLQtMovieDialog.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4OpenGLQtMovieDialog.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 63
|
||||
#error "This file was generated using the moc from 4.8.4. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_G4OpenGLQtMovieDialog[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
10, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
23, 22, 22, 22, 0x0a,
|
||||
41, 22, 22, 22, 0x0a,
|
||||
53, 22, 48, 22, 0x0a,
|
||||
80, 22, 48, 22, 0x0a,
|
||||
110, 22, 48, 22, 0x0a,
|
||||
138, 22, 22, 22, 0x08,
|
||||
164, 22, 22, 22, 0x08,
|
||||
187, 22, 22, 22, 0x08,
|
||||
214, 22, 22, 22, 0x08,
|
||||
231, 22, 22, 22, 0x08,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4OpenGLQtMovieDialog[] = {
|
||||
"G4OpenGLQtMovieDialog\0\0stopFinishClose()\0"
|
||||
"save()\0bool\0checkEncoderSwParameters()\0"
|
||||
"checkSaveFileNameParameters()\0"
|
||||
"checkTempFolderParameters()\0"
|
||||
"selectEncoderPathAction()\0"
|
||||
"selectTempPathAction()\0"
|
||||
"selectSaveFileNameAction()\0resetRecording()\0"
|
||||
"enabledApplyButton()\0"
|
||||
};
|
||||
|
||||
void G4OpenGLQtMovieDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Q_ASSERT(staticMetaObject.cast(_o));
|
||||
G4OpenGLQtMovieDialog *_t = static_cast<G4OpenGLQtMovieDialog *>(_o);
|
||||
switch (_id) {
|
||||
case 0: _t->stopFinishClose(); break;
|
||||
case 1: _t->save(); break;
|
||||
case 2: { bool _r = _t->checkEncoderSwParameters();
|
||||
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
|
||||
case 3: { bool _r = _t->checkSaveFileNameParameters();
|
||||
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
|
||||
case 4: { bool _r = _t->checkTempFolderParameters();
|
||||
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
|
||||
case 5: _t->selectEncoderPathAction(); break;
|
||||
case 6: _t->selectTempPathAction(); break;
|
||||
case 7: _t->selectSaveFileNameAction(); break;
|
||||
case 8: _t->resetRecording(); break;
|
||||
case 9: _t->enabledApplyButton(); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData G4OpenGLQtMovieDialog::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject G4OpenGLQtMovieDialog::staticMetaObject = {
|
||||
{ &QDialog::staticMetaObject, qt_meta_stringdata_G4OpenGLQtMovieDialog,
|
||||
qt_meta_data_G4OpenGLQtMovieDialog, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &G4OpenGLQtMovieDialog::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *G4OpenGLQtMovieDialog::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4OpenGLQtMovieDialog::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtMovieDialog))
|
||||
return static_cast<void*>(const_cast< G4OpenGLQtMovieDialog*>(this));
|
||||
return QDialog::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4OpenGLQtMovieDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QDialog::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 10)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 10;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
@@ -1,170 +0,0 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'G4OpenGLQtViewer.hh'
|
||||
**
|
||||
** Created: Tue Nov 22 09:56:58 2016
|
||||
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../include/G4OpenGLQtViewer.hh"
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'G4OpenGLQtViewer.hh' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 63
|
||||
#error "This file was generated using the moc from 4.8.4. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
static const uint qt_meta_data_G4OpenGLQtViewer[] = {
|
||||
|
||||
// content:
|
||||
6, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
29, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: signature, parameters, type, tag, flags
|
||||
18, 17, 17, 17, 0x0a,
|
||||
36, 17, 17, 17, 0x09,
|
||||
71, 17, 17, 17, 0x08,
|
||||
89, 17, 17, 17, 0x08,
|
||||
119, 17, 17, 17, 0x08,
|
||||
143, 17, 17, 17, 0x08,
|
||||
170, 17, 17, 17, 0x08,
|
||||
194, 17, 17, 17, 0x08,
|
||||
210, 17, 17, 17, 0x08,
|
||||
233, 17, 17, 17, 0x08,
|
||||
258, 17, 17, 17, 0x08,
|
||||
281, 17, 17, 17, 0x08,
|
||||
306, 17, 17, 17, 0x08,
|
||||
331, 17, 17, 17, 0x08,
|
||||
351, 17, 17, 17, 0x08,
|
||||
367, 17, 17, 17, 0x08,
|
||||
393, 17, 17, 17, 0x08,
|
||||
416, 17, 17, 17, 0x08,
|
||||
440, 17, 17, 17, 0x08,
|
||||
465, 17, 17, 17, 0x08,
|
||||
495, 487, 17, 17, 0x08,
|
||||
547, 17, 17, 17, 0x08,
|
||||
588, 17, 17, 17, 0x08,
|
||||
604, 17, 17, 17, 0x08,
|
||||
629, 17, 17, 17, 0x08,
|
||||
658, 17, 17, 17, 0x08,
|
||||
686, 17, 17, 17, 0x08,
|
||||
719, 710, 17, 17, 0x08,
|
||||
768, 17, 17, 17, 0x08,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
static const char qt_meta_stringdata_G4OpenGLQtViewer[] = {
|
||||
"G4OpenGLQtViewer\0\0startPauseVideo()\0"
|
||||
"updateToolbarAndMouseContextMenu()\0"
|
||||
"actionSaveImage()\0actionChangeBackgroundColor()\0"
|
||||
"actionChangeTextColor()\0"
|
||||
"actionChangeDefaultColor()\0"
|
||||
"actionMovieParameters()\0showShortcuts()\0"
|
||||
"toggleMouseAction(int)\0toggleSurfaceAction(int)\0"
|
||||
"toggleProjection(bool)\0toggleTransparency(bool)\0"
|
||||
"toggleAntialiasing(bool)\0toggleHaloing(bool)\0"
|
||||
"toggleAux(bool)\0toggleHiddenMarkers(bool)\0"
|
||||
"toggleFullScreen(bool)\0processEncodeFinished()\0"
|
||||
"processLookForFinished()\0processEncodeStdout()\0"
|
||||
"item,id\0sceneTreeComponentItemChanged(QTreeWidgetItem*,int)\0"
|
||||
"toggleSceneTreeComponentPickingCout(int)\0"
|
||||
"togglePicking()\0currentTabActivated(int)\0"
|
||||
"sceneTreeComponentSelected()\0"
|
||||
"changeDepthInSceneTree(int)\0"
|
||||
"changeSearchSelection()\0item,val\0"
|
||||
"changeColorAndTransparency(QTreeWidgetItem*,int)\0"
|
||||
"tableWidgetViewerSetItemChanged(QTableWidgetItem*)\0"
|
||||
};
|
||||
|
||||
void G4OpenGLQtViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Q_ASSERT(staticMetaObject.cast(_o));
|
||||
G4OpenGLQtViewer *_t = static_cast<G4OpenGLQtViewer *>(_o);
|
||||
switch (_id) {
|
||||
case 0: _t->startPauseVideo(); break;
|
||||
case 1: _t->updateToolbarAndMouseContextMenu(); break;
|
||||
case 2: _t->actionSaveImage(); break;
|
||||
case 3: _t->actionChangeBackgroundColor(); break;
|
||||
case 4: _t->actionChangeTextColor(); break;
|
||||
case 5: _t->actionChangeDefaultColor(); break;
|
||||
case 6: _t->actionMovieParameters(); break;
|
||||
case 7: _t->showShortcuts(); break;
|
||||
case 8: _t->toggleMouseAction((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 9: _t->toggleSurfaceAction((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 10: _t->toggleProjection((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 11: _t->toggleTransparency((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 12: _t->toggleAntialiasing((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 13: _t->toggleHaloing((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 14: _t->toggleAux((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 15: _t->toggleHiddenMarkers((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 16: _t->toggleFullScreen((*reinterpret_cast< bool(*)>(_a[1]))); break;
|
||||
case 17: _t->processEncodeFinished(); break;
|
||||
case 18: _t->processLookForFinished(); break;
|
||||
case 19: _t->processEncodeStdout(); break;
|
||||
case 20: _t->sceneTreeComponentItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
|
||||
case 21: _t->toggleSceneTreeComponentPickingCout((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 22: _t->togglePicking(); break;
|
||||
case 23: _t->currentTabActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 24: _t->sceneTreeComponentSelected(); break;
|
||||
case 25: _t->changeDepthInSceneTree((*reinterpret_cast< int(*)>(_a[1]))); break;
|
||||
case 26: _t->changeSearchSelection(); break;
|
||||
case 27: _t->changeColorAndTransparency((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
|
||||
case 28: _t->tableWidgetViewerSetItemChanged((*reinterpret_cast< QTableWidgetItem*(*)>(_a[1]))); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObjectExtraData G4OpenGLQtViewer::staticMetaObjectExtraData = {
|
||||
0, qt_static_metacall
|
||||
};
|
||||
|
||||
const QMetaObject G4OpenGLQtViewer::staticMetaObject = {
|
||||
{ &QObject::staticMetaObject, qt_meta_stringdata_G4OpenGLQtViewer,
|
||||
qt_meta_data_G4OpenGLQtViewer, &staticMetaObjectExtraData }
|
||||
};
|
||||
|
||||
#ifdef Q_NO_DATA_RELOCATION
|
||||
const QMetaObject &G4OpenGLQtViewer::getStaticMetaObject() { return staticMetaObject; }
|
||||
#endif //Q_NO_DATA_RELOCATION
|
||||
|
||||
const QMetaObject *G4OpenGLQtViewer::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *G4OpenGLQtViewer::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return 0;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_G4OpenGLQtViewer))
|
||||
return static_cast<void*>(const_cast< G4OpenGLQtViewer*>(this));
|
||||
if (!strcmp(_clname, "G4OpenGLViewer"))
|
||||
return static_cast< G4OpenGLViewer*>(const_cast< G4OpenGLQtViewer*>(this));
|
||||
return QObject::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int G4OpenGLQtViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QObject::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 29)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 29;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
@@ -1,73 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrajectoryDrawByTouchedVolume.hh 66264 2012-12-14 10:17:44Z allison $
|
||||
//
|
||||
// Class Description:
|
||||
// Trajectory model which colours a trajectory according to
|
||||
// the touched volume
|
||||
// Class Description - End:
|
||||
// Jane Tinslay March 2006
|
||||
|
||||
#ifndef G4TRAJECTORYDRAWBYTOUCHEDVOLUME
|
||||
#define G4TRAJECTORYDRAWBYTOUCHEDVOLUME
|
||||
|
||||
#include "G4VTrajectoryModel.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4ModelColourMap.hh"
|
||||
#include "G4String.hh"
|
||||
#include <map>
|
||||
|
||||
class G4TrajectoryDrawByTouchedVolume : public G4VTrajectoryModel {
|
||||
|
||||
public: // With description
|
||||
|
||||
G4TrajectoryDrawByTouchedVolume(const G4String& name = "Unspecified", G4VisTrajContext* context=0);
|
||||
|
||||
virtual ~G4TrajectoryDrawByTouchedVolume();
|
||||
|
||||
// Draw method
|
||||
virtual void Draw(const G4VTrajectory& trajectory,
|
||||
const G4bool& visible = true) const;
|
||||
|
||||
virtual void Print(std::ostream& ostr) const;
|
||||
// Print configuration
|
||||
|
||||
void SetDefault(const G4String&);
|
||||
void SetDefault(const G4Colour&);
|
||||
|
||||
void Set(const G4String& pvname, const G4String& colour);
|
||||
void Set(const G4String& pvname, const G4Colour& colour);
|
||||
// Configuration functions
|
||||
|
||||
private:
|
||||
|
||||
// Data members
|
||||
G4ModelColourMap<G4String> fMap;
|
||||
G4Colour fDefault;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,68 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrajectoryTouchedVolumeFilter.hh 66264 2012-12-14 10:17:44Z allison $
|
||||
//
|
||||
// Filter trajectories according to touched volume name. Only registered
|
||||
// volumes will pass the filter.
|
||||
//
|
||||
// John Allison, Feb 2016
|
||||
//
|
||||
#ifndef G4TRAJECTORYTOUCHEDVOLUMEFILTER_HH
|
||||
#define G4TRAJECTORYTOUCHEDVOLUMEFILTER_HH
|
||||
|
||||
#include "G4SmartFilter.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4TrajectoryTouchedVolumeFilter : public G4SmartFilter<G4VTrajectory> {
|
||||
|
||||
public: // With description
|
||||
|
||||
// Construct with filter name
|
||||
G4TrajectoryTouchedVolumeFilter(const G4String& name = "Unspecified");
|
||||
|
||||
virtual ~G4TrajectoryTouchedVolumeFilter();
|
||||
|
||||
// Evaluate this trajectory
|
||||
virtual bool Evaluate(const G4VTrajectory&) const;
|
||||
|
||||
// Print configuration
|
||||
virtual void Print(std::ostream& ostr) const;
|
||||
|
||||
// Clear filter
|
||||
virtual void Clear();
|
||||
|
||||
// Configuration function
|
||||
void Add(const G4String& volume);
|
||||
|
||||
private:
|
||||
|
||||
// Data member
|
||||
std::vector<G4String> fVolumes;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,150 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrajectoryDrawByTouchedVolume.cc 95107 2016-01-26 12:41:11Z allison $
|
||||
//
|
||||
// Jane Tinslay March 2006
|
||||
|
||||
#include "G4TrajectoryDrawByTouchedVolume.hh"
|
||||
#include "G4TrajectoryDrawerUtils.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
#include "G4VisTrajContext.hh"
|
||||
#include "G4VTrajectoryPoint.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include "G4RichTrajectory.hh"
|
||||
|
||||
G4TrajectoryDrawByTouchedVolume::G4TrajectoryDrawByTouchedVolume(const G4String& name, G4VisTrajContext* context)
|
||||
:G4VTrajectoryModel(name, context)
|
||||
,fDefault(G4Colour::Grey())
|
||||
{}
|
||||
|
||||
G4TrajectoryDrawByTouchedVolume::~G4TrajectoryDrawByTouchedVolume() {}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
|
||||
{
|
||||
try
|
||||
{
|
||||
const G4RichTrajectory& richTrajectory = dynamic_cast<const G4RichTrajectory&>(traj);
|
||||
|
||||
G4Colour colour(fDefault);
|
||||
G4String soughtPVName("none");
|
||||
|
||||
for (const auto& item: fMap.GetBasicMap()) {
|
||||
soughtPVName = item.first;
|
||||
for (G4int iPoint = 0; iPoint < richTrajectory.GetPointEntries(); iPoint++) {
|
||||
G4VTrajectoryPoint* point = richTrajectory.GetPoint(iPoint);
|
||||
if (!point) continue;
|
||||
std::vector<G4AttValue>* attValues = point->CreateAttValues();
|
||||
std::vector<G4AttValue>::const_iterator iAtt;
|
||||
for (iAtt = attValues->begin(); iAtt != attValues->end(); ++iAtt) {
|
||||
if (iAtt->GetName() == "PostVPath" &&
|
||||
iAtt->GetValue().contains(soughtPVName)) break;
|
||||
}
|
||||
if (iAtt != attValues->end()) { // Required value found
|
||||
fMap.GetColour(soughtPVName, colour);
|
||||
break; // First found pvname determines colour.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G4VisTrajContext myContext(GetContext());
|
||||
|
||||
myContext.SetLineColour(colour);
|
||||
myContext.SetVisible(visible);
|
||||
|
||||
if (GetVerbose()) {
|
||||
G4cout
|
||||
<< "G4TrajectoryDrawByTouchedVolume drawer named " << Name()
|
||||
<< ", drawing trajectory touching physical volume " << soughtPVName
|
||||
<< ", with configuration:" << G4endl;
|
||||
myContext.Print(G4cout);
|
||||
}
|
||||
|
||||
G4TrajectoryDrawerUtils::DrawLineAndPoints(richTrajectory, myContext);
|
||||
|
||||
}
|
||||
|
||||
catch (std::bad_cast)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Requires G4RichTrajectory - \"/vis/scene/add/trajectories rich\"";
|
||||
G4Exception
|
||||
("G4TrajectoryDrawByTouchedVolume::Draw(const G4VTrajectory& traj,...",
|
||||
"modeling0125",
|
||||
JustWarning, ed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::SetDefault(const G4String& colour)
|
||||
{
|
||||
G4Colour myColour;
|
||||
|
||||
// Will not modify default colour if colour key does not exist
|
||||
if (!G4Colour::GetColour(colour, myColour)) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "G4Colour with key "<<colour<<" does not exist ";
|
||||
G4Exception
|
||||
("G4TrajectoryDrawByTouchedParticleID::SetDefault(const G4String& colour)", "modeling0123", JustWarning, ed);
|
||||
return;
|
||||
}
|
||||
|
||||
SetDefault(myColour);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::SetDefault(const G4Colour& colour)
|
||||
{
|
||||
fDefault = colour;
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::Set(const G4String& pvname, const G4String& colour)
|
||||
{
|
||||
fMap.Set(pvname, colour);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::Set(const G4String& pvname, const G4Colour& colour)
|
||||
{
|
||||
fMap[pvname] = colour;
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryDrawByTouchedVolume::Print(std::ostream& ostr) const
|
||||
{
|
||||
ostr
|
||||
<< "G4TrajectoryDrawByTouchedVolume model "<< Name()
|
||||
<< ", colour scheme: "
|
||||
<< ", Default " << fDefault
|
||||
<< std::endl;
|
||||
|
||||
fMap.Print(ostr);
|
||||
|
||||
ostr << "Default configuration:" << std::endl;
|
||||
GetContext().Print(ostr);
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4TrajectoryTouchedVolumeFilter.cc 95107 2016-01-26 12:41:11Z allison $
|
||||
//
|
||||
// Filter trajectories according to touched volume name. Only registered
|
||||
// volumes will pass the filter.
|
||||
//
|
||||
// John Allison, Feb 2016
|
||||
//
|
||||
#include "G4TrajectoryTouchedVolumeFilter.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VTrajectoryPoint.hh"
|
||||
#include "G4AttValue.hh"
|
||||
#include "G4RichTrajectory.hh"
|
||||
|
||||
G4TrajectoryTouchedVolumeFilter::G4TrajectoryTouchedVolumeFilter(const G4String& name)
|
||||
:G4SmartFilter<G4VTrajectory>(name)
|
||||
{}
|
||||
|
||||
G4TrajectoryTouchedVolumeFilter::~G4TrajectoryTouchedVolumeFilter() {}
|
||||
|
||||
bool
|
||||
G4TrajectoryTouchedVolumeFilter::Evaluate(const G4VTrajectory& traj) const
|
||||
{
|
||||
try
|
||||
{
|
||||
const G4RichTrajectory& richTrajectory = dynamic_cast<const G4RichTrajectory&>(traj);
|
||||
|
||||
for (const auto& pvname: fVolumes) {
|
||||
for (G4int iPoint = 0; iPoint < richTrajectory.GetPointEntries(); iPoint++) {
|
||||
G4VTrajectoryPoint* point = richTrajectory.GetPoint(iPoint);
|
||||
if (!point) continue;
|
||||
std::vector<G4AttValue>* attValues = point->CreateAttValues();
|
||||
std::vector<G4AttValue>::const_iterator iAtt;
|
||||
for (iAtt = attValues->begin(); iAtt != attValues->end(); ++iAtt) {
|
||||
if (iAtt->GetName() == "PostVPath" &&
|
||||
iAtt->GetValue().contains(pvname)) break;
|
||||
}
|
||||
if (iAtt != attValues->end()) { // Required value found
|
||||
return true; // First found pvname determines selection.
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
catch (std::bad_cast)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Requires G4RichTrajectory - \"/vis/scene/add/trajectories rich\"";
|
||||
G4Exception
|
||||
("G4TrajectoryTouchedVolumeFilter::Evaluate(const G4VTrajectory& traj)",
|
||||
"modeling0126",
|
||||
JustWarning, ed);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryTouchedVolumeFilter::Add(const G4String& volume)
|
||||
{
|
||||
fVolumes.push_back(volume);
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryTouchedVolumeFilter::Print(std::ostream& ostr) const
|
||||
{
|
||||
ostr<<"Volume names registered: "<<G4endl;
|
||||
std::vector<G4String>::const_iterator iter = fVolumes.begin();
|
||||
|
||||
while (iter != fVolumes.end()) {
|
||||
ostr<<*iter<<G4endl;
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4TrajectoryTouchedVolumeFilter::Clear()
|
||||
{
|
||||
// Clear volume vector
|
||||
fVolumes.clear();
|
||||
}
|
||||
Reference in New Issue
Block a user