|
| 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 | +/// \author Xu wang <wangxuwx@mails.ccnu.edu.cn>. |
| 13 | +#include "CommonConstants/PhysicsConstants.h" |
| 14 | +#include "Framework/AnalysisTask.h" |
| 15 | +#include "Framework/HistogramRegistry.h" |
| 16 | +#include "Framework/runDataProcessing.h" |
| 17 | + |
| 18 | +#include "Common/Core/TrackSelection.h" |
| 19 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 20 | +#include "Common/DataModel/Centrality.h" |
| 21 | +#include "Common/DataModel/Multiplicity.h" |
| 22 | + |
| 23 | +#include "PWGHF/Core/HfHelper.h" |
| 24 | +#include "PWGHF/DataModel/CandidateReconstructionTables.h" |
| 25 | +#include "PWGHF/DataModel/CandidateSelectionTables.h" |
| 26 | +#include "PWGHF/HFC/DataModel/CorrelationTables.h" |
| 27 | +//#include "d0minijet.h" |
| 28 | + |
| 29 | +using namespace o2; |
| 30 | +using namespace o2::analysis; |
| 31 | +using namespace o2::aod::hf_cand_2prong; |
| 32 | +using namespace o2::constants::physics; |
| 33 | +using namespace o2::framework; |
| 34 | +// using namespace o2::do_mini_jet; |
| 35 | + |
| 36 | +// histogram binning definition |
| 37 | +const int ptDAxisBins = 180; |
| 38 | +const double ptDAxisMin = 0.; |
| 39 | +const double ptDAxisMax = 36.; |
| 40 | +const int yAxisBins = 100; |
| 41 | +const double yAxisMin = -5.; |
| 42 | +const double yAxisMax = 5.; |
| 43 | +const int phiAxisBins = 32; |
| 44 | +const double phiAxisMin = 0.; |
| 45 | +const double phiAxisMax = o2::constants::math::TwoPI; |
| 46 | +const int massAxisBins = 120; |
| 47 | +const double massAxisMin = 1.5848; |
| 48 | +const double massAxisMax = 2.1848; |
| 49 | + |
| 50 | +double getDeltaPhi(double phiHadron, double phiD) |
| 51 | +{ |
| 52 | + return RecoDecay::constrainAngle(phiHadron - phiD, -o2::constants::math::PIHalf); |
| 53 | +} |
| 54 | + |
| 55 | +struct A_D0minijet { |
| 56 | + SliceCache cache; |
| 57 | + Produces<aod::DHadronPair> entryD0HadronPair; |
| 58 | + // Produces<aod::DHadronRecoInfo> entryD0HadronRecoInfo; |
| 59 | + // Produces<aod::dominijet> rowdominijet; |
| 60 | + std::vector<int> vtriggerFlag; |
| 61 | + Configurable<double> cutforwardjet{"cutforwardjet", 0.9, "the range of forwardjet"}; |
| 62 | + Configurable<double> cutbackwardjet{"cutbackwardjet", 1.4, "the range of backwardjet"}; |
| 63 | + Configurable<double> cuttriggerpt{"cuttriggerpt", 1., "the range of trigger particle pt"}; |
| 64 | + Configurable<double> multMin{"multMin", 0., "minimum multiplicity accepted"}; |
| 65 | + Configurable<double> multMax{"multMax", 10000., "maximum multiplicity accepted"}; |
| 66 | + Configurable<double> yCandMax{"yCandMax", -1., "max. cand. rapidity"}; |
| 67 | + Configurable<double> ptCandMin{"ptCandMin", -1., "min. cand. pT"}; |
| 68 | + Configurable<int> triggerFlag{"triggerFlag", 1, "trigger Flag"}; |
| 69 | + Configurable<int> selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; |
| 70 | + Configurable<int> selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; |
| 71 | + Configurable<std::vector<double>> bins{"ptBinsForMassAndEfficiency", std::vector<double>{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; |
| 72 | + |
| 73 | + HfHelper hfHelper; |
| 74 | + |
| 75 | + HistogramRegistry registry{ |
| 76 | + "registry", |
| 77 | + { |
| 78 | + {"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, |
| 79 | + {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, |
| 80 | + {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, |
| 81 | + {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, |
| 82 | + {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, |
| 83 | + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, |
| 84 | + }}; |
| 85 | + Partition<soa::Join<aod::HfCand2Prong, aod::HfSelD0>> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; |
| 86 | + void init(InitContext const&) |
| 87 | + { |
| 88 | + auto vbins = (std::vector<double>)bins; |
| 89 | + // registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); |
| 90 | + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); |
| 91 | + registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); |
| 92 | + registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); |
| 93 | + } |
| 94 | + void processData(aod::Collision const& collision, aod::TracksWDca const& tracks, soa::Join<aod::HfCand2Prong, aod::HfSelD0> const&) |
| 95 | + { |
| 96 | + int nTracks = 0; |
| 97 | + int ntriggers = 0; |
| 98 | + double setparticlestatus = 0; |
| 99 | + if (collision.numContrib() > 1) { |
| 100 | + for (const auto& track : tracks) { |
| 101 | + if (track.eta() < -4.0 || track.eta() > 4.0) { |
| 102 | + vtriggerFlag.push_back(0); |
| 103 | + continue; |
| 104 | + } |
| 105 | + if (std::abs(track.dcaXY()) > 0.0025 || std::abs(track.dcaZ()) > 0.0025) { |
| 106 | + vtriggerFlag.push_back(0); |
| 107 | + continue; |
| 108 | + } |
| 109 | + if (track.pt() > cuttriggerpt) { |
| 110 | + ntriggers++; |
| 111 | + } |
| 112 | + nTracks++; |
| 113 | + } |
| 114 | + } |
| 115 | + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); |
| 116 | + if (nTracks < multMin || nTracks > multMax) { |
| 117 | + return; |
| 118 | + } |
| 119 | + registry.fill(HIST("hMultiplicity"), nTracks); |
| 120 | + |
| 121 | + auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); |
| 122 | + |
| 123 | + for (const auto& candidate1 : selectedD0CandidatesGrouped) { |
| 124 | + if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate1)) > yCandMax) { |
| 125 | + continue; |
| 126 | + } |
| 127 | + if (ptCandMin >= 0. && candidate1.pt() < ptCandMin) { |
| 128 | + continue; |
| 129 | + } |
| 130 | + // check decay channel flag for candidate1 |
| 131 | + if (!(candidate1.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { |
| 132 | + continue; |
| 133 | + } |
| 134 | + // ========================== Fill mass histo ================================ |
| 135 | + if (candidate1.isSelD0() >= selectionFlagD0) { |
| 136 | + registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt()); |
| 137 | + registry.fill(HIST("hMassD0"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt()); |
| 138 | + } |
| 139 | + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { |
| 140 | + registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt()); |
| 141 | + registry.fill(HIST("hMassD0bar"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt()); |
| 142 | + } |
| 143 | + // ========================== Fill general histos ================================ |
| 144 | + registry.fill(HIST("hPtCand"), candidate1.pt()); |
| 145 | + registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); |
| 146 | + registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); |
| 147 | + registry.fill(HIST("hEta"), candidate1.eta()); |
| 148 | + registry.fill(HIST("hPhi"), candidate1.phi()); |
| 149 | + registry.fill(HIST("hY"), hfHelper.yD0(candidate1)); |
| 150 | + for (const auto& track : tracks) { |
| 151 | + registry.fill(HIST("hTrackCounter"), 1); // fill total no. of tracks |
| 152 | + // Remove D0 daughters by checking track indices |
| 153 | + if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { |
| 154 | + continue; |
| 155 | + } |
| 156 | + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { |
| 157 | + continue; |
| 158 | + } // Remove secondary tracks |
| 159 | + |
| 160 | + registry.fill(HIST("hTrackCounter"), 2); // fill no. of tracks before soft pion removal |
| 161 | + |
| 162 | + if (track.pt() < cuttriggerpt) { |
| 163 | + continue; |
| 164 | + } |
| 165 | + double deltaPhi = getDeltaPhi(track.phi(), candidate1.phi()); |
| 166 | + // double deltaEta = track.eta() - candidate1.eta(); |
| 167 | + setparticlestatus = 0; |
| 168 | + if (std::abs(deltaPhi) <= cutforwardjet) { |
| 169 | + setparticlestatus = 1; |
| 170 | + } |
| 171 | + if (std::abs(deltaPhi - o2::constants::math::PI) <= cutbackwardjet) { |
| 172 | + setparticlestatus = 2; |
| 173 | + } |
| 174 | + |
| 175 | + entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), track.eta() - candidate1.eta(), candidate1.pt(), track.pt(), setparticlestatus); |
| 176 | + } |
| 177 | + } |
| 178 | + } |
| 179 | + PROCESS_SWITCH(A_D0minijet, processData, "d0 mini jet", true); |
| 180 | +}; |
| 181 | + |
| 182 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 183 | +{ |
| 184 | + WorkflowSpec workflow{adaptAnalysisTask<A_D0minijet>(cfgc)}; |
| 185 | + return workflow; |
| 186 | +} |
0 commit comments