From 7c07290d9342381d89e38bf6852505a1e4e191a6 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 20:46:23 +0200 Subject: [PATCH 01/21] [math][genvector] remove leftover Makefile --- math/genvector/test/Makefile | 207 ----------------------------------- 1 file changed, 207 deletions(-) delete mode 100644 math/genvector/test/Makefile diff --git a/math/genvector/test/Makefile b/math/genvector/test/Makefile deleted file mode 100644 index 89f2dfabfa6ad..0000000000000 --- a/math/genvector/test/Makefile +++ /dev/null @@ -1,207 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - -ROOTSYS = ../../.. -include $(ROOTSYS)/etc/Makefile.arch - -#------------------------------------------------------------------------------ - -ifeq ($(PLATFORM),win32) -EXTRALIBS = -include:_G__cpp_setupG__GenVector -include:_G__cpp_setupG__GenVector32 "$(ROOTSYS)/lib/libGenVector.lib" -else -EXTRALIBS = -lGenVector -CXXFLAGS += -g -endif - -ifeq ($(DIM),2) -CXXFLAGS += -DDIM_2 -endif -ifeq ($(DIM),3) -CXXFLAGS += -DDIM_3 -endif -ifneq ($(USE_CLHEP),) -CXXFLAGS += -DUSE_CLHEP -endif -ifneq ($(USE_ROOT),) -CXXFLAGS += -DUSE_ROOT -endif - - -# use reflex -#useReflex=yes -ifneq ($(USE_REFLEX),) -GCCXML=yes -CXXFLAGS += -DUSE_REFLEX -endif - - -# if have clhep -ifneq ($(CLHEPBASE),) -CXXFLAGS+= -I$(CLHEPBASE)/include -DHAVE_CLHEP -ifeq ($(PLATFORM),win32) -EXTRALIBS += "$(CLHEPBASE)/lib/CLHEP.lib" -else -#EXTRALIBS+= $(CLHEPBASE)/lib/libCLHEP.a -EXTRALIBS+= -L$(CLHEPBASE)/lib -lCLHEP -endif -endif - - -COORDINATES3DOBJ = coordinates3D.$(ObjSuf) -COORDINATES3DSRC = coordinates3D.$(SrcSuf) -COORDINATES3D = coordinates3D$(ExeSuf) - -COORDINATES4DOBJ = coordinates4D.$(ObjSuf) -COORDINATES4DSRC = coordinates4D.$(SrcSuf) -COORDINATES4D = coordinates4D$(ExeSuf) - -ROTATIONOBJ = rotationApplication.$(ObjSuf) -ROTATIONSRC = rotationApplication.$(SrcSuf) -ROTATION = rotationApplication$(ExeSuf) - -BOOSTOBJ = testBoost.$(ObjSuf) -BOOSTSRC = testBoost.$(SrcSuf) -BOOST = testBoost$(ExeSuf) - -ITERATOROBJ = testIterator.$(ObjSuf) -ITERATORSRC = testIterator.$(SrcSuf) -ITERATOR = testIterator$(ExeSuf) - -GENVECTOROBJ = testGenVector.$(ObjSuf) -GENVECTORSRC = testGenVector.$(SrcSuf) -GENVECTOR = testGenVector$(ExeSuf) - -VECTORIOOBJ = testVectorIO.$(ObjSuf) -VECTORIOSRC = testVectorIO.$(SrcSuf) -VECTORIO = testVectorIO$(ExeSuf) - -STRESS3DOBJ = stress3D.$(ObjSuf) -STRESS3DSRC = stress3D.$(SrcSuf) -STRESS3D = stress3D$(ExeSuf) - -STRESS2DOBJ = stress2D.$(ObjSuf) -STRESS2DSRC = stress2D.$(SrcSuf) -STRESS2D = stress2D$(ExeSuf) - -VECTOROPOBJ = vectorOperation.$(ObjSuf) -VECTOROPSRC = vectorOperation.$(SrcSuf) -VECTOROP = vectorOperation$(ExeSuf) - -#VECTORSCALEOBJ = testVectorScale.$(ObjSuf) -#VECTORSCALESRC = testVectorScale.$(SrcSuf) -#VECTORSCALE = testVectorScale$(ExeSuf) - - -OBJS = $(COORDINATES3DOBJ) $(COORDINATES4DOBJ) $(ROTATIONOBJ) $(BOOSTOBJ) $(GENVECTOROBJ) $(VECTORIOOBJ) $(STRESS3DOBJ) $(STRESS2DOBJ) $(ITERATOROBJ) $(VECTOROPOBJ) - - -PROGRAMS = $(COORDINATES3D) $(COORDINATES4D) $(ROTATION) $(BOOST) $(GENVECTOR) $(VECTORIO) $(STRESS3D) $(STRESS2D) $(ITERATOR) $(VECTOROP) - - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - - -all: $(PROGRAMS) libTrackDict.$(DllSuf) - - -$(COORDINATES3D): $(COORDINATES3DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(COORDINATES4D): $(COORDINATES4DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(ROTATION): $(ROTATIONOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(BOOST): $(BOOSTOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(GENVECTOR): $(GENVECTOROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(VECTORIO): $(VECTORIOOBJ) libTrackDict.$(DllSuf) - $(LD) $(LDFLAGS) $(VECTORIOOBJ) $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESS3D): $(STRESS3DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESS2D): $(STRESS2DOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(ITERATOR): $(ITERATOROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - - -$(VECTOROP): $(VECTOROPOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ - @echo "$@ done" - -# $(VECTORSCALE): $(VECTORSCALEOBJ) -# $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(EXTRAIOLIBS) $(OutPutOpt)$@ -# @echo "$@ done" - - -ifneq ($(USE_REFLEX),) -TrackDict.$(SrcSuf): Track.h TrackDict.xml - @echo "Generating dictionary $@ using gccxml ..." - genreflex Track.h --selection_file=TrackDict.xml -o TrackDict.cxx -I$(ROOTSYS)/include -else -TrackDict.$(SrcSuf): Track.h TrackLinkDef.h - @echo "Generating dictionary $@ using rootcling ..." - $(ROOTCLING) -f $@ -c $^ -endif - - -libTrackDict.$(DllSuf): TrackDict.$(ObjSuf) -ifeq ($(ARCH),aix) - /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(GLIBS) -p 0 $^ -else -ifeq ($(ARCH),aix5) - /usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(GLIBS) -p 0 $^ -else -ifeq ($(PLATFORM),macosx) - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ -else -ifeq ($(PLATFORM),win32) - bindexplib libTrackDict $^ > libTrackDict.def - lib -nologo -MACHINE:IX86 $^ -def:$*.def \ - $(OutPutOpt)libTrackDict.lib - $(LD) $(SOFLAGS) $(LDFLAGS) $^ libTrackDict.exp $(LIBS) \ - $(OutPutOpt)$@ -else - $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt)$@ -endif -endif -endif -endif - - - - -clean: - @rm -f $(OBJS) core TrackDict.$(SrcSuf) TrackDict.h - -distclean: clean - @rm -f $(PROGRAMS) libTrackDict.* - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From 63f44c65855db421c1ed1c81d934cdbbe7b1315b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 20:50:11 +0200 Subject: [PATCH 02/21] [mathcore] remove leftover Makefile --- math/mathcore/test/fit/Makefile | 114 -------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 math/mathcore/test/fit/Makefile diff --git a/math/mathcore/test/fit/Makefile b/math/mathcore/test/fit/Makefile deleted file mode 100644 index cd78e419fba6b..0000000000000 --- a/math/mathcore/test/fit/Makefile +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - - -# RC := root-config -# ifeq ($(shell which $(RC) 2>&1 | sed -ne "s@.*/$(RC)@$(RC)@p"),$(RC)) -# MKARCH := $(wildcard $(shell $(RC) --etcdir)/Makefile.arch) -# RCONFIG := $(wildcard $(shell $(RC) --incdir)/RConfigure.h) -# endif -# ifneq ($(MKARCH),) -# include $(MKARCH) -# else -# ifeq ($(ROOTSYS),) -# ROOTSYS = .. -# endif -# include $(ROOTSYS)/etc/Makefile.arch -# endif - -ifeq ($(ROOTSYS),) -ROOTSYS = ../../../.. -endif -include $(ROOTSYS)/config/Makefile.config -include $(ROOTSYS)/etc/Makefile.arch - -#------------------------------------------------------------------------------ - - - -ifeq ($(PLATFORM),win32) -EXTRALIBS= "$(ROOTSYS)/lib/libMathMore.lib" -ROOFITLIBS= "$(ROOTSYS)/lib/libMinuit.lib" "$(ROOTSYS)/lib/libThread.lib" "$(ROOTSYS)/lib/libHtml.lib" -else -EXTRALIBS= -ROOFITLIBS= -lMathMore -lMinuit -lThread -lHtml -lFoam -CXXFLAGS += -g -endif - -SPARSEDATACOMPAREROBJ = SparseDataComparer.$(ObjSuf) -SPARSEDATACOMPARERSRC = SparseDataComparer.$(SrcSuf) -SPARSEDATACOMPARER = SparseDataComparer$(ExeSuf) - -SPARSEFIT3OBJ = SparseFit3.$(ObjSuf) -SPARSEFIT3SRC = SparseFit3.$(SrcSuf) -SPARSEFIT3 = SparseFit3$(ExeSuf) - -SPARSEFIT4OBJ = SparseFit4.$(ObjSuf) -SPARSEFIT4SRC = SparseFit4.$(SrcSuf) -SPARSEFIT4 = SparseFit4$(ExeSuf) - -TESTFITOBJ = testFit.$(ObjSuf) -TESTFITSRC = testFit.$(SrcSuf) -TESTFIT = testFit$(ExeSuf) - - -TESTMINIMOBJ = testMinim.$(ObjSuf) -TESTMINIMSRC = testMinim.$(SrcSuf) -TESTMINIM = testMinim$(ExeSuf) - -GRAPHFITOBJ = testGraphFit.$(ObjSuf) -GRAPHFITSRC = testGraphFit.$(SrcSuf) -GRAPHFIT = testGraphFit$(ExeSuf) - - -OBJS = $(SPARSEFIT4OBJ) $(SPARSEFIT3OBJ) $(SPARSEDATACOMPAREROBJ) $(TESTFITOBJ) $(TESTMINIMOBJ) $(GRAPHFITOBJ) - - -PROGRAMS = $(SPARSEFIT4) $(SPARSEFIT3) $(SPARSEDATACOMPARER) $(TESTFIT) $(TESTMINIM) $(GRAPHFIT) - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - -all: $(PROGRAMS) - -$(SPARSEFIT4): $(SPARSEFIT4OBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(SPARSEFIT3): $(SPARSEFIT3OBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(SPARSEDATACOMPARER): $(SPARSEDATACOMPAREROBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTFIT): $(TESTFITOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(GRAPHFIT): $(GRAPHFITOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTMINIM): $(TESTMINIMOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -clean: - @rm -f $(OBJS) core - -distclean: clean - @rm -f $(PROGRAMS) - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From 5d47b4fbf0c4a27f268627335708f9ae557bf1a5 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 7 Apr 2026 21:12:31 +0200 Subject: [PATCH 03/21] [math] rescue smatrix test by migrating to CMake --- math/smatrix/CMakeLists.txt | 2 + math/smatrix/test/CMakeLists.txt | 51 ++++++++++ math/smatrix/test/Makefile | 168 ------------------------------- 3 files changed, 53 insertions(+), 168 deletions(-) create mode 100644 math/smatrix/test/CMakeLists.txt delete mode 100644 math/smatrix/test/Makefile diff --git a/math/smatrix/CMakeLists.txt b/math/smatrix/CMakeLists.txt index a1c06b84984e5..e7fe665e34819 100644 --- a/math/smatrix/CMakeLists.txt +++ b/math/smatrix/CMakeLists.txt @@ -57,3 +57,5 @@ ROOT_GENERATE_DICTIONARY(G__Smatrix32 Core MathCore ) + +ROOT_ADD_TEST_SUBDIRECTORY(test) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt new file mode 100644 index 0000000000000..a5fc646a354c0 --- /dev/null +++ b/math/smatrix/test/CMakeLists.txt @@ -0,0 +1,51 @@ +# Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. +# All rights reserved. +# +# For the licensing terms see $ROOTSYS/LICENSE. +# For the list of contributors see $ROOTSYS/README/CREDITS. + +# @author Danilo Piparo CERN + +project(smatrix-tests) + +set(Libraries Core RIO Tree Rint Matrix MathCore Hist) + +set(TestSource + testSMatrix.cxx + testOperations.cxx + testKalman.cxx + testIO.cxx + testInversion.cxx + stressOperations.cxx + stressKalman.cxx) + +if (USE_REFLEX) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() + +#---Build and add all the defined test in the list--------------- +foreach(file ${TestSource}) + get_filename_component(testname ${file} NAME_WE) + if (testname STREQUAL "testIO") + ROOT_EXECUTABLE(${testname} ${file} TrackDict.cxx LIBRARIES ${Libraries}) + else() + ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) + endif() + target_include_directories(${testname} PRIVATE ./) + if (CLHEPBASE) + target_include_directories(${testname} PRIVATE ${CLHEPBASE}) + target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) + if (WIN32) + target_link_libraries(${testname} PRIVATE "${CLHEPBASE}/lib/CLHEP.lib") + else() + target_link_libraries(${testname} PRIVATE "CLHEP" "m") + target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") + endif() + endif() + if (USE_REFLEX) + target_compile_definitions(${testname} PRIVATE USE_REFLEX) + endif() + ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) +endforeach() diff --git a/math/smatrix/test/Makefile b/math/smatrix/test/Makefile deleted file mode 100644 index 1c3b803b542a3..0000000000000 --- a/math/smatrix/test/Makefile +++ /dev/null @@ -1,168 +0,0 @@ -# Makefile for the ROOT test programs. -# This Makefile shows nicely how to compile and link applications -# using the ROOT libraries on all supported platforms. -# -# Copyright (c) 2000 Rene Brun and Fons Rademakers -# -# Author: Fons Rademakers, 29/2/2000 - -ifeq ($(ROOTSYS),) -ROOTSYS = ../../.. -endif -include $(ROOTSYS)/etc/Makefile.arch -include $(ROOTSYS)/config/Makefile.config - -#------------------------------------------------------------------------------ - -# ifeq ($(PLATFORM),macosx) -# #unroll loop better on gcc > 4 -# CXXFLAGS+= -O3 -g -funroll-loops -# endif - - - -# if have clhep -#CLHEPBASE=/Users/moneta/mathlibs/CLHEP-1.9.2.2 -ifneq ($(CLHEPBASE),) -CXXFLAGS+= -I$(CLHEPBASE)/include -DHAVE_CLHEP -ifeq ($(PLATFORM),win32) -EXTRALIBS += "$(CLHEPBASE)/lib/CLHEP.lib" -else -#EXTRALIBS+= $(CLHEPBASE)/lib/libCLHEP.a -EXTRALIBS+= -L$(CLHEPBASE)/lib -lCLHEP -endif -endif - -ifneq ($(PLATFORM),win32) -LIBM = -lm -endif - -ifneq ($(USE_REFLEX),) -GCCXML=yes -CXXFLAGS+=-DUSE_REFLEX -endif - - - -TESTSMATRIXOBJ = testSMatrix.$(ObjSuf) -TESTSMATRIXSRC = testSMatrix.$(SrcSuf) -TESTSMATRIX = testSMatrix$(ExeSuf) - -TESTOPERATIONSOBJ = testOperations.$(ObjSuf) -TESTOPERATIONSSRC = testOperations.$(SrcSuf) -TESTOPERATIONS = testOperations$(ExeSuf) - -TESTKALMANOBJ = testKalman.$(ObjSuf) -TESTKALMANSRC = testKalman.$(SrcSuf) -TESTKALMAN = testKalman$(ExeSuf) - -TESTIOOBJ = testIO.$(ObjSuf) -TESTIOSRC = testIO.$(SrcSuf) -TESTIO = testIO$(ExeSuf) - -TESTINVERSIONOBJ = testInversion.$(ObjSuf) -TESTINVERSIONSRC = testInversion.$(SrcSuf) -TESTINVERSION = testInversion$(ExeSuf) - - -STRESSOPERATIONSOBJ = stressOperations.$(ObjSuf) -STRESSOPERATIONSSRC = stressOperations.$(SrcSuf) -STRESSOPERATIONS = stressOperations$(ExeSuf) - - -STRESSKALMANOBJ = stressKalman.$(ObjSuf) -STRESSKALMANSRC = stressKalman.$(SrcSuf) -STRESSKALMAN = stressKalman$(ExeSuf) - - -OBJS = $(TESTSMATRIXOBJ) $(TESTOPERATIONSOBJ) $(TESTKALMANOBJ) $(TESTINVERSIONOBJ) $(TESTIOOBJ) $(STRESSOPERATIONSOBJ) $(STRESSKALMANOBJ) - - -PROGRAMS = $(TESTSMATRIX) $(TESTOPERATIONS) $(TESTKALMAN) $(TESTINVERSION) $(TESTIO) $(STRESSOPERATIONS) $(STRESSKALMAN) - - -.SUFFIXES: .$(SrcSuf) .$(ObjSuf) $(ExeSuf) - - -all: $(PROGRAMS) libTrackDict.$(DllSuf) - -testOperations.$(ObjSuf): matrix_op.h matrix_util.h TestTimer.h - -testKalman.$(ObjSuf): matrix_util.h TestTimer.h - -stressOperations.$(ObjSuf): $(TESTOPERATIONSOBJ) - - -$(TESTSMATRIX): $(TESTSMATRIXOBJ) - $(LD) $(LDFLAGS) $^ $(LIBM) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTOPERATIONS): $(TESTOPERATIONSOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTKALMAN): $(TESTKALMANOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTINVERSION): $(TESTINVERSIONOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(TESTIO): $(TESTIOOBJ) libTrackDict.$(DllSuf) - $(LD) $(LDFLAGS) $(TESTIOOBJ) $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -ifneq ($(USE_REFLEX),) -TrackDict.$(SrcSuf): Track.h TrackDict.xml - @echo "Generating dictionary $@ using gccxml ..." - genreflex Track.h --selection_file=TrackDict.xml -o TrackDict.cxx -I$(ROOTSYS)/include -else -TrackDict.$(SrcSuf): Track.h TrackLinkDef.h - @echo "Generating dictionary $@ using rootcling ..." - $(ROOTCLING) -f $@ -c $^ -endif - - -libTrackDict.$(DllSuf): TrackDict.$(ObjSuf) -ifeq ($(ARCH),aix) - /usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^ -else -ifeq ($(ARCH),aix5) - /usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^ -else -ifeq ($(PLATFORM),macosx) - $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ -else - $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@ - $(MT_DLL) -endif -endif -endif - - -$(STRESSKALMAN): $(STRESSKALMANOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -$(STRESSOPERATIONS): $(STRESSOPERATIONSOBJ) - $(LD) $(LDFLAGS) $^ $(LIBS) $(EXTRALIBS) $(OutPutOpt)$@ - @echo "$@ done" - -check: all - for prog in $(PROGRAMS); do \ - ./$$prog > $$prog.out; \ - done; - -clean: - @rm -f $(OBJS) $(PROGRAMS) libTrackDict.* TrackDict.$(ObjSuf) TrackDict.$(SrcSuf) TrackDict.h core - -distclean: clean - @rm -f $(PROGRAMS) kalman.root stressOperations.root - - -.SUFFIXES: .$(SrcSuf) - - -.$(SrcSuf).$(ObjSuf): - $(CXX) $(CXXFLAGS) -c $< From 72d8a106a1247d4b4b7bb53a1fee8fd12b4c7d3a Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 10:11:44 +0200 Subject: [PATCH 04/21] [tests] fix warnings --- math/smatrix/test/stressKalman.cxx | 12 ++++++------ math/smatrix/test/testIO.cxx | 4 ++-- math/smatrix/test/testInversion.cxx | 4 ++-- math/smatrix/test/testKalman.cxx | 12 ++++++------ math/smatrix/test/testSMatrix.cxx | 1 + 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/math/smatrix/test/stressKalman.cxx b/math/smatrix/test/stressKalman.cxx index 6dbe7b53fe20f..ae41260939473 100644 --- a/math/smatrix/test/stressKalman.cxx +++ b/math/smatrix/test/stressKalman.cxx @@ -380,8 +380,8 @@ int TestRunner::test_smatrix_kalman() { // need to write explicitly the dimensions - typedef ROOT::Math::SMatrix MnMatrixNN; - typedef ROOT::Math::SMatrix MnMatrixMM; + // typedef ROOT::Math::SMatrix MnMatrixNN; + // typedef ROOT::Math::SMatrix MnMatrixMM; typedef ROOT::Math::SMatrix MnMatrixNM; typedef ROOT::Math::SMatrix MnMatrixMN; typedef ROOT::Math::SMatrix MnSymMatrixNN; @@ -525,16 +525,16 @@ int TestRunner::test_smatrix_sym_kalman() { // need to write explicitly the dimensions - typedef ROOT::Math::SMatrix MnMatrixNN; - typedef ROOT::Math::SMatrix MnMatrixMM; + // typedef ROOT::Math::SMatrix MnMatrixNN; + // typedef ROOT::Math::SMatrix MnMatrixMM; typedef ROOT::Math::SMatrix MnMatrixNM; typedef ROOT::Math::SMatrix MnMatrixMN; typedef ROOT::Math::SMatrix > MnSymMatrixNN; typedef ROOT::Math::SMatrix > MnSymMatrixMM; typedef ROOT::Math::SVector MnVectorN; typedef ROOT::Math::SVector MnVectorM; - typedef ROOT::Math::SVector MnVectorN2; - typedef ROOT::Math::SVector MnVectorM2; + // typedef ROOT::Math::SVector MnVectorN2; + // typedef ROOT::Math::SVector MnVectorM2; diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index d44d4090417c2..a6b27d2e8224e 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -470,7 +470,7 @@ double readSMatrix(const std::string & file) { TFile f1(file.c_str()); if (f1.IsZombie() ) { - std::cerr << "Error opening the ROOT file" << file << std::endl; + std::cerr << "Error opening the ROOT file " << file << std::endl; return -1; } @@ -516,7 +516,7 @@ double readSMatrixSym(const std::string & file) { TFile f1(file.c_str()); if (f1.IsZombie() ) { - std::cerr << "Error opening the ROOT file" << file << std::endl; + std::cerr << "Error opening the ROOT file " << file << std::endl; return -1; } diff --git a/math/smatrix/test/testInversion.cxx b/math/smatrix/test/testInversion.cxx index 550d153ac9a17..65b2e9e457920 100644 --- a/math/smatrix/test/testInversion.cxx +++ b/math/smatrix/test/testInversion.cxx @@ -101,11 +101,11 @@ template void genMatrix(M & m ) { TRandom & r = *gRandom; // generate first diagonal elements - for (int i = 0; i < N; ++i) { + for (int i = 0; i < static_cast(N); ++i) { double maxVal = i*10000/(N-1) + 1; // max condition is 10^4 m(i,i) = r.Uniform(0, maxVal); } - for (int i = 0; i < N; ++i) { + for (int i = 0; i < static_cast(N); ++i) { for (int j = 0; j < i; ++j) { double v = 0.3*std::sqrt( m(i,i) * m(j,j) ); // this makes the matrix pos defined m(i,j) = r.Uniform(0, v); diff --git a/math/smatrix/test/testKalman.cxx b/math/smatrix/test/testKalman.cxx index 1e164eab0097b..65e607243748d 100644 --- a/math/smatrix/test/testKalman.cxx +++ b/math/smatrix/test/testKalman.cxx @@ -46,8 +46,8 @@ int test_smatrix_kalman() { // need to write explicitly the dimensions - typedef SMatrix MnMatrixNN; - typedef SMatrix MnMatrixMM; + // typedef SMatrix MnMatrixNN; + // typedef SMatrix MnMatrixMM; typedef SMatrix MnMatrixNM; typedef SMatrix MnMatrixMN; typedef SMatrix MnSymMatrixNN; @@ -170,16 +170,16 @@ int test_smatrix_sym_kalman() { // need to write explicitly the dimensions - typedef SMatrix MnMatrixNN; - typedef SMatrix MnMatrixMM; + // typedef SMatrix MnMatrixNN; + // typedef SMatrix MnMatrixMM; typedef SMatrix MnMatrixNM; typedef SMatrix MnMatrixMN; typedef SMatrix > MnSymMatrixNN; typedef SMatrix > MnSymMatrixMM; typedef SVector MnVectorN; typedef SVector MnVectorM; - typedef SVector MnVectorN2; - typedef SVector MnVectorM2; + // typedef SVector MnVectorN2; + // typedef SVector MnVectorM2; diff --git a/math/smatrix/test/testSMatrix.cxx b/math/smatrix/test/testSMatrix.cxx index ba1a0d6e108c5..5603fa029624c 100644 --- a/math/smatrix/test/testSMatrix.cxx +++ b/math/smatrix/test/testSMatrix.cxx @@ -33,6 +33,7 @@ template typename std::enable_if::value, int>::type compare(T a, T b, const std::string &s = "", int ulps = 10) { + (void)ulps; // silence unused variable warning if (a != b) compare_fail(a, b, T(0), T(0), s); return a == b ? 0 : 1; } From 7d1cf0aa9de57dcc593fa3bf6c5a1987cedf1e83 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 10:14:26 +0200 Subject: [PATCH 05/21] [test] fix compilation error due to max template depth reached --- math/smatrix/test/testOperations.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/math/smatrix/test/testOperations.cxx b/math/smatrix/test/testOperations.cxx index 2974c13ca0832..13ae78c716230 100644 --- a/math/smatrix/test/testOperations.cxx +++ b/math/smatrix/test/testOperations.cxx @@ -828,7 +828,8 @@ int main(int argc , char *argv[] ) { TEST(15); TEST(20); NLOOP = 50*NLOOP_MIN; - TEST(30); + TEST(29); + // TEST(30); // NLOOP = NLOOP_MIN; // TEST(50); // TEST(75); From f728fd66248ea43014e9accc01f7513ad0b1c78e Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 13:28:30 +0200 Subject: [PATCH 06/21] [test] disable smatrix reflex test follow-up of https://github.com/root-project/root/commit/faadea7f8730fea105a3e0ec625dc715b35b8438#diff-94b4efe857e73addae83acfbcc7f26682960180a8c75e3a6aa13903b76500d88 --- math/smatrix/test/CMakeLists.txt | 10 ++----- math/smatrix/test/testIO.cxx | 48 +++++++------------------------- 2 files changed, 12 insertions(+), 46 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index a5fc646a354c0..ee6831d98162b 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -19,11 +19,8 @@ set(TestSource stressOperations.cxx stressKalman.cxx) -if (USE_REFLEX) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() + +ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) @@ -44,8 +41,5 @@ foreach(file ${TestSource}) target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") endif() endif() - if (USE_REFLEX) - target_compile_definitions(${testname} PRIVATE USE_REFLEX) - endif() ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) endforeach() diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index a6b27d2e8224e..66546491d4c31 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -1,11 +1,11 @@ // // Cling macro to test I/O of SMatrix classes and compare with a TMatrix -// A ROOT tree is written and read in both using either a SMatrix or +// A ROOT tree is written and read in both using either a SMatrix or // a TMatrixD. // // To execute the macro type in: // -// root[0]: .x smatrixIO.C +// root[0]: .x testIO.cxx #include "Math/SMatrix.h" #include "TMatrixD.h" @@ -44,10 +44,7 @@ double tol = 1.E-16; double tol32 = 1.E-6; std::string sfile1 = "smatrix.root"; -std::string sfile2 = "smatrix_rflx.root"; - std::string symfile1 = "smatrixsym.root"; -std::string symfile2 = "smatrixsym_rflx.root"; @@ -748,7 +745,7 @@ int testWrite(int nEvents, double & w1, double & w2) { return iret; } -int testRead(double & r1, double & r2, double & r3) { +int testRead(double & r1, double & r2) { int iret = 0; @@ -762,16 +759,6 @@ int testRead(double & r1, double & r2, double & r3) { iret = 2; } - std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; - - r3 = readSMatrix(sfile2); - if ( r3 != -1. && fabs(r2-r3) > tol) { - std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatrices" << std::endl; - int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); - iret = 3; - } - - return iret; } @@ -801,7 +788,7 @@ int testWriteSym(int nEvents, double & w1, double & w2) { return iret; } -int testReadSym(double & r1, double & r2, double & r3) { +int testReadSym(double & r1, double & r2) { int iret = 0; @@ -814,19 +801,9 @@ int testReadSym(double & r1, double & r2, double & r3) { iret = 12; } - std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; - - r3 = readSMatrixSym(symfile2); - if ( r3 != -1. && fabs(r2-r3) > tol) { - std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatricesSym" << std::endl; - int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); - iret = 13; - } - - return iret; } -int testResult(double w1, double r1, double w2, double r2, double r3) { +int testResult(double w1, double r1, double w2, double r2) { int iret = 0; @@ -840,11 +817,6 @@ int testResult(double w1, double r1, double w2, double r2, double r3) { int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); iret = -2; } - if ( r3 != -1. && fabs(w2-r3) > tol) { - std::cout << "\nERROR: Differeces found when reading SMatrices with different Dictionary" << std::endl; - int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); - iret = -3; - } return iret; } @@ -896,10 +868,10 @@ int testIO() { - double r1, r2, r3 = 0; + double r1, r2 = 0; int iret2 = 0; - iret2 |= testRead(r1,r2,r3); - iret2 |= testResult(w1,r1,w2,r2,r3); + iret2 |= testRead(r1,r2); + iret2 |= testResult(w1,r1,w2,r2); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) std::cout << " Reading Test:\t" << "OK"; @@ -916,8 +888,8 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; iret = testWriteSym(nEvents,w1,w2); - iret2 = testReadSym(r1,r2,r3); - iret2 = testResult(w1,r1,w2,r2,r3); + iret2 = testReadSym(r1,r2); + iret2 = testResult(w1,r1,w2,r2); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) From e8b9adb7a34c59bddd434535f308aa0bc2e44ab8 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 8 Apr 2026 14:16:47 +0200 Subject: [PATCH 07/21] [test] no runtime loading of track lib dictionary --- math/smatrix/test/testIO.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index 66546491d4c31..faccb91b022ae 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -907,7 +907,7 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; // load track dictionary - iret |= gSystem->Load("libTrackDict"); + // iret |= gSystem->Load("libTrackDict"); if (iret != 0 ) return iret; iret |= testTrack(nEvents); From ad2a794954d6cbfe9bbf9fe8fe04c497990e7791 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Sun, 12 Apr 2026 12:44:18 +0200 Subject: [PATCH 08/21] [test] fix uninitialized warning --- math/smatrix/test/testOperations.cxx | 6 +++--- math/smatrix/test/testSMatrix.cxx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/math/smatrix/test/testOperations.cxx b/math/smatrix/test/testOperations.cxx index 13ae78c716230..2706b16391bb7 100644 --- a/math/smatrix/test/testOperations.cxx +++ b/math/smatrix/test/testOperations.cxx @@ -87,7 +87,7 @@ int test_smatrix_op() { double r1,r2; - int npass = NITER; + int npass = std::max(int(NITER), int(1)); TRandom3 r(111); for (int k = 0; k < npass; k++) { @@ -194,7 +194,7 @@ int test_smatrix_sym_op() { - int first = NDIM1; //Can change the size of the matrices + int first = std::max(int(NDIM1), int(1)); //Can change the size of the matrices std::cout << "************************************************\n"; @@ -311,7 +311,7 @@ int test_tmatrix_op() { double totTime1, totTime2; double r1,r2; - int npass = NITER; + int npass = std::max(int(1), int(NITER)); TRandom3 r(111); gMatrixCheck = 0; diff --git a/math/smatrix/test/testSMatrix.cxx b/math/smatrix/test/testSMatrix.cxx index 5603fa029624c..70b9f5008f4ad 100644 --- a/math/smatrix/test/testSMatrix.cxx +++ b/math/smatrix/test/testSMatrix.cxx @@ -1073,9 +1073,9 @@ int test19() for (int i = 0; i < 7; ++i) { for (int j = 0; j <= i; ++j) { if (i == j) - S(i, j) = 10 * float(std::rand()) / (RAND_MAX); // generate between 0,10 + S(i, j) = 10.f * float(std::rand()) / float(RAND_MAX); // generate between 0,10 else - S(i, j) = 2 * float(std::rand()) / (RAND_MAX)-1; // generate between -1,1 + S(i, j) = 2.f * float(std::rand()) / float(RAND_MAX)-1.f; // generate between -1,1 } } int ifail = 0; @@ -1096,9 +1096,9 @@ int test19() for (int i = 0; i < 7; ++i) { for (int j = 0; j < 7; ++j) { if (i == j) - M(i, j) = 10 * float(std::rand()) / (RAND_MAX); // generate between 0,10 + M(i, j) = 10.f * float(std::rand()) / float(RAND_MAX); // generate between 0,10 else - M(i, j) = 2 * float(std::rand()) / (RAND_MAX)-1; // generate between -1,1 + M(i, j) = 2.f * float(std::rand()) / float(RAND_MAX)-1.f; // generate between -1,1 } } ifail = 0; From 3938b57385bfde66db51e3c745aa14ced880b3be Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Tue, 14 Apr 2026 10:28:09 +0200 Subject: [PATCH 09/21] Correctly link CLHEP library when CLHEPBASE shell variable exists Co-authored-by: ferdymercury --- math/smatrix/test/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index ee6831d98162b..2c348eb995921 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -31,14 +31,14 @@ foreach(file ${TestSource}) ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) endif() target_include_directories(${testname} PRIVATE ./) - if (CLHEPBASE) - target_include_directories(${testname} PRIVATE ${CLHEPBASE}) + if (DEFINED ENV{CLHEPBASE}) + target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) if (WIN32) - target_link_libraries(${testname} PRIVATE "${CLHEPBASE}/lib/CLHEP.lib") + target_link_libraries(${testname} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") else() target_link_libraries(${testname} PRIVATE "CLHEP" "m") - target_link_directories(${testname} PRIVATE "${CLHEPBASE}/lib") + target_link_directories(${testname} PRIVATE "$ENV{CLHEPBASE}/lib") endif() endif() ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) From b7eae1f0515827083039e36c772fa7bdd2772ed0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 13:14:02 +0200 Subject: [PATCH 10/21] [math] rescue reflex use as suggested by linev Co-authored-by: ferdymercury [test] rescue reflex_use --- math/smatrix/test/CMakeLists.txt | 9 ++++++- math/smatrix/test/testIO.cxx | 43 ++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index 2c348eb995921..3f80e46d2064b 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -20,7 +20,11 @@ set(TestSource stressKalman.cxx) -ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +if (DEFINED ENV{USE_REFLEX}) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) @@ -31,6 +35,9 @@ foreach(file ${TestSource}) ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) endif() target_include_directories(${testname} PRIVATE ./) + if (DEFINED ENV{USE_REFLEX}) + target_compile_definitions(${testname} PRIVATE USE_REFLEX) + endif() if (DEFINED ENV{CLHEPBASE}) target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) diff --git a/math/smatrix/test/testIO.cxx b/math/smatrix/test/testIO.cxx index faccb91b022ae..0227275c9fc93 100644 --- a/math/smatrix/test/testIO.cxx +++ b/math/smatrix/test/testIO.cxx @@ -44,7 +44,10 @@ double tol = 1.E-16; double tol32 = 1.E-6; std::string sfile1 = "smatrix.root"; +std::string sfile2 = "smatrix_rflx.root"; + std::string symfile1 = "smatrixsym.root"; +std::string symfile2 = "smatrixsym_rflx.root"; @@ -745,7 +748,7 @@ int testWrite(int nEvents, double & w1, double & w2) { return iret; } -int testRead(double & r1, double & r2) { +int testRead(double & r1, double & r2, double & r3) { int iret = 0; @@ -759,6 +762,15 @@ int testRead(double & r1, double & r2) { iret = 2; } + std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; + + r3 = readSMatrix(sfile2); + if ( r3 != -1. && fabs(r2-r3) > tol) { + std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatrices" << std::endl; + int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); + iret = 3; + } + return iret; } @@ -788,7 +800,7 @@ int testWriteSym(int nEvents, double & w1, double & w2) { return iret; } -int testReadSym(double & r1, double & r2) { +int testReadSym(double & r1, double & r2, double & r3) { int iret = 0; @@ -801,9 +813,19 @@ int testReadSym(double & r1, double & r2) { iret = 12; } + std::cout << "try to read file written with Reflex using Cling Dictionaries " << std::endl; + + r3 = readSMatrixSym(symfile2); + if ( r3 != -1. && fabs(r2-r3) > tol) { + std::cout << "\nERROR: Differeces Reflex-Cling found when reading SMatricesSym" << std::endl; + int pr = std::cout.precision(18); std::cout << r2 << " != " << r3 << std::endl; std::cout.precision(pr); + iret = 13; + } + return iret; } -int testResult(double w1, double r1, double w2, double r2) { + +int testResult(double w1, double r1, double w2, double r2, double r3) { int iret = 0; @@ -817,6 +839,11 @@ int testResult(double w1, double r1, double w2, double r2) { int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); iret = -2; } + if ( r3 != -1. && fabs(w2-r3) > tol) { + std::cout << "\nERROR: Differeces found when reading SMatrices with different Dictionary" << std::endl; + int pr = std::cout.precision(18); std::cout << w2 << " != " << r2 << std::endl; std::cout.precision(pr); + iret = -3; + } return iret; } @@ -868,10 +895,10 @@ int testIO() { - double r1, r2 = 0; + double r1, r2, r3 = 0; int iret2 = 0; - iret2 |= testRead(r1,r2); - iret2 |= testResult(w1,r1,w2,r2); + iret2 |= testRead(r1,r2,r3); + iret2 |= testResult(w1,r1,w2,r2,r3); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) std::cout << " Reading Test:\t" << "OK"; @@ -888,8 +915,8 @@ int testIO() { std::cout << "\n*****************************************************\n\n"; iret = testWriteSym(nEvents,w1,w2); - iret2 = testReadSym(r1,r2); - iret2 = testResult(w1,r1,w2,r2); + iret2 = testReadSym(r1,r2,r3); + iret2 = testResult(w1,r1,w2,r2,r3); std::cout << "\n\n*************************************************************\n"; if (iret2 == 0 ) From b42942cdba87b26f81beb8c677a1fe8ea4a15137 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 13:40:21 +0200 Subject: [PATCH 11/21] [genvector] rescue test with dict from Makefile --- math/genvector/test/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index b8fe57321604f..83ebfefd1bae6 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -19,6 +19,18 @@ ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +if (DEFINED ENV{USE_REFLEX}) + REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) +else() + ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +endif() +ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx TrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +if (DEFINED ENV{USE_REFLEX}) + target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) +endif() +ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) + ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) From 76229c3d148ba43eca47128fb69b85d2819657a0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 14 Apr 2026 15:10:43 +0200 Subject: [PATCH 12/21] [cmake] disambiguate --- math/genvector/test/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 83ebfefd1bae6..cbdacce69b0bf 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -19,17 +19,20 @@ ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) -if (DEFINED ENV{USE_REFLEX}) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() -ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx TrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) +ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +ROOT_EXECUTABLE(testVectorIOdictxml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +target_include_directories(testVectorIOdict PRIVATE ./) if (DEFINED ENV{USE_REFLEX}) target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) endif() +target_include_directories(testVectorIOdict PRIVATE ./) +target_include_directories(testVectorIOdictXml PRIVATE ./) +target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml) ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) From 88bcc41a97b67b130596176ee88612002b740b0a Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 15 Apr 2026 08:12:18 +0200 Subject: [PATCH 13/21] test variants --- math/smatrix/test/CMakeLists.txt | 47 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index 3f80e46d2064b..d035fc1ac0e1e 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -20,33 +20,38 @@ set(TestSource stressKalman.cxx) -if (DEFINED ENV{USE_REFLEX}) - REFLEX_GENERATE_DICTIONARY(TrackDict Track.h SELECTION TrackDict.xml) -else() - ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -endif() +ROOT_GENERATE_DICTIONARY(TrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +REFLEX_GENERATE_DICTIONARY(TrackDictXml Track.h SELECTION TrackDict.xml) #---Build and add all the defined test in the list--------------- foreach(file ${TestSource}) + get_filename_component(testname ${file} NAME_WE) if (testname STREQUAL "testIO") - ROOT_EXECUTABLE(${testname} ${file} TrackDict.cxx LIBRARIES ${Libraries}) + set(variants "" "Xml") else() - ROOT_EXECUTABLE(${testname} ${file} LIBRARIES ${Libraries}) - endif() - target_include_directories(${testname} PRIVATE ./) - if (DEFINED ENV{USE_REFLEX}) - target_compile_definitions(${testname} PRIVATE USE_REFLEX) + set(variants "") endif() - if (DEFINED ENV{CLHEPBASE}) - target_include_directories(${testname} PRIVATE $ENV{CLHEPBASE}) - target_compile_definitions(${testname} PRIVATE HAVE_CLHEP) - if (WIN32) - target_link_libraries(${testname} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") - else() - target_link_libraries(${testname} PRIVATE "CLHEP" "m") - target_link_directories(${testname} PRIVATE "$ENV{CLHEPBASE}/lib") - endif() + foreach(variant ${variants}) + if (testname STREQUAL "testIO") + ROOT_EXECUTABLE(${testname}${variant} ${file} TrackDict${variant}.cxx LIBRARIES ${Libraries}) + if (variant STREQUAL "Xml") + target_compile_definitions(${testname}${variant} PRIVATE USE_REFLEX) + endif() + else() + ROOT_EXECUTABLE(${testname}${variant} ${file} LIBRARIES ${Libraries}) + endif() + target_include_directories(${testname}${variant} PRIVATE ./) + if (DEFINED ENV{CLHEPBASE}) + target_include_directories(${testname}${variant} PRIVATE $ENV{CLHEPBASE}) + target_compile_definitions(${testname}${variant} PRIVATE HAVE_CLHEP) + if (WIN32) + target_link_libraries(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") + else() + target_link_libraries(${testname}${variant} PRIVATE "CLHEP" "m") + target_link_directories(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib") + endif() + endif() + ROOT_ADD_TEST(smatrix-${testname}${variant} COMMAND ${testname}${variant} LABELS ${${testname}${variant}_LABELS}) endif() - ROOT_ADD_TEST(smatrix-${testname} COMMAND ${testname} LABELS ${${testname}_LABELS}) endforeach() From 95d73a26d6f3068fb392366c63dec5118109932b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 14:47:51 +0200 Subject: [PATCH 14/21] [test] fix duplicated stuff and copy-to-builds --- math/genvector/test/CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index cbdacce69b0bf..866d0bf09c707 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -16,23 +16,20 @@ ROOT_EXECUTABLE(testGenvector testGenVector.cxx LIBRARIES GenVector Hist Smatrix ROOT_ADD_TEST(test-genvector-genvector COMMAND testGenvector) ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad Physics) -ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO - COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +target_include_directories(testVectorIO PRIVATE ./) +ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO) +# COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) ROOT_EXECUTABLE(testVectorIOdictxml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) -if (DEFINED ENV{USE_REFLEX}) - target_compile_definitions(testVectorIOdict PRIVATE USE_REFLEX) -endif() -target_include_directories(testVectorIOdict PRIVATE ./) target_include_directories(testVectorIOdictXml PRIVATE ./) target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) -ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict - COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict) ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml) +# COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) From 5ed3df405e3ef2b870754de1db7c0771d628f201 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 14:57:36 +0200 Subject: [PATCH 15/21] letters --- math/genvector/test/CMakeLists.txt | 2 +- ...a32_gcc323.root => kalman_slc3_ia32_gcc323.root} | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename math/smatrix/test/{kalmam_slc3_ia32_gcc323.root => kalman_slc3_ia32_gcc323.root} (100%) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 866d0bf09c707..7df483d92ca3d 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -23,7 +23,7 @@ ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO) REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) -ROOT_EXECUTABLE(testVectorIOdictxml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +ROOT_EXECUTABLE(testVectorIOdictXml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) target_include_directories(testVectorIOdictXml PRIVATE ./) target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) diff --git a/math/smatrix/test/kalmam_slc3_ia32_gcc323.root b/math/smatrix/test/kalman_slc3_ia32_gcc323.root similarity index 100% rename from math/smatrix/test/kalmam_slc3_ia32_gcc323.root rename to math/smatrix/test/kalman_slc3_ia32_gcc323.root From de5fd17faa61e3693cda95231661b185ecc154f2 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 15:17:40 +0200 Subject: [PATCH 16/21] test read kalman --- math/smatrix/test/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index d035fc1ac0e1e..f1174fe7826f3 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -53,5 +53,8 @@ foreach(file ${TestSource}) endif() endif() ROOT_ADD_TEST(smatrix-${testname}${variant} COMMAND ${testname}${variant} LABELS ${${testname}${variant}_LABELS}) - endif() + endforeach() endforeach() + +ROOT_EXECUTABLE(testReadKalman kalman.C LIBRARIES ${Libraries}) +ROOT_ADD_TEST(smatrix-testReadKalman COMMAND testReadKalman slc3_ia32_gcc323 LABELS ${testReadKalman_LABELS} COPY_TO_BUILD_DIR kalman_slc3_ia32_gcc323.root) From b1d3d08b7459824fd984446e3dac48ed6f3a3478 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 15:44:37 +0200 Subject: [PATCH 17/21] swap fixes --- math/genvector/test/CMakeLists.txt | 2 +- math/smatrix/test/CMakeLists.txt | 38 +++++++++++++++--------------- math/smatrix/test/kalman.C | 14 ++++++++++- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 7df483d92ca3d..44feb2da46f86 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -20,8 +20,8 @@ target_include_directories(testVectorIO PRIVATE ./) ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO) # COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) -REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) +REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) ROOT_EXECUTABLE(testVectorIOdictXml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index f1174fe7826f3..6001bdd07ac63 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -8,7 +8,7 @@ project(smatrix-tests) -set(Libraries Core RIO Tree Rint Matrix MathCore Hist) +set(Libraries Core RIO Tree Rint Matrix MathCore Hist Graf Gpad) set(TestSource testSMatrix.cxx @@ -33,26 +33,26 @@ foreach(file ${TestSource}) set(variants "") endif() foreach(variant ${variants}) - if (testname STREQUAL "testIO") - ROOT_EXECUTABLE(${testname}${variant} ${file} TrackDict${variant}.cxx LIBRARIES ${Libraries}) - if (variant STREQUAL "Xml") - target_compile_definitions(${testname}${variant} PRIVATE USE_REFLEX) - endif() - else() - ROOT_EXECUTABLE(${testname}${variant} ${file} LIBRARIES ${Libraries}) + if (testname STREQUAL "testIO") + ROOT_EXECUTABLE(${testname}${variant} ${file} TrackDict${variant}.cxx LIBRARIES ${Libraries}) + if (variant STREQUAL "Xml") + target_compile_definitions(${testname}${variant} PRIVATE USE_REFLEX) endif() - target_include_directories(${testname}${variant} PRIVATE ./) - if (DEFINED ENV{CLHEPBASE}) - target_include_directories(${testname}${variant} PRIVATE $ENV{CLHEPBASE}) - target_compile_definitions(${testname}${variant} PRIVATE HAVE_CLHEP) - if (WIN32) - target_link_libraries(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") - else() - target_link_libraries(${testname}${variant} PRIVATE "CLHEP" "m") - target_link_directories(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib") - endif() + else() + ROOT_EXECUTABLE(${testname}${variant} ${file} LIBRARIES ${Libraries}) + endif() + target_include_directories(${testname}${variant} PRIVATE ./) + if (DEFINED ENV{CLHEPBASE}) + target_include_directories(${testname}${variant} PRIVATE $ENV{CLHEPBASE}) + target_compile_definitions(${testname}${variant} PRIVATE HAVE_CLHEP) + if (WIN32) + target_link_libraries(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib/CLHEP.lib") + else() + target_link_libraries(${testname}${variant} PRIVATE "CLHEP" "m") + target_link_directories(${testname}${variant} PRIVATE "$ENV{CLHEPBASE}/lib") endif() - ROOT_ADD_TEST(smatrix-${testname}${variant} COMMAND ${testname}${variant} LABELS ${${testname}${variant}_LABELS}) + endif() + ROOT_ADD_TEST(smatrix-${testname}${variant} COMMAND ${testname}${variant} LABELS ${${testname}${variant}_LABELS}) endforeach() endforeach() diff --git a/math/smatrix/test/kalman.C b/math/smatrix/test/kalman.C index 78f93b29cd64c..7c54adde8f0db 100644 --- a/math/smatrix/test/kalman.C +++ b/math/smatrix/test/kalman.C @@ -7,6 +7,7 @@ #include "TLine.h" #include "Math/SMatrix.h" +#include #include bool gUseCPUTime = false; //default use real time @@ -19,7 +20,7 @@ const Int_t n=nx*ny; void kalman(std::string machine = "",int sym=1,int cut =6) { - cout << "loading lib smatrix" << std::endl; + std::cout << "loading lib smatrix" << std::endl; gSystem->Load("libSmatrix"); std::string fname = "kalman"; @@ -250,3 +251,14 @@ void kalman_do(const char *machine,int sym, int cut) { tt.DrawText(xmin+(i+0.5)*dx,ylow+0.022,text); } +int main(int argc, char *argv[]) { + if (argc == 1) + kalman(argv[0]); + else if (argc == 2) + kalman(argv[0], atoi(argv[1])); + else if (argc == 3) + kalman(argv[0], atoi(argv[1]), atoi(argv[2])); + else + kalman(); + return 0; +} From c1a3ef5334e761cc923ed18f41702c76ae465cae Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 15:58:59 +0200 Subject: [PATCH 18/21] fix empty genreflex command rm debug print capital try fix genreflex not found on mac --- cmake/modules/RootMacros.cmake | 5 ++--- math/genvector/test/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 773561f83d38f..dd541c2e2b3a6 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -198,13 +198,14 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) LIST(APPEND definitions "$,EXCLUDE,^$>") ENDIF() + set(ROOT_genreflex_CMD $) add_custom_command( - OUTPUT ${gensrcdict} ${rootmapname} COMMAND ${ROOT_genreflex_CMD} ARGS ${headerfiles} -o ${gensrcdict} ${rootmapopts} --select=${selectionfile} ${ARG_OPTIONS} "-I$>,;-I>" "$<$>:-D$>" + OUTPUT ${gensrcdict} ${rootmapname} DEPENDS ${headerfiles} ${selectionfile} ${ARG_DEPENDS} COMMAND_EXPAND_LISTS @@ -2749,8 +2750,6 @@ macro(ROOTTEST_GENERATE_REFLEX_DICTIONARY dictionary) set(CMAKE_ROOTTEST_NOROOTMAP OFF) endif() - set(ROOT_genreflex_CMD ${ROOT_BINDIR}/genreflex) - ROOTTEST_TARGETNAME_FROM_FILE(targetname ${dictionary}) set(targetname_libgen ${targetname}-libgen) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 44feb2da46f86..c9c29dbaa29f7 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -21,8 +21,8 @@ ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO) # COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) -REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) +REFLEX_GENERATE_DICTIONARY(GVTrackDictXml Track.h SELECTION TrackDict.xml) ROOT_EXECUTABLE(testVectorIOdictXml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIOdict PRIVATE ./) target_include_directories(testVectorIOdictXml PRIVATE ./) From 4a0cbb3d6e4c6dde5321c62dc540636d9298d89b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 17:05:05 +0200 Subject: [PATCH 19/21] fix buffer overflow --- math/smatrix/test/kalman.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/smatrix/test/kalman.C b/math/smatrix/test/kalman.C index 7c54adde8f0db..4a4cddfb90e4b 100644 --- a/math/smatrix/test/kalman.C +++ b/math/smatrix/test/kalman.C @@ -126,7 +126,7 @@ void kalman_do(const char *machine,int sym, int cut) { ts.SetTextSize(0.031); tt.SetTextColor(kRed); tt.SetTextSize(0.031); - char text[20]; + char text[21]; ts.SetTextAlign(22); for (i=0;i<=nx;i++) { line.DrawLine(xmin+i*dx,ymin,xmin+i*dx,ymax); From cf1f5fb50f7378bd47f0be824e723c41e933dbe9 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 17:30:07 +0200 Subject: [PATCH 20/21] fix indices and read testOp fix indices and read testOp, copy header --- math/genvector/test/CMakeLists.txt | 11 ++++++----- math/smatrix/test/CMakeLists.txt | 3 +++ math/smatrix/test/kalman.C | 10 +++++----- math/smatrix/test/matrixOperations.C | 21 +++++++++++++++++++-- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index c9c29dbaa29f7..099c660dd8595 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -17,8 +17,8 @@ ROOT_ADD_TEST(test-genvector-genvector COMMAND testGenvector) ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIO PRIVATE ./) -ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO) -# COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) @@ -27,9 +27,10 @@ ROOT_EXECUTABLE(testVectorIOdictXml testVectorIO.cxx GVTrackDictXml.cxx LIBRARIE target_include_directories(testVectorIOdict PRIVATE ./) target_include_directories(testVectorIOdictXml PRIVATE ./) target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) -ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict) -ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml) -# COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) +ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) # concurrency issue? separate fixtures-setup copying this? +ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) # concurrency issue? separate fixtures-setup copying this? ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D) diff --git a/math/smatrix/test/CMakeLists.txt b/math/smatrix/test/CMakeLists.txt index 6001bdd07ac63..930cb4f20f4b4 100644 --- a/math/smatrix/test/CMakeLists.txt +++ b/math/smatrix/test/CMakeLists.txt @@ -58,3 +58,6 @@ endforeach() ROOT_EXECUTABLE(testReadKalman kalman.C LIBRARIES ${Libraries}) ROOT_ADD_TEST(smatrix-testReadKalman COMMAND testReadKalman slc3_ia32_gcc323 LABELS ${testReadKalman_LABELS} COPY_TO_BUILD_DIR kalman_slc3_ia32_gcc323.root) + +ROOT_EXECUTABLE(testMatrixOperations matrixOperations.C LIBRARIES ${Libraries}) +ROOT_ADD_TEST(smatrix-testMatrixOperations COMMAND testMatrixOperations slc3_ia32_gcc323 LABELS ${testMatrixOperations_LABELS} COPY_TO_BUILD_DIR testOperations_slc3_ia32_gcc323.root) diff --git a/math/smatrix/test/kalman.C b/math/smatrix/test/kalman.C index 4a4cddfb90e4b..ee03823c33ba3 100644 --- a/math/smatrix/test/kalman.C +++ b/math/smatrix/test/kalman.C @@ -252,12 +252,12 @@ void kalman_do(const char *machine,int sym, int cut) { } int main(int argc, char *argv[]) { - if (argc == 1) - kalman(argv[0]); - else if (argc == 2) - kalman(argv[0], atoi(argv[1])); + if (argc == 2) + kalman(argv[1]); else if (argc == 3) - kalman(argv[0], atoi(argv[1]), atoi(argv[2])); + kalman(argv[1], atoi(argv[2])); + else if (argc == 4) + kalman(argv[1], atoi(argv[2]), atoi(argv[3])); else kalman(); return 0; diff --git a/math/smatrix/test/matrixOperations.C b/math/smatrix/test/matrixOperations.C index fee3faa4b45c7..1efbd92789eba 100644 --- a/math/smatrix/test/matrixOperations.C +++ b/math/smatrix/test/matrixOperations.C @@ -14,7 +14,7 @@ int fillCol=20; std::string systemName; -bool drawSingleGraph = true; +// bool drawSingleGraph = true; int topX=10; int topY=50; @@ -33,7 +33,7 @@ void matrixOperations(std::string type = "",bool clhep=false, bool drawSingleGra } -void DrawData(char * title, TGraphErrors * h1, TGraphErrors * h2, TGraphErrors * h3 = nullptr, TGraphErrors * h4 = nullptr, TGraphErrors * h5 = nullptr, TGraphErrors * h6 = nullptr) { +void DrawData(const char * title, TGraphErrors * h1, TGraphErrors * h2, TGraphErrors * h3 = nullptr, TGraphErrors * h4 = nullptr, TGraphErrors * h5 = nullptr, TGraphErrors * h6 = nullptr) { gPad->SetFillColor(fillCol); @@ -146,6 +146,10 @@ void GetData(std::string s,double * x, double * y, double * ey) { fileName="testOperations.root"; TFile * f = new TFile(fileName.c_str()); + if (!f || f->IsZombie()) { + std::cout << "File " << fileName << " not found !!!" << std::endl; + return; + } TProfile * h1 = (TProfile * ) f->Get(s.c_str() ); if (h1 ==nullptr) { std::cout << "Profile " << s << " not found !!! " << std::endl; @@ -315,3 +319,16 @@ void matrixOperations_do(std::string type, bool clhep, bool drawSingleGraph) { } + + +int main(int argc, char *argv[]) { + if (argc == 2) + matrixOperations(argv[1]); + else if (argc == 3) + matrixOperations(argv[1], atoi(argv[2])); + else if (argc == 4) + matrixOperations(argv[1], atoi(argv[2]), atoi(argv[3])); + else + matrixOperations(); + return 0; +} From b46c77316af90f87907552075c5e4203c6fa2621 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Thu, 23 Apr 2026 19:04:23 +0200 Subject: [PATCH 21/21] try fix concurrency issue --- math/genvector/test/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/math/genvector/test/CMakeLists.txt b/math/genvector/test/CMakeLists.txt index 099c660dd8595..bfb9c1c67888b 100644 --- a/math/genvector/test/CMakeLists.txt +++ b/math/genvector/test/CMakeLists.txt @@ -18,7 +18,8 @@ ROOT_ADD_TEST(test-genvector-genvector COMMAND testGenvector) ROOT_EXECUTABLE(testVectorIO testVectorIO.cxx LIBRARIES GenVector Tree Hist Gpad Physics) target_include_directories(testVectorIO PRIVATE ./) ROOT_ADD_TEST(test-genvector-vectorio COMMAND testVectorIO - COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) + COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h + FIXTURES_SETUP vectoriofixture) ROOT_GENERATE_DICTIONARY(GVTrackDict Track.h LINKDEF TrackLinkDef.h OPTIONS -inlineInputHeader) ROOT_EXECUTABLE(testVectorIOdict testVectorIO.cxx GVTrackDict.cxx LIBRARIES GenVector Tree Hist Gpad Physics) @@ -28,9 +29,9 @@ target_include_directories(testVectorIOdict PRIVATE ./) target_include_directories(testVectorIOdictXml PRIVATE ./) target_compile_definitions(testVectorIOdictXml PRIVATE USE_REFLEX) ROOT_ADD_TEST(test-genvector-vectoriodict COMMAND testVectorIOdict - COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) # concurrency issue? separate fixtures-setup copying this? + FIXTURES_REQUIRED vectoriofixture FIXTURES_SETUP vectoriodictrun) ROOT_ADD_TEST(test-genvector-vectoriodictxml COMMAND testVectorIOdictXml - COPY_TO_BUILDDIR ${CMAKE_CURRENT_SOURCE_DIR}/Track.h) # concurrency issue? separate fixtures-setup copying this? + FIXTURES_REQUIRED vectoriodictrun) ROOT_EXECUTABLE(coordinates3D coordinates3D.cxx LIBRARIES GenVector) ROOT_ADD_TEST(test-genvector-coordinates3D COMMAND coordinates3D)