diff --git a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx index 2472bcc4501f4144192fca2b41401860762b815e..d4edd07e30d6f1553b7874b992102dd082ced3d1 100644 --- a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx +++ b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx @@ -284,8 +284,13 @@ void CbmAlgoBuildRawEvents::LoopOnSeeds() /// Loop on size of vector for (UInt_t uDigi = 0; uDigi < uNbRefDigis; ++uDigi) { LOG(debug) << Form("Checking seed %6u / %6u", uDigi, uNbRefDigis); + const DigiSeed* pDigi = GetDigi<DigiSeed>(uDigi); - const Double_t dTime = pDigi->GetTime(); + + // filter T0 digis from Tof (remove this line if T0 properly implemented) + if (fRefDet.detId == ECbmModuleId::kTof && pDigi->GetAddress() == fuT0Address) { continue; } + + const Double_t dTime = pDigi->GetTime(); /// Check if seed in acceptance window if (dTime < fdSeedWindowBeg) { continue; } @@ -449,7 +454,11 @@ void CbmAlgoBuildRawEvents::SearchMatches(Double_t dSeedTime, RawEventBuilderDet const UInt_t uNbSelDigis = GetNofDigis(detMatch.detId); /// Loop on size of vector for (UInt_t uDigi = detMatch.fuStartIndex; uDigi < uNbSelDigis; ++uDigi) { - const DigiCheck* pDigi = GetDigi<DigiCheck>(uDigi); + const DigiCheck* pDigi = GetDigi<DigiCheck>(uDigi); + + // filter T0 digis from Tof (remove this line if T0 properly implemented) + if (detMatch.detId == ECbmModuleId::kTof && pDigi->GetAddress() == fuT0Address) { continue; } + const Double_t dTime = pDigi->GetTime(); const Double_t dTimeDiff = dTime - dSeedTime; LOG(debug4) << detMatch.sName << Form(" => Checking match %6u / %6u, dt %f", uDigi, uNbSelDigis, dTimeDiff); diff --git a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.h b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.h index 2a605c46fa4b3a3a914a451446925ba50185a14b..fda3e2835c62413fb1ddb9fd9cc792252619f06f 100644 --- a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.h +++ b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.h @@ -107,6 +107,8 @@ static const RawEventBuilderDetector kRawEventBuilderDetUndef = RawEventBuilderD class CbmAlgoBuildRawEvents { public: + const static uint32_t fuT0Address = 10246; + /** Default constructor **/ CbmAlgoBuildRawEvents() = default; diff --git a/reco/eventbuilder/digis/CbmBuildEventsQa.cxx b/reco/eventbuilder/digis/CbmBuildEventsQa.cxx index 13e10df2ee4bd6656e4eb4eeb3abca6af5bedcde..6208af5764062ac89787f7c30870ec4dda7375d6 100644 --- a/reco/eventbuilder/digis/CbmBuildEventsQa.cxx +++ b/reco/eventbuilder/digis/CbmBuildEventsQa.cxx @@ -15,7 +15,6 @@ #include "CbmMatch.h" #include "CbmModuleList.h" #include "CbmQaCanvas.h" -#include "CbmStsDigi.h" #include "FairRootManager.h" #include <Logger.h> diff --git a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx index 5944b7a03d52b0fb7313f7abe91897061f2f1367..ff3447e72b9321f8cf935cfa228368d91122c8e3 100644 --- a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx +++ b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx @@ -332,6 +332,14 @@ void CbmTaskBuildRawEvents::FillSeedTimesFromDetList(std::vector<Double_t>* vdSe for (RawEventBuilderDetector& system : fSeedTimeDetList) { if (DigiCounters[system.detId] < DigiNumbers[system.detId]) { + + // filter T0 digis from Tof (remove this statement if T0 properly implemented) + if (system.detId == ECbmModuleId::kTof + && (fTofDigis->at(DigiCounters[system.detId])).GetAddress() == CbmAlgoBuildRawEvents::fuT0Address) { + DigiCounters[system.detId]++; + continue; + } // end of T0 filter + Double_t thisTime = GetDigiTime(system.detId, DigiCounters[system.detId]); if (thisTime < earliestTime || earliestTime == -1) { nextAddedSystem = system.detId; @@ -340,6 +348,7 @@ void CbmTaskBuildRawEvents::FillSeedTimesFromDetList(std::vector<Double_t>* vdSe } } if (earliestTime != -1) { + if (vDigiMatch != nullptr) { const CbmMatch* digiMatch = fDigiMan->GetMatch(nextAddedSystem, DigiCounters[nextAddedSystem]); vDigiMatch->push_back(*digiMatch); @@ -380,6 +389,13 @@ void CbmTaskBuildRawEvents::FillSeedTimesFromSlidingWindow(const RawEventBuilder } fvDigiMatchQa->clear(); for (Int_t i = 0; i < fDigiMan->GetNofDigis(seedDet->detId); i++) { + + // filter T0 digis from Tof (remove this statement if T0 properly implemented) + if (seedDet->detId == ECbmModuleId::kTof + && (fTofDigis->at(i)).GetAddress() == CbmAlgoBuildRawEvents::fuT0Address) { + continue; + } // end of T0 filter + const CbmMatch* digiMatch = fDigiMan->GetMatch(seedDet->detId, i); fvDigiMatchQa->push_back(*digiMatch); } @@ -397,7 +413,21 @@ void CbmTaskBuildRawEvents::FillSeedTimesFromSlidingWindow(const RawEventBuilder } case ECbmModuleId::kSts: fSeedFinderSlidingWindow->FillSeedTimes(fStsDigis, fvDigiMatchQa); break; case ECbmModuleId::kTrd: fSeedFinderSlidingWindow->FillSeedTimes(fTrdDigis, fvDigiMatchQa); break; - case ECbmModuleId::kTof: fSeedFinderSlidingWindow->FillSeedTimes(fTofDigis, fvDigiMatchQa); break; + case ECbmModuleId::kTof: { + + // filter T0 digis from Tof (remove this statement if T0 properly implemented) + std::vector<CbmTofDigi> vFilteredTofDigis; + for (const auto& tofDigi : *fTofDigis) { + if (tofDigi.GetAddress() == CbmAlgoBuildRawEvents::fuT0Address) { continue; } + vFilteredTofDigis.push_back(tofDigi); + } + fSeedFinderSlidingWindow->FillSeedTimes(&vFilteredTofDigis, fvDigiMatchQa); + break; + // end of T0 filter + + //original version (no T0 filter) + //fSeedFinderSlidingWindow->FillSeedTimes(fTofDigis, fvDigiMatchQa); break; + } case ECbmModuleId::kRich: fSeedFinderSlidingWindow->FillSeedTimes(fRichDigis, fvDigiMatchQa); break; case ECbmModuleId::kPsd: fSeedFinderSlidingWindow->FillSeedTimes(fPsdDigis, fvDigiMatchQa); break; case ECbmModuleId::kT0: fSeedFinderSlidingWindow->FillSeedTimes(fT0Digis, fvDigiMatchQa); break;