From 2f04e24504bd44e94174daa6fddd58c971e2cf85 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 21 Feb 2023 15:56:42 -0300 Subject: [PATCH 01/19] Changes to ZDC data model --- .../AODProducerWorkflowSpec.h | 8 +- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 149 ++++++---- .../include/Framework/AnalysisDataModel.h | 268 +++++++++++++++++- 3 files changed, 367 insertions(+), 58 deletions(-) diff --git a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h index d5575f8caf6e1..423815a4e0168 100644 --- a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h +++ b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h @@ -49,6 +49,8 @@ using GID = o2::dataformats::GlobalTrackID; using GIndex = o2::dataformats::VtxTrackIndex; using DataRequest = o2::globaltracking::DataRequest; +#define O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 + namespace o2::aodproducer { @@ -272,10 +274,12 @@ class AODProducerWorkflowDPL : public Task BunchCrossings mBCLookup; +#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 // zdc helper maps to avoid a number of "if" statements // when filling ZDC table - map mZDCEnergyMap; // mapping detector name to a corresponding energy - map mZDCTDCMap; // mapping TDC channel to a corresponding TDC value + std::array mZDCEnergyMap; // mapping detector id to a corresponding energy + std::array mZDCTDCMap; // mapping TDC channel id to a corresponding TDC value +#endif std::vector mITSTPCTRDTriggers; // mapping from TRD tracks ID to corresponding trigger (for tracks time extraction) std::vector mTPCTRDTriggers; // mapping from TRD tracks ID to corresponding trigger (for tracks time extraction) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 282d0f7fa1b4d..436b8cf750ecb 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1431,12 +1431,15 @@ void AODProducerWorkflowDPL::init(InitContext& ic) mFDDAmplitude = 0xFFFFFFFF; mT0Amplitude = 0xFFFFFFFF; } - - // initialize zdc helper maps - for (auto& ChannelName : o2::zdc::ChannelNames) { - mZDCEnergyMap[(string)ChannelName] = 0; - mZDCTDCMap[(string)ChannelName] = 999; +#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 + // Initialize ZDC helper maps + for (int ic = 0; ic < o2::zdc::NChannels; ic++) { + mZDCEnergyMap[ic] = -std::numeric_limits::infinity(); + } + for (int ic = 0; ic < o2::zdc::NTDCChannels; ic++) { + mZDCTDCMap[ic] = -std::numeric_limits::infinity(); } +#endif mTimer.Reset(); } @@ -1538,7 +1541,11 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto ambigMFTTracksCursor = ambigMFTTracksBuilder.cursor(); auto ambigFwdTracksCursor = ambigFwdTracksBuilder.cursor(); auto v0sCursor = v0sBuilder.cursor(); +#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 + auto zdcCursor = zdcBuilder.cursor(); +#else auto zdcCursor = zdcBuilder.cursor(); +#endif auto caloCellsCursor = caloCellsBuilder.cursor(); auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder.cursor(); auto cpvClustersCursor = cpvClustersBuilder.cursor(); @@ -1593,6 +1600,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) fv0RecPoint.getTrigger().getTriggersignals()); } +#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 for (auto zdcRecData : zdcBCRecData) { uint64_t bc = zdcRecData.ir.toLong(); auto item = bcsMap.find(bc); @@ -1602,66 +1610,109 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) } else { LOG(fatal) << "Error: could not find a corresponding BC ID for a ZDC rec. point; BC = " << bc; } - float energyZEM1 = 0; - float energyZEM2 = 0; - float energyCommonZNA = 0; - float energyCommonZNC = 0; - float energyCommonZPA = 0; - float energyCommonZPC = 0; - float energySectorZNA[4] = {0.}; - float energySectorZNC[4] = {0.}; - float energySectorZPA[4] = {0.}; - float energySectorZPC[4] = {0.}; int fe, ne, ft, nt, fi, ni; zdcRecData.getRef(fe, ne, ft, nt, fi, ni); + // initialize zdc helper maps + for (int ic = 0; ic < o2::zdc::NChannels; ic++) { + mZDCEnergyMap[ic] = -std::numeric_limits::infinity(); + } + for (int ic = 0; ic < o2::zdc::NTDCChannels; ic++) { + mZDCTDCMap[ic] = -std::numeric_limits::infinity(); + } for (int ie = 0; ie < ne; ie++) { auto& zdcEnergyData = zdcEnergies[fe + ie]; + int ch = zdcEnergyData.ch(); float energy = zdcEnergyData.energy(); - string chName = o2::zdc::channelName(zdcEnergyData.ch()); - mZDCEnergyMap.at(chName) = energy; + if (ch >= 0 && ch < o2::zdc::NChannels) { + mZDCEnergyMap[ch] = energy; + } } for (int it = 0; it < nt; it++) { auto& tdc = zdcTDCData[ft + it]; + int ch = tdc.ch(); float tdcValue = tdc.value(); - int channelID = o2::zdc::TDCSignal[tdc.ch()]; - auto channelName = o2::zdc::ChannelNames[channelID]; - mZDCTDCMap.at((string)channelName) = tdcValue; - } - energySectorZNA[0] = mZDCEnergyMap.at("ZNA1"); - energySectorZNA[1] = mZDCEnergyMap.at("ZNA2"); - energySectorZNA[2] = mZDCEnergyMap.at("ZNA3"); - energySectorZNA[3] = mZDCEnergyMap.at("ZNA4"); - energySectorZNC[0] = mZDCEnergyMap.at("ZNC1"); - energySectorZNC[1] = mZDCEnergyMap.at("ZNC2"); - energySectorZNC[2] = mZDCEnergyMap.at("ZNC3"); - energySectorZNC[3] = mZDCEnergyMap.at("ZNC4"); - energySectorZPA[0] = mZDCEnergyMap.at("ZPA1"); - energySectorZPA[1] = mZDCEnergyMap.at("ZPA2"); - energySectorZPA[2] = mZDCEnergyMap.at("ZPA3"); - energySectorZPA[3] = mZDCEnergyMap.at("ZPA4"); - energySectorZPC[0] = mZDCEnergyMap.at("ZPC1"); - energySectorZPC[1] = mZDCEnergyMap.at("ZPC2"); - energySectorZPC[2] = mZDCEnergyMap.at("ZPC3"); - energySectorZPC[3] = mZDCEnergyMap.at("ZPC4"); + if (ch >= 0 && ch < o2::zdc::NTDCChannels) { + mZDCTDCMap[ch] = tdcValue; + } + } + float energySectorZNA[4]; + float energySectorZNC[4]; + float energySectorZPA[4]; + float energySectorZPC[4]; + energySectorZNA[0] = mZDCEnergyMap[o2::zdc::IdZNA1]; + energySectorZNA[1] = mZDCEnergyMap[o2::zdc::IdZNA2]; + energySectorZNA[2] = mZDCEnergyMap[o2::zdc::IdZNA3]; + energySectorZNA[3] = mZDCEnergyMap[o2::zdc::IdZNA4]; + energySectorZNC[0] = mZDCEnergyMap[o2::zdc::IdZNC1]; + energySectorZNC[1] = mZDCEnergyMap[o2::zdc::IdZNC2]; + energySectorZNC[2] = mZDCEnergyMap[o2::zdc::IdZNC3]; + energySectorZNC[3] = mZDCEnergyMap[o2::zdc::IdZNC4]; + energySectorZPA[0] = mZDCEnergyMap[o2::zdc::IdZPA1]; + energySectorZPA[1] = mZDCEnergyMap[o2::zdc::IdZPA2]; + energySectorZPA[2] = mZDCEnergyMap[o2::zdc::IdZPA3]; + energySectorZPA[3] = mZDCEnergyMap[o2::zdc::IdZPA4]; + energySectorZPC[0] = mZDCEnergyMap[o2::zdc::IdZPC1]; + energySectorZPC[1] = mZDCEnergyMap[o2::zdc::IdZPC2]; + energySectorZPC[2] = mZDCEnergyMap[o2::zdc::IdZPC3]; + energySectorZPC[3] = mZDCEnergyMap[o2::zdc::IdZPC4]; zdcCursor(0, bcID, - mZDCEnergyMap.at("ZEM1"), - mZDCEnergyMap.at("ZEM2"), - mZDCEnergyMap.at("ZNAC"), - mZDCEnergyMap.at("ZNCC"), - mZDCEnergyMap.at("ZPAC"), - mZDCEnergyMap.at("ZPCC"), + mZDCEnergyMap[o2::zdc::IdZEM1], + mZDCEnergyMap[o2::zdc::IdZEM2], + mZDCEnergyMap[o2::zdc::IdZNAC], + mZDCEnergyMap[o2::zdc::IdZNCC], + mZDCEnergyMap[o2::zdc::IdZPAC], + mZDCEnergyMap[o2::zdc::IdZPCC], energySectorZNA, energySectorZNC, energySectorZPA, energySectorZPC, - mZDCTDCMap.at("ZEM1"), - mZDCTDCMap.at("ZEM2"), - mZDCTDCMap.at("ZNAC"), - mZDCTDCMap.at("ZNCC"), - mZDCTDCMap.at("ZPAC"), - mZDCTDCMap.at("ZPCC")); + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZEM1], + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZEM2], + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZNAC], + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZNCC], + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZPAC], + mZDCTDCMap[o2::zdc::TDCChannelID::TDCZPCC]); } +#else + std::vector zdcEnergy, zdcAmplitudes, zdcTime; + std::vector zdcChannelsE, zdcChannelsT; + for (auto zdcRecData : zdcBCRecData) { + uint64_t bc = zdcRecData.ir.toLong(); + auto item = bcsMap.find(bc); + int bcID = -1; + if (item != bcsMap.end()) { + bcID = item->second; + } else { + LOG(fatal) << "Error: could not find a corresponding BC ID for a ZDC rec. point; BC = " << bc; + } + int fe, ne, ft, nt, fi, ni; + zdcRecData.getRef(fe, ne, ft, nt, fi, ni); + zdcEnergy.clear(); + zdcChannelsE.clear(); + zdcAmplitudes.clear(); + zdcTime.clear(); + zdcChannelsT.clear(); + for (int ie = 0; ie < ne; ie++) { + auto& zdcEnergyData = zdcEnergies[fe + ie]; + zdcEnergy.emplace_back(zdcEnergyData.energy()); + zdcChannelsE.emplace_back(zdcEnergyData.ch()); + } + for (int it = 0; it < nt; it++) { + auto& tdc = zdcTDCData[ft + it]; + zdcAmplitudes.emplace_back(tdc.amplitude()); + zdcTime.emplace_back(tdc.value()); + zdcChannelsT.emplace_back(o2::zdc::TDCSignal[tdc.ch()]); + } + zdcCursor(0, + bcID, + zdcEnergy, + zdcChannelsE, + zdcAmplitudes, + zdcTime, + zdcChannelsT); + } +#endif // keep track event/source id for each mc-collision // using map and not unordered_map to ensure diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index fb4253757a45c..e36b75e7a67cb 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -708,9 +708,8 @@ DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER", //! CPV clusters cpvcluster::ModuleNumber, cpvcluster::IsUnfolded); using CPVCluster = CPVClusters::iterator; -namespace zdc +namespace zdclegacy // needed to have the new dynamic columns with the same name { -DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float); //! DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); //! @@ -727,13 +726,268 @@ DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! +} +namespace zdc +{ +DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index +// New summarized table, minimal disk footprint +DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) +DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. +DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of non-zero channels. The channel IDs are given in ChannelT (at the same index) +DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non-zero channels. The channel IDs are given in ChannelT (at the same index) +DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. +// Dynamic columns to take into account packed information; replace old getters +DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! + [](std::span channelE, std::span energy) -> float { + 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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! + [](std::span channelE, std::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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! + [](std::span channelE, std::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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! + [](std::span channelE, std::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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! + [](std::span channelE, std::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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! + [](std::span channelE, std::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 + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! + [](std::span channelE, std::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -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? + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! + [](std::span channelE, std::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -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? + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! + [](std::span channelE, std::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -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? + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! + [](std::span channelE, std::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -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? + } + return thisenergy; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! + [](std::span channelT, std::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 + } + return thistime; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! + [](std::span channelT, std::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 + } + return thistime; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! + [](std::span channelT, std::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 + } + return thistime; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! + [](std::span channelT, std::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 + } + return thistime; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! + [](std::span channelT, std::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 + } + return thistime; + }); +DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! + [](std::span channelT, std::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 + } + return thistime; + }); + +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! + [](std::span channelT, std::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 + } + return thisamplitude; + }); } // namespace zdc -DECLARE_SOA_TABLE(Zdcs, "AOD", "ZDC", //! ZDC information - o2::soa::Index<>, zdc::BCId, zdc::EnergyZEM1, zdc::EnergyZEM2, - zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, - zdc::EnergySectorZNA, zdc::EnergySectorZNC, zdc::EnergySectorZPA, zdc::EnergySectorZPC, - zdc::TimeZEM1, zdc::TimeZEM2, zdc::TimeZNA, zdc::TimeZNC, zdc::TimeZPA, zdc::TimeZPC); +DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information + o2::soa::Index<>, zdc::BCId, zdclegacy::EnergyZEM1, zdclegacy::EnergyZEM2, + zdclegacy::EnergyCommonZNA, zdclegacy::EnergyCommonZNC, zdclegacy::EnergyCommonZPA, zdclegacy::EnergyCommonZPC, + zdclegacy::EnergySectorZNA, zdclegacy::EnergySectorZNC, zdclegacy::EnergySectorZPA, zdclegacy::EnergySectorZPC, + zdclegacy::TimeZEM1, zdclegacy::TimeZEM2, zdclegacy::TimeZNA, zdclegacy::TimeZNC, zdclegacy::TimeZPA, zdclegacy::TimeZPC); + +DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! Full ZDC information, std::vector format + o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, + zdc::EnergyZEM1, zdc::EnergyZEM2, + zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, + zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, + zdc::EnergySectorZNA, zdc::EnergySectorZNC, + zdc::EnergySectorZPA, zdc::EnergySectorZPC, + zdc::TimeZEM1, zdc::TimeZEM2, + zdc::TimeZNA, zdc::TimeZNC, + zdc::TimeZPA, zdc::TimeZPC, + zdc::AmplitudeZEM1, zdc::AmplitudeZEM2, + zdc::AmplitudeZNA, zdc::AmplitudeZNC, + zdc::AmplitudeZPA, zdc::AmplitudeZPC); // +#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 +using Zdcs = Zdcs_001; //! this defines the current default version +#endif +#ifndef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 +using Zdcs = Zdcs_000; //! this defines the current default version +#endif using Zdc = Zdcs::iterator; namespace fv0a From ef4aa636272585e043c5307d57ed56d33718cea4 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Thu, 2 Mar 2023 07:49:31 -0300 Subject: [PATCH 02/19] Changes WIP --- .../AODProducerWorkflow/AODProducerWorkflowSpec.h | 4 ---- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 8 ++------ .../Core/include/Framework/AnalysisDataModel.h | 13 +++++++------ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h index 423815a4e0168..fdcf952132cb0 100644 --- a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h +++ b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h @@ -49,8 +49,6 @@ using GID = o2::dataformats::GlobalTrackID; using GIndex = o2::dataformats::VtxTrackIndex; using DataRequest = o2::globaltracking::DataRequest; -#define O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 - namespace o2::aodproducer { @@ -274,12 +272,10 @@ class AODProducerWorkflowDPL : public Task BunchCrossings mBCLookup; -#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 // zdc helper maps to avoid a number of "if" statements // when filling ZDC table std::array mZDCEnergyMap; // mapping detector id to a corresponding energy std::array mZDCTDCMap; // mapping TDC channel id to a corresponding TDC value -#endif std::vector mITSTPCTRDTriggers; // mapping from TRD tracks ID to corresponding trigger (for tracks time extraction) std::vector mTPCTRDTriggers; // mapping from TRD tracks ID to corresponding trigger (for tracks time extraction) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 436b8cf750ecb..21ba98bf4bc03 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1431,7 +1431,7 @@ void AODProducerWorkflowDPL::init(InitContext& ic) mFDDAmplitude = 0xFFFFFFFF; mT0Amplitude = 0xFFFFFFFF; } -#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 +#ifdef O2_ZDC_NEWDATAMODEL // Initialize ZDC helper maps for (int ic = 0; ic < o2::zdc::NChannels; ic++) { mZDCEnergyMap[ic] = -std::numeric_limits::infinity(); @@ -1541,11 +1541,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto ambigMFTTracksCursor = ambigMFTTracksBuilder.cursor(); auto ambigFwdTracksCursor = ambigFwdTracksBuilder.cursor(); auto v0sCursor = v0sBuilder.cursor(); -#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 auto zdcCursor = zdcBuilder.cursor(); -#else - auto zdcCursor = zdcBuilder.cursor(); -#endif auto caloCellsCursor = caloCellsBuilder.cursor(); auto caloCellsTRGTableCursor = caloCellsTRGTableBuilder.cursor(); auto cpvClustersCursor = cpvClustersBuilder.cursor(); @@ -1600,7 +1596,7 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) fv0RecPoint.getTrigger().getTriggersignals()); } -#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 +#ifndef O2_ZDC_NEWDATAMODEL for (auto zdcRecData : zdcBCRecData) { uint64_t bc = zdcRecData.ir.toLong(); auto item = bcsMap.find(bc); diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index e36b75e7a67cb..e1cfa780b22c4 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -11,6 +11,8 @@ #ifndef O2_FRAMEWORK_ANALYSISDATAMODEL_H_ #define O2_FRAMEWORK_ANALYSISDATAMODEL_H_ +#define O2_ZDC_NEWDATAMODEL + #include "Framework/ASoA.h" #include #include @@ -730,7 +732,7 @@ DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! namespace zdc { DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index -// New summarized table, minimal disk footprint +// New summarized table, minimal disk footprint, per channel like other detectors DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of non-zero channels. The channel IDs are given in ChannelT (at the same index) @@ -982,11 +984,10 @@ DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! Full ZDC information, zdc::AmplitudeZEM1, zdc::AmplitudeZEM2, zdc::AmplitudeZNA, zdc::AmplitudeZNC, zdc::AmplitudeZPA, zdc::AmplitudeZPC); // -#ifdef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 -using Zdcs = Zdcs_001; //! this defines the current default version -#endif -#ifndef O2_AODPRODUCER_WORKFLOW_SPEC_ZDC_RUN2 -using Zdcs = Zdcs_000; //! this defines the current default version +#ifdef O2_ZDC_NEWDATAMODEL +using Zdcs = Zdcs_001; //! new version +#else +using Zdcs = Zdcs_000; //! old version #endif using Zdc = Zdcs::iterator; From c473ee4628d53cdbef6714c41f7101208660b1b7 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Thu, 2 Mar 2023 09:35:23 -0300 Subject: [PATCH 03/19] Bugfix in span --- .../include/Framework/AnalysisDataModel.h | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index e1cfa780b22c4..77b683f09ca13 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -726,7 +726,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 @@ -740,7 +740,7 @@ DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. // Dynamic columns to take into account packed information; replace old getters DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! - [](std::span channelE, std::span energy) -> float { + [](gsl::span channelE, gsl::span energy) -> float { auto ne = channelE.size(); auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -750,7 +750,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! - [](std::span channelE, std::span energy) -> float { + [](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? @@ -759,7 +759,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! - [](std::span channelE, std::span energy) -> float { + [](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? @@ -768,7 +768,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! - [](std::span channelE, std::span energy) -> float { + [](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? @@ -777,7 +777,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! - [](std::span channelE, std::span energy) -> float { + [](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? @@ -786,7 +786,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! - [](std::span channelE, std::span energy) -> float { + [](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? @@ -795,7 +795,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! - [](std::span channelE, std::span energy) -> std::array { + [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), -std::numeric_limits::infinity(), @@ -810,7 +810,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! - [](std::span channelE, std::span energy) -> std::array { + [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), -std::numeric_limits::infinity(), @@ -825,7 +825,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! - [](std::span channelE, std::span energy) -> std::array { + [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), -std::numeric_limits::infinity(), @@ -840,7 +840,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! - [](std::span channelE, std::span energy) -> std::array { + [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), -std::numeric_limits::infinity(), @@ -855,7 +855,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -864,7 +864,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! return thistime; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -873,7 +873,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! return thistime; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -882,7 +882,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! return thistime; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -891,7 +891,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! return thistime; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -900,7 +900,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! return thistime; }); DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! - [](std::span channelT, std::span time) -> float { + [](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? @@ -910,7 +910,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? @@ -919,7 +919,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! return thisamplitude; }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? @@ -928,7 +928,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! return thisamplitude; }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? @@ -937,7 +937,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! return thisamplitude; }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? @@ -946,7 +946,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! return thisamplitude; }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? @@ -955,7 +955,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! return thisamplitude; }); DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! - [](std::span channelT, std::span amplitude) -> float { + [](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? From 1317296fa490cddb5ca9cea02c1e8f84c557d5c4 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Fri, 3 Mar 2023 10:32:27 -0300 Subject: [PATCH 04/19] Fix name of tree in AO2D --- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 21ba98bf4bc03..1c9e941a82cf0 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1512,7 +1512,11 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto& ambigMFTTracksBuilder = pc.outputs().make(Output{"AOD", "AMBIGUOUSMFTTR"}); auto& ambigFwdTracksBuilder = pc.outputs().make(Output{"AOD", "AMBIGUOUSFWDTR"}); auto& v0sBuilder = pc.outputs().make(Output{"AOD", "V0_001"}); + #ifdef O2_ZDC_NEWDATAMODEL + auto& zdcBuilder = pc.outputs().make(Output{"AOD", "ZDC_001"}); + #else auto& zdcBuilder = pc.outputs().make(Output{"AOD", "ZDC"}); + #endif auto& caloCellsBuilder = pc.outputs().make(Output{"AOD", "CALO"}); auto& caloCellsTRGTableBuilder = pc.outputs().make(Output{"AOD", "CALOTRIGGER"}); auto& cpvClustersBuilder = pc.outputs().make(Output{"AOD", "CPVCLUSTER"}); From f4d33c68a5bd9b67b75a90203abacade60e0e306 Mon Sep 17 00:00:00 2001 From: Pietro Cortese Date: Fri, 17 Mar 2023 09:47:09 +0100 Subject: [PATCH 05/19] 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 06/19] 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 } } From 96cbebf6205c9305a487eb1335ff6d4a2c62d060 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 17 Mar 2023 13:28:45 +0000 Subject: [PATCH 07/19] Please consider the following formatting changes --- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 6 +- .../include/Framework/AnalysisDataModel.h | 450 +++++++++--------- 2 files changed, 236 insertions(+), 220 deletions(-) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 76f6a1669ad82..96608824a55c7 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1512,11 +1512,11 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) auto& ambigMFTTracksBuilder = pc.outputs().make(Output{"AOD", "AMBIGUOUSMFTTR"}); auto& ambigFwdTracksBuilder = pc.outputs().make(Output{"AOD", "AMBIGUOUSFWDTR"}); auto& v0sBuilder = pc.outputs().make(Output{"AOD", "V0_001"}); - #ifdef O2_ZDC_NEWDATAMODEL +#ifdef O2_ZDC_NEWDATAMODEL auto& zdcBuilder = pc.outputs().make(Output{"AOD", "ZDC_001"}); - #else +#else auto& zdcBuilder = pc.outputs().make(Output{"AOD", "ZDC"}); - #endif +#endif auto& caloCellsBuilder = pc.outputs().make(Output{"AOD", "CALO"}); auto& caloCellsTRGTableBuilder = pc.outputs().make(Output{"AOD", "CALOTRIGGER"}); auto& cpvClustersBuilder = pc.outputs().make(Output{"AOD", "CPVCLUSTER"}); diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 52ca235743604..22f9f980630d4 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -711,7 +711,7 @@ DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER", //! CPV clusters cpvcluster::ModuleNumber, cpvcluster::IsUnfolded); using CPVCluster = CPVClusters::iterator; -namespace zdclegacy // needed to have the new dynamic columns with the same name +namespace zdclegacy // needed to have the new dynamic columns with the same name { DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float); //! @@ -729,276 +729,292 @@ DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! -} +} // namespace zdclegacy namespace zdc { -DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index +DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index // New summarized table, minimal disk footprint, per channel like other detectors -DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) -DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. -DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of non-zero channels. The channel IDs are given in ChannelT (at the same index) -DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non-zero channels. The channel IDs are given in ChannelT (at the same index) -DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. +DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) +DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. +DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of non-zero channels. The channel IDs are given in ChannelT (at the same index) +DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non-zero channels. The channel IDs are given in ChannelT (at the same index) +DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. // Dynamic columns to take into account packed information; replace old getters DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! [](gsl::span channelE, gsl::span energy) -> float { - auto ne = channelE.size(); - auto thisenergy = -std::numeric_limits::infinity(); - for (uint64_t ie = 0; ie < channelE.size(); ie++) { - if(channelE[ie] == o2::zdc::IdZEM1) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto ne = channelE.size(); + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZEM1) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); 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] == o2::zdc::IdZEM2) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZEM2) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); 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] == o2::zdc::IdZNAC) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZNAC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); 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] == o2::zdc::IdZNCC) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZNCC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); 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] == o2::zdc::IdZPAC) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZPAC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); 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] == o2::zdc::IdZPCC) { - thisenergy = energy[ie]; - break; // avoid unnecessary looping - } - } - return thisenergy; + auto thisenergy = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + if (channelE[ie] == o2::zdc::IdZPCC) { + thisenergy = energy[ie]; + break; // avoid unnecessary looping + } + } + return thisenergy; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! - [](gsl::span channelE, gsl::span energy) -> std::array { - std::array thisenergy = { - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}; - for (uint64_t ie = 0; ie < channelE.size(); ie++) { - 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; + [](gsl::span channelE, gsl::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity()}; + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + 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; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! - [](gsl::span channelE, gsl::span energy) -> std::array { - std::array thisenergy = { - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}; - for (uint64_t ie = 0; ie < channelE.size(); ie++) { - 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; + [](gsl::span channelE, gsl::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity()}; + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + 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; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! - [](gsl::span channelE, gsl::span energy) -> std::array { - std::array thisenergy = { - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}; - for (uint64_t ie = 0; ie < channelE.size(); ie++) { - 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; + [](gsl::span channelE, gsl::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity()}; + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + 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; }); DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! - [](gsl::span channelE, gsl::span energy) -> std::array { - std::array thisenergy = { - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}; - for (uint64_t ie = 0; ie < channelE.size(); ie++) { - 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; + [](gsl::span channelE, gsl::span energy) -> std::array { + std::array thisenergy = { + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -std::numeric_limits::infinity()}; + for (uint64_t ie = 0; ie < channelE.size(); ie++) { + 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; }); 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] == o2::zdc::IdZEM1) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZEM1) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZEM2) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZEM2) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZNAC) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZNAC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZNCC) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZNCC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZPAC) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZPAC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZPCC) { - thistime = time[ie]; - break; // avoid unnecessary looping - } - } - return thistime; + auto thistime = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZPCC) { + thistime = time[ie]; + break; // avoid unnecessary looping + } + } + return thistime; }); 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] == o2::zdc::IdZEM1) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZEM1) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); 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] == o2::zdc::IdZEM2) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZEM2) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); 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] == o2::zdc::IdZNAC) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZNAC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); 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] == o2::zdc::IdZNCC) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZNCC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); 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] == o2::zdc::IdZPAC) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZPAC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); 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] == o2::zdc::IdZPCC) { - thisamplitude = amplitude[ie]; - break; // avoid unnecessary looping - } - } - return thisamplitude; + auto thisamplitude = -std::numeric_limits::infinity(); + for (uint64_t ie = 0; ie < channelT.size(); ie++) { + if (channelT[ie] == o2::zdc::IdZPCC) { + thisamplitude = amplitude[ie]; + break; // avoid unnecessary looping + } + } + return thisamplitude; }); } // namespace zdc @@ -1009,18 +1025,18 @@ DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information zdclegacy::TimeZEM1, zdclegacy::TimeZEM2, zdclegacy::TimeZNA, zdclegacy::TimeZNC, zdclegacy::TimeZPA, zdclegacy::TimeZPC); DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! Full ZDC information, std::vector format - o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, - zdc::EnergyZEM1, zdc::EnergyZEM2, - zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, - zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, - zdc::EnergySectorZNA, zdc::EnergySectorZNC, - zdc::EnergySectorZPA, zdc::EnergySectorZPC, - zdc::TimeZEM1, zdc::TimeZEM2, - zdc::TimeZNA, zdc::TimeZNC, - zdc::TimeZPA, zdc::TimeZPC, - zdc::AmplitudeZEM1, zdc::AmplitudeZEM2, - zdc::AmplitudeZNA, zdc::AmplitudeZNC, - zdc::AmplitudeZPA, zdc::AmplitudeZPC); // + o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, + zdc::EnergyZEM1, zdc::EnergyZEM2, + zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, + zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, + zdc::EnergySectorZNA, zdc::EnergySectorZNC, + zdc::EnergySectorZPA, zdc::EnergySectorZPC, + zdc::TimeZEM1, zdc::TimeZEM2, + zdc::TimeZNA, zdc::TimeZNC, + zdc::TimeZPA, zdc::TimeZPC, + zdc::AmplitudeZEM1, zdc::AmplitudeZEM2, + zdc::AmplitudeZNA, zdc::AmplitudeZNC, + zdc::AmplitudeZPA, zdc::AmplitudeZPC); // #ifdef O2_ZDC_NEWDATAMODEL using Zdcs = Zdcs_001; //! new version #else From efa001275da2891b2a868404e9aae3293b1603b4 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 17 Mar 2023 15:18:20 -0300 Subject: [PATCH 08/19] Comment #define for now --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 22f9f980630d4..e2349c02f54cc 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -11,7 +11,7 @@ #ifndef O2_FRAMEWORK_ANALYSISDATAMODEL_H_ #define O2_FRAMEWORK_ANALYSISDATAMODEL_H_ -#define O2_ZDC_NEWDATAMODEL +// #define O2_ZDC_NEWDATAMODEL #include "Framework/ASoA.h" #include From d163e32bc3665e8d5da6aa145e215ce4ef04d17d Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 3 Apr 2023 11:28:23 -0300 Subject: [PATCH 09/19] Update Framework/Core/include/Framework/AnalysisDataModel.h Co-authored-by: Jan Fiete --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index e2349c02f54cc..3a3b11249eebb 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1024,7 +1024,7 @@ DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information zdclegacy::EnergySectorZNA, zdclegacy::EnergySectorZNC, zdclegacy::EnergySectorZPA, zdclegacy::EnergySectorZPC, zdclegacy::TimeZEM1, zdclegacy::TimeZEM2, zdclegacy::TimeZNA, zdclegacy::TimeZNC, zdclegacy::TimeZPA, zdclegacy::TimeZPC); -DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! Full ZDC information, std::vector format +DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! ZDC information, version 1, std::vector format o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, zdc::EnergyZEM1, zdc::EnergyZEM2, zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, From 5182ea4c2876094cecdccf6bac7d6ffb2624982e Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 3 Apr 2023 11:29:18 -0300 Subject: [PATCH 10/19] Update Framework/Core/include/Framework/AnalysisDataModel.h move `legacy` to `_000` Co-authored-by: Jan Fiete --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 3a3b11249eebb..73eded4d3c0cf 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -711,7 +711,7 @@ DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER", //! CPV clusters cpvcluster::ModuleNumber, cpvcluster::IsUnfolded); using CPVCluster = CPVClusters::iterator; -namespace zdclegacy // needed to have the new dynamic columns with the same name +namespace zdc_000 // needed to have the new dynamic columns with the same name { DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float); //! From cd846a13d96945b69b8eded4dde1a33157ed2576 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 3 Apr 2023 14:29:54 +0000 Subject: [PATCH 11/19] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 73eded4d3c0cf..f3d74ecc2fa4a 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -729,7 +729,7 @@ DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! -} // namespace zdclegacy +} // namespace zdc_000 namespace zdc { DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index From b72eebc55525b5586879a11ee7a1674f9959bb78 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Mon, 3 Apr 2023 11:35:02 -0300 Subject: [PATCH 12/19] Add comments --- .../include/Framework/AnalysisDataModel.h | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index f3d74ecc2fa4a..0a688d78a6898 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -11,7 +11,7 @@ #ifndef O2_FRAMEWORK_ANALYSISDATAMODEL_H_ #define O2_FRAMEWORK_ANALYSISDATAMODEL_H_ -// #define O2_ZDC_NEWDATAMODEL +// #define O2_ZDC_NEWDATAMODEL -> commented for now #include "Framework/ASoA.h" #include @@ -740,7 +740,7 @@ DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non-zero channels. The channel IDs are given in ChannelT (at the same index) DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. // Dynamic columns to take into account packed information; replace old getters -DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! return ZEM1 energy [](gsl::span channelE, gsl::span energy) -> float { auto ne = channelE.size(); auto thisenergy = -std::numeric_limits::infinity(); @@ -752,7 +752,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! return ZEM2 energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -763,7 +763,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! return common ZNA energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -774,7 +774,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! return common ZNC energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -785,7 +785,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! return common ZPA energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -796,7 +796,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! return common ZPC energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -807,7 +807,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! return sector ZNA energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -826,7 +826,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! return sector ZNC energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -845,7 +845,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! return sector ZPA energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -864,7 +864,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! +DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! return sector ZPC energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -883,7 +883,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! return ZEM1 time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -894,7 +894,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! return ZEM2 time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -905,7 +905,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! return ZNA time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -916,7 +916,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! return ZNC time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -927,7 +927,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! return ZPA time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -938,7 +938,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! +DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! return ZPC time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -950,7 +950,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! return ZEM1 amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -961,7 +961,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! return ZEM2 amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -972,7 +972,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! return ZNA amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -983,7 +983,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! return ZNC amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -994,7 +994,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! return ZPA amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -1005,7 +1005,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! +DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! return ZPC amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { From db62dc17b172e8d3165d1431c20f2eb79bbebacb Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 3 Apr 2023 14:35:49 +0000 Subject: [PATCH 13/19] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 0a688d78a6898..156307ad6db3b 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -11,7 +11,7 @@ #ifndef O2_FRAMEWORK_ANALYSISDATAMODEL_H_ #define O2_FRAMEWORK_ANALYSISDATAMODEL_H_ -// #define O2_ZDC_NEWDATAMODEL -> commented for now +// #define O2_ZDC_NEWDATAMODEL -> commented for now #include "Framework/ASoA.h" #include From 0d68bd889d14481dd257ef505dbf15ae29f62456 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Mon, 3 Apr 2023 12:35:28 -0300 Subject: [PATCH 14/19] Change syntax to correct one for aod producer --- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 96608824a55c7..db234317dbf3e 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -2574,7 +2574,7 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo 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); + outputs.emplace_back(OutputLabel{"O2zdc_001"}, "AOD", "ZDC", 1, Lifetime::Timeframe); #else outputs.emplace_back(OutputLabel{"O2zdc"}, "AOD", "ZDC", 0, Lifetime::Timeframe); #endif From a182c900719ae0bba88f8cae13207cf4e92c344f Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Mon, 3 Apr 2023 17:05:27 -0300 Subject: [PATCH 15/19] Fixes --- Framework/Core/include/Framework/AnalysisDataModel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 156307ad6db3b..f0571fa73af25 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1019,10 +1019,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! return ZPC amplitude } // namespace zdc DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information - o2::soa::Index<>, zdc::BCId, zdclegacy::EnergyZEM1, zdclegacy::EnergyZEM2, - zdclegacy::EnergyCommonZNA, zdclegacy::EnergyCommonZNC, zdclegacy::EnergyCommonZPA, zdclegacy::EnergyCommonZPC, - zdclegacy::EnergySectorZNA, zdclegacy::EnergySectorZNC, zdclegacy::EnergySectorZPA, zdclegacy::EnergySectorZPC, - zdclegacy::TimeZEM1, zdclegacy::TimeZEM2, zdclegacy::TimeZNA, zdclegacy::TimeZNC, zdclegacy::TimeZPA, zdclegacy::TimeZPC); + o2::soa::Index<>, zdc::BCId, zdc_000::EnergyZEM1, zdc_000::EnergyZEM2, + zdc_000::EnergyCommonZNA, zdc_000::EnergyCommonZNC, zdc_000::EnergyCommonZPA, zdc_000::EnergyCommonZPC, + zdc_000::EnergySectorZNA, zdc_000::EnergySectorZNC, zdc_000::EnergySectorZPA, zdc_000::EnergySectorZPC, + zdc_000::TimeZEM1, zdc_000::TimeZEM2, zdc_000::TimeZNA, zdc_000::TimeZNC, zdc_000::TimeZPA, zdc_000::TimeZPC); DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! ZDC information, version 1, std::vector format o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, From 8a0c6cace5fe5109010c7049da22b361520c673d Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 4 Apr 2023 04:47:59 -0300 Subject: [PATCH 16/19] Change naming to avoid issues --- .../include/Framework/AnalysisDataModel.h | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index f0571fa73af25..fd8c04ccef7c2 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -711,8 +711,9 @@ DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER", //! CPV clusters cpvcluster::ModuleNumber, cpvcluster::IsUnfolded); using CPVCluster = CPVClusters::iterator; -namespace zdc_000 // needed to have the new dynamic columns with the same name +namespace zdc // Original ZDC table elements (legacy/000) { +DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index, to be used by both legacy and new table DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float); //! DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); //! @@ -730,9 +731,8 @@ DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! } // namespace zdc_000 -namespace zdc +namespace zdc_001 // Revised table, required for dynamic in-place replacements { -DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index // New summarized table, minimal disk footprint, per channel like other detectors DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. @@ -1019,24 +1019,24 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! return ZPC amplitude } // namespace zdc DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information - o2::soa::Index<>, zdc::BCId, zdc_000::EnergyZEM1, zdc_000::EnergyZEM2, - zdc_000::EnergyCommonZNA, zdc_000::EnergyCommonZNC, zdc_000::EnergyCommonZPA, zdc_000::EnergyCommonZPC, - zdc_000::EnergySectorZNA, zdc_000::EnergySectorZNC, zdc_000::EnergySectorZPA, zdc_000::EnergySectorZPC, - zdc_000::TimeZEM1, zdc_000::TimeZEM2, zdc_000::TimeZNA, zdc_000::TimeZNC, zdc_000::TimeZPA, zdc_000::TimeZPC); + o2::soa::Index<>, zdc::BCId, zdc::EnergyZEM1, zdc::EnergyZEM2, + zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, + zdc::EnergySectorZNA, zdc::EnergySectorZNC, zdc::EnergySectorZPA, zdc::EnergySectorZPC, + zdc::TimeZEM1, zdc::TimeZEM2, zdc::TimeZNA, zdc::TimeZNC, zdc::TimeZPA, zdc::TimeZPC); DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! ZDC information, version 1, std::vector format - o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, - zdc::EnergyZEM1, zdc::EnergyZEM2, - zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, - zdc::EnergyCommonZPA, zdc::EnergyCommonZPC, - zdc::EnergySectorZNA, zdc::EnergySectorZNC, - zdc::EnergySectorZPA, zdc::EnergySectorZPC, - zdc::TimeZEM1, zdc::TimeZEM2, - zdc::TimeZNA, zdc::TimeZNC, - zdc::TimeZPA, zdc::TimeZPC, - zdc::AmplitudeZEM1, zdc::AmplitudeZEM2, - zdc::AmplitudeZNA, zdc::AmplitudeZNC, - zdc::AmplitudeZPA, zdc::AmplitudeZPC); // + o2::soa::Index<>, zdc::BCId, zdc_001::Energy, zdc_001::ChannelE, zdc_001::Amplitude, zdc_001::Time, zdc_001::ChannelT, + zdc_001::EnergyZEM1, zdc_001::EnergyZEM2, + zdc_001::EnergyCommonZNA, zdc_001::EnergyCommonZNC, + zdc_001::EnergyCommonZPA, zdc_001::EnergyCommonZPC, + zdc_001::EnergySectorZNA, zdc_001::EnergySectorZNC, + zdc_001::EnergySectorZPA, zdc_001::EnergySectorZPC, + zdc_001::TimeZEM1, zdc_001::TimeZEM2, + zdc_001::TimeZNA, zdc_001::TimeZNC, + zdc_001::TimeZPA, zdc_001::TimeZPC, + zdc_001::AmplitudeZEM1, zdc_001::AmplitudeZEM2, + zdc_001::AmplitudeZNA, zdc_001::AmplitudeZNC, + zdc_001::AmplitudeZPA, zdc_001::AmplitudeZPC); // #ifdef O2_ZDC_NEWDATAMODEL using Zdcs = Zdcs_001; //! new version #else From f8f00f91cb544caa8902e5c02b530f3aa30bf881 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Apr 2023 07:48:44 +0000 Subject: [PATCH 17/19] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index fd8c04ccef7c2..83a35f2574798 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -713,7 +713,7 @@ using CPVCluster = CPVClusters::iterator; namespace zdc // Original ZDC table elements (legacy/000) { -DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index, to be used by both legacy and new table +DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index, to be used by both legacy and new table DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float); //! DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); //! @@ -730,7 +730,7 @@ DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! -} // namespace zdc_000 +} // namespace zdc namespace zdc_001 // Revised table, required for dynamic in-place replacements { // New summarized table, minimal disk footprint, per channel like other detectors @@ -1016,7 +1016,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! return ZPC amplitude } return thisamplitude; }); -} // namespace zdc +} // namespace zdc_001 DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information o2::soa::Index<>, zdc::BCId, zdc::EnergyZEM1, zdc::EnergyZEM2, From 8653560d632878c0793702e544749055755612c4 Mon Sep 17 00:00:00 2001 From: David Dobrigkeit Chinellato Date: Tue, 4 Apr 2023 12:23:24 -0300 Subject: [PATCH 18/19] Unified zdc namespace, same getters, different names --- .../include/Framework/AnalysisDataModel.h | 74 +++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 83a35f2574798..6abe23bf5d206 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -711,7 +711,7 @@ DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER", //! CPV clusters cpvcluster::ModuleNumber, cpvcluster::IsUnfolded); using CPVCluster = CPVClusters::iterator; -namespace zdc // Original ZDC table elements (legacy/000) +namespace zdc { DECLARE_SOA_INDEX_COLUMN(BC, bc); //! BC index, to be used by both legacy and new table DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float); //! @@ -730,9 +730,6 @@ DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); //! DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); //! DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float); //! DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float); //! -} // namespace zdc -namespace zdc_001 // Revised table, required for dynamic in-place replacements -{ // New summarized table, minimal disk footprint, per channel like other detectors DECLARE_SOA_COLUMN(Energy, energy, std::vector); //! Energy of non-zero channels. The channel IDs are given in ChannelE (at the same index) DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector); //! Channel IDs which have reconstructed energy. There are at maximum 26 channels. @@ -740,7 +737,7 @@ DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector); //! Amplitudes of DECLARE_SOA_COLUMN(Time, time, std::vector); //! Times of non-zero channels. The channel IDs are given in ChannelT (at the same index) DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector); //! Channel IDs which had non-zero amplitudes. There are at maximum 26 channels. // Dynamic columns to take into account packed information; replace old getters -DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! return ZEM1 energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyZEM1, energyZEM1, //! return ZEM1 energy [](gsl::span channelE, gsl::span energy) -> float { auto ne = channelE.size(); auto thisenergy = -std::numeric_limits::infinity(); @@ -752,7 +749,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM1, energyZEM1, //! return ZEM1 energy } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! return ZEM2 energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyZEM2, energyZEM2, //! return ZEM2 energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -763,7 +760,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyZEM2, energyZEM2, //! return ZEM2 energy } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! return common ZNA energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZNA, energyCommonZNA, //! return common ZNA energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -774,7 +771,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNA, energyCommonZNA, //! return common Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! return common ZNC energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZNC, energyCommonZNC, //! return common ZNC energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -785,7 +782,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZNC, energyCommonZNC, //! return common Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! return common ZPA energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZPA, energyCommonZPA, //! return common ZPA energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -796,7 +793,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPA, energyCommonZPA, //! return common Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! return common ZPC energy +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZPC, energyCommonZPC, //! return common ZPC energy [](gsl::span channelE, gsl::span energy) -> float { auto thisenergy = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelE.size(); ie++) { @@ -807,7 +804,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergyCommonZPC, energyCommonZPC, //! return common Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! return sector ZNA energy (array of 4 floats) +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZNA, energySectorZNA, //! return sector ZNA energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -826,7 +823,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNA, energySectorZNA, //! return sector Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! return sector ZNC energy (array of 4 floats) +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZNC, energySectorZNC, //! return sector ZNC energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -845,7 +842,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZNC, energySectorZNC, //! return sector Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! return sector ZPA energy (array of 4 floats) +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZPA, energySectorZPA, //! return sector ZPA energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -864,7 +861,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPA, energySectorZPA, //! return sector Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! return sector ZPC energy (array of 4 floats) +DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZPC, energySectorZPC, //! return sector ZPC energy (array of 4 floats) [](gsl::span channelE, gsl::span energy) -> std::array { std::array thisenergy = { -std::numeric_limits::infinity(), @@ -883,7 +880,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(EnergySectorZPC, energySectorZPC, //! return sector Z } return thisenergy; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! return ZEM1 time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZEM1, timeZEM1, //! return ZEM1 time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -894,7 +891,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM1, timeZEM1, //! return ZEM1 time information } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! return ZEM2 time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZEM2, timeZEM2, //! return ZEM2 time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -905,7 +902,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZEM2, timeZEM2, //! return ZEM2 time information } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! return ZNA time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZNA, timeZNA, //! return ZNA time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -916,7 +913,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNA, timeZNA, //! return ZNA time information } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! return ZNC time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZNC, timeZNC, //! return ZNC time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -927,7 +924,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZNC, timeZNC, //! return ZNC time information } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! return ZPA time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZPA, timeZPA, //! return ZPA time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -938,7 +935,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPA, timeZPA, //! return ZPA time information } return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! return ZPC time information +DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZPC, timeZPC, //! return ZPC time information [](gsl::span channelT, gsl::span time) -> float { auto thistime = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -950,7 +947,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TimeZPC, timeZPC, //! return ZPC time information return thistime; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! return ZEM1 amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZEM1, amplitudeZEM1, //! return ZEM1 amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -961,7 +958,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM1, amplitudeZEM1, //! return ZEM1 amplitu } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! return ZEM2 amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZEM2, amplitudeZEM2, //! return ZEM2 amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -972,7 +969,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZEM2, amplitudeZEM2, //! return ZEM2 amplitu } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! return ZNA amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZNA, amplitudeZNA, //! return ZNA amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -983,7 +980,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNA, amplitudeZNA, //! return ZNA amplitude } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! return ZNC amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZNC, amplitudeZNC, //! return ZNC amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -994,7 +991,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZNC, amplitudeZNC, //! return ZNC amplitude } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! return ZPA amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZPA, amplitudeZPA, //! return ZPA amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -1005,7 +1002,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPA, amplitudeZPA, //! return ZPA amplitude } return thisamplitude; }); -DECLARE_SOA_DYNAMIC_COLUMN(AmplitudeZPC, amplitudeZPC, //! return ZPC amplitude +DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZPC, amplitudeZPC, //! return ZPC amplitude [](gsl::span channelT, gsl::span amplitude) -> float { auto thisamplitude = -std::numeric_limits::infinity(); for (uint64_t ie = 0; ie < channelT.size(); ie++) { @@ -1024,19 +1021,20 @@ DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information zdc::EnergySectorZNA, zdc::EnergySectorZNC, zdc::EnergySectorZPA, zdc::EnergySectorZPC, zdc::TimeZEM1, zdc::TimeZEM2, zdc::TimeZNA, zdc::TimeZNC, zdc::TimeZPA, zdc::TimeZPC); +// new version of tables: different names for dynamic columns, but same getters DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1, //! ZDC information, version 1, std::vector format - o2::soa::Index<>, zdc::BCId, zdc_001::Energy, zdc_001::ChannelE, zdc_001::Amplitude, zdc_001::Time, zdc_001::ChannelT, - zdc_001::EnergyZEM1, zdc_001::EnergyZEM2, - zdc_001::EnergyCommonZNA, zdc_001::EnergyCommonZNC, - zdc_001::EnergyCommonZPA, zdc_001::EnergyCommonZPC, - zdc_001::EnergySectorZNA, zdc_001::EnergySectorZNC, - zdc_001::EnergySectorZPA, zdc_001::EnergySectorZPC, - zdc_001::TimeZEM1, zdc_001::TimeZEM2, - zdc_001::TimeZNA, zdc_001::TimeZNC, - zdc_001::TimeZPA, zdc_001::TimeZPC, - zdc_001::AmplitudeZEM1, zdc_001::AmplitudeZEM2, - zdc_001::AmplitudeZNA, zdc_001::AmplitudeZNC, - zdc_001::AmplitudeZPA, zdc_001::AmplitudeZPC); // + o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT, + zdc::DyEnergyZEM1, zdc::DyEnergyZEM2, + zdc::DyEnergyCommonZNA, zdc::DyEnergyCommonZNC, + zdc::DyEnergyCommonZPA, zdc::DyEnergyCommonZPC, + zdc::DyEnergySectorZNA, zdc::DyEnergySectorZNC, + zdc::DyEnergySectorZPA, zdc::DyEnergySectorZPC, + zdc::DyTimeZEM1, zdc::DyTimeZEM2, + zdc::DyTimeZNA, zdc::DyTimeZNC, + zdc::DyTimeZPA, zdc::DyTimeZPC, + zdc::DyAmplitudeZEM1, zdc::DyAmplitudeZEM2, + zdc::DyAmplitudeZNA, zdc::DyAmplitudeZNC, + zdc::DyAmplitudeZPA, zdc::DyAmplitudeZPC); // #ifdef O2_ZDC_NEWDATAMODEL using Zdcs = Zdcs_001; //! new version #else From faf3d32d204fe9eb6b9d639e949aba78bd4a8bc9 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Apr 2023 15:26:34 +0000 Subject: [PATCH 19/19] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 6abe23bf5d206..1aa4a6c81420f 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1013,7 +1013,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZPC, amplitudeZPC, //! return ZPC amplitud } return thisamplitude; }); -} // namespace zdc_001 +} // namespace zdc DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC", //! ZDC information o2::soa::Index<>, zdc::BCId, zdc::EnergyZEM1, zdc::EnergyZEM2,