Commit 956d8fc0 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

Add Cubix in the Gw

parent 7c6dc7e1
......@@ -8,6 +8,7 @@
add_subdirectory (core)
add_subdirectory (physics)
add_subdirectory (gem)
add_subdirectory (gui)
# CMake for GammaWare
# J. Dudouet
#----------------------------------------------------------------------------
# Add modules
#
add_subdirectory (cubix)
#
# cmake file for a standalone program
#
# J. Dudouet
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#
# NAME OF THE PROGRAM : means main is in PROG_NAME.[c,cpp ...] and it gives exec with name PROG_NAME
#
SET(PROG_NAME Cubix)
SET(CMAKE_EXEC_LINKER_FLAGS -static)
#
PROJECT(${PROG_NAME})
MESSAGE("[GW] + root/gui/${PROJECT_NAME}")
#Set C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -Wno-unused-parameter -Wno-sign-compare -Wno-unused-but-set-variable" )
#Set ROOT
set (ROOT_FIND_COMPONENTS Core MathCore Hist Gui Gpad Graf RIO Matrix Physics Thread MultiProc Spectrum)
find_file(ROOT_CONFIG ROOTConfig.cmake HINTS $ENV{ROOTSYS} ${ROOTSYS} ${ROOT_DIR} NO_DEFAULT_PATH PATH_SUFFIXES cmake)
if (ROOT_CONFIG)
include(${ROOT_CONFIG})
include(${ROOT_USE_FILE})
if(ROOT_LIBRARIES AND ROOT_INCLUDE_DIRS)
set(ROOT_FOUND TRUE)
endif()
else()
message(STATUS "ROOTConfig.cmake not found, trying to use FindROOT.cmake...")
find_package(ROOT REQUIRED COMPONENTS Core MathCore Hist Gui Gpad Graf RIO Matrix Physics Thread MultiProc)
INCLUDE_DIRECTORIES( ${ROOT_INCLUDE_DIR} )
LINK_DIRECTORIES( ${ROOT_LIBRARY_DIR} )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}" )
endif()
if(ROOT_FOUND)
include_directories(${ROOT_INCLUDE_DIRS})
else()
message(ERROR "ROOT not found")
endif()
#
# Redirection to the right macro depending on the ROOT version
#
STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}")
IF (found_root_major_vers LESS 6)
MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 6 is required, e.g. \"6.00/00\"")
ENDIF (found_root_major_vers LESS 6)
SET(EXTRA_EXTERNAL_LIBRARIES ${EXTRA_EXTERNAL_LIBRARIES} Core MathCore Hist Gui Gpad Graf RIO Matrix Physics Thread MultiProc Spectrum)
# gw
set (ALL_GW_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/include ${ROOT_INCLUDES})
set(EXTRA_INTERNAL_LIBRARIES GWCORE GWPHYSICS GWTOOLS GWSYSTEM )
#
SET(SourceDir ${CMAKE_CURRENT_SOURCE_DIR}/src)
#
# exe and list of required libraries
SET( PROG_NAME_SRCS ${SourceDir}/Cubix.cpp )
file(GLOB headers ${SourceDir}/*.h)
list(REMOVE_ITEM headers ${SourceDir}/LinkDef.h)
file(GLOB icons ${CMAKE_CURRENT_SOURCE_DIR}/icons/*)
file(GLOB database ${CMAKE_CURRENT_SOURCE_DIR}/DataBase)
file(GLOB sources ${SourceDir}/*.cpp)
include_directories(${SourceDir})
set(CMAKE_INSTALL_MESSAGE LAZY)
ROOT_GENERATE_DICTIONARY(G__${PROG_NAME} ${headers} LINKDEF ${SourceDir}/LinkDef.h )
#
ADD_EXECUTABLE(${PROG_NAME} G__${PROG_NAME}.cxx ${sources} )
TARGET_LINK_LIBRARIES(${PROG_NAME} ${EXTRA_EXTERNAL_LIBRARIES} ${EXTRA_INTERNAL_LIBRARIES})
install(TARGETS ${PROG_NAME} RUNTIME DESTINATION bin)
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${PROG_NAME}_rdict.pcm DESTINATION lib)
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${PROG_NAME}.rootmap DESTINATION lib)
install(FILES ${headers} DESTINATION include COMPONENT headers)
install(FILES ${icons} DESTINATION icons COMPONENT icons)
install(DIRECTORY ${database} DESTINATION ${CMAKE_INSTALL_PREFIX})
How to update the database
1) dowload the zip files (3 files) from: https://www.nndc.bnl.gov/ensarchivals/
2) execute the ExtractFiles script, giving the files to process in argument
#include "iostream"
#include "iomanip"
#include "fstream"
#include "TString.h"
#include "TSystem.h"
#include "TSystemDirectory.h"
#include "TList.h"
#include "TObjArray.h"
using namespace std;
int main(int argc, char **argv)
{
for(int i=0 ; i<argc ; i++)
{
TString FileName = argv[i];
if(!FileName.EndsWith(".zip"))
continue;
gSystem->mkdir("ENSDF",1);
gSystem->mkdir("tmp",1);
if(system(Form("unzip %s -d tmp/",FileName.Data())))
return 1;
TSystemDirectory *dir = new TSystemDirectory("dir","tmp");
TList *lof = dir->GetListOfFiles();
lof->Sort();
for(int ifile=2 ; ifile<lof->GetEntries() ; ifile++)
{
FileName = lof->At(ifile)->GetName();
ifstream file(Form("tmp/%s",FileName.Data()));
TString Buffer;
string line;
Int_t Mass;
TObjArray *arr = FileName.Tokenize(".");
Mass = ((TString)arr->Last()->GetName()).Atoi();
delete arr;
TString NucName="";
ofstream outfile;
while(file)
{
getline(file,line);
Buffer=line;
if(!Buffer.Contains("ADOPTED LEVELS") && NucName=="")
continue;
Bool_t ok = false;
if(Buffer.Contains("ADOPTED LEVELS"))
{
arr = Buffer.Tokenize(" ");
TString test = arr->At(1)->GetName();
if(test == "ADOPTED")
ok = true;
}
if(ok)
{
NucName = arr->First()->GetName();
NucName.ReplaceAll(Form("%d",Mass),"");
NucName.ToLower();
TString firstletter = NucName[0];
firstletter.ToUpper();
NucName.Remove(0,1);
NucName.Prepend(firstletter);
if(NucName.IsAlpha() && NucName.Length()<4)
{
NucName = Form("%d%s",Mass,NucName.Data());
if(outfile.is_open())
outfile.close();
outfile.open(Form("ENSDF/%s.ens",NucName.Data()));
cout<<NucName<<endl;
}
delete arr;
}
outfile<<line<<endl;
}
outfile.close();
}
if(system("rm -rf tmp"))
return 1;
}
return 0;
}
#!/bin/bash
NAME=../ExtractFiles
NAME2=ExtractFiles.cpp
g++ $NAME2 -o $NAME -O6 -g `root-config --cflags` `root-config --cflags --libs` -lProof
This diff is collapsed.
/* XPM */
static char * log_xpm[] = {
"16 16 150 2",
" c None",
". c #443F32",
"+ c #000000",
"@ c #B0AC8E",
"# c #FFFFFD",
"$ c #5A583B",
"% c #281B0D",
"& c #2E270E",
"* c #FFFFED",
"= c #F9EBA4",
"- c #F8E9C4",
"; c #FFFFD5",
"> c #B4AA86",
", c #686745",
"' c #291C1A",
") c #666870",
"! c #F7EFC4",
"~ c #FFFFFF",
"{ c #F8E29D",
"] c #FFEBB2",
"^ c #F7EFAA",
"/ c #F9F3AA",
"( c #FFFFDE",
"_ c #FFFFCC",
": c #2C2C0E",
"< c #FFFFFB",
"[ c #FCEBB1",
"} c #F8EDB9",
"| c #FEECC8",
"1 c #FFFFE2",
"2 c #FFF1DE",
"3 c #F6EE92",
"4 c #FFF4B4",
"5 c #F5DD74",
"6 c #FEFFB1",
"7 c #3C3909",
"8 c #625F52",
"9 c #F6E7C3",
"0 c #FEFBFE",
"a c #FCE59E",
"b c #FBFFC8",
"c c #FE765A",
"d c #FFA794",
"e c #FFFCC9",
"f c #FEE996",
"g c #FFFFC6",
"h c #FFFFE1",
"i c #F7FBB7",
"j c #FE8E8A",
"k c #FEFFFD",
"l c #FBF7C6",
"m c #FDA294",
"n c #F3FFC9",
"o c #FFA48A",
"p c #FBF3A8",
"q c #F5D674",
"r c #FFFD8A",
"s c #BBB89E",
"t c #F5EEB2",
"u c #FF796C",
"v c #FEFFFA",
"w c #FA8A58",
"x c #FFA888",
"y c #FFB09E",
"z c #F4FFC5",
"A c #FDB9A6",
"B c #FEA57B",
"C c #F8C477",
"D c #9A9666",
"E c #1C190E",
"F c #FFFFBD",
"G c #F78153",
"H c #FBFFCE",
"I c #F8FEC9",
"J c #FF7764",
"K c #FEE5CF",
"L c #F8E69A",
"M c #F3FF9C",
"N c #FF744D",
"O c #F5C585",
"P c #FCEFA3",
"Q c #595318",
"R c #FFFFDD",
"S c #FE786C",
"T c #FEFFD2",
"U c #FFF7BC",
"V c #F6DB5E",
"W c #EFF7A8",
"X c #FFFCD3",
"Y c #EFE87A",
"Z c #FFFFE7",
"` c #FE5851",
" . c #E3E97C",
".. c #FFFF9F",
"+. c #111206",
"@. c #ADA487",
"#. c #EEE979",
"$. c #F8E9A8",
"%. c #FFFFD9",
"&. c #F1E688",
"*. c #FFFFD7",
"=. c #E7DA81",
"-. c #EDDC87",
";. c #F0D989",
">. c #FEFFA3",
",. c #ECDD7A",
"'. c #DCD869",
"). c #000002",
"!. c #33320E",
"~. c #B4AE65",
"{. c #FFFFC3",
"]. c #F9F5A6",
"^. c #E9DF81",
"/. c #E5D070",
"(. c #FFFFCA",
"_. c #FFFFDF",
":. c #E5D76F",
"<. c #FFFFD0",
"[. c #FFFFAD",
"}. c #EDE18A",
"|. c #F8F09B",
"1. c #5F5921",
"2. c #090907",
"3. c #020204",
"4. c #2C2605",
"5. c #B4B061",
"6. c #FDFDCA",
"7. c #E7E188",
"8. c #DED259",
"9. c #E3D771",
"0. c #FFFDA4",
"a. c #FFFF9B",
"b. c #E5D769",
"c. c #FFFFA5",
"d. c #454313",
"e. c #050505",
"f. c #696120",
"g. c #B2AB62",
"h. c #FFFFBF",
"i. c #FDFFB5",
"j. c #E8DC7B",
"k. c #DED368",
"l. c #F6EF8B",
"m. c #D9D15B",
"n. c #6A622A",
"o. c #ADA95B",
"p. c #FFFFA3",
"q. c #FFFCA6",
"r. c #37370D",
"s. c #4D4D14",
" . + ",
" @ # $ % + ",
" & * = - # ; > , ' + ",
" ) ! ~ ~ { ] ^ / ( _ : ",
" + < [ } | 1 2 3 4 5 6 7 ",
" 8 9 0 ~ a b c d e f g ",
" + h i j k l m n o p q r ",
" s t u v w x y z A B C D ",
" E F G H I J K L M N O P Q ",
" + R S T U V W X Y Z ` ...+. ",
" @.#.$.%.&.h *.=.-.;.>.,.'.). ",
"!.~.{.].^./.(._.:.<.[.}.|.1.2.3.",
" 4.5.{.6.7.8.9.0.a.b.c.d.e. ",
" f.g.h.i.j.k.l.m.+ ",
" n.o.p.q.r. ",
" s. "};
/* XPM */
static char *_about[] = {
/* width height num_colors chars_per_pixel */
" 16 16 256 2",
/* colors */
"`` c #000000",
"`. c #ff0000",
"`# c #00ff00",
"`a c #0000ff",
"`b c #ffff00",
"`c c #00ffff",
"`d c #ff00ff",
"`e c #ffffff",
"`f c #7b7b7b",
"`g c None s None",
"`h c #7b7b7b",
"`i c #7b7b7b",
"`j c #7b7b7b",
"`k c #7b7b7b",
"`l c #7b7b7b",
"`m c #7b7b7b",
"`n c #7b7b7b",
"`o c #7b7b7b",
"`p c #7b7b7b",
"`q c #7b7b7b",
"`r c #7b7b7b",
"`s c #7b7b7b",
"`t c #7b7b7b",
"`u c #7b7b7b",
"`v c #7b7b7b",
"`w c #7b7b7b",
"`x c #7b7b7b",
"`y c #7b7b7b",
"`z c #7b7b7b",
"`A c #7b7b7b",
"`B c #7b7b7b",
"`C c #7b7b7b",
"`D c #7b7b7b",
"`E c #7b7b7b",
"`F c #7b7b7b",
"`G c #7b7b7b",
"`H c #7b7b7b",
"`I c #7b7b7b",
"`J c #7b7b7b",
"`K c #7b7b7b",
"`L c #7b7b7b",
"`M c #7b7b7b",
"`N c #7b7b7b",
"`O c #7b7b7b",
"`P c #7b7b7b",
"`Q c #7b7b7b",
"`R c #7b7b7b",
"`S c #7b7b7b",
"`T c #7b7b7b",
"`U c #7b7b7b",
"`V c #7b7b7b",
"`W c #7b7b7b",
"`X c #7b7b7b",
"`Y c #7b7b7b",
"`Z c #7b7b7b",
"`0 c #7b7b7b",
"`1 c #7b7b7b",
"`2 c #7b7b7b",
"`3 c #7b7b7b",
"`4 c #7b7b7b",
"`5 c #7b7b7b",
"`6 c #7b7b7b",
"`7 c #7b7b7b",
"`8 c #7b7b7b",
".` c #7b7b7b",
".. c #7b7b7b",
".# c #7b7b7b",
".a c #7b7b7b",
".b c #7b7b7b",
".c c #7b7b7b",
".d c #7b7b7b",
".e c #7b7b7b",
".f c #7b7b7b",
".g c #7b7b7b",
".h c #7b7b7b",
".i c #7b7b7b",
".j c #7b7b7b",
".k c #7b7b7b",
".l c #7b7b7b",
".m c #7b7b7b",
".n c #7b7b7b",
".o c #7b7b7b",
".p c #7b7b7b",
".q c #7b7b7b",
".r c #7b7b7b",
".s c #7b7b7b",
".t c #7b7b7b",
".u c #7b7b7b",
".v c #7b7b7b",
".w c #7b7b7b",
".x c #7b7b7b",
".y c #7b7b7b",
".z c #7b7b7b",
".A c #7b7b7b",
".B c #7b7b7b",
".C c #7b7b7b",
".D c #7b7b7b",
".E c #7b7b7b",
".F c #7b7b7b",
".G c #7b7b7b",
".H c #7b7b7b",
".I c #7b7b7b",
".J c #7b7b7b",
".K c #7b7b7b",
".L c #7b7b7b",
".M c #7b7b7b",
".N c #7b7b7b",
".O c #7b7b7b",
".P c #7b7b7b",
".Q c #7b7b7b",
".R c #7b7b7b",
".S c #7b7b7b",
".T c #7b7b7b",
".U c #7b7b7b",
".V c #7b7b7b",
".W c #7b7b7b",
".X c #7b7b7b",
".Y c #7b7b7b",
".Z c #7b7b7b",
".0 c #7b7b7b",
".1 c #7b7b7b",
".2 c #7b7b7b",
".3 c #7b7b7b",
".4 c #7b7b7b",
".5 c #7b7b7b",
".6 c #7b7b7b",
".7 c #7b7b7b",
".8 c #7b7b7b",
"#` c #7b7b7b",
"#. c #7b7b7b",
"## c #7b7b7b",
"#a c #7b7b7b",
"#b c #7b7b7b",
"#c c #7b7b7b",
"#d c #7b7b7b",
"#e c #7b7b7b",
"#f c #7b7b7b",
"#g c #7b7b7b",
"#h c #7b7b7b",
"#i c #7b7b7b",
"#j c #7b7b7b",
"#k c #7b7b7b",
"#l c #7b7b7b",
"#m c #7b7b7b",
"#n c #7b7b7b",
"#o c #7b7b7b",
"#p c #7b7b7b",
"#q c #7b7b7b",
"#r c #7b7b7b",
"#s c #7b7b7b",
"#t c #7b7b7b",
"#u c #7b7b7b",
"#v c #7b7b7b",
"#w c #7b7b7b",
"#x c #7b7b7b",
"#y c #7b7b7b",
"#z c #7b7b7b",
"#A c #7b7b7b",
"#B c #7b7b7b",
"#C c #7b7b7b",
"#D c #7b7b7b",
"#E c #7b7b7b",
"#F c #7b7b7b",
"#G c #7b7b7b",
"#H c #7b7b7b",
"#I c #7b7b7b",
"#J c #7b7b7b",
"#K c #7b7b7b",
"#L c #7b7b7b",
"#M c #7b7b7b",
"#N c #7b7b7b",
"#O c #7b7b7b",
"#P c #7b7b7b",
"#Q c #7b7b7b",
"#R c #7b7b7b",
"#S c #7b7b7b",
"#T c #7b7b7b",
"#U c #7b7b7b",
"#V c #7b7b7b",
"#W c #7b7b7b",
"#X c #7b7b7b",
"#Y c #7b7b7b",
"#Z c #7b7b7b",
"#0 c #7b7b7b",
"#1 c #7b7b7b",
"#2 c #7b7b7b",
"#3 c #7b7b7b",
"#4 c #7b7b7b",
"#5 c #7b7b7b",
"#6 c #7b7b7b",
"#7 c #7b7b7b",
"#8 c #7b7b7b",
"a` c #7b7b7b",
"a. c #7b7b7b",
"a# c #7b7b7b",
"aa c #7b7b7b",
"ab c #7b7b7b",
"ac c #7b7b7b",
"ad c #7b7b7b",
"ae c #7b7b7b",
"af c #7b7b7b",
"ag c #7b7b7b",
"ah c #7b7b7b",
"ai c #7b7b7b",
"aj c #7b7b7b",
"ak c #7b7b7b",
"al c #7b7b7b",
"am c #7b7b7b",
"an c #7b7b7b",
"ao c #7b7b7b",
"ap c #7b7b7b",