From d8665c55295c390bd11c2e6b2d2e31c668c7f27c Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Sat, 4 May 2024 06:53:14 +0200 Subject: [PATCH] Please consider the following formatting changes (#288) --- PWGLF/DataModel/LFStrangenessTables.h | 18 +++++----- .../Strangeness/cascadebuilder.cxx | 33 ++++++++++--------- .../Strangeness/cascademcbuilder.cxx | 5 +-- .../Strangeness/cascademcfinder.cxx | 2 +- .../Strangeness/lambdakzerobuilder.cxx | 2 +- .../Strangeness/strangederivedbuilder.cxx | 20 +++++------ 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 76cacaf8680..319ce295b2f 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -703,12 +703,12 @@ DECLARE_SOA_TABLE(V0MCRefs, "AOD", "V0MCREF", //! index table when using AO2Ds using V0sLinked = soa::Join; using V0Linked = V0sLinked::iterator; -namespace v0data +namespace v0data { DECLARE_SOA_COLUMN(IsFound, isFound, bool); //! is this FindableV0 actually in the V0s table? } -// Major bypass for simultaneous found vs findable study +// Major bypass for simultaneous found vs findable study DECLARE_SOA_TABLE(FindableV0s, "AOD", "FindableV0", //! Will store findable o2::soa::Index<>, v0::CollisionId, v0::PosTrackId, v0::NegTrackId, @@ -718,7 +718,7 @@ DECLARE_SOA_TABLE(FindableV0s, "AOD", "FindableV0", //! Will store findable v0::IsCollinearV0, o2::soa::Marker<1>); -DECLARE_SOA_TABLE(V0FoundTags, "AOD", "V0FoundTag", //! found or not? +DECLARE_SOA_TABLE(V0FoundTags, "AOD", "V0FoundTag", //! found or not? v0data::IsFound); using FindableV0sLinked = soa::Join; @@ -1260,16 +1260,16 @@ using CascadeLinked = CascadesLinked::iterator; using KFCascadesLinked = soa::Join; using KFCascadeLinked = KFCascadesLinked::iterator; -namespace cascdata +namespace cascdata { -DECLARE_SOA_INDEX_COLUMN(FindableV0, findableV0); //! V0 index -DECLARE_SOA_COLUMN(IsFound, isFound, bool); //! is this FindableCascade actually in the Cascades table? -} +DECLARE_SOA_INDEX_COLUMN(FindableV0, findableV0); //! V0 index +DECLARE_SOA_COLUMN(IsFound, isFound, bool); //! is this FindableCascade actually in the Cascades table? +} // namespace cascdata DECLARE_SOA_TABLE(FindableCascades, "AOD", "FINDABLECASCS", //! Run 3 cascade table - o2::soa::Index<>, cascade::CollisionId, cascdata::FindableV0Id, cascade::BachelorId, o2::soa::Marker<1>); + o2::soa::Index<>, cascade::CollisionId, cascdata::FindableV0Id, cascade::BachelorId, o2::soa::Marker<1>); -DECLARE_SOA_TABLE(CascFoundTags, "AOD", "CascFoundTag", //! found or not? +DECLARE_SOA_TABLE(CascFoundTags, "AOD", "CascFoundTag", //! found or not? cascdata::IsFound); using FindableCascadesLinked = soa::Join; diff --git a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx index 064a61134c5..b981070d9bb 100644 --- a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx @@ -1525,7 +1525,8 @@ struct cascadeBuilder { } template - void processCascadeCandidate(TV0Index const& v0index, TCascade const& cascade){ + void processCascadeCandidate(TV0Index const& v0index, TCascade const& cascade) + { bool validCascadeCandidate = false; if (v0index.has_v0Data()) { // this V0 passed both standard V0 and cascade V0 selections @@ -1549,17 +1550,17 @@ struct cascadeBuilder { cascadecandidate.positiveId, cascadecandidate.negativeId, cascadecandidate.bachelorId, cascade.collisionId()); cascdata(cascadecandidate.charge, cascadecandidate.mXi, cascadecandidate.mOmega, - cascadecandidate.pos[0], cascadecandidate.pos[1], cascadecandidate.pos[2], - cascadecandidate.v0pos[0], cascadecandidate.v0pos[1], cascadecandidate.v0pos[2], - cascadecandidate.v0mompos[0], cascadecandidate.v0mompos[1], cascadecandidate.v0mompos[2], - cascadecandidate.v0momneg[0], cascadecandidate.v0momneg[1], cascadecandidate.v0momneg[2], - cascadecandidate.bachP[0], cascadecandidate.bachP[1], cascadecandidate.bachP[2], - cascadecandidate.bachP[0] + cascadecandidate.v0mompos[0] + cascadecandidate.v0momneg[0], // <--- redundant but ok - cascadecandidate.bachP[1] + cascadecandidate.v0mompos[1] + cascadecandidate.v0momneg[1], // <--- redundant but ok - cascadecandidate.bachP[2] + cascadecandidate.v0mompos[2] + cascadecandidate.v0momneg[2], // <--- redundant but ok - cascadecandidate.v0dcadau, cascadecandidate.dcacascdau, - cascadecandidate.v0dcapostopv, cascadecandidate.v0dcanegtopv, - cascadecandidate.bachDCAxy, cascadecandidate.cascDCAxy, cascadecandidate.cascDCAz); // <--- no corresponding stratrack information available + cascadecandidate.pos[0], cascadecandidate.pos[1], cascadecandidate.pos[2], + cascadecandidate.v0pos[0], cascadecandidate.v0pos[1], cascadecandidate.v0pos[2], + cascadecandidate.v0mompos[0], cascadecandidate.v0mompos[1], cascadecandidate.v0mompos[2], + cascadecandidate.v0momneg[0], cascadecandidate.v0momneg[1], cascadecandidate.v0momneg[2], + cascadecandidate.bachP[0], cascadecandidate.bachP[1], cascadecandidate.bachP[2], + cascadecandidate.bachP[0] + cascadecandidate.v0mompos[0] + cascadecandidate.v0momneg[0], // <--- redundant but ok + cascadecandidate.bachP[1] + cascadecandidate.v0mompos[1] + cascadecandidate.v0momneg[1], // <--- redundant but ok + cascadecandidate.bachP[2] + cascadecandidate.v0mompos[2] + cascadecandidate.v0momneg[2], // <--- redundant but ok + cascadecandidate.v0dcadau, cascadecandidate.dcacascdau, + cascadecandidate.v0dcapostopv, cascadecandidate.v0dcanegtopv, + cascadecandidate.bachDCAxy, cascadecandidate.cascDCAxy, cascadecandidate.cascDCAz); // <--- no corresponding stratrack information available if (createCascTrackXs) { cascTrackXs(cascadecandidate.positiveX, cascadecandidate.negativeX, cascadecandidate.bachelorX); } @@ -1599,7 +1600,7 @@ struct cascadeBuilder { for (auto& cascade : cascades) { // de-reference from V0 pool, either specific for cascades or general // use templatizing to avoid code duplication - + auto v0index = cascade.template v0_as(); processCascadeCandidate(v0index, cascade); } @@ -1615,7 +1616,7 @@ struct cascadeBuilder { for (auto& cascade : cascades) { // de-reference from V0 pool, either specific for cascades or general // use templatizing to avoid code duplication - + auto v0index = cascade.template findableV0_as(); processCascadeCandidate(v0index, cascade); } @@ -2007,7 +2008,7 @@ struct cascadePreselector { void init(InitContext const&) { - //check settings and stop if not viable + // check settings and stop if not viable if (doprocessBuildAll == false && doprocessBuildMCAssociated == false && doprocessBuildValiddEdx == false && doprocessBuildValiddEdxMCAssociated == false && doprocessBuildFindable == false) { LOGF(fatal, "No processBuild function enabled. Please choose one."); } @@ -2344,7 +2345,7 @@ struct cascadeLinkBuilder { } } - // build Cascade -> CascData link table + // build Cascade -> CascData link table void processFindable(aod::FindableCascades const& casctable, aod::CascDatas const& cascdatatable) { std::vector lIndices; diff --git a/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx b/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx index 4bdf8421ac1..a138744f43c 100644 --- a/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx @@ -56,7 +56,8 @@ struct cascademcbuilder { void init(InitContext const&) {} template - void generateCascadeMCinfo(TCascadeTable cascTable){ + void generateCascadeMCinfo(TCascadeTable cascTable) + { for (auto& casc : cascTable) { int pdgCode = -1, pdgCodeMother = -1; int pdgCodePositive = -1, pdgCodeNegative = -1, pdgCodeBachelor = -1, pdgCodeV0 = -1; @@ -129,7 +130,7 @@ struct cascademcbuilder { } } } // end conditional V0-bach pair - } // end has mothers + } // end has mothers } // end neg = pos mother conditional } } // end loop neg/pos mothers diff --git a/PWGLF/TableProducer/Strangeness/cascademcfinder.cxx b/PWGLF/TableProducer/Strangeness/cascademcfinder.cxx index 7a353d41a74..476b84ad172 100644 --- a/PWGLF/TableProducer/Strangeness/cascademcfinder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascademcfinder.cxx @@ -62,7 +62,7 @@ using namespace o2::framework::expressions; using std::array; using namespace ROOT::Math; -// WARNING: the cascade findable uses findable V0s as well +// WARNING: the cascade findable uses findable V0s as well using LabeledTracks = soa::Join; using LabeledFullV0s = soa::Join; diff --git a/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx b/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx index 71a085cc241..0c6a0b843a2 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx @@ -1363,7 +1363,7 @@ struct lambdakzeroPreselector { void init(InitContext const&) { - //check settings and stop if not viable + // check settings and stop if not viable if (doprocessBuildAll == false && doprocessBuildMCAssociated == false && doprocessBuildValiddEdx == false && doprocessBuildValiddEdxMCAssociated == false && doprocessBuildFindable == false) { LOGF(fatal, "No processBuild function enabled. Please choose one."); } diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index b3b591832a3..287b4fb131c 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -218,8 +218,8 @@ struct strangederivedbuilder { histos.add("h2dNVerticesVsCentrality", "h2dNVerticesVsCentrality", kTH2D, {axisCentrality, axisNVertices}); - if( doprocessV0FoundTags || doprocessCascFoundTags){ - histos.add("hFoundTagsCounters", "hFoundTagsCounters", kTH1D, {{4, -0.5f, 3.5f}}); + if (doprocessV0FoundTags || doprocessCascFoundTags) { + histos.add("hFoundTagsCounters", "hFoundTagsCounters", kTH1D, {{4, -0.5f, 3.5f}}); } // for QA and test purposes @@ -794,7 +794,7 @@ struct strangederivedbuilder { uint64_t combineProngIndices(uint32_t low, uint32_t high) { - return (((uint64_t) high) << 32) | ((uint64_t) low); + return (((uint64_t)high) << 32) | ((uint64_t)low); } void processV0FoundTags(aod::V0s const& foundV0s, aod::V0Datas const& findableV0s, aod::FindableV0s const& /* added to avoid troubles */) @@ -803,7 +803,7 @@ struct strangederivedbuilder { histos.fill(HIST("hFoundTagsCounters"), 1.0f, findableV0s.size()); // pack the found V0s in a long long - std::vector foundV0sPacked; + std::vector foundV0sPacked; foundV0sPacked.reserve(foundV0s.size()); for (auto const& foundV0 : foundV0s) { foundV0sPacked[foundV0.globalIndex()] = combineProngIndices(foundV0.posTrackId(), foundV0.negTrackId()); @@ -812,8 +812,8 @@ struct strangederivedbuilder { bool hasBeenFound = false; for (auto const& findableV0 : findableV0s) { uint64_t indexPack = combineProngIndices(findableV0.posTrackId(), findableV0.negTrackId()); - for(uint32_t ic=0; ic foundCascadesPacked; + std::vector foundCascadesPacked; foundCascadesPacked.reserve(foundCascades.size()); for (auto const& foundCascade : foundCascades) { auto v0 = foundCascade.v0(); @@ -844,8 +844,8 @@ struct strangederivedbuilder { bool hasBeenFound = false; for (auto const& findableCascade : findableCascades) { uint128_t indexPack = combineProngIndices128(findableCascade.posTrackId(), findableCascade.negTrackId(), findableCascade.bachelorId()); - for(uint32_t ic=0; ic