Skip to content

Commit 360c8c2

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents b51dc6f + 8fdaccc commit 360c8c2

File tree

69 files changed

+3267
-1936
lines changed

Some content is hidden

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

69 files changed

+3267
-1936
lines changed

.github/labeler.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
alice3:
3+
- changed-files:
4+
- any-glob-to-any-file: ['ALICE3/**']
5+
6+
common:
7+
- changed-files:
8+
- any-glob-to-any-file: ['Common/**']
9+
10+
infrastructure:
11+
- changed-files:
12+
- any-glob-to-any-file: ['.github/**', 'cmake/**', 'dependencies/**', 'packaging/**']
13+
14+
dpg:
15+
- changed-files:
16+
- any-glob-to-any-file: ['DPG/**']
17+
18+
pwgcf:
19+
- changed-files:
20+
- any-glob-to-any-file: ['PWGCF/**', '*/PWGCF/**']
21+
22+
pwgdq:
23+
- changed-files:
24+
- any-glob-to-any-file: ['PWGDQ/**', '*/PWGDQ/**']
25+
26+
pwgem:
27+
- changed-files:
28+
- any-glob-to-any-file: ['PWGEM/**', '*/PWGEM/**']
29+
30+
pwghf:
31+
- changed-files:
32+
- any-glob-to-any-file: ['PWGHF/**', '*/PWGHF/**']
33+
34+
pwgje:
35+
- changed-files:
36+
- any-glob-to-any-file: ['PWGJE/**', '*/PWGJE/**']
37+
38+
pwglf:
39+
- changed-files:
40+
- any-glob-to-any-file: ['PWGLF/**', '*/PWGLF/**', 'PWGMM/**', '*/PWGMM/**']
41+
42+
pwgud:
43+
- changed-files:
44+
- any-glob-to-any-file: ['PWGUD/**', '*/PWGUD/**']
45+
46+
trigger:
47+
- changed-files:
48+
- any-glob-to-any-file: ['EventFiltering/**']
49+
50+
tutorial:
51+
- changed-files:
52+
- any-glob-to-any-file: ['Tutorials/**']

.github/workflows/codeowner-self-approval.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
approve:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-22.04
1717
# Only run if the PR author enabled auto-merge, not someone else.
1818
# Also run if a new approval was created, as this affects whether we can
1919
# auto-approve. There is a risk of infinite loops here, though -- when we
@@ -25,7 +25,7 @@ jobs:
2525
2626
steps:
2727
- name: Install dependencies
28-
run: pip install --break-system-packages codeowners PyGithub
28+
run: pip install codeowners PyGithub
2929

3030
# Approve the PR, if the author is only editing files owned by themselves.
3131
- name: Auto-approve PR if permitted

.github/workflows/labeler.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: "Pull Request Labeler"
3+
on:
4+
- pull_request_target
5+
permissions: read-all
6+
7+
jobs:
8+
labeler:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
steps:
14+
- uses: actions/labeler@v5
15+
with:
16+
repo-token: ${{ secrets.GITHUB_TOKEN }}

Common/Core/TrackSelectorPID.h

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ class TrackSelectorPidBase
103103
/// Checks if track is compatible with given particle species hypothesis within given TPC nσ range.
104104
/// \param track track
105105
/// \param conditionalTof variable to store the result of selection with looser cuts for conditional accepting of track if combined with TOF
106+
/// \param tpcNSigmaCustom custom TPC nσ value to be used for the selection, in case the desired value cannot be taken from the track table
106107
/// \return true if track satisfies TPC PID hypothesis for given TPC nσ range
107108
template <typename T>
108-
bool isSelectedByTpc(const T& track, bool& conditionalTof)
109+
bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = -999.f)
109110
{
110111
// Accept if selection is disabled via large values.
111112
if (mNSigmaTpcMin < -999. && mNSigmaTpcMax > 999.) {
@@ -128,6 +129,11 @@ class TrackSelectorPidBase
128129
errorPdg();
129130
}
130131

132+
/// use custom TPC nσ, if a valid value is provided
133+
if (tpcNSigmaCustom > -999.f) {
134+
nSigma = tpcNSigmaCustom;
135+
}
136+
131137
if (mNSigmaTpcMinCondTof < -999. && mNSigmaTpcMaxCondTof > 999.) {
132138
conditionalTof = true;
133139
} else {
@@ -140,13 +146,13 @@ class TrackSelectorPidBase
140146
/// \param track track
141147
/// \return TPC selection status (see TrackSelectorPID::Status)
142148
template <typename T>
143-
TrackSelectorPID::Status statusTpc(const T& track)
149+
TrackSelectorPID::Status statusTpc(const T& track, float tpcNSigmaCustom = -999.f)
144150
{
145151
if (!isValidForTpc(track)) {
146152
return TrackSelectorPID::NotApplicable;
147153
}
148154
bool condTof = false;
149-
if (isSelectedByTpc(track, condTof)) {
155+
if (isSelectedByTpc(track, condTof, tpcNSigmaCustom)) {
150156
return TrackSelectorPID::Accepted;
151157
} else if (condTof) {
152158
return TrackSelectorPID::Conditional; // potential to be accepted if combined with TOF
@@ -191,9 +197,10 @@ class TrackSelectorPidBase
191197
/// Checks if track is compatible with given particle species hypothesis within given TOF nσ range.
192198
/// \param track track
193199
/// \param conditionalTpc variable to store the result of selection with looser cuts for conditional accepting of track if combined with TPC
200+
/// \param tofNSigmaCustom custom TOF nσ value to be used for the selection, in case the desired value cannot be taken from the track table
194201
/// \return true if track satisfies TOF PID hypothesis for given TOF nσ range
195202
template <typename T>
196-
bool isSelectedByTof(const T& track, bool& conditionalTpc)
203+
bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = -999.f)
197204
{
198205
// Accept if selection is disabled via large values.
199206
if (mNSigmaTofMin < -999. && mNSigmaTofMax > 999.) {
@@ -216,6 +223,11 @@ class TrackSelectorPidBase
216223
errorPdg();
217224
}
218225

226+
/// use custom TOF nσ, if a valid value is provided
227+
if (tofNSigmaCustom > -999.f) {
228+
nSigma = tofNSigmaCustom;
229+
}
230+
219231
if (mNSigmaTofMinCondTpc < -999. && mNSigmaTofMaxCondTpc > 999.) {
220232
conditionalTpc = true;
221233
} else {
@@ -228,13 +240,13 @@ class TrackSelectorPidBase
228240
/// \param track track
229241
/// \return TOF selection status (see TrackSelectorPID::Status)
230242
template <typename T>
231-
TrackSelectorPID::Status statusTof(const T& track)
243+
TrackSelectorPID::Status statusTof(const T& track, float tofNSigmaCustom = -999.f)
232244
{
233245
if (!isValidForTof(track)) {
234246
return TrackSelectorPID::NotApplicable;
235247
}
236248
bool condTpc = false;
237-
if (isSelectedByTof(track, condTpc)) {
249+
if (isSelectedByTof(track, condTpc, tofNSigmaCustom)) {
238250
return TrackSelectorPID::Accepted;
239251
} else if (condTpc) {
240252
return TrackSelectorPID::Conditional; // potential to be accepted if combined with TPC
@@ -391,10 +403,10 @@ class TrackSelectorPidBase
391403
/// \param track track
392404
/// \return status of combined PID (TPC or TOF) (see TrackSelectorPID::Status)
393405
template <typename T>
394-
TrackSelectorPID::Status statusTpcOrTof(const T& track)
406+
TrackSelectorPID::Status statusTpcOrTof(const T& track, float tpcNSigmaCustom = -999.f, float tofNSigmaCustom = -999.f)
395407
{
396-
int pidTpc = statusTpc(track);
397-
int pidTof = statusTof(track);
408+
int pidTpc = statusTpc(track, tpcNSigmaCustom);
409+
int pidTof = statusTof(track, tofNSigmaCustom);
398410

399411
if (pidTpc == TrackSelectorPID::Accepted || pidTof == TrackSelectorPID::Accepted) {
400412
return TrackSelectorPID::Accepted;
@@ -412,15 +424,15 @@ class TrackSelectorPidBase
412424
/// \param track track
413425
/// \return status of combined PID (TPC and TOF) (see TrackSelectorPID::Status)
414426
template <typename T>
415-
TrackSelectorPID::Status statusTpcAndTof(const T& track)
427+
TrackSelectorPID::Status statusTpcAndTof(const T& track, float tpcNSigmaCustom = -999.f, float tofNSigmaCustom = -999.f)
416428
{
417429
int pidTpc = TrackSelectorPID::NotApplicable;
418430
if (track.hasTPC()) {
419-
pidTpc = statusTpc(track);
431+
pidTpc = statusTpc(track, tpcNSigmaCustom);
420432
}
421433
int pidTof = TrackSelectorPID::NotApplicable;
422434
if (track.hasTOF()) {
423-
pidTof = statusTof(track);
435+
pidTof = statusTof(track, tofNSigmaCustom);
424436
}
425437

426438
if (pidTpc == TrackSelectorPID::Accepted && pidTof == TrackSelectorPID::Accepted) {

Common/TableProducer/Converters/bcFlagsCreator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct bcFlagsCreator {
2222

2323
void process(aod::BCs const& bcTable)
2424
{
25-
for (auto& bc : bcTable) {
25+
for (auto& _ : bcTable) {
2626
bcFlags(0);
2727
}
2828
}

Common/TableProducer/eventSelection.cxx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ using BCsWithRun2InfosTimestampsAndMatches = soa::Join<aod::BCs, aod::Run2BCInfo
3838
using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
3939
using BCsWithBcSelsRun2 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run2BCInfos, aod::Run2MatchedToBCSparse>;
4040
using BCsWithBcSelsRun3 = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels, aod::Run3MatchedToBCSparse>;
41+
using FullTracks = soa::Join<aod::Tracks, aod::TracksExtra>;
4142
using FullTracksIU = soa::Join<aod::TracksIU, aod::TracksExtra>;
4243
const double bcNS = o2::constants::lhc::LHCBunchSpacingNS;
4344

@@ -446,7 +447,10 @@ struct EventSelectionTask {
446447
Configurable<bool> confUseWeightsForOccupancyVariable{"UseWeightsForOccupancyEstimator", 1, "Use or not the delta-time weights for the occupancy estimator"};
447448
Configurable<int> confSigmaBCforHighPtTracks{"confSigmaBCforHighPtTracks", 4, "Custom sigma (in bcs) for collisions with high-pt tracks"};
448449

449-
Partition<aod::Tracks> tracklets = (aod::track::trackType == static_cast<uint8_t>(o2::aod::track::TrackTypeEnum::Run2Tracklet));
450+
Partition<FullTracks> tracklets = (aod::track::trackType == static_cast<uint8_t>(o2::aod::track::TrackTypeEnum::Run2Tracklet));
451+
452+
Preslice<FullTracks> perCollision = aod::track::collisionId;
453+
Preslice<FullTracksIU> perCollisionIU = aod::track::collisionId;
450454

451455
Service<o2::ccdb::BasicCCDBManager> ccdb;
452456
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -482,6 +486,10 @@ struct EventSelectionTask {
482486
// helper function to find closest TVX signal in time and in zVtx
483487
int64_t findBestGlobalBC(int64_t meanBC, int64_t sigmaBC, int32_t nContrib, float zVtxCol, std::map<int64_t, float>& mapGlobalBcVtxZ)
484488
{
489+
// protection against
490+
if (sigmaBC < 1)
491+
sigmaBC = 1;
492+
485493
int64_t minBC = meanBC - 3 * sigmaBC;
486494
int64_t maxBC = meanBC + 3 * sigmaBC;
487495
// TODO: use ITS ROF bounds to reduce the search range?
@@ -495,7 +503,7 @@ struct EventSelectionTask {
495503
float bestChi2 = 1e+10;
496504
int64_t bestGlobalBC = 0;
497505
for (std::map<int64_t, float>::iterator it = itMin; it != itMax; ++it) {
498-
float chi2 = pow((it->second - zVtxCol) / zVtxSigma, 2) + pow((it->first - meanBC) / sigmaBC, 2.);
506+
float chi2 = pow((it->second - zVtxCol) / zVtxSigma, 2) + pow(static_cast<float>(it->first - meanBC) / sigmaBC, 2.);
499507
if (chi2 < bestChi2) {
500508
bestChi2 = chi2;
501509
bestGlobalBC = it->first;
@@ -541,7 +549,7 @@ struct EventSelectionTask {
541549
evsel.reserve(collisions.size());
542550
}
543551

544-
void processRun2(aod::Collision const& col, BCsWithBcSelsRun2 const&, FullTracksIU const&, aod::FV0Cs const&)
552+
void processRun2(aod::Collision const& col, BCsWithBcSelsRun2 const&, FullTracks const&, aod::FV0Cs const&)
545553
{
546554
auto bc = col.bc_as<BCsWithBcSelsRun2>();
547555
EventSelectionParams* par = ccdb->getForTimeStamp<EventSelectionParams>("EventSelection/EventSelectionParams", bc.timestamp());
@@ -788,7 +796,8 @@ struct EventSelectionTask {
788796
auto bc = col.bc_as<BCsWithBcSelsRun3>();
789797
int64_t globalBC = bc.globalBC();
790798
int64_t meanBC = globalBC + TMath::Nint(weightedTime / bcNS);
791-
int64_t bestGlobalBC = findBestGlobalBC(meanBC, weightedSigma / bcNS, vNcontributors[colIndex], col.posZ(), mapGlobalBcVtxZ);
799+
int64_t sigmaBC = TMath::CeilNint(weightedSigma / bcNS);
800+
int64_t bestGlobalBC = findBestGlobalBC(meanBC, sigmaBC, vNcontributors[colIndex], col.posZ(), mapGlobalBcVtxZ);
792801
vFoundGlobalBC[colIndex] = bestGlobalBC > 0 ? bestGlobalBC : globalBC;
793802
vFoundBCindex[colIndex] = bestGlobalBC > 0 ? mapGlobalBcWithTVX[bestGlobalBC] : bc.globalIndex();
794803
}

Common/TableProducer/match-mft-ft0.cxx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,9 @@ T getCompatibleBCs(aod::AmbiguousMFTTrack const& atrack, aod::Collision const& c
109109
}
110110

111111
int64_t maxBCId = bcIt.globalIndex();
112-
auto maxGlobalBC = bcIt.globalBC();
113112

114113
while (bcIt != bcs.end() && bcIt.globalBC() < lastBC + deltaBC) {
115114
maxBCId = bcIt.globalIndex();
116-
maxGlobalBC = bcIt.globalBC();
117115

118116
++bcIt;
119117
}
@@ -149,12 +147,10 @@ T getCompatibleBCs(aod::MFTTracks::iterator const& track, aod::Collision const&
149147
// int64_t collLastBC = collFirstBC + 2*collOrig.collisionTimeRes()/o2::constants::lhc::LHCBunchSpacingNS +1;
150148

151149
int64_t minBCId = bcIt.globalIndex();
152-
uint64_t minGlobalBC = bcIt.globalBC();
153150

154151
if ((int64_t)bcIt.globalBC() < firstBC + deltaBC) {
155152
while (bcIt != bcs.end() && (int64_t)bcIt.globalBC() < firstBC + deltaBC) {
156153
minBCId = bcIt.globalIndex();
157-
minGlobalBC = bcIt.globalBC();
158154

159155
++bcIt;
160156
}
@@ -164,19 +160,16 @@ T getCompatibleBCs(aod::MFTTracks::iterator const& track, aod::Collision const&
164160
}
165161
// minGlobalBC needs to be >= to firstBC+deltaBC
166162
minBCId = bcIt.globalIndex();
167-
minGlobalBC = bcIt.globalBC();
168163

169164
} else {
170165
// here bcIt.globalBC() >= firstBC + deltaBC
171166

172167
while (bcIt != bcs.begin() && (int64_t)bcIt.globalBC() >= (int64_t)firstBC + deltaBC) {
173168
minBCId = bcIt.globalIndex();
174-
minGlobalBC = bcIt.globalBC();
175169
--bcIt;
176170
}
177171
if (bcIt == bcs.begin() && (int64_t)bcIt.globalBC() >= (int64_t)firstBC + deltaBC) {
178172
minBCId = bcIt.globalIndex();
179-
minGlobalBC = bcIt.globalBC();
180173
}
181174
++bcIt; // retrieve the pointer which gave minBCId and minGlobalBC
182175
if (bcIt == bcs.end()) {
@@ -185,7 +178,6 @@ T getCompatibleBCs(aod::MFTTracks::iterator const& track, aod::Collision const&
185178
}
186179

187180
int64_t maxBCId = bcIt.globalIndex();
188-
uint64_t maxGlobalBC = bcIt.globalBC();
189181

190182
if ((int64_t)bcIt.globalBC() > (int64_t)lastBC + deltaBC) {
191183
// the previous minimum is actually bigger than the right boundary
@@ -218,7 +210,6 @@ T getCompatibleBCs(aod::MFTTracks::iterator const& track, aod::Collision const&
218210

219211
while (bcIt != bcs.end() && (int64_t)bcIt.globalBC() <= (int64_t)lastBC + deltaBC) {
220212
maxBCId = bcIt.globalIndex();
221-
maxGlobalBC = bcIt.globalBC();
222213

223214
++bcIt;
224215
}

Common/TableProducer/multiplicityTable.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ struct MultiplicityTable {
565565
}
566566
}
567567

568-
int bcNumber = bc.globalBC() % 3564;
569-
570568
tableExtra(collision.numContrib(), collision.chi2(), collision.collisionTimeRes(),
571569
mRunNumber, collision.posZ(), collision.sel8(),
572570
nHasITS, nHasTPC, nHasTOF, nHasTRD, nITSonly, nTPConly, nITSTPC,

0 commit comments

Comments
 (0)