Skip to content

Commit 8308a2f

Browse files
authored
Merge branch 'master' into njacazio-patch-clean-pidresponse
2 parents bc4d8d5 + 32e844a commit 8308a2f

File tree

96 files changed

+10229
-4517
lines changed

Some content is hidden

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

96 files changed

+10229
-4517
lines changed

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v9.2.0
41+
uses: oxsecurity/megalinter@v9.3.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,16 @@ namespace a3_mc_truth
389389
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int); //!
390390
DECLARE_SOA_COLUMN(BHadMotherPtRec, bHadMotherPtRec, float); //!
391391
DECLARE_SOA_COLUMN(FlagMcRec, flagMcRec, int); //!
392+
DECLARE_SOA_COLUMN(ParticleMcRec, particleMcRec, int); //!
392393
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int); //!
393394
DECLARE_SOA_COLUMN(BHadMotherPtGen, bHadMotherPtGen, float); //!
394395
DECLARE_SOA_COLUMN(FlagMcGen, flagMcGen, int); //!
395396
} // namespace a3_mc_truth
396397
DECLARE_SOA_TABLE(Alice3McRecFlags, "AOD", "ALICE3MCRECFLAG", //!
397398
a3_mc_truth::OriginMcRec,
398399
a3_mc_truth::BHadMotherPtRec,
399-
a3_mc_truth::FlagMcRec);
400+
a3_mc_truth::FlagMcRec,
401+
a3_mc_truth::ParticleMcRec);
400402

401403
DECLARE_SOA_TABLE(Alice3McGenFlags, "AOD", "ALICE3MCGENFLAG", //!
402404
a3_mc_truth::OriginMcGen,

ALICE3/DataModel/OTFStrangeness.h

Lines changed: 160 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define ALICE3_DATAMODEL_OTFSTRANGENESS_H_
2121

2222
// O2 includes
23+
#include "Common/Core/RecoDecay.h"
24+
2325
#include "Framework/AnalysisDataModel.h"
2426

2527
namespace o2::aod
@@ -33,8 +35,8 @@ DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg");
3335
DECLARE_SOA_INDEX_COLUMN_FULL(BachTrack, bachTrack, int, Tracks, "_Bach"); //!
3436

3537
// topo vars
36-
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
37-
DECLARE_SOA_COLUMN(DCACascadeDaughters, dcaCascadeDaughters, float);
38+
DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float);
39+
DECLARE_SOA_COLUMN(DcaCascadeDaughters, dcaCascadeDaughters, float);
3840
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
3941
DECLARE_SOA_COLUMN(CascRadius, cascRadius, float);
4042
DECLARE_SOA_COLUMN(CascRadiusMC, cascRadiusMC, float);
@@ -53,8 +55,8 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES",
5355
otfcascade::PosTrackId,
5456
otfcascade::NegTrackId,
5557
otfcascade::BachTrackId,
56-
otfcascade::DCAV0Daughters,
57-
otfcascade::DCACascadeDaughters,
58+
otfcascade::DcaV0Daughters,
59+
otfcascade::DcaCascadeDaughters,
5860
otfcascade::V0Radius,
5961
otfcascade::CascRadius,
6062
otfcascade::CascRadiusMC,
@@ -70,10 +72,10 @@ namespace otfv0
7072
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
7173
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
7274
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
73-
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!
75+
DECLARE_SOA_INDEX_COLUMN(V0, v0); //! index of the mc particle corresponding to the V0
7476

7577
// topo vars
76-
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
78+
DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float);
7779
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
7880
DECLARE_SOA_COLUMN(MLambda, mLambda, float);
7981
DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float);
@@ -86,16 +88,166 @@ DECLARE_SOA_COLUMN(Pt, pt, float);
8688
DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
8789
o2::soa::Index<>,
8890
otfv0::CollisionId,
91+
otfv0::V0Id,
8992
otfv0::PosTrackId,
9093
otfv0::NegTrackId,
91-
otfv0::DCAV0Daughters,
94+
otfv0::DcaV0Daughters,
9295
otfv0::V0Radius,
9396
otfv0::MLambda,
9497
otfv0::MAntiLambda,
9598
otfv0::MK0,
9699
otfv0::Pt);
97100

98101
using UpgradeV0 = UpgradeV0s::iterator;
99-
} // namespace o2::aod
100102

103+
namespace candidatev0
104+
{
105+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
106+
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
107+
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
108+
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!
109+
110+
// Label to MC particle
111+
DECLARE_SOA_INDEX_COLUMN_FULL(McParticle, mcParticle, int, McParticles, ""); //! label to the MC particle corresponding to the V0
112+
113+
// General V0 properties: position, momentum
114+
DECLARE_SOA_COLUMN(PosX, posX, float); //! positive track X at min
115+
DECLARE_SOA_COLUMN(NegX, negX, float); //! negative track X at min
116+
DECLARE_SOA_COLUMN(PxPos, pxPos, float); //! positive track px at min
117+
DECLARE_SOA_COLUMN(PyPos, pyPos, float); //! positive track py at min
118+
DECLARE_SOA_COLUMN(PzPos, pzPos, float); //! positive track pz at min
119+
DECLARE_SOA_COLUMN(PxNeg, pxNeg, float); //! negative track px at min
120+
DECLARE_SOA_COLUMN(PyNeg, pyNeg, float); //! negative track py at min
121+
DECLARE_SOA_COLUMN(PzNeg, pzNeg, float); //! negative track pz at min
122+
DECLARE_SOA_COLUMN(X, x, float); //! decay position X
123+
DECLARE_SOA_COLUMN(Y, y, float); //! decay position Y
124+
DECLARE_SOA_COLUMN(Z, z, float); //! decay position Z
125+
126+
// topo vars
127+
DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float);
128+
DECLARE_SOA_COLUMN(CosPA, cosPA, float);
129+
DECLARE_SOA_COLUMN(DcaPosToPV, dcaPosToPV, float);
130+
DECLARE_SOA_COLUMN(DcaNegToPV, dcaNegToPV, float);
131+
DECLARE_SOA_COLUMN(DcaV0ToPV, dcaV0ToPV, float);
132+
133+
//______________________________________________________
134+
// DYNAMIC COLUMNS
135+
136+
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! V0 px
137+
[](float pxPos, float pxNeg) -> float { return pxPos + pxNeg; });
138+
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! V0 py
139+
[](float pyPos, float pyNeg) -> float { return pyPos + pyNeg; });
140+
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! V0 pz
141+
[](float pzPos, float pzNeg) -> float { return pzPos + pzNeg; });
142+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! Transverse momentum in GeV/c
143+
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float {
144+
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg);
145+
});
146+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c
147+
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
148+
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
149+
});
150+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi)
151+
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float { return RecoDecay::phi(pxPos + pxNeg, pyPos + pyNeg); });
152+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! Pseudorapidity, conditionally defined to avoid FPEs
153+
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
154+
return RecoDecay::eta(std::array{pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg});
155+
});
156+
// Length quantities
157+
DECLARE_SOA_DYNAMIC_COLUMN(V0radius, v0radius, //! V0 decay radius (2D, centered at zero)
158+
[](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); });
159+
160+
// Distance Over To Mom
161+
DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distOverTotMom, //! PV to V0decay distance over total momentum
162+
[](float X, float Y, float Z, float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg, float pvX, float pvY, float pvZ) {
163+
float p = RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
164+
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (p + 1E-10);
165+
});
166+
167+
// Armenteros-Podolanski variables
168+
DECLARE_SOA_DYNAMIC_COLUMN(Alpha, alpha, //! Armenteros Alpha
169+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
170+
float momTot = RecoDecay::p(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
171+
float lQlNeg = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
172+
float lQlPos = RecoDecay::dotProd(std::array{pxpos, pypos, pzpos}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
173+
return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0
174+
});
175+
176+
DECLARE_SOA_DYNAMIC_COLUMN(QtArm, qtArm, //! Armenteros Qt
177+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
178+
float momTot = RecoDecay::p2(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
179+
float dp = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg});
180+
return std::sqrt(RecoDecay::p2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm
181+
});
182+
// Mass assumption
183+
DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! mass under lambda hypothesis
184+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
185+
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
186+
});
187+
DECLARE_SOA_DYNAMIC_COLUMN(MAntiLambda, mAntiLambda, //! mass under antilambda hypothesis
188+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
189+
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton});
190+
});
191+
DECLARE_SOA_DYNAMIC_COLUMN(MK0Short, mK0Short, //! mass under K0short hypothesis
192+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
193+
return RecoDecay::m(std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged});
194+
});
195+
// Rapidity
196+
DECLARE_SOA_DYNAMIC_COLUMN(YK0Short, yK0Short, //! V0 y with K0short hypothesis
197+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
198+
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassKaonNeutral);
199+
});
200+
DECLARE_SOA_DYNAMIC_COLUMN(YLambda, yLambda, //! V0 y with lambda or antilambda hypothesis
201+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
202+
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassLambda);
203+
});
204+
// Daughter track momenta
205+
DECLARE_SOA_DYNAMIC_COLUMN(NegativePt, negativePt, //! negative daughter pT
206+
[](float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares(pxneg, pyneg); });
207+
DECLARE_SOA_DYNAMIC_COLUMN(PositivePt, positivePt, //! positive daughter pT
208+
[](float pxpos, float pypos) -> float { return RecoDecay::sqrtSumOfSquares(pxpos, pypos); });
209+
DECLARE_SOA_DYNAMIC_COLUMN(NegativeEta, negativeEta, //! negative daughter eta
210+
[](float PxNeg, float PyNeg, float PzNeg) -> float { return RecoDecay::eta(std::array{PxNeg, PyNeg, PzNeg}); });
211+
DECLARE_SOA_DYNAMIC_COLUMN(NegativePhi, negativePhi, //! negative daughter phi
212+
[](float PxNeg, float PyNeg) -> float { return RecoDecay::phi(PxNeg, PyNeg); });
213+
DECLARE_SOA_DYNAMIC_COLUMN(PositiveEta, positiveEta, //! positive daughter eta
214+
[](float PxPos, float PyPos, float PzPos) -> float { return RecoDecay::eta(std::array{PxPos, PyPos, PzPos}); });
215+
DECLARE_SOA_DYNAMIC_COLUMN(PositivePhi, positivePhi, //! positive daughter phi
216+
[](float PxPos, float PyPos) -> float { return RecoDecay::phi(PxPos, PyPos); });
217+
} // namespace candidatev0
218+
DECLARE_SOA_TABLE(V0CandidateIndices, "AOD", "V0CANDIDATEINDEX", //! index table
219+
o2::soa::Index<>, candidatev0::CollisionId, candidatev0::PosTrackId, candidatev0::NegTrackId, candidatev0::McParticleId);
220+
221+
DECLARE_SOA_TABLE(V0CandidateCores, "AOD", "V0CANDIDATECORE",
222+
o2::soa::Index<>,
223+
candidatev0::X, candidatev0::Y, candidatev0::Z,
224+
candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos,
225+
candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg,
226+
candidatev0::DcaV0Daughters, candidatev0::DcaPosToPV, candidatev0::DcaNegToPV,
227+
candidatev0::CosPA, candidatev0::DcaV0ToPV,
228+
candidatev0::Px<candidatev0::PxPos, candidatev0::PxNeg>,
229+
candidatev0::Py<candidatev0::PyPos, candidatev0::PyNeg>,
230+
candidatev0::Pz<candidatev0::PzPos, candidatev0::PzNeg>,
231+
candidatev0::Pt<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
232+
candidatev0::P<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
233+
candidatev0::Phi<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
234+
candidatev0::Eta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
235+
candidatev0::V0radius<candidatev0::X, candidatev0::Y>,
236+
candidatev0::DistOverTotMom<candidatev0::X, candidatev0::Y, candidatev0::Z, candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
237+
candidatev0::Alpha<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
238+
candidatev0::QtArm<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
239+
candidatev0::MLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
240+
candidatev0::MAntiLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
241+
candidatev0::MK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
242+
candidatev0::YK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
243+
candidatev0::YLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
244+
candidatev0::NegativePt<candidatev0::PxNeg, candidatev0::PyNeg>,
245+
candidatev0::PositivePt<candidatev0::PxPos, candidatev0::PyPos>,
246+
candidatev0::NegativeEta<candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
247+
candidatev0::NegativePhi<candidatev0::PxNeg, candidatev0::PyNeg>,
248+
candidatev0::PositiveEta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos>,
249+
candidatev0::PositivePhi<candidatev0::PxPos, candidatev0::PyPos>);
250+
251+
using V0CandidateCore = V0CandidateCores::iterator;
252+
} // namespace o2::aod
101253
#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_

ALICE3/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,8 @@ o2physics_add_dpl_workflow(alice3-tracking-translator
6060
SOURCES alice3TrackingTranslator.cxx
6161
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
6262
COMPONENT_NAME Analysis)
63+
64+
o2physics_add_dpl_workflow(alice3strangenessfinder
65+
SOURCES alice3strangenessFinder.cxx
66+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
67+
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020

2121
#include <CCDB/BasicCCDBManager.h>
2222
#include <Framework/AnalysisTask.h>
23+
#include <Framework/HistogramRegistry.h>
2324
#include <Framework/runDataProcessing.h>
2425

2526
#include <map>
2627
#include <string>
2728
#include <vector>
2829

2930
struct OnTheFlyDetectorGeometryProvider {
30-
31+
o2::framework::HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
3132
o2::framework::Configurable<std::vector<std::string>> detectorConfiguration{"detectorConfiguration",
3233
std::vector<std::string>{"$O2PHYSICS_ROOT/share/alice3/a3geometry_v3.ini"},
3334
"Paths of the detector geometry configuration files"};
@@ -45,6 +46,7 @@ struct OnTheFlyDetectorGeometryProvider {
4546
int idx = 0;
4647
for (auto& configFile : detectorConfiguration.value) {
4748
LOG(info) << "Loading detector geometry from configuration file: " << configFile;
49+
histos.add<TH1>(Form("GeometryConfigFile_%d", idx), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5);
4850
// If the filename starts with ccdb: then take the file from the ccdb
4951
if (configFile.rfind("ccdb:", 0) == 0) {
5052
std::string ccdbPath = configFile.substr(5); // remove "ccdb:" prefix
@@ -75,10 +77,12 @@ struct OnTheFlyDetectorGeometryProvider {
7577
LOG(fatal) << "Inconsistent magnetic field values between configurations 0 and " << icfg << ": " << mMagneticField << " vs " << cfgBfield;
7678
}
7779
}
80+
LOG(info) << "Initialization completed";
7881
}
7982

80-
void process(o2::aod::McCollisions const&)
83+
void process(o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles)
8184
{
85+
LOG(info) << "On-the-fly detector geometry provider processing " << mcCollisions.size() << " collisions and " << mcParticles.size() << " particles.";
8286
}
8387
};
8488

0 commit comments

Comments
 (0)