|
| 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 bcWiseTables.h |
| 13 | +/// |
| 14 | +/// \brief This header provides the table definitions to store very lightweight EMCal clusters per BC |
| 15 | +/// |
| 16 | +/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt |
| 17 | +/// |
| 18 | + |
| 19 | +#ifndef PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ |
| 20 | +#define PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ |
| 21 | + |
| 22 | +#include "Framework/AnalysisDataModel.h" |
| 23 | + |
| 24 | +namespace o2::aod |
| 25 | +{ |
| 26 | + |
| 27 | +namespace emdownscaling |
| 28 | +{ |
| 29 | +enum Observables { |
| 30 | + kDefinition, |
| 31 | + kEnergy, |
| 32 | + kEta, |
| 33 | + kPhi, |
| 34 | + kNCells, |
| 35 | + kM02, |
| 36 | + kTime, |
| 37 | + kFT0MCent, |
| 38 | + kZVtx, |
| 39 | + kFT0Amp, |
| 40 | + kCellAmpSum, |
| 41 | + kpT, |
| 42 | + nObservables |
| 43 | +}; |
| 44 | + |
| 45 | +// Values in tables are stored in downscaled format to save disk space |
| 46 | +const float downscalingFactors[nObservables]{ |
| 47 | + 1E0, // Cluster definition |
| 48 | + 1E3, // Cluster energy |
| 49 | + 1E4, // Cluster eta |
| 50 | + 1E4, // Cluster phi |
| 51 | + 1E0, // Number of cells |
| 52 | + 1E4, // M02 |
| 53 | + 1E2, // Cluster time |
| 54 | + 2E0, // FT0M centrality |
| 55 | + 1E3, // Z-vertex position |
| 56 | + 1E0, // FT0M amplitude |
| 57 | + 1E0, // Cell energy |
| 58 | + 1E3}; // MC pi0 pt |
| 59 | +} // namespace emdownscaling |
| 60 | + |
| 61 | +namespace bcwisebc |
| 62 | +{ |
| 63 | +DECLARE_SOA_COLUMN(HasFT0, hasFT0, bool); //! has_foundFT0() |
| 64 | +DECLARE_SOA_COLUMN(HasTVX, hasTVX, bool); //! has the TVX trigger flag |
| 65 | +DECLARE_SOA_COLUMN(HaskTVXinEMC, haskTVXinEMC, bool); //! kTVXinEMC |
| 66 | +DECLARE_SOA_COLUMN(HasEMCCell, hasEMCCell, bool); //! at least one EMCal cell in the BC |
| 67 | +DECLARE_SOA_COLUMN(HasNoTFROFBorder, hasNoTFROFBorder, bool); //! not in the TF border or ITS ROF border region |
| 68 | +DECLARE_SOA_COLUMN(StoredFT0MAmplitude, storedFT0MAmplitude, unsigned int); //! ft0a+c amplitude |
| 69 | +DECLARE_SOA_COLUMN(StoredEMCalnCells, storedEMCalnCells, unsigned int); //! number of emcal cells |
| 70 | +DECLARE_SOA_COLUMN(StoredEMCalCellEnergy, storedEMCalCellEnergy, float); //! sum of energy in emcal cells |
| 71 | +} // namespace bcwisebc |
| 72 | +DECLARE_SOA_TABLE(BCWiseBCs, "AOD", "BCWISEBCS", //! table of bc wise centrality estimation and event selection input |
| 73 | + o2::soa::Index<>, bcwisebc::HasFT0, bcwisebc::HasTVX, bcwisebc::HaskTVXinEMC, bcwisebc::HasEMCCell, bcwisebc::HasNoTFROFBorder, |
| 74 | + bcwisebc::StoredFT0MAmplitude, bcwisebc::StoredEMCalnCells, bcwisebc::StoredEMCalCellEnergy); |
| 75 | + |
| 76 | +DECLARE_SOA_INDEX_COLUMN(BCWiseBC, bcWiseBC); //! bunch crossing ID used as index |
| 77 | + |
| 78 | +namespace bcwisecollision |
| 79 | +{ |
| 80 | +DECLARE_SOA_COLUMN(StoredCentrality, storedCentrality, uint8_t); //! FT0M centrality (0-100) (x2) |
| 81 | +DECLARE_SOA_COLUMN(StoredZVtx, storedZVtx, int16_t); //! Z-vertex position (x1000) |
| 82 | + |
| 83 | +DECLARE_SOA_DYNAMIC_COLUMN(Centrality, centrality, [](uint8_t storedcentrality) -> float { return storedcentrality / emdownscaling::downscalingFactors[emdownscaling::kFT0MCent]; }); //! Centrality (0-100) |
| 84 | +DECLARE_SOA_DYNAMIC_COLUMN(ZVtx, zVtx, [](uint8_t storedzvtx) -> float { return storedzvtx / emdownscaling::downscalingFactors[emdownscaling::kZVtx]; }); //! Centrality (0-100) |
| 85 | +} // namespace bcwisecollision |
| 86 | +DECLARE_SOA_TABLE(BCWiseCollisions, "AOD", "BCWISECOLLS", //! table of skimmed EMCal clusters |
| 87 | + o2::soa::Index<>, BCWiseBCId, bcwisecollision::StoredCentrality, bcwisecollision::StoredZVtx, |
| 88 | + bcwisecollision::Centrality<bcwisecollision::StoredCentrality>, bcwisecollision::ZVtx<bcwisecollision::StoredZVtx>); |
| 89 | + |
| 90 | +namespace bcwisecluster |
| 91 | +{ |
| 92 | +DECLARE_SOA_COLUMN(StoredDefinition, storedDefinition, uint8_t); //! cluster definition, see EMCALClusterDefinition.h |
| 93 | +DECLARE_SOA_COLUMN(StoredE, storedE, uint16_t); //! cluster energy (1 MeV -> Maximum cluster energy of ~65 GeV) |
| 94 | +DECLARE_SOA_COLUMN(StoredEta, storedEta, int16_t); //! cluster pseudorapidity (x10,000) |
| 95 | +DECLARE_SOA_COLUMN(StoredPhi, storedPhi, uint16_t); //! cluster azimuthal angle (x10 000) from 0 to 2pi |
| 96 | +DECLARE_SOA_COLUMN(StoredNCells, storedNCells, uint8_t); //! number of cells in cluster |
| 97 | +DECLARE_SOA_COLUMN(StoredM02, storedM02, uint16_t); //! shower shape long axis (x10 000) |
| 98 | +DECLARE_SOA_COLUMN(StoredTime, storedTime, int16_t); //! cluster time (10 ps resolution) |
| 99 | +DECLARE_SOA_COLUMN(StoredIsExotic, storedIsExotic, bool); //! flag to mark cluster as exotic |
| 100 | + |
| 101 | +DECLARE_SOA_DYNAMIC_COLUMN(Definition, definition, [](uint8_t storedDefinition) -> uint8_t { return storedDefinition; }); //! cluster definition, see EMCALClusterDefinition.h |
| 102 | +DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](uint16_t storedE) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy]; }); //! cluster energy (GeV) |
| 103 | +DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](int16_t storedEta) -> float { return storedEta / emdownscaling::downscalingFactors[emdownscaling::kEta]; }); //! cluster pseudorapidity |
| 104 | +DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](uint16_t storedPhi) -> float { return storedPhi / emdownscaling::downscalingFactors[emdownscaling::kPhi]; }); //! cluster azimuthal angle (0 to 2pi) |
| 105 | +DECLARE_SOA_DYNAMIC_COLUMN(NCells, nCells, [](uint16_t storedNCells) -> uint16_t { return storedNCells; }); //! number of cells in cluster |
| 106 | +DECLARE_SOA_DYNAMIC_COLUMN(M02, m02, [](uint16_t storedM02) -> float { return storedM02 / emdownscaling::downscalingFactors[emdownscaling::kM02]; }); //! shower shape long axis |
| 107 | +DECLARE_SOA_DYNAMIC_COLUMN(Time, time, [](int16_t storedTime) -> float { return storedTime / emdownscaling::downscalingFactors[emdownscaling::kTime]; }); //! cluster time (ns) |
| 108 | +DECLARE_SOA_DYNAMIC_COLUMN(IsExotic, isExotic, [](bool storedIsExotic) -> bool { return storedIsExotic; }); //! flag to mark cluster as exotic |
| 109 | + |
| 110 | +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float storedE, float storedEta) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy] / std::cosh(storedEta / emdownscaling::downscalingFactors[emdownscaling::kEta]); }); //! cluster pt, assuming m=0 (photons) |
| 111 | +} // namespace bcwisecluster |
| 112 | + |
| 113 | +DECLARE_SOA_TABLE(BCWiseClusters, "AOD", "BCWISECLUSTERS", //! table of skimmed EMCal clusters |
| 114 | + o2::soa::Index<>, BCWiseBCId, bcwisecluster::StoredDefinition, bcwisecluster::StoredE, bcwisecluster::StoredEta, bcwisecluster::StoredPhi, bcwisecluster::StoredNCells, bcwisecluster::StoredM02, bcwisecluster::StoredTime, bcwisecluster::StoredIsExotic, |
| 115 | + bcwisecluster::Definition<bcwisecluster::StoredDefinition>, bcwisecluster::E<bcwisecluster::StoredE>, bcwisecluster::Eta<bcwisecluster::StoredEta>, bcwisecluster::Phi<bcwisecluster::StoredPhi>, bcwisecluster::NCells<bcwisecluster::StoredNCells>, bcwisecluster::M02<bcwisecluster::StoredM02>, bcwisecluster::Time<bcwisecluster::StoredTime>, bcwisecluster::IsExotic<bcwisecluster::StoredIsExotic>, |
| 116 | + bcwisecluster::Pt<bcwisecluster::StoredE, bcwisecluster::StoredEta>); |
| 117 | + |
| 118 | +namespace bcwisemcpi0s |
| 119 | +{ |
| 120 | +DECLARE_SOA_COLUMN(ParticleIdPi0, particleIdPi0, int); //! ID of the pi0 in the MC stack |
| 121 | +DECLARE_SOA_COLUMN(StoredPt, storedPt, uint16_t); //! Transverse momentum of generated pi0 (10 MeV) |
| 122 | +DECLARE_SOA_COLUMN(IsAccepted, isAccepted, bool); //! Both decay photons are within the EMCal acceptance |
| 123 | +DECLARE_SOA_COLUMN(IsPrimary, isPrimary, bool); //! mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator() |
| 124 | +DECLARE_SOA_COLUMN(IsFromWD, isFromWD, bool); //! Pi0 from a weak decay according to pwgem::photonmeson::utils::mcutil::IsFromWD |
| 125 | + |
| 126 | +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](uint16_t storedpt) -> float { return storedpt / emdownscaling::downscalingFactors[emdownscaling::kpT]; }); //! pT of pi0 (GeV) |
| 127 | +} // namespace bcwisemcpi0s |
| 128 | + |
| 129 | +DECLARE_SOA_TABLE(BCWiseMCPi0s, "AOD", "BCWISEMCPI0S", //! table of pi0s on MC level |
| 130 | + o2::soa::Index<>, BCWiseBCId, bcwisemcpi0s::ParticleIdPi0, bcwisemcpi0s::StoredPt, bcwisemcpi0s::IsAccepted, bcwisemcpi0s::IsPrimary, bcwisemcpi0s::IsFromWD, |
| 131 | + bcwisemcpi0s::Pt<bcwisemcpi0s::StoredPt>); |
| 132 | + |
| 133 | +namespace bcwisemccluster |
| 134 | +{ |
| 135 | +DECLARE_SOA_COLUMN(StoredE, storedE, uint16_t); //! energy of cluster inducing particle (1 MeV precision) |
| 136 | + |
| 137 | +DECLARE_SOA_DYNAMIC_COLUMN(E, e, [](uint16_t storedE) -> float { return storedE / emdownscaling::downscalingFactors[emdownscaling::kEnergy]; }); //! energy of cluster inducing particle (GeV) |
| 138 | +} // namespace bcwisemccluster |
| 139 | + |
| 140 | +DECLARE_SOA_TABLE(BCWiseMCClusters, "AOD", "BCWISEMCCLS", //! table of MC information for clusters -> To be joined with the cluster table |
| 141 | + o2::soa::Index<>, BCWiseBCId, bcwisemccluster::StoredE, bcwisemcpi0s::ParticleIdPi0, |
| 142 | + bcwisemccluster::E<bcwisemccluster::StoredE>); |
| 143 | + |
| 144 | +} // namespace o2::aod |
| 145 | + |
| 146 | +#endif // PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ |
0 commit comments