Skip to content

Commit e482e01

Browse files
nzardoshNima Zardoshti
andauthored
PWGJE: Adding functionality to jet QA tasks (#3078)
* PWGJE: refactory of jet QA task * PWGJE: fixing bugs with templating in jet QA task --------- Co-authored-by: Nima Zardoshti <nzardosh@alicecerno2.cern.ch>
1 parent 68a2efd commit e482e01

6 files changed

Lines changed: 484 additions & 531 deletions

File tree

PWGJE/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ o2physics_add_dpl_workflow(jet-finder-d0-data-charged
2121
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
2222
COMPONENT_NAME Analysis)
2323

24+
o2physics_add_dpl_workflow(jet-finder-lc-data-charged
25+
SOURCES jetfinderLcDataCharged.cxx
26+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
27+
COMPONENT_NAME Analysis)
28+
2429
o2physics_add_dpl_workflow(jet-skimmer
2530
SOURCES jetskimming.cxx
2631
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore

PWGJE/TableProducer/jetfinder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
using JetTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection>>;
4444
using JetClusters = o2::soa::Filtered<o2::aod::EMCALClusters>;
4545

46-
using JetParticles2Prong = soa::Filtered<soa::Join<aod::McParticles, aod::HfCand2ProngMcGen>>;
47-
using JetParticles3Prong = soa::Filtered<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>;
46+
using JetParticlesD0 = soa::Filtered<soa::Join<aod::McParticles, aod::HfCand2ProngMcGen>>;
47+
using JetParticlesLc = soa::Filtered<soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>>;
4848
using JetParticlesBplus = soa::Filtered<soa::Join<aod::McParticles, aod::HfCandBplusMcGen>>;
4949

5050
using CandidateD0Data = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0>>;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
// jet finder lc data charged task
13+
//
14+
// Authors: Nima Zardoshti
15+
16+
#include "PWGJE/TableProducer/jetfinderhf.cxx"
17+
18+
using JetFinderLcDataCharged = JetFinderHFTask<o2::aod::LcChargedJets, o2::aod::LcChargedJetConstituents, o2::aod::LcChargedJetConstituentsSub>;
19+
20+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
21+
{
22+
std::vector<o2::framework::DataProcessorSpec> tasks;
23+
24+
tasks.emplace_back(adaptAnalysisTask<JetFinderLcDataCharged>(cfgc,
25+
SetDefaultProcesses{},
26+
TaskName{"jet-finder-lc-data-charged"}));
27+
28+
return WorkflowSpec{tasks};
29+
}

PWGJE/TableProducer/jetfinderhf.cxx

Lines changed: 27 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ struct JetFinderHFTask {
6565
Configurable<float> clusterPhiMax{"clusterPhiMax", 999, "maximum cluster phi"};
6666

6767
// HF candidate level configurables
68-
Configurable<std::string> candSpecie_s{"candSpecie_s", "D0", "options are D0, Lc, Bplus"};
69-
Configurable<std::string> candDecayChannel_s{"candDecayChannel_s", "default", "look up in task"};
7068
Configurable<float> candPtMin{"candPtMin", 0.0, "minimum candidate pT"};
7169
Configurable<float> candPtMax{"candPtMax", 100.0, "maximum candidate pT"};
7270
Configurable<float> candYMin{"candYMin", -0.8, "minimum candidate eta"};
@@ -126,29 +124,18 @@ struct JetFinderHFTask {
126124
jetFinder.ghostArea = jetGhostArea;
127125
jetFinder.ghostRepeatN = ghostRepeat;
128126

129-
auto candSpecie = static_cast<std::string>(candSpecie_s);
130-
auto candDecayChannel = static_cast<std::string>(candDecayChannel_s);
131-
if (candSpecie == "D0") {
127+
if (doprocessD0ChargedJetsData || doprocessD0ChargedJetsMCD || doprocessD0ChargedJetsMCP) { // Note : need to be careful if configurable workflow options are added later
132128
candPDG = static_cast<int>(pdg::Code::kD0);
133129
candDecay = static_cast<int>(aod::hf_cand_2prong::DecayType::D0ToPiK);
134130
}
135-
if (candSpecie == "Bplus") {
131+
if (doprocessBplusChargedJetsData || doprocessBplusChargedJetsMCD || doprocessBplusChargedJetsMCP) {
136132
candPDG = static_cast<int>(pdg::Code::kBPlus);
137133
candDecay = static_cast<int>(aod::hf_cand_bplus::DecayType::BplusToD0Pi);
138134
}
139-
if (candSpecie == "Lc") {
135+
if (doprocessLcChargedJetsData || doprocessLcChargedJetsMCD || doprocessLcChargedJetsMCP) {
140136
candPDG = static_cast<int>(pdg::Code::kLambdaCPlus);
141137
candDecay = static_cast<int>(aod::hf_cand_3prong::DecayType::LcToPKPi);
142138
}
143-
if (candSpecie == "JPsi") {
144-
candPDG = static_cast<int>(pdg::Code::kJPsi);
145-
if (candDecayChannel == "default" || candDecayChannel == "ee") {
146-
candDecay = static_cast<int>(aod::hf_cand_2prong::DecayType::JpsiToEE);
147-
}
148-
if (candDecayChannel == "mumu") {
149-
candDecay = static_cast<int>(aod::hf_cand_2prong::DecayType::JpsiToMuMu);
150-
}
151-
}
152139
}
153140

154141
o2::aod::EMCALClusterDefinition clusterDefinition = o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionS.value);
@@ -198,9 +185,13 @@ struct JetFinderHFTask {
198185
}
199186

200187
// function that generalically processes gen level events
201-
template <typename T, typename U, typename M>
202-
void analyseMCGenParticles(T const& collision, U const& particles, M& candidates)
188+
template <typename T, typename U>
189+
void analyseMCP(T const& collision, U const& particles)
203190
{
191+
inputParticles.clear();
192+
std::vector<typename U::iterator> candidates;
193+
candidates.clear();
194+
204195
for (auto const& particle : particles) {
205196
if (std::abs(particle.flagMcMatchGen()) & (1 << candDecay)) {
206197
auto particleY = RecoDecay::y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()));
@@ -220,34 +211,6 @@ struct JetFinderHFTask {
220211
}
221212
}
222213

223-
// check if type JetParticles2Prong can be templated. then you can just use one function everywhere
224-
// function that is called for gen level events with 2 prong candidates
225-
template <typename T, typename U>
226-
void analyseMCGen2Prong(T const& collision, U const& particles)
227-
{
228-
inputParticles.clear();
229-
std::vector<JetParticles2Prong::iterator> candidates;
230-
candidates.clear();
231-
analyseMCGenParticles(collision, particles, candidates);
232-
}
233-
// function that is called for gen level events with 3 prong candidates
234-
template <typename T, typename U>
235-
void analyseMCGen3Prong(T const& collision, U const& particles)
236-
{
237-
inputParticles.clear();
238-
std::vector<JetParticles3Prong::iterator> candidates;
239-
analyseMCGenParticles(collision, particles, candidates);
240-
}
241-
// function that is called for gen level events with B+ candidates
242-
template <typename T, typename U>
243-
void analyseMCGenBplus(T const& collision, U const& particles)
244-
{
245-
inputParticles.clear();
246-
std::vector<JetParticlesBplus::iterator> candidates;
247-
candidates.clear();
248-
analyseMCGenParticles(collision, particles, candidates);
249-
}
250-
251214
void processDummy(aod::Collisions const& collision)
252215
{
253216
}
@@ -259,38 +222,38 @@ struct JetFinderHFTask {
259222
void processD0ChargedJetsMCD(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, JetTracks const& tracks, CandidateD0MC const& candidates) { analyseMCD(collision, tracks, candidates); }
260223
PROCESS_SWITCH(JetFinderHFTask, processD0ChargedJetsMCD, "D0 finding on MC detector level", false);
261224

225+
void processD0ChargedJetsMCP(aod::McCollision const& collision,
226+
JetParticlesD0 const& particles)
227+
{
228+
analyseMCP(collision, particles);
229+
}
230+
PROCESS_SWITCH(JetFinderHFTask, processD0ChargedJetsMCP, "D0 jet finding on MC particle level", false);
231+
262232
void processBplusChargedJetsData(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator const& collision, JetTracks const& tracks, CandidateBplusData const& candidates, aod::HfCand2Prong const& HFdaughters) { analyseData(collision, tracks, candidates); }
263233
PROCESS_SWITCH(JetFinderHFTask, processBplusChargedJetsData, "B+ jet finding on data", false);
264234

265235
void processBplusChargedJetsMCD(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, JetTracks const& tracks, CandidateBplusMC const& candidates, aod::HfCand2Prong const& HFdaughters) { analyseMCD(collision, tracks, candidates); }
266236
PROCESS_SWITCH(JetFinderHFTask, processBplusChargedJetsMCD, "B+ finding on MC detector level", false);
267237

238+
void processBplusChargedJetsMCP(aod::McCollision const& collision,
239+
JetParticlesBplus const& particles)
240+
{
241+
analyseMCP(collision, particles);
242+
}
243+
PROCESS_SWITCH(JetFinderHFTask, processBplusChargedJetsMCP, "B+ jet finding on MC particle level", false);
244+
268245
void processLcChargedJetsData(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator const& collision, JetTracks const& tracks, CandidateLcData const& candidates) { analyseData(collision, tracks, candidates); }
269246
PROCESS_SWITCH(JetFinderHFTask, processLcChargedJetsData, "Lc jet finding on data", false);
270247

271248
void processLcChargedJetsMCD(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, JetTracks const& tracks, CandidateLcMC const& candidates) { analyseMCD(collision, tracks, candidates); }
272249
PROCESS_SWITCH(JetFinderHFTask, processLcChargedJetsMCD, "Lc finding on MC detector level", false);
273250

274-
void process2ProngJetsMCP(aod::McCollision const& collision,
275-
JetParticles2Prong const& particles)
276-
{
277-
analyseMCGen2Prong(collision, particles);
278-
}
279-
PROCESS_SWITCH(JetFinderHFTask, process2ProngJetsMCP, "2-prong HF jet finding on MC particle level", false);
280-
281-
void process3ProngJetsMCP(aod::McCollision const& collision,
282-
JetParticles3Prong const& particles)
283-
{
284-
analyseMCGen3Prong(collision, particles);
285-
}
286-
PROCESS_SWITCH(JetFinderHFTask, process3ProngJetsMCP, "3-prong HF jet finding on MC particle level", false);
287-
288-
void processBplusJetsMCP(aod::McCollision const& collision,
289-
JetParticlesBplus const& particles)
251+
void processLcChargedJetsMCP(aod::McCollision const& collision,
252+
JetParticlesLc const& particles)
290253
{
291-
analyseMCGenBplus(collision, particles);
254+
analyseMCP(collision, particles);
292255
}
293-
PROCESS_SWITCH(JetFinderHFTask, processBplusJetsMCP, "B+ HF jet finding on MC particle level", false);
256+
PROCESS_SWITCH(JetFinderHFTask, processLcChargedJetsMCP, "Lc jet finding on MC particle level", false);
294257
};
295258
/*
296259
using JetFinderD0DataCharged = JetFinderHFTask<o2::aod::D0ChargedJets, o2::aod::D0ChargedJetConstituents, o2::aod::D0ChargedJetConstituentsSub>;

0 commit comments

Comments
 (0)