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
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreator2Prong.cxx
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 warning on line 1 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.

Check warning on line 1 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

Declare struct members in the conventional order. See the PWGHF coding guidelines.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -17,7 +17,7 @@
/// \author Pengzhong Lu <pengzhong.lu@cern.ch>, GSI Darmstadt, USTC

#ifndef HomogeneousField
#define HomogeneousField

Check warning on line 20 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/macro]

Use SCREAMING_SNAKE_CASE for names of macros. Leading and double underscores are not allowed.
#endif

#include <memory>
Expand Down Expand Up @@ -371,7 +371,7 @@
kfpVertex.SetCovarianceMatrix(rowTrackIndexProng2.pvRefitSigmaX2(), rowTrackIndexProng2.pvRefitSigmaXY(), rowTrackIndexProng2.pvRefitSigmaY2(), rowTrackIndexProng2.pvRefitSigmaXZ(), rowTrackIndexProng2.pvRefitSigmaYZ(), rowTrackIndexProng2.pvRefitSigmaZ2());
}
kfpVertex.GetCovarianceMatrix(covMatrixPV);
KFParticle KFPV(kfpVertex);

Check warning on line 374 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
registry.fill(HIST("hCovPVXX"), covMatrixPV[0]);
registry.fill(HIST("hCovPVYY"), covMatrixPV[2]);
registry.fill(HIST("hCovPVXZ"), covMatrixPV[3]);
Expand Down Expand Up @@ -691,10 +691,10 @@
using McCollisionsFT0Cs = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Cs>;
using McCollisionsFT0Ms = soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels, aod::CentFT0Ms>;
using McCollisionsCentFT0Ms = soa::Join<aod::McCollisions, aod::McCentFT0Ms>;
PresliceUnsorted<McCollisionsNoCents> colPerMcCollision = aod::mccollisionlabel::mcCollisionId;

Check warning on line 694 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfCandidateCreator2ProngExpressions: PresliceUnsorted< appears too early (before end of Preslice<).
PresliceUnsorted<McCollisionsFT0Cs> colPerMcCollisionFT0C = aod::mccollisionlabel::mcCollisionId;
PresliceUnsorted<McCollisionsFT0Ms> colPerMcCollisionFT0M = aod::mccollisionlabel::mcCollisionId;
Preslice<aod::McParticles> mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId;

Check warning on line 697 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfCandidateCreator2ProngExpressions: Preslice< appears too early (before end of using).

using BCsInfo = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels>;
HistogramRegistry registry{"registry"};
Expand Down Expand Up @@ -805,17 +805,19 @@
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down Expand Up @@ -901,6 +903,6 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<HfCandidateCreator2Prong>(cfgc, TaskName{"hf-candidate-creator-2prong"}),

Check warning on line 906 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names hf-candidate-creator-2prong and hf-candidate-creator2-prong generated from the specified task name hf-candidate-creator-2prong and from the struct name HfCandidateCreator2Prong, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to HfCandidateCreator2Prong and removing TaskName.
adaptAnalysisTask<HfCandidateCreator2ProngExpressions>(cfgc, TaskName{"hf-candidate-creator-2prong-expressions"})};

Check warning on line 907 in PWGHF/TableProducer/candidateCreator2Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names hf-candidate-creator-2prong-expressions and hf-candidate-creator2-prong-expressions generated from the specified task name hf-candidate-creator-2prong-expressions and from the struct name HfCandidateCreator2ProngExpressions, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to HfCandidateCreator2ProngExpressions and removing TaskName.
}
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -684,17 +684,19 @@
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all gen particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down Expand Up @@ -829,6 +831,6 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<HfCandidateCreator3Prong>(cfgc, TaskName{"hf-candidate-creator-3prong"}),

Check warning on line 834 in PWGHF/TableProducer/candidateCreator3Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names hf-candidate-creator-3prong and hf-candidate-creator3-prong generated from the specified task name hf-candidate-creator-3prong and from the struct name HfCandidateCreator3Prong, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to HfCandidateCreator3Prong and removing TaskName.
adaptAnalysisTask<HfCandidateCreator3ProngExpressions>(cfgc, TaskName{"hf-candidate-creator-3prong-expressions"})};

Check warning on line 835 in PWGHF/TableProducer/candidateCreator3Prong.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names hf-candidate-creator-3prong-expressions and hf-candidate-creator3-prong-expressions generated from the specified task name hf-candidate-creator-3prong-expressions and from the struct name HfCandidateCreator3ProngExpressions, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to HfCandidateCreator3ProngExpressions and removing TaskName.
}
8 changes: 7 additions & 1 deletion PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
/// \author Chiara Zampolli, <Chiara.Zampolli@cern.ch>, CERN
/// Paul Buehler, <paul.buehler@oeaw.ac.at>, Vienna

#include <string>
#include <memory>
#include <vector>

#include <TPDGCode.h>

#include "CommonConstants/PhysicsConstants.h"
Expand Down Expand Up @@ -539,17 +543,19 @@ struct HfCandidateCreatorCascadeMc {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -635,17 +635,19 @@ struct HfCandidateCreatorDstarExpressions {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collInfos.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
4 changes: 3 additions & 1 deletion PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2039,17 +2039,19 @@ struct HfCandidateCreatorXic0Omegac0Mc {
// Slice the collisions table to get the collision info for the current MC collision
float centrality{-1.f};
uint16_t rejectionMask{0};
int nSplitColl = 0;
if constexpr (centEstimator == CentralityEstimator::FT0C) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0C, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::FT0M) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollisionFT0M, mcCollision.globalIndex());
nSplitColl = collSlice.size();
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
} else if constexpr (centEstimator == CentralityEstimator::None) {
const auto collSlice = collsWithMcLabels.sliceBy(colPerMcCollision, mcCollision.globalIndex());
rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask<BCsInfo, centEstimator>(mcCollision, collSlice, centrality);
}
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask);
hfEvSelMc.fillHistograms<centEstimator>(mcCollision, rejectionMask, nSplitColl);
if (rejectionMask != 0) {
/// at least one event selection not satisfied --> reject all particles from this collision
for (unsigned int i = 0; i < mcParticlesPerMcColl.size(); ++i) {
Expand Down
15 changes: 14 additions & 1 deletion PWGHF/Utils/utilsEvSelHf.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ struct HfEventSelectionMc {
// histogram names
static constexpr char nameHistGenCollisionsCent[] = "hGenCollisionsCent";
std::shared_ptr<TH1> hGenCollisionsCent;
static constexpr char nameHistRecCollisionsCentMc[] = "hRecCollisionsCentMc";
std::shared_ptr<TH1> hRecCollisionsCentMc;
static constexpr char nameHistNSplitVertices[] = "hNSplitVertices";
std::shared_ptr<TH1> hNSplitVertices;
static constexpr char nameHistParticles[] = "hParticles";
std::shared_ptr<TH1> hParticles;

Expand All @@ -353,6 +357,8 @@ struct HfEventSelectionMc {
void addHistograms(o2::framework::HistogramRegistry& registry)
{
hGenCollisionsCent = registry.add<TH1>(nameHistGenCollisionsCent, "HF event counter;T0M;# of generated collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}});
hRecCollisionsCentMc = registry.add<TH1>(nameHistRecCollisionsCentMc, "HF event counter;T0M;# of reconstructed collisions", {o2::framework::HistType::kTH1D, {{100, 0., 100.}}});
hNSplitVertices = registry.add<TH1>(nameHistNSplitVertices, "HF split vertices counter;;# of reconstructed collisions per mc collision", {o2::framework::HistType::kTH1D, {{4, 1., 5.}}});
hParticles = registry.add<TH1>(nameHistParticles, "HF particle counter;;# of accepted particles", {o2::framework::HistType::kTH1D, {axisEvents}});
// Puts labels on the collision monitoring histogram.
setEventRejectionLabels(hParticles);
Expand Down Expand Up @@ -428,7 +434,7 @@ struct HfEventSelectionMc {
/// \param collision analysed collision
/// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision
template <o2::hf_centrality::CentralityEstimator centEstimator, typename Coll>
void fillHistograms(Coll const& mcCollision, const uint16_t rejectionMask)
void fillHistograms(Coll const& mcCollision, const uint16_t rejectionMask, int nSplitColl = 0)
{
hParticles->Fill(EventRejection::None);

Expand All @@ -444,6 +450,13 @@ struct HfEventSelectionMc {
}
hParticles->Fill(reason);
}

if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) {
hNSplitVertices->Fill(nSplitColl);
for (int nColl = 0; nColl < nSplitColl; nColl++) {
hRecCollisionsCentMc->Fill(mcCollision.centFT0M());
}
}
}
};
} // namespace o2::hf_evsel
Expand Down
Loading