|
| 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 | +/// \brief this is a starting point for the Resonances tutorial |
| 13 | +/// \author junlee kim |
| 14 | + |
| 15 | +#include <Framework/Configurable.h> |
| 16 | +#include <TLorentzVector.h> |
| 17 | +#include <Math/GenVector/Boost.h> |
| 18 | +#include <Math/Vector4D.h> |
| 19 | +#include <Math/Vector3D.h> |
| 20 | +#include <TMath.h> |
| 21 | +#include <TRandom3.h> |
| 22 | +#include <fairlogger/Logger.h> |
| 23 | +#include <iostream> |
| 24 | +#include <iterator> |
| 25 | +#include <string> |
| 26 | +#include <vector> |
| 27 | + |
| 28 | +#include "Framework/AnalysisTask.h" |
| 29 | +#include "Framework/ASoAHelpers.h" |
| 30 | +#include "Framework/runDataProcessing.h" |
| 31 | +#include "Framework/AnalysisDataModel.h" |
| 32 | +#include "Framework/StepTHn.h" |
| 33 | +#include "Common/Core/trackUtilities.h" |
| 34 | +#include "PWGLF/DataModel/ReducedHeptaQuarkTables.h" |
| 35 | +#include "CommonConstants/PhysicsConstants.h" |
| 36 | + |
| 37 | +using namespace o2; |
| 38 | +using namespace o2::framework; |
| 39 | +using namespace o2::framework::expressions; |
| 40 | +using namespace o2::soa; |
| 41 | + |
| 42 | +struct heptaquark { |
| 43 | + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
| 44 | + Configurable<bool> cfgRotBkg{"cfgRotBkg", true, "flag to construct rotational backgrounds"}; |
| 45 | + Configurable<int> cfgNRotBkg{"cfgNRotBkg", 10, "the number of rotational backgrounds"}; |
| 46 | + |
| 47 | + Configurable<int> cfgPIDStrategy{"cfgPIDStrategy", 3, "PID strategy 1"}; |
| 48 | + Configurable<float> cfgPIDPrPi{"cfgPIDPrPi", 3, "PID selection for proton and pion"}; |
| 49 | + |
| 50 | + Configurable<float> minPhiMass{"minPhiMass", 1.01, "Minimum phi mass"}; |
| 51 | + Configurable<float> maxPhiMass{"maxPhiMass", 1.03, "Maximum phi mass"}; |
| 52 | + |
| 53 | + Configurable<float> minLambdaMass{"minLambdaMass", 1.1, "Minimum lambda mass"}; |
| 54 | + Configurable<float> maxLambdaMass{"maxLambdaMass", 1.13, "Maximum lambda mass"}; |
| 55 | + |
| 56 | + Configurable<float> cutNsigmaTPC{"cutNsigmaTPC", 2.5, "nsigma cut TPC"}; |
| 57 | + Configurable<float> cutNsigmaTOF{"cutNsigmaTOF", 3.0, "nsigma cut TOF"}; |
| 58 | + |
| 59 | + ConfigurableAxis massAxis{"massAxis", {600, 2.8, 3.4}, "Invariant mass axis"}; |
| 60 | + ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "Transverse momentum bins"}; |
| 61 | + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 20, 50, 100}, "Centrality interval"}; |
| 62 | + ConfigurableAxis massPPAxis{"massPPAxis", {100, 3.0, 8.0}, "Mass square of phi phi"}; |
| 63 | + ConfigurableAxis massPLAxis{"massPLAxis", {100, 3.0, 8.0}, "Mass square of phi lambda"}; |
| 64 | + |
| 65 | + void init(o2::framework::InitContext&) |
| 66 | + { |
| 67 | + histos.add("hnsigmaTPCPi", "hnsigmaTPCPi", kTH2F, {{1000, -7.0, 7.0f}, {100, 0.0f, 10.0f}}); |
| 68 | + |
| 69 | + histos.add("hnsigmaTPCKa", "hnsigmaTPCKa", kTH2F, {{1000, -7.0, 7.0f}, {100, 0.0f, 10.0f}}); |
| 70 | + histos.add("hnsigmaTOFKa", "hnsigmaTOFKa", kTH2F, {{1000, -7.0, 7.0f}, {100, 0.0f, 10.0f}}); |
| 71 | + |
| 72 | + histos.add("hnsigmaTPCPr", "hnsigmaTPCPr", kTH2F, {{1000, -7.0, 7.0f}, {100, 0.0f, 10.0f}}); |
| 73 | + |
| 74 | + histos.add("hPhid1Mass", "hPhid1Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}}); |
| 75 | + histos.add("hPhid2Mass", "hPhid2Mass", kTH2F, {{40, 1.0, 1.04f}, {100, 0.0f, 10.0f}}); |
| 76 | + histos.add("hLambdaMass", "hLambdaMass", kTH2F, {{140, 1.095, 1.135}, {100, 0.0f, 10.0f}}); |
| 77 | + |
| 78 | + histos.add("h_InvMass_same", "h_InvMass_same", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); |
| 79 | + histos.add("h_InvMass_rotPhi", "h_InvMass_rotPhi", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); |
| 80 | + histos.add("h_InvMass_rotLambda", "h_InvMass_rotLambda", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); |
| 81 | + histos.add("h_InvMass_rotPhiLambda", "h_InvMass_rotPhiLambda", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); |
| 82 | + |
| 83 | + histos.add("hDalitz", "hDalitz", {HistType::kTHnSparseF, {massPPAxis, massPLAxis, massAxis, ptAxis, centAxis}}); |
| 84 | + histos.add("hDalitzRot", "hDalitzRot", {HistType::kTHnSparseF, {massPPAxis, massPLAxis, massAxis, ptAxis, centAxis}}); |
| 85 | + } |
| 86 | + |
| 87 | + double massLambda = o2::constants::physics::MassLambda; |
| 88 | + double massPr = o2::constants::physics::MassProton; |
| 89 | + double massPi = o2::constants::physics::MassPionCharged; |
| 90 | + double massKa = o2::constants::physics::MassKPlus; |
| 91 | + |
| 92 | + TRandom* rn = new TRandom(); |
| 93 | + |
| 94 | + bool selectionPIDKaon(float nsigmaTPC, float nsigmaTOF, int TOFHit, int PIDStrategy, float ptcand) |
| 95 | + { |
| 96 | + if (PIDStrategy == 0) { |
| 97 | + if (TOFHit != 1) { |
| 98 | + if (TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 99 | + return true; |
| 100 | + } |
| 101 | + } |
| 102 | + if (TOFHit == 1) { |
| 103 | + if (TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 104 | + return true; |
| 105 | + } |
| 106 | + } |
| 107 | + } |
| 108 | + if (PIDStrategy == 1) { |
| 109 | + if (ptcand < 0.5) { |
| 110 | + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 111 | + return true; |
| 112 | + } |
| 113 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 114 | + return true; |
| 115 | + } |
| 116 | + } |
| 117 | + if (ptcand >= 0.5) { |
| 118 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 119 | + return true; |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | + if (PIDStrategy == 2) { |
| 124 | + if (ptcand < 0.5) { |
| 125 | + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 126 | + return true; |
| 127 | + } |
| 128 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 129 | + return true; |
| 130 | + } |
| 131 | + } |
| 132 | + if (ptcand >= 0.5 && ptcand < 1.2) { |
| 133 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 134 | + return true; |
| 135 | + } |
| 136 | + if (TOFHit != 1 && nsigmaTPC > -1.5 && nsigmaTPC < cutNsigmaTPC) { |
| 137 | + return true; |
| 138 | + } |
| 139 | + } |
| 140 | + if (ptcand >= 1.2) { |
| 141 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 142 | + return true; |
| 143 | + } |
| 144 | + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 145 | + return true; |
| 146 | + } |
| 147 | + } |
| 148 | + } |
| 149 | + if (PIDStrategy == 3) { |
| 150 | + if (ptcand < 0.5) { |
| 151 | + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 152 | + return true; |
| 153 | + } |
| 154 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 155 | + return true; |
| 156 | + } |
| 157 | + } |
| 158 | + if (ptcand >= 0.5 && ptcand < 1.2) { |
| 159 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 160 | + return true; |
| 161 | + } |
| 162 | + } |
| 163 | + if (ptcand >= 1.2) { |
| 164 | + if (TOFHit == 1 && TMath::Abs(nsigmaTOF) < cutNsigmaTOF) { |
| 165 | + return true; |
| 166 | + } |
| 167 | + if (TOFHit != 1 && TMath::Abs(nsigmaTPC) < cutNsigmaTPC) { |
| 168 | + return true; |
| 169 | + } |
| 170 | + } |
| 171 | + } |
| 172 | + return false; |
| 173 | + } |
| 174 | + |
| 175 | + ROOT::Math::PxPyPzMVector DauVec1, DauVec2; |
| 176 | + |
| 177 | + TLorentzVector exotic, HQ1, HQ2, HQ3; |
| 178 | + TLorentzVector exoticRot2, HQ2Rot; |
| 179 | + TLorentzVector exoticRot3, HQ3Rot; |
| 180 | + TLorentzVector exoticRot23; |
| 181 | + TLorentzVector HQ12, HQ13; |
| 182 | + TLorentzVector HQ12Rot, HQ13Rot; |
| 183 | + |
| 184 | + void processSameEvent(aod::RedHQEvents::iterator const& collision, aod::HQTracks const& hqtracks) |
| 185 | + { |
| 186 | + if (collision.numLambda() < 1 || collision.numPhi() < 2) |
| 187 | + return; |
| 188 | + |
| 189 | + for (auto hqtrackd1 : hqtracks) { |
| 190 | + if (hqtrackd1.hqId() != 333) |
| 191 | + continue; |
| 192 | + |
| 193 | + if (hqtrackd1.hqMass() < minPhiMass || hqtrackd1.hqMass() > maxPhiMass) |
| 194 | + continue; |
| 195 | + |
| 196 | + DauVec1 = ROOT::Math::PxPyPzMVector(hqtrackd1.hqd1Px(), hqtrackd1.hqd1Py(), hqtrackd1.hqd1Pz(), massKa); |
| 197 | + DauVec2 = ROOT::Math::PxPyPzMVector(hqtrackd1.hqd2Px(), hqtrackd1.hqd2Py(), hqtrackd1.hqd2Pz(), massKa); |
| 198 | + |
| 199 | + if (!selectionPIDKaon(hqtrackd1.hqd1TPC(), hqtrackd1.hqd1TOF(), hqtrackd1.hqd1TOFHit(), cfgPIDStrategy, DauVec1.Pt())) |
| 200 | + continue; |
| 201 | + |
| 202 | + if (!selectionPIDKaon(hqtrackd1.hqd2TPC(), hqtrackd1.hqd2TOF(), hqtrackd1.hqd2TOFHit(), cfgPIDStrategy, DauVec2.Pt())) |
| 203 | + continue; |
| 204 | + |
| 205 | + HQ1.SetXYZM(hqtrackd1.hqPx(), hqtrackd1.hqPy(), hqtrackd1.hqPz(), hqtrackd1.hqMass()); |
| 206 | + |
| 207 | + histos.fill(HIST("hnsigmaTPCKa"), hqtrackd1.hqd1TPC(), DauVec1.Pt()); |
| 208 | + histos.fill(HIST("hnsigmaTPCKa"), hqtrackd1.hqd2TPC(), DauVec2.Pt()); |
| 209 | + if (hqtrackd1.hqd1TOFHit()) |
| 210 | + histos.fill(HIST("hnsigmaTOFKa"), hqtrackd1.hqd1TOF(), DauVec1.Pt()); |
| 211 | + if (hqtrackd1.hqd2TOFHit()) |
| 212 | + histos.fill(HIST("hnsigmaTOFKa"), hqtrackd1.hqd2TOF(), DauVec2.Pt()); |
| 213 | + |
| 214 | + auto hqd1id = hqtrackd1.index(); |
| 215 | + histos.fill(HIST("hPhid1Mass"), HQ1.M(), HQ1.Pt()); |
| 216 | + |
| 217 | + for (auto hqtrackd2 : hqtracks) { |
| 218 | + auto hqd2id = hqtrackd2.index(); |
| 219 | + if (hqd2id <= hqd1id) |
| 220 | + continue; |
| 221 | + |
| 222 | + if (hqtrackd2.hqId() != 333) |
| 223 | + continue; |
| 224 | + |
| 225 | + if (hqtrackd2.hqMass() < minPhiMass || hqtrackd2.hqMass() > maxPhiMass) |
| 226 | + continue; |
| 227 | + |
| 228 | + DauVec1 = ROOT::Math::PxPyPzMVector(hqtrackd2.hqd1Px(), hqtrackd2.hqd1Py(), hqtrackd2.hqd1Pz(), massKa); |
| 229 | + DauVec2 = ROOT::Math::PxPyPzMVector(hqtrackd2.hqd2Px(), hqtrackd2.hqd2Py(), hqtrackd2.hqd2Pz(), massKa); |
| 230 | + |
| 231 | + if (!selectionPIDKaon(hqtrackd2.hqd1TPC(), hqtrackd2.hqd1TOF(), hqtrackd2.hqd1TOFHit(), cfgPIDStrategy, DauVec1.Pt())) |
| 232 | + continue; |
| 233 | + |
| 234 | + if (!selectionPIDKaon(hqtrackd2.hqd2TPC(), hqtrackd2.hqd2TOF(), hqtrackd2.hqd2TOFHit(), cfgPIDStrategy, DauVec2.Pt())) |
| 235 | + continue; |
| 236 | + |
| 237 | + if (hqtrackd1.hqd1Index() == hqtrackd2.hqd1Index()) |
| 238 | + continue; |
| 239 | + |
| 240 | + if (hqtrackd1.hqd2Index() == hqtrackd2.hqd2Index()) |
| 241 | + continue; |
| 242 | + |
| 243 | + HQ2.SetXYZM(hqtrackd2.hqPx(), hqtrackd2.hqPy(), hqtrackd2.hqPz(), hqtrackd2.hqMass()); |
| 244 | + |
| 245 | + histos.fill(HIST("hnsigmaTPCKa"), hqtrackd2.hqd1TPC(), DauVec1.Pt()); |
| 246 | + histos.fill(HIST("hnsigmaTPCKa"), hqtrackd2.hqd2TPC(), DauVec2.Pt()); |
| 247 | + if (hqtrackd2.hqd1TOFHit()) |
| 248 | + histos.fill(HIST("hnsigmaTOFKa"), hqtrackd2.hqd1TOF(), DauVec1.Pt()); |
| 249 | + if (hqtrackd2.hqd2TOFHit()) |
| 250 | + histos.fill(HIST("hnsigmaTOFKa"), hqtrackd2.hqd2TOF(), DauVec2.Pt()); |
| 251 | + histos.fill(HIST("hPhid2Mass"), HQ2.M(), HQ2.Pt()); |
| 252 | + |
| 253 | + for (auto hqtrackd3 : hqtracks) { |
| 254 | + if (std::abs(hqtrackd3.hqId()) != 3122) |
| 255 | + continue; |
| 256 | + |
| 257 | + if (hqtrackd3.hqMass() < minLambdaMass || hqtrackd3.hqMass() > maxLambdaMass) |
| 258 | + continue; |
| 259 | + |
| 260 | + if (hqtrackd3.hqId() > 0) { |
| 261 | + DauVec1 = ROOT::Math::PxPyPzMVector(hqtrackd3.hqd1Px(), hqtrackd3.hqd1Py(), hqtrackd3.hqd1Pz(), massPr); |
| 262 | + DauVec2 = ROOT::Math::PxPyPzMVector(hqtrackd3.hqd2Px(), hqtrackd3.hqd2Py(), hqtrackd3.hqd2Pz(), massPi); |
| 263 | + } else if (hqtrackd3.hqId() < 0) { |
| 264 | + DauVec1 = ROOT::Math::PxPyPzMVector(hqtrackd3.hqd1Px(), hqtrackd3.hqd1Py(), hqtrackd3.hqd1Pz(), massPi); |
| 265 | + DauVec2 = ROOT::Math::PxPyPzMVector(hqtrackd3.hqd2Px(), hqtrackd3.hqd2Py(), hqtrackd3.hqd2Pz(), massPr); |
| 266 | + } |
| 267 | + |
| 268 | + if (std::abs(hqtrackd3.hqd1TPC()) > cfgPIDPrPi || std::abs(hqtrackd3.hqd2TPC()) > cfgPIDPrPi) |
| 269 | + continue; |
| 270 | + |
| 271 | + if (hqtrackd1.hqd1Index() == hqtrackd3.hqd1Index()) |
| 272 | + continue; |
| 273 | + |
| 274 | + if (hqtrackd1.hqd2Index() == hqtrackd3.hqd2Index()) |
| 275 | + continue; |
| 276 | + |
| 277 | + if (hqtrackd2.hqd1Index() == hqtrackd3.hqd1Index()) |
| 278 | + continue; |
| 279 | + |
| 280 | + if (hqtrackd2.hqd2Index() == hqtrackd3.hqd2Index()) |
| 281 | + continue; |
| 282 | + |
| 283 | + HQ3.SetXYZM(hqtrackd3.hqPx(), hqtrackd3.hqPy(), hqtrackd3.hqPz(), hqtrackd3.hqMass()); |
| 284 | + histos.fill(HIST("hLambdaMass"), HQ3.M(), HQ3.Pt()); |
| 285 | + |
| 286 | + if (hqtrackd3.hqId() > 0) { |
| 287 | + histos.fill(HIST("hnsigmaTPCPr"), hqtrackd3.hqd1TPC(), DauVec1.Pt()); |
| 288 | + histos.fill(HIST("hnsigmaTPCPi"), hqtrackd3.hqd2TPC(), DauVec2.Pt()); |
| 289 | + } else if (hqtrackd3.hqId() < 0) { |
| 290 | + histos.fill(HIST("hnsigmaTPCPi"), hqtrackd3.hqd1TPC(), DauVec1.Pt()); |
| 291 | + histos.fill(HIST("hnsigmaTPCPr"), hqtrackd3.hqd2TPC(), DauVec2.Pt()); |
| 292 | + } |
| 293 | + |
| 294 | + exotic = HQ1 + HQ2 + HQ3; |
| 295 | + HQ12 = HQ1 + HQ2; |
| 296 | + HQ13 = HQ1 + HQ3; |
| 297 | + |
| 298 | + histos.fill(HIST("h_InvMass_same"), exotic.M(), exotic.Pt(), collision.centrality()); |
| 299 | + histos.fill(HIST("hDalitz"), HQ12.M2(), HQ13.M2(), exotic.M(), exotic.Pt(), collision.centrality()); |
| 300 | + |
| 301 | + if (cfgRotBkg) { |
| 302 | + for (int nr = 0; nr < cfgNRotBkg; nr++) { |
| 303 | + auto RanPhiForD2 = rn->Uniform(o2::constants::math::PI * 5.0 / 6.0, o2::constants::math::PI * 7.0 / 6.0); |
| 304 | + auto RanPhiForD3 = rn->Uniform(o2::constants::math::PI * 5.0 / 6.0, o2::constants::math::PI * 7.0 / 6.0); |
| 305 | + |
| 306 | + RanPhiForD2 += HQ2.Phi(); |
| 307 | + RanPhiForD3 += HQ3.Phi(); |
| 308 | + |
| 309 | + HQ2Rot.SetXYZM(HQ2.Pt() * std::cos(RanPhiForD2), HQ2.Pt() * std::sin(RanPhiForD2), HQ2.Pz(), HQ2.M()); |
| 310 | + HQ3Rot.SetXYZM(HQ3.Pt() * std::cos(RanPhiForD3), HQ3.Pt() * std::sin(RanPhiForD3), HQ3.Pz(), HQ3.M()); |
| 311 | + |
| 312 | + exoticRot2 = HQ1 + HQ2Rot + HQ3; |
| 313 | + exoticRot3 = HQ1 + HQ2 + HQ3Rot; |
| 314 | + exoticRot23 = HQ1 + HQ2Rot + HQ3Rot; |
| 315 | + |
| 316 | + HQ12Rot = HQ1 + HQ2Rot; |
| 317 | + HQ13Rot = HQ1 + HQ3Rot; |
| 318 | + |
| 319 | + histos.fill(HIST("h_InvMass_rotPhi"), exoticRot2.M(), exoticRot2.Pt(), collision.centrality()); |
| 320 | + histos.fill(HIST("h_InvMass_rotLambda"), exoticRot3.M(), exoticRot3.Pt(), collision.centrality()); |
| 321 | + histos.fill(HIST("h_InvMass_rotPhiLambda"), exoticRot23.M(), exoticRot23.Pt(), collision.centrality()); |
| 322 | + histos.fill(HIST("hDalitzRot"), HQ12Rot.M2(), HQ13Rot.M2(), exoticRot23.M(), exoticRot23.Pt(), collision.centrality()); |
| 323 | + } |
| 324 | + } |
| 325 | + } |
| 326 | + } |
| 327 | + } |
| 328 | + } |
| 329 | + PROCESS_SWITCH(heptaquark, processSameEvent, "Process same event", true); |
| 330 | +}; |
| 331 | + |
| 332 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<heptaquark>(cfgc)}; } |
0 commit comments