diff --git a/Common/Constants/include/CommonConstants/ZDCConstants.h b/Common/Constants/include/CommonConstants/ZDCConstants.h new file mode 100644 index 0000000000000..a07de17abff65 --- /dev/null +++ b/Common/Constants/include/CommonConstants/ZDCConstants.h @@ -0,0 +1,63 @@ +// 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 + +#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; + +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; + +} // namespace zdc +} // namespace o2 + +#endif 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..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 @@ -129,41 +130,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..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,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] == o2::zdc::IdZEM1) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -753,8 +756,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] == o2::zdc::IdZEM2) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -762,8 +767,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] == o2::zdc::IdZNAC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -771,8 +778,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] == o2::zdc::IdZNCC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -780,8 +789,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] == o2::zdc::IdZPAC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -789,8 +800,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] == o2::zdc::IdZPCC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } } return thisenergy; }); @@ -802,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; }); @@ -817,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; }); @@ -832,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; }); @@ -847,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; }); @@ -858,8 +871,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] == o2::zdc::IdZEM1) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -867,8 +882,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] == o2::zdc::IdZEM2) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -876,8 +893,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] == o2::zdc::IdZNAC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -885,8 +904,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] == o2::zdc::IdZNCC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -894,8 +915,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] == o2::zdc::IdZPAC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -903,8 +926,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] == o2::zdc::IdZPCC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } } return thistime; }); @@ -913,8 +938,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] == o2::zdc::IdZEM1) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -922,8 +949,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] == o2::zdc::IdZEM2) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -931,8 +960,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] == o2::zdc::IdZNAC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -940,8 +971,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] == o2::zdc::IdZNCC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -949,8 +982,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] == o2::zdc::IdZPAC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; }); @@ -958,8 +993,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] == o2::zdc::IdZPCC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } } return thisamplitude; });