Skip to content
Open
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
14 changes: 14 additions & 0 deletions ALICE3/DataModel/collisionAlice3.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ DECLARE_SOA_TABLE(CollisionsAlice3, "AOD", "COLLALICE3",

using CollisionAlice3 = CollisionsAlice3::iterator;

namespace mcmult_alice3
{
DECLARE_SOA_COLUMN(MultMC, multMC, int); //! Total MCTruth multiplicity
DECLARE_SOA_COLUMN(MultMC25, multMC25, int); //! MCTruth multiplicity in |eta| < 2.5
DECLARE_SOA_COLUMN(MultMC125, multMC125, int); //! MCTruth multiplicity in |eta| < 1.25
DECLARE_SOA_COLUMN(MultMC09, multMC09, int); //! MCTruth multiplicity in |eta| < 0.9
} // namespace mcmult_alice3
DECLARE_SOA_TABLE(MultsMCAlice3, "AOD", "MULTMCALICE3",
mcmult_alice3::MultMC,
mcmult_alice3::MultMC25,
mcmult_alice3::MultMC125,
mcmult_alice3::MultMC09);

using MultMCAlice3 = MultsMCAlice3::iterator;
} // namespace o2::aod

#endif // ALICE3_DATAMODEL_COLLISIONALICE3_H_
4 changes: 3 additions & 1 deletion ALICE3/DataModel/tracksAlice3.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DECLARE_SOA_COLUMN(NSiliconHits, nSiliconHits, int); //! number of silico
DECLARE_SOA_COLUMN(NTPCHits, nTPCHits, int); //! number of tpc hits
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); //! PDG code of the linked truth MC particle
DECLARE_SOA_COLUMN(TrackType, trackType, int); //! Type of the track
DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Has track contributed to the PV fit?
} // namespace track_alice3
DECLARE_SOA_TABLE(TracksAlice3, "AOD", "TRACKSALICE3",
track_alice3::IsReconstructed);
Expand All @@ -43,7 +44,8 @@ using TrackAlice3Pdg = TracksAlice3Pdg::iterator;
DECLARE_SOA_TABLE(TracksExtraA3, "AOD", "TracksExtraA3",
track_alice3::NSiliconHits,
track_alice3::NTPCHits,
track_alice3::TrackType);
track_alice3::TrackType,
track_alice3::IsPVContributor);
using TrackExtraA3 = TracksExtraA3::iterator;

namespace mcparticle_alice3
Expand Down
5 changes: 5 additions & 0 deletions ALICE3/TableProducer/CMakeLists.txt
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 ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -11,12 +11,12 @@

add_subdirectory(OTF)

o2physics_add_dpl_workflow(alice3-trackselection

Check failure on line 14 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackselection does not match its file name alice3-trackselection.cxx. (Matches alice3Trackselection.cxx.)
SOURCES alice3-trackselection.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-trackextension

Check failure on line 19 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-trackextension does not match its file name alice3-trackextension.cxx. (Matches alice3Trackextension.cxx.)
SOURCES alice3-trackextension.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)
Expand All @@ -26,12 +26,17 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-multiplicity
SOURCES alice3Multiplicity.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decaypreselector

Check failure on line 34 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decaypreselector does not match its file name alice3-decaypreselector.cxx. (Matches alice3Decaypreselector.cxx.)
SOURCES alice3-decaypreselector.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-decayfinder

Check failure on line 39 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-decayfinder does not match its file name alice3-decayfinder.cxx. (Matches alice3Decayfinder.cxx.)
SOURCES alice3-decayfinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -41,7 +46,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-correlatorddbar

Check failure on line 49 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-correlatorddbar does not match its file name alice3-correlatorDDbar.cxx. (Matches alice3Correlatorddbar.cxx.)
SOURCES alice3-correlatorDDbar.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
COMPONENT_NAME Analysis)
Expand All @@ -66,12 +71,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3-dileptonsmearing

Check failure on line 74 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3-dileptonsmearing does not match its file name alice3-dileptonsmearing.cxx. (Matches alice3Dileptonsmearing.cxx.)
SOURCES alice3-dileptonsmearing.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGEMDileptonCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(alice3strangenessfinder

Check failure on line 79 in ALICE3/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name alice3strangenessfinder does not match its file name alice3strangenessFinder.cxx. (Matches alice3strangenessfinder.cxx.)
SOURCES alice3strangenessFinder.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::ALICE3Core
COMPONENT_NAME Analysis)
Expand Down
2 changes: 1 addition & 1 deletion ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#include <TGeoGlobalMagField.h>
#include <TH1.h>
#include <TH2.h>
#include <TLorentzVector.h>

Check failure on line 80 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMCProcess.h>
#include <TMath.h>
#include <TPDGCode.h>
Expand Down Expand Up @@ -786,7 +786,7 @@
/// \param xiDecayVertex the address of the xi decay vertex
/// \param laDecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayCascade(McParticleType particle, o2::track::TrackParCov track, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& xiDecayVertex, std::vector<double>& laDecayVertex)

Check failure on line 789 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
const double uXi = rand.Uniform(0, 1);
const double ctauXi = 4.91; // cm
Expand Down Expand Up @@ -1776,7 +1776,7 @@
trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(),
trackParCov.getSigma1Pt2());
tableMcTrackLabels(trackParCov.mcLabel, 0);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType);
tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits, trackParCov.trackType, true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

shouldn't it be only if the track is a contributor?


// populate extra tables if required to do so
if (populateTracksExtra) {
Expand Down
180 changes: 180 additions & 0 deletions ALICE3/TableProducer/alice3Multiplicity.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
// Copyright 2019-2026 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.
//
/// \author Alexander Tiekoetter <alexander.tiekoetter@cern.ch>, Muenster
/// \brief Multiplicity task for ALICE3
/// \file alice3Multiplicity.cxx

#include "ALICE3/DataModel/collisionAlice3.h"
#include "ALICE3/DataModel/tracksAlice3.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/Expressions.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/HistogramSpec.h>
#include <Framework/InitContext.h>
#include <Framework/O2DatabasePDGPlugin.h>
#include <Framework/OutputObjHeader.h>
#include <Framework/runDataProcessing.h>

#include <TH1.h>

#include <cmath>
#include <cstdlib>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

using TracksAlice3 = soa::Join<aod::Tracks, aod::TracksDCA, o2::aod::TracksAlice3, aod::TracksExtraA3>;

struct Alice3Multiplicity {
Produces<aod::PVMults> multPV;
Produces<aod::MultsGlobal> multGlobal;
Produces<aod::MultsMCAlice3> multMC;

HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
Configurable<float> minEta{"minEta", -2.5f, "Minimum eta in range for global track counting"};
Configurable<float> maxEta{"maxEta", 2.5f, "Maximum eta in range for global track counting"};
Configurable<float> maxDCAxy{"maxDCAxy", 0.0025f, "Max DCAxy for global track counting"};
Configurable<float> maxDCAz{"maxDCAz", 0.0025f, "Max DCAz for global track counting"};
Configurable<int> minSiliconHits{"minSiliconHits", 5, "Minimum number of hits in silicon detector for global track counting"};
Configurable<bool> requireReconstructed{"requireReconstructed", false, "Require track to be reconstructed for global track counting"};
Configurable<bool> doQA{"doQA", true, "Fill QA histograms"};

ConfigurableAxis axisMult{"axisMult", {10000, 0, 10000}, "Reconstructed tracks"};

Service<o2::framework::O2DatabasePDG> pdg;

Filter trackFilter = (aod::track::eta >= minEta) && (aod::track::eta <= maxEta) && (nabs(aod::track::dcaXY) <= maxDCAxy) && (nabs(aod::track::dcaZ) <= maxDCAz) && (aod::track_alice3::nSiliconHits >= minSiliconHits) && (!requireReconstructed || aod::track_alice3::isReconstructed);

void init(InitContext&)
{
if (doQA) {
histos.add("multiplicity/nTracksPV", "nTracksPV", kTH1D, {axisMult});
histos.add("multiplicity/nTracksPVeta1", "nTracksPVeta1", kTH1D, {axisMult});
histos.add("multiplicity/nTracksPVetaHalf", "nTracksPVetaHalf", kTH1D, {axisMult});

histos.add("multiplicity/nTracksGlobal", "nTracksGlobal", kTH1D, {axisMult});
histos.add("multiplicity/nTracksGlobalPV", "nTracksGlobalPV", kTH1D, {axisMult});

histos.add("multiplicity/nTracksMC", "nTracksMC", kTH1D, {axisMult});
histos.add("multiplicity/nTracksMCEta25", "nTracksMCEta25", kTH1D, {axisMult});
histos.add("multiplicity/nTracksMCEta125", "nTracksMCEta125", kTH1D, {axisMult});
histos.add("multiplicity/nTracksMCEta09", "nTracksMCEta09", kTH1D, {axisMult});
}
}

void processGlobalTracks(const aod::Collision& /*collision*/, const soa::Filtered<TracksAlice3>& tracks)
{
int globalTracks = 0;
int globalTracksPV = 0;

for (const auto& track : tracks) {
++globalTracks;
if (track.isPVContributor())
++globalTracksPV;
}

if (doQA) {
histos.fill(HIST("multiplicity/nTracksGlobal"), globalTracks);
histos.fill(HIST("multiplicity/nTracksGlobalPV"), globalTracksPV);
}

multGlobal(globalTracks, globalTracksPV, 0, 0);
}

void processPV(const aod::Collision& /*collision*/, const TracksAlice3& tracks)
{
int numTracksPV = 0;
int numTracksPVeta1 = 0;
int numTracksPVetaHalf = 0;

for (const auto& track : tracks) {
if (track.isPVContributor()) {
++numTracksPV;
if (std::abs(track.eta()) < 1.0)
++numTracksPVeta1;
if (std::abs(track.eta()) < 0.5)
++numTracksPVetaHalf;
}
}

if (doQA) {
histos.fill(HIST("multiplicity/nTracksPV"), numTracksPV);
histos.fill(HIST("multiplicity/nTracksPVeta1"), numTracksPVeta1);
histos.fill(HIST("multiplicity/nTracksPVetaHalf"), numTracksPVetaHalf);
}

multPV(numTracksPV, numTracksPVeta1, numTracksPVetaHalf);
}

void processMC(aod::McCollision const& /*mcCollision*/, aod::McParticles const& mcParticles)
{
int numMCParticles = 0;
int numMCParticlesEta25 = 0;
int numMCParticlesEta125 = 0;
int numMCParticlesEta09 = 0;

for (const auto& mcParticle : mcParticles) {
if (!mcParticle.isPhysicalPrimary()) {
continue;
}

auto charge = 0.;
auto* p = pdg->GetParticle(mcParticle.pdgCode());
if (p != nullptr) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

charge = p->Charge();
}
if (std::abs(charge) < 1e-3) {
continue;
}

++numMCParticles;
if (std::abs(mcParticle.eta()) < 2.5)
++numMCParticlesEta25;
if (std::abs(mcParticle.eta()) < 1.25)
++numMCParticlesEta125;
if (std::abs(mcParticle.eta()) < 0.9)
++numMCParticlesEta09;
}

if (doQA) {
histos.fill(HIST("multiplicity/nTracksMC"), numMCParticles);
histos.fill(HIST("multiplicity/nTracksMCEta25"), numMCParticlesEta25);
histos.fill(HIST("multiplicity/nTracksMCEta125"), numMCParticlesEta125);
histos.fill(HIST("multiplicity/nTracksMCEta09"), numMCParticlesEta09);
}

multMC(numMCParticles, numMCParticlesEta25, numMCParticlesEta125, numMCParticlesEta09);
}

void processDummy(const aod::Collision&)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do you need the dummy?

{
// do nothing
}

PROCESS_SWITCH(Alice3Multiplicity, processGlobalTracks, "Process global track counter", false);
PROCESS_SWITCH(Alice3Multiplicity, processPV, "Process primary vertex contributor tracks", false);
PROCESS_SWITCH(Alice3Multiplicity, processMC, "Process MC truth information", false);
PROCESS_SWITCH(Alice3Multiplicity, processDummy, "Dummy proccess function", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<Alice3Multiplicity>(cfgc)};
}
3 changes: 2 additions & 1 deletion ALICE3/TableProducer/alice3TrackingTranslator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ struct Alice3TrackingTranslator {

tableTracksExtraA3(m_nMeasurements, // nSiliconHits (using m_nMeasurements as proxy)
0, // nTPCHits
0); // trackType
0, // trackType
false); // isPVContributor

// Fill extra track info
tableStoredTracksExtra(0.f, // TPCInnerParam
Expand Down
Loading