@@ -373,11 +373,14 @@ int GPUChainTracking::Init()
373373 }
374374
375375 if (GPUQA::QAAvailable () && (GetProcessingSettings ().runQA || GetProcessingSettings ().eventDisplay )) {
376- mQA .reset (new GPUQA (this ));
376+ auto & qa = mQAFromForeignChain ? mQAFromForeignChain ->mQA : mQA ;
377+ if (!qa) {
378+ qa.reset (new GPUQA (this ));
379+ }
377380 }
378381 if (GetProcessingSettings ().eventDisplay ) {
379382#ifndef GPUCA_ALIROOT_LIB
380- mEventDisplay .reset (GPUDisplayInterface::getDisplay (GetProcessingSettings ().eventDisplay , this , mQA . get ()));
383+ mEventDisplay .reset (GPUDisplayInterface::getDisplay (GetProcessingSettings ().eventDisplay , this , GetQA ()));
381384#endif
382385 if (mEventDisplay == nullptr ) {
383386 throw std::runtime_error (" Error loading event display" );
@@ -479,19 +482,21 @@ int GPUChainTracking::PrepareEvent()
479482
480483int GPUChainTracking::ForceInitQA ()
481484{
482- if (!mQA ) {
483- mQA .reset (new GPUQA (this ));
485+ auto & qa = mQAFromForeignChain ? mQAFromForeignChain ->mQA : mQA ;
486+ if (!qa) {
487+ qa.reset (new GPUQA (this ));
484488 }
485- if (!mQA ->IsInitialized ()) {
486- return mQA ->InitQA ();
489+ if (!GetQA () ->IsInitialized ()) {
490+ return GetQA () ->InitQA ();
487491 }
488492 return 0 ;
489493}
490494
491495int GPUChainTracking::Finalize ()
492496{
493- if (GetProcessingSettings ().runQA && mQA ->IsInitialized () && !(mConfigQA && mConfigQA ->shipToQC )) {
494- mQA ->DrawQAHistograms ();
497+ if (GetProcessingSettings ().runQA && GetQA ()->IsInitialized () && !(mConfigQA && mConfigQA ->shipToQC ) && !mQAFromForeignChain ) {
498+ GetQA ()->UpdateChain (this );
499+ GetQA ()->DrawQAHistograms ();
495500 }
496501 if (GetProcessingSettings ().debugLevel >= 6 ) {
497502 mDebugFile ->close ();
@@ -670,8 +675,8 @@ int GPUChainTracking::RunChain()
670675 mCompressionStatistics .reset (new GPUTPCClusterStatistics);
671676 }
672677 const bool needQA = GPUQA::QAAvailable () && (GetProcessingSettings ().runQA || (GetProcessingSettings ().eventDisplay && (mIOPtrs .nMCInfosTPC || GetProcessingSettings ().runMC )));
673- if (needQA && mQA ->IsInitialized () == false ) {
674- if (mQA ->InitQA (GetProcessingSettings ().runQA ? -GetProcessingSettings ().runQA : -1 )) {
678+ if (needQA && GetQA () ->IsInitialized () == false ) {
679+ if (GetQA () ->InitQA (GetProcessingSettings ().runQA ? -GetProcessingSettings ().runQA : -1 )) {
675680 return 1 ;
676681 }
677682 }
@@ -796,7 +801,8 @@ int GPUChainTracking::RunChainFinalize()
796801 const bool needQA = GPUQA::QAAvailable () && (GetProcessingSettings ().runQA || (GetProcessingSettings ().eventDisplay && mIOPtrs .nMCInfosTPC ));
797802 if (needQA && mFractionalQAEnabled ) {
798803 mRec ->getGeneralStepTimer (GeneralStep::QA ).Start ();
799- mQA ->RunQA (!GetProcessingSettings ().runQA );
804+ GetQA ()->UpdateChain (this );
805+ GetQA ()->RunQA (!GetProcessingSettings ().runQA );
800806 mRec ->getGeneralStepTimer (GeneralStep::QA ).Stop ();
801807 if (GetProcessingSettings ().debugLevel == 0 ) {
802808 GPUInfo (" Total QA runtime: %d us" , (int )(mRec ->getGeneralStepTimer (GeneralStep::QA ).GetElapsedTime () * 1000000 ));
0 commit comments