Skip to content

Commit aab791a

Browse files
Maxim VirtaMaxim Virta
authored andcommitted
[PWGCF] Derived data for Generic Framework analyses created
1 parent 2f5e710 commit aab791a

4 files changed

Lines changed: 689 additions & 46 deletions

File tree

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

0 commit comments

Comments
 (0)