Skip to content

Commit c278d7a

Browse files
authored
Merge branch 'AliceO2Group:master' into jethadronBranch
2 parents 0c81527 + cafae83 commit c278d7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2593
-1046
lines changed

ALICE3/DataModel/OTFStrangeness.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,37 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES",
6565

6666
using UpgradeCascade = UpgradeCascades::iterator;
6767

68+
namespace otfv0
69+
{
70+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
71+
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
72+
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
73+
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!
74+
75+
// topo vars
76+
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
77+
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
78+
DECLARE_SOA_COLUMN(MLambda, mLambda, float);
79+
DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float);
80+
DECLARE_SOA_COLUMN(MK0, mK0, float);
81+
82+
// kinematics
83+
DECLARE_SOA_COLUMN(Pt, pt, float);
84+
85+
} // namespace otfv0
86+
DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
87+
o2::soa::Index<>,
88+
otfv0::CollisionId,
89+
otfv0::PosTrackId,
90+
otfv0::NegTrackId,
91+
otfv0::DCAV0Daughters,
92+
otfv0::V0Radius,
93+
otfv0::MLambda,
94+
otfv0::MAntiLambda,
95+
otfv0::MK0,
96+
otfv0::Pt);
97+
98+
using UpgradeV0 = UpgradeV0s::iterator;
6899
} // namespace o2::aod
69100

70101
#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 316 additions & 6 deletions
Large diffs are not rendered by default.

ALICE3/Tasks/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,8 @@ o2physics_add_dpl_workflow(alice3-pid-evaluation
7878
SOURCES alice3PidEvaluation.cxx
7979
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
8080
COMPONENT_NAME Analysis)
81+
82+
o2physics_add_dpl_workflow(alice3-strangeness
83+
SOURCES alice3-strangeness.cxx
84+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
85+
COMPONENT_NAME Analysis)
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
///
12+
/// \file alice3-strangeness.cxx
13+
///
14+
/// \brief This task produces invariant mass distributions for strange hadrons
15+
///
16+
/// \author Lucia Anna Tarasovičová, Pavol Jozef Šafárik University (SK)
17+
/// \since November 20, 2025
18+
///
19+
20+
#include "ALICE3/DataModel/OTFStrangeness.h"
21+
#include "ALICE3/DataModel/tracksAlice3.h"
22+
#include "Common/DataModel/TrackSelectionTables.h"
23+
24+
#include "Framework/AnalysisDataModel.h"
25+
#include "Framework/AnalysisTask.h"
26+
#include "Framework/runDataProcessing.h"
27+
#include <CommonConstants/MathConstants.h>
28+
#include <CommonConstants/PhysicsConstants.h>
29+
#include <DCAFitter/DCAFitterN.h>
30+
#include <DataFormatsParameters/GRPMagField.h>
31+
#include <DetectorsBase/Propagator.h>
32+
#include <DetectorsVertexing/PVertexer.h>
33+
#include <DetectorsVertexing/PVertexerHelpers.h>
34+
#include <Field/MagneticField.h>
35+
#include <Framework/AnalysisDataModel.h>
36+
#include <Framework/AnalysisTask.h>
37+
#include <Framework/HistogramRegistry.h>
38+
#include <Framework/O2DatabasePDGPlugin.h>
39+
#include <Framework/runDataProcessing.h>
40+
#include <ReconstructionDataFormats/DCA.h>
41+
#include <SimulationDataFormat/InteractionSampler.h>
42+
43+
#include <TGenPhaseSpace.h>
44+
#include <TGeoGlobalMagField.h>
45+
#include <TLorentzVector.h>
46+
#include <TPDGCode.h>
47+
#include <TRandom3.h>
48+
49+
#include <string>
50+
#include <vector>
51+
52+
using namespace o2;
53+
using namespace o2::framework;
54+
55+
using alice3tracks = soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels, aod::TracksDCA, aod::TracksExtraA3>;
56+
57+
struct alice3strangeness {
58+
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
59+
ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"};
60+
ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, ""};
61+
ConfigurableAxis axisVertexZ{"axisVertexZ", {40, -20, 20}, "vertex Z (cm)"};
62+
63+
void init(InitContext&)
64+
{
65+
histos.add("K0/hMassAllCandidates", "", kTH2D, {axisK0Mass, axisPt});
66+
histos.add("K0/hMassSelected", "", kTH2D, {axisK0Mass, axisPt});
67+
histos.add("K0/hSelections", "", kTH1D, {{10, 0, 10}});
68+
histos.add("K0/hDCANegDaughter", "", kTH1D, {{200, -5, 5}});
69+
histos.add("K0/hDCAPosDaughter", "", kTH1D, {{200, -5, 5}});
70+
histos.add("hPVz", "hPVz", kTH1F, {axisVertexZ});
71+
}
72+
long int nEvents = 0;
73+
void process(aod::Collisions const& collisions, aod::McCollisions const& mcCollisions, aod::UpgradeV0s const& v0Recos, alice3tracks const&)
74+
{
75+
LOG(info) << "Event processed " << nEvents++ << " :" << collisions.size() << " " << mcCollisions.size();
76+
for (const auto& collision : collisions) {
77+
float collisionZ = collision.posZ();
78+
// std::cout << "______ process V0_______" << collision.size() << std::endl;
79+
histos.fill(HIST("hPVz"), collisionZ);
80+
for (const auto& v0Cand : v0Recos) {
81+
82+
auto negV0Daughter = v0Cand.negTrack_as<alice3tracks>(); // de-reference neg track
83+
auto posV0Daughter = v0Cand.posTrack_as<alice3tracks>(); // de-reference pos track
84+
85+
bool isK0 = v0Cand.mK0() > 0;
86+
if (isK0) {
87+
histos.fill(HIST("K0/hMassAllCandidates"), v0Cand.mK0(), v0Cand.pt());
88+
histos.fill(HIST("K0/hSelections"), 0); // all candidates
89+
histos.fill(HIST("K0/hDCANegDaughter"), negV0Daughter.dcaXY());
90+
histos.fill(HIST("K0/hDCAPosDaughter"), posV0Daughter.dcaXY());
91+
if (std::abs(negV0Daughter.dcaXY()) < 0.05)
92+
continue;
93+
histos.fill(HIST("K0/hSelections"), 1); // dcaXY cut
94+
if (std::abs(posV0Daughter.dcaXY()) < 0.05)
95+
continue;
96+
histos.fill(HIST("K0/hSelections"), 2); // dcaXY cut
97+
if (v0Cand.dcaV0Daughters() > 1.0)
98+
continue;
99+
histos.fill(HIST("K0/hSelections"), 3); // dca between daughters
100+
if (v0Cand.v0Radius() < 0.5)
101+
continue;
102+
histos.fill(HIST("K0/hSelections"), 4); // radius cut
103+
if (std::abs(negV0Daughter.eta()) > 0.8 || std::abs(posV0Daughter.eta()) > 0.8)
104+
continue;
105+
histos.fill(HIST("K0/hSelections"), 5); // eta cut
106+
histos.fill(HIST("K0/hMassSelected"), v0Cand.mK0(), v0Cand.pt());
107+
}
108+
}
109+
}
110+
}
111+
PROCESS_SWITCH(alice3strangeness, process, "", true);
112+
};
113+
114+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
115+
{
116+
return WorkflowSpec{
117+
adaptAnalysisTask<alice3strangeness>(cfgc)};
118+
}

Common/Core/FFitWeights.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ void FFitWeights::fillWeights(float centrality, float qn, int nh, const char* pf
104104
th2->Fill(centrality, qn);
105105
};
106106

107-
void FFitWeights::fillPt(float centrality, float pt, bool first)
107+
void FFitWeights::fillPt(float centrality, float pt, float weight, bool first)
108108
{
109109
if (first) {
110-
ptProfCent->Fill(centrality, pt);
110+
ptProfCent->Fill(centrality, pt, weight);
111111
} else {
112-
h2ptCent->Fill(centrality, pt);
112+
h2ptCent->Fill(centrality, pt, weight);
113113
}
114114
};
115115
float FFitWeights::getPtMult(float centrality)

Common/Core/FFitWeights.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FFitWeights : public TNamed
4141

4242
void init();
4343
void fillWeights(float centrality, float qn, int nh, const char* pf = "");
44-
void fillPt(float centrality, float pt, bool first);
44+
void fillPt(float centrality, float pt, float weight, bool first);
4545
float getPtMult(float centrality);
4646
TObjArray* getDataArray() { return fW_data; }
4747

Common/TableProducer/eseTableProducer.cxx

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ struct EseTableProducer {
105105

106106
Service<o2::ccdb::BasicCCDBManager> ccdb;
107107

108+
struct Config {
109+
TH1D* mEfficiency = nullptr;
110+
bool correctionsLoaded = false;
111+
} cfg;
112+
108113
Configurable<float> cfgVtxZ{"cfgVtxZ", 10.0f, "max z vertex position"};
109114
Configurable<float> cfgEta{"cfgEta", 0.8f, "max eta"};
110115
Configurable<float> cfgPtmin{"cfgPtmin", 0.2f, "min pt"};
111116
Configurable<float> cfgPtmax{"cfgPtmax", 5.0f, "max pt"};
112117
Configurable<float> cfgChi2PrITSCls{"cfgChi2PrITSCls", 4.0f, "max chi2 per ITS cluster"};
113118
Configurable<float> cfgChi2PrTPCCls{"cfgChi2PrTPCCls", 2.5f, "max chi2 per TPC cluster"};
114119
Configurable<float> cfgDCAz{"cfgDCAz", 2.0f, "max DCAz cut"};
120+
Configurable<std::string> cfgEfficiency{"cfgEfficiency", "", "CCDB path to efficiency object"};
115121

116122
// o2::framework::expressions::Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ;
117123
o2::framework::expressions::Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == static_cast<uint8_t>(true))) && (aod::track::itsChi2NCl < cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgDCAz;
@@ -158,6 +164,14 @@ struct EseTableProducer {
158164
LOGF(fatal, "failed loading qSelection with ese flag");
159165
LOGF(info, "successfully loaded qSelection");
160166
}
167+
if (!cfgEfficiency.value.empty()) {
168+
cfg.mEfficiency = ccdb->getForTimeStamp<TH1D>(cfgEfficiency, timestamp);
169+
if (cfg.mEfficiency == nullptr) {
170+
LOGF(fatal, "Could not load efficiency histogram from %s", cfgEfficiency.value.c_str());
171+
}
172+
LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency);
173+
cfg.correctionsLoaded = true;
174+
}
161175
}
162176

163177
float calcRedqn(const float& Qx, const float& Qy, const float& Mult)
@@ -256,17 +270,32 @@ struct EseTableProducer {
256270
};
257271

258272
template <typename TTracks, typename Cent>
259-
double calculateMeanPt(TTracks const& tracks, Cent const& centrality)
273+
std::pair<double, double> calculateMeanPt(TTracks const& tracks, Cent const& centrality)
260274
{
261-
std::vector<double> meanPtEvent;
275+
double meanPtEvent{0.0};
276+
double effEvent{0.0};
262277
for (const auto& track : tracks) {
263-
meanPtEvent.push_back(track.pt());
264-
weightsFFit->fillPt(centrality, track.pt(), true);
278+
double weff = getEfficiency(track);
279+
effEvent += weff;
280+
meanPtEvent += track.pt() * weff;
265281
}
266-
if (meanPtEvent.empty())
267-
return 0.0;
268-
auto mean = std::accumulate(meanPtEvent.begin(), meanPtEvent.end(), 0.0) / meanPtEvent.size();
269-
return mean;
282+
if (meanPtEvent == 0.0)
283+
return std::make_pair(0.0, 0.0);
284+
double mean = meanPtEvent / effEvent;
285+
weightsFFit->fillPt(centrality, mean, effEvent, true);
286+
return std::make_pair(mean, effEvent);
287+
}
288+
289+
template <typename TTrack>
290+
double getEfficiency(TTrack track)
291+
{
292+
double eff = 1.;
293+
if (cfg.mEfficiency)
294+
eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt()));
295+
if (eff == 0)
296+
return -1.;
297+
else
298+
return 1. / eff;
270299
}
271300

272301
void processESE(CollWithMults::iterator const& collision, aod::BCsWithTimestamps const&, aod::FV0As const&, aod::FT0s const&)
@@ -319,11 +348,11 @@ struct EseTableProducer {
319348
registry.fill(HIST("hMeanPtStat"), 1.5);
320349
} else {
321350
const auto avgpt = eventShape->getPtMult(centrality);
322-
if (mean == 0.0) {
351+
if (mean.first == 0.0) {
323352
registry.fill(HIST("hMeanPtStat"), cfgMeanPt == Step1 ? 2.5 : 3.5);
324353
} else {
325-
const auto binval = (mean - avgpt) / avgpt;
326-
weightsFFit->fillPt(centrality, binval, false);
354+
const auto binval = (mean.first - avgpt) / avgpt;
355+
weightsFFit->fillPt(centrality, binval, mean.second, false);
327356
meanPt[0] = binval;
328357
if (cfgMeanPt == Step1) {
329358
registry.fill(HIST("hMeanPtStat"), 2.5);

0 commit comments

Comments
 (0)