Skip to content

Commit fedbcb2

Browse files
author
Preet Pati
committed
2 parents aea0bd9 + b1d9dc9 commit fedbcb2

File tree

89 files changed

+9916
-1786
lines changed

Some content is hidden

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

89 files changed

+9916
-1786
lines changed

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/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: 70 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -150,70 +150,90 @@ struct flowTest {
150150

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

153-
void processCascade(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledCascades> const& cascades, recoTracks const&, aod::McCollisions const&)
153+
void processCascade(aod::McParticles const& mcParticles, LabeledCascades const& cascades, recoTracks const&, aod::McCollisions const&)
154154
{
155-
auto mcCollision = mcParticle.mcCollision();
156-
float imp = mcCollision.impactParameter();
155+
std::vector<bool> isRecoed;
156+
isRecoed.resize(mcParticles.size(), false);
157+
for (auto const& cascade : cascades) {
158+
if (cascade.has_mcParticle()) {
159+
isRecoed[cascade.mcParticleId()] = true;
160+
}
161+
}
162+
163+
for (auto const& mcParticle : mcParticles) {
164+
auto mcCollision = mcParticle.mcCollision();
165+
float imp = mcCollision.impactParameter();
157166

158-
int pdgCode = TMath::Abs(mcParticle.pdgCode());
159-
if (pdgCode != 3312 && pdgCode != 3334)
160-
return;
161-
162-
if (!mcParticle.isPhysicalPrimary())
163-
return;
164-
if (TMath::Abs(mcParticle.eta()) > 0.8)
165-
return;
166-
167-
float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
168-
if (deltaPhi < 0)
169-
deltaPhi += 2. * TMath::Pi();
170-
if (deltaPhi > 2. * TMath::Pi())
171-
deltaPhi -= 2. * TMath::Pi();
172-
if (pdgCode == 3312)
173-
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
174-
if (pdgCode == 3334)
175-
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());
176-
177-
if (cascades.size() > 0) {
167+
int pdgCode = TMath::Abs(mcParticle.pdgCode());
168+
if (pdgCode != 3312 && pdgCode != 3334)
169+
return;
170+
171+
if (!mcParticle.isPhysicalPrimary())
172+
return;
173+
if (TMath::Abs(mcParticle.eta()) > 0.8)
174+
return;
175+
176+
float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
177+
if (deltaPhi < 0)
178+
deltaPhi += 2. * TMath::Pi();
179+
if (deltaPhi > 2. * TMath::Pi())
180+
deltaPhi -= 2. * TMath::Pi();
178181
if (pdgCode == 3312)
179-
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
182+
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
180183
if (pdgCode == 3334)
181-
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
184+
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());
185+
186+
if (isRecoed[mcParticle.globalIndex()]) {
187+
if (pdgCode == 3312)
188+
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
189+
if (pdgCode == 3334)
190+
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
191+
}
182192
}
183193
}
184194
PROCESS_SWITCH(flowTest, processCascade, "Process cascades", true);
185195

186196
using LabeledV0s = soa::Join<aod::V0Datas, aod::McV0Labels>;
187197

188-
void processV0s(aod::McParticle const& mcParticle, soa::SmallGroups<LabeledV0s> const& v0s, recoTracks const&, aod::McCollisions const&)
198+
void processV0s(aod::McParticles const& mcParticles, LabeledV0s const& v0s, recoTracks const&, aod::McCollisions const&)
189199
{
190-
auto mcCollision = mcParticle.mcCollision();
191-
float imp = mcCollision.impactParameter();
200+
std::vector<bool> isRecoed;
201+
isRecoed.resize(mcParticles.size(), false);
202+
for (auto const& v0 : v0s) {
203+
if (v0.has_mcParticle()) {
204+
isRecoed[v0.mcParticleId()] = true;
205+
}
206+
}
207+
208+
for (auto const& mcParticle : mcParticles) {
209+
auto mcCollision = mcParticle.mcCollision();
210+
float imp = mcCollision.impactParameter();
192211

193-
int pdgCode = TMath::Abs(mcParticle.pdgCode());
194-
if (pdgCode != 310 && pdgCode != 3122)
195-
return;
196-
197-
if (!mcParticle.isPhysicalPrimary())
198-
return;
199-
if (TMath::Abs(mcParticle.eta()) > 0.8)
200-
return;
201-
202-
float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
203-
if (deltaPhi < 0)
204-
deltaPhi += 2. * TMath::Pi();
205-
if (deltaPhi > 2. * TMath::Pi())
206-
deltaPhi -= 2. * TMath::Pi();
207-
if (pdgCode == 310)
208-
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
209-
if (pdgCode == 3122)
210-
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());
211-
212-
if (v0s.size() > 0) {
212+
int pdgCode = TMath::Abs(mcParticle.pdgCode());
213+
if (pdgCode != 310 && pdgCode != 3122)
214+
return;
215+
216+
if (!mcParticle.isPhysicalPrimary())
217+
return;
218+
if (TMath::Abs(mcParticle.eta()) > 0.8)
219+
return;
220+
221+
float deltaPhi = mcParticle.phi() - mcCollision.eventPlaneAngle();
222+
if (deltaPhi < 0)
223+
deltaPhi += 2. * TMath::Pi();
224+
if (deltaPhi > 2. * TMath::Pi())
225+
deltaPhi -= 2. * TMath::Pi();
213226
if (pdgCode == 310)
214-
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
227+
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
215228
if (pdgCode == 3122)
216-
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
229+
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());
230+
231+
if (isRecoed[mcParticle.globalIndex()]) {
232+
if (pdgCode == 310)
233+
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
234+
if (pdgCode == 3122)
235+
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
236+
}
217237
}
218238
}
219239
PROCESS_SWITCH(flowTest, processV0s, "Process V0s", true);

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)