@@ -1788,15 +1788,6 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
17881788 auto fwdTracksCursor = createTableCursor<o2::aod::StoredFwdTracks>(pc);
17891789 auto fwdTracksCovCursor = createTableCursor<o2::aod::StoredFwdTracksCov>(pc);
17901790 auto fwdTrkClsCursor = createTableCursor<o2::aod::FwdTrkCls>(pc);
1791- auto mcColLabelsCursor = createTableCursor<o2::aod::McCollisionLabels>(pc);
1792- auto mcCollisionsCursor = createTableCursor<o2::aod::McCollisions>(pc);
1793- auto hepmcXSectionsCursor = createTableCursor<o2::aod::HepMCXSections>(pc);
1794- auto hepmcPdfInfosCursor = createTableCursor<o2::aod::HepMCPdfInfos>(pc);
1795- auto hepmcHeavyIonsCursor = createTableCursor<o2::aod::HepMCHeavyIons>(pc);
1796- auto mcMFTTrackLabelCursor = createTableCursor<o2::aod::McMFTTrackLabels>(pc);
1797- auto mcFwdTrackLabelCursor = createTableCursor<o2::aod::McFwdTrackLabels>(pc);
1798- auto mcParticlesCursor = createTableCursor<o2::aod::StoredMcParticles_001>(pc);
1799- auto mcTrackLabelCursor = createTableCursor<o2::aod::McTrackLabels>(pc);
18001791 auto mftTracksCursor = createTableCursor<o2::aod::StoredMFTTracks>(pc);
18011792 auto tracksCursor = createTableCursor<o2::aod::StoredTracksIU>(pc);
18021793 auto tracksCovCursor = createTableCursor<o2::aod::StoredTracksCovIU>(pc);
@@ -1810,10 +1801,33 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
18101801 auto hmpCursor = createTableCursor<o2::aod::HMPIDs>(pc);
18111802 auto caloCellsCursor = createTableCursor<o2::aod::Calos>(pc);
18121803 auto caloCellsTRGTableCursor = createTableCursor<o2::aod::CaloTriggers>(pc);
1813- auto mcCaloLabelsCursor = createTableCursor<o2::aod::McCaloLabels_001>(pc);
18141804 auto cpvClustersCursor = createTableCursor<o2::aod::CPVClusters>(pc);
18151805 auto originCursor = createTableCursor<o2::aod::Origins>(pc);
18161806
1807+ // Declare MC cursors type without adding the output for a table
1808+ o2::framework::Produces<o2::aod::McCollisionLabels> mcColLabelsCursor;
1809+ o2::framework::Produces<o2::aod::McCollisions> mcCollisionsCursor;
1810+ o2::framework::Produces<o2::aod::HepMCXSections> hepmcXSectionsCursor;
1811+ o2::framework::Produces<o2::aod::HepMCPdfInfos> hepmcPdfInfosCursor;
1812+ o2::framework::Produces<o2::aod::HepMCHeavyIons> hepmcHeavyIonsCursor;
1813+ o2::framework::Produces<o2::aod::McMFTTrackLabels> mcMFTTrackLabelCursor;
1814+ o2::framework::Produces<o2::aod::McFwdTrackLabels> mcFwdTrackLabelCursor;
1815+ o2::framework::Produces<o2::aod::StoredMcParticles_001> mcParticlesCursor;
1816+ o2::framework::Produces<o2::aod::McTrackLabels> mcTrackLabelCursor;
1817+ o2::framework::Produces<o2::aod::McCaloLabels_001> mcCaloLabelsCursor;
1818+ if (mUseMC ) { // This creates the actual writercursor
1819+ mcColLabelsCursor = createTableCursor<o2::aod::McCollisionLabels>(pc);
1820+ mcCollisionsCursor = createTableCursor<o2::aod::McCollisions>(pc);
1821+ hepmcXSectionsCursor = createTableCursor<o2::aod::HepMCXSections>(pc);
1822+ hepmcPdfInfosCursor = createTableCursor<o2::aod::HepMCPdfInfos>(pc);
1823+ hepmcHeavyIonsCursor = createTableCursor<o2::aod::HepMCHeavyIons>(pc);
1824+ mcMFTTrackLabelCursor = createTableCursor<o2::aod::McMFTTrackLabels>(pc);
1825+ mcFwdTrackLabelCursor = createTableCursor<o2::aod::McFwdTrackLabels>(pc);
1826+ mcParticlesCursor = createTableCursor<o2::aod::StoredMcParticles_001>(pc);
1827+ mcTrackLabelCursor = createTableCursor<o2::aod::McTrackLabels>(pc);
1828+ mcCaloLabelsCursor = createTableCursor<o2::aod::McCaloLabels_001>(pc);
1829+ }
1830+
18171831 std::unique_ptr<o2::steer::MCKinematicsReader> mcReader;
18181832 if (mUseMC ) {
18191833 mcReader = std::make_unique<o2::steer::MCKinematicsReader>(" collisioncontext.root" );
@@ -2926,14 +2940,6 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo
29262940 OutputForTable<FV0As>::spec (),
29272941 OutputForTable<StoredFwdTracks>::spec (),
29282942 OutputForTable<StoredFwdTracksCov>::spec (),
2929- OutputForTable<McCollisions>::spec (),
2930- OutputForTable<HepMCXSections>::spec (),
2931- OutputForTable<HepMCPdfInfos>::spec (),
2932- OutputForTable<HepMCHeavyIons>::spec (),
2933- OutputForTable<McMFTTrackLabels>::spec (),
2934- OutputForTable<McFwdTrackLabels>::spec (),
2935- OutputForTable<StoredMcParticles_001>::spec (),
2936- OutputForTable<McTrackLabels>::spec (),
29372943 OutputForTable<StoredMFTTracks>::spec (),
29382944 OutputForTable<StoredTracksIU>::spec (),
29392945 OutputForTable<StoredTracksCovIU>::spec (),
@@ -2952,18 +2958,30 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo
29522958 OutputForTable<Calos>::spec (),
29532959 OutputForTable<CaloTriggers>::spec (),
29542960 OutputForTable<CPVClusters>::spec (),
2955- OutputForTable<McCaloLabels_001>::spec (),
29562961 OutputForTable<Origin>::spec (),
2957- // todo: use addTableToOuput helper?
2958- // currently the description is MCCOLLISLABEL, so
2959- // the name in AO2D would be O2mccollislabel
2960- // addTableToOutput<McCollisionLabels>(outputs);
2961- {OutputLabel{" McCollisionLabels" }, " AOD" , " MCCOLLISIONLABEL" , 0 , Lifetime::Timeframe},
29622962 OutputSpec{" TFN" , " TFNumber" },
29632963 OutputSpec{" TFF" , " TFFilename" },
29642964 OutputSpec{" AMD" , " AODMetadataKeys" },
29652965 OutputSpec{" AMD" , " AODMetadataVals" }};
29662966
2967+ if (useMC) {
2968+ outputs.insert (outputs.end (),
2969+ {OutputForTable<McCollisions>::spec (),
2970+ OutputForTable<HepMCXSections>::spec (),
2971+ OutputForTable<HepMCPdfInfos>::spec (),
2972+ OutputForTable<HepMCHeavyIons>::spec (),
2973+ OutputForTable<McMFTTrackLabels>::spec (),
2974+ OutputForTable<McFwdTrackLabels>::spec (),
2975+ OutputForTable<StoredMcParticles_001>::spec (),
2976+ OutputForTable<McTrackLabels>::spec (),
2977+ OutputForTable<McCaloLabels_001>::spec (),
2978+ // todo: use addTableToOuput helper?
2979+ // currently the description is MCCOLLISLABEL, so
2980+ // the name in AO2D would be O2mccollislabel
2981+ // addTableToOutput<McCollisionLabels>(outputs);
2982+ {OutputLabel{" McCollisionLabels" }, " AOD" , " MCCOLLISIONLABEL" , 0 , Lifetime::Timeframe}});
2983+ }
2984+
29672985 return DataProcessorSpec{
29682986 " aod-producer-workflow" ,
29692987 dataRequest->inputs ,
0 commit comments