Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8cfd0bcc4a | |||
| 7198521f60 | |||
| 834884f3a4 | |||
| 80591f6f13 | |||
| 44456c49e9 | |||
| 495f02c3c6 | |||
| ad2e84581f | |||
| 59dbae4a1e | |||
| 4d176c395c | |||
| 74978025fb | |||
| deeee783f5 | |||
| cadd28b9fe | |||
| 79c8be54bf | |||
| 3cf89c6571 | |||
| 673a742631 | |||
| f68775dd64 | |||
| 23bf2ec2fc | |||
| 23ac67a443 | |||
| d6a3767040 | |||
| 75d0c9e01a | |||
| ecd9e4a953 | |||
| 3c2b0322c0 | |||
| 4747fbc77d | |||
| b1b808ad7b | |||
| 2d1875ebfe | |||
| d221ef1ed0 | |||
| f7c45f46ff | |||
| 5b093208eb | |||
| 7a1f60d00f | |||
| de2d8394d3 | |||
| af13e78c52 | |||
| 7691ef2815 | |||
| 8f4a7c6b68 | |||
| 1cb0cfd3e7 | |||
| 344a5c8ba0 |
@@ -1,7 +1,7 @@
|
||||
# - musrfit
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
project(musrfit VERSION 1.9.2 LANGUAGES C CXX)
|
||||
project(musrfit VERSION 1.9.3 LANGUAGES C CXX)
|
||||
|
||||
#--- musrfit specific options -------------------------------------------------
|
||||
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
||||
@@ -222,6 +222,29 @@ else ()
|
||||
set(IS_GIT_REPO 0)
|
||||
endif ()
|
||||
|
||||
#--- rpath related things -----------------------------------------------------
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
if("${isSystemDir}" STREQUAL "-1")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endif("${isSystemDir}" STREQUAL "-1")
|
||||
set(rpath ${CMAKE_INSTALL_RPATH})
|
||||
string(APPEND rpath ";/usr/local/lib")
|
||||
set(CMAKE_INSTALL_RPATH "${rpath}")
|
||||
|
||||
#--- propagate to the sub-directories -----------------------------------------
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = "mupp"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.0.0
|
||||
PROJECT_NUMBER = 1.1.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
|
||||
\mainpage musrfit - a framework to analyse muSR data.
|
||||
|
||||
<p>This pages here are meant to explain the software structure of the musrfit framework. Only the core-classes
|
||||
are described, *i.e.* not the Qt GUI related stuff.
|
||||
<p>This pages here are meant to explain the software structure of the musrfit framework.
|
||||
|
||||
<p>People merely interested in the handling of the programs should check this link:
|
||||
\htmlonly
|
||||
@@ -64,13 +63,9 @@ under Linux, Mac OS X, and (with some more work) under Windows. The musrfit fram
|
||||
|
||||
\section roadmap Road map and missing features
|
||||
|
||||
<p>Support for NeXus files is fully available from early 2012 on.
|
||||
|
||||
<p>The following features should eventually be implemented, but are still missing:
|
||||
- non-muSR: The plan is to add an option to fit/plot \f$f(x_1,\ldots,x_n)\f$ versus \f$g(x_1,\ldots,x_n)\f$, where \f$x_i\f$ is a given data set element.
|
||||
- as soon as ROOT will properly support MS Windows platforms, some better support for MS Windows will be added. Currently only the cygwin version will be supported.
|
||||
- add an interface to maxent
|
||||
- we will provide rpm's for various linux flavors.
|
||||
|
||||
\section shortComings Short comings of the current musrfit design
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = musrfit
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.6.0
|
||||
PROJECT_NUMBER = 1.9.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -655,7 +655,9 @@ void PFunction::EvalTreeForStringExpression(iter_t const& i)
|
||||
assert(i->children.size() == 2);
|
||||
EvalTreeForStringExpression(i->children.begin());
|
||||
fFuncString += " / ";
|
||||
fFuncString += "(";
|
||||
EvalTreeForStringExpression(i->children.begin()+1);
|
||||
fFuncString += ")";
|
||||
} else {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Bastian M. Wojek / Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Bastian M. Wojek / Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -1302,8 +1302,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
|
||||
|
||||
if (newRunNumber.str().compare(tempRunNumber.str())) { // first run number does not match the template run number
|
||||
// in global+ mode, read in the single run msr-file of the corresponding run
|
||||
if (globalPlus)
|
||||
if (globalPlus) {
|
||||
singleRunMsrFile = GetSingleRunMsrFile();
|
||||
if (singleRunMsrFile == nullptr)
|
||||
return false;
|
||||
}
|
||||
|
||||
// substitute the template run-numbers in the parameter names
|
||||
for (unsigned int l(fNumGlobalParam); l < msrParamList->size(); ++l) {
|
||||
@@ -1380,8 +1383,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
|
||||
newRunNumber << *fRunVectorIter;
|
||||
|
||||
// in global+ mode, read in the single run msr-file
|
||||
if (globalPlus)
|
||||
if (globalPlus) {
|
||||
singleRunMsrFile = GetSingleRunMsrFile();
|
||||
if (singleRunMsrFile == nullptr)
|
||||
return false;
|
||||
}
|
||||
|
||||
// add parameters for each run
|
||||
for (unsigned int l(0); l < fNumSpecParam; ++l) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2018-2023 by Zaher Salman *
|
||||
* Copyright (C) 2018-2024 by Zaher Salman *
|
||||
* zaher.salman@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -91,7 +91,7 @@ int parseXmlFile(TSAXParser *saxParser, const char *startup_path_name)
|
||||
/**
|
||||
* <p>Constructor. Check if the musrfit_startup.xml file is found in some standard search paths
|
||||
*/
|
||||
PStartupHandler::PStartupHandler()
|
||||
PStartupHandler::PStartupHandler(bool reset_startup_file)
|
||||
{
|
||||
fStartupFileFound = false;
|
||||
fStartupFilePath = "";
|
||||
@@ -145,6 +145,17 @@ PStartupHandler::PStartupHandler()
|
||||
}
|
||||
}
|
||||
|
||||
// musrfit_startup.xml found. Check if it should be rewritten
|
||||
if (fStartupFileFound && reset_startup_file) {
|
||||
std::cout << std::endl;
|
||||
std::cout << ">> Will only reset the file: '" << fStartupFilePath.Data() << "'."<< std::endl;
|
||||
std::cout << std::endl;
|
||||
if (!WriteDefaultStartupFile(reset_startup_file)) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't re-write " << fStartupFilePath.Data() << "." << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if musrfit_startup.xml is still not found, will create a default one
|
||||
if (!fStartupFileFound) {
|
||||
std::cout << std::endl << "**INFO** no musrfit_startup.xml file found, will write a default one." << std::endl;
|
||||
@@ -606,33 +617,37 @@ Bool_t PStartupHandler::StartupFileExists(Char_t *fln)
|
||||
//--------------------------------------------------------------------------
|
||||
// WriteDefaultStartupFile
|
||||
//--------------------------------------------------------------------------
|
||||
Bool_t PStartupHandler::WriteDefaultStartupFile()
|
||||
Bool_t PStartupHandler::WriteDefaultStartupFile(bool reset_startup_file)
|
||||
{
|
||||
// get home
|
||||
Char_t startup_path_name[256];
|
||||
Char_t *home = nullptr;
|
||||
home = getenv("HOME");
|
||||
if (home == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't obtain $HOME." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// first check that $HOME/.musrfit exists and if NOT create it
|
||||
struct stat info;
|
||||
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
|
||||
if (!stat(startup_path_name, &info)) {
|
||||
if (!(info.st_mode & S_IFDIR))
|
||||
return false;
|
||||
} else {
|
||||
if (mkdir(startup_path_name, 0777)) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't create '" << startup_path_name << "'" << std::endl;
|
||||
if (reset_startup_file) { // reset the found
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s", fStartupFilePath.Data());
|
||||
} else { // no musrfit_startup.xml found, hence write default under $HOME/.musrfit
|
||||
// get home
|
||||
Char_t *home = nullptr;
|
||||
home = getenv("HOME");
|
||||
if (home == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't obtain $HOME." << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// set path-name for musrfit_startup.xml
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
|
||||
// first check that $HOME/.musrfit exists and if NOT create it
|
||||
struct stat info;
|
||||
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
|
||||
if (!stat(startup_path_name, &info)) {
|
||||
if (!(info.st_mode & S_IFDIR))
|
||||
return false;
|
||||
} else {
|
||||
if (mkdir(startup_path_name, 0777)) {
|
||||
std::cerr << std::endl << "**ERROR** couldn't create '" << startup_path_name << "'" << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// set path-name for musrfit_startup.xml
|
||||
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
|
||||
}
|
||||
|
||||
std::ofstream fout(startup_path_name, std::ofstream::out);
|
||||
if (!fout.is_open()) {
|
||||
@@ -648,29 +663,36 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
|
||||
fout << " </comment>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/nemu/data/his</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/nemu/data/wkm</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/misc</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/gps</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/dolly</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/gpd</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/ltf</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/alc</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/alc/td</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/hifi</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/lem</data_path>" << std::endl;
|
||||
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/flame</data_path>" << std::endl;
|
||||
fout << " <!-- MISC/PSI 1985 - 1990 -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"misc\">d%yyyy%/deltat_misc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <!-- ALC TD/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"alc\">d%yyyy%/deltat_zh_chem_%rrrr%.bin</run_name_template>" << std:: endl;
|
||||
fout << " <run_name_template inst=\"alc\">d%yyyy%/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"alc\">d%yyyy%/tdc/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <!-- Dolly/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie1/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie3/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/deltat_tdc_dolly_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/mdu/deltat_tdc_dolly_%rrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <!-- Flame/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/deltat_tdc_flame_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/mdu/deltat_tdc_flame_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <!-- GPD/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_mue1_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_fq_si_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_strobo_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
@@ -681,10 +703,11 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_gpd_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/pta/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/deltat_tdc_gpd_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/mdu/deltat_tdc_gpd_%rrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <!-- GPS/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_ccr_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_he3_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_stutt_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
@@ -695,14 +718,15 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_oven2_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_pta_gps_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/deltat_tdc_gps_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/mdu/deltat_tdc_gps_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <!-- HAL-9500/PSI == HIFI/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/deltat_hifi_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/tdc_hifi_%yyyy%_%rrrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
|
||||
fout << " <!-- LTF/PSI -->" << std::endl;
|
||||
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf2_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"ltf\">d%yyyy%/pta/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
fout << " <run_name_template inst=\"ltf\">d%yyyy%/tdc/deltat_tdc_ltf_%rrrr%.bin</run_name_template>" << std::endl;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
17
src/external/BMWtools/BMWIntegrator.h
vendored
17
src/external/BMWtools/BMWIntegrator.h
vendored
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
@@ -88,10 +89,8 @@ inline double T2Integrator::IntegrateFunc(double x1, double x2, const std::vecto
|
||||
ptrPair.first = (this);
|
||||
ptrPair.second = ∥
|
||||
|
||||
ROOT::Math::GSLIntegrator *integrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
std::unique_ptr<ROOT::Math::GSLIntegrator> integrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
double value(integrator->Integral(&T2Integrator::FuncAtXgsl, static_cast<void*>(&ptrPair), x1, x2));
|
||||
delete integrator;
|
||||
integrator = nullptr;
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -115,7 +114,7 @@ class TIntegrator {
|
||||
|
||||
private:
|
||||
static double FuncAtXgsl(double, void *);
|
||||
ROOT::Math::GSLIntegrator *fIntegrator; ///< pointer to the GSL integrator
|
||||
std::unique_ptr<ROOT::Math::GSLIntegrator> fIntegrator; ///< pointer to the GSL integrator
|
||||
mutable double (*fFunc)(double, void *); ///< pointer to the integrand function
|
||||
};
|
||||
|
||||
@@ -125,7 +124,7 @@ class TIntegrator {
|
||||
* Allocation of memory for an integration using the adaptive 31 point Gauss-Kronrod rule
|
||||
*/
|
||||
inline TIntegrator::TIntegrator() : fFunc(0) {
|
||||
fIntegrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
fIntegrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -135,8 +134,6 @@ inline TIntegrator::TIntegrator() : fFunc(0) {
|
||||
*/
|
||||
inline TIntegrator::~TIntegrator(){
|
||||
fPar.clear();
|
||||
delete fIntegrator;
|
||||
fIntegrator=nullptr;
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
@@ -190,7 +187,7 @@ class TMCIntegrator {
|
||||
|
||||
private:
|
||||
static double FuncAtXgsl(double *, size_t, void *);
|
||||
ROOT::Math::GSLMCIntegrator *fMCIntegrator; ///< pointer to the GSL integrator
|
||||
std::unique_ptr<ROOT::Math::GSLMCIntegrator> fMCIntegrator; ///< pointer to the GSL integrator
|
||||
mutable double (*fFunc)(double *, size_t, void *); ///< pointer to the integrand function
|
||||
};
|
||||
|
||||
@@ -200,7 +197,7 @@ class TMCIntegrator {
|
||||
* Allocation of memory for an integration using the MISER algorithm of Press and Farrar
|
||||
*/
|
||||
inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
||||
fMCIntegrator = new ROOT::Math::GSLMCIntegrator(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
|
||||
fMCIntegrator = std::make_unique<ROOT::Math::GSLMCIntegrator>(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -210,8 +207,6 @@ inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
|
||||
*/
|
||||
inline TMCIntegrator::~TMCIntegrator(){
|
||||
fPar.clear();
|
||||
delete fMCIntegrator;
|
||||
fMCIntegrator=nullptr;
|
||||
fFunc=0;
|
||||
}
|
||||
|
||||
|
||||
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
@@ -11,7 +11,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter, Bastian M. Wojek *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/BMWtools/BMWStartupHandler.h
vendored
2
src/external/BMWtools/BMWStartupHandler.h
vendored
@@ -11,7 +11,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter, Bastian M. Wojek *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
190
src/external/BMWtools/TTrimSPDataHandler.cpp
vendored
190
src/external/BMWtools/TTrimSPDataHandler.cpp
vendored
@@ -33,37 +33,33 @@
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
#include <memory>
|
||||
|
||||
//--------------------
|
||||
// Constructor of the TrimSPData class -- reading all available trim.SP-rge-files with a given name into std::vectors
|
||||
//--------------------
|
||||
|
||||
TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool debug, unsigned int highRes) {
|
||||
TTrimSPData::TTrimSPData(const std::string &path, std::map<double, std::string> &energies, bool debug, unsigned int highRes) {
|
||||
|
||||
// sort the energies in ascending order - this might be useful for later applications (energy-interpolations etc.)
|
||||
// after the change from the vector to the map this is not necessary any more - since maps are always ordered!
|
||||
// sort(energies.begin(), energies.end());
|
||||
|
||||
double zz(0.0), nzz(0.0);
|
||||
vector<double> vzz, vnzz;
|
||||
string word, energyStr;
|
||||
std::vector<double> vzz, vnzz;
|
||||
std::string word, energyStr;
|
||||
bool goodFile(false);
|
||||
|
||||
for ( map<double, string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
|
||||
for ( std::map<double, std::string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
|
||||
|
||||
energyStr = path + iter->second + ".rge";
|
||||
|
||||
ifstream *rgeFile = new ifstream(energyStr.c_str());
|
||||
if(! *rgeFile) {
|
||||
cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << endl;
|
||||
delete rgeFile;
|
||||
rgeFile = 0;
|
||||
std::unique_ptr<std::ifstream> rgeFile = std::make_unique<std::ifstream>(energyStr.c_str());
|
||||
if (rgeFile == nullptr) {
|
||||
std::cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << std::endl;
|
||||
} else {
|
||||
|
||||
while(*rgeFile >> word) {
|
||||
if(word == "PARTICLES") {
|
||||
while (*rgeFile >> word) {
|
||||
if (word == "PARTICLES") {
|
||||
goodFile = true;
|
||||
break;
|
||||
}
|
||||
@@ -73,7 +69,7 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
||||
|
||||
fEnergy.push_back(iter->first);
|
||||
|
||||
while(!rgeFile->eof()) {
|
||||
while (!rgeFile->eof()) {
|
||||
*rgeFile >> zz >> nzz;
|
||||
vzz.push_back(zz);
|
||||
vnzz.push_back(nzz);
|
||||
@@ -92,8 +88,6 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
||||
|
||||
|
||||
rgeFile->close();
|
||||
delete rgeFile;
|
||||
rgeFile = 0;
|
||||
|
||||
vzz.clear();
|
||||
vnzz.clear();
|
||||
@@ -106,14 +100,14 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
||||
}
|
||||
|
||||
} else {
|
||||
cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << endl;
|
||||
std::cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << std::endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << endl;
|
||||
std::cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << std::endl;
|
||||
|
||||
fOrigDataNZ = fDataNZ;
|
||||
|
||||
@@ -126,8 +120,8 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
|
||||
// If it is not found the energy iterator will point to the end() of the energy vector.
|
||||
|
||||
void TTrimSPData::FindEnergy(double e) const {
|
||||
for(fEnergyIter = fEnergy.begin(); fEnergyIter != fEnergy.end(); ++fEnergyIter) {
|
||||
if(fabs(*fEnergyIter - e) < 0.05)
|
||||
for (fEnergyIter = fEnergy.begin(); fEnergyIter != fEnergy.end(); ++fEnergyIter) {
|
||||
if (fabs(*fEnergyIter - e) < 0.05)
|
||||
return;
|
||||
}
|
||||
return;
|
||||
@@ -137,11 +131,11 @@ void TTrimSPData::UseHighResolution(double e) {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
vector<double> vecZ;
|
||||
vector<double> vecNZ;
|
||||
for(double zz(1.); zz<2100.; zz+=1.) {
|
||||
std::vector<double> vecZ;
|
||||
std::vector<double> vecNZ;
|
||||
for (double zz(1.); zz<2100.; zz+=1.) {
|
||||
vecZ.push_back(zz);
|
||||
vecNZ.push_back(GetNofZ(zz/10.0, e));
|
||||
}
|
||||
@@ -153,7 +147,7 @@ void TTrimSPData::UseHighResolution(double e) {
|
||||
return;
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << endl;
|
||||
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -161,16 +155,16 @@ void TTrimSPData::UseHighResolution(double e) {
|
||||
// Method returning z-vector calculated by trim.SP for given energy[keV]
|
||||
//---------------------
|
||||
|
||||
vector<double> TTrimSPData::DataZ(double e) const {
|
||||
std::vector<double> TTrimSPData::DataZ(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
return fDataZ[i];
|
||||
}
|
||||
// default
|
||||
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
||||
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||
return fDataZ[0];
|
||||
}
|
||||
|
||||
@@ -179,50 +173,50 @@ vector<double> TTrimSPData::DataZ(double e) const {
|
||||
// potentially altered by the WeightLayers- or the Normalize-method for given energy[keV]
|
||||
//---------------------
|
||||
|
||||
vector<double> TTrimSPData::DataNZ(double e) const {
|
||||
std::vector<double> TTrimSPData::DataNZ(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
return fDataNZ[i];
|
||||
}
|
||||
// default
|
||||
cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
||||
return fDataNZ[0];
|
||||
std::cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||
|
||||
return fDataNZ[0];
|
||||
}
|
||||
|
||||
//---------------------
|
||||
// Method returning original n(z)-vector calculated by trim.SP for given energy[keV]
|
||||
//---------------------
|
||||
|
||||
vector<double> TTrimSPData::OrigDataNZ(double e) const {
|
||||
std::vector<double> TTrimSPData::OrigDataNZ(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
return fOrigDataNZ[i];
|
||||
}
|
||||
// default
|
||||
cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
|
||||
return fOrigDataNZ[0];
|
||||
std::cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
|
||||
|
||||
return fOrigDataNZ[0];
|
||||
}
|
||||
|
||||
double TTrimSPData::DataDZ(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
return fDZ[i];
|
||||
}
|
||||
// default
|
||||
cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << endl;
|
||||
return 0.0;
|
||||
std::cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << std::endl;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//---------------------
|
||||
@@ -230,10 +224,10 @@ double TTrimSPData::DataDZ(double e) const {
|
||||
// Parameters: Energy[keV], LayerNumber[1], Interfaces[nm]
|
||||
//---------------------
|
||||
|
||||
double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<double>& interface) const {
|
||||
double TTrimSPData::LayerFraction(double e, unsigned int layno, const std::vector<double>& interface) const {
|
||||
|
||||
if(layno < 1 && layno > (interface.size()+1)) {
|
||||
cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << endl;
|
||||
if (layno < 1 && layno > (interface.size()+1)) {
|
||||
std::cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << std::endl;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -244,21 +238,21 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
|
||||
// Because we do not know if the implantation profile is normalized or not, do not care about this and calculate the fraction from the beginning
|
||||
// Total "number of muons"
|
||||
double totalNumber(0.0);
|
||||
for(unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
totalNumber += fDataNZ[i][j];
|
||||
// "number of muons" in layer layno
|
||||
double layerNumber(0.0);
|
||||
if(!(layno-1)){
|
||||
for(unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if(fDataZ[i][j] < interface[0]*10.0)
|
||||
if (!(layno-1)){
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if (fDataZ[i][j] < interface[0]*10.0)
|
||||
layerNumber += fDataNZ[i][j];
|
||||
} else if(!(layno-interface.size()-1)){
|
||||
for(unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if(fDataZ[i][j] >= *(interface.end()-1)*10.0)
|
||||
} else if (!(layno-interface.size()-1)) {
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if (fDataZ[i][j] >= *(interface.end()-1)*10.0)
|
||||
layerNumber += fDataNZ[i][j];
|
||||
} else {
|
||||
for(unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if(fDataZ[i][j] >= interface[layno-2]*10.0 && fDataZ[i][j] < interface[layno-1]*10.0)
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
if (fDataZ[i][j] >= interface[layno-2]*10.0 && fDataZ[i][j] < interface[layno-1]*10.0)
|
||||
layerNumber += fDataNZ[i][j];
|
||||
}
|
||||
// fraction of muons in layer layno
|
||||
@@ -267,9 +261,9 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
|
||||
}
|
||||
|
||||
// default
|
||||
cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << endl;
|
||||
return 0.0;
|
||||
std::cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << std::endl;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//---------------------
|
||||
@@ -280,30 +274,30 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
|
||||
// the first and last layers get the full n(z), where only one third of the muons in the second layer will be taken into account
|
||||
//---------------------
|
||||
|
||||
void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const vector<double>& weight) const {
|
||||
void TTrimSPData::WeightLayers(double e, const std::vector<double>& interface, const std::vector<double>& weight) const {
|
||||
|
||||
if(weight.size()-interface.size()-1) {
|
||||
cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << endl;
|
||||
cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << endl;
|
||||
if (weight.size()-interface.size()-1) {
|
||||
std::cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << std::endl;
|
||||
std::cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
for(unsigned int i(0); i<interface.size(); i++) {
|
||||
for (unsigned int i(0); i<interface.size(); i++) {
|
||||
if (interface[i]<0.0) {
|
||||
cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << endl;
|
||||
std::cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << std::endl;
|
||||
return;
|
||||
}
|
||||
else if (i>1) {
|
||||
if (interface[i]<interface[i-1]) {
|
||||
cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << endl;
|
||||
std::cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(unsigned int i(0); i<weight.size(); i++) {
|
||||
for (unsigned int i(0); i<weight.size(); i++) {
|
||||
if (weight[i]>1.0 || weight[i]<0.0) {
|
||||
cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << endl;
|
||||
std::cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << std::endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -311,11 +305,11 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
||||
FindEnergy(e);
|
||||
|
||||
// If all weights are equal to one, use the original n(z) vector
|
||||
for(unsigned int i(0); i<weight.size(); i++) {
|
||||
if(weight[i]-1.0)
|
||||
for (unsigned int i(0); i<weight.size(); i++) {
|
||||
if (weight[i]-1.0)
|
||||
break;
|
||||
if(i == weight.size() - 1) {
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (i == weight.size() - 1) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int j(fEnergyIter - fEnergy.begin());
|
||||
fDataNZ[j] = fOrigDataNZ[j];
|
||||
fIsNormalized[j] = false;
|
||||
@@ -324,12 +318,12 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
||||
}
|
||||
}
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
unsigned int k(0);
|
||||
for(unsigned int j(0); j<fDataZ[i].size(); j++) {
|
||||
if(k<interface.size()) {
|
||||
if(fDataZ[i][j] < interface[k]*10.0)
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++) {
|
||||
if (k<interface.size()) {
|
||||
if (fDataZ[i][j] < interface[k]*10.0)
|
||||
fDataNZ[i][j] = fOrigDataNZ[i][j]*weight[k];
|
||||
else {
|
||||
k++;
|
||||
@@ -339,11 +333,11 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
||||
else
|
||||
fDataNZ[i][j] = fOrigDataNZ[i][j]*weight[k];
|
||||
}
|
||||
fIsNormalized[i] = false;
|
||||
return;
|
||||
fIsNormalized[i] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << endl;
|
||||
std::cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,20 +347,20 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
|
||||
|
||||
double TTrimSPData::GetNofZ(double zz, double e) const {
|
||||
|
||||
vector<double> z, nz;
|
||||
std::vector<double> z, nz;
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
z = fDataZ[i];
|
||||
nz = fDataNZ[i];
|
||||
} else {
|
||||
cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << endl;
|
||||
std::cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if(zz < 0)
|
||||
if (zz < 0)
|
||||
return 0.0;
|
||||
|
||||
bool found = false;
|
||||
@@ -395,7 +389,7 @@ void TTrimSPData::Normalize(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
double nZsum = 0.0;
|
||||
for (unsigned int j(0); j<fDataZ[i].size(); j++)
|
||||
@@ -408,9 +402,9 @@ void TTrimSPData::Normalize(double e) const {
|
||||
return;
|
||||
}
|
||||
// default
|
||||
cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << endl;
|
||||
return;
|
||||
std::cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << std::endl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//---------------------
|
||||
@@ -420,12 +414,12 @@ void TTrimSPData::Normalize(double e) const {
|
||||
bool TTrimSPData::IsNormalized(double e) const {
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
return fIsNormalized[i];
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << endl;
|
||||
std::cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -436,19 +430,19 @@ bool TTrimSPData::IsNormalized(double e) const {
|
||||
double TTrimSPData::MeanRange(double e) const {
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
if (!fIsNormalized[i])
|
||||
Normalize(e);
|
||||
double mean(0.0);
|
||||
for(unsigned int j(0); j<fDataNZ[i].size(); j++){
|
||||
for (unsigned int j(0); j<fDataNZ[i].size(); j++){
|
||||
mean += fDataNZ[i][j]*fDataZ[i][j];
|
||||
}
|
||||
mean *= fDZ[i]/10.0;
|
||||
return mean;
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
|
||||
std::cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
|
||||
return -1.;
|
||||
}
|
||||
|
||||
@@ -460,21 +454,21 @@ double TTrimSPData::PeakRange(double e) const {
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
|
||||
vector<double>::const_iterator nziter;
|
||||
std::vector<double>::const_iterator nziter;
|
||||
nziter = max_element(fDataNZ[i].begin(),fDataNZ[i].end());
|
||||
|
||||
if(nziter != fDataNZ[i].end()){
|
||||
if (nziter != fDataNZ[i].end()){
|
||||
unsigned int j(nziter - fDataNZ[i].begin());
|
||||
return fDataZ[i][j]/10.0;
|
||||
}
|
||||
cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << endl;
|
||||
std::cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << std::endl;
|
||||
return -1.;
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
|
||||
std::cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
|
||||
return -1.;
|
||||
}
|
||||
|
||||
@@ -484,26 +478,26 @@ double TTrimSPData::PeakRange(double e) const {
|
||||
//---------------------
|
||||
|
||||
void TTrimSPData::ConvolveGss(double w, double e) const {
|
||||
if(!w)
|
||||
if (!w)
|
||||
return;
|
||||
|
||||
vector<double> z, nz, gss;
|
||||
std::vector<double> z, nz, gss;
|
||||
double nn;
|
||||
|
||||
FindEnergy(e);
|
||||
|
||||
if(fEnergyIter != fEnergy.end()) {
|
||||
if (fEnergyIter != fEnergy.end()) {
|
||||
unsigned int i(fEnergyIter - fEnergy.begin());
|
||||
z = fDataZ[i];
|
||||
nz = fDataNZ[i];
|
||||
|
||||
for(unsigned int k(0); k<z.size(); k++) {
|
||||
for (unsigned int k(0); k<z.size(); k++) {
|
||||
gss.push_back(exp(-z[k]*z[k]/200.0/w/w));
|
||||
}
|
||||
|
||||
for(unsigned int k(0); k<nz.size(); k++) {
|
||||
for (unsigned int k(0); k<nz.size(); k++) {
|
||||
nn = 0.0;
|
||||
for(unsigned int j(0); j<nz.size(); j++) {
|
||||
for (unsigned int j(0); j<nz.size(); j++) {
|
||||
nn += nz[j]*gss[abs(int(k)-int(j))];
|
||||
}
|
||||
fDataNZ[i][k] = nn;
|
||||
@@ -514,6 +508,6 @@ void TTrimSPData::ConvolveGss(double w, double e) const {
|
||||
return;
|
||||
}
|
||||
|
||||
cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << endl;
|
||||
std::cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
29
src/external/BMWtools/TTrimSPDataHandler.h
vendored
29
src/external/BMWtools/TTrimSPDataHandler.h
vendored
@@ -32,7 +32,6 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* <p>Class used to handle a set of low energy muon implantation profiles
|
||||
@@ -41,7 +40,7 @@ class TTrimSPData {
|
||||
|
||||
public:
|
||||
|
||||
TTrimSPData(const string&, map<double, string>&, bool debug = false, unsigned int highRes = 0);
|
||||
TTrimSPData(const std::string&, std::map<double, std::string>&, bool debug = false, unsigned int highRes = 0);
|
||||
|
||||
~TTrimSPData() {
|
||||
fDataZ.clear();
|
||||
@@ -52,15 +51,15 @@ public:
|
||||
fIsNormalized.clear();
|
||||
}
|
||||
|
||||
vector<double> Energy() const {return fEnergy;}
|
||||
vector<double> DataZ(double) const;
|
||||
vector<double> DataNZ(double) const;
|
||||
vector<double> OrigDataNZ(double) const;
|
||||
std::vector<double> Energy() const {return fEnergy;}
|
||||
std::vector<double> DataZ(double) const;
|
||||
std::vector<double> DataNZ(double) const;
|
||||
std::vector<double> OrigDataNZ(double) const;
|
||||
double DataDZ(double) const;
|
||||
void UseHighResolution(double);
|
||||
void SetOriginal() {fOrigDataNZ = fDataNZ;}
|
||||
void WeightLayers(double, const vector<double>&, const vector<double>&) const;
|
||||
double LayerFraction(double, unsigned int, const vector<double>&) const;
|
||||
void WeightLayers(double, const std::vector<double>&, const std::vector<double>&) const;
|
||||
double LayerFraction(double, unsigned int, const std::vector<double>&) const;
|
||||
double GetNofZ(double, double) const;
|
||||
void Normalize(double) const;
|
||||
bool IsNormalized(double) const;
|
||||
@@ -71,13 +70,13 @@ public:
|
||||
private:
|
||||
void FindEnergy(double) const;
|
||||
|
||||
vector<double> fEnergy; ///< vector holding all available muon energies
|
||||
vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
|
||||
vector< vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
|
||||
mutable vector< vector<double> > fDataNZ; ///< n(z) for all energies
|
||||
vector< vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
|
||||
mutable vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
|
||||
mutable vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
|
||||
std::vector<double> fEnergy; ///< vector holding all available muon energies
|
||||
std::vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
|
||||
std::vector< std::vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
|
||||
mutable std::vector< std::vector<double> > fDataNZ; ///< n(z) for all energies
|
||||
std::vector< std::vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
|
||||
mutable std::vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
|
||||
mutable std::vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
|
||||
};
|
||||
|
||||
#endif // _TTrimSPDataHandler_H_
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/MagProximity/PMagProximity.h
vendored
2
src/external/MagProximity/PMagProximity.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -59,14 +59,14 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
||||
|
||||
// read XML startup file
|
||||
char startup_path_name[128];
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
PMPStartupHandler *fStartupHandler = new PMPStartupHandler();
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
fStartupHandler = std::make_unique<PMPStartupHandler>();
|
||||
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
|
||||
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler);
|
||||
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler.get());
|
||||
//Int_t status = saxParser->ParseFile(startup_path_name);
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
Int_t status = parseXmlFile(saxParser, startup_path_name);
|
||||
Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
|
||||
@@ -74,12 +74,6 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
|
||||
// check if everything went fine with the startup handler
|
||||
if (!fStartupHandler->IsValid()) {
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
@@ -89,7 +83,7 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
|
||||
}
|
||||
|
||||
// load all the TRIM.SP rge-files
|
||||
fRgeHandler = new PRgeHandler();
|
||||
fRgeHandler = std::make_unique<PRgeHandler>();
|
||||
if (!fRgeHandler->IsValid()) {
|
||||
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
@@ -109,15 +103,6 @@ PMagProximityFitterGlobal::~PMagProximityFitterGlobal()
|
||||
fPreviousParam.clear();
|
||||
|
||||
fField.clear();
|
||||
|
||||
if (fRgeHandler) {
|
||||
delete fRgeHandler;
|
||||
fRgeHandler = nullptr;
|
||||
}
|
||||
if (fStartupHandler) {
|
||||
delete fStartupHandler;
|
||||
fStartupHandler = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef _PMAGPROXIMITYFITTER_H_
|
||||
#define _PMAGPROXIMITYFITTER_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "PMPStartupHandler.h"
|
||||
#include "PRgeHandler.h"
|
||||
@@ -49,8 +51,8 @@ class PMagProximityFitterGlobal
|
||||
private:
|
||||
Bool_t fValid;
|
||||
|
||||
PMPStartupHandler *fStartupHandler;
|
||||
PRgeHandler *fRgeHandler;
|
||||
std::unique_ptr<PMPStartupHandler> fStartupHandler;
|
||||
std::unique_ptr<PRgeHandler> fRgeHandler;
|
||||
|
||||
mutable std::vector<Double_t> fPreviousParam;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2023 by Andreas Suter *
|
||||
* Copyright (C) 2011-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
17
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
17
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
|
||||
#include "TMusrRunHeader.h"
|
||||
|
||||
@@ -1075,7 +1076,7 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
|
||||
}
|
||||
for (Int_t i=0; i<tokens->GetEntries(); i++) {
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||
dvec.push_back(ostr->GetString().Atoi());
|
||||
dvec.push_back(ostr->GetString().Atof());
|
||||
}
|
||||
if (tokens) {
|
||||
delete tokens;
|
||||
@@ -1234,7 +1235,7 @@ void TMusrRunHeader::DumpHeader()
|
||||
str += subStr;
|
||||
str += "; ";
|
||||
}
|
||||
subStr.Form(fmt, dvec.size()-1);
|
||||
subStr.Form(fmt, dvec[dvec.size()-1]);
|
||||
str += subStr;
|
||||
str += " -@";
|
||||
str += MRH_DOUBLE_VECTOR;
|
||||
@@ -1254,13 +1255,13 @@ void TMusrRunHeader::DumpHeader()
|
||||
*/
|
||||
void TMusrRunHeader::DrawHeader()
|
||||
{
|
||||
TPaveText *pt;
|
||||
TCanvas *ca;
|
||||
std::unique_ptr<TPaveText> pt;
|
||||
std::unique_ptr<TCanvas> ca;
|
||||
|
||||
ca = new TCanvas("MusrRoot RunHeader","MusrRoot RunHeader", 147,37,699,527);
|
||||
ca = std::make_unique<TCanvas>("MusrRoot RunHeader","MusrRoot RunHeader", 147,37,699,527);
|
||||
ca->Range(0., 0., 100., 100.);
|
||||
|
||||
pt = new TPaveText(10.,10.,90.,90.,"br");
|
||||
pt = std::make_unique<TPaveText>(10.,10.,90.,90.,"br");
|
||||
pt->SetFillColor(19);
|
||||
pt->SetTextAlign(12);
|
||||
|
||||
@@ -1506,7 +1507,7 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path)
|
||||
|
||||
if (!obj) { // required object not present, create it
|
||||
TObjArray *oarray = new TObjArray();
|
||||
if (!oarray) {
|
||||
if (oarray == nullptr) {
|
||||
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
BIN
src/external/MusrRoot/doc/MusrRootDefinition.pdf
vendored
BIN
src/external/MusrRoot/doc/MusrRootDefinition.pdf
vendored
Binary file not shown.
21
src/external/MusrRoot/doc/MusrRootDefinition.tex
vendored
21
src/external/MusrRoot/doc/MusrRootDefinition.tex
vendored
@@ -274,7 +274,7 @@ An example program \verb!write_musrRoot_runHeader! which is writing a full run h
|
||||
|
||||
\begin{shaded}
|
||||
\begin{verbatim}
|
||||
TMusrRunHeader *header = new TMusrRunHeader();
|
||||
std::unique_ptr<TMusrRunHeader> header = std::make_unique<TMusrRunHeader>();
|
||||
TMusrRunPhysicalQuantity prop;
|
||||
\end{verbatim}
|
||||
\end{shaded}
|
||||
@@ -318,14 +318,15 @@ header->Set("DetectorInfo/Detector001/Time Zero Bin", 3419.0);
|
||||
|
||||
\begin{shaded}
|
||||
\begin{verbatim}
|
||||
TFile *f = new TFile(fileName, "RECREATE", "write_musrRoot_runHeader");
|
||||
std::unique_ptr<TFile> f = std::make_unique<TFile>(fileName, "RECREATE",
|
||||
"write_musrRoot_runHeader");
|
||||
if (f->IsZombie()) {
|
||||
delete f;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// create the needed TFolder object
|
||||
TFolder *runHeader = new TFolder("RunHeader", "MusrRoot Run Header Info");
|
||||
std::unique_ptr<TFolder> runHeader = std::make_unique<TFolder>("RunHeader",
|
||||
"MusrRoot Run Header Info");
|
||||
|
||||
// create the "directory" structure
|
||||
if (header->FillFolder(runHeader)) {
|
||||
@@ -343,21 +344,22 @@ The following code snippet shows how the extract the full run header from the \m
|
||||
|
||||
\begin{shaded}
|
||||
\begin{verbatim}
|
||||
TFile *f = new TFile(fileName, "READ", "read_musrRoot_runHeader");
|
||||
std::unique_ptr<TFile> f = std::make_unique<TFile>(fileName, "READ",
|
||||
"read_musrRoot_runHeader");
|
||||
if (f->IsZombie()) {
|
||||
delete f;
|
||||
return -1;
|
||||
}
|
||||
|
||||
TFolder *runHeader = 0;
|
||||
TFolder *runHeader = nullptr;
|
||||
f->GetObject("RunHeader", runHeader);
|
||||
if (runHeader == 0) {
|
||||
if (runHeader == nullptr) {
|
||||
cerr << endl << ">> **ERROR** Couldn't get top folder RunHeader";
|
||||
closeFile(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
TMusrRunHeader *header = new TMusrRunHeader(fileName);
|
||||
std::unique_ptr<TMusrRunHeader> header =
|
||||
std::make_unique<TMusrRunHeader>(fileName);
|
||||
|
||||
if (!header->ExtractAll(runHeader)) {
|
||||
cerr << endl << ">> **ERROR** couldn't extract all RunHeader information";
|
||||
@@ -366,7 +368,6 @@ if (!header->ExtractAll(runHeader)) {
|
||||
}
|
||||
|
||||
f->Close();
|
||||
delete f;
|
||||
\end{verbatim}
|
||||
\end{shaded}
|
||||
|
||||
|
||||
42
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
42
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <cmath>
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include <TSAXParser.h>
|
||||
#include <TMath.h>
|
||||
@@ -52,14 +53,14 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
|
||||
{
|
||||
// read XML startup file
|
||||
char startup_path_name[128];
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
PNL_StartupHandler *fStartupHandler = new PNL_StartupHandler();
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
fStartupHandler = std::make_unique<PNL_StartupHandler>();
|
||||
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
|
||||
saxParser->ConnectToHandler("PNL_StartupHandler", fStartupHandler);
|
||||
saxParser->ConnectToHandler("PNL_StartupHandler", fStartupHandler.get());
|
||||
//Int_t status = saxParser->ParseFile(startup_path_name);
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
Int_t status = parseXmlFile(saxParser, startup_path_name);
|
||||
Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal: **WARNING** Reading/parsing nonlocal_startup.xml failed.";
|
||||
@@ -67,14 +68,8 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
|
||||
fValid = false;
|
||||
}
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
|
||||
// check if everything went fine with the startup handler
|
||||
if (!fStartupHandler->IsValid()) {
|
||||
if (!fStartupHandler->IsValid() && fValid) {
|
||||
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
@@ -84,12 +79,14 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
|
||||
fFourierPoints = fStartupHandler->GetFourierPoints();
|
||||
|
||||
// load all the TRIM.SP rge-files
|
||||
fRgeHandler = new PRgeHandler("./nonlocal_startup.xml");
|
||||
if (!fRgeHandler->IsValid()) {
|
||||
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
if (fValid) {
|
||||
fRgeHandler = std::make_unique<PRgeHandler>("./nonlocal_startup.xml");
|
||||
if (!fRgeHandler->IsValid()) {
|
||||
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
|
||||
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
|
||||
std::cout << std::endl;
|
||||
fValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
fPlanPresent = false;
|
||||
@@ -124,15 +121,6 @@ PNL_PippardFitterGlobal::~PNL_PippardFitterGlobal()
|
||||
fftw_free(fFieldq);
|
||||
fFieldB = 0;
|
||||
}
|
||||
|
||||
if (fRgeHandler) {
|
||||
delete fRgeHandler;
|
||||
fRgeHandler = 0;
|
||||
}
|
||||
if (fStartupHandler) {
|
||||
delete fStartupHandler;
|
||||
fStartupHandler = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
8
src/external/Nonlocal/PNL_PippardFitter.h
vendored
8
src/external/Nonlocal/PNL_PippardFitter.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -36,6 +36,8 @@
|
||||
//#endif
|
||||
#include <fftw3.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PMusr.h"
|
||||
#include "PUserFcnBase.h"
|
||||
#include "PNL_StartupHandler.h"
|
||||
@@ -57,8 +59,8 @@ class PNL_PippardFitterGlobal
|
||||
private:
|
||||
Bool_t fValid{true};
|
||||
|
||||
PNL_StartupHandler *fStartupHandler{nullptr};
|
||||
PRgeHandler *fRgeHandler{nullptr};
|
||||
std::unique_ptr<PNL_StartupHandler> fStartupHandler;
|
||||
std::unique_ptr<PRgeHandler> fRgeHandler;
|
||||
|
||||
mutable std::vector<Double_t> fPreviousParam;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
2
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
4
src/external/Nonlocal/cmake/dnlf_config.h.in
vendored
4
src/external/Nonlocal/cmake/dnlf_config.h.in
vendored
@@ -2,3 +2,7 @@
|
||||
|
||||
#define PROJECT_VERSION "@PROJECT_VERSION@"
|
||||
|
||||
#define GIT_BRANCH "@GIT_BRANCH@"
|
||||
#define GIT_CURRENT_SHA1 @GIT_CURRENT_SHA1@
|
||||
|
||||
#define ROOT_VERSION_USED "@ROOT_VERSION_USED@"
|
||||
|
||||
55
src/external/Nonlocal/prog/CMakeLists.txt
vendored
55
src/external/Nonlocal/prog/CMakeLists.txt
vendored
@@ -1,23 +1,64 @@
|
||||
#--- dump_nonlocal_field ------------------------------------------------------
|
||||
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(dump_nonlocal_field VERSION 1.0.0 LANGUAGES C CXX)
|
||||
|
||||
#--- check for git ------------------------------------------------------------
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
#--- check for ROOT -----------------------------------------------------------
|
||||
find_package(ROOT 6.18 REQUIRED COMPONENTS Gui MathMore Minuit2 XMLParser)
|
||||
if (ROOT_mathmore_FOUND)
|
||||
execute_process(COMMAND root-config --bindir OUTPUT_VARIABLE ROOT_BINDIR)
|
||||
string(STRIP ${ROOT_BINDIR} ROOT_BINDIR)
|
||||
execute_process(COMMAND root-config --version OUTPUT_VARIABLE ROOT_VERSION_USED)
|
||||
string(STRIP ${ROOT_VERSION_USED} ROOT_VERSION_USED)
|
||||
execute_process(COMMAND root-config --incdir OUTPUT_VARIABLE ROOT_INC)
|
||||
string(STRIP ${ROOT_INC} ROOT_INC)
|
||||
message("-- Found ROOT: ${ROOT_BINDIR} (found version: ${ROOT_VERSION})")
|
||||
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
|
||||
include(${ROOT_USE_FILE})
|
||||
endif (ROOT_mathmore_FOUND)
|
||||
|
||||
#--- check for boost ----------------------------------------------------------
|
||||
find_package(Boost REQUIRED
|
||||
COMPONENTS
|
||||
system
|
||||
filesystem
|
||||
)
|
||||
message(STATUS "Boost libs: ${Boost_LIBRARIES}")
|
||||
|
||||
#--- check for fftw3 ----------------------------------------------------------
|
||||
#find_package(FFTW3 REQUIRED)
|
||||
|
||||
# Get the current working branch
|
||||
execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND git log -1 --pretty="%h, %ci"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_CURRENT_SHA1
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
|
||||
#--- feed dnlf_config.h -----------------------------------------
|
||||
set(HAVE_DNLF_CONFIG_H 1 CACHE INTERNAL "dnlf_config.h is available")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/dnlf_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dnlf_config.h)
|
||||
|
||||
#--- start create git-revision.h ----------------------------------------------
|
||||
if (IS_GIT_REPO)
|
||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||
else (IS_GIT_REPO)
|
||||
set(HAVE_GIT_REV_H "")
|
||||
endif (IS_GIT_REPO)
|
||||
|
||||
add_executable(dump_nonlocal_field dump_nonlocal_field.cpp)
|
||||
target_compile_options(dump_nonlocal_field BEFORE PRIVATE "-DHAVE_CONFIG_H" "-DHAVE_DNLF_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(dump_nonlocal_field
|
||||
BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${ROOT_INC}>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2023 by Andreas Suter *
|
||||
* Copyright (C) 2009-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -38,15 +38,9 @@
|
||||
|
||||
#include "PNL_PippardFitter.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_DNLF_CONFIG_H
|
||||
#include "dnlf_config.h"
|
||||
#endif
|
||||
#ifdef HAVE_GIT_REV_H
|
||||
#include "git-revision.h"
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
@@ -58,6 +52,7 @@ void dnlf_syntax()
|
||||
std::cout << "usage: dump_nonlocal_field [<msr-file> --out <field-dump> [--step <stepVal>] | --version | --help]" << std::endl;
|
||||
std::cout << " <msr-file> : nonlocal msr-file name." << std::endl;
|
||||
std::cout << " --out <field-dump> : ascii field dump output file name." << std::endl;
|
||||
std::cout << " --range <rangeVal> : this optional parameter (in nm) will overwrite the standard z-range = 5 * lambdaL." << std::endl;
|
||||
std::cout << " --step <stepVal> : this optional parameters allows to define the z-value step size in (nm)." << std::endl;
|
||||
std::cout << " --version : dumps the version" << std::endl;
|
||||
std::cout << " --help : will dump this help" << std::endl;
|
||||
@@ -190,7 +185,8 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
std::string msrFileName("");
|
||||
std::string outFileName("");
|
||||
double step(0.0);
|
||||
double step{0.0};
|
||||
double range{0.0};
|
||||
bool show_syntax(false);
|
||||
|
||||
if (argc == 1) {
|
||||
@@ -202,18 +198,10 @@ int main(int argc, char* argv[])
|
||||
if (argv[i][0] != '-') { // must be the msr-file name
|
||||
msrFileName = argv[i];
|
||||
} else if (!strcmp(argv[i], "--version")) {
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#ifdef HAVE_GIT_REV_H
|
||||
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << " (" << PACKAGE_VERSION << "), git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
|
||||
#ifdef HAVE_DNLF_CONFIG_H
|
||||
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << ", ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
|
||||
#else
|
||||
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << " (" << PACKAGE_VERSION << "/" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_GIT_REV_H
|
||||
std::cout << std::endl << "dump_nonlocal_field git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
|
||||
#else
|
||||
std::cout << std::endl << "dump_nonlocal_field version: unknown" << std::endl << std::endl;
|
||||
#endif
|
||||
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << ", ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
} else if (!strcmp(argv[i], "--help")) {
|
||||
@@ -228,6 +216,22 @@ int main(int argc, char* argv[])
|
||||
show_syntax = true;
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp(argv[i], "--range")) {
|
||||
if (i < argc-1) {
|
||||
try {
|
||||
range = std::stod(argv[i+1]);
|
||||
}
|
||||
catch(std::exception& e) {
|
||||
std::cout << "dump_nonlocal_field: **ERROR** <rangeVal> '" << argv[i+1] << "' seems not to be a double." << std::endl;
|
||||
show_syntax = true;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
} else {
|
||||
std::cerr << std::endl << "dump_nonlocal_field: **ERROR** found option --range without <rangeVal>" << std::endl;
|
||||
show_syntax = true;
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp(argv[i], "--step")) {
|
||||
if (i < argc-1) {
|
||||
try {
|
||||
@@ -260,14 +264,17 @@ int main(int argc, char* argv[])
|
||||
|
||||
// calculate field and write it to file
|
||||
PNL_PippardFitterGlobal pip;
|
||||
pip.CalculateField(param);
|
||||
if (pip.IsValid())
|
||||
pip.CalculateField(param);
|
||||
else
|
||||
return -3;
|
||||
|
||||
std::ofstream fout(outFileName.c_str(), std::ofstream::out);
|
||||
if (!fout.is_open()) {
|
||||
std::cout << std::endl;
|
||||
std::cerr << "**ERROR** can not write to file '" << outFileName << "'." << std::endl;
|
||||
std::cout << std::endl;
|
||||
return -3;
|
||||
return -4;
|
||||
}
|
||||
// write header
|
||||
fout << "% z (nm), field (G)" << std::endl;
|
||||
@@ -280,13 +287,15 @@ int main(int argc, char* argv[])
|
||||
bool done(false);
|
||||
double deadLayer = param[8];
|
||||
double b0 = param[6];
|
||||
if (range == 0.0)
|
||||
range = 5.0*param[5]; // 5*lambda
|
||||
do {
|
||||
if (z < deadLayer) {
|
||||
fout << z << ", " << b0 << std::endl;
|
||||
} else {
|
||||
field = pip.GetMagneticField(z-deadLayer);
|
||||
fout << z << ", " << b0*field << std::endl;
|
||||
if (fabs(prevField-field) < 1.0e-10)
|
||||
if ((fabs(prevField-field) < 1.0e-10) && (z >= range))
|
||||
done = true;
|
||||
prevField = field;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "LineProfile.h"
|
||||
#include <iostream> //for testing purposes
|
||||
|
||||
#include <boost/math/special_functions/ellint_1.hpp>
|
||||
|
||||
//Implement helperfunctions
|
||||
|
||||
Double_t GaussianShape(Double_t x, Double_t position, Double_t width) {
|
||||
@@ -80,11 +82,11 @@ Double_t IAsym(Double_t x, Double_t omega_center, Double_t omega_min,Double_t om
|
||||
|
||||
Double_t IAsym_low(Double_t omega, Double_t omega_center, Double_t omega_min,Double_t omega_max){
|
||||
Double_t m =(omega-omega_min)*(omega_max-omega_center)/((omega_max-omega)*(omega_center-omega_min));
|
||||
return 1./PI/pow(omega_max-omega,0.5)/pow(omega_center-omega_min,0.5)*std::comp_ellint_1( m );
|
||||
return 1./PI/pow(omega_max-omega,0.5)/pow(omega_center-omega_min,0.5)*boost::math::ellint_1( m );
|
||||
}
|
||||
Double_t IAsym_high(Double_t omega, Double_t omega_center, Double_t omega_min,Double_t omega_max){
|
||||
Double_t m =(omega_center-omega_min)*(omega_max-omega)/((omega_max-omega_center)*(omega-omega_min));
|
||||
return 1./PI/pow(omega-omega_min,0.5)/pow(omega_max-omega_center,0.5)*std::comp_ellint_1( m );
|
||||
return 1./PI/pow(omega-omega_min,0.5)/pow(omega_max-omega_center,0.5)*boost::math::ellint_1( m );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,33 +50,22 @@ TMeanFieldsForScHalfSpace::TMeanFieldsForScHalfSpace() {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
}
|
||||
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
@@ -141,33 +130,22 @@ TMeanFieldsForScSingleLayer::TMeanFieldsForScSingleLayer() {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
}
|
||||
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
@@ -240,33 +218,22 @@ TMeanFieldsForScBilayer::TMeanFieldsForScBilayer() {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug(), 1);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug(), 1);
|
||||
}
|
||||
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
@@ -335,10 +302,10 @@ double TMeanFieldsForScBilayer::CalcMeanB (double E, const std::vector<double>&
|
||||
std::vector<double> nz(fImpProfile->DataNZ(E));
|
||||
double dz(fImpProfile->DataDZ(E));
|
||||
|
||||
if (E==20.0){
|
||||
ofstream of("Implantation-profile-normal.dat");
|
||||
if (E==20.0) {
|
||||
std::ofstream of("Implantation-profile-normal.dat");
|
||||
for (unsigned int i(0); i<z.size(); i++) {
|
||||
of << z[i] << " " << nz[i] << endl;
|
||||
of << z[i] << " " << nz[i] << std::endl;
|
||||
}
|
||||
of.close();
|
||||
}
|
||||
@@ -359,33 +326,22 @@ TMeanFieldsForScTrilayer::TMeanFieldsForScTrilayer() {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
}
|
||||
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
@@ -464,33 +420,22 @@ TMeanFieldsForScTrilayerWithInsulator::TMeanFieldsForScTrilayerWithInsulator() {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
}
|
||||
|
||||
// Operator-method that returns the mean field for a given implantation energy
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#ifndef _TCalcMeanFieldsLEM_H_
|
||||
#define _TCalcMeanFieldsLEM_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "TLondon1D.h"
|
||||
|
||||
class TMeanFieldsForScHalfSpace : public PUserFcnBase {
|
||||
@@ -36,13 +38,12 @@ class TMeanFieldsForScHalfSpace : public PUserFcnBase {
|
||||
public:
|
||||
// default constructor
|
||||
TMeanFieldsForScHalfSpace();
|
||||
~TMeanFieldsForScHalfSpace() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const TLondon1D_HS&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||
|
||||
ClassDef(TMeanFieldsForScHalfSpace,1)
|
||||
};
|
||||
@@ -52,13 +53,12 @@ class TMeanFieldsForScSingleLayer : public PUserFcnBase {
|
||||
public:
|
||||
// default constructor
|
||||
TMeanFieldsForScSingleLayer();
|
||||
~TMeanFieldsForScSingleLayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_1L&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||
|
||||
ClassDef(TMeanFieldsForScSingleLayer,1)
|
||||
};
|
||||
@@ -68,13 +68,12 @@ class TMeanFieldsForScBilayer : public PUserFcnBase {
|
||||
public:
|
||||
// default constructor
|
||||
TMeanFieldsForScBilayer();
|
||||
~TMeanFieldsForScBilayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_2L&, double) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||
|
||||
ClassDef(TMeanFieldsForScBilayer,1)
|
||||
};
|
||||
@@ -84,13 +83,12 @@ class TMeanFieldsForScTrilayer : public PUserFcnBase {
|
||||
public:
|
||||
// default constructor
|
||||
TMeanFieldsForScTrilayer();
|
||||
~TMeanFieldsForScTrilayer() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3L&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||
|
||||
ClassDef(TMeanFieldsForScTrilayer,1)
|
||||
};
|
||||
@@ -100,13 +98,12 @@ class TMeanFieldsForScTrilayerWithInsulator : public PUserFcnBase {
|
||||
public:
|
||||
// default constructor
|
||||
TMeanFieldsForScTrilayerWithInsulator();
|
||||
~TMeanFieldsForScTrilayerWithInsulator() {delete fImpProfile; fImpProfile = 0;}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
double CalcMeanB (double, const std::vector<double>&, const std::vector<double>&, const TLondon1D_3LwInsulator&) const;
|
||||
|
||||
private:
|
||||
TTrimSPData *fImpProfile;
|
||||
std::unique_ptr<TTrimSPData> fImpProfile;
|
||||
|
||||
ClassDef(TMeanFieldsForScTrilayerWithInsulator,1)
|
||||
};
|
||||
|
||||
392
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
392
src/external/libFitPofB/classes/TLondon1D.cpp
vendored
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "TLondon1D.h"
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
@@ -55,12 +56,6 @@ TLondon1DHS::~TLondon1DHS() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
TLondon1D1L::~TLondon1D1L() {
|
||||
@@ -68,12 +63,6 @@ TLondon1D1L::~TLondon1D1L() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
TLondon1D2L::~TLondon1D2L() {
|
||||
@@ -81,12 +70,6 @@ TLondon1D2L::~TLondon1D2L() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
TProximity1D1LHS::~TProximity1D1LHS() {
|
||||
@@ -94,12 +77,6 @@ TProximity1D1LHS::~TProximity1D1LHS() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
TLondon1D3L::~TLondon1D3L() {
|
||||
@@ -107,12 +84,6 @@ TLondon1D3L::~TLondon1D3L() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
TLondon1D3LS::~TLondon1D3LS() {
|
||||
@@ -120,12 +91,6 @@ TLondon1D3LS::~TLondon1D3LS() {
|
||||
fParForBofZ.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fImpProfile;
|
||||
fImpProfile = 0;
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
// TLondon1D4L::~TLondon1D4L() {
|
||||
@@ -133,10 +98,6 @@ TLondon1D3LS::~TLondon1D3LS() {
|
||||
// fParForBofZ.clear();
|
||||
// fParForPofB.clear();
|
||||
// fParForPofT.clear();
|
||||
// delete fImpProfile;
|
||||
// fImpProfile = 0;
|
||||
// delete fPofT;
|
||||
// fPofT = 0;
|
||||
// }
|
||||
|
||||
//------------------
|
||||
@@ -147,27 +108,27 @@ TLondon1D3LS::~TLondon1D3LS() {
|
||||
TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0); // phase
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -180,21 +141,11 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -203,18 +154,18 @@ TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1DHS
|
||||
//------------------
|
||||
|
||||
double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
double TLondon1DHS::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool dead_layer_changed(false);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -230,7 +181,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -253,7 +204,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -264,8 +215,8 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(dead_layer_changed){
|
||||
vector<double> interfaces;
|
||||
if (dead_layer_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||
interfaces.clear();
|
||||
@@ -273,7 +224,7 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D_HS BofZ(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -286,7 +237,6 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -298,27 +248,27 @@ double TLondon1DHS::operator()(double t, const vector<double> &par) const {
|
||||
TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -331,21 +281,11 @@ TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -354,7 +294,7 @@ TLondon1D1L::TLondon1D1L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D1L
|
||||
//------------------
|
||||
|
||||
double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
double TLondon1D1L::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 6 || par.size() == 8);
|
||||
|
||||
@@ -362,7 +302,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
// Count the number of function calls
|
||||
// fCallCounter++;
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@@ -370,7 +310,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -389,7 +329,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -413,7 +353,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -424,12 +364,12 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(6); i<8; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(6); i<8; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@@ -439,8 +379,8 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
interfaces.push_back(par[3] + par[4]);// dead layer + first layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||
@@ -451,7 +391,7 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D_1L BofZ1(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ1, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ1, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -484,27 +424,27 @@ double TLondon1D1L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -517,21 +457,11 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -540,11 +470,11 @@ TLondon1D2L::TLondon1D2L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D2L
|
||||
//------------------
|
||||
|
||||
double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
double TLondon1D2L::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 8 || par.size() == 11);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@@ -552,7 +482,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -570,7 +500,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -594,7 +524,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -605,13 +535,13 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(8); i<11; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(8); i<11; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@@ -621,8 +551,8 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
interfaces.push_back(par[3] + par[4] + par[5]);// dead layer + first layer + second layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||
@@ -632,7 +562,7 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D_2L BofZ2(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ2, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ2, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
|
||||
@@ -646,7 +576,6 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -657,27 +586,27 @@ double TLondon1D2L::operator()(double t, const vector<double> &par) const {
|
||||
TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -690,21 +619,11 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.01); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -713,18 +632,18 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TProximity1D1LHS
|
||||
//------------------
|
||||
|
||||
double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
double TProximity1D1LHS::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 7);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
bool dead_layer_changed(false);
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -740,14 +659,14 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
only_phase_changed = true;
|
||||
} else {
|
||||
only_phase_changed = false;
|
||||
if (i == 4){
|
||||
if (i == 4) {
|
||||
dead_layer_changed = true;
|
||||
}
|
||||
}
|
||||
@@ -763,7 +682,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -774,8 +693,8 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(dead_layer_changed){
|
||||
vector<double> interfaces;
|
||||
if (dead_layer_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[4]);// dead layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces); // Fraction of muons in the deadlayer
|
||||
interfaces.clear();
|
||||
@@ -783,7 +702,7 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TProximity1D_1LHS BofZ(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
|
||||
@@ -797,7 +716,6 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -807,27 +725,27 @@ double TProximity1D1LHS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -840,21 +758,11 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -863,11 +771,11 @@ TLondon1D3L::TLondon1D3L() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D3L
|
||||
//------------------
|
||||
|
||||
double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
double TLondon1D3L::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 10 || par.size() == 14);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@@ -875,7 +783,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -893,7 +801,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -917,7 +825,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -928,14 +836,14 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(10); i<14; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(10); i<14; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@@ -945,8 +853,8 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||
@@ -956,7 +864,7 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D_3L BofZ3(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ3, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ3, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -969,7 +877,6 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -979,27 +886,27 @@ double TLondon1D3L::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
string startup_path_name("BMW_startup.xml");
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
fNSteps = startupHandler->GetNSteps();
|
||||
fWisdom = startupHandler->GetWisdomFile();
|
||||
string rge_path(startupHandler->GetDataPath());
|
||||
map<double, string> energy_vec(startupHandler->GetEnergies());
|
||||
std::string rge_path(startupHandler->GetDataPath());
|
||||
std::map<double, std::string> energy_vec(startupHandler->GetEnergies());
|
||||
|
||||
fParForPofT.push_back(0.0);
|
||||
fParForPofT.push_back(startupHandler->GetDeltat());
|
||||
@@ -1012,21 +919,11 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fImpProfile = new TTrimSPData(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
fImpProfile = std::make_unique<TTrimSPData>(rge_path, energy_vec, startupHandler->GetDebug());
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -1035,11 +932,11 @@ TLondon1D3LS::TLondon1D3LS() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// Parameters: all the parameters for the function to be fitted through TLondon1D3LS
|
||||
//------------------
|
||||
|
||||
double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
double TLondon1D3LS::operator()(double t, const std::vector<double> &par) const {
|
||||
|
||||
assert(par.size() == 9 || par.size() == 13);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
bool bkg_fraction_changed(false);
|
||||
@@ -1047,7 +944,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(2); i<fPar.size(); i++){
|
||||
@@ -1065,7 +962,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -1089,7 +986,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// std::cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
@@ -1100,14 +997,14 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
fParForPofB[3] = par[2]; // Bkg-Field
|
||||
//fParForPofB[4] = 0.005; // Bkg-width (in principle zero)
|
||||
|
||||
if(weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]+par[4]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]);
|
||||
interfaces.push_back(par[3]+par[4]+par[5]+par[6]);
|
||||
|
||||
vector<double> weights;
|
||||
for(unsigned int i(9); i<13; i++)
|
||||
std::vector<double> weights;
|
||||
for (unsigned int i(9); i<13; i++)
|
||||
weights.push_back(par[i]);
|
||||
|
||||
// std::cout << "Weighting has changed, re-calculating n(z) now..." << std::endl;
|
||||
@@ -1117,8 +1014,8 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
weights.clear();
|
||||
}
|
||||
|
||||
if(bkg_fraction_changed || weights_changed) {
|
||||
vector<double> interfaces;
|
||||
if (bkg_fraction_changed || weights_changed) {
|
||||
std::vector<double> interfaces;
|
||||
interfaces.push_back(par[3]);// dead layer
|
||||
interfaces.push_back(par[3] + par[4] + par[5] + par[6]);// dead layer + first layer + second layer + third layer
|
||||
fParForPofB[5] = fImpProfile->LayerFraction(par[1], 1, interfaces) + // Fraction of muons in the deadlayer
|
||||
@@ -1128,7 +1025,7 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
|
||||
TLondon1D_3LS BofZ3(fParForBofZ);
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(&BofZ3, fImpProfile, fParForPofB);
|
||||
fPofB->Calculate(&BofZ3, fImpProfile.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -1141,7 +1038,6 @@ double TLondon1D3LS::operator()(double t, const vector<double> &par) const {
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
// //------------------
|
||||
|
||||
@@ -553,7 +553,7 @@ void TPofBCalc::Calculate(const TBulkVortexFieldCalc *vortexLattice, const std::
|
||||
if (fill_index < fPBSize) {
|
||||
fPB[fill_index] += 1.0;
|
||||
} else {
|
||||
cout << "Field over the limit..." << endl;
|
||||
std::cout << "Field over the limit..." << std::endl;
|
||||
}
|
||||
}
|
||||
// of << endl;
|
||||
|
||||
46
src/external/libFitPofB/classes/TPofTCalc.cpp
vendored
46
src/external/libFitPofB/classes/TPofTCalc.cpp
vendored
@@ -13,7 +13,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008-2023 by Bastian M. Wojek, Andreas Suter *
|
||||
* Copyright (C) 2008-2024 by Bastian M. Wojek, Andreas Suter *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -36,12 +36,14 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "TPofTCalc.h"
|
||||
#include "fftw3.h"
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "TPofTCalc.h"
|
||||
#include "fftw3.h"
|
||||
|
||||
#ifdef HAVE_GOMP
|
||||
#include <omp.h>
|
||||
@@ -217,7 +219,7 @@ double TPofTCalc::Eval(double t) const {
|
||||
// Parameters: output filename, par(dt, dB, timeres, channels, asyms, phases, t0s, N0s, bgs) optPar(field, energy)
|
||||
//---------------------
|
||||
|
||||
void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<double> &par, const std::vector<double> *optPar = 0) {
|
||||
void TPofTCalc::FakeData(const std::string &rootOutputFileName, const std::vector<double> &par, const std::vector<double> *optPar = 0) {
|
||||
|
||||
//determine the number of histograms to be built
|
||||
unsigned int numHist(0);
|
||||
@@ -314,8 +316,8 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
||||
|
||||
std::cout << "TPofTCalc::FakeData: Adding Poisson noise ..." << std::endl;
|
||||
|
||||
TH1F* theoHisto;
|
||||
TH1F* fakeHisto;
|
||||
std::unique_ptr<TH1F> theoHisto;
|
||||
std::unique_ptr<TH1F> fakeHisto;
|
||||
std::vector<TH1F*> histoData;
|
||||
|
||||
TString name;
|
||||
@@ -323,13 +325,13 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
||||
// create histos
|
||||
name = "theoHisto";
|
||||
name += i;
|
||||
theoHisto = new TH1F(name.Data(), name.Data(), int(par[3]), -par[2]/2.0, (par[3]+0.5)*par[2]);
|
||||
theoHisto = std::make_unique<TH1F>(name.Data(), name.Data(), int(par[3]), -par[2]/2.0, (par[3]+0.5)*par[2]);
|
||||
if (i < 10)
|
||||
name = "hDecay0";
|
||||
else
|
||||
name = "hDecay";
|
||||
name += i;
|
||||
fakeHisto = new TH1F(name.Data(), name.Data(), int(par[3]), -par[2]/2.0, (par[3]+0.5)*par[2]);
|
||||
fakeHisto = std::make_unique<TH1F>(name.Data(), name.Data(), int(par[3]), -par[2]/2.0, (par[3]+0.5)*par[2]);
|
||||
// fill theoHisto
|
||||
#ifdef HAVE_GOMP
|
||||
#pragma omp parallel for default(shared) private(j) schedule(dynamic,chunk)
|
||||
@@ -339,24 +341,18 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
||||
// end omp
|
||||
|
||||
// fill fakeHisto
|
||||
fakeHisto->FillRandom(theoHisto, (int)theoHisto->Integral());
|
||||
fakeHisto->FillRandom(theoHisto.get(), (int)theoHisto->Integral());
|
||||
|
||||
// keep fake data
|
||||
histoData.push_back(fakeHisto);
|
||||
|
||||
// cleanup
|
||||
if (theoHisto) {
|
||||
delete theoHisto;
|
||||
theoHisto = 0;
|
||||
}
|
||||
histoData.push_back(fakeHisto.get());
|
||||
}
|
||||
|
||||
std::cout << "TPofTCalc::FakeData: Write histograms and header information to the file ..." << std::endl;
|
||||
|
||||
// save the histograms as root files
|
||||
// create run info folder and content
|
||||
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
||||
TLemRunHeader *runHeader = new TLemRunHeader();
|
||||
std::unique_ptr<TFolder> runInfoFolder = std::make_unique<TFolder>("RunInfo", "Run Info");
|
||||
std::unique_ptr<TLemRunHeader> runHeader = std::make_unique<TLemRunHeader>();
|
||||
//snprintf(str, sizeof(str), "Fake Data generated from %s", pBFileName.Data());
|
||||
runHeader->SetRunTitle("Fake Data");
|
||||
if (optPar && (optPar->size() > 1)) { // set energy and field if they were specified
|
||||
@@ -375,12 +371,12 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
||||
delete[] t0array;
|
||||
t0array = 0;
|
||||
}
|
||||
runInfoFolder->Add(runHeader);
|
||||
runInfoFolder->Add(runHeader.get());
|
||||
|
||||
// create decay histo folder and content
|
||||
TFolder *histoFolder = new TFolder("histos", "histos");
|
||||
TFolder *decayAnaModule = new TFolder("DecayAnaModule", "DecayAnaModule");
|
||||
histoFolder->Add(decayAnaModule);
|
||||
std::unique_ptr<TFolder> histoFolder = std::make_unique<TFolder>("histos", "histos");
|
||||
std::unique_ptr<TFolder> decayAnaModule = std::make_unique<TFolder>("DecayAnaModule", "DecayAnaModule");
|
||||
histoFolder->Add(decayAnaModule.get());
|
||||
// no post pileup corrected (NPP)
|
||||
for (unsigned int i(0); i<histoData.size(); i++)
|
||||
decayAnaModule->Add(histoData[i]);
|
||||
@@ -420,13 +416,9 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
||||
fakeHisto = 0;
|
||||
|
||||
histoFolder->Clear();
|
||||
delete histoFolder; histoFolder = 0;
|
||||
decayAnaModule->Clear();
|
||||
delete decayAnaModule; decayAnaModule = 0;
|
||||
|
||||
runInfoFolder->Clear();
|
||||
delete runInfoFolder; runInfoFolder = 0;
|
||||
delete runHeader; runHeader = 0;
|
||||
|
||||
t0.clear();
|
||||
asy0.clear();
|
||||
|
||||
34
src/external/libFitPofB/classes/TSkewedGss.cpp
vendored
34
src/external/libFitPofB/classes/TSkewedGss.cpp
vendored
@@ -26,11 +26,13 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "TSkewedGss.h"
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
#include <TSAXParser.h>
|
||||
|
||||
#include "TSkewedGss.h"
|
||||
#include "BMWStartupHandler.h"
|
||||
|
||||
ClassImp(TSkewedGss)
|
||||
@@ -43,10 +45,6 @@ TSkewedGss::~TSkewedGss() {
|
||||
fPar.clear();
|
||||
fParForPofB.clear();
|
||||
fParForPofT.clear();
|
||||
delete fPofB;
|
||||
fPofB = 0;
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -58,15 +56,15 @@ TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -82,19 +80,9 @@ TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.0); // s-
|
||||
fParForPofB.push_back(0.0); // s+
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
|
||||
410
src/external/libFitPofB/classes/TVortex.cpp
vendored
410
src/external/libFitPofB/classes/TVortex.cpp
vendored
@@ -52,12 +52,6 @@ ClassImp(TBulkAnisotropicTriVortexAGL)
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -69,12 +63,6 @@ TBulkTriVortexLondon::~TBulkTriVortexLondon() {
|
||||
//------------------
|
||||
|
||||
TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -86,12 +74,6 @@ TBulkSqVortexLondon::~TBulkSqVortexLondon() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexML::~TBulkTriVortexML() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -103,12 +85,6 @@ TBulkTriVortexML::~TBulkTriVortexML() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -120,12 +96,6 @@ TBulkTriVortexAGL::~TBulkTriVortexAGL() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -137,12 +107,6 @@ TBulkTriVortexAGLII::~TBulkTriVortexAGLII() {
|
||||
//------------------
|
||||
|
||||
TBulkTriVortexNGL::~TBulkTriVortexNGL() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -159,18 +123,18 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -192,21 +156,11 @@ TBulkTriVortexLondon::TBulkTriVortexLondon() : fCalcNeeded(true), fFirstCall(tru
|
||||
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
||||
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
||||
|
||||
fVortex = new TBulkTriVortexLondonFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkTriVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -219,18 +173,18 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -250,21 +204,11 @@ TBulkSqVortexLondon::TBulkSqVortexLondon() : fCalcNeeded(true), fFirstCall(true)
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkSqVortexLondonFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkSqVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -277,12 +221,12 @@ double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8); // normal, +BkgWeight, +VortexWeighting, +AFfield
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@@ -342,7 +286,7 @@ double TBulkTriVortexLondon::operator()(double t, const std::vector<double> &par
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -422,7 +366,7 @@ double TBulkSqVortexLondon::operator()(double t, const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -449,18 +393,18 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -480,21 +424,11 @@ TBulkTriVortexML::TBulkTriVortexML() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkTriVortexMLFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkTriVortexMLFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -507,12 +441,12 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@@ -547,7 +481,7 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@@ -561,7 +495,7 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -574,7 +508,6 @@ double TBulkTriVortexML::operator()(double t, const std::vector<double> &par) co
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -588,18 +521,18 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -619,21 +552,11 @@ TBulkTriVortexAGL::TBulkTriVortexAGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkTriVortexAGLFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkTriVortexAGLFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -646,12 +569,12 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@@ -686,7 +609,7 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@@ -700,7 +623,7 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -713,7 +636,6 @@ double TBulkTriVortexAGL::operator()(double t, const std::vector<double> &par) c
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -726,18 +648,18 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -759,21 +681,11 @@ TBulkTriVortexAGLII::TBulkTriVortexAGLII() : fCalcNeeded(true), fFirstCall(true)
|
||||
fParForPofB.push_back(0.0); // vortex-weighting || antiferromagnetic field
|
||||
fParForPofB.push_back(0.0); // vortex-weighting: 0.0 homogeneous, 1.0 Gaussian, 2.0 Lorentzian || 3.0 antiferromagnetic vortex-cores
|
||||
|
||||
fVortex = new TBulkTriVortexAGLIIFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkTriVortexAGLIIFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -786,12 +698,12 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5 || par.size() == 7 || par.size() == 8);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@@ -826,7 +738,7 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@@ -851,7 +763,7 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -864,7 +776,6 @@ double TBulkTriVortexAGLII::operator()(double t, const std::vector<double> &par)
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -877,18 +788,18 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -908,21 +819,11 @@ TBulkTriVortexNGL::TBulkTriVortexNGL() : fCalcNeeded(true), fFirstCall(true) {
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkTriVortexNGLFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkTriVortexNGLFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -935,12 +836,12 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
assert(par.size() == 4 || par.size() == 5);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(par[0]*0.017453293);
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 3; i++) {
|
||||
@@ -975,7 +876,7 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@@ -989,7 +890,7 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -1002,7 +903,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
}
|
||||
|
||||
return fPofT->Eval(t);
|
||||
|
||||
}
|
||||
|
||||
//------------------
|
||||
@@ -1010,12 +910,6 @@ double TBulkTriVortexNGL::operator()(double t, const std::vector<double> &par) c
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexLondonGlobal::~TBulkAnisotropicTriVortexLondonGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -1032,18 +926,18 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -1063,21 +957,11 @@ TBulkAnisotropicTriVortexLondonGlobal::TBulkAnisotropicTriVortexLondonGlobal() :
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkAnisotropicTriVortexLondonFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkAnisotropicTriVortexLondonFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par) const {
|
||||
@@ -1090,7 +974,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@@ -1127,7 +1011,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
|
||||
@@ -1141,7 +1025,7 @@ void TBulkAnisotropicTriVortexLondonGlobal::Calc(const std::vector<double> &par)
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
@@ -1198,7 +1082,7 @@ void TBulkAnisotropicTriVortexLondon::SetGlobalPart(std::vector<void *> &globalP
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexLondonGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
fValid = false;
|
||||
cerr << endl << ">> TBulkAnisotropicTriVortexLondon::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexLondon::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexLondonGlobal*>(fGlobalUserFcn);
|
||||
@@ -1238,7 +1122,7 @@ double TBulkAnisotropicTriVortexLondon::operator()(double t, const std::vector<d
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
@@ -1252,12 +1136,6 @@ double TBulkAnisotropicTriVortexLondon::operator()(double t, const std::vector<d
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexMLGlobal::~TBulkAnisotropicTriVortexMLGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -1274,18 +1152,18 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -1305,21 +1183,11 @@ TBulkAnisotropicTriVortexMLGlobal::TBulkAnisotropicTriVortexMLGlobal() : fCalcNe
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkAnisotropicTriVortexMLFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkAnisotropicTriVortexMLFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) const {
|
||||
@@ -1332,7 +1200,7 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@@ -1347,7 +1215,7 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -1369,9 +1237,9 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
fParForVortex[i] = par[i+1];
|
||||
@@ -1383,11 +1251,11 @@ void TBulkAnisotropicTriVortexMLGlobal::Calc(const std::vector<double> &par) con
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@@ -1440,7 +1308,7 @@ void TBulkAnisotropicTriVortexML::SetGlobalPart(std::vector<void *> &globalPart,
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexMLGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
fValid = false;
|
||||
cerr << endl << ">> TBulkAnisotropicTriVortexML::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexML::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexMLGlobal*>(fGlobalUserFcn);
|
||||
@@ -1480,7 +1348,7 @@ double TBulkAnisotropicTriVortexML::operator()(double t, const std::vector<doubl
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
@@ -1494,12 +1362,6 @@ double TBulkAnisotropicTriVortexML::operator()(double t, const std::vector<doubl
|
||||
//------------------
|
||||
|
||||
TBulkAnisotropicTriVortexAGLGlobal::~TBulkAnisotropicTriVortexAGLGlobal() {
|
||||
delete fPofT;
|
||||
fPofT = 0;
|
||||
delete fPofB;
|
||||
fPofT = 0;
|
||||
delete fVortex;
|
||||
fVortex = 0;
|
||||
fPar.clear();
|
||||
fParForVortex.clear();
|
||||
fParForPofB.clear();
|
||||
@@ -1516,18 +1378,18 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
||||
// read startup file
|
||||
std::string startup_path_name("BMW_startup.xml");
|
||||
|
||||
TSAXParser *saxParser = new TSAXParser();
|
||||
BMWStartupHandler *startupHandler = new BMWStartupHandler();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler);
|
||||
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
|
||||
std::unique_ptr<BMWStartupHandler> startupHandler = std::make_unique<BMWStartupHandler>();
|
||||
saxParser->ConnectToHandler("BMWStartupHandler", startupHandler.get());
|
||||
//int status (saxParser->ParseFile(startup_path_name.c_str()));
|
||||
// parsing the file as above seems to lead to problems in certain environments;
|
||||
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
|
||||
int status = parseXmlFile(saxParser, startup_path_name.c_str());
|
||||
int status = parseXmlFile(saxParser.get(), startup_path_name.c_str());
|
||||
// check for parse errors
|
||||
if (status) { // error
|
||||
cerr << endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< endl;
|
||||
std::cerr << std::endl << "**ERROR** Reading/parsing " << startup_path_name << " failed." \
|
||||
<< std::endl << "**ERROR** Please make sure that the file exists in the local directory and it is set up correctly!" \
|
||||
<< std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -1547,21 +1409,11 @@ TBulkAnisotropicTriVortexAGLGlobal::TBulkAnisotropicTriVortexAGLGlobal() : fCalc
|
||||
fParForPofB.push_back(0.005); // Bkg-width
|
||||
fParForPofB.push_back(0.0); // Bkg-weight
|
||||
|
||||
fVortex = new TBulkAnisotropicTriVortexAGLFieldCalc(fWisdom, fGridSteps);
|
||||
fVortex = std::make_unique<TBulkAnisotropicTriVortexAGLFieldCalc>(fWisdom, fGridSteps);
|
||||
|
||||
fPofB = new TPofBCalc(fParForPofB);
|
||||
fPofB = std::make_unique<TPofBCalc>(fParForPofB);
|
||||
|
||||
fPofT = new TPofTCalc(fPofB, fWisdom, fParForPofT);
|
||||
|
||||
// clean up
|
||||
if (saxParser) {
|
||||
delete saxParser;
|
||||
saxParser = 0;
|
||||
}
|
||||
if (startupHandler) {
|
||||
delete startupHandler;
|
||||
startupHandler = 0;
|
||||
}
|
||||
fPofT = std::make_unique<TPofTCalc>(fPofB.get(), fWisdom, fParForPofT);
|
||||
}
|
||||
|
||||
void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) const {
|
||||
@@ -1574,7 +1426,7 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
|
||||
// check if the function is called the first time and if yes, read in parameters
|
||||
|
||||
if(fFirstCall){
|
||||
if (fFirstCall) {
|
||||
fPar = par;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
@@ -1589,7 +1441,7 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
bool only_phase_changed(false);
|
||||
|
||||
for (unsigned int i(0); i<fPar.size(); i++) {
|
||||
if( fPar[i]-par[i] ) {
|
||||
if ( fPar[i]-par[i] ) {
|
||||
fPar[i] = par[i];
|
||||
par_changed = true;
|
||||
if (i == 0) {
|
||||
@@ -1611,9 +1463,9 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
|
||||
fParForPofT[0] = par[0]; // phase
|
||||
|
||||
if(!only_phase_changed) {
|
||||
if (!only_phase_changed) {
|
||||
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << endl;
|
||||
// cout << " Parameters have changed, (re-)calculating p(B) and P(t) now..." << std::endl;
|
||||
|
||||
for (unsigned int i(0); i < 5; i++) {
|
||||
fParForVortex[i] = par[i+1];
|
||||
@@ -1625,11 +1477,11 @@ void TBulkAnisotropicTriVortexAGLGlobal::Calc(const std::vector<double> &par) co
|
||||
fVortex->SetParameters(fParForVortex);
|
||||
fVortex->CalculateGrid();
|
||||
fPofB->UnsetPBExists();
|
||||
fPofB->Calculate(fVortex, fParForPofB);
|
||||
fPofB->Calculate(fVortex.get(), fParForPofB);
|
||||
fPofT->DoFFT();
|
||||
|
||||
}/* else {
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl;
|
||||
cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << std::endl;
|
||||
}*/
|
||||
|
||||
fPofT->CalcPol(fParForPofT);
|
||||
@@ -1683,7 +1535,7 @@ void TBulkAnisotropicTriVortexAGL::SetGlobalPart(std::vector<void *> &globalPart
|
||||
fGlobalUserFcn = new TBulkAnisotropicTriVortexAGLGlobal();
|
||||
if (fGlobalUserFcn == 0) { // global user function object couldn't be invoked -> error
|
||||
fValid = false;
|
||||
cerr << endl << ">> TBulkAnisotropicTriVortexAGL::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
|
||||
std::cerr << std::endl << ">> TBulkAnisotropicTriVortexAGL::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
|
||||
} else { // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
|
||||
globalPart.resize(fIdxGlobal+1);
|
||||
globalPart[fIdxGlobal] = dynamic_cast<TBulkAnisotropicTriVortexAGLGlobal*>(fGlobalUserFcn);
|
||||
@@ -1723,7 +1575,7 @@ double TBulkAnisotropicTriVortexAGL::operator()(double t, const std::vector<doub
|
||||
assert(param.size() == 6);
|
||||
assert(fGlobalUserFcn);
|
||||
|
||||
if(t<0.0)
|
||||
if (t<0.0)
|
||||
return cos(param[0]*0.017453293);
|
||||
|
||||
// call the global user function object
|
||||
|
||||
46
src/external/libFitPofB/include/TLondon1D.h
vendored
46
src/external/libFitPofB/include/TLondon1D.h
vendored
@@ -29,6 +29,8 @@
|
||||
#ifndef _TLondon1D_H_
|
||||
#define _TLondon1D_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "TPofTCalc.h"
|
||||
|
||||
@@ -47,15 +49,15 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
string fWisdom; ///< file name of the FFTW wisdom file
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
mutable std::vector<double> fParForBofZ; ///< parameters for the calculation of B(z)
|
||||
mutable std::vector<double> fParForPofB; ///< parameters for the calculation of P(B)
|
||||
std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
unsigned int fNSteps; ///< number of points for which B(z) is calculated
|
||||
|
||||
ClassDef(TLondon1DHS,1)
|
||||
@@ -76,9 +78,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
@@ -107,9 +109,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
@@ -137,9 +139,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
@@ -167,9 +169,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
@@ -197,9 +199,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TTrimSPData *fImpProfile; ///< low energy muon implantation profiles
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TTrimSPData> fImpProfile; ///< low energy muon implantation profiles
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
|
||||
2
src/external/libFitPofB/include/TPofTCalc.h
vendored
2
src/external/libFitPofB/include/TPofTCalc.h
vendored
@@ -66,7 +66,7 @@ private:
|
||||
double *fPT; ///< array containing the discrete values of the polarization p(t)
|
||||
double fTBin; ///< time resolution
|
||||
int fNFFT; ///< length of the discrete 1D Fourier transform
|
||||
const string fWisdom; ///< file name of the FFTW wisdom file
|
||||
const std::string fWisdom; ///< file name of the FFTW wisdom file
|
||||
bool fUseWisdom; ///< tag determining if a FFTW wisdom file is used
|
||||
|
||||
};
|
||||
|
||||
6
src/external/libFitPofB/include/TSkewedGss.h
vendored
6
src/external/libFitPofB/include/TSkewedGss.h
vendored
@@ -29,6 +29,8 @@
|
||||
#ifndef _TSkewedGss_H_
|
||||
#define _TSkewedGss_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "TPofTCalc.h"
|
||||
|
||||
@@ -47,8 +49,8 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForPofT; ///< parameters for the calculation of p(t)
|
||||
|
||||
62
src/external/libFitPofB/include/TVortex.h
vendored
62
src/external/libFitPofB/include/TVortex.h
vendored
@@ -29,6 +29,8 @@
|
||||
#ifndef _TVortex_H_
|
||||
#define _TVortex_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "TPofTCalc.h"
|
||||
|
||||
@@ -47,9 +49,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -76,9 +78,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkSqVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkSqVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -105,9 +107,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -134,9 +136,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -163,9 +165,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexAGLIIFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexAGLIIFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -192,9 +194,9 @@ public:
|
||||
|
||||
private:
|
||||
mutable std::vector<double> fPar; ///< parameters of the model
|
||||
TBulkTriVortexNGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkTriVortexNGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -223,14 +225,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexLondonFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexLondonFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -287,14 +289,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexMLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexMLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
@@ -351,14 +353,14 @@ public:
|
||||
|
||||
void Calc(const std::vector<double>&) const;
|
||||
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT; }
|
||||
const TPofTCalc* GetPolarizationPointer() const { return fPofT.get(); }
|
||||
|
||||
private:
|
||||
mutable bool fValid; ///< tag indicating if the global part has been calculated
|
||||
mutable std::vector<double> fPar; ///< parameter vector
|
||||
TBulkAnisotropicTriVortexAGLFieldCalc *fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
TPofBCalc *fPofB; ///< static field distribution P(B)
|
||||
TPofTCalc *fPofT; ///< muon spin polarization p(t)
|
||||
std::unique_ptr<TBulkAnisotropicTriVortexAGLFieldCalc> fVortex; ///< spatial field distribution B(x,y) within the vortex lattice
|
||||
std::unique_ptr<TPofBCalc> fPofB; ///< static field distribution P(B)
|
||||
std::unique_ptr<TPofTCalc> fPofT; ///< muon spin polarization p(t)
|
||||
mutable bool fCalcNeeded; ///< tag needed to avoid unnecessary calculations if the core parameters were unchanged
|
||||
mutable bool fFirstCall; ///< tag for checking if the function operator is called the first time
|
||||
mutable std::vector<double> fParForVortex; ///< parameters for the calculation of B(x,y)
|
||||
|
||||
340
src/external/libFitPofB/test/simulation/COPYING
vendored
340
src/external/libFitPofB/test/simulation/COPYING
vendored
@@ -1,340 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
@@ -1,49 +0,0 @@
|
||||
#---------------------------------------------------
|
||||
# get compilation and library flags from root-config
|
||||
|
||||
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
|
||||
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
|
||||
|
||||
#---------------------------------------------------
|
||||
|
||||
CXX = g++
|
||||
CXXFLAGS = -g -O3 -Wall
|
||||
LOCALINCLUDE =
|
||||
ROOTINCLUDE = $(ROOTSYS)/include
|
||||
INCLUDES = -I$(ROOTINCLUDE)
|
||||
LD = g++
|
||||
LDFLAGS = -O
|
||||
|
||||
# the output from the root-config script:
|
||||
CXXFLAGS += $(ROOTCFLAGS)
|
||||
LDFLAGS +=
|
||||
|
||||
# the ROOT, BMW, and MUSR libraries
|
||||
LIBS = $(ROOTLIBS) -lXMLParser -lMathMore -lBMWtools -lFitPofB -lfftw3 -lfftw3f -fopenmp -lm -lPMusr
|
||||
|
||||
EXEC = simDataFullSpec
|
||||
|
||||
# some definitions: headers, sources, objects,...
|
||||
OBJS =
|
||||
OBJS += $(EXEC).o
|
||||
|
||||
# make the executable:
|
||||
#
|
||||
all: $(EXEC)
|
||||
|
||||
$(EXEC): $(OBJS)
|
||||
@echo "---> Building $(EXEC) ..."
|
||||
$(LD) $(LDFLAGS) $(OBJS) -o $(EXEC) $(LIBS)
|
||||
@echo "done"
|
||||
|
||||
# clean up: remove all object file (and core files)
|
||||
# semicolon needed to tell make there is no source
|
||||
# for this target!
|
||||
#
|
||||
clean:; @rm -f $(OBJS)
|
||||
@echo "---> removing $(OBJS)"
|
||||
|
||||
#
|
||||
$(OBJS): %.o: %.cpp
|
||||
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,500 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
simDataFullSpec.cpp
|
||||
|
||||
Author: Bastian M. Wojek
|
||||
|
||||
$Id$
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* 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; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* 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, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "TFile.h"
|
||||
#include "TH1.h"
|
||||
#include "TMath.h"
|
||||
#include "TFolder.h"
|
||||
|
||||
#include "TBofZCalc.h"
|
||||
#include "TPofTCalc.h"
|
||||
#include "TLemRunHeader.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// check the number of arguments: run number, energy (keV), field (G), lambda (nm), dead layer (nm), broadening (G), asymmetry[, sigmaLambda (lambda)]
|
||||
if (argc < 8) {
|
||||
cerr << "Please give all necessary parameters: run number, energy (keV), field (G), lambda (nm), dead layer (nm), broadening (G), asymmetry[, sigmaLambda (lambda)]" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// fill the specified paramters into the corresponding variables
|
||||
unsigned int runNumber;
|
||||
double impEnergy;
|
||||
double field;
|
||||
double lambda;
|
||||
double deadlayer;
|
||||
double broadening;
|
||||
double asymmetry;
|
||||
double sigmaLambda(0.0);
|
||||
try {
|
||||
runNumber = boost::lexical_cast<unsigned int>(argv[1]);
|
||||
impEnergy = boost::lexical_cast<double>(argv[2]);
|
||||
field = boost::lexical_cast<double>(argv[3]);
|
||||
lambda = boost::lexical_cast<double>(argv[4]);
|
||||
deadlayer = boost::lexical_cast<double>(argv[5]);
|
||||
broadening = boost::lexical_cast<double>(argv[6]);
|
||||
asymmetry = boost::lexical_cast<double>(argv[7]);
|
||||
if (argc == 9) {
|
||||
sigmaLambda = boost::lexical_cast<double>(argv[8])*lambda;
|
||||
}
|
||||
}
|
||||
catch(boost::bad_lexical_cast &) {
|
||||
cerr << endl;
|
||||
cerr << "Please specify parameters with a meaning:" << endl;
|
||||
cerr << "run number, energy (keV), field (G), lambda (nm), dead layer (nm), broadening (G), asymmetry" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read in the root file containing the transport energy spectrum
|
||||
|
||||
string fileName("lem08_1351_ImpSpectrum_15kV.root");
|
||||
|
||||
TFile *rootFile = new TFile(fileName.c_str());
|
||||
|
||||
if (rootFile != NULL) {
|
||||
cout << "Opened root file: " << fileName << endl;
|
||||
} else {
|
||||
cout << "Could not open root file: " << fileName << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
TH1F* impSpec = static_cast<TH1F*>(rootFile->Get("fEnergyHisto"));
|
||||
|
||||
map<double, pair<double, int> > spectrum; // E, (weight, t0shift)
|
||||
|
||||
const double dE(0.1);
|
||||
const double peakEnergy(11.25);
|
||||
const double peakEnergyTrans(14.1);
|
||||
const double peakEnergyFinal(impEnergy);
|
||||
double eDiff(peakEnergyTrans-peakEnergy);
|
||||
double eDiffFinal(peakEnergyFinal-peakEnergyTrans);
|
||||
|
||||
const double muMass(105658.370); // keV/c^2
|
||||
const double speedOfLight(299.792458); // mm/ns
|
||||
const double driftLength(1160.); // mm
|
||||
const double res(0.1953125); // ns
|
||||
double coeff0(driftLength/(speedOfLight*res));
|
||||
|
||||
pair<double, int> tmpPair;
|
||||
unsigned int peakBin; // see lem-svn:analysis/root/macros/lemStart.C for the conversion between Etrans and TOF
|
||||
peakBin = static_cast<unsigned int>(floor(coeff0/sqrt(1.0-1.0/pow(peakEnergy/muMass + 1.0, 2.0))));
|
||||
|
||||
for (double E(5.95); E <= 15.0; E += dE) {
|
||||
// // Debug: use only the peak energy
|
||||
// if (fabs(E - peakEnergy) > 0.01)
|
||||
// continue;
|
||||
if (peakEnergyTrans - (E+eDiff) >= peakEnergyFinal)
|
||||
continue; // forget about the reflected muons with too low energies in the tail
|
||||
tmpPair.first = impSpec->GetBinContent(impSpec->FindBin(E));
|
||||
tmpPair.second = static_cast<int>(floor(coeff0/sqrt(1.0-1.0/pow(E/muMass + 1.0, 2.0)))) - peakBin; // t-shift relativ to peak
|
||||
spectrum[E+eDiff] = tmpPair;
|
||||
}
|
||||
|
||||
// normalize spectrum
|
||||
double tmpNorm(0.0);
|
||||
for (map<double, pair<double, int> >::const_iterator it(spectrum.begin()); it != spectrum.end(); ++it) {
|
||||
tmpNorm += it->second.first;
|
||||
}
|
||||
for (map<double, pair<double, int> >::iterator it(spectrum.begin()); it != spectrum.end(); ++it) {
|
||||
it->second.first /= tmpNorm;
|
||||
}
|
||||
|
||||
// calculate phaseMag on the fly when the histogram is filled
|
||||
// in order not to rewrite all the FakeData-routine, use it as implemented in TPofTCalc to create separate files for each energy
|
||||
// in the end, add the histograms of the files together to create the resulting simulated histograms
|
||||
|
||||
// read in the TrimSP files
|
||||
string rge_path("/home/l_wojek/TrimSP/YBCOxtal/Espread-40eV/YBCOxtal-50000-");
|
||||
vector<string> energy_labels;
|
||||
ostringstream tmpLabel;
|
||||
for (unsigned int i(0); i < 30; ++i) {
|
||||
tmpLabel.clear();
|
||||
tmpLabel.str("");
|
||||
tmpLabel.fill('0');
|
||||
tmpLabel.setf(ios::internal, ios::adjustfield);
|
||||
tmpLabel.width(2);
|
||||
tmpLabel << i;
|
||||
tmpLabel << "_";
|
||||
for (unsigned int j(0); j < 10; ++j) {
|
||||
if (!((i == 0) && (j == 0))) {
|
||||
energy_labels.push_back(tmpLabel.str());
|
||||
energy_labels.back().append(boost::lexical_cast<string>(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
energy_labels.push_back("30_0");
|
||||
|
||||
map<double,string> energy_vec;
|
||||
|
||||
for (unsigned int i(0); i < energy_labels.size(); ++i) {
|
||||
energy_vec[static_cast<double>(i+1)*0.1] = energy_labels[i];
|
||||
}
|
||||
|
||||
TTrimSPData calcData(rge_path, energy_vec, true);
|
||||
|
||||
// parameters for the London model calculations
|
||||
|
||||
vector<double> par_vec;
|
||||
par_vec.resize(5, 0.0); // phase (deg), energy (keV), applied field (G), deadlayer (nm), lambda (nm)
|
||||
par_vec[2] = field;
|
||||
par_vec[3] = deadlayer;
|
||||
par_vec[4] = lambda;
|
||||
|
||||
vector<double> interfaces;
|
||||
interfaces.push_back(par_vec[3]); // deadlayer
|
||||
|
||||
vector<double> parForBofZ;
|
||||
for (unsigned int i(2); i<par_vec.size(); ++i)
|
||||
parForBofZ.push_back(par_vec[i]);
|
||||
|
||||
vector<double> parForPofB;
|
||||
parForPofB.resize(6, 0.0); // dt (us), dB (G), energy (keV), bkg-field (G), bkg-width (G), bkg-fraction (here from deadlayer)
|
||||
parForPofB[0] = 0.005; // dt
|
||||
parForPofB[1] = 0.05; // dB
|
||||
parForPofB[3] = field; // bkg-field
|
||||
parForPofB[4] = 0.1; // bkg-width
|
||||
|
||||
vector<double> parForPofT;
|
||||
parForPofT.resize(3, 0.0); // phase, dt, dB
|
||||
parForPofT[1] = 0.005; //dt
|
||||
parForPofT[2] = 0.05; //dB
|
||||
|
||||
vector<double> parForFakeData; // par(dt, dB, timeres, channels, asyms, phases, t0s, N0s, bgs)
|
||||
parForFakeData.resize(14, 0.0);
|
||||
parForFakeData[0] = 0.005;//dt for FFT
|
||||
parForFakeData[1] = 0.05;//dB
|
||||
parForFakeData[2] = res*1.e-3;//timeres
|
||||
parForFakeData[3] = 66601.;//channels
|
||||
parForFakeData[4] = asymmetry;//asys -- fixed for the moment but in principle also energy-dependent
|
||||
parForFakeData[5] = asymmetry;
|
||||
|
||||
const double N0L(115.), N0R(100.), bgL(9.), bgR(8.), t0Peak(3000.);
|
||||
|
||||
TLondon1D_HS *BofZ = new TLondon1D_HS(parForBofZ);
|
||||
TPofBCalc *PofB = new TPofBCalc(parForPofB);
|
||||
TPofTCalc *PofT = new TPofTCalc(PofB, "/home/l_wojek/analysis/WordsOfWisdom.dat", parForPofT);
|
||||
|
||||
double tmpE, tmpTransportE, tmpPhase;
|
||||
ostringstream tmpFile;
|
||||
ostringstream tmpDouble;
|
||||
|
||||
const double phaseApp(16.0); // phaseSep ~ 9 deg, phaseCryo ~ 7 deg
|
||||
const double gamma_mu(TMath::TwoPi()*0.0135538817); // MHz/G
|
||||
double coeff1(1.30406); // m/s -> for v = sqrt(2E/m) = 1.30406e6 m/s sqrt(E[keV]) no "e6" because gamma_mu is in MHz/G
|
||||
double coeff2(0.13123); // m -> for phaseMag = gamma_mu/v Int {B(x) dx} = coeff2 * B * gamma_mu/v
|
||||
double coeff3(gamma_mu*field*coeff2/coeff1);
|
||||
|
||||
map<int, double> GssWeight;
|
||||
if (sigmaLambda) { // If Gaussian spread of lambdas around the specified value
|
||||
for (int i(1); i < 16; ++i) {
|
||||
GssWeight[i] = GssWeight[-i] = exp(-0.02*static_cast<double>(i)*static_cast<double>(i));
|
||||
}
|
||||
GssWeight[0] = 1.0;
|
||||
// Normalize
|
||||
double tmpSum(0.0);
|
||||
for (map<int, double>::const_iterator it(GssWeight.begin()); it != GssWeight.end(); ++it) {
|
||||
tmpSum += it->second;
|
||||
}
|
||||
for (map<int, double>::iterator it(GssWeight.begin()); it != GssWeight.end(); ++it) {
|
||||
it->second /= tmpSum;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int index(0);
|
||||
for (map<double, pair<double, int> >::const_iterator it(spectrum.begin()); it != spectrum.end(); ++it) {
|
||||
|
||||
tmpTransportE = it->first;
|
||||
tmpE = eDiffFinal + tmpTransportE;
|
||||
|
||||
cout << "tmpTransportE = " << tmpTransportE << ", tmpE = " << tmpE << endl;
|
||||
|
||||
tmpPhase = coeff3/sqrt(tmpTransportE)*180.0/TMath::Pi() + phaseApp;
|
||||
|
||||
parForPofB[2] = tmpE;
|
||||
parForPofB[5] = calcData.LayerFraction(tmpE, 1, interfaces); // Fraction of muons in the deadlayer
|
||||
// replace this expression by 1.0 if you are interested only in the background (reference above Tc)
|
||||
|
||||
parForPofT[0] = tmpPhase;
|
||||
|
||||
parForFakeData[6] = tmpPhase;//phases
|
||||
parForFakeData[7] = parForFakeData[6] + 165.;
|
||||
parForFakeData[8] = t0Peak + spectrum[tmpTransportE].second;//t0s
|
||||
parForFakeData[9] = parForFakeData[8];
|
||||
parForFakeData[10] = N0L*spectrum[tmpTransportE].first;//N0s
|
||||
parForFakeData[11] = N0R*spectrum[tmpTransportE].first;
|
||||
parForFakeData[12] = bgL*spectrum[tmpTransportE].first;//bgs
|
||||
parForFakeData[13] = bgR*spectrum[tmpTransportE].first;
|
||||
|
||||
if (GssWeight.empty()) {
|
||||
PofB->UnsetPBExists();
|
||||
PofB->Calculate(BofZ, &calcData, parForPofB);
|
||||
} else {
|
||||
// calculate P(B) for the Gaussian distribution of lambdas and finally add them together
|
||||
vector<double> *pb = 0;
|
||||
double *tmpPB;
|
||||
|
||||
for (map<int, double>::iterator it(GssWeight.begin()); it != GssWeight.end(); ++it) {
|
||||
delete BofZ;
|
||||
parForBofZ.back() = lambda + 0.2*it->first*sigmaLambda;
|
||||
BofZ = new TLondon1D_HS(parForBofZ);
|
||||
PofB->UnsetPBExists();
|
||||
PofB->Calculate(BofZ, &calcData, parForPofB);
|
||||
|
||||
if (it == GssWeight.begin()) {
|
||||
pb = new vector<double>(PofB->DataPB(), PofB->DataPB() + PofB->GetPBSize());
|
||||
for (unsigned int i(0); i < pb->size(); ++i) {
|
||||
(*pb)[i] *= it->second;
|
||||
}
|
||||
} else if (pb) {
|
||||
tmpPB = PofB->DataPB();
|
||||
for (unsigned int i(0); i < pb->size(); ++i) {
|
||||
(*pb)[i] += tmpPB[i]*it->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
PofB->SetPB(*pb);
|
||||
delete pb;
|
||||
pb = 0;
|
||||
}
|
||||
|
||||
PofB->ConvolveGss(broadening);
|
||||
|
||||
// // debug: check the calculated field distribution
|
||||
// const double *b(PofB->DataB());
|
||||
// double *pB(PofB->DataPB());
|
||||
// unsigned int s(PofB->GetPBSize());
|
||||
//
|
||||
// ofstream ofx("test-pB.dat");
|
||||
// for (unsigned int i(0); i < s; ++i) {
|
||||
// ofx << b[i] << " " << pB[i] << endl;
|
||||
// }
|
||||
// ofx.close();
|
||||
// return 100;
|
||||
|
||||
tmpFile.clear();
|
||||
tmpFile.str("");
|
||||
tmpFile.fill('0');
|
||||
tmpFile.setf(ios::internal, ios::adjustfield);
|
||||
tmpFile.width(2);
|
||||
tmpFile << index;
|
||||
tmpFile << "tempFile.root";
|
||||
|
||||
PofT->DoFFT();
|
||||
PofT->FakeData(tmpFile.str(), parForFakeData, 0);
|
||||
|
||||
++index;
|
||||
}
|
||||
|
||||
delete BofZ;
|
||||
BofZ = 0;
|
||||
delete PofB;
|
||||
PofB = 0;
|
||||
delete PofT;
|
||||
PofT = 0;
|
||||
|
||||
// read back the written files and add the decay histograms
|
||||
|
||||
// get the first histogram, copy it and add the rest of them
|
||||
vector<TFile*> rootTmpFile;
|
||||
rootTmpFile.push_back(new TFile("00tempFile.root"));
|
||||
|
||||
TFolder *tmpFolder;
|
||||
rootTmpFile.back()->GetObject("histos", tmpFolder);
|
||||
if (!tmpFolder) {
|
||||
cerr << endl << "No histogram folder found in 00tempFile.root" << endl;
|
||||
rootTmpFile.back()->Close();
|
||||
return -1;
|
||||
}
|
||||
|
||||
TH1F *tmpHist = dynamic_cast<TH1F*>(tmpFolder->FindObjectAny("hDecay00"));
|
||||
|
||||
vector<TH1F*> finalHistos;
|
||||
finalHistos.push_back(dynamic_cast<TH1F*>(tmpHist->Clone()));
|
||||
|
||||
|
||||
|
||||
tmpHist = dynamic_cast<TH1F*>(tmpFolder->FindObjectAny("hDecay01"));
|
||||
finalHistos.push_back(dynamic_cast<TH1F*>(tmpHist->Clone()));
|
||||
|
||||
|
||||
// rootTmpFile->Close();
|
||||
|
||||
// delete rootTmpFile;
|
||||
|
||||
|
||||
|
||||
// ostringstream tmpStrStream;
|
||||
// tmpStrStream << "hDecay0";
|
||||
// string tmpString;
|
||||
|
||||
for (unsigned int i(1); i < index; ++i) {
|
||||
tmpFile.clear();
|
||||
tmpFile.str("");
|
||||
tmpFile.fill('0');
|
||||
tmpFile.setf(ios::internal, ios::adjustfield);
|
||||
tmpFile.width(2);
|
||||
tmpFile << i;
|
||||
tmpFile << "tempFile.root";
|
||||
|
||||
rootTmpFile.push_back(new TFile(tmpFile.str().c_str()));
|
||||
|
||||
rootTmpFile.back()->GetObject("histos", tmpFolder);
|
||||
if (!tmpFolder) {
|
||||
cerr << endl << "No histogram folder found in " << tmpFile.str() << endl;
|
||||
rootTmpFile.back()->Close();
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(unsigned int j(0); j < finalHistos.size(); ++j) {
|
||||
// tmpString = tmpStrStream.str().append(boost::lexical_cast<string>(j));
|
||||
tmpHist = dynamic_cast<TH1F*>(tmpFolder->FindObjectAny(finalHistos[j]->GetName()));
|
||||
finalHistos[j]->Add(tmpHist);
|
||||
}
|
||||
|
||||
// rootTmpFile->Close();
|
||||
// delete rootTmpFile;
|
||||
}
|
||||
|
||||
// save everything to the final ROOT file
|
||||
// create run info folder and content
|
||||
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
||||
TLemRunHeader *runHeader = new TLemRunHeader();
|
||||
|
||||
runHeader->SetRunTitle("Simulated Data");
|
||||
runHeader->SetImpEnergy(peakEnergyFinal);
|
||||
runHeader->SetSampleBField(field, 0.0f);
|
||||
|
||||
runHeader->SetTimeResolution(res);
|
||||
runHeader->SetNChannels(66601);
|
||||
runHeader->SetNHist(finalHistos.size());
|
||||
double *t0array = new double[finalHistos.size()];
|
||||
for (unsigned int i(0); i<finalHistos.size(); ++i)
|
||||
t0array[i] = t0Peak;
|
||||
runHeader->SetTimeZero(t0array);
|
||||
if (t0array) {
|
||||
delete[] t0array;
|
||||
t0array = 0;
|
||||
}
|
||||
runInfoFolder->Add(runHeader);
|
||||
|
||||
// create decay histo folder and content
|
||||
TFolder *histoFolder = new TFolder("histos", "histos");
|
||||
TFolder *decayAnaModule = new TFolder("DecayAnaModule", "DecayAnaModule");
|
||||
histoFolder->Add(decayAnaModule);
|
||||
// non post pileup corrected (NPP)
|
||||
for (unsigned int i(0); i<finalHistos.size(); ++i)
|
||||
decayAnaModule->Add(finalHistos[i]);
|
||||
// post pileup corrected (PPC)
|
||||
vector<TH1F*> finalHistosPPC;
|
||||
TString name;
|
||||
for (unsigned int i(0); i<finalHistos.size(); ++i) {
|
||||
finalHistosPPC.push_back(dynamic_cast<TH1F*>(finalHistos[i]->Clone()));
|
||||
if (i < 10)
|
||||
name = "hDecay2";
|
||||
else
|
||||
name = "hDecay";
|
||||
name += i;
|
||||
finalHistosPPC[i]->SetNameTitle(name.Data(), name.Data());
|
||||
decayAnaModule->Add(finalHistosPPC[i]);
|
||||
}
|
||||
|
||||
// write file
|
||||
tmpFile.clear();
|
||||
tmpFile.str("");
|
||||
tmpFile << "LEMsimulation-YBCO-London-lambda" << fixed << setprecision(0) << par_vec[4] << "nm-dl" << fixed << setprecision(0) << par_vec[3] << "nm_";
|
||||
tmpFile.fill('0');
|
||||
tmpFile.setf(ios::internal, ios::adjustfield);
|
||||
tmpFile.width(4);
|
||||
tmpFile << runNumber;
|
||||
tmpFile << ".root";
|
||||
|
||||
TFile fdf(tmpFile.str().c_str(), "recreate");
|
||||
runInfoFolder->Write("RunInfo", TObject::kSingleKey);
|
||||
histoFolder->Write();
|
||||
fdf.Close();
|
||||
|
||||
// clean up
|
||||
|
||||
for (unsigned int i(0); i<finalHistos.size(); ++i) {
|
||||
delete finalHistos[i];
|
||||
delete finalHistosPPC[i];
|
||||
}
|
||||
finalHistos.clear();
|
||||
finalHistosPPC.clear();
|
||||
|
||||
for (unsigned int i(0); i<rootTmpFile.size(); ++i) {
|
||||
rootTmpFile[i]->Close();
|
||||
delete rootTmpFile[i];
|
||||
}
|
||||
rootTmpFile.clear();
|
||||
|
||||
histoFolder->Clear();
|
||||
delete histoFolder; histoFolder = 0;
|
||||
decayAnaModule->Clear();
|
||||
delete decayAnaModule; decayAnaModule = 0;
|
||||
|
||||
runInfoFolder->Clear();
|
||||
delete runInfoFolder; runInfoFolder = 0;
|
||||
delete runHeader; runHeader = 0;
|
||||
|
||||
|
||||
// // debug: check read in file and normalization
|
||||
// tmpNorm = 0.0;
|
||||
// for (map<double, pair<double, int> >::const_iterator it(spectrum.begin()); it != spectrum.end(); ++it) {
|
||||
// tmpNorm += it->second.first;
|
||||
// }
|
||||
// cout << "E normalizer: " << tmpNorm << endl;
|
||||
// ofstream of0("test-spec.dat");
|
||||
// for (map<double, pair<double, int> >::const_iterator it(spectrum.begin()); it != spectrum.end(); ++it) {
|
||||
// of0 << it->first << " " << it->second.first << " " << it->second.second << " " << coeff3/sqrt(it->first)*180.0/TMath::Pi() << endl;
|
||||
// }
|
||||
// of0.close();
|
||||
|
||||
rootFile->Close();
|
||||
delete rootFile;
|
||||
rootFile = 0;
|
||||
impSpec = 0;
|
||||
spectrum.clear();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script for the data generation -- also serves as "run log"
|
||||
|
||||
#arguments: run number, energy (keV), field (G), lambda (nm), dead layer (nm), broadening (G), asymmetry
|
||||
|
||||
#./simDataFullSpec 1 2.0 50.0 100.0 5.0 1.174 0.060
|
||||
#./simDataFullSpec 2 3.6 50.0 100.0 5.0 1.174 0.065
|
||||
#./simDataFullSpec 3 5.0 50.0 100.0 5.0 1.174 0.075
|
||||
#./simDataFullSpec 4 7.5 50.0 100.0 5.0 1.174 0.085
|
||||
#./simDataFullSpec 5 10.0 50.0 100.0 5.0 1.174 0.095
|
||||
#./simDataFullSpec 6 14.1 50.0 100.0 5.0 1.174 0.100
|
||||
#./simDataFullSpec 7 17.8 50.0 100.0 5.0 1.174 0.105
|
||||
#./simDataFullSpec 8 21.1 50.0 100.0 5.0 1.174 0.110
|
||||
#./simDataFullSpec 9 23.1 50.0 100.0 5.0 1.174 0.115
|
||||
#./simDataFullSpec 10 24.6 50.0 100.0 5.0 1.174 0.120
|
||||
|
||||
#./simDataFullSpec 11 2.0 50.0 100.0 5.0 5.87 0.060
|
||||
#./simDataFullSpec 12 3.6 50.0 100.0 5.0 5.87 0.065
|
||||
#./simDataFullSpec 13 5.0 50.0 100.0 5.0 5.87 0.075
|
||||
#./simDataFullSpec 14 7.5 50.0 100.0 5.0 5.87 0.085
|
||||
#./simDataFullSpec 15 10.0 50.0 100.0 5.0 5.87 0.095
|
||||
#./simDataFullSpec 16 14.1 50.0 100.0 5.0 5.87 0.100
|
||||
#./simDataFullSpec 17 17.8 50.0 100.0 5.0 5.87 0.105
|
||||
#./simDataFullSpec 18 21.1 50.0 100.0 5.0 5.87 0.110
|
||||
#./simDataFullSpec 19 23.1 50.0 100.0 5.0 5.87 0.115
|
||||
#./simDataFullSpec 20 24.6 50.0 100.0 5.0 5.87 0.12
|
||||
|
||||
#./simDataFullSpec 21 2.0 100.0 100.0 5.0 1.174 0.060
|
||||
#./simDataFullSpec 22 3.6 100.0 100.0 5.0 1.174 0.065
|
||||
#./simDataFullSpec 23 5.0 100.0 100.0 5.0 1.174 0.075
|
||||
#./simDataFullSpec 24 7.5 100.0 100.0 5.0 1.174 0.085
|
||||
#./simDataFullSpec 25 10.0 100.0 100.0 5.0 1.174 0.095
|
||||
#./simDataFullSpec 26 14.1 100.0 100.0 5.0 1.174 0.100
|
||||
#./simDataFullSpec 27 17.8 100.0 100.0 5.0 1.174 0.105
|
||||
#./simDataFullSpec 28 21.1 100.0 100.0 5.0 1.174 0.110
|
||||
#./simDataFullSpec 29 23.1 100.0 100.0 5.0 1.174 0.115
|
||||
#./simDataFullSpec 30 24.6 100.0 100.0 5.0 1.174 0.120
|
||||
|
||||
#./simDataFullSpec 31 2.0 100.0 100.0 5.0 8.218 0.060
|
||||
#./simDataFullSpec 32 3.6 100.0 100.0 5.0 8.218 0.065
|
||||
#./simDataFullSpec 33 5.0 100.0 100.0 5.0 8.218 0.075
|
||||
#./simDataFullSpec 34 7.5 100.0 100.0 5.0 8.218 0.085
|
||||
#./simDataFullSpec 35 10.0 100.0 100.0 5.0 8.218 0.095
|
||||
#./simDataFullSpec 36 14.1 100.0 100.0 5.0 8.218 0.100
|
||||
#./simDataFullSpec 37 17.8 100.0 100.0 5.0 8.218 0.105
|
||||
#./simDataFullSpec 38 21.1 100.0 100.0 5.0 8.218 0.110
|
||||
#./simDataFullSpec 39 23.1 100.0 100.0 5.0 8.218 0.115
|
||||
#./simDataFullSpec 40 24.6 100.0 100.0 5.0 8.218 0.120
|
||||
|
||||
#./simDataFullSpec 41 2.0 200.0 100.0 5.0 11.74 0.060
|
||||
#./simDataFullSpec 42 3.6 200.0 100.0 5.0 11.74 0.065
|
||||
#./simDataFullSpec 43 5.0 200.0 100.0 5.0 11.74 0.075
|
||||
#./simDataFullSpec 44 7.5 200.0 100.0 5.0 11.74 0.085
|
||||
#./simDataFullSpec 45 10.0 200.0 100.0 5.0 11.74 0.095
|
||||
#./simDataFullSpec 46 14.1 200.0 100.0 5.0 11.74 0.100
|
||||
#./simDataFullSpec 47 17.8 200.0 100.0 5.0 11.74 0.105
|
||||
#./simDataFullSpec 48 21.1 200.0 100.0 5.0 11.74 0.110
|
||||
#./simDataFullSpec 49 23.1 200.0 100.0 5.0 11.74 0.115
|
||||
#./simDataFullSpec 50 24.6 200.0 100.0 5.0 11.74 0.120
|
||||
|
||||
#./simDataFullSpec 51 2.0 25.0 100.0 5.0 3.522 0.060
|
||||
#./simDataFullSpec 52 3.6 25.0 100.0 5.0 3.522 0.065
|
||||
#./simDataFullSpec 53 5.0 25.0 100.0 5.0 3.522 0.075
|
||||
#./simDataFullSpec 54 7.5 25.0 100.0 5.0 3.522 0.085
|
||||
#./simDataFullSpec 55 10.0 25.0 100.0 5.0 3.522 0.095
|
||||
#./simDataFullSpec 56 14.1 25.0 100.0 5.0 3.522 0.100
|
||||
#./simDataFullSpec 57 17.8 25.0 100.0 5.0 3.522 0.105
|
||||
#./simDataFullSpec 58 21.1 25.0 100.0 5.0 3.522 0.110
|
||||
#./simDataFullSpec 59 23.1 25.0 100.0 5.0 3.522 0.115
|
||||
#./simDataFullSpec 60 24.6 25.0 100.0 5.0 3.522 0.120
|
||||
|
||||
#./simDataFullSpec 61 2.0 50.0 250.0 5.0 5.87 0.060
|
||||
#./simDataFullSpec 62 3.6 50.0 250.0 5.0 5.87 0.065
|
||||
#./simDataFullSpec 63 5.0 50.0 250.0 5.0 5.87 0.075
|
||||
#./simDataFullSpec 64 7.5 50.0 250.0 5.0 5.87 0.085
|
||||
#./simDataFullSpec 65 10.0 50.0 250.0 5.0 5.87 0.095
|
||||
#./simDataFullSpec 66 14.1 50.0 250.0 5.0 5.87 0.100
|
||||
#./simDataFullSpec 67 17.8 50.0 250.0 5.0 5.87 0.105
|
||||
#./simDataFullSpec 68 21.1 50.0 250.0 5.0 5.87 0.110
|
||||
#./simDataFullSpec 69 23.1 50.0 250.0 5.0 5.87 0.115
|
||||
#./simDataFullSpec 70 24.6 50.0 250.0 5.0 5.87 0.120
|
||||
|
||||
#./simDataFullSpec 71 2.0 100.0 250.0 5.0 8.218 0.060
|
||||
#./simDataFullSpec 72 3.6 100.0 250.0 5.0 8.218 0.065
|
||||
#./simDataFullSpec 73 5.0 100.0 250.0 5.0 8.218 0.075
|
||||
#./simDataFullSpec 74 7.5 100.0 250.0 5.0 8.218 0.085
|
||||
#./simDataFullSpec 75 10.0 100.0 250.0 5.0 8.218 0.095
|
||||
#./simDataFullSpec 76 14.1 100.0 250.0 5.0 8.218 0.100
|
||||
#./simDataFullSpec 77 17.8 100.0 250.0 5.0 8.218 0.105
|
||||
#./simDataFullSpec 78 21.1 100.0 250.0 5.0 8.218 0.110
|
||||
#./simDataFullSpec 79 23.1 100.0 250.0 5.0 8.218 0.115
|
||||
#./simDataFullSpec 80 24.6 100.0 250.0 5.0 8.218 0.120
|
||||
|
||||
#./simDataFullSpec 81 2.0 200.0 250.0 5.0 11.74 0.060
|
||||
#./simDataFullSpec 82 3.6 200.0 250.0 5.0 11.74 0.065
|
||||
#./simDataFullSpec 83 5.0 200.0 250.0 5.0 11.74 0.075
|
||||
#./simDataFullSpec 84 7.5 200.0 250.0 5.0 11.74 0.085
|
||||
#./simDataFullSpec 85 10.0 200.0 250.0 5.0 11.74 0.095
|
||||
#./simDataFullSpec 86 14.1 200.0 250.0 5.0 11.74 0.100
|
||||
#./simDataFullSpec 87 17.8 200.0 250.0 5.0 11.74 0.105
|
||||
#./simDataFullSpec 88 21.1 200.0 250.0 5.0 11.74 0.110
|
||||
#./simDataFullSpec 89 23.1 200.0 250.0 5.0 11.74 0.115
|
||||
#./simDataFullSpec 90 24.6 200.0 250.0 5.0 11.74 0.120
|
||||
|
||||
#./simDataFullSpec 91 2.0 25.0 250.0 5.0 3.522 0.060
|
||||
#./simDataFullSpec 92 3.6 25.0 250.0 5.0 3.522 0.065
|
||||
#./simDataFullSpec 93 5.0 25.0 250.0 5.0 3.522 0.075
|
||||
#./simDataFullSpec 94 7.5 25.0 250.0 5.0 3.522 0.085
|
||||
#./simDataFullSpec 95 10.0 25.0 250.0 5.0 3.522 0.095
|
||||
#./simDataFullSpec 96 14.1 25.0 250.0 5.0 3.522 0.100
|
||||
#./simDataFullSpec 97 17.8 25.0 250.0 5.0 3.522 0.105
|
||||
#./simDataFullSpec 98 21.1 25.0 250.0 5.0 3.522 0.110
|
||||
#./simDataFullSpec 99 23.1 25.0 250.0 5.0 3.522 0.115
|
||||
#./simDataFullSpec 100 24.6 25.0 250.0 5.0 3.522 0.120
|
||||
|
||||
./simDataFullSpec 101 2.0 25.0 100.0 5.0 5.87 0.060
|
||||
./simDataFullSpec 102 3.6 25.0 100.0 5.0 5.87 0.065
|
||||
./simDataFullSpec 103 5.0 25.0 100.0 5.0 5.87 0.075
|
||||
./simDataFullSpec 104 7.5 25.0 100.0 5.0 5.87 0.085
|
||||
./simDataFullSpec 105 10.0 25.0 100.0 5.0 5.87 0.095
|
||||
./simDataFullSpec 106 14.1 25.0 100.0 5.0 5.87 0.100
|
||||
./simDataFullSpec 107 17.8 25.0 100.0 5.0 5.87 0.105
|
||||
./simDataFullSpec 108 21.1 25.0 100.0 5.0 5.87 0.110
|
||||
./simDataFullSpec 109 23.1 25.0 100.0 5.0 5.87 0.115
|
||||
./simDataFullSpec 110 24.6 25.0 100.0 5.0 5.87 0.120
|
||||
231
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
231
src/external/libGapIntegrals/TGapIntegrals.cpp
vendored
@@ -72,9 +72,7 @@ ClassImp(TFilmMagnetizationDWave)
|
||||
* <p> s wave gap integral
|
||||
*/
|
||||
TGapSWave::TGapSWave() {
|
||||
TGapIntegral *gapint = new TGapIntegral();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TGapIntegral>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -88,9 +86,7 @@ TGapSWave::TGapSWave() {
|
||||
* <p> point p wave gap integral
|
||||
*/
|
||||
TGapPointPWave::TGapPointPWave() {
|
||||
TPointPWaveGapIntegralCuhre *gapint = new TPointPWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TPointPWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -104,9 +100,7 @@ TGapPointPWave::TGapPointPWave() {
|
||||
* <p> line p wave gap integral
|
||||
*/
|
||||
TGapLinePWave::TGapLinePWave() {
|
||||
TLinePWaveGapIntegralCuhre *gapint = new TLinePWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TLinePWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -120,9 +114,7 @@ TGapLinePWave::TGapLinePWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapDWave::TGapDWave() {
|
||||
TDWaveGapIntegralCuhre *gapint = new TDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TDWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -136,9 +128,7 @@ TGapDWave::TGapDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapCosSqDWave::TGapCosSqDWave() {
|
||||
TCosSqDWaveGapIntegralCuhre *gapint = new TCosSqDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TCosSqDWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -152,9 +142,7 @@ TGapCosSqDWave::TGapCosSqDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapSinSqDWave::TGapSinSqDWave() {
|
||||
TSinSqDWaveGapIntegralCuhre *gapint = new TSinSqDWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TSinSqDWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -168,9 +156,7 @@ TGapSinSqDWave::TGapSinSqDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapAnSWave::TGapAnSWave() {
|
||||
TAnSWaveGapIntegralCuhre *gapint = new TAnSWaveGapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TAnSWaveGapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -184,9 +170,7 @@ TGapAnSWave::TGapAnSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapNonMonDWave1::TGapNonMonDWave1() {
|
||||
TNonMonDWave1GapIntegralCuhre *gapint = new TNonMonDWave1GapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TNonMonDWave1GapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -200,9 +184,7 @@ TGapNonMonDWave1::TGapNonMonDWave1() {
|
||||
* <p>
|
||||
*/
|
||||
TGapNonMonDWave2::TGapNonMonDWave2() {
|
||||
TNonMonDWave2GapIntegralCuhre *gapint = new TNonMonDWave2GapIntegralCuhre();
|
||||
fGapIntegral = gapint;
|
||||
gapint = nullptr;
|
||||
fGapIntegral = std::make_unique<TNonMonDWave2GapIntegralCuhre>();
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
@@ -216,7 +198,7 @@ TGapNonMonDWave2::TGapNonMonDWave2() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaSWave::TLambdaSWave() {
|
||||
fLambdaInvSq = new TGapSWave();
|
||||
fLambdaInvSq = std::make_unique<TGapSWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -224,7 +206,7 @@ TLambdaSWave::TLambdaSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaPointPWave::TLambdaPointPWave() {
|
||||
fLambdaInvSq = new TGapPointPWave();
|
||||
fLambdaInvSq = std::make_unique<TGapPointPWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -232,7 +214,7 @@ TLambdaPointPWave::TLambdaPointPWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaLinePWave::TLambdaLinePWave() {
|
||||
fLambdaInvSq = new TGapLinePWave();
|
||||
fLambdaInvSq = std::make_unique<TGapLinePWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -240,7 +222,7 @@ TLambdaLinePWave::TLambdaLinePWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaDWave::TLambdaDWave() {
|
||||
fLambdaInvSq = new TGapDWave();
|
||||
fLambdaInvSq = std::make_unique<TGapDWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -248,7 +230,7 @@ TLambdaDWave::TLambdaDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaAnSWave::TLambdaAnSWave() {
|
||||
fLambdaInvSq = new TGapAnSWave();
|
||||
fLambdaInvSq = std::make_unique<TGapAnSWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -256,7 +238,7 @@ TLambdaAnSWave::TLambdaAnSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaNonMonDWave1::TLambdaNonMonDWave1() {
|
||||
fLambdaInvSq = new TGapNonMonDWave1();
|
||||
fLambdaInvSq = std::make_unique<TGapNonMonDWave1>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -264,7 +246,7 @@ TLambdaNonMonDWave1::TLambdaNonMonDWave1() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaNonMonDWave2::TLambdaNonMonDWave2() {
|
||||
fLambdaInvSq = new TGapNonMonDWave2();
|
||||
fLambdaInvSq = std::make_unique<TGapNonMonDWave2>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -272,7 +254,7 @@ TLambdaNonMonDWave2::TLambdaNonMonDWave2() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvSWave::TLambdaInvSWave() {
|
||||
fLambdaInvSq = new TGapSWave();
|
||||
fLambdaInvSq = std::make_unique<TGapSWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -280,7 +262,7 @@ TLambdaInvSWave::TLambdaInvSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvPointPWave::TLambdaInvPointPWave() {
|
||||
fLambdaInvSq = new TGapPointPWave();
|
||||
fLambdaInvSq = std::make_unique<TGapPointPWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -288,7 +270,7 @@ TLambdaInvPointPWave::TLambdaInvPointPWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvLinePWave::TLambdaInvLinePWave() {
|
||||
fLambdaInvSq = new TGapLinePWave();
|
||||
fLambdaInvSq = std::make_unique<TGapLinePWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -296,7 +278,7 @@ TLambdaInvLinePWave::TLambdaInvLinePWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvDWave::TLambdaInvDWave() {
|
||||
fLambdaInvSq = new TGapDWave();
|
||||
fLambdaInvSq = std::make_unique<TGapDWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -304,7 +286,7 @@ TLambdaInvDWave::TLambdaInvDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvAnSWave::TLambdaInvAnSWave() {
|
||||
fLambdaInvSq = new TGapAnSWave();
|
||||
fLambdaInvSq = std::make_unique<TGapAnSWave>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -312,7 +294,7 @@ TLambdaInvAnSWave::TLambdaInvAnSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvNonMonDWave1::TLambdaInvNonMonDWave1() {
|
||||
fLambdaInvSq = new TGapNonMonDWave1();
|
||||
fLambdaInvSq = std::make_unique<TGapNonMonDWave1>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -320,7 +302,7 @@ TLambdaInvNonMonDWave1::TLambdaInvNonMonDWave1() {
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvNonMonDWave2::TLambdaInvNonMonDWave2() {
|
||||
fLambdaInvSq = new TGapNonMonDWave2();
|
||||
fLambdaInvSq = std::make_unique<TGapNonMonDWave2>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
@@ -328,9 +310,6 @@ TLambdaInvNonMonDWave2::TLambdaInvNonMonDWave2() {
|
||||
* <p>
|
||||
*/
|
||||
TGapSWave::~TGapSWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -343,9 +322,6 @@ TGapSWave::~TGapSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapPointPWave::~TGapPointPWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -358,9 +334,6 @@ TGapPointPWave::~TGapPointPWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapLinePWave::~TGapLinePWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -373,9 +346,6 @@ TGapLinePWave::~TGapLinePWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapDWave::~TGapDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -388,9 +358,6 @@ TGapDWave::~TGapDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapCosSqDWave::~TGapCosSqDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -403,9 +370,6 @@ TGapCosSqDWave::~TGapCosSqDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapSinSqDWave::~TGapSinSqDWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -418,9 +382,6 @@ TGapSinSqDWave::~TGapSinSqDWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapAnSWave::~TGapAnSWave() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -433,9 +394,6 @@ TGapAnSWave::~TGapAnSWave() {
|
||||
* <p>
|
||||
*/
|
||||
TGapNonMonDWave1::~TGapNonMonDWave1() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -448,9 +406,6 @@ TGapNonMonDWave1::~TGapNonMonDWave1() {
|
||||
* <p>
|
||||
*/
|
||||
TGapNonMonDWave2::~TGapNonMonDWave2() {
|
||||
delete fGapIntegral;
|
||||
fGapIntegral = nullptr;
|
||||
|
||||
fTemp.clear();
|
||||
fTempIter = fTemp.end();
|
||||
fIntegralValues.clear();
|
||||
@@ -458,133 +413,6 @@ TGapNonMonDWave2::~TGapNonMonDWave2() {
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaSWave::~TLambdaSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaPointPWave::~TLambdaPointPWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaLinePWave::~TLambdaLinePWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaDWave::~TLambdaDWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaAnSWave::~TLambdaAnSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaNonMonDWave1::~TLambdaNonMonDWave1() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaNonMonDWave2::~TLambdaNonMonDWave2() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvSWave::~TLambdaInvSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvPointPWave::~TLambdaInvPointPWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvLinePWave::~TLambdaInvLinePWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvDWave::~TLambdaInvDWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvAnSWave::~TLambdaInvAnSWave() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvNonMonDWave1::~TLambdaInvNonMonDWave1() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TLambdaInvNonMonDWave2::~TLambdaInvNonMonDWave2() {
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>prepare the needed parameters for the integration carried out in TGapIntegral.
|
||||
@@ -1685,18 +1513,7 @@ double TLambdaInvPowerLaw::operator()(double t, const std::vector<double> &par)
|
||||
*/
|
||||
TFilmMagnetizationDWave::TFilmMagnetizationDWave()
|
||||
{
|
||||
fLambdaInvSq = new TGapDWave();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
TFilmMagnetizationDWave::~TFilmMagnetizationDWave()
|
||||
{
|
||||
delete fLambdaInvSq;
|
||||
fLambdaInvSq = nullptr;
|
||||
fLambdaInvSq = std::make_unique<TGapDWave>();
|
||||
fPar.clear();
|
||||
}
|
||||
|
||||
|
||||
80
src/external/libGapIntegrals/TGapIntegrals.h
vendored
80
src/external/libGapIntegrals/TGapIntegrals.h
vendored
@@ -29,8 +29,9 @@
|
||||
#ifndef _TGapIntegrals_H_
|
||||
#define _TGapIntegrals_H_
|
||||
|
||||
#include<vector>
|
||||
#include<cmath>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
#include "PUserFcnBase.h"
|
||||
#include "BMWIntegrator.h"
|
||||
@@ -48,7 +49,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapIntegral *fGapIntegral;
|
||||
std::unique_ptr<TGapIntegral> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -72,7 +73,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TPointPWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TPointPWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -96,7 +97,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TLinePWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TLinePWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -120,7 +121,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TDWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TDWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -144,7 +145,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TCosSqDWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TCosSqDWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -168,7 +169,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TSinSqDWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TSinSqDWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -192,7 +193,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TAnSWaveGapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TAnSWaveGapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -216,7 +217,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TNonMonDWave1GapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TNonMonDWave1GapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -240,7 +241,7 @@ public:
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TNonMonDWave2GapIntegralCuhre *fGapIntegral;
|
||||
std::unique_ptr<TNonMonDWave2GapIntegralCuhre> fGapIntegral;
|
||||
mutable std::vector<double> fTemp;
|
||||
mutable std::vector<double>::const_iterator fTempIter;
|
||||
mutable std::vector<double> fIntegralValues;
|
||||
@@ -259,9 +260,6 @@ private:
|
||||
class TGapPowerLaw : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TGapPowerLaw() {}
|
||||
virtual ~TGapPowerLaw() {}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
@@ -276,9 +274,6 @@ private:
|
||||
class TGapDirtySWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TGapDirtySWave() {}
|
||||
virtual ~TGapDirtySWave() {}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
@@ -295,12 +290,11 @@ class TLambdaSWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaSWave();
|
||||
virtual ~TLambdaSWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapSWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapSWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaSWave,1)
|
||||
};
|
||||
@@ -313,12 +307,11 @@ class TLambdaPointPWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaPointPWave();
|
||||
virtual ~TLambdaPointPWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapPointPWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapPointPWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaPointPWave,1)
|
||||
};
|
||||
@@ -331,12 +324,11 @@ class TLambdaLinePWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaLinePWave();
|
||||
virtual ~TLambdaLinePWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapLinePWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapLinePWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaLinePWave,1)
|
||||
};
|
||||
@@ -349,12 +341,11 @@ class TLambdaDWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaDWave();
|
||||
virtual ~TLambdaDWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapDWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaDWave,1)
|
||||
};
|
||||
@@ -367,12 +358,11 @@ class TLambdaAnSWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaAnSWave();
|
||||
virtual ~TLambdaAnSWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapAnSWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapAnSWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaAnSWave,1)
|
||||
};
|
||||
@@ -385,12 +375,11 @@ class TLambdaNonMonDWave1 : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaNonMonDWave1();
|
||||
virtual ~TLambdaNonMonDWave1();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave1 *fLambdaInvSq;
|
||||
std::unique_ptr<TGapNonMonDWave1> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaNonMonDWave1,1)
|
||||
};
|
||||
@@ -403,12 +392,11 @@ class TLambdaNonMonDWave2 : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaNonMonDWave2();
|
||||
virtual ~TLambdaNonMonDWave2();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave2 *fLambdaInvSq;
|
||||
std::unique_ptr<TGapNonMonDWave2> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaNonMonDWave2,1)
|
||||
};
|
||||
@@ -420,9 +408,6 @@ private:
|
||||
class TLambdaPowerLaw : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaPowerLaw() {}
|
||||
virtual ~TLambdaPowerLaw() {}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
@@ -438,12 +423,11 @@ class TLambdaInvSWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvSWave();
|
||||
virtual ~TLambdaInvSWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapSWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapSWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvSWave,1)
|
||||
};
|
||||
@@ -456,12 +440,11 @@ class TLambdaInvPointPWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvPointPWave();
|
||||
virtual ~TLambdaInvPointPWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapPointPWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapPointPWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvPointPWave,1)
|
||||
};
|
||||
@@ -474,12 +457,11 @@ class TLambdaInvLinePWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvLinePWave();
|
||||
virtual ~TLambdaInvLinePWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapLinePWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapLinePWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvLinePWave,1)
|
||||
};
|
||||
@@ -492,12 +474,11 @@ class TLambdaInvDWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvDWave();
|
||||
virtual ~TLambdaInvDWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapDWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvDWave,1)
|
||||
};
|
||||
@@ -510,12 +491,11 @@ class TLambdaInvAnSWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvAnSWave();
|
||||
virtual ~TLambdaInvAnSWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapAnSWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapAnSWave> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvAnSWave,1)
|
||||
};
|
||||
@@ -528,12 +508,11 @@ class TLambdaInvNonMonDWave1 : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvNonMonDWave1();
|
||||
virtual ~TLambdaInvNonMonDWave1();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave1 *fLambdaInvSq;
|
||||
std::unique_ptr<TGapNonMonDWave1> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvNonMonDWave1,1)
|
||||
};
|
||||
@@ -546,12 +525,11 @@ class TLambdaInvNonMonDWave2 : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvNonMonDWave2();
|
||||
virtual ~TLambdaInvNonMonDWave2();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapNonMonDWave2 *fLambdaInvSq;
|
||||
std::unique_ptr<TGapNonMonDWave2> fLambdaInvSq;
|
||||
|
||||
ClassDef(TLambdaInvNonMonDWave2,1)
|
||||
};
|
||||
@@ -563,9 +541,6 @@ private:
|
||||
class TLambdaInvPowerLaw : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TLambdaInvPowerLaw() {}
|
||||
virtual ~TLambdaInvPowerLaw() {}
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
@@ -581,12 +556,11 @@ class TFilmMagnetizationDWave : public PUserFcnBase {
|
||||
|
||||
public:
|
||||
TFilmMagnetizationDWave();
|
||||
virtual ~TFilmMagnetizationDWave();
|
||||
|
||||
double operator()(double, const std::vector<double>&) const;
|
||||
|
||||
private:
|
||||
TGapDWave *fLambdaInvSq;
|
||||
std::unique_ptr<TGapDWave> fLambdaInvSq;
|
||||
|
||||
mutable std::vector<double> fPar;
|
||||
|
||||
|
||||
2
src/external/libGbGLF/PGbGLF.cpp
vendored
2
src/external/libGbGLF/PGbGLF.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/libGbGLF/PGbGLF.h
vendored
2
src/external/libGbGLF/PGbGLF.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2023 by Andreas Suter *
|
||||
* Copyright (C) 2007-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
@@ -7,7 +7,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016-2023 by Andreas Suter *
|
||||
* Copyright (C) 2016-2024 by Andreas Suter *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2023 by Andreas Suter *
|
||||
* Copyright (C) 2013-2024 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/mud/src/mud.h
vendored
2
src/external/mud/src/mud.h
vendored
@@ -4,7 +4,7 @@
|
||||
* mud.h Declarations for MUD
|
||||
* v1.3
|
||||
*
|
||||
* Copyright (C) 1994-2023 TRIUMF (Vancouver, Canada)
|
||||
* Copyright (C) 1994-2024 TRIUMF (Vancouver, Canada)
|
||||
*
|
||||
* Authors: T. Whidden, D. Arseneau, S. Daviel
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user