Skip to content

Commit

Permalink
Please consider the following formatting changes (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
alibuild authored May 4, 2024
1 parent 41f8a51 commit d8665c5
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 39 deletions.
18 changes: 9 additions & 9 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,12 @@ DECLARE_SOA_TABLE(V0MCRefs, "AOD", "V0MCREF", //! index table when using AO2Ds
using V0sLinked = soa::Join<V0s, V0DataLink>;
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,
Expand All @@ -718,7 +718,7 @@ DECLARE_SOA_TABLE(FindableV0s, "AOD", "FindableV0", //! Will store findable
v0::IsCollinearV0<v0::V0Type>,
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<FindableV0s, V0DataLink>;
Expand Down Expand Up @@ -1260,16 +1260,16 @@ using CascadeLinked = CascadesLinked::iterator;
using KFCascadesLinked = soa::Join<Cascades, KFCascDataLink>;
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<FindableCascades, CascDataLink>;
Expand Down
33 changes: 17 additions & 16 deletions PWGLF/TableProducer/Strangeness/cascadebuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,8 @@ struct cascadeBuilder {
}

template <class TTrackTo, typename TV0Index, typename TCascade>
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
Expand All @@ -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);
}
Expand Down Expand Up @@ -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<aod::V0sLinked>();
processCascadeCandidate<TTrackTo>(v0index, cascade);
}
Expand All @@ -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<aod::FindableV0sLinked>();
processCascadeCandidate<TTrackTo>(v0index, cascade);
}
Expand Down Expand Up @@ -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.");
}
Expand Down Expand Up @@ -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<int> lIndices;
Expand Down
5 changes: 3 additions & 2 deletions PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ struct cascademcbuilder {
void init(InitContext const&) {}

template <typename TCascadeTable>
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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Strangeness/cascademcfinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<aod::TracksIU, aod::TracksExtra, aod::McTrackLabels>;
using LabeledFullV0s = soa::Join<aod::FindableV0s, aod::McFullV0Labels>;

Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
20 changes: 10 additions & 10 deletions PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */)
Expand All @@ -803,7 +803,7 @@ struct strangederivedbuilder {
histos.fill(HIST("hFoundTagsCounters"), 1.0f, findableV0s.size());

// pack the found V0s in a long long
std::vector<uint64_t> foundV0sPacked;
std::vector<uint64_t> foundV0sPacked;
foundV0sPacked.reserve(foundV0s.size());
for (auto const& foundV0 : foundV0s) {
foundV0sPacked[foundV0.globalIndex()] = combineProngIndices(foundV0.posTrackId(), foundV0.negTrackId());
Expand All @@ -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<foundV0s.size(); ic++){
if(indexPack==foundV0sPacked[ic]) {
for (uint32_t ic = 0; ic < foundV0s.size(); ic++) {
if (indexPack == foundV0sPacked[ic]) {
hasBeenFound = true;
break;
}
Expand All @@ -825,7 +825,7 @@ struct strangederivedbuilder {
using uint128_t = __uint128_t;
uint128_t combineProngIndices128(uint32_t pos, uint32_t neg, uint32_t bach)
{
return (((uint128_t) pos) << 64) | (((uint128_t) neg) << 32) | ((uint128_t) bach);
return (((uint128_t)pos) << 64) | (((uint128_t)neg) << 32) | ((uint128_t)bach);
}

void processCascFoundTags(aod::Cascades const& foundCascades, aod::CascDatas const& findableCascades, aod::V0s const&, aod::FindableCascades const& /* added to avoid troubles */)
Expand All @@ -834,7 +834,7 @@ struct strangederivedbuilder {
histos.fill(HIST("hFoundTagsCounters"), 3.0f, findableCascades.size());

// pack the found V0s in a long long
std::vector<uint128_t> foundCascadesPacked;
std::vector<uint128_t> foundCascadesPacked;
foundCascadesPacked.reserve(foundCascades.size());
for (auto const& foundCascade : foundCascades) {
auto v0 = foundCascade.v0();
Expand All @@ -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<foundCascades.size(); ic++){
if(indexPack==foundCascadesPacked[ic]) {
for (uint32_t ic = 0; ic < foundCascades.size(); ic++) {
if (indexPack == foundCascadesPacked[ic]) {
hasBeenFound = true;
break;
}
Expand Down

0 comments on commit d8665c5

Please sign in to comment.