From 8d21e553fee03ebe701512f16f67ef0feea61d7c Mon Sep 17 00:00:00 2001 From: Jan Fiete Date: Mon, 31 Jan 2022 15:47:41 +0100 Subject: [PATCH] McParticle: moving default to 001 --- .../AODProducerWorkflowSpec.h | 18 ----------- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 32 +++++++++---------- .../include/Framework/AnalysisDataModel.h | 2 +- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h index d0d0485c0f470..242c495a2cf0d 100644 --- a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h +++ b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h @@ -151,24 +151,6 @@ using FwdTracksCovTable = o2::soa::Table; -using MCParticlesTable = o2::soa::Table; - typedef boost::tuple Triplet_t; struct TripletHash : std::unary_function { diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 715cc21da9bf2..24023ed8f1264 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -309,7 +309,7 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID, for (int ti = start; ti < end; ti++) { auto& trackIndex = GIndices[ti]; if (GIndex::includesSource(src, mInputSources)) { - if (src == GIndex::Source::MFT) { // MFT tracks are treated separately since they are stored in a different table + if (src == GIndex::Source::MFT) { // MFT tracks are treated separately since they are stored in a different table if (trackIndex.isAmbiguous() && mGIDToTableMFTID.find(trackIndex) != mGIDToTableMFTID.end()) { // was it already stored ? continue; } @@ -701,29 +701,29 @@ void AODProducerWorkflowDPL::fillMCParticlesTable(o2::steer::MCKinematicsReader& flags |= o2::aod::mcparticle::enums::PhysicalPrimary; // mark as physical primary } float weight = 0.f; + std::vector mothers; int mcMother0 = mcParticles[particle].getMotherTrackId(); auto item = mToStore.find(Triplet_t(source, event, mcMother0)); - int mother0 = -1; if (item != mToStore.end()) { - mother0 = item->second; + mothers.push_back(item->second); } int mcMother1 = mcParticles[particle].getSecondMotherTrackId(); - int mother1 = -1; item = mToStore.find(Triplet_t(source, event, mcMother1)); if (item != mToStore.end()) { - mother1 = item->second; + mothers.push_back(item->second); } + int daughters[2] = {-1, -1}; // slice int mcDaughter0 = mcParticles[particle].getFirstDaughterTrackId(); - int daughter0 = -1; item = mToStore.find(Triplet_t(source, event, mcDaughter0)); if (item != mToStore.end()) { - daughter0 = item->second; + daughters[0] = item->second; } int mcDaughterL = mcParticles[particle].getLastDaughterTrackId(); - int daughterL = -1; item = mToStore.find(Triplet_t(source, event, mcDaughterL)); if (item != mToStore.end()) { - daughterL = item->second; + daughters[1] = item->second; + } else { + daughters[1] = daughters[0]; } auto pX = (float)mcParticles[particle].Px(); auto pY = (float)mcParticles[particle].Py(); @@ -734,10 +734,8 @@ void AODProducerWorkflowDPL::fillMCParticlesTable(o2::steer::MCKinematicsReader& mcParticles[particle].GetPdgCode(), statusCode, flags, - mother0, - mother1, - daughter0, - daughterL, + mothers, + daughters, truncateFloatFraction(weight, mMcParticleW), truncateFloatFraction(pX, mMcParticleMom), truncateFloatFraction(pY, mMcParticleMom), @@ -789,7 +787,7 @@ void AODProducerWorkflowDPL::fillMCTrackLabelsTable(const MCTrackLabelCursorType if (!needToStore(src == GIndex::Source::MFT ? mGIDToTableMFTID : mGIDToTableFwdID)) { continue; } - if (mcTruth.isValid()) { // if not set, -1 will be stored + if (mcTruth.isValid()) { // if not set, -1 will be stored labelHolder.labelID = mToStore.at(Triplet_t(mcTruth.getSourceID(), mcTruth.getEventID(), mcTruth.getTrackID())); } if (mcTruth.isFake()) { @@ -1178,7 +1176,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto& mcCollisionsBuilder = pc.outputs().make(Output{"AOD", "MCCOLLISION"}); auto& mcMFTTrackLabelBuilder = pc.outputs().make(Output{"AOD", "MCMFTTRACKLABEL"}); auto& mcFwdTrackLabelBuilder = pc.outputs().make(Output{"AOD", "MCFWDTRACKLABEL"}); - auto& mcParticlesBuilder = pc.outputs().make(Output{"AOD", "MCPARTICLE"}); + auto& mcParticlesBuilder = pc.outputs().make(Output{"AOD", "MCPARTICLE_001"}); auto& mcTrackLabelBuilder = pc.outputs().make(Output{"AOD", "MCTRACKLABEL"}); auto& mftTracksBuilder = pc.outputs().make(Output{"AOD", "MFTTRACK"}); auto& tracksBuilder = pc.outputs().make(Output{"AOD", "TRACK"}); @@ -1204,7 +1202,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto mcCollisionsCursor = mcCollisionsBuilder.cursor(); auto mcMFTTrackLabelCursor = mcMFTTrackLabelBuilder.cursor(); auto mcFwdTrackLabelCursor = mcFwdTrackLabelBuilder.cursor(); - auto mcParticlesCursor = mcParticlesBuilder.cursor(); + auto mcParticlesCursor = mcParticlesBuilder.cursor(); auto mcTrackLabelCursor = mcTrackLabelBuilder.cursor(); auto mftTracksCursor = mftTracksBuilder.cursor(); auto tracksCovCursor = tracksCovBuilder.cursor(); @@ -1939,7 +1937,7 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo outputs.emplace_back(OutputLabel{"O2mccollisionlabel"}, "AOD", "MCCOLLISIONLABEL", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2mcmfttracklabel"}, "AOD", "MCMFTTRACKLABEL", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2mcfwdtracklabel"}, "AOD", "MCFWDTRACKLABEL", 0, Lifetime::Timeframe); - outputs.emplace_back(OutputLabel{"O2mcparticle"}, "AOD", "MCPARTICLE", 0, Lifetime::Timeframe); + outputs.emplace_back(OutputLabel{"O2mcparticle_001"}, "AOD", "MCPARTICLE_001", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2mctracklabel"}, "AOD", "MCTRACKLABEL", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2mfttrack"}, "AOD", "MFTTRACK", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2track"}, "AOD", "TRACK", 0, Lifetime::Timeframe); diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index c909006ea54eb..c590303e93f92 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -886,7 +886,7 @@ DECLARE_SOA_EXTENDED_TABLE(McParticles_001, StoredMcParticles_001, "MCPARTICLE_0 mcparticle::P, mcparticle::Y); -using McParticles = McParticles_000; +using McParticles = McParticles_001; using McParticle = McParticles::iterator; } // namespace aod namespace soa