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
9 changes: 9 additions & 0 deletions 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 cftrack
{
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_INDEX_COLUMN(CFMcParticle, cfMCParticle); //! Index to MC particle

Check failure on line 68 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 @@ -86,6 +86,15 @@
//------transient CF-filter to CF-2prong-filter
DECLARE_SOA_TABLE(CFCollRefs, "AOD", "CFCOLLREF", o2::soa::Index<>, track::CollisionId); //! Transient cf collision index table

//------multiplicity set
namespace cfmultiplicityset
{
DECLARE_SOA_COLUMN(Multiplicities, multiplicities, std::vector<float>); //! List of auxiliary multiplicities
}
DECLARE_SOA_TABLE(CFMultiplicitySets, "AOD", "CFMULTIPLICITYSET", cfmultiplicityset::Multiplicities); //! Auxilary multiplicity set table

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember there was a maximal number of characters (14?) for the third argument. Does this work in run time? And does the table in the file has the name o2cfmultiplicitysets?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test this. I'm not able to test locally at the moment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that the name is clipped to CFMULTIPLICITYS (or o2cfmultiplicitys). It's not ideal so I'll change it in the next PR while making other fixes too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, otherwise the merging does not work

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktf @aalkin in the past this (too long string in the third argument) caused a compilation error? Why is this gone?


using CFMultiplicitySet = CFMultiplicitySets::iterator;

// Reco

using CFCollRef = CFCollRefs::iterator;
Expand All @@ -111,8 +120,8 @@

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

Check failure on line 123 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

Check failure on line 124 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
33 changes: 33 additions & 0 deletions PWGCF/TableProducer/filterCorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ struct FilterCF {
kPIDProton = BIT(1)
};

enum MultiplicityEstimators : uint8_t {
kCentFT0C = BIT(0),
kMultFV0A = BIT(1),
kMultNTracksPV = BIT(2),
kMultNTracksGlobal = BIT(3),
};

// Configuration
O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 7.0f, "Accepted z-vertex range")
O2_DEFINE_CONFIGURABLE(cfgCutPt, float, 0.5f, "Minimal pT for tracks")
Expand All @@ -90,6 +97,7 @@ struct FilterCF {
O2_DEFINE_CONFIGURABLE(tpcnclusters, int, 50, "minimum number of TPC clusters found")
O2_DEFINE_CONFIGURABLE(chi2pertpccluster, float, 2.5, "maximum Chi2 / cluster for the TPC track segment")
O2_DEFINE_CONFIGURABLE(chi2peritscluster, float, 36, "maximum Chi2 / cluster for the ITS track segment")
O2_DEFINE_CONFIGURABLE(cfgEstimatorBitMask, uint16_t, 0, "BitMask for multiplicity estimators to be included in the CFMultiplicitySet tables.");

// Filters and input definitions
Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex;
Expand Down Expand Up @@ -117,6 +125,9 @@ struct FilterCF {
Produces<aod::CFTrackRefs> outputTrackRefs;
Produces<aod::CFMcParticleRefs> outputMcParticleRefs;

Produces<aod::CFMultiplicitySets> outputMultSets;
std::vector<float> multiplicities{};

// persistent caches
std::vector<bool> mcReconstructedCache;
std::vector<int> mcParticleLabelsCache;
Expand Down Expand Up @@ -238,6 +249,9 @@ struct FilterCF {
return 0;
}

template <class T>
using HasMultTables = decltype(std::declval<T&>().multNTracksPV());

/// \brief Templetized process data for a given collision and its associated tracks
/// \param collision The collision object containing information about the collision
/// \param tracks The collection of tracks associated with the collision
Expand All @@ -255,6 +269,19 @@ struct FilterCF {
auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
outputCollisions(bc.runNumber(), collision.posZ(), collision.multiplicity(), bc.timestamp());

if constexpr (std::experimental::is_detected<HasMultTables, typename T1::iterator>::value) {
multiplicities.clear();
if (cfgEstimatorBitMask & kCentFT0C)
multiplicities.push_back(collision.centFT0C());
if (cfgEstimatorBitMask & kMultFV0A)
multiplicities.push_back(collision.multFV0A());
if (cfgEstimatorBitMask & kMultNTracksPV)
multiplicities.push_back(collision.multNTracksPV());
if (cfgEstimatorBitMask & kMultNTracksGlobal)
multiplicities.push_back(collision.multNTracksGlobal());
outputMultSets(multiplicities);
}

Comment on lines +272 to +284

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not matter much but in principle this code could be in processDataMults. Nothing should speak against filling one table there and the then one would not need the HasMultTables, or am missing something?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the keepCollision in processDataT? Somehow the multiplicity tables would need to stay synced so they can then ultimately be joined with the collision output table.

if (cfgTransientTables)
outputCollRefs(collision.globalIndex());
for (auto& track : tracks) {
Expand Down Expand Up @@ -283,6 +310,12 @@ struct FilterCF {
}
PROCESS_SWITCH(FilterCF, processDataPid, "Process data with PID", false);

void processDataMults(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CFMultiplicities, aod::CentFT0Cs, aod::PVMults, aod::FV0Mults, aod::MultsGlobal>>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA>> const& tracks)
{
processDataT(collision, tracks);
}
PROCESS_SWITCH(FilterCF, processDataMults, "Process data with multiplicity sets", false);

/// \brief Process MC data for a given set of MC collisions and associated particles and tracks
/// \param mcCollisions The collection of MC collisions
/// \param allParticles The collection of all MC particles
Expand Down
Loading