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
2 changes: 1 addition & 1 deletion PWGCF/DataModel/CorrelationsDerived.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGCF/DataModel/CorrelationsDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef PWGCF_DATAMODEL_CORRELATIONSDERIVED_H_

Check failure on line 11 in PWGCF/DataModel/CorrelationsDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGCF/DataModel/CorrelationsDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGCF/DataModel/CorrelationsDerived.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
#define PWGCF_DATAMODEL_CORRELATIONSDERIVED_H_

#include "Common/DataModel/Centrality.h"
Expand All @@ -31,7 +31,7 @@

namespace cfmcparticle
{
DECLARE_SOA_INDEX_COLUMN(CFMcCollision, cfMcCollision); //! Index to reduced MC collision

Check failure on line 34 in PWGCF/DataModel/CorrelationsDerived.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(Pt, pt, float); //! pT (GeV/c)
DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity
DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi angle
Expand All @@ -48,7 +48,7 @@

namespace cfcollision
{
DECLARE_SOA_INDEX_COLUMN(CFMcCollision, cfMcCollision); //! Index to reduced MC collision

Check failure on line 51 in PWGCF/DataModel/CorrelationsDerived.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(Multiplicity, multiplicity, float); //! Centrality/multiplicity value
} // namespace cfcollision
DECLARE_SOA_TABLE(CFCollisions, "AOD", "CFCOLLISION", //! Reduced collision table
Expand All @@ -64,8 +64,8 @@

namespace cfeventshape
{
DECLARE_SOA_INDEX_COLUMN(CFCollision, cfCollision); //! Index to collision

Check failure on line 67 in PWGCF/DataModel/CorrelationsDerived.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(Spherocity, spherocity, float); //! Spherocity
DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity
} // namespace cfeventshape
DECLARE_SOA_TABLE(CFEventShapes, "AOD", "CFEVENTSHAPE", //! Event shape table
o2::soa::Index<>,
Expand All @@ -74,8 +74,8 @@

namespace cftrack
{
DECLARE_SOA_INDEX_COLUMN(CFCollision, cfCollision); //! Index to collision

Check failure on line 77 in PWGCF/DataModel/CorrelationsDerived.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(CFMcParticle, cfMCParticle); //! Index to MC particle

Check failure on line 78 in PWGCF/DataModel/CorrelationsDerived.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(Pt, pt, float); //! pT (GeV/c)
DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity
DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi angle
Expand Down Expand Up @@ -137,7 +137,7 @@

namespace cf2prongtrack
{
DECLARE_SOA_INDEX_COLUMN_FULL(CFTrackProng0, cfTrackProng0, int, CFTracks, "_0"); //! Index to prong 1 CFTrack

Check failure on line 140 in PWGCF/DataModel/CorrelationsDerived.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_FULL(CFTrackProng1, cfTrackProng1, int, CFTracks, "_1"); //! Index to prong 2 CFTrack
DECLARE_SOA_COLUMN(Pt, pt, float); //! pT (GeV/c)
DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity
Expand Down
68 changes: 39 additions & 29 deletions PWGCF/TableProducer/filterCorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,13 @@ struct EventShapeProducer {
O2_DEFINE_CONFIGURABLE(AbsEtaTrack, float, 0.8, "Maximum |eta| of tracks required to estimate spherocity");
O2_DEFINE_CONFIGURABLE(usePtWeighted, bool, false, "Use pt-weighted spherocity");
O2_DEFINE_CONFIGURABLE(outputQAHistos, bool, false, "Whether to output QA histograms for spherocity");

HistogramRegistry QAhistos{"QAhistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
HistogramRegistry QAhistosCent{"QAhistosCent", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
HistogramRegistry QAhistosSpherocity{"QAhistosSpherocity", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};

std::vector<float> nx, ny, px, py;

void init(InitContext const&)
{
AxisSpec axisPt = {100, 0.0, 50.0};
Expand All @@ -598,10 +598,11 @@ struct EventShapeProducer {
AxisSpec axisMult = {100, 0.0, 100.0};
AxisSpec axisSpherocity = {1000, 0.0, 1.0};

QAhistos.add("multS0", "",{HistType::kTH2F,{axisMult, axisSpherocity}});
QAhistos.add("multS0", "", {HistType::kTH2F, {axisMult, axisSpherocity}});
QAhistos.add("spherocity", "", {HistType::kTH1F, {axisSpherocity}});

if(!outputQAHistos) return;
if (!outputQAHistos)
return;
QAhistos.add("pt", "", {HistType::kTH1F, {axisPt}});
QAhistos.add("eta", "", {HistType::kTH1F, {axisEta}});
QAhistos.add("phi", "", {HistType::kTH1F, {axisPhi}});
Expand All @@ -613,19 +614,20 @@ struct EventShapeProducer {
QAhistosCent.add("ntracks_20_40", "", {HistType::kTH1F, {axisNtracks}});
QAhistosCent.add("ntracks_40_60", "", {HistType::kTH1F, {axisNtracks}});
QAhistosCent.add("ntracks_60_100", "", {HistType::kTH1F, {axisNtracks}});

QAhistosSpherocity.add("spherocity_0_20", "", {HistType::kTH1F, {axisSpherocity}});
QAhistosSpherocity.add("spherocity_20_40", "", {HistType::kTH1F, {axisSpherocity}});
QAhistosSpherocity.add("spherocity_40_60", "", {HistType::kTH1F, {axisSpherocity}});
QAhistosSpherocity.add("spherocity_60_100", "", {HistType::kTH1F, {axisSpherocity}});
}

// Spherocity calculation based on the central barrel tracks
template<typename TTracks>
template <typename TTracks>
float CalculateSpherocity(TTracks const& tracks, bool usePtWeighted, bool outputQAHistos)
{
{
const size_t nTracks = tracks.size();
if (nTracks < static_cast<size_t>(minTracks)) return -2.0f;
if (nTracks < static_cast<size_t>(minTracks))
return -2.0f;

if (nx.size() < nTracks) {
nx.resize(nTracks);
Expand All @@ -641,10 +643,10 @@ struct EventShapeProducer {
for (auto& track : tracks) {
const float cosPhi = std::cos(track.phi());
const float sinPhi = std::sin(track.phi());

nx[idx] = cosPhi;
ny[idx] = sinPhi;

if (usePtWeighted) {
const float pt = track.pt();
px[idx] = pt * cosPhi;
Expand All @@ -664,8 +666,9 @@ struct EventShapeProducer {
idx++;
}

if (sumPt == 0.0f) return -1.5f; // no tracks -- avoid division by zero

if (sumPt == 0.0f)
return -1.5f; // no tracks -- avoid division by zero

// Validation check for non-weighted case
if (!usePtWeighted && std::abs(static_cast<float>(nTracks) - sumPt) > 0.01f) {
LOGF(info, "Spherocity calculation: number of tracks (%zu) does not match sum of pT (%f)", nTracks, sumPt);
Expand All @@ -676,35 +679,41 @@ struct EventShapeProducer {
float numerator = 0.0f;
const float nyi = ny[i];
const float nxi = nx[i];

for (size_t j = 0; j < nTracks; j++) {
numerator += std::abs(nyi * px[j] - nxi * py[j]);
}

const float sFull = std::pow(numerator / sumPt, 2);
if (sFull < retval) retval = sFull;
if (sFull < retval)
retval = sFull;
}

retval = retval * M_PI * M_PI / 4.0f; // normalization factor

if (retval < 0.0f || retval > 1.0f) {
LOGF(info, "Spherocity value is out of range: %f", retval);
return -0.5f;
}

return retval;
}//spherocity calculation ends
} // spherocity calculation ends

Filter cftrackFilter = (aod::cftrack::pt > minPtTrack) && (nabs(aod::cftrack::eta) < AbsEtaTrack);

using myCollisions = aod::CFCollisions;
using myTracks = soa::Filtered<aod::CFTracks>;

inline int getCentralityBin(float multiplicity) {
if (multiplicity < 20.0f) return 0;
else if (multiplicity < 40.0f) return 1;
else if (multiplicity < 60.0f) return 2;
else if (multiplicity < 100.0f) return 3;
inline int getCentralityBin(float multiplicity)
{
if (multiplicity < 20.0f)
return 0;
else if (multiplicity < 40.0f)
return 1;
else if (multiplicity < 60.0f)
return 2;
else if (multiplicity < 100.0f)
return 3;
return -1; // outside range
}

Expand All @@ -715,12 +724,13 @@ struct EventShapeProducer {
const float multiplicity = coll.multiplicity();
QAhistos.fill(HIST("multS0"), multiplicity, spherocity);
QAhistos.fill(HIST("spherocity"), spherocity);

if (!outputQAHistos) return;


if (!outputQAHistos)
return;

const size_t nTracks = tracks.size();
const int centralityBin = getCentralityBin(multiplicity);

QAhistos.fill(HIST("ntracks"), nTracks);
QAhistos.fill(HIST("mult"), multiplicity);

Expand Down
4 changes: 2 additions & 2 deletions PWGCF/Tasks/correlations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ struct CorrelationTask {
Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex;
// This filter is only applied to AOD
Filter collisionVertexTypeFilter = (aod::collision::flags & static_cast<uint16_t>(aod::collision::CollisionFlagsRun2::Run2VertexerTracks)) == static_cast<uint16_t>(aod::collision::CollisionFlagsRun2::Run2VertexerTracks);

Filter collisionSpherocityFilter = (aod::cfeventshape::spherocity > cfgS0CutLow) && (aod::cfeventshape::spherocity < cfgS0CutUp);

// Track filters
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true));
Filter cfTrackFilter = (nabs(aod::cftrack::eta) < cfgCutEta) && (aod::cftrack::pt > cfgCutPt) && ((aod::track::trackType & (uint8_t)cfgTrackBitMask) == (uint8_t)cfgTrackBitMask);
Expand Down
Loading