Skip to content

Commit ffc8b77

Browse files
authored
PWGHF: Add a skeleton for HF + track task (#5345)
* Attempt to run a HF+track reconstruction * Update taskBPlus.cxx * Update taskBPlus.cxx * Fix Clang * Update taskBPlus.cxx
1 parent df57e01 commit ffc8b77

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

Analysis/Tasks/PWGHF/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ o2_add_dpl_workflow(hf-task-jpsi
7272
SOURCES taskJpsi.cxx
7373
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::AnalysisCore O2::DetectorsVertexing
7474
COMPONENT_NAME Analysis)
75+
76+
o2_add_dpl_workflow(hf-task-bplus
77+
SOURCES taskBPlus.cxx
78+
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::AnalysisCore O2::DetectorsVertexing
79+
COMPONENT_NAME Analysis)

Analysis/Tasks/PWGHF/taskBPlus.cxx

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file taskBplus.cxx
12+
/// \brief B+ analysis task
13+
///
14+
/// \author Gian Michele Innocenti <gian.michele.innocenti@cern.ch>, CERN
15+
/// \author Vít Kučera <vit.kucera@cern.ch>, CERN
16+
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>, CERN
17+
18+
#include "Framework/AnalysisTask.h"
19+
#include "Framework/HistogramRegistry.h"
20+
#include "AnalysisDataModel/HFSecondaryVertex.h"
21+
#include "AnalysisDataModel/HFCandidateSelectionTables.h"
22+
23+
using namespace o2;
24+
using namespace o2::framework;
25+
using namespace o2::aod::hf_cand_prong2;
26+
using namespace o2::framework::expressions;
27+
28+
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
29+
{
30+
ConfigParamSpec optionDoMC{"doMC", VariantType::Bool, false, {"Fill MC histograms."}};
31+
workflowOptions.push_back(optionDoMC);
32+
}
33+
34+
#include "Framework/runDataProcessing.h"
35+
36+
/// B+ analysis task
37+
struct TaskBplus {
38+
HistogramRegistry registry{
39+
"registry",
40+
{{"hmassD0", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}},
41+
{"hptcand", "B+ candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}}};
42+
43+
Configurable<int> d_selectionFlagD0{"d_selectionFlagD0", 1, "Selection Flag for D0"};
44+
Configurable<int> d_selectionFlagD0bar{"d_selectionFlagD0bar", 1, "Selection Flag for D0bar"};
45+
Configurable<double> cutEtaCandMax{"cutEtaCandMax", -1., "max. cand. pseudorapidity"};
46+
47+
Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar);
48+
49+
void process(aod::Collisions const& collisions, aod::BigTracks const& tracks, soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelD0Candidate>> const& candidates)
50+
{
51+
for (auto& candidate : candidates) {
52+
if (!(candidate.hfflag() & 1 << D0ToPiK)) {
53+
continue;
54+
}
55+
if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) {
56+
//Printf("Candidate: eta rejection: %g", candidate.eta());
57+
continue;
58+
}
59+
if (candidate.isSelD0bar() >= d_selectionFlagD0bar) {
60+
//Printf("Track size: %d", tracks.size());
61+
registry.fill(HIST("hmassD0"), InvMassD0bar(candidate));
62+
for (auto trackPos1 = tracks.begin(); trackPos1 != tracks.end(); ++trackPos1) {
63+
if (trackPos1.signed1Pt() < 0) {
64+
continue;
65+
}
66+
if (candidate.index0().collisionId() != trackPos1.collisionId()) {
67+
continue;
68+
}
69+
//Printf("Positive track pt: %f", trackPos1.pt());
70+
registry.fill(HIST("hptcand"), candidate.pt() + trackPos1.pt());
71+
}
72+
}
73+
}
74+
}
75+
};
76+
77+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
78+
{
79+
WorkflowSpec workflow{
80+
adaptAnalysisTask<TaskBplus>("hf-task-bplus")};
81+
return workflow;
82+
}

0 commit comments

Comments
 (0)