Commit 9bfdb5cc authored by Tobias WEBER's avatar Tobias WEBER

cleanups

parent c2f0a124
......@@ -7,7 +7,7 @@
find_path(Minuit2_INCLUDE_DIRS
NAMES MnMigrad.h
PATH_SUFFIXES root Minuit2 Minuit root/Minuit2 root/Minuit
HINTS /usr/include/root/Minuit2 /usr/local/include/root/Minuit2 /opt/local/include/root/Minuit2
HINTS /usr/local/include/Minuit2 /usr/include/Minuit2 /usr/local/include/root/Minuit2 /usr/include/root/Minuit2 /opt/local/include/root/Minuit2
DOC "Root/Minuit2 include directories"
)
......@@ -17,7 +17,7 @@ list(APPEND Minuit2_INCLUDE_DIRS "${Minuit2_INCLUDE_DIRS}/..")
find_library(Minuit2_LIBRARIES
NAMES Minuit2
HINTS /usr/lib64/root /usr/lib/root /usr/lib32/root
HINTS /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /usr/lib64/root /usr/lib/root /usr/lib32/root
DOC "Minuit2 library"
)
......
......@@ -86,7 +86,7 @@ void Log::begin_log()
{
s_mtx.lock();
std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
const std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
std::vector<t_pairOstr> vecOstrs = arrayunion({m_vecOstrs, vecOstrsTh});
for(t_pairOstr &pairOstr : vecOstrs)
......@@ -133,7 +133,7 @@ void Log::begin_log()
void Log::end_log()
{
std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
const std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
std::vector<t_pairOstr> vecOstrs = arrayunion({m_vecOstrs, vecOstrsTh});
for(t_pairOstr& pairOstr : vecOstrs)
......@@ -192,7 +192,13 @@ Log::~Log()
std::vector<Log::t_pairOstr>& Log::GetThreadOstrs()
{
return m_mapOstrsTh[std::this_thread::get_id()];
static const std::vector<Log::t_pairOstr> empty;
t_mapthreadOstrs::iterator iter = m_mapOstrsTh.find(std::this_thread::get_id());
if(iter == m_mapOstrsTh.end())
iter = m_mapOstrsTh.insert({std::this_thread::get_id(), std::vector<t_pairOstr>()}).first;
return iter->second;
}
......
......@@ -82,7 +82,7 @@ public:
if(!m_bEnabled) return;
begin_log();
std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
const std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
std::vector<t_pairOstr> vecOstrs = arrayunion({m_vecOstrs, vecOstrsTh});
for(t_pairOstr& pair : vecOstrs)
......@@ -99,7 +99,7 @@ public:
if(!m_bEnabled) return;
inc_depth();
std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
const std::vector<t_pairOstr>& vecOstrsTh = GetThreadOstrs();
std::vector<t_pairOstr> vecOstrs = arrayunion({m_vecOstrs, vecOstrsTh});
for(t_pairOstr& pair : vecOstrs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment