Skip to content

Commit 05232cb

Browse files
author
Aswathy Menon
committed
Implementation of Spherocity in PWGDQ
1 parent e2c8d48 commit 05232cb

2 files changed

Lines changed: 35 additions & 32 deletions

File tree

‎PWGDQ.zip‎

5.63 MB
Binary file not shown.

‎PWGDQ/TableProducer/tableMaker_withAssoc.cxx‎

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ struct TableMaker {
336336

337337
// Spherocity configurables
338338
struct : ConfigurableGroup {
339+
Configurable<bool> fConfigSpherocityCompute{"cfgSpherocityCompute", false, "Compute and store event spherocity (off by default)"};
339340
Configurable<float> fConfigSpherocityPtMin{"cfgSpherocityPtMin", 0.15f, "Min pT for spherocity calculation"};
340341
Configurable<float> fConfigSpherocityPtMax{"cfgSpherocityPtMax", 10.0f, "Max pT for spherocity calculation"};
341342
Configurable<float> fConfigSpherocityEtaMin{"cfgSpherocityEtaMin", -0.8f, "Min eta for spherocity calculation"};
@@ -1238,42 +1239,44 @@ struct TableMaker {
12381239
float spherocityValue = -1.0f;
12391240
float spherocityPtWeighted = -1.0f;
12401241

1241-
if constexpr (static_cast<bool>(TTrackFillMap)) {
1242-
auto groupedTrackIndices = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex());
1242+
if (fConfigSpherocity.fConfigSpherocityCompute) {
1243+
if constexpr (static_cast<bool>(TTrackFillMap)) {
1244+
auto groupedTrackIndices = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex());
12431245

1244-
if (static_cast<int>(groupedTrackIndices.size()) >= fConfigSpherocity.fConfigSpherocityMinMult) {
1245-
std::vector<typename std::decay_t<decltype(tracksBarrel.begin())>> trackVec;
1246-
trackVec.reserve(groupedTrackIndices.size());
1246+
if (static_cast<int>(groupedTrackIndices.size()) >= fConfigSpherocity.fConfigSpherocityMinMult) {
1247+
std::vector<typename std::decay_t<decltype(tracksBarrel.begin())>> trackVec;
1248+
trackVec.reserve(groupedTrackIndices.size());
12471249

1248-
int validTracks = 0;
1249-
for (auto const& assoc : groupedTrackIndices) {
1250-
if (assoc.trackId() < tracksBarrel.size()) {
1251-
auto track = tracksBarrel.rawIteratorAt(assoc.trackId());
1252-
trackVec.push_back(track);
1253-
validTracks++;
1250+
int validTracks = 0;
1251+
for (auto const& assoc : groupedTrackIndices) {
1252+
if (assoc.trackId() < tracksBarrel.size()) {
1253+
auto track = tracksBarrel.rawIteratorAt(assoc.trackId());
1254+
trackVec.push_back(track);
1255+
validTracks++;
1256+
}
12541257
}
1255-
}
12561258

1257-
if (validTracks >= fConfigSpherocity.fConfigSpherocityMinMult) {
1258-
// Calculate unweighted spherocity
1259-
spherocityValue = VarManager::CalculateSpherocity(
1260-
trackVec,
1261-
fConfigSpherocity.fConfigSpherocityPtMin,
1262-
fConfigSpherocity.fConfigSpherocityPtMax,
1263-
fConfigSpherocity.fConfigSpherocityEtaMin,
1264-
fConfigSpherocity.fConfigSpherocityEtaMax,
1265-
fConfigSpherocity.fConfigSpherocityMinMult,
1266-
false);
1267-
1268-
// Calculate pT-weighted spherocity
1269-
spherocityPtWeighted = VarManager::CalculateSpherocity(
1270-
trackVec,
1271-
fConfigSpherocity.fConfigSpherocityPtMin,
1272-
fConfigSpherocity.fConfigSpherocityPtMax,
1273-
fConfigSpherocity.fConfigSpherocityEtaMin,
1274-
fConfigSpherocity.fConfigSpherocityEtaMax,
1275-
fConfigSpherocity.fConfigSpherocityMinMult,
1276-
true);
1259+
if (validTracks >= fConfigSpherocity.fConfigSpherocityMinMult) {
1260+
// Calculate unweighted spherocity
1261+
spherocityValue = VarManager::CalculateSpherocity(
1262+
trackVec,
1263+
fConfigSpherocity.fConfigSpherocityPtMin,
1264+
fConfigSpherocity.fConfigSpherocityPtMax,
1265+
fConfigSpherocity.fConfigSpherocityEtaMin,
1266+
fConfigSpherocity.fConfigSpherocityEtaMax,
1267+
fConfigSpherocity.fConfigSpherocityMinMult,
1268+
false);
1269+
1270+
// Calculate pT-weighted spherocity
1271+
spherocityPtWeighted = VarManager::CalculateSpherocity(
1272+
trackVec,
1273+
fConfigSpherocity.fConfigSpherocityPtMin,
1274+
fConfigSpherocity.fConfigSpherocityPtMax,
1275+
fConfigSpherocity.fConfigSpherocityEtaMin,
1276+
fConfigSpherocity.fConfigSpherocityEtaMax,
1277+
fConfigSpherocity.fConfigSpherocityMinMult,
1278+
true);
1279+
}
12771280
}
12781281
}
12791282
}

0 commit comments

Comments
 (0)