Skip to content

Commit a31e563

Browse files
committed
adding HFHBar
1 parent b2129c8 commit a31e563

14 files changed

+757
-133
lines changed

PWGJE/Core/JetMatchingUtilities.h

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -364,30 +364,37 @@ void MatchHF(T const& jetsBasePerCollision, U const& jetsTagPerCollision, std::v
364364
if (jetBase.candidatesIds().size() == 0) {
365365
continue;
366366
}
367-
const auto candidateBase = jetBase.template candidates_first_as<V>();
368367
for (const auto& jetTag : jetsTagPerCollision) {
369368
if (jetTag.candidatesIds().size() == 0) {
370369
continue;
371370
}
372371
if (std::round(jetBase.r()) != std::round(jetTag.r())) {
373372
continue;
374373
}
375-
if constexpr (jetsBaseIsMc || jetsTagIsMc) {
376-
if (jetcandidateutilities::isMatchedCandidate(candidateBase)) {
377-
const auto candidateBaseMcId = jetcandidateutilities::matchedParticleId(candidateBase, tracksBase, tracksTag);
378-
const auto candidateTag = jetTag.template candidates_first_as<M>();
379-
const auto candidateTagId = candidateTag.mcParticleId();
380-
if (candidateBaseMcId == candidateTagId) {
381-
baseToTagMatchingHF[jetBase.globalIndex()].push_back(jetTag.globalIndex());
382-
tagToBaseMatchingHF[jetTag.globalIndex()].push_back(jetBase.globalIndex());
374+
auto const& candidatesBase = jetBase.template candidates_as<V>();
375+
std::size_t iCandidateBaseMatched = 0;
376+
for (auto const& candidateBase : candidatesBase) {
377+
if constexpr (jetsBaseIsMc || jetsTagIsMc) {
378+
if (jetcandidateutilities::isMatchedCandidate(candidateBase)) {
379+
const auto candidateBaseMcId = jetcandidateutilities::matchedParticleId(candidateBase, tracksBase, tracksTag);
380+
for (auto const& candidateTag : jetTag.template candidates_as<M>()) {
381+
const auto candidateTagId = candidateTag.mcParticleId();
382+
if (candidateBaseMcId == candidateTagId) {
383+
iCandidateBaseMatched++;
384+
}
385+
}
386+
}
387+
} else {
388+
for (auto const& candidateTag : jetTag.template candidates_as<M>()) {
389+
if (candidateBase.globalIndex() == candidateTag.globalIndex()) {
390+
iCandidateBaseMatched++;
391+
}
383392
}
384393
}
385-
} else {
386-
const auto candidateTag = jetTag.template candidates_first_as<M>();
387-
if (candidateBase.globalIndex() == candidateTag.globalIndex()) {
388-
baseToTagMatchingHF[jetBase.globalIndex()].push_back(jetTag.globalIndex());
389-
tagToBaseMatchingHF[jetTag.globalIndex()].push_back(jetBase.globalIndex());
390-
}
394+
}
395+
if (iCandidateBaseMatched == candidatesBase.size()) {
396+
baseToTagMatchingHF[jetBase.globalIndex()].push_back(jetTag.globalIndex());
397+
tagToBaseMatchingHF[jetTag.globalIndex()].push_back(jetBase.globalIndex());
391398
}
392399
}
393400
}

PWGJE/DataModel/JetSubstructure.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(R, r, //!
204204
{ \
205205
DECLARE_SOA_INDEX_COLUMN_CUSTOM(_jet_type_##CO, collision, _jet_description_ "COs"); \
206206
DECLARE_SOA_INDEX_COLUMN_FULL_CUSTOM(Candidate, candidate, int, _cand_type_, _cand_description_ "S", "_0"); \
207+
DECLARE_SOA_ARRAY_INDEX_COLUMN_FULL_CUSTOM(Candidates, candidates, int32_t, _cand_type_, _cand_description_ "S", "_0"); \
207208
DECLARE_SOA_INDEX_COLUMN(_jet_recoil_type_, jet); \
208209
} \
209-
DECLARE_SOA_TABLE(_jet_type_##Os, "AOD", _jet_description_ "O", o2::soa::Index<>, _name_##jetoutput::_jet_type_##COId, _name_##jetoutput::CandidateId, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetY, jetoutput::JetR, jetoutput::JetArea, jetoutput::JetRho, jetoutput::JetPerpConeRho, jetoutput::JetNConstituents); \
210+
DECLARE_SOA_TABLE(_jet_type_##Os, "AOD", _jet_description_ "O", o2::soa::Index<>, _name_##jetoutput::_jet_type_##COId, _name_##jetoutput::CandidatesIds, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetY, jetoutput::JetR, jetoutput::JetArea, jetoutput::JetRho, jetoutput::JetPerpConeRho, jetoutput::JetNConstituents); \
210211
DECLARE_SOA_TABLE(_jet_type_##Rs, "AOD", _jet_description_ "R", _name_##jetoutput::_jet_recoil_type_##Id, _name_##jetoutput::CandidateId, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetR, jetoutput::JetNConstituents, jetoutput::Pt<jetoutput::JetPt>, jetoutput::Phi<jetoutput::JetPhi>, jetoutput::Eta<jetoutput::JetEta>, jetoutput::R<jetoutput::JetR>); \
211212
DECLARE_SOA_TABLE(_jet_type_##ROs, "AOD", _jet_description_ "RO", o2::soa::Index<>, _name_##jetoutput::CandidateId, jetoutput::JetPt, jetoutput::JetPhi, jetoutput::JetEta, jetoutput::JetR, jetoutput::JetNConstituents); \
212213
using _jet_type_##O = _jet_type_##Os::iterator; \

PWGJE/JetFinders/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,34 @@ o2physics_add_dpl_workflow(jet-finder-dielectron-mcp-charged
209209
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
210210
COMPONENT_NAME Analysis)
211211

212+
o2physics_add_dpl_workflow(jet-finder-d0d0bar-data-charged
213+
SOURCES jetFinderD0D0BarDataCharged.cxx
214+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
215+
COMPONENT_NAME Analysis)
216+
217+
o2physics_add_dpl_workflow(jet-finder-d0d0bar-mcd-charged
218+
SOURCES jetFinderD0D0BarMCDCharged.cxx
219+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
220+
COMPONENT_NAME Analysis)
221+
222+
o2physics_add_dpl_workflow(jet-finder-d0d0bar-mcp-charged
223+
SOURCES jetFinderD0D0BarMCPCharged.cxx
224+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
225+
COMPONENT_NAME Analysis)
226+
227+
o2physics_add_dpl_workflow(jet-finder-dplusdminus-data-charged
228+
SOURCES jetFinderDplusDminusDataCharged.cxx
229+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
230+
COMPONENT_NAME Analysis)
231+
232+
o2physics_add_dpl_workflow(jet-finder-dplusdminus-mcd-charged
233+
SOURCES jetFinderDplusDminusMCDCharged.cxx
234+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
235+
COMPONENT_NAME Analysis)
236+
237+
o2physics_add_dpl_workflow(jet-finder-dplusdminus-mcp-charged
238+
SOURCES jetFinderDplusDminusMCPCharged.cxx
239+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport
240+
COMPONENT_NAME Analysis)
241+
212242
endif()
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 d0-d0bar data charged task
13+
//
14+
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>
15+
16+
#include "PWGJE/DataModel/Jet.h"
17+
#include "PWGJE/JetFinders/jetFinderHFHFBar.h"
18+
19+
#include <Framework/AnalysisTask.h>
20+
#include <Framework/ConfigContext.h>
21+
#include <Framework/DataProcessorSpec.h>
22+
#include <Framework/runDataProcessing.h>
23+
24+
#include <vector>
25+
26+
using namespace o2;
27+
using namespace o2::framework;
28+
using namespace o2::framework::expressions;
29+
30+
using JetFinderD0D0BarDataCharged = JetFinderHFHFBarTask<aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JetTracksSubD0, aod::JetParticlesSubD0, aod::D0ChargedJets, aod::D0ChargedJetConstituents, aod::D0ChargedEventWiseSubtractedJets, aod::D0ChargedEventWiseSubtractedJetConstituents>;
31+
32+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
33+
{
34+
std::vector<o2::framework::DataProcessorSpec> tasks;
35+
36+
tasks.emplace_back(adaptAnalysisTask<JetFinderD0D0BarDataCharged>(cfgc,
37+
SetDefaultProcesses{{{"processChargedJetsData", true}}},
38+
TaskName{"jet-finder-d0d0bar-data-charged"}));
39+
40+
return WorkflowSpec{tasks};
41+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 d0-d0bar mcd charged task
13+
//
14+
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>
15+
16+
#include "PWGJE/DataModel/Jet.h"
17+
#include "PWGJE/JetFinders/jetFinderHFHFBar.h"
18+
19+
#include <Framework/AnalysisTask.h>
20+
#include <Framework/ConfigContext.h>
21+
#include <Framework/DataProcessorSpec.h>
22+
#include <Framework/runDataProcessing.h>
23+
24+
#include <vector>
25+
26+
using namespace o2;
27+
using namespace o2::framework;
28+
using namespace o2::framework::expressions;
29+
30+
using JetFinderD0D0BarMCDetectorLevelCharged = JetFinderHFHFBarTask<aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JetTracksSubD0, aod::JetParticlesSubD0, aod::D0ChargedMCDetectorLevelJets, aod::D0ChargedMCDetectorLevelJetConstituents, aod::D0ChargedMCDetectorLevelEventWiseSubtractedJets, aod::D0ChargedMCDetectorLevelEventWiseSubtractedJetConstituents>;
31+
32+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
33+
{
34+
std::vector<o2::framework::DataProcessorSpec> tasks;
35+
36+
tasks.emplace_back(adaptAnalysisTask<JetFinderD0D0BarMCDetectorLevelCharged>(cfgc,
37+
SetDefaultProcesses{{{"processChargedJetsMCD", true}}},
38+
TaskName{"jet-finder-d0d0bar-mcd-charged"}));
39+
40+
return WorkflowSpec{tasks};
41+
}

0 commit comments

Comments
 (0)