|
| 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 | +/// \file selectionStudyTable.cxx |
| 13 | +/// \brief Produces tables for centrality selection bias studies |
| 14 | +/// |
| 15 | +/// \author ALICE |
| 16 | +/// |
| 17 | + |
| 18 | +#include "Common/DataModel/SelectionStudyTables.h" |
| 19 | + |
| 20 | +#include "Framework/ASoAHelpers.h" |
| 21 | +#include "Framework/AnalysisDataModel.h" |
| 22 | +#include "Framework/AnalysisTask.h" |
| 23 | +#include "Framework/ConfigParamSpec.h" |
| 24 | +#include "Framework/HistogramRegistry.h" |
| 25 | +#include "Framework/O2DatabasePDGPlugin.h" |
| 26 | +#include "Framework/runDataProcessing.h" |
| 27 | + |
| 28 | +#include <algorithm> |
| 29 | +#include <map> |
| 30 | +#include <string> |
| 31 | +#include <vector> |
| 32 | + |
| 33 | +using namespace o2; |
| 34 | +using namespace o2::framework; |
| 35 | +using namespace o2::framework::expressions; |
| 36 | + |
| 37 | +struct SelectionStudyTable { |
| 38 | + Produces<aod::PIDPts> pidpts; |
| 39 | + |
| 40 | + // could be done in a vector of vectors |
| 41 | + // left for future iteration |
| 42 | + std::vector<float> ptpi; |
| 43 | + std::vector<float> ptka; |
| 44 | + std::vector<float> ptpr; |
| 45 | + std::vector<float> ptk0; |
| 46 | + std::vector<float> ptla; |
| 47 | + std::vector<float> ptxi; |
| 48 | + std::vector<float> ptom; |
| 49 | + std::vector<float> ptph; |
| 50 | + std::vector<float> ptks; |
| 51 | + std::vector<float> ptd; |
| 52 | + std::vector<float> ptlc; |
| 53 | + std::vector<float> ptjp; |
| 54 | + |
| 55 | + void init(InitContext&) |
| 56 | + { |
| 57 | + } |
| 58 | + |
| 59 | + void process(aod::McCollision const&, aod::McParticles const& mcParticles) |
| 60 | + { |
| 61 | + ptpi.clear(); |
| 62 | + ptka.clear(); |
| 63 | + ptpr.clear(); |
| 64 | + ptk0.clear(); |
| 65 | + ptla.clear(); |
| 66 | + ptxi.clear(); |
| 67 | + ptom.clear(); |
| 68 | + ptph.clear(); |
| 69 | + ptks.clear(); |
| 70 | + ptd.clear(); |
| 71 | + ptlc.clear(); |
| 72 | + ptjp.clear(); |
| 73 | + for (auto const& mcPart : mcParticles) { |
| 74 | + if (std::fabs(mcPart.y()) > 0.5) { |
| 75 | + continue; // only do midrapidity particles |
| 76 | + } |
| 77 | + |
| 78 | + // handle resonances first to make sure phys prim crit does not reject them |
| 79 | + if (mcPart.pdgCode() == 333) { |
| 80 | + ptph.push_back(mcPart.pt()); |
| 81 | + } |
| 82 | + if (std::abs(mcPart.pdgCode()) == 313) { |
| 83 | + ptks.push_back(mcPart.pt()); |
| 84 | + } |
| 85 | + |
| 86 | + // resonances handled, move to primaries |
| 87 | + if (!mcPart.isPhysicalPrimary()) { |
| 88 | + continue; |
| 89 | + } |
| 90 | + if (std::abs(mcPart.pdgCode()) == 211) { |
| 91 | + ptpi.push_back(mcPart.pt()); |
| 92 | + } |
| 93 | + if (std::abs(mcPart.pdgCode()) == 321) { |
| 94 | + ptka.push_back(mcPart.pt()); |
| 95 | + } |
| 96 | + if (std::abs(mcPart.pdgCode()) == 2212) { |
| 97 | + ptpr.push_back(mcPart.pt()); |
| 98 | + } |
| 99 | + if (std::abs(mcPart.pdgCode()) == 310) { |
| 100 | + ptk0.push_back(mcPart.pt()); |
| 101 | + } |
| 102 | + if (std::abs(mcPart.pdgCode()) == 3122) { |
| 103 | + ptla.push_back(mcPart.pt()); |
| 104 | + } |
| 105 | + if (std::abs(mcPart.pdgCode()) == 3312) { |
| 106 | + ptxi.push_back(mcPart.pt()); |
| 107 | + } |
| 108 | + if (std::abs(mcPart.pdgCode()) == 3334) { |
| 109 | + ptom.push_back(mcPart.pt()); |
| 110 | + } |
| 111 | + if (std::abs(mcPart.pdgCode()) == 3334) { |
| 112 | + ptom.push_back(mcPart.pt()); |
| 113 | + } |
| 114 | + // inclusive HF for now |
| 115 | + if (std::abs(mcPart.pdgCode()) == 421) { |
| 116 | + ptd.push_back(mcPart.pt()); |
| 117 | + } |
| 118 | + if (std::abs(mcPart.pdgCode()) == 4122) { |
| 119 | + ptd.push_back(mcPart.pt()); |
| 120 | + } |
| 121 | + if (std::abs(mcPart.pdgCode()) == 443) { |
| 122 | + ptjp.push_back(mcPart.pt()); |
| 123 | + } |
| 124 | + } |
| 125 | + |
| 126 | + pidpts(ptpi, ptka, ptpr, ptk0, ptla, ptxi, ptom, ptph, ptks, ptd, ptlc, ptjp); |
| 127 | + } |
| 128 | +}; |
| 129 | + |
| 130 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 131 | +{ |
| 132 | + return WorkflowSpec{adaptAnalysisTask<SelectionStudyTable>(cfgc)}; |
| 133 | +} |
0 commit comments