|
| 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 GfwDerived.h |
| 13 | +/// \brief Derived collision and track tables for the GFW v02 flow analysis. |
| 14 | +/// |
| 15 | +/// Selection columns are bit masks. A later analysis keeps a row when every bit |
| 16 | +/// set in its mask is also set on the row (`ncheckbit` / `(value & mask) == mask`). |
| 17 | +/// PID is stored only as bits. The nominal, tight, and loose windows are fixed |
| 18 | +/// at production. |
| 19 | +/// |
| 20 | +/// \author Maxim Virta, AU, maxim.virta@cern.ch |
| 21 | + |
| 22 | +#ifndef PWGCF_GENERICFRAMEWORK_DATAMODEL_GFWDERIVED_H_ |
| 23 | +#define PWGCF_GENERICFRAMEWORK_DATAMODEL_GFWDERIVED_H_ |
| 24 | + |
| 25 | +#include <Framework/ASoA.h> |
| 26 | +#include <Framework/AnalysisDataModel.h> |
| 27 | + |
| 28 | +#include <Rtypes.h> |
| 29 | + |
| 30 | +#include <cstdint> |
| 31 | + |
| 32 | +namespace o2::aod |
| 33 | +{ |
| 34 | +namespace gfwcollision |
| 35 | +{ |
| 36 | +DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Centrality estimator chosen at production |
| 37 | +DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); //! Global-track multiplicity, multNTracksGlobal |
| 38 | +DECLARE_SOA_COLUMN(EventSel, eventSel, uint16_t); //! Event-selection bitmask, see EventSelection |
| 39 | + |
| 40 | +/// One bit per event-level decision. Bits record that the decision passed. |
| 41 | +/// sel8 is required by the producer and is not stored here. |
| 42 | +enum EventSelection : uint16_t { |
| 43 | + kNoSameBunchPileup = BIT(0), |
| 44 | + kIsGoodZvtxFT0vsPV = BIT(1), |
| 45 | + kNoCollInTimeRangeStandard = BIT(2), |
| 46 | + kNoCollInRofStandard = BIT(3), |
| 47 | + kNoHighMultCollInPrevRof = BIT(4), |
| 48 | + kIsVertexITSTPC = BIT(5), |
| 49 | + kIsGoodITSLayersAll = BIT(6), |
| 50 | + kNoTimeFrameBorder = BIT(7), |
| 51 | + kNoITSROFrameBorder = BIT(8), |
| 52 | + kOccupancy = BIT(9), //! track occupancy is within the production threshold |
| 53 | + kNotTVXinTRD = BIT(10), //! collision is not a TRD-triggered TVX event |
| 54 | + kGoodVertex = BIT(11), //! PV contributor and z-resolution quality |
| 55 | + kMultCorr = BIT(12) //! multiplicity-correlation cut |
| 56 | +}; |
| 57 | + |
| 58 | +inline constexpr uint16_t DefaultEventMask = 0; |
| 59 | +} // namespace gfwcollision |
| 60 | + |
| 61 | +DECLARE_SOA_TABLE(GfwCollisions, "AOD", "GFWCOLLISION", //! |
| 62 | + o2::soa::Index<>, |
| 63 | + bc::RunNumber, |
| 64 | + collision::PosZ, |
| 65 | + gfwcollision::Centrality, |
| 66 | + gfwcollision::Multiplicity, |
| 67 | + timestamp::Timestamp, |
| 68 | + gfwcollision::EventSel); |
| 69 | +using GfwCollision = GfwCollisions::iterator; |
| 70 | + |
| 71 | +namespace gfwtrack |
| 72 | +{ |
| 73 | +DECLARE_SOA_INDEX_COLUMN(GfwCollision, gfwCollision); //! Parent derived collision |
| 74 | +DECLARE_SOA_COLUMN(Pt, pt, float); //! pT (GeV/c) |
| 75 | +DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity |
| 76 | +DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuthal angle |
| 77 | +DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); //! Track has a TOF match |
| 78 | +DECLARE_SOA_COLUMN(TrackSel, trackSel, uint32_t); //! Track and PID bitmask, see TrackSelection |
| 79 | + |
| 80 | +/// Track-quality bits occupy 0-13. TPC PID bits occupy 14-22 and TOF PID bits occupy 23-31. |
| 81 | +/// Global-track, ITS-cluster, and ITS-chi2 requirements are applied by the producer and are not stored. |
| 82 | +/// DCA bits are |DCA| <= nSigma times a pT-dependent shape. |
| 83 | +/// A PID bit is set when low * scale < nSigma < up * scale. |
| 84 | +/// Above the TOF pT cut, every PID bit stays unset when the track has no TOF match. |
| 85 | +/// Within each detector, PidWindowBits covers π/K/p, followed by the tight window and then the loose window. |
| 86 | +enum TrackSelection : uint32_t { |
| 87 | + kDCAxy = BIT(0), //! |DCAxy| within the nominal nSigma times f_xy(pT) |
| 88 | + kDCAxyTight = BIT(1), |
| 89 | + kDCAxyLoose = BIT(2), |
| 90 | + kDCAz = BIT(3), //! |DCAz| within the nominal nSigma times f_z(pT) |
| 91 | + kDCAzTight = BIT(4), |
| 92 | + kDCAzLoose = BIT(5), // DCA bit selections |
| 93 | + |
| 94 | + kTPCXrows = BIT(6), |
| 95 | + kTPCXrowsTight = BIT(7), |
| 96 | + kTPCXrowsLoose = BIT(8), |
| 97 | + kTPCCls = BIT(9), |
| 98 | + kTPCClsTight = BIT(10), |
| 99 | + kTPCClsLoose = BIT(11), |
| 100 | + kChi2TPC = BIT(12), |
| 101 | + kChi2TPCLoose = BIT(13), // TPC bit selections |
| 102 | + |
| 103 | + // TPC PID selections: nominal, tight, then loose |
| 104 | + kTpcPi = BIT(14), |
| 105 | + kTpcKa = BIT(15), |
| 106 | + kTpcPr = BIT(16), |
| 107 | + kTpcPiTight = BIT(17), |
| 108 | + kTpcKaTight = BIT(18), |
| 109 | + kTpcPrTight = BIT(19), |
| 110 | + kTpcPiLoose = BIT(20), |
| 111 | + kTpcKaLoose = BIT(21), |
| 112 | + kTpcPrLoose = BIT(22), |
| 113 | + // TOF PID selections: nominal, tight, then loose |
| 114 | + kTofPi = BIT(23), |
| 115 | + kTofKa = BIT(24), |
| 116 | + kTofPr = BIT(25), |
| 117 | + kTofPiTight = BIT(26), |
| 118 | + kTofKaTight = BIT(27), |
| 119 | + kTofPrTight = BIT(28), |
| 120 | + kTofPiLoose = BIT(29), |
| 121 | + kTofKaLoose = BIT(30), |
| 122 | + kTofPrLoose = BIT(31) |
| 123 | +}; |
| 124 | + |
| 125 | +/// Quality bits corresponding to the default flowGfwV02 track filter plus trackSelected(). |
| 126 | +inline constexpr uint32_t NominalMask = static_cast<uint32_t>(kDCAxy | kDCAz | kTPCXrows | kTPCCls | kChi2TPC); |
| 127 | +/// Loosest quality bits. Production can optionally require these while still leaving the nominal cuts free. |
| 128 | +inline constexpr uint32_t LooseSkimMask = static_cast<uint32_t>(kDCAxyLoose | kDCAzLoose | kTPCXrowsLoose | kTPCClsLoose | kChi2TPCLoose); |
| 129 | +/// Tracks that enter the multiplicity-correlation count. Global track and ITS chi2 are already required by the producer. |
| 130 | +inline constexpr uint32_t MultCorrTrackMask = static_cast<uint32_t>(kDCAz | kChi2TPC); |
| 131 | + |
| 132 | +inline constexpr int PidWindowBits = 3; |
| 133 | +inline constexpr int PidWindowNominal = 0; |
| 134 | +inline constexpr int PidWindowTight = 1; |
| 135 | +inline constexpr int PidWindowLoose = 2; |
| 136 | +} // namespace gfwtrack |
| 137 | + |
| 138 | +DECLARE_SOA_TABLE(GfwTracks, "AOD", "GFWTRACK", //! |
| 139 | + o2::soa::Index<>, |
| 140 | + gfwtrack::GfwCollisionId, |
| 141 | + gfwtrack::Pt, gfwtrack::Eta, gfwtrack::Phi, |
| 142 | + gfwtrack::HasTOF, gfwtrack::TrackSel); |
| 143 | +using GfwTrack = GfwTracks::iterator; |
| 144 | +} // namespace o2::aod |
| 145 | + |
| 146 | +#endif // PWGCF_GENERICFRAMEWORK_DATAMODEL_GFWDERIVED_H_ |
0 commit comments