Skip to content

Commit d816a8b

Browse files
committed
Merge branch 'master' into localtestPWGUD
2 parents 80fff5f + d840208 commit d816a8b

File tree

49 files changed

+5832
-2572
lines changed

Some content is hidden

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

49 files changed

+5832
-2572
lines changed

ALICE3/Core/FastTracker.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include <vector>
13+
#include <string>
1314
#include "TMath.h"
1415
#include "TMatrixD.h"
1516
#include "TRandom.h"
@@ -214,7 +215,7 @@ float FastTracker::Dist(float z, float r)
214215
if (i == nSteps - 1)
215216
index = 1;
216217
z0 = -4 * sigmaD + i * dz0;
217-
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
218+
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * std::exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
218219
if (index != 4)
219220
index = 4;
220221
else
@@ -295,7 +296,7 @@ float FastTracker::ProbGoodChiSqHit(float radius, float searchRadiusRPhi, float
295296

296297
// function to provide a reconstructed track from a perfect input track
297298
// returns number of intercepts (generic for now)
298-
int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, float nch)
299+
int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, const float nch)
299300
{
300301
hits.clear();
301302
nIntercepts = 0;

ALICE3/Core/FastTracker.h

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <fairlogger/Logger.h> // not a system header but megalinter thinks so
1616
#include <vector>
17+
#include <string>
1718
#include "DetLayer.h"
1819
#include "ReconstructionDataFormats/Track.h"
1920

@@ -34,16 +35,38 @@ class FastTracker
3435
FastTracker();
3536
virtual ~FastTracker() {}
3637

38+
// Layer and layer configuration
3739
void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f, int type = 0);
3840
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true) const;
3941
int GetLayerIndex(const std::string name) const;
42+
void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; }
43+
void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; }
44+
void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; }
45+
void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; }
46+
void SetResolution(const std::string layerName, float resRPhi, float resZ)
47+
{
48+
SetResolutionRPhi(layerName, resRPhi);
49+
SetResolutionZ(layerName, resZ);
50+
}
4051

4152
void AddSiliconALICE3v4(std::vector<float> pixelResolution);
4253
void AddSiliconALICE3v2(std::vector<float> pixelResolution);
4354
void AddTPC(float phiResMean, float zResMean);
4455

4556
void Print();
46-
int FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, float nch);
57+
58+
/**
59+
* @brief Performs fast tracking on the input track parameters.
60+
*
61+
* Propagates the given input track through the detector layers, applying
62+
* relevant corrections and updates, and stores the result in outputTrack.
63+
*
64+
* @param inputTrack The input track parameters and covariance (const, by value).
65+
* @param outputTrack Reference to the output track parameters and covariance, to be filled.
66+
* @param nch Charged particle multiplicity (used for hit density calculations).
67+
* @return int i.e. number of intercepts (implementation-defined).
68+
*/
69+
int FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, const float nch);
4770

4871
// For efficiency calculation
4972
float Dist(float z, float radius);
@@ -53,18 +76,35 @@ class FastTracker
5376
float HitDensity(float radius);
5477
float ProbGoodChiSqHit(float radius, float searchRadiusRPhi, float searchRadiusZ);
5578

79+
// Setters and getters for configuration
80+
void SetIntegrationTime(float t) { integrationTime = t; }
81+
void SetMaxRadiusOfSlowDetectors(float r) { maxRadiusSlowDet = r; }
82+
void SetAvgRapidity(float y) { avgRapidity = y; }
83+
void SetdNdEtaCent(float d) { dNdEtaCent = d; }
84+
void SetLhcUPCscale(float s) { lhcUPCScale = s; }
85+
void SetBField(float b) { magneticField = b; }
86+
void SetMinRadTrack(float r) { fMinRadTrack = r; }
87+
void SetMagneticField(float b) { magneticField = b; }
88+
void SetApplyZacceptance(bool b) { applyZacceptance = b; }
89+
void SetApplyMSCorrection(bool b) { applyMSCorrection = b; }
90+
void SetApplyElossCorrection(bool b) { applyElossCorrection = b; }
91+
92+
// Getters for the last track
93+
int GetNIntercepts() const { return nIntercepts; }
94+
int GetNSiliconPoints() const { return nSiliconPoints; }
95+
int GetNGasPoints() const { return nGasPoints; }
96+
float GetGoodHitProb(int layer) const { return goodHitProbability[layer]; }
97+
std::size_t GetNHits() const { return hits.size(); }
98+
float GetHitX(const int i) const { return hits[i][0]; }
99+
float GetHitY(const int i) const { return hits[i][1]; }
100+
float GetHitZ(const int i) const { return hits[i][2]; }
101+
uint64_t GetCovMatOK() const { return covMatOK; }
102+
uint64_t GetCovMatNotOK() const { return covMatNotOK; }
103+
104+
private:
56105
// Definition of detector layers
57106
std::vector<DetLayer> layers;
58107
std::vector<std::vector<float>> hits; // bookkeep last added hits
59-
void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; }
60-
void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; }
61-
void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; }
62-
void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; }
63-
void SetResolution(const std::string layerName, float resRPhi, float resZ)
64-
{
65-
SetResolutionRPhi(layerName, resRPhi);
66-
SetResolutionZ(layerName, resZ);
67-
}
68108

69109
// operational
70110
bool applyZacceptance; // check z acceptance or not
@@ -87,16 +127,6 @@ class FastTracker
87127
float upcBackgroundMultiplier;
88128
float fMinRadTrack = 132.;
89129

90-
// Setters and getters
91-
void SetIntegrationTime(float t) { integrationTime = t; }
92-
void SetMaxRadiusOfSlowDetectors(float r) { maxRadiusSlowDet = r; }
93-
void SetAvgRapidity(float y) { avgRapidity = y; }
94-
void SetdNdEtaCent(float d) { dNdEtaCent = d; }
95-
void SetLhcUPCscale(float s) { lhcUPCScale = s; }
96-
void SetBField(float b) { magneticField = b; }
97-
void SetMinRadTrack(float r) { fMinRadTrack = r; }
98-
// void SetAtLeastHits(int n) { fMinRadTrack = n; }
99-
100130
uint64_t covMatOK; // cov mat has negative eigenvals
101131
uint64_t covMatNotOK; // cov mat has negative eigenvals
102132

@@ -105,7 +135,6 @@ class FastTracker
105135
int nSiliconPoints; // silicon-based space points added to track
106136
int nGasPoints; // tpc-based space points added to track
107137
std::vector<float> goodHitProbability;
108-
float GetGoodHitProb(int layer) const { return goodHitProbability[layer]; }
109138

110139
ClassDef(FastTracker, 1);
111140
};

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
// O2 includes
2222
#include "Framework/AnalysisDataModel.h"
23+
#include "Common/Core/RecoDecay.h"
2324

2425
enum a3selectionBit : uint32_t { kDCAxy = 0,
2526
kInnerTOFPion,
@@ -59,6 +60,64 @@ DECLARE_SOA_TABLE(Alice3DecayMaps, "AOD", "ALICE3DECAYMAPS",
5960

6061
using Alice3DecayMap = Alice3DecayMaps::iterator;
6162

63+
namespace a3D0meson
64+
{
65+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
66+
DECLARE_SOA_COLUMN(PxProng0, pxProng0, float); //! positive track
67+
DECLARE_SOA_COLUMN(PyProng0, pyProng0, float); //!
68+
DECLARE_SOA_COLUMN(PzProng0, pzProng0, float); //!
69+
DECLARE_SOA_COLUMN(PxProng1, pxProng1, float); //! negative track
70+
DECLARE_SOA_COLUMN(PyProng1, pyProng1, float); //!
71+
DECLARE_SOA_COLUMN(PzProng1, pzProng1, float); //!
72+
DECLARE_SOA_DYNAMIC_COLUMN(PtProng0, ptProng0, //!
73+
[](float px, float py) -> float { return RecoDecay::pt(px, py); });
74+
DECLARE_SOA_DYNAMIC_COLUMN(PtProng1, ptProng1, //!
75+
[](float px, float py) -> float { return RecoDecay::pt(px, py); });
76+
DECLARE_SOA_EXPRESSION_COLUMN(Px, px, //!
77+
float, 1.f * aod::a3D0meson::pxProng0 + 1.f * aod::a3D0meson::pxProng1);
78+
DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //!
79+
float, 1.f * aod::a3D0meson::pyProng0 + 1.f * aod::a3D0meson::pyProng1);
80+
DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //!
81+
float, 1.f * aod::a3D0meson::pzProng0 + 1.f * aod::a3D0meson::pzProng1);
82+
DECLARE_SOA_COLUMN(Pt, pt, float); //!
83+
DECLARE_SOA_COLUMN(M, m, float); //!
84+
DECLARE_SOA_DYNAMIC_COLUMN(E, e, //!
85+
[](float px, float py, float pz, double m) -> float { return RecoDecay::e(px, py, pz, m); });
86+
DECLARE_SOA_COLUMN(Eta, eta, float); //!
87+
DECLARE_SOA_COLUMN(Phi, phi, float); //!
88+
DECLARE_SOA_COLUMN(Y, y, float);
89+
} // namespace a3D0meson
90+
DECLARE_SOA_TABLE(Alice3D0Meson, "AOD", "ALICE3D0MESON", //!
91+
o2::soa::Index<>,
92+
a3D0meson::CollisionId,
93+
a3D0meson::PxProng0, a3D0meson::PyProng0, a3D0meson::PzProng0, // positive track
94+
a3D0meson::PxProng1, a3D0meson::PyProng1, a3D0meson::PzProng1, // negative track
95+
a3D0meson::PtProng0<a3D0meson::PxProng0, a3D0meson::PyProng0>,
96+
a3D0meson::PtProng1<a3D0meson::PxProng1, a3D0meson::PyProng1>,
97+
a3D0meson::Px, a3D0meson::Py, a3D0meson::Pz,
98+
a3D0meson::Pt,
99+
a3D0meson::M,
100+
a3D0meson::E<a3D0meson::Px, a3D0meson::Py, a3D0meson::Pz, a3D0meson::M>,
101+
a3D0meson::Eta,
102+
a3D0meson::Phi,
103+
a3D0meson::Y);
104+
105+
namespace a3D0Selection
106+
{
107+
DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //!
108+
DECLARE_SOA_COLUMN(IsSelD0bar, isSelD0bar, int); //!
109+
} // namespace a3D0Selection
110+
DECLARE_SOA_TABLE(Alice3D0Sel, "AOD", "ALICE3D0SEL", //!
111+
a3D0Selection::IsSelD0,
112+
a3D0Selection::IsSelD0bar);
113+
114+
namespace a3D0MCTruth
115+
{
116+
DECLARE_SOA_COLUMN(McTruthInfo, mcTruthInfo, int); //! 0 for bkg, 1 for true D0, 2 for true D0bar
117+
} // namespace a3D0MCTruth
118+
DECLARE_SOA_TABLE(Alice3D0MCTruth, "AOD", "ALICE3D0MCTRUTH", //!
119+
a3D0MCTruth::McTruthInfo); //!
120+
62121
} // namespace o2::aod
63122

64123
#endif // ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_

ALICE3/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ o2physics_add_dpl_workflow(alice3-multicharm
4545
SOURCES alice3-multicharm.cxx
4646
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
4747
COMPONENT_NAME Analysis)
48+
49+
o2physics_add_dpl_workflow(alice3-correlatorddbar
50+
SOURCES alice3-correlatorDDbar.cxx
51+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
52+
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ o2physics_add_dpl_workflow(onthefly-richpid
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
2525
COMPONENT_NAME Analysis)
2626

27-
o2physics_add_dpl_workflow(onthefly-trkpid
27+
o2physics_add_dpl_workflow(on-the-fly-tracker-pid
2828
SOURCES onTheFlyTrackerPid.cxx
2929
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
3030
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ struct OnTheFlyTracker {
423423
rand.SetSeed(seed);
424424

425425
// configure FastTracker
426-
fastTracker.magneticField = magneticField;
427-
fastTracker.applyZacceptance = fastTrackerSettings.applyZacceptance;
428-
fastTracker.applyMSCorrection = fastTrackerSettings.applyMSCorrection;
429-
fastTracker.applyElossCorrection = fastTrackerSettings.applyElossCorrection;
426+
fastTracker.SetMagneticField(magneticField);
427+
fastTracker.SetApplyZacceptance(fastTrackerSettings.applyZacceptance);
428+
fastTracker.SetApplyMSCorrection(fastTrackerSettings.applyMSCorrection);
429+
fastTracker.SetApplyElossCorrection(fastTrackerSettings.applyElossCorrection);
430430

431431
if (fastTrackerSettings.alice3detector == 0) {
432432
fastTracker.AddSiliconALICE3v2(fastTrackerSettings.pixelRes);
@@ -633,8 +633,8 @@ struct OnTheFlyTracker {
633633
nTPCHits[i] = 0;
634634
if (enableSecondarySmearing) {
635635
nHits[i] = fastTracker.FastTrack(xiDaughterTrackParCovsPerfect[i], xiDaughterTrackParCovsTracked[i], dNdEta);
636-
nSiliconHits[i] = fastTracker.nSiliconPoints;
637-
nTPCHits[i] = fastTracker.nGasPoints;
636+
nSiliconHits[i] = fastTracker.GetNSiliconPoints();
637+
nTPCHits[i] = fastTracker.GetNGasPoints();
638638

639639
if (nHits[i] < 0) { // QA
640640
histos.fill(HIST("hFastTrackerQA"), o2::math_utils::abs(nHits[i]));
@@ -645,8 +645,8 @@ struct OnTheFlyTracker {
645645
} else {
646646
continue; // extra sure
647647
}
648-
for (uint32_t ih = 0; ih < fastTracker.hits.size(); ih++) {
649-
histos.fill(HIST("hFastTrackerHits"), fastTracker.hits[ih][2], std::hypot(fastTracker.hits[ih][0], fastTracker.hits[ih][1]));
648+
for (uint32_t ih = 0; ih < fastTracker.GetNHits(); ih++) {
649+
histos.fill(HIST("hFastTrackerHits"), fastTracker.GetHitZ(ih), std::hypot(fastTracker.GetHitX(ih), fastTracker.GetHitY(ih)));
650650
}
651651
} else {
652652
isReco[i] = true;
@@ -1116,8 +1116,8 @@ struct OnTheFlyTracker {
11161116
}
11171117

11181118
// do bookkeeping of fastTracker tracking
1119-
histos.fill(HIST("hCovMatOK"), 0.0f, fastTracker.covMatNotOK);
1120-
histos.fill(HIST("hCovMatOK"), 1.0f, fastTracker.covMatOK);
1119+
histos.fill(HIST("hCovMatOK"), 0.0f, fastTracker.GetCovMatNotOK());
1120+
histos.fill(HIST("hCovMatOK"), 1.0f, fastTracker.GetCovMatOK());
11211121
} // end process
11221122
};
11231123

0 commit comments

Comments
 (0)