From f4d33c68a5bd9b67b75a90203abacade60e0e306 Mon Sep 17 00:00:00 2001 From: Pietro Cortese Date: Fri, 17 Mar 2023 09:47:09 +0100 Subject: [PATCH 1/2] Fix AOD creation --- .../include/CommonConstants/ZDCConstants.h | 50 ++++++++ Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 4 + .../ZDC/base/include/ZDCBase/Constants.h | 35 ------ .../include/Framework/AnalysisDataModel.h | 108 ++++++++++++------ 4 files changed, 126 insertions(+), 71 deletions(-) create mode 100644 Common/Constants/include/CommonConstants/ZDCConstants.h diff --git a/Common/Constants/include/CommonConstants/ZDCConstants.h b/Common/Constants/include/CommonConstants/ZDCConstants.h new file mode 100644 index 0000000000000..b0fe03ee7f9ea --- /dev/null +++ b/Common/Constants/include/CommonConstants/ZDCConstants.h @@ -0,0 +1,50 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// @file ZDCConstants.h +/// @brief Some ZDC constants shared between O2 and O2Physics + +/// @author pietro.cortese@cern.ch + +//< map detector/tower to continuous channel Id +constexpr int IdDummy = -1; +constexpr int IdVoid = -2; + +constexpr int IdZNAC = 0; +constexpr int IdZNA1 = 1; +constexpr int IdZNA2 = 2; +constexpr int IdZNA3 = 3; +constexpr int IdZNA4 = 4; +constexpr int IdZNASum = 5; +// +constexpr int IdZPAC = 6; +constexpr int IdZPA1 = 7; +constexpr int IdZPA2 = 8; +constexpr int IdZPA3 = 9; +constexpr int IdZPA4 = 10; +constexpr int IdZPASum = 11; +// +constexpr int IdZEM1 = 12; +constexpr int IdZEM2 = 13; +// +constexpr int IdZNCC = 14; +constexpr int IdZNC1 = 15; +constexpr int IdZNC2 = 16; +constexpr int IdZNC3 = 17; +constexpr int IdZNC4 = 18; +constexpr int IdZNCSum = 19; +// +constexpr int IdZPCC = 20; +constexpr int IdZPC1 = 21; +constexpr int IdZPC2 = 22; +constexpr int IdZPC3 = 23; +constexpr int IdZPC4 = 24; +constexpr int IdZPCSum = 25; diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 1c9e941a82cf0..76f6a1669ad82 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -2573,7 +2573,11 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo outputs.emplace_back(OutputLabel{"O2ambiguousMFTtrack"}, "AOD", "AMBIGUOUSMFTTR", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2ambiguousFwdtrack"}, "AOD", "AMBIGUOUSFWDTR", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2v0_001"}, "AOD", "V0_001", 0, Lifetime::Timeframe); +#ifdef O2_ZDC_NEWDATAMODEL + outputs.emplace_back(OutputLabel{"O2zdc_001"}, "AOD", "ZDC_001", 0, Lifetime::Timeframe); +#else outputs.emplace_back(OutputLabel{"O2zdc"}, "AOD", "ZDC", 0, Lifetime::Timeframe); +#endif outputs.emplace_back(OutputLabel{"O2caloCell"}, "AOD", "CALO", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2caloCellTRGR"}, "AOD", "CALOTRIGGER", 0, Lifetime::Timeframe); outputs.emplace_back(OutputLabel{"O2cpvCluster"}, "AOD", "CPVCLUSTER", 0, Lifetime::Timeframe); diff --git a/Detectors/ZDC/base/include/ZDCBase/Constants.h b/Detectors/ZDC/base/include/ZDCBase/Constants.h index 15e04c8696ad4..6a6b9848c968e 100644 --- a/Detectors/ZDC/base/include/ZDCBase/Constants.h +++ b/Detectors/ZDC/base/include/ZDCBase/Constants.h @@ -129,41 +129,6 @@ constexpr float getTOFCorrection(int det) return TOFCorr[det - DetIDOffs]; } -//< map detector/tower to continuous channel Id -constexpr int IdDummy = -1; -constexpr int IdVoid = -2; - -constexpr int IdZNAC = 0; -constexpr int IdZNA1 = 1; -constexpr int IdZNA2 = 2; -constexpr int IdZNA3 = 3; -constexpr int IdZNA4 = 4; -constexpr int IdZNASum = 5; -// -constexpr int IdZPAC = 6; -constexpr int IdZPA1 = 7; -constexpr int IdZPA2 = 8; -constexpr int IdZPA3 = 9; -constexpr int IdZPA4 = 10; -constexpr int IdZPASum = 11; -// -constexpr int IdZEM1 = 12; -constexpr int IdZEM2 = 13; -// -constexpr int IdZNCC = 14; -constexpr int IdZNC1 = 15; -constexpr int IdZNC2 = 16; -constexpr int IdZNC3 = 17; -constexpr int IdZNC4 = 18; -constexpr int IdZNCSum = 19; -// -constexpr int IdZPCC = 20; -constexpr int IdZPC1 = 21; -constexpr int IdZPC2 = 22; -constexpr int IdZPC3 = 23; -constexpr int IdZPC4 = 24; -constexpr int IdZPCSum = 25; - constexpr uint32_t MaskZNA = 0x0000001f; constexpr uint32_t MaskAllZNA = 0x0000003f; constexpr uint32_t MaskZPA = 0x000007c0; diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 77b683f09ca13..1ff8bf6daa253 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -744,8 +744,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! auto ne = channelE.size(); auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 12) thisenergy = energy[ie]; // FIXME: pass IdZEM1, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 12) { + thisenergy = energy[ie]; // FIXME: pass IdZEM1, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -753,8 +755,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 13) thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 13) { + thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -762,8 +766,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 0) thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 0) { + thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -771,8 +777,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 14) thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 14) { + thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -780,8 +788,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 6) thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 6) { + thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -789,8 +799,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 20) thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelE[ie] == 20) { + thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -858,8 +870,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 12) thistime = time[ie]; // FIXME: pass IdZEM1, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 12) { + thistime = time[ie]; // FIXME: pass IdZEM1, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -867,8 +881,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 13) thistime = time[ie]; // FIXME: pass IdZEM1, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 13) { + thistime = time[ie]; // FIXME: pass IdZEM1, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -876,8 +892,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 0) thistime = time[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 0) { + thistime = time[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -885,8 +903,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 14) thistime = time[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 14) { + thistime = time[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -894,8 +914,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 6) thistime = time[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 6) { + thistime = time[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -903,8 +925,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 20) thistime = time[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 20) { + thistime = time[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thistime; }); @@ -913,8 +937,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 12) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 12) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -922,8 +948,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 13) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 13) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -931,8 +959,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 0) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 0) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -940,8 +970,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 14) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 14) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -949,8 +981,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 6) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 6) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -958,8 +992,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 20) thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? - break; // avoid unnecessary looping + if(channelT[ie] == 20) { + thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + break; // avoid unnecessary looping + } } return thisamplitude; }); From 301b7d7b7802dc447922a7ab642250e52c00b9e5 Mon Sep 17 00:00:00 2001 From: Pietro Cortese Date: Fri, 17 Mar 2023 11:39:57 +0100 Subject: [PATCH 2/2] Move ZDC channel ids to shared file --- .../include/CommonConstants/ZDCConstants.h | 13 +++ .../ZDC/base/include/ZDCBase/Constants.h | 1 + .../include/Framework/AnalysisDataModel.h | 107 +++++++++--------- 3 files changed, 68 insertions(+), 53 deletions(-) diff --git a/Common/Constants/include/CommonConstants/ZDCConstants.h b/Common/Constants/include/CommonConstants/ZDCConstants.h index b0fe03ee7f9ea..a07de17abff65 100644 --- a/Common/Constants/include/CommonConstants/ZDCConstants.h +++ b/Common/Constants/include/CommonConstants/ZDCConstants.h @@ -14,6 +14,14 @@ /// @author pietro.cortese@cern.ch +#ifndef ALICEO2_ZDCCONSTANTS_H_ +#define ALICEO2_ZDCCONSTANTS_H_ + +namespace o2 +{ +namespace zdc +{ + //< map detector/tower to continuous channel Id constexpr int IdDummy = -1; constexpr int IdVoid = -2; @@ -48,3 +56,8 @@ constexpr int IdZPC2 = 22; constexpr int IdZPC3 = 23; constexpr int IdZPC4 = 24; constexpr int IdZPCSum = 25; + +} // namespace zdc +} // namespace o2 + +#endif diff --git a/Detectors/ZDC/base/include/ZDCBase/Constants.h b/Detectors/ZDC/base/include/ZDCBase/Constants.h index 6a6b9848c968e..e318b358ae38c 100644 --- a/Detectors/ZDC/base/include/ZDCBase/Constants.h +++ b/Detectors/ZDC/base/include/ZDCBase/Constants.h @@ -14,6 +14,7 @@ #include "CommonConstants/PhysicsConstants.h" #include "CommonConstants/LHCConstants.h" +#include "CommonConstants/ZDCConstants.h" #include #include #include diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 1ff8bf6daa253..52ca235743604 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -20,6 +20,7 @@ #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "CommonConstants/GeomConstants.h" +#include "CommonConstants/ZDCConstants.h" #include "SimulationDataFormat/MCGenStatus.h" using namespace o2::constants::math; @@ -726,7 +727,7 @@ DECLARE_SOA_COLUMN(TimeZEM1, timeZEM1, float); //! DECLARE_SOA_COLUMN(TimeZEM2, timeZEM2, float); //! DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! -DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //!ƒ +DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! } namespace zdc @@ -744,8 +745,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! auto ne = channelE.size(); auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 12) { - thisenergy = energy[ie]; // FIXME: pass IdZEM1, etc? + if(channelE[ie] == o2::zdc::IdZEM1) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -755,8 +756,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 13) { - thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZEM2) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -766,8 +767,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 0) { - thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZNAC) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -777,8 +778,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 14) { - thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZNCC) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -788,8 +789,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 6) { - thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZPAC) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -799,8 +800,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 20) { - thisenergy = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZPCC) { + thisenergy = energy[ie]; break; // avoid unnecessary looping } } @@ -814,10 +815,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! -std::numeric_limits::infinity(), -std::numeric_limits::infinity()}; for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 1) thisenergy[0] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 2) thisenergy[1] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 3) thisenergy[2] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 4) thisenergy[3] = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZNA1) thisenergy[0] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNA2) thisenergy[1] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNA3) thisenergy[2] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNA4) thisenergy[3] = energy[ie]; } return thisenergy; }); @@ -829,10 +830,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! -std::numeric_limits::infinity(), -std::numeric_limits::infinity()}; for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 15) thisenergy[0] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 16) thisenergy[1] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 17) thisenergy[2] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 18) thisenergy[3] = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZNC1) thisenergy[0] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNC2) thisenergy[1] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNC3) thisenergy[2] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZNC4) thisenergy[3] = energy[ie]; } return thisenergy; }); @@ -844,10 +845,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! -std::numeric_limits::infinity(), -std::numeric_limits::infinity()}; for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 7) thisenergy[0] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 8) thisenergy[1] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 9) thisenergy[2] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 10) thisenergy[3] = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZPA1) thisenergy[0] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPA2) thisenergy[1] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPA3) thisenergy[2] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPA4) thisenergy[3] = energy[ie]; } return thisenergy; }); @@ -859,10 +860,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! -std::numeric_limits::infinity(), -std::numeric_limits::infinity()}; for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == 21) thisenergy[0] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 22) thisenergy[1] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 23) thisenergy[2] = energy[ie]; // FIXME: pass IdZEM2, etc? - if(channelE[ie] == 24) thisenergy[3] = energy[ie]; // FIXME: pass IdZEM2, etc? + if(channelE[ie] == o2::zdc::IdZPC1) thisenergy[0] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPC2) thisenergy[1] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPC3) thisenergy[2] = energy[ie]; + if(channelE[ie] == o2::zdc::IdZPC4) thisenergy[3] = energy[ie]; } return thisenergy; }); @@ -870,8 +871,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 12) { - thistime = time[ie]; // FIXME: pass IdZEM1, etc? + if(channelT[ie] == o2::zdc::IdZEM1) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -881,8 +882,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 13) { - thistime = time[ie]; // FIXME: pass IdZEM1, etc? + if(channelT[ie] == o2::zdc::IdZEM2) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -892,8 +893,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 0) { - thistime = time[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZNAC) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -903,8 +904,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 14) { - thistime = time[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZNCC) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -914,8 +915,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 6) { - thistime = time[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZPAC) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -925,8 +926,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 20) { - thistime = time[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZPCC) { + thistime = time[ie]; break; // avoid unnecessary looping } } @@ -937,8 +938,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 12) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? + if(channelT[ie] == o2::zdc::IdZEM1) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } } @@ -948,8 +949,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 13) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM1, etc? + if(channelT[ie] == o2::zdc::IdZEM2) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } } @@ -959,8 +960,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 0) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZNAC) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } } @@ -970,8 +971,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 14) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZNCC) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } } @@ -981,8 +982,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 6) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZPAC) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } } @@ -992,8 +993,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { - if(channelT[ie] == 20) { - thisamplitude = amplitude[ie]; // FIXME: pass IdZEM2, etc? + if(channelT[ie] == o2::zdc::IdZPCC) { + thisamplitude = amplitude[ie]; break; // avoid unnecessary looping } }