Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
75ab60d
Megalinter again
romainschotter Feb 12, 2024
aa86638
Megalinter again v2
romainschotter Feb 12, 2024
1c3b73a
Add TOF selections + fix generated candidates loop
romainschotter Mar 7, 2024
bbbc5c0
Fix whitespaces
romainschotter Mar 7, 2024
cba4138
Add boolean to enable/disable TPC QA plots + add centralityVsNch QA plot
romainschotter Mar 12, 2024
0c51b3b
Fix clang and whitespaces
romainschotter Mar 12, 2024
9cc5ecc
Formatting changes
romainschotter Mar 18, 2024
681436c
Please consider the following formatting changes
romainschotter Mar 18, 2024
bfc942e
Please consider the following formatting changes
romainschotter Mar 18, 2024
9409325
Remove duplicates
romainschotter Mar 26, 2024
ecd83d9
Add detector/ITS cluster map QA plots with both pos. and neg. info
romainschotter Apr 8, 2024
1f3b042
Fix whitespaces
romainschotter Apr 8, 2024
ec0c9fa
Please consider the following formatting changes
romainschotter Apr 8, 2024
71cfb2b
Please consider the following formatting changes
romainschotter Apr 8, 2024
131aa37
Add particle MC ID into the derived data + add one extra bin for det.…
romainschotter Apr 19, 2024
e157dd3
Add ITS chi2/Ncls info in derived data + add extra event selections t…
romainschotter Apr 23, 2024
e86ed08
Please consider the following whitespace changes
romainschotter Apr 23, 2024
65b5495
Please consider the following formatting changes
romainschotter Apr 23, 2024
45eda8e
Please consider the following formatting changes
romainschotter Apr 23, 2024
8337ae9
Add new converter task + fix error in filling the dautrackextra tables
romainschotter Apr 24, 2024
45a16fc
Create two separate process functions + rename converter
romainschotter Apr 24, 2024
31a40b7
Forgot to update CMakeLists file
romainschotter Apr 24, 2024
664776b
Rename and modify stradautracksconverter task + create a new converte…
romainschotter Apr 24, 2024
281fc44
Forgot to update CMakeList file
romainschotter Apr 24, 2024
bc7c245
Merge branch 'master' into master
romainschotter Apr 24, 2024
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
36 changes: 34 additions & 2 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,16 @@ namespace dautrack
{
//______________________________________________________
// Daughter track declarations for derived data analysis
DECLARE_SOA_COLUMN(ITSChi2PerNcl, itsChi2PerNcl, float); //! ITS chi2 per N cluster
DECLARE_SOA_COLUMN(DetectorMap, detectorMap, uint8_t); //! detector map for reference (see DetectorMapEnum)
DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t); //! ITS cluster sizes per layer
DECLARE_SOA_COLUMN(TPCClusters, tpcClusters, uint8_t); //! N TPC clusters
DECLARE_SOA_COLUMN(TPCCrossedRows, tpcCrossedRows, uint8_t); //! N TPC clusters

//______________________________________________________
// Daughter track MC information
DECLARE_SOA_COLUMN(ParticleMCId, particleMCId, int); //! particle MC Id

//______________________________________________________
// for extras: replicated here to ensure ease of manipulating the ITS information
// directly from the V0 extras table in simple ways for derived data as well
Expand Down Expand Up @@ -126,7 +131,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(HasTOF, hasTOF, //! Flag to check if track has a TOF
[](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::TOF; });
} // namespace dautrack

DECLARE_SOA_TABLE(DauTrackExtras, "AOD", "DAUTRACKEXTRA", //! detector properties of decay daughters
DECLARE_SOA_TABLE(DauTrackExtras_000, "AOD", "DAUTRACKEXTRA", //! detector properties of decay daughters
dautrack::DetectorMap, dautrack::ITSClusterSizes,
dautrack::TPCClusters, dautrack::TPCCrossedRows,

Expand All @@ -138,6 +143,23 @@ DECLARE_SOA_TABLE(DauTrackExtras, "AOD", "DAUTRACKEXTRA", //! detector propertie
dautrack::HasTRD<dautrack::DetectorMap>,
dautrack::HasTOF<dautrack::DetectorMap>);

DECLARE_SOA_TABLE_VERSIONED(DauTrackExtras_001, "AOD", "DAUTRACKEXTRA", 1, //! detector properties of decay daughters
dautrack::ITSChi2PerNcl,
dautrack::DetectorMap, dautrack::ITSClusterSizes,
dautrack::TPCClusters, dautrack::TPCCrossedRows,

// Dynamic columns for manipulating information
dautrack::ITSClusterMap<dautrack::ITSClusterSizes>,
dautrack::ITSNCls<dautrack::ITSClusterSizes>,
dautrack::HasITS<dautrack::DetectorMap>,
dautrack::HasTPC<dautrack::DetectorMap>,
dautrack::HasTRD<dautrack::DetectorMap>,
dautrack::HasTOF<dautrack::DetectorMap>);

DECLARE_SOA_TABLE(DauTrackMCIds, "AOD", "DAUTRACKMCID", // index table when using AO2Ds
dautrack::ParticleMCId);

using DauTrackExtras = DauTrackExtras_001;
using DauTrackExtra = DauTrackExtras::iterator;

namespace motherParticle
Expand Down Expand Up @@ -232,6 +254,7 @@ DECLARE_SOA_COLUMN(KFV0Chi2, kfV0Chi2, float); //!

//______________________________________________________
// REGULAR COLUMNS FOR V0MCCORES
DECLARE_SOA_COLUMN(ParticleIdMC, particleIdMC, int); //! V0 Particle ID
DECLARE_SOA_COLUMN(PDGCode, pdgCode, int); //! V0 PDG Code
DECLARE_SOA_COLUMN(PDGCodeMother, pdgCodeMother, int); //! V0 mother PDG code (for feeddown)
DECLARE_SOA_COLUMN(PDGCodePositive, pdgCodePositive, int); //! V0 positive prong PDG code
Expand Down Expand Up @@ -551,13 +574,21 @@ DECLARE_SOA_EXTENDED_TABLE_USER(V0fCCores, StoredV0fCCores, "V0FCCOREEXT",
DECLARE_SOA_TABLE_FULL(V0fCCovs, "V0fCCovs", "AOD", "V0FCCOVS", //! V0 covariance matrices
v0data::PositionCovMat, v0data::MomentumCovMat, o2::soa::Marker<2>);

DECLARE_SOA_TABLE(V0MCCores, "AOD", "V0MCCORE", //! MC properties of the V0 for posterior analysis
DECLARE_SOA_TABLE(V0MCCores_000, "AOD", "V0MCCORE", //! MC properties of the V0 for posterior analysis
v0data::PDGCode, v0data::PDGCodeMother,
v0data::PDGCodePositive, v0data::PDGCodeNegative,
v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC,
v0data::PxPosMC, v0data::PyPosMC, v0data::PzPosMC,
v0data::PxNegMC, v0data::PyNegMC, v0data::PzNegMC);

DECLARE_SOA_TABLE_VERSIONED(V0MCCores_001, "AOD", "V0MCCORE", 1, //! debug information
v0data::ParticleIdMC, //! MC properties of the V0 for posterior analysis
v0data::PDGCode, v0data::PDGCodeMother,
v0data::PDGCodePositive, v0data::PDGCodeNegative,
v0data::IsPhysicalPrimary, v0data::XMC, v0data::YMC, v0data::ZMC,
v0data::PxPosMC, v0data::PyPosMC, v0data::PzPosMC,
v0data::PxNegMC, v0data::PyNegMC, v0data::PzNegMC);

DECLARE_SOA_TABLE(V0MCCollRefs, "AOD", "V0MCCOLLREF", //! refers MC candidate back to proper MC Collision
o2::soa::Index<>, v0data::StraMCCollisionId, o2::soa::Marker<2>);

Expand All @@ -568,6 +599,7 @@ DECLARE_SOA_TABLE(GeAntiLambda, "AOD", "GeAntiLambda", v0data::GeneratedAntiLamb
DECLARE_SOA_TABLE(V0MCMothers, "AOD", "V0MCMOTHER", //! optional table for MC mothers
o2::soa::Index<>, v0data::MotherMCPartId);

using V0MCCores = V0MCCores_001;
using V0Index = V0Indices::iterator;
using V0Core = V0Cores::iterator;
using V0TrackX = V0TrackXs::iterator;
Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Strangeness/lambdakzeromcbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct lambdakzeromcbuilder {
lLabel, lMotherLabel);
if (populateV0MCCores) {
v0mccores(
pdgCode, pdgCodeMother, pdgCodePositive, pdgCodeNegative,
lLabel, pdgCode, pdgCodeMother, pdgCodePositive, pdgCodeNegative,
isPhysicalPrimary, xmc, ymc, zmc,
pxposmc, pyposmc, pzposmc,
pxnegmc, pynegmc, pznegmc);
Expand Down
65 changes: 44 additions & 21 deletions PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct strangederivedbuilder {
//__________________________________________________
// track extra references
Produces<aod::DauTrackExtras> dauTrackExtras; // daughter track detector properties
Produces<aod::DauTrackMCIds> dauTrackMCIds; // daughter track MC Particle ID
Produces<aod::DauTrackTPCPIDs> dauTrackTPCPIDs; // daughter track TPC PID
Produces<aod::DauTrackTOFPIDs> dauTrackTOFPIDs; // daughter track TOF PID
Produces<aod::V0Extras> v0Extras; // references DauTracks from V0s
Expand Down Expand Up @@ -449,53 +450,55 @@ struct strangederivedbuilder {
// circle back and populate actual DauTrackExtra table
for (auto const& tr : tracksExtra) {
if (trackMap[tr.globalIndex()] >= 0) {
dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(),
dauTrackExtras(tr.itsChi2NCl(),
tr.detectorMap(), tr.itsClusterSizes(),
tr.tpcNClsFound(), tr.tpcNClsCrossedRows());
}
}
// done!
}

void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, TracksWithExtra const& tracksExtra, aod::V0s const&)
template <typename V0Datas, typename CascDatas, typename KFCascDatas, typename TraCascDatas, typename tracksWithExtra>
void fillTrackExtras(V0Datas const& V0s, CascDatas const& Cascades, KFCascDatas const& KFCascades, TraCascDatas const& TraCascades, tracksWithExtra const& tracksExtra)
{
std::vector<int> trackMap(tracksExtra.size(), -1); // index -1: not used

//__________________________________________________
// mark tracks that belong to V0s
for (auto const& v0 : V0s) {
auto const& posTrack = v0.posTrack_as<TracksWithExtra>();
auto const& negTrack = v0.negTrack_as<TracksWithExtra>();
auto const& posTrack = v0.template posTrack_as<tracksWithExtra>();
auto const& negTrack = v0.template negTrack_as<tracksWithExtra>();
trackMap[posTrack.globalIndex()] = 0;
trackMap[negTrack.globalIndex()] = 0;
}

//__________________________________________________
// index tracks that belong to CascDatas
for (auto const& casc : Cascades) {
auto bachTrack = casc.bachelor_as<TracksWithExtra>();
auto posTrack = casc.posTrack_as<TracksWithExtra>();
auto negTrack = casc.negTrack_as<TracksWithExtra>();
auto bachTrack = casc.template bachelor_as<tracksWithExtra>();
auto posTrack = casc.template posTrack_as<tracksWithExtra>();
auto negTrack = casc.template negTrack_as<tracksWithExtra>();
trackMap[posTrack.globalIndex()] = 0;
trackMap[negTrack.globalIndex()] = 0;
trackMap[bachTrack.globalIndex()] = 0;
}
//__________________________________________________
// index tracks that belong to KFCascDatas
for (auto const& casc : KFCascades) {
auto bachTrack = casc.bachelor_as<TracksWithExtra>();
auto posTrack = casc.posTrack_as<TracksWithExtra>();
auto negTrack = casc.negTrack_as<TracksWithExtra>();
auto bachTrack = casc.template bachelor_as<tracksWithExtra>();
auto posTrack = casc.template posTrack_as<tracksWithExtra>();
auto negTrack = casc.template negTrack_as<tracksWithExtra>();
trackMap[posTrack.globalIndex()] = 0;
trackMap[negTrack.globalIndex()] = 0;
trackMap[bachTrack.globalIndex()] = 0;
}
//__________________________________________________
// index tracks that belong to TraCascDatas
for (auto const& casc : TraCascades) {
auto bachTrack = casc.bachelor_as<TracksWithExtra>();
auto posTrack = casc.posTrack_as<TracksWithExtra>();
auto negTrack = casc.negTrack_as<TracksWithExtra>();
auto strangeTrack = casc.strangeTrack_as<TracksWithExtra>();
auto bachTrack = casc.template bachelor_as<tracksWithExtra>();
auto posTrack = casc.template posTrack_as<tracksWithExtra>();
auto negTrack = casc.template negTrack_as<tracksWithExtra>();
auto strangeTrack = casc.template strangeTrack_as<tracksWithExtra>();
trackMap[posTrack.globalIndex()] = 0;
trackMap[negTrack.globalIndex()] = 0;
trackMap[bachTrack.globalIndex()] = 0;
Expand All @@ -513,34 +516,41 @@ struct strangederivedbuilder {
//__________________________________________________
// populate track references
for (auto const& v0 : V0s) {
auto const& posTrack = v0.posTrack_as<TracksWithExtra>();
auto const& negTrack = v0.negTrack_as<TracksWithExtra>();
auto const& posTrack = v0.template posTrack_as<tracksWithExtra>();
auto const& negTrack = v0.template negTrack_as<tracksWithExtra>();
v0Extras(trackMap[posTrack.globalIndex()],
trackMap[negTrack.globalIndex()]); // joinable with V0Datas
}
//__________________________________________________
// populate track references
for (auto const& casc : Cascades) {
auto bachTrack = casc.bachelor_as<TracksWithExtra>();
auto posTrack = casc.posTrack_as<TracksWithExtra>();
auto negTrack = casc.negTrack_as<TracksWithExtra>();
auto bachTrack = casc.template bachelor_as<tracksWithExtra>();
auto posTrack = casc.template posTrack_as<tracksWithExtra>();
auto negTrack = casc.template negTrack_as<tracksWithExtra>();
cascExtras(trackMap[posTrack.globalIndex()],
trackMap[negTrack.globalIndex()],
trackMap[bachTrack.globalIndex()]); // joinable with CascDatas
}
//__________________________________________________
// populate track references
for (auto const& casc : TraCascades) {
auto strangeTrack = casc.strangeTrack_as<TracksWithExtra>();
auto strangeTrack = casc.template strangeTrack_as<tracksWithExtra>();
straTrackExtras(trackMap[strangeTrack.globalIndex()]); // joinable with TraCascDatas
}
//__________________________________________________
// circle back and populate actual DauTrackExtra table
for (auto const& tr : tracksExtra) {
if (trackMap[tr.globalIndex()] >= 0) {
dauTrackExtras(tr.detectorMap(), tr.itsClusterSizes(),
dauTrackExtras(tr.itsChi2NCl(),
tr.detectorMap(), tr.itsClusterSizes(),
tr.tpcNClsFound(), tr.tpcNClsCrossedRows());

// if the table has MC info
if constexpr (requires { tr.mcParticle(); }) {
// do your thing with the mcParticleIds only in case the table has the MC info
dauTrackMCIds(tr.mcParticleId()); // joinable with dauTrackExtras
}

// round if requested
if (roundNSigmaVariables) {
dauTrackTPCPIDs(tr.tpcSignal(),
Expand All @@ -562,6 +572,18 @@ struct strangederivedbuilder {
// done!
}

void processTrackExtras(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join<aod::TracksIU, aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTPCFullHe, aod::TOFEvTime, aod::TOFSignal> const& tracksExtra, aod::V0s const&)
{
fillTrackExtras(V0s, Cascades, KFCascades, TraCascades, tracksExtra);
// done!
}

void processTrackExtrasMC(aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join<aod::TracksIU, aod::TracksExtra, aod::McTrackLabels, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTPCFullHe, aod::TOFEvTime, aod::TOFSignal> const& tracksExtra, aod::V0s const&)
{
fillTrackExtras(V0s, Cascades, KFCascades, TraCascades, tracksExtra);
// done!
}

void processStrangeMothers(soa::Join<aod::V0Datas, aod::McV0Labels> const& V0s, soa::Join<aod::CascDatas, aod::McCascLabels> const& Cascades, aod::McParticles const& mcParticles)
{
std::vector<int> motherReference(mcParticles.size(), -1); // index -1: not used / no reference
Expand Down Expand Up @@ -764,6 +786,7 @@ struct strangederivedbuilder {
PROCESS_SWITCH(strangederivedbuilder, processCollisionsMC, "Produce collisions (V0s + casc)", false);
PROCESS_SWITCH(strangederivedbuilder, processTrackExtrasV0sOnly, "Produce track extra information (V0s only)", true);
PROCESS_SWITCH(strangederivedbuilder, processTrackExtras, "Produce track extra information (V0s + casc)", true);
PROCESS_SWITCH(strangederivedbuilder, processTrackExtrasMC, "Produce track extra information (V0s + casc)", false);
PROCESS_SWITCH(strangederivedbuilder, processStrangeMothers, "Produce tables with mother info for V0s + casc", true);
PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkTracked, "Produce tables interconnecting cascades", false);
PROCESS_SWITCH(strangederivedbuilder, processCascadeInterlinkKF, "Produce tables interconnecting cascades", false);
Expand Down
14 changes: 12 additions & 2 deletions PWGLF/TableProducer/converters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2physics_add_dpl_workflow(stradautracksconverter
SOURCES stradautracksconverter.cxx
o2physics_add_dpl_workflow(stradautrackstofpidconverter
SOURCES stradautrackstofpidconverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(stradautracksextraconverter
SOURCES stradautracksextraconverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(strarawcentsconverter
SOURCES strarawcentsconverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(v0coresconverter
SOURCES v0coresconverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
40 changes: 40 additions & 0 deletions PWGLF/TableProducer/converters/stradautracksextraconverter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"

using namespace o2;
using namespace o2::framework;

// Converts V0 version 001 to 002
struct stradautracksextraconverter {
Produces<aod::DauTrackExtras_001> dauTrackExtras_001;

void process(aod::DauTrackExtras_000 const& dauTrackExtras_000)
{
for (auto& values : dauTrackExtras_000) {
dauTrackExtras_001(0,
values.detectorMap(),
values.itsClusterSizes(),
values.tpcClusters(),
values.tpcCrossedRows());
}
}
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<stradautracksextraconverter>(cfgc)};
}
Loading