Index: trunk/examples/convergenceTestRuncard.txt
===================================================================
--- trunk/examples/convergenceTestRuncard.txt (revision 0)
+++ trunk/examples/convergenceTestRuncard.txt (revision 350)
@@ -0,0 +1,136 @@
+//==============================================================================
+// tableGeneratorRuncard.txt
+//
+// Copyright (C) 2010-2016 Tobias Toll and Thomas Ullrich
+//
+// This file is part of Sartre.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation.
+// This program is distributed in the hope that it will be useful,
+// but without any warranty; without even the implied warranty of
+// merchantability or fitness for a particular purpose. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Author: Tobias Toll
+// Last update:
+// $Date: 2017-03-01 01:36:16 +0530 (Wed, 01 Mar 2017) $
+// $Author: ullrich $
+//==============================================================================
+//
+// Example Runcard for Sartre Table Generator.
+//
+// Comments start with a # or #
+//
+// Name and value are separated by a "=": name = value
+// (alternatively ":" can be used as well)
+//==============================================================================
+#
+# Nucleus number
+#
+A = 2
+
+#
+# Which moments of the amplitude to calculate:
+# 0 analytical, averaged over configurations
+# 1 only, analytical
+# 2 , and both averaged over configurations
+#
+modesToCalculate = 2
+
+#
+# Rootfile This is a prefix table type (T and L, or T2 and L2) and ".root" will be appended
+#
+numberOfConfigurations = 100
+
+rootfile = test_100.root
+
+#
+# Model parameters
+#
+vectorMesonId = 443
+dipoleModel = bSat
+dipoleModelParameterSet = KMW
+
+#
+# Table Set Type (experts only)
+#
+tableSetType = total_and_coherent
+#tableSetType = coherent_and_incoherent
+
+#
+# Developer only
+# Only takes affect when dipoleModelParameterSet = CUSTOM
+# All parameters must be given.
+#
+# For bSat and bNonSat (8 parameters):
+# m_u m_d m_s m_c BG mu02 lambdaG Ag
+# For bCGC (10 parameters):
+# m_u m_d m_s m_c dkappa dN0 dx0 dlambda dgammas dBcgc
+#
+#dipoleModelCustomParameters = 0.14 0.14 0.14 1.27 4. 1.51 0.058 2.308
+
+
+# Path for the b-dependence lookup table for bSat. Not used with bCGC.
+bSatLookupPath = /home/tollto/sartreSVN/sartre/bSatLookupTables/
+
+
+#
+# Kinematic range
+#
+# EIC limits:
+# Say we aim s = 20000 (30000 for pp)
+# That implies:
+# Q2 = 0.0001 - 20000 (or with x<1e-2, Q2<200)
+# t = -3 - 0
+# W2 = 1 - 20000 (W = 1-141)
+#
+
+Q2min = 0.01
+Q2max = 20.
+Wmin = 10
+Wmax = 380
+tmin = -.5
+tmax = -.0
+
+#H1 DVCS:
+#Q2min = 6.5
+#Q2max = 80.
+#Wmin = 30
+#Wmax = 140
+#tmin = -1.
+#tmax = -.0
+
+
+#
+# Number of bins in the tables:
+#
+#
+# ZEUS test, bin density for
+# 40x40x40: 64000/(99.85*190*1)=3.37 bins/GeV^5
+#
+# Or in different directions:
+# Q2: 40/100=0.4 bins/GeV^2
+# W: 40/190=0.21 bins/GeV
+# t: 40/1= 40 bins/GeV^2
+#
+Q2bins = 20
+W2bins = 20
+tbins = 50
+
+#
+# If a run fails, use the backup and continue:
+# If in doubt use the tableInspector to make sure the rest
+# of the runcard is as it should be.
+#
+useBackupFile = false
+startingBinFromBackup=2
+
+#
+# If the table you are making should take presendence
+# over previous tables, make it with a higher priority
+#
+priority = 0
Index: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt (revision 349)
+++ trunk/examples/CMakeLists.txt (revision 350)
@@ -1,160 +1,162 @@
#===============================================================================
# CMakeLists.txt (examples)
#
# Copyright (C) 2010-2016 Tobias Toll and Thomas Ullrich
#
# This file is part of Sartre.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
# Author: Thomas Ullrich
# Last update:
# $Date$
# $Author$
#===============================================================================
cmake_minimum_required (VERSION 3.1)
project(SARTRE_EXAMPLES)
#
# Compiler options
#
set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#
# Set the location of the installed sartre package
#
set(SARTRE_DIR "$ENV{SARTRE_DIR}")
if (IS_DIRECTORY "${SARTRE_DIR}" AND
IS_DIRECTORY "${SARTRE_DIR}/lib" AND
IS_DIRECTORY "${SARTRE_DIR}/include" AND
IS_DIRECTORY "${SARTRE_DIR}/gemini" AND
IS_DIRECTORY "${SARTRE_DIR}/tables")
message (STATUS "Using Sartre installed in ${SARTRE_DIR}")
else()
message(FATAL_ERROR "Environment variable SARTRE_DIR does not point to a valid Sartre installation.")
endif()
message(STATUS "System = ${CMAKE_SYSTEM}")
#
# User can select if Sartre is to be compiled
# in multithreaded mode or not.
# Default is off.
# cmake -DMULTITHREADED=ON .
#
option(MULTITHREADED "Switch on/off multithreaded mode" OFF)
if (MULTITHREADED)
add_definitions(-DSARTRE_IN_MULTITHREADED_MODE)
message (STATUS "MULTITHREADED mode is ON")
endif (MULTITHREADED)
#
# See if optional libraries (Glut & OpenGL) are present.
# If not skip the examples that require them.
#
# GLUT
#find_package(GLUT)
#if (GLUT_FOUND)
# message("blah")
# include_directories(${GLUT_INCLUDE_DIR})
# set(LIBS ${LIBS} ${GLUT_LIBRARIES})
#endif()
# OpenGL
find_package(OpenGL)
if (OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
endif()
#
# Built all programs in example directory
#
add_executable(createBSatBDependenceTable createBSatBDependenceTable.cpp)
add_executable(heraCompare heraCompare.cpp)
add_executable(sartreMain sartreMain.cpp)
add_executable(sartreTest sartreTest.cpp)
add_executable(tableGeneratorMain tableGeneratorMain.cpp)
add_executable(tableGeneratorUPCMain tableGeneratorUPCMain.cpp)
add_executable(lambdaGeneratorMain lambdaGeneratorMain.cpp)
+add_executable(convergenceTest convergenceTest.cpp)
#if (OPENGL_FOUND AND GLUT_FOUND)
# add_executable(nucleusAnimation nucleusAnimation.cpp)
#endif()
#
# Make sure the files to search for external libraries are available
#
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
#
# Compiler options
#
set(CMAKE_C_FLAGS_DEBUG " -g -W")
set(CMAKE_CXX_FLAGS_DEBUG " -g -W -Wall -Wextra -pedantic -Wno-long-long -std=c++11")
set(CMAKE_C_FLAGS_RELEASE " -O -W")
set(CMAKE_CXX_FLAGS_RELEASE " -O -W -Wall -Wextra -pedantic -Wno-long-long -std=c++11")
set(CMAKE_C_FLAGS " -O -W")
set(CMAKE_CXX_FLAGS " -O -std=c++11 -W -Wall -Wextra -pedantic -Wno-long-long")
#
# Include files locations
#
include_directories("${SARTRE_DIR}/include")
#
# Find external required packages
# (see also FindGSL.cmake and FindROOT.cmke in cmake/modules)
#
# GSL
find_package(GSL REQUIRED)
include_directories(${GSL_INCLUDE_DIR})
set(LIBS ${LIBS} ${GSL_LIBRARIES})
# ROOT
find_package(ROOT REQUIRED)
include_directories(${ROOT_INCLUDE_DIR})
set(LIBS ${LIBS} ${ROOT_LIBRARIES} "-lEG -lMathMore -lUnuran" )
#BOOST
if (MULTITHREADED)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.39 COMPONENTS thread REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
set(LIBS ${LIBS} ${Boost_LIBRARIES} -lboost_system)
endif(Boost_FOUND)
endif (MULTITHREADED)
#
# Libraries to link with
#
#link_directories(${SARTRE_DIR}/lib)
file (GLOB ALLSARTRE ${SARTRE_DIR}/lib/*)
set(LIBS ${ALLSARTRE} ${ALLSARTRE} ${LIBS} ${ALLSARTRE})
target_link_libraries(createBSatBDependenceTable ${LIBS})
target_link_libraries(heraCompare ${LIBS})
target_link_libraries(sartreMain ${LIBS})
target_link_libraries(sartreTest ${LIBS})
target_link_libraries(tableGeneratorMain ${LIBS})
target_link_libraries(tableGeneratorUPCMain ${LIBS})
target_link_libraries(lambdaGeneratorMain ${LIBS})
+target_link_libraries(convergenceTest ${LIBS})
#if (OPENGL_FOUND AND GLUT_FOUND)
# target_link_libraries(nucleusAnimation ${LIBS})
#endif()
Index: trunk/examples/convergenceTest.cpp
===================================================================
--- trunk/examples/convergenceTest.cpp (revision 0)
+++ trunk/examples/convergenceTest.cpp (revision 350)
@@ -0,0 +1,94 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include "Amplitudes.h"
+#include "TROOT.h"
+#include "TH1D.h"
+#include "TFile.h"
+#include "Nucleus.h"
+#include "Constants.h"
+#include "Table.h"
+#include "TableGeneratorSettings.h"
+#include "Enumerations.h"
+#include "DglapEvolution.h"
+#include "Version.h"
+
+#define PR(x) cout << #x << " = " << (x) << endl;
+
+using namespace std;
+
+int main(int argc, char *argv[]) {
+ TH1::AddDirectory(false); // to explicitly delete all new histograms by hand
+ TableGeneratorSettings* settings = TableGeneratorSettings::instance();
+
+ //
+ // Check arguments
+ //
+ char* runcard;
+ if (argc != 4) {
+ cout << "Usage: tableGeneratorMain runcard startBin endBin" << endl;
+ return 2;
+ }
+ else {
+ runcard = argv[1];
+ settings->setStartBin(atoi(argv[2]));
+ settings->setEndBin(atoi(argv[3]));
+ }
+
+ cout << "Reading settings from runcard." << endl;
+ settings->readSettingsFromFile(runcard);
+ settings->consolidateSettings();
+
+ string rootfile;
+ if (argc == 3) {
+ rootfile = argv[2];
+ settings->setRootfile(argv[2]);
+ }
+ else
+ rootfile = settings->rootfile();
+
+ TFile *hfile = 0;
+ if (rootfile.size()) {
+ hfile = new TFile(rootfile.c_str(),"RECREATE");
+ cout << "ROOT file is '" << rootfile.c_str() << "'." << endl;
+ }
+
+ //
+ // Create and initialize the amplitudes calculator
+ //
+ Amplitudes amps;
+
+ //
+ // Generate the the nucleon configurations
+ //
+ amps.generateConfigurations();
+
+ int numBins=100;
+ TH1D* hCoherentT = new TH1D("hCoherentT", "hCoherentT", numBins, 0, 0.5);
+ TH1D* hCoherentL = new TH1D("hCoherentL", "hCoherentL", numBins, 0, 0.5);
+ TH1D* hTotalT = new TH1D("hTotalT", "hTotalT", numBins, 0, 0.5);
+ TH1D* hTotalL = new TH1D("hTotalL", "hTotalL", numBins, 0, 0.5);
+ double Q2=2.;
+ double W2=2000;
+ for(int i=1; i<=numBins; i++){
+ PR(i);
+ double t=-hCoherentT->GetBinCenter(i);
+ double kinematicPoint[3]={t, Q2, W2};
+ amps.calculate(kinematicPoint);
+ double aT=amps.amplitudeT();
+ double aL=amps.amplitudeL();
+ double aT2=amps.amplitudeT2();
+ double aL2=amps.amplitudeL2();
+
+ hCoherentT->SetBinContent(i, aT*aT);
+ hCoherentL->SetBinContent(i, aL*aL);
+ hTotalT->SetBinContent(i, aT2);
+ hTotalL->SetBinContent(i, aL2);
+ }
+ hfile->Write();
+
+ return 0;
+}