From 0c01147636143369619c1c880bfae5b0dfeca414 Mon Sep 17 00:00:00 2001 From: Alexandru Bercuci <abercuci@niham.nipne.ro> Date: Fri, 15 Jul 2022 10:57:32 +0300 Subject: [PATCH] make Flush buffer work full/partial depending on the type of simulations (EbyE/TB) --- sim/detectors/trd/CbmTrdModuleSim2D.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sim/detectors/trd/CbmTrdModuleSim2D.cxx b/sim/detectors/trd/CbmTrdModuleSim2D.cxx index 6196159cc5..1a599c65c7 100644 --- a/sim/detectors/trd/CbmTrdModuleSim2D.cxx +++ b/sim/detectors/trd/CbmTrdModuleSim2D.cxx @@ -602,7 +602,7 @@ Int_t CbmTrdModuleSim2D::FlushBuffer(ULong64_t time) FairRootManager* ioman = FairRootManager::Instance(); fTimeSlice = (CbmTimeSlice*) ioman->GetObject("TimeSlice."); } - Bool_t closeTS(kFALSE); + bool closeTS(false); if (fTimeSlice) { closeTS = (fTimeOld - fTimeSlice->GetEndTime() - 1000) > 0.; if (!time) closeTS = true; @@ -617,7 +617,7 @@ Int_t CbmTrdModuleSim2D::FlushBuffer(ULong64_t time) // ask FASP simulator if there is enough time elapsed from the last running of the simulator if (time > 0 && !fFASP->Go(time) && !closeTS) return 0; // configure FASP simulator time range for special cases - if (closeTS) fFASP->SetProcTime(TMath::Nint(fTimeSlice->GetEndTime())); + if (closeTS && fTimeSlice->IsRegular()) fFASP->SetProcTime(TMath::Nint(fTimeSlice->GetEndTime())); if (VERBOSE) { cout << "\nPHYS DIGITS : \n"; @@ -713,7 +713,7 @@ Int_t CbmTrdModuleSim2D::FlushBuffer(ULong64_t time) delete digi; if (digiMatch) { digiMatch->AddLink(iv->second->GetLink(0)); - if (VERBOSE) cout << "\t" << digiMatch->ToString(); + if (VERBOSE > 2) cout << "\t" << digiMatch->ToString(); } iv = fBuffer[padAddress].erase(iv); // remove from saved buffer continue; @@ -759,10 +759,12 @@ Int_t CbmTrdModuleSim2D::FlushBuffer(ULong64_t time) printf("CbmTrdModuleSim2D::FlushBuffer : write %d digis in [%d - " "%d]ns. Digits still in buffer %d\n", n, TMath::Nint(timeMin), TMath::Nint(timeMax), nDigiLeft); + if (newStartTime > 0) fFASP->SetStartTime(newStartTime); - else - fFASP->SetStartTime(fFASP->GetEndTime()); - fFASP->SetProcTime(time); + else { + if (fTimeSlice->IsRegular()) fFASP->SetStartTime(fFASP->GetEndTime()); + } + fFASP->SetProcTime(/*time*/); // TODO Makes sense for TB with precautions ! //iteratively process all digi at the end of run if (time == 0 && nDigiLeft) n += FlushBuffer(); -- GitLab