diff --git a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.cxx b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.cxx index 91b39a8f5031e..a950cda6019ec 100644 --- a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.cxx +++ b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.cxx @@ -55,20 +55,6 @@ void DigitizerSpec::initDigitizerTask(framework::InitContext& ic) mDeadTime = o2::cpv::CPVSimParams::Instance().mDeadTime; // PHOS dead time (should include readout => mReadoutTime< mDeadTime) } } -// helper function which will be offered as a service -void DigitizerSpec::retrieveHits(const char* brname, - int sourceID, - int entryID) -{ - auto br = mSimChains[sourceID]->GetBranch(brname); - if (!br) { - LOG(error) << "No branch found"; - return; - } - mHits->clear(); - br->SetAddress(&mHits); - br->GetEntry(entryID); -} void DigitizerSpec::updateTimeDependentParams(framework::ProcessingContext& ctx) { @@ -165,7 +151,8 @@ void DigitizerSpec::run(framework::ProcessingContext& pc) // get the hits for this event and this source int source = part->sourceID; int entry = part->entryID; - retrieveHits("CPVHit", source, entry); + mHits->clear(); + context->retrieveHits(mSimChains, "CPVHit", source, entry, mHits); part++; if (part == eventParts[collID].end() && isLastStream) { // last stream, copy digits directly to output vector mDigitizer.processHits(mHits, mDigitsFinal, mDigitsOut, mLabels, collID, source, dt); diff --git a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h index 8d75def27ade4..151087a05138b 100644 --- a/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h +++ b/Steer/DigitizerWorkflow/src/CPVDigitizerSpec.h @@ -54,14 +54,6 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer void run(framework::ProcessingContext& ctx); private: - /// \brief helper function which will be offered as a service - /// \param brname Name of the hit branch - /// \param sourceID ID of the source - /// \param entryID ID of the entry in the source - void retrieveHits(const char* brname, - int sourceID, - int entryID); - void updateTimeDependentParams(framework::ProcessingContext& ctx); float mReadoutTime = 0.; ///< PHOS readout time diff --git a/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.cxx b/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.cxx index da5e299b9eac2..943975c7a3256 100644 --- a/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.cxx +++ b/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.cxx @@ -60,20 +60,6 @@ void DigitizerSpec::initDigitizerTask(framework::InitContext& ic) } mHits = new std::vector(); } -// helper function which will be offered as a service -void DigitizerSpec::retrieveHits(const char* brname, - int sourceID, - int entryID) -{ - auto br = mSimChains[sourceID]->GetBranch(brname); - if (!br) { - LOG(error) << "No branch found"; - return; - } - mHits->clear(); - br->SetAddress(&mHits); - br->GetEntry(entryID); -} void DigitizerSpec::run(framework::ProcessingContext& pc) { @@ -156,7 +142,9 @@ void DigitizerSpec::run(framework::ProcessingContext& pc) // get the hits for this event and this source int source = part->sourceID; int entry = part->entryID; - retrieveHits("PHSHit", source, entry); + mHits->clear(); + context->retrieveHits(mSimChains, "PHSHit", source, entry, mHits); + part++; if (part == eventParts[collID].end() && isLastStream) { // last stream, copy digits directly to output vector mDigitizer.processHits(mHits, mDigitsFinal, mDigitsOut, mLabels, entry, source, dt); diff --git a/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.h b/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.h index 03360730a4c19..cf30ad085d717 100644 --- a/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.h +++ b/Steer/DigitizerWorkflow/src/PHOSDigitizerSpec.h @@ -55,14 +55,6 @@ class DigitizerSpec final : public o2::base::BaseDPLDigitizer void run(framework::ProcessingContext& ctx); private: - /// \brief helper function which will be offered as a service - /// \param brname Name of the hit branch - /// \param sourceID ID of the source - /// \param entryID ID of the entry in the source - void retrieveHits(const char* brname, - int sourceID, - int entryID); - float mReadoutTime = 0.; ///< PHOS readout time float mDeadTime = 0.; ///< PHOS dead time bool mInitSimParams = true; ///< To initialize SimParams