1616#include " Framework/ControlService.h"
1717#include " DataFormatsPHOS/MCLabel.h"
1818#include " SimulationDataFormat/MCTruthContainer.h"
19+ #include " SimulationDataFormat/ConstMCTruthContainer.h"
1920#include " CommonDataFormat/InteractionRecord.h"
2021#include " PHOSBase/PHOSSimParams.h"
2122#include " CCDB/CcdbApi.h"
@@ -44,11 +45,15 @@ void CellConverterSpec::run(framework::ProcessingContext& ctx)
4445
4546 auto digits = ctx.inputs ().get <std::vector<o2::phos::Digit>>(" digits" );
4647 auto digitsTR = ctx.inputs ().get <std::vector<o2::phos::TriggerRecord>>(" digitTriggerRecords" );
47- auto truthcont = ctx. inputs (). get <o2::dataformats::MCTruthContainer<o2::phos::MCLabel>*>( " digitsmctr " ) ;
48+ gsl::span< const char > labelbuffer ;
4849 if (mPropagateMC ) {
50+ labelbuffer = ctx.inputs ().get <gsl::span<char >>(" digitsmctr" );
51+ // auto truthcont = ctx.inputs().get<o2::dataformats::MCTruthContainer<o2::phos::MCLabel>*>("digitsmctr");
52+
4953 mOutputTruthCont .clear ();
5054 mOutputTruthMap .clear ();
5155 }
56+ o2::dataformats::ConstMCTruthContainerView<o2::phos::MCLabel> truthcont (labelbuffer);
5257 LOG (INFO) << " [PHOSCellConverter - run] Received " << digits.size () << " digits and " << digitsTR.size () << " TriggerRecords" ;
5358
5459 // Get TimeStamp from TriggerRecord
@@ -100,7 +105,7 @@ void CellConverterSpec::run(framework::ProcessingContext& ctx)
100105 if (mPropagateMC ) { // copy MC info,
101106 int iLab = dig.getLabel ();
102107 if (iLab > -1 ) {
103- mOutputTruthCont .addElements (labelIndex, truthcont-> getLabels (iLab));
108+ mOutputTruthCont .addElements (labelIndex, truthcont. getLabels (iLab));
104109 mOutputTruthMap .emplace_back (icell); // Relate cell index and label index
105110 labelIndex++;
106111 }
@@ -115,8 +120,6 @@ void CellConverterSpec::run(framework::ProcessingContext& ctx)
115120 // ctx.outputs().snapshot(o2::framework::Output{"PHS", "CELLSMCTR", 0, o2::framework::Lifetime::Timeframe}, mOutputTruthCont);
116121 // ctx.outputs().snapshot(o2::framework::Output{"PHS", "CELLSMCMAP", 0, o2::framework::Lifetime::Timeframe}, mOutputTruthMap);
117122 }
118- LOG (INFO) << " Finished " ;
119- ctx.services ().get <o2::framework::ControlService>().readyToQuit (framework::QuitRequest::Me);
120123}
121124
122125o2::framework::DataProcessorSpec o2::phos::reco_workflow::getCellConverterSpec (bool propagateMC)
0 commit comments