From 4c5655842e46101d7228e694483e7eddc61cd26a Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Fri, 6 Sep 2024 12:39:11 +0200 Subject: [PATCH] CP --- Common/DCAFitter/GPU/cuda/DCAFitterN.cu | 2 +- Common/DCAFitter/GPU/cuda/test/main_prog.cxx | 4 +--- Common/DCAFitter/include/DCAFitter/DCAFitterN.h | 13 +++++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Common/DCAFitter/GPU/cuda/DCAFitterN.cu b/Common/DCAFitter/GPU/cuda/DCAFitterN.cu index be33ec4896174..413aaff642d28 100644 --- a/Common/DCAFitter/GPU/cuda/DCAFitterN.cu +++ b/Common/DCAFitter/GPU/cuda/DCAFitterN.cu @@ -40,7 +40,7 @@ GPUg() void printKernel(o2::vertexing::DCAFitterN<2>* ft) { if (threadIdx.x == 0) { printf(" =============== GPU DCA Fitter ================\n"); - // ft->print(); + ft->print(); printf(" ===============================================\n"); } } diff --git a/Common/DCAFitter/GPU/cuda/test/main_prog.cxx b/Common/DCAFitter/GPU/cuda/test/main_prog.cxx index c4939d03b4450..d18ed439411c4 100644 --- a/Common/DCAFitter/GPU/cuda/test/main_prog.cxx +++ b/Common/DCAFitter/GPU/cuda/test/main_prog.cxx @@ -113,7 +113,6 @@ int run() double bz = 5.0; std::vector forceQ{1, 1}; - std::cout << "running... " << std::endl; o2::vertexing::DCAFitterN<2> ft; // 2 prong fitter ft.setBz(bz); ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway @@ -123,12 +122,11 @@ int run() ft.setMinParamChange(1e-3); // stop iterations if max correction is below this value. This is default anyway ft.setMinRelChi2Change(0.9); // stop iterations if chi2 improves by less that this factor - std::cout << "running... " << std::endl; auto genParent = generate(vtxGen, vctracks, bz, genPHS, k0, k0dec, forceQ); - std::cout << "running... " << std::endl; ft.setUseAbsDCA(true); auto res = ft.process(vctracks[0], vctracks[1]); ft.print(); + std::cout << " => " << sizeof(DCAFitterN<2>) << std::endl; std::cout << "returned value: " << res << std::endl; // o2::vertexing::gpu::doPrintOnDevice(&ft); diff --git a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h index a1cad50ece4f8..550aff307d658 100644 --- a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h +++ b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h @@ -1011,10 +1011,23 @@ GPUd() bool DCAFitterN::closerToAlternative() const template GPUd() void DCAFitterN::print() const { +#if !defined(GPUCA_GPUCODE) LOG(info) << N << "-prong vertex fitter in " << (mUseAbsDCA ? "abs." : "weighted") << " distance minimization mode"; LOG(info) << "Bz: " << mBz << " MaxIter: " << mMaxIter << " MaxChi2: " << mMaxChi2; LOG(info) << "Stopping condition: Max.param change < " << mMinParamChange << " Rel.Chi2 change > " << mMinRelChi2Change; LOG(info) << "Discard candidates for : Rvtx > " << getMaxR() << " DZ between tracks > " << mMaxDZIni; +#endif +#if defined(GPUCA_GPUCODE_DEVICE) + // if (mUseAbsDCA) { + printf("test %d\n", sizeof(DCAFitterN<2>)); + // printf("%d-prong vertex fitter in abs. distance minimization mode\n", N); + // // } else { + // printf("%d-prong vertex fitter in weighted distance minimization mode\n", N); + // // } + // printf("Bz: %f MaxIter: %d MaxChi2: %f\n", mBz, mMaxIter, mMaxChi2); + // printf("Stopping condition: Max.param change < %f Rel.Chi2 change > %f\n", mMinParamChange, mMinRelChi2Change); + // printf("Discard candidates for : Rvtx > %f DZ between tracks > %f", getMaxR(), mMaxDZIni); +#endif } //___________________________________________________________________