Skip to content

Commit 64765cb

Browse files
Merge branch 'AliceO2Group:master' into debadatta
2 parents 894ab9a + 668665a commit 64765cb

File tree

174 files changed

+20284
-9014
lines changed

Some content is hidden

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

174 files changed

+20284
-9014
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Dependabot configuration
3+
# Reference: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "github-actions" # See documentation for possible values
8+
directory: "/" # Location of package manifests
9+
schedule:
10+
interval: "weekly"

.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@v8.4.2
41+
uses: oxsecurity/megalinter@v8.5.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
stale:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v1
15+
- uses: actions/stale@v9
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
stale-pr-message: 'This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.'

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- repo: https://github.com/pre-commit/mirrors-clang-format
10-
rev: "v18.1.3" # clang-format version
10+
rev: v18.1.3 # clang-format version
1111
hooks:
1212
- id: clang-format
13+
- repo: https://github.com/cpplint/cpplint
14+
rev: 2.0.0
15+
hooks:
16+
- id: cpplint

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ struct OnTheFlyTracker {
323323
histos.add("h2dVerticesVsContributors", "h2dVerticesVsContributors", kTH2F, {axes.axisMultiplicity, axes.axisNVertices});
324324
histos.add("hRecoVsSimMultiplicity", "hRecoVsSimMultiplicity", kTH2F, {axes.axisMultiplicity, axes.axisMultiplicity});
325325
histos.add("h2dDCAxy", "h2dDCAxy", kTH2F, {axes.axisMomentum, axes.axisDCA});
326+
histos.add("h2dDCAz", "h2dDCAz", kTH2F, {axes.axisMomentum, axes.axisDCA});
326327

327328
histos.add("hSimTrackX", "hSimTrackX", kTH1F, {axes.axisX});
328329
histos.add("hRecoTrackX", "hRecoTrackX", kTH1F, {axes.axisX});
@@ -1042,6 +1043,7 @@ struct OnTheFlyTracker {
10421043
}
10431044
if (doExtraQA && (!extraQAwithoutDecayDaughters || (extraQAwithoutDecayDaughters && !trackParCov.isDecayDau))) {
10441045
histos.fill(HIST("h2dDCAxy"), trackParametrization.getPt(), dcaXY * 1e+4); // in microns, please
1046+
histos.fill(HIST("h2dDCAz"), trackParametrization.getPt(), dcaZ * 1e+4); // in microns, please
10451047
histos.fill(HIST("hTrackXatDCA"), trackParametrization.getX());
10461048
}
10471049
if (cascadeDecaySettings.doXiQA) {
@@ -1107,6 +1109,7 @@ struct OnTheFlyTracker {
11071109
}
11081110
if (doExtraQA && (!extraQAwithoutDecayDaughters || (extraQAwithoutDecayDaughters && !trackParCov.isDecayDau))) {
11091111
histos.fill(HIST("h2dDCAxy"), trackParametrization.getPt(), dcaXY * 1e+4); // in microns, please
1112+
histos.fill(HIST("h2dDCAz"), trackParametrization.getPt(), dcaZ * 1e+4); // in microns, please
11101113
histos.fill(HIST("hTrackXatDCA"), trackParametrization.getX());
11111114
}
11121115
tracksDCA(dcaXY, dcaZ);

ALICE3/TableProducer/alice3-multicharm.cxx

Lines changed: 105 additions & 29 deletions
Large diffs are not rendered by default.

Common/Core/fwdtrackUtilities.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ o2::dataformats::GlobalFwdTrack propagateMuon(TFwdTrack const& muon, TCollision
5959

6060
if (endPoint == propagationPoint::kToVertex) {
6161
o2::mch::TrackExtrap::extrapToVertex(mchTrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY());
62-
}
63-
if (endPoint == propagationPoint::kToDCA) {
62+
} else if (endPoint == propagationPoint::kToDCA) {
6463
o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrack, collision.posZ());
65-
}
66-
if (endPoint == propagationPoint::kToRabs) {
64+
} else if (endPoint == propagationPoint::kToRabs) {
6765
o2::mch::TrackExtrap::extrapToZ(mchTrack, -505.);
6866
}
6967

@@ -77,7 +75,11 @@ o2::dataformats::GlobalFwdTrack propagateMuon(TFwdTrack const& muon, TCollision
7775
auto Bz = field->getBz(centerMFT); // Get field at centre of MFT
7876
auto geoMan = o2::base::GeometryManager::meanMaterialBudget(muon.x(), muon.y(), muon.z(), collision.posX(), collision.posY(), collision.posZ());
7977
auto x2x0 = static_cast<float>(geoMan.meanX2X0);
80-
fwdtrack.propagateToVtxhelixWithMCS(collision.posZ(), {collision.posX(), collision.posY()}, {collision.covXX(), collision.covYY()}, Bz, x2x0);
78+
if (endPoint == propagationPoint::kToVertex) {
79+
fwdtrack.propagateToVtxhelixWithMCS(collision.posZ(), {collision.posX(), collision.posY()}, {collision.covXX(), collision.covYY()}, Bz, x2x0);
80+
} else if (endPoint == propagationPoint::kToDCA) {
81+
fwdtrack.propagateToZhelix(collision.posZ(), Bz);
82+
}
8183
propmuon.setParameters(fwdtrack.getParameters());
8284
propmuon.setZ(fwdtrack.getZ());
8385
propmuon.setCovariances(fwdtrack.getCovariances());

Common/TableProducer/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ add_subdirectory(PID)
1414

1515
o2physics_add_dpl_workflow(trackextension
1616
SOURCES trackextension.cxx
17-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
17+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
1818
COMPONENT_NAME Analysis)
1919

2020
o2physics_add_dpl_workflow(trackselection
@@ -59,12 +59,12 @@ o2physics_add_dpl_workflow(ft0-corrected-table
5959

6060
o2physics_add_dpl_workflow(track-propagation
6161
SOURCES trackPropagation.cxx
62-
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
62+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
6363
COMPONENT_NAME Analysis)
6464

6565
o2physics_add_dpl_workflow(track-propagation-tester
6666
SOURCES trackPropagationTester.cxx
67-
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore O2Physics::trackSelectionRequest
67+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::trackSelectionRequest
6868
COMPONENT_NAME Analysis)
6969

7070
o2physics_add_dpl_workflow(calo-clusters
@@ -92,7 +92,7 @@ o2physics_add_dpl_workflow(fwdtrack-to-collision-associator
9292

9393
o2physics_add_dpl_workflow(mccollisionextra
9494
SOURCES mcCollsExtra.cxx
95-
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
95+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
9696
COMPONENT_NAME Analysis)
9797

9898
o2physics_add_dpl_workflow(qvector-table

Common/TableProducer/fwdtrackPropagation.cxx

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@ struct FwdTrackPropagation {
6161
Configurable<float> maxEtaSA{"maxEtaSA", -2.5, "max. eta acceptance for MCH-MID"};
6262
Configurable<float> minEtaGL{"minEtaGL", -3.6, "min. eta acceptance for MFT-MCH-MID"};
6363
Configurable<float> maxEtaGL{"maxEtaGL", -2.5, "max. eta acceptance for MFT-MCH-MID"};
64+
Configurable<float> minRabsGL{"minRabsGL", 27.6, "min. R at absorber end for global muon (min. eta = -3.6)"}; // std::tan(2.f * std::atan(std::exp(- -3.6)) ) * -505.
6465
Configurable<float> minRabs{"minRabs", 17.6, "min. R at absorber end"};
6566
Configurable<float> midRabs{"midRabs", 26.5, "middle R at absorber end for pDCA cut"};
6667
Configurable<float> maxRabs{"maxRabs", 89.5, "max. R at absorber end"};
68+
Configurable<float> maxDCAxy{"maxDCAxy", 1e+10, "max. DCAxy for global muons"};
6769
Configurable<float> maxPDCAforLargeR{"maxPDCAforLargeR", 324.f, "max. pDCA for large R at absorber end"};
6870
Configurable<float> maxPDCAforSmallR{"maxPDCAforSmallR", 594.f, "max. pDCA for small R at absorber end"};
6971
Configurable<float> maxMatchingChi2MCHMFT{"maxMatchingChi2MCHMFT", 50.f, "max. chi2 for MCH-MFT matching"};
70-
Configurable<float> maxChi2{"maxChi2", 1e+6, "max. chi2 for muon tracking"};
71-
Configurable<bool> refitGlobalMuon{"refitGlobalMuon", false, "flag to refit global muon"};
72+
Configurable<float> maxChi2SA{"maxChi2SA", 1e+6, "max. chi2 for standalone muon"};
73+
Configurable<float> maxChi2GL{"maxChi2GL", 50.f, "max. chi2 for global muon"};
74+
Configurable<bool> refitGlobalMuon{"refitGlobalMuon", true, "flag to refit global muon"};
7275

7376
HistogramRegistry fRegistry{"fRegistry"};
7477
static constexpr std::string_view muon_types[5] = {"MFTMCHMID/", "MFTMCHMIDOtherMatch/", "MFTMCH/", "MCHMID/", "MCH/"};
@@ -137,9 +140,9 @@ struct FwdTrackPropagation {
137140
fRegistry.add("MFTMCHMID/hChi2MatchMCHMID", "chi2 match MCH-MID;chi2", kTH1F, {{100, 0.0f, 100}}, false);
138141
fRegistry.add("MFTMCHMID/hChi2MatchMCHMFT", "chi2 match MCH-MFT;chi2", kTH1F, {{100, 0.0f, 100}}, false);
139142
fRegistry.add("MFTMCHMID/hMatchScoreMCHMFT", "match score MCH-MFT;score", kTH1F, {{100, 0.0f, 100}}, false);
140-
fRegistry.add("MFTMCHMID/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.1, 0.1}, {200, -0.1, +0.1}}, false);
143+
fRegistry.add("MFTMCHMID/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5, 0.5}, {200, -0.5, +0.5}}, false);
141144
fRegistry.add("MFTMCHMID/hDCAxy2DinSigma", "DCA x vs. y in sigma;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10, 10}, {200, -10, +10}}, false);
142-
fRegistry.add("MFTMCHMID/hDCAxy", "DCAxy;DCA_{xy} (cm);", kTH1F, {{100, 0, 0.1}}, false);
145+
fRegistry.add("MFTMCHMID/hDCAxy", "DCAxy;DCA_{xy} (cm);", kTH1F, {{100, 0, 1}}, false);
143146
fRegistry.add("MFTMCHMID/hDCAxyinSigma", "DCAxy in sigma;DCA_{xy} (#sigma);", kTH1F, {{100, 0, 10}}, false);
144147
fRegistry.addClone("MFTMCHMID/", "MCHMID/");
145148
fRegistry.add("MFTMCHMID/hDCAxResolutionvsPt", "DCA_{x} vs. p_{T};p_{T} (GeV/c);DCA_{x} resolution (#mum);", kTH2F, {{100, 0, 10.f}, {500, 0, 500}}, false);
@@ -148,59 +151,55 @@ struct FwdTrackPropagation {
148151
fRegistry.add("MCHMID/hDCAyResolutionvsPt", "DCA_{y} vs. p_{T};p_{T} (GeV/c);DCA_{y} resolution (#mum);", kTH2F, {{100, 0, 10.f}, {500, 0, 5e+5}}, false);
149152
}
150153

151-
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2, const uint8_t trackType)
154+
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2, const uint8_t trackType, const float dcaXY)
152155
{
153156
if (pt < minPt || maxPt < pt) {
154157
return false;
155158
}
156-
157159
if (rAtAbsorberEnd < minRabs || maxRabs < rAtAbsorberEnd) {
158160
return false;
159161
}
160-
161-
if (maxChi2 < chi2) {
162+
if (rAtAbsorberEnd < midRabs ? pDCA > maxPDCAforSmallR : pDCA > maxPDCAforLargeR) {
162163
return false;
163164
}
164165

165166
if (trackType == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) {
166167
if (eta < minEtaGL || maxEtaGL < eta) {
167168
return false;
168169
}
170+
if (maxDCAxy < dcaXY) {
171+
return false;
172+
}
173+
if (chi2 < 0.f || maxChi2GL < chi2) {
174+
return false;
175+
}
176+
if (rAtAbsorberEnd < minRabsGL || maxRabs < rAtAbsorberEnd) {
177+
return false;
178+
}
169179
} else if (trackType == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) {
170180
if (eta < minEtaSA || maxEtaSA < eta) {
171181
return false;
172182
}
183+
if (chi2 < 0.f || maxChi2SA < chi2) {
184+
return false;
185+
}
173186
} else {
174187
return false;
175188
}
176189

177-
if (rAtAbsorberEnd < midRabs ? pDCA > maxPDCAforSmallR : pDCA > maxPDCAforLargeR) {
178-
return false;
179-
}
180190
return true;
181191
}
182192

183193
template <typename TCollision, typename TFwdTrack, typename TFwdTracks, typename TMFTTracks>
184-
void fillFwdTrackTable(TCollision const& collision, TFwdTrack fwdtrack, TFwdTracks const& fwdtracks, TMFTTracks const&, const bool isAmbiguous)
194+
void fillFwdTrackTable(TCollision const& collision, TFwdTrack fwdtrack, TFwdTracks const&, TMFTTracks const&, const bool isAmbiguous)
185195
{
186-
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) {
187-
std::map<int64_t, float> map_chi2MFTMCH;
188-
const auto& matchedGlobalTracks = fwdtracks.sliceBy(perMFTTrack, fwdtrack.matchMFTTrackId()); // MFT-MCH-MID or MFT-MCH
189-
for (const auto& matchedtrack : matchedGlobalTracks) {
190-
if (matchedtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) {
191-
map_chi2MFTMCH[matchedtrack.globalIndex()] = matchedtrack.chi2MatchMCHMFT();
192-
}
193-
}
194-
if (map_chi2MFTMCH.begin()->first != fwdtrack.globalIndex()) { // search for minimum chi2
195-
map_chi2MFTMCH.clear();
196-
return;
197-
}
198-
map_chi2MFTMCH.clear();
196+
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack && (fwdtrack.chi2MatchMCHMFT() > maxMatchingChi2MCHMFT || fwdtrack.chi2() > maxChi2GL)) {
197+
return;
198+
} // Users have to decide the best match between MFT and MCH-MID at analysis level. The same global muon is repeatedly stored.
199199

200-
if (fwdtrack.chi2MatchMCHMFT() > maxMatchingChi2MCHMFT) {
201-
return;
202-
}
203-
} // reduce useless propagation
200+
if (fwdtrack.chi2MatchMCHMID() < 0.f) { // this should never happen. only for protection.
201+
return;
202+
}
204203

205204
o2::dataformats::GlobalFwdTrack propmuonAtPV = propagateMuon(fwdtrack, collision, propagationPoint::kToVertex);
206205
o2::dataformats::GlobalFwdTrack propmuonAtDCA = propagateMuon(fwdtrack, collision, propagationPoint::kToDCA);
@@ -236,9 +235,6 @@ struct FwdTrackPropagation {
236235

237236
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack) {
238237
const auto& mchtrack = fwdtrack.template matchMCHTrack_as<TFwdTracks>(); // MCH-MID
239-
// etaMatchedMCHMID = mchtrack.eta();
240-
// phiMatchedMCHMID = mchtrack.phi();
241-
// o2::math_utils::bringTo02Pi(phiMatchedMCHMID);
242238
o2::dataformats::GlobalFwdTrack propmuonAtPV_Matched = propagateMuon(mchtrack, collision, propagationPoint::kToVertex);
243239
etaMatchedMCHMID = propmuonAtPV_Matched.getEta();
244240
phiMatchedMCHMID = propmuonAtPV_Matched.getPhi();
@@ -251,18 +247,18 @@ struct FwdTrackPropagation {
251247

252248
const auto& mfttrack = fwdtrack.template matchMFTTrack_as<TMFTTracks>();
253249
nClustersMFT = mfttrack.nClusters();
250+
chi2mft = mfttrack.chi2();
254251
if (refitGlobalMuon) {
255252
eta = mfttrack.eta();
256253
phi = mfttrack.phi();
257254
o2::math_utils::bringTo02Pi(phi);
258-
pt = propmuonAtPV.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
255+
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
259256

260257
x = mfttrack.x();
261258
y = mfttrack.y();
262259
z = mfttrack.z();
263260
tgl = mfttrack.tgl();
264261
}
265-
chi2mft = mfttrack.chi2();
266262
} else if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
267263
o2::dataformats::GlobalFwdTrack propmuonAtRabs = propagateMuon(fwdtrack, collision, propagationPoint::kToRabs); // this is necessary only for MuonStandaloneTrack
268264
float xAbs = propmuonAtRabs.getX();
@@ -272,7 +268,7 @@ struct FwdTrackPropagation {
272268
return;
273269
}
274270

275-
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2(), fwdtrack.trackType())) {
271+
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2(), fwdtrack.trackType(), dcaXY)) {
276272
return;
277273
}
278274

0 commit comments

Comments
 (0)