Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions PWGJE/Core/JetDerivedDataUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file JetDetivedDataUtilities.h
/// \file JetDerivedDataUtilities.h
/// \brief Jet derived data related utilities
///
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>
Expand All @@ -33,7 +33,7 @@
namespace jetderiveddatautilities
{

static constexpr float mPion = 0.139; // TDatabasePDG::Instance()->GetParticle(211)->Mass(); //can be removed when pion mass becomes default for unidentified tracks

Check failure on line 36 in PWGJE/Core/JetDerivedDataUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.

enum JCollisionSel {
sel8 = 0,
Expand All @@ -54,20 +54,36 @@
};

template <typename T>
bool selectCollision(T const& collision, const std::vector<int>& eventSelectionMaskBits, bool skipMBGapEvents = true, bool rctSelection = true, std::string rctLabel = "CBT_hadronPID", bool rejectLimitedAcceptanceRct = false, bool requireZDCRct = false)
bool commonCollisionSelection(T const& collision, bool skipMBGapEvents = true, bool rctSelection = true, std::string rctLabel = "CBT_hadronPID", bool rejectLimitedAcceptanceRct = false, bool requireZDCRct = false)
{
if (skipMBGapEvents && collision.subGeneratorId() == JCollisionSubGeneratorId::mbGap) {
if (skipMBGapEvents && collision.getSubGeneratorId() == JCollisionSubGeneratorId::mbGap) {
return false;
}
o2::aod::rctsel::RCTFlagsChecker rctChecker;
rctChecker.init(rctLabel, requireZDCRct, rejectLimitedAcceptanceRct);
if (rctSelection && !rctChecker.checkTable(collision)) { // CBT_hadronPID given as default so that TOF is included in RCT selection to benefit from better timing for tracks. Impact of this for inclusive jets should be studied
return false;
}
return true;
}

template <typename T>
bool selectMcCollision(T const& mcCollision, bool skipMBGapEvents = true, bool rctSelection = true, std::string rctLabel = "CBT_hadronPID", bool rejectLimitedAcceptanceRct = false, bool requireZDCRct = false)
{
return commonCollisionSelection(mcCollision, skipMBGapEvents, rctSelection, rctLabel, rejectLimitedAcceptanceRct, requireZDCRct);
}

template <typename T>
bool selectCollision(T const& collision, const std::vector<int>& eventSelectionMaskBits, bool skipMBGapEvents = true, bool rctSelection = true, std::string rctLabel = "CBT_hadronPID", bool rejectLimitedAcceptanceRct = false, bool requireZDCRct = false)
{

if (!commonCollisionSelection(collision, skipMBGapEvents, rctSelection, rctLabel, rejectLimitedAcceptanceRct, requireZDCRct)) {
return false;
}
if (eventSelectionMaskBits.size() == 0) {
return true;
}
for (auto eventSelectionMaskBit : eventSelectionMaskBits) {

Check failure on line 86 in PWGJE/Core/JetDerivedDataUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!(collision.eventSel() & (1 << eventSelectionMaskBit))) {
return false;
}
Expand Down Expand Up @@ -199,7 +215,7 @@
// Check for EMCAL in readout requires any of the EMCAL trigger classes (including EMC in MB trigger) to fire
std::array<triggerAliases, 11> selectAliases = {{triggerAliases::kTVXinEMC, triggerAliases::kEMC7, triggerAliases::kDMC7, triggerAliases::kEG1, triggerAliases::kEG2, triggerAliases::kDG1, triggerAliases::kDG2, triggerAliases::kEJ1, triggerAliases::kEJ2, triggerAliases::kDJ1, triggerAliases::kDJ2}};
bool found = false;
for (auto alias : selectAliases) {

Check failure on line 218 in PWGJE/Core/JetDerivedDataUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (collision.alias_bit(alias)) {
found = true;
break;
Expand Down Expand Up @@ -241,7 +257,7 @@
if (triggerMaskBits.size() == 0) {
return true;
}
for (auto triggerMaskBit : triggerMaskBits) {

Check failure on line 260 in PWGJE/Core/JetDerivedDataUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (collision.triggerSel() & (1 << triggerMaskBit)) {
return true;
}
Expand Down Expand Up @@ -648,7 +664,7 @@
template <typename T>
bool selectTrackDcaZ(T const& track, double dcaZmax = 99.)
{
return abs(track.dcaZ()) < dcaZmax;
return std::abs(track.dcaZ()) < dcaZmax;
}

} // namespace jetderiveddatautilities
Expand Down
89 changes: 50 additions & 39 deletions PWGJE/DataModel/JetReducedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@

namespace jbc
{
DECLARE_SOA_INDEX_COLUMN(BC, bc);

Check failure on line 35 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(RunNumber, runNumber, int);
DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t);
DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t);
DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32);
DECLARE_SOA_BITMAP_COLUMN(Selection, selection, 64);
DECLARE_SOA_BITMAP_COLUMN(Rct, rct, 32);
DECLARE_SOA_COLUMN(ReadCounts, readCounts, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVX, readCountsWithTVX, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndNoTFB, readCountsWithTVXAndNoTFB, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndNoTFBAndNoITSROFB, readCountsWithTVXAndNoTFBAndNoITSROFB, std::vector<int>);
DECLARE_SOA_COLUMN(Counts, counts, int);
DECLARE_SOA_COLUMN(CountsWithTVX, countsWithTVX, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndNoTFB, countsWithTVXAndNoTFB, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndNoTFBAndNoITSROFB, countsWithTVXAndNoTFBAndNoITSROFB, int);
} // namespace jbc

DECLARE_SOA_TABLE_STAGED(JBCs, "JBC",
Expand All @@ -61,15 +61,15 @@
jbc::BCId);

DECLARE_SOA_TABLE_STAGED(BCCounts, "BCCOUNT",
jbc::ReadCounts,
jbc::ReadCountsWithTVX,
jbc::ReadCountsWithTVXAndNoTFB,
jbc::ReadCountsWithTVXAndNoTFBAndNoITSROFB);
jbc::Counts,
jbc::CountsWithTVX,
jbc::CountsWithTVXAndNoTFB,
jbc::CountsWithTVXAndNoTFBAndNoITSROFB);

namespace jcollision
{
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
DECLARE_SOA_INDEX_COLUMN(JBC, bc);

Check failure on line 72 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(PosX, posX, float);
DECLARE_SOA_COLUMN(PosY, posY, float);
DECLARE_SOA_COLUMN(PosZ, posZ, float);
Expand All @@ -90,7 +90,7 @@
DECLARE_SOA_COLUMN(CentralityVariant1, centralityVariant1, float);
DECLARE_SOA_COLUMN(HadronicRate, hadronicRate, float);
DECLARE_SOA_COLUMN(Weight, weight, float);
DECLARE_SOA_COLUMN(SubGeneratorId, subGeneratorId, int);
DECLARE_SOA_COLUMN(GetSubGeneratorId, getSubGeneratorId, int);
DECLARE_SOA_COLUMN(EventSel, eventSel, uint16_t);
DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32);
DECLARE_SOA_BITMAP_COLUMN(Rct, rct, 32);
Expand All @@ -99,21 +99,21 @@
DECLARE_SOA_COLUMN(ChargedTriggerSel, chargedTriggerSel, uint8_t);
DECLARE_SOA_COLUMN(FullTriggerSel, fullTriggerSel, uint32_t);
DECLARE_SOA_COLUMN(ChargedHFTriggerSel, chargedHFTriggerSel, uint8_t);
DECLARE_SOA_COLUMN(ReadCounts, readCounts, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVX, readCountsWithTVX, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSel8, readCountsWithTVXAndZVertexAndSel8, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSel8Full, readCountsWithTVXAndZVertexAndSel8Full, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSel8FullPbPb, readCountsWithTVXAndZVertexAndSel8FullPbPb, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSelMC, readCountsWithTVXAndZVertexAndSelMC, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSelMCFull, readCountsWithTVXAndZVertexAndSelMCFull, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSelMCFullPbPb, readCountsWithTVXAndZVertexAndSelMCFullPbPb, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSelUnanchoredMC, readCountsWithTVXAndZVertexAndSelUnanchoredMC, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSelTVX, readCountsWithTVXAndZVertexAndSelTVX, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSel7, readCountsWithTVXAndZVertexAndSel7, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithTVXAndZVertexAndSel7KINT7, readCountsWithTVXAndZVertexAndSel7KINT7, std::vector<int>);
DECLARE_SOA_COLUMN(ReadCountsWithCustom, readCountsWithCustom, std::vector<int>);
DECLARE_SOA_COLUMN(Counts, counts, int);
DECLARE_SOA_COLUMN(CountsWithTVX, countsWithTVX, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSel8, countsWithTVXAndZVertexAndSel8, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSel8Full, countsWithTVXAndZVertexAndSel8Full, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSel8FullPbPb, countsWithTVXAndZVertexAndSel8FullPbPb, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSelMC, countsWithTVXAndZVertexAndSelMC, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSelMCFull, countsWithTVXAndZVertexAndSelMCFull, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSelMCFullPbPb, countsWithTVXAndZVertexAndSelMCFullPbPb, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSelUnanchoredMC, countsWithTVXAndZVertexAndSelUnanchoredMC, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSelTVX, countsWithTVXAndZVertexAndSelTVX, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSel7, countsWithTVXAndZVertexAndSel7, int);
DECLARE_SOA_COLUMN(CountsWithTVXAndZVertexAndSel7KINT7, countsWithTVXAndZVertexAndSel7KINT7, int);
DECLARE_SOA_COLUMN(CountsWithCustomSelection, countsWithCustomSelection, int);
DECLARE_SOA_COLUMN(IsAmbiguous, isAmbiguous, bool);
DECLARE_SOA_COLUMN(IsEMCALReadout, isEmcalReadout, bool);

Check failure on line 116 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(IsOutlier, isOutlier, bool);
} // namespace jcollision

Expand Down Expand Up @@ -146,7 +146,7 @@

DECLARE_SOA_TABLE_STAGED(JCollisionMcInfos, "JCOLLISIONMCINFO",
jcollision::Weight,
jcollision::SubGeneratorId);
jcollision::GetSubGeneratorId);

DECLARE_SOA_TABLE_STAGED(JCollisionOutliers, "JCOLLISIONOUTLR",
jcollision::IsOutlier);
Expand All @@ -173,19 +173,19 @@
jcollision::ChargedHFTriggerSel);

DECLARE_SOA_TABLE_STAGED(CollisionCounts, "COLLCOUNT",
jcollision::ReadCounts,
jcollision::ReadCountsWithTVX,
jcollision::ReadCountsWithTVXAndZVertexAndSel8,
jcollision::ReadCountsWithTVXAndZVertexAndSel8Full,
jcollision::ReadCountsWithTVXAndZVertexAndSel8FullPbPb,
jcollision::ReadCountsWithTVXAndZVertexAndSelMC,
jcollision::ReadCountsWithTVXAndZVertexAndSelMCFull,
jcollision::ReadCountsWithTVXAndZVertexAndSelMCFullPbPb,
jcollision::ReadCountsWithTVXAndZVertexAndSelUnanchoredMC,
jcollision::ReadCountsWithTVXAndZVertexAndSelTVX,
jcollision::ReadCountsWithTVXAndZVertexAndSel7,
jcollision::ReadCountsWithTVXAndZVertexAndSel7KINT7,
jcollision::ReadCountsWithCustom);
jcollision::Counts,
jcollision::CountsWithTVX,
jcollision::CountsWithTVXAndZVertexAndSel8,
jcollision::CountsWithTVXAndZVertexAndSel8Full,
jcollision::CountsWithTVXAndZVertexAndSel8FullPbPb,
jcollision::CountsWithTVXAndZVertexAndSelMC,
jcollision::CountsWithTVXAndZVertexAndSelMCFull,
jcollision::CountsWithTVXAndZVertexAndSelMCFullPbPb,
jcollision::CountsWithTVXAndZVertexAndSelUnanchoredMC,
jcollision::CountsWithTVXAndZVertexAndSelTVX,
jcollision::CountsWithTVXAndZVertexAndSel7,
jcollision::CountsWithTVXAndZVertexAndSel7KINT7,
jcollision::CountsWithCustomSelection);

namespace jmccollision
{
Expand All @@ -198,13 +198,19 @@
DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float);
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float);
DECLARE_SOA_COLUMN(Weight, weight, float);
DECLARE_SOA_COLUMN(SubGeneratorId, subGeneratorId, int);
DECLARE_SOA_COLUMN(Accepted, accepted, uint64_t);
DECLARE_SOA_COLUMN(Attempted, attempted, uint64_t);
DECLARE_SOA_COLUMN(XsectGen, xsectGen, float);
DECLARE_SOA_COLUMN(XsectErr, xsectErr, float);
DECLARE_SOA_COLUMN(PtHard, ptHard, float);
DECLARE_SOA_COLUMN(IsOutlier, isOutlier, bool);
DECLARE_SOA_BITMAP_COLUMN(Rct, rct, 32);
DECLARE_SOA_COLUMN(GetGeneratorId, getGeneratorId, int);
DECLARE_SOA_COLUMN(GetSubGeneratorId, getSubGeneratorId, int);
DECLARE_SOA_COLUMN(GetSourceId, getSourceId, int);
DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float);
DECLARE_SOA_COLUMN(EventPlaneAngle, eventPlaneAngle, float);

} // namespace jmccollision
DECLARE_SOA_TABLE_STAGED(JMcCollisions, "JMCCOLLISION",
o2::soa::Index<>,
Expand All @@ -216,12 +222,17 @@
jmccollision::MultFT0C,
jmccollision::CentFT0M,
jmccollision::Weight,
jmccollision::SubGeneratorId,
jmccollision::Accepted,
jmccollision::Attempted,
jmccollision::XsectGen,
jmccollision::XsectErr,
jmccollision::PtHard);
jmccollision::PtHard,
jmccollision::Rct,
jmccollision::GetGeneratorId,
jmccollision::GetSubGeneratorId,
jmccollision::GetSourceId,
jmccollision::ImpactParameter,
jmccollision::EventPlaneAngle);

using JMcCollision = JMcCollisions::iterator;
using StoredJMcCollision = StoredJMcCollisions::iterator;
Expand All @@ -231,7 +242,7 @@

namespace jmccollisionlb
{
DECLARE_SOA_INDEX_COLUMN(JMcCollision, mcCollision);

Check failure on line 245 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
}

DECLARE_SOA_TABLE_STAGED(JMcCollisionLbs, "JMCCOLLISIONLB",
Expand All @@ -242,12 +253,12 @@

namespace jtrack
{
DECLARE_SOA_INDEX_COLUMN(JCollision, collision);

Check failure on line 256 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_INDEX_COLUMN(Track, track);
DECLARE_SOA_COLUMN(Pt, pt, float);
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_COLUMN(DCAX, dcaX, float);

Check failure on line 261 in PWGJE/DataModel/JetReducedData.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(DCAY, dcaY, float);
DECLARE_SOA_COLUMN(DCAZ, dcaZ, float);
DECLARE_SOA_COLUMN(DCAXY, dcaXY, float);
Expand Down
Loading
Loading