Skip to content

Commit 5a41322

Browse files
author
Luigi Dello Stritto
committed
2 parents 24883a3 + b833caa commit 5a41322

File tree

222 files changed

+14373
-3211
lines changed

Some content is hidden

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

222 files changed

+14373
-3211
lines changed

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ infrastructure:
1616
- '.github/**'
1717
- '.checkov.yml'
1818
- '.mega-linter.yml'
19+
- '.pre-commit-config.yaml'
1920
- 'cmake/**'
2021
- 'CODEOWNERS'
2122
- 'CPPLINT.cfg'

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- repo: https://github.com/pre-commit/mirrors-clang-format
10+
rev: "v18.1.3" # clang-format version
11+
hooks:
12+
- id: clang-format

ALICE3/TableProducer/alice3-pidTOF.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct ALICE3pidTOFTask {
123123
if (!track.hasTOF()) {
124124
return -999.f;
125125
}
126-
return ((track.trackTime() - track.collision().collisionTime()) * 1000.f - o2::pid::tof::ExpTimes<Trks::iterator, id>::ComputeExpectedTime(track.tofExpMom() / o2::pid::tof::kCSPEED,
126+
return ((track.trackTime() - track.collision().collisionTime()) * 1000.f - o2::pid::tof::ExpTimes<Trks::iterator, id>::ComputeExpectedTime(track.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS,
127127
track.length())) /
128128
sigma<id>(track);
129129
}
@@ -294,7 +294,7 @@ struct ALICE3pidTOFTaskQA {
294294
//
295295
// histos.fill(HIST("event/tofsignal"), t.p(), t.tofSignal());
296296
histos.fill(HIST("event/tofsignal"), t.p(), tofSignal);
297-
histos.fill(HIST("event/pexp"), t.p(), t.tofExpMom() / o2::pid::tof::kCSPEED);
297+
histos.fill(HIST("event/pexp"), t.p(), t.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS);
298298
histos.fill(HIST("event/eta"), t.eta());
299299
histos.fill(HIST("event/length"), t.length());
300300
histos.fill(HIST("event/pt"), t.pt());

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/PWGEM @alibuild @feisenhu @dsekihat @ivorobye
3737
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu
3838
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat
39-
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano
39+
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano @zhangbiao-phy
4040
# PWG-LF
4141
/PWGLF @alibuild @njacazio @skundu692
4242
/PWGLF/Tasks/GlobalEventProperties @alibuild @njacazio @skundu692 @gbencedi @omvazque

Common/Core/PID/PIDTOF.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ namespace o2::pid::tof
4141
{
4242

4343
// Utility values (to remove!)
44-
static constexpr float kCSPEED = TMath::C() * 1.0e2f * 1.0e-12f; /// Speed of light in TOF units (cm/ps)
45-
static constexpr float kCSPEDDInv = 1.f / kCSPEED; /// Inverse of the Speed of light in TOF units (ps/cm)
4644
static constexpr float defaultReturnValue = -999.f; /// Default return value in case TOF measurement is not available
4745

4846
/// \brief Class to handle the the TOF detector response for the TOF beta measurement

Common/Core/RecoDecay.h

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,11 @@ struct RecoDecay {
668668
}
669669

670670
/// Checks whether the reconstructed decay candidate is the expected decay.
671-
/// \param checkProcess switch to accept only decay daughters by checking the production process of MC particles
672-
/// \param acceptIncompleteReco switch to accept candidates with only part of the daughters reconstructed
671+
/// \tparam acceptFlavourOscillation switch to accept flavour oscillastion (i.e. B0 -> B0bar -> D+pi-)
672+
/// \tparam checkProcess switch to accept only decay daughters by checking the production process of MC particles
673+
/// \tparam acceptIncompleteReco switch to accept candidates with only part of the daughters reconstructed
673674
/// \tparam acceptTrackDecay switch to accept candidates with daughter tracks of pions and kaons which decayed
675+
/// \tparam acceptTrackIntWithMaterial switch to accept candidates with final (i.e. p, K, pi) daughter tracks interacting with material
674676
/// \param particlesMC table with MC particles
675677
/// \param arrDaughters array of candidate daughters
676678
/// \param PDGMother expected mother PDG code
@@ -680,8 +682,9 @@ struct RecoDecay {
680682
/// \param depthMax maximum decay tree level to check; Daughters up to this level will be considered. If -1, all levels are considered.
681683
/// \param nPiToMu number of pion prongs decayed to a muon
682684
/// \param nKaToPi number of kaon prongs decayed to a pion
685+
/// \param nInteractionsWithMaterial number of daughter particles that interacted with material
683686
/// \return index of the mother particle if the mother and daughters are correct, -1 otherwise
684-
template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, bool acceptTrackDecay = false, std::size_t N, typename T, typename U>
687+
template <bool acceptFlavourOscillation = false, bool checkProcess = false, bool acceptIncompleteReco = false, bool acceptTrackDecay = false, bool acceptTrackIntWithMaterial = false, std::size_t N, typename T, typename U>
685688
static int getMatchedMCRec(const T& particlesMC,
686689
const std::array<U, N>& arrDaughters,
687690
int PDGMother,
@@ -690,16 +693,18 @@ struct RecoDecay {
690693
int8_t* sign = nullptr,
691694
int depthMax = 1,
692695
int8_t* nPiToMu = nullptr,
693-
int8_t* nKaToPi = nullptr)
696+
int8_t* nKaToPi = nullptr,
697+
int8_t* nInteractionsWithMaterial = nullptr)
694698
{
695699
// Printf("MC Rec: Expected mother PDG: %d", PDGMother);
696-
int8_t coefFlavourOscillation = 1; // 1 if no B0(s) flavour oscillation occured, -1 else
697-
int8_t sgn = 0; // 1 if the expected mother is particle, -1 if antiparticle (w.r.t. PDGMother)
698-
int8_t nPiToMuLocal = 0; // number of pion prongs decayed to a muon
699-
int8_t nKaToPiLocal = 0; // number of kaon prongs decayed to a pion
700-
int indexMother = -1; // index of the mother particle
701-
std::vector<int> arrAllDaughtersIndex; // vector of indices of all daughters of the mother of the first provided daughter
702-
std::array<int, N> arrDaughtersIndex; // array of indices of provided daughters
700+
int8_t coefFlavourOscillation = 1; // 1 if no B0(s) flavour oscillation occured, -1 else
701+
int8_t sgn = 0; // 1 if the expected mother is particle, -1 if antiparticle (w.r.t. PDGMother)
702+
int8_t nPiToMuLocal = 0; // number of pion prongs decayed to a muon
703+
int8_t nKaToPiLocal = 0; // number of kaon prongs decayed to a pion
704+
int8_t nInteractionsWithMaterialLocal = 0; // number of interactions with material
705+
int indexMother = -1; // index of the mother particle
706+
std::vector<int> arrAllDaughtersIndex; // vector of indices of all daughters of the mother of the first provided daughter
707+
std::array<int, N> arrDaughtersIndex; // array of indices of provided daughters
703708
if (sign) {
704709
*sign = sgn;
705710
}
@@ -737,6 +742,28 @@ struct RecoDecay {
737742
particleI = motherI;
738743
}
739744
}
745+
if constexpr (acceptTrackIntWithMaterial) {
746+
// Replace the MC particle associated with the prong by its mother for part → part due to material interactions.
747+
// It keeps looking at the mother iteratively, until it finds a particle from decay or primary
748+
auto process = particleI.getProcess();
749+
auto pdgI = std::abs(particleI.pdgCode());
750+
auto pdgMotherI = std::abs(particleI.pdgCode());
751+
while (process != TMCProcess::kPDecay && process != TMCProcess::kPPrimary && pdgI == pdgMotherI) {
752+
if (!particleI.has_mothers()) {
753+
break;
754+
}
755+
auto motherI = particleI.template mothers_first_as<T>();
756+
pdgI = std::abs(particleI.pdgCode());
757+
pdgMotherI = std::abs(motherI.pdgCode());
758+
if (pdgI == pdgMotherI) {
759+
particleI = motherI;
760+
process = particleI.getProcess();
761+
if (process == TMCProcess::kPDecay || process == TMCProcess::kPPrimary) { // we found the original daughter that interacted with material
762+
nInteractionsWithMaterialLocal++;
763+
}
764+
}
765+
}
766+
}
740767
arrDaughtersIndex[iProng] = particleI.globalIndex();
741768
// Get the list of daughter indices from the mother of the first prong.
742769
if (iProng == 0) {
@@ -817,6 +844,11 @@ struct RecoDecay {
817844
*nKaToPi = nKaToPiLocal;
818845
}
819846
}
847+
if constexpr (acceptTrackIntWithMaterial) {
848+
if (nInteractionsWithMaterial) {
849+
*nInteractionsWithMaterial = nInteractionsWithMaterialLocal;
850+
}
851+
}
820852
return indexMother;
821853
}
822854

Common/Tasks/flowTest.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ struct flowTest {
4242

4343
ConfigurableAxis axisB{"axisB", {100, 0.0f, 20.0f}, ""};
4444
ConfigurableAxis axisPhi{"axisPhi", {100, 0.0f, 2.0f * TMath::Pi()}, ""};
45+
ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "Nch in |eta|<0.8"};
4546

4647
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}, "pt axis"};
4748

4849
void init(InitContext&)
4950
{
5051
// pT histograms
5152
histos.add<TH1>("hImpactParameter", "hImpactParameter", HistType::kTH1D, {axisB});
53+
histos.add<TH2>("hNchVsImpactParameter", "hNchVsImpactParameter", HistType::kTH2D, {axisB, axisNch});
5254
histos.add<TH1>("hEventPlaneAngle", "hEventPlaneAngle", HistType::kTH1D, {axisPhi});
5355
histos.add<TH2>("hPtVsPhiGenerated", "hPtVsPhiGenerated", HistType::kTH2D, {axisPhi, axisPt});
5456
histos.add<TH2>("hPtVsPhiGlobal", "hPtVsPhiGlobal", HistType::kTH2D, {axisPhi, axisPt});
@@ -80,6 +82,8 @@ struct flowTest {
8082
if (evPhi < 0)
8183
evPhi += 2. * TMath::Pi();
8284

85+
long nCh = 0;
86+
8387
if (imp > minB && imp < maxB) {
8488
// event within range
8589
histos.fill(HIST("hImpactParameter"), imp);
@@ -104,6 +108,8 @@ struct flowTest {
104108
histos.fill(HIST("hPtVsPhiGenerated"), deltaPhi, mcParticle.pt());
105109
histos.fill(HIST("hBVsPtVsPhiGenerated"), imp, deltaPhi, mcParticle.pt());
106110

111+
nCh++;
112+
107113
bool validGlobal = false;
108114
bool validTrack = false;
109115
bool validTPCTrack = false;
@@ -146,6 +152,7 @@ struct flowTest {
146152
histos.fill(HIST("hBVsPtVsPhiITSABTrack"), imp, deltaPhi, mcParticle.pt());
147153
}
148154
}
155+
histos.fill(HIST("hNchVsImpactParameter"), imp, nCh);
149156
}
150157

151158
using LabeledCascades = soa::Join<aod::CascDataExt, aod::McCascLabels>;

DPG/Tasks/AOTTrack/PID/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
add_subdirectory(Combined)
1313
add_subdirectory(TOF)
1414
add_subdirectory(TPC)
15+
add_subdirectory(ITS)
1516
add_subdirectory(HMPID)

DPG/Tasks/AOTTrack/PID/HMPID/qaHMPID.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ struct pidHmpidQa {
159159

160160
histos.fill(HIST("hmpidSignal"), t.hmpidSignal());
161161
histos.fill(HIST("PhivsEta"), t.track_as<TrackCandidates>().eta(), t.track_as<TrackCandidates>().phi());
162-
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), abs(t.hmpidMom()));
163-
histos.fill(HIST("hmpidCkovvsMom"), abs(t.hmpidMom()), t.hmpidSignal());
162+
histos.fill(HIST("hmpidMomvsTrackMom"), t.track_as<TrackCandidates>().p(), std::abs(t.hmpidMom()));
163+
histos.fill(HIST("hmpidCkovvsMom"), std::abs(t.hmpidMom()), t.hmpidSignal());
164164
histos.fill(HIST("hmpidXTrack"), t.hmpidXTrack());
165165
histos.fill(HIST("hmpidYTrack"), t.hmpidYTrack());
166166
histos.fill(HIST("hmpidXMip"), t.hmpidXMip());
@@ -173,7 +173,7 @@ struct pidHmpidQa {
173173
histos.fill(HIST("hmpidQMip"), t.hmpidQMip());
174174
histos.fill(HIST("hmpidClusSize"), (t.hmpidClusSize() % 1000000) / 1000);
175175
histos.fill(HIST("TrackMom"), t.track_as<TrackCandidates>().p());
176-
histos.fill(HIST("hmpidMom"), abs(t.hmpidMom()));
176+
histos.fill(HIST("hmpidMom"), std::abs(t.hmpidMom()));
177177
for (int i = 0; i < 10; i++) {
178178
if (t.hmpidPhotsCharge()[i] > 0)
179179
histos.fill(HIST("hmpidPhotsCharge"), t.hmpidPhotsCharge()[i]);
@@ -190,7 +190,7 @@ struct pidHmpidQa {
190190
histos.fill(HIST("hmpidQMip0"), t.hmpidQMip());
191191
histos.fill(HIST("hmpidClusSize0"), (t.hmpidClusSize() % 1000000) / 1000);
192192
histos.fill(HIST("TrackMom0"), t.track_as<TrackCandidates>().p());
193-
histos.fill(HIST("hmpidMom0"), abs(t.hmpidMom()));
193+
histos.fill(HIST("hmpidMom0"), std::abs(t.hmpidMom()));
194194
for (int i = 0; i < 10; i++) {
195195
if (t.hmpidPhotsCharge()[i] > 0)
196196
histos.fill(HIST("hmpidPhotsCharge0"), t.hmpidPhotsCharge()[i]);
@@ -208,7 +208,7 @@ struct pidHmpidQa {
208208
histos.fill(HIST("hmpidQMip1"), t.hmpidQMip());
209209
histos.fill(HIST("hmpidClusSize1"), (t.hmpidClusSize() % 1000000) / 1000);
210210
histos.fill(HIST("TrackMom1"), t.track_as<TrackCandidates>().p());
211-
histos.fill(HIST("hmpidMom1"), abs(t.hmpidMom()));
211+
histos.fill(HIST("hmpidMom1"), std::abs(t.hmpidMom()));
212212
for (int i = 0; i < 10; i++) {
213213
if (t.hmpidPhotsCharge()[i] > 0)
214214
histos.fill(HIST("hmpidPhotsCharge1"), t.hmpidPhotsCharge()[i]);
@@ -226,7 +226,7 @@ struct pidHmpidQa {
226226
histos.fill(HIST("hmpidQMip2"), t.hmpidQMip());
227227
histos.fill(HIST("hmpidClusSize2"), (t.hmpidClusSize() % 1000000) / 1000);
228228
histos.fill(HIST("TrackMom2"), t.track_as<TrackCandidates>().p());
229-
histos.fill(HIST("hmpidMom2"), abs(t.hmpidMom()));
229+
histos.fill(HIST("hmpidMom2"), std::abs(t.hmpidMom()));
230230
for (int i = 0; i < 10; i++) {
231231
if (t.hmpidPhotsCharge()[i] > 0)
232232
histos.fill(HIST("hmpidPhotsCharge2"), t.hmpidPhotsCharge()[i]);
@@ -244,7 +244,7 @@ struct pidHmpidQa {
244244
histos.fill(HIST("hmpidQMip3"), t.hmpidQMip());
245245
histos.fill(HIST("hmpidClusSize3"), (t.hmpidClusSize() % 1000000) / 1000);
246246
histos.fill(HIST("TrackMom3"), t.track_as<TrackCandidates>().p());
247-
histos.fill(HIST("hmpidMom3"), abs(t.hmpidMom()));
247+
histos.fill(HIST("hmpidMom3"), std::abs(t.hmpidMom()));
248248
for (int i = 0; i < 10; i++) {
249249
if (t.hmpidPhotsCharge()[i] > 0)
250250
histos.fill(HIST("hmpidPhotsCharge3"), t.hmpidPhotsCharge()[i]);
@@ -262,7 +262,7 @@ struct pidHmpidQa {
262262
histos.fill(HIST("hmpidQMip4"), t.hmpidQMip());
263263
histos.fill(HIST("hmpidClusSize4"), (t.hmpidClusSize() % 1000000) / 1000);
264264
histos.fill(HIST("TrackMom4"), t.track_as<TrackCandidates>().p());
265-
histos.fill(HIST("hmpidMom4"), abs(t.hmpidMom()));
265+
histos.fill(HIST("hmpidMom4"), std::abs(t.hmpidMom()));
266266
for (int i = 0; i < 10; i++) {
267267
if (t.hmpidPhotsCharge()[i] > 0)
268268
histos.fill(HIST("hmpidPhotsCharge4"), t.hmpidPhotsCharge()[i]);
@@ -280,7 +280,7 @@ struct pidHmpidQa {
280280
histos.fill(HIST("hmpidQMip5"), t.hmpidQMip());
281281
histos.fill(HIST("hmpidClusSize5"), (t.hmpidClusSize() % 1000000) / 1000);
282282
histos.fill(HIST("TrackMom5"), t.track_as<TrackCandidates>().p());
283-
histos.fill(HIST("hmpidMom5"), abs(t.hmpidMom()));
283+
histos.fill(HIST("hmpidMom5"), std::abs(t.hmpidMom()));
284284
for (int i = 0; i < 10; i++) {
285285
if (t.hmpidPhotsCharge()[i] > 0)
286286
histos.fill(HIST("hmpidPhotsCharge5"), t.hmpidPhotsCharge()[i]);
@@ -298,7 +298,7 @@ struct pidHmpidQa {
298298
histos.fill(HIST("hmpidQMip6"), t.hmpidQMip());
299299
histos.fill(HIST("hmpidClusSize6"), (t.hmpidClusSize() % 1000000) / 1000);
300300
histos.fill(HIST("TrackMom6"), t.track_as<TrackCandidates>().p());
301-
histos.fill(HIST("hmpidMom6"), abs(t.hmpidMom()));
301+
histos.fill(HIST("hmpidMom6"), std::abs(t.hmpidMom()));
302302
for (int i = 0; i < 10; i++) {
303303
if (t.hmpidPhotsCharge()[i] > 0)
304304
histos.fill(HIST("hmpidPhotsCharge6"), t.hmpidPhotsCharge()[i]);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
# ITS
13+
o2physics_add_dpl_workflow(pid-its-qa
14+
SOURCES qaPIDITS.cxx
15+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
16+
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)