From e095e782b570d1d42ecb9b2269c23a8c206d1e38 Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Thu, 12 Jun 2025 14:51:40 +0200 Subject: [PATCH] TPC: changing uint64_t to unsigned long long for compatibility with Mac --- .../Detectors/TPC/include/DataFormatsTPC/DCS.h | 4 ++-- DataFormats/Detectors/TPC/src/DCS.cxx | 2 +- .../TPCCalibration/PressureTemperatureHelper.h | 16 ++++++++-------- .../src/PressureTemperatureHelper.cxx | 8 ++++---- .../workflow/src/TPCPressureTemperatureSpec.cxx | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DataFormats/Detectors/TPC/include/DataFormatsTPC/DCS.h b/DataFormats/Detectors/TPC/include/DataFormatsTPC/DCS.h index 3608fdc390203..d40b07c48e314 100644 --- a/DataFormats/Detectors/TPC/include/DataFormatsTPC/DCS.h +++ b/DataFormats/Detectors/TPC/include/DataFormatsTPC/DCS.h @@ -557,13 +557,13 @@ struct RobustPressure { Stats cavernAtmosPressure2S; ///< rolling statistics of cavernAtmosPressure2/surfaceAtmosPressure std::vector isOk; ///< bit mask of valid sensors: cavernBit 0, cavern2Bit = 1, surfaceBit = 2 std::vector robustPressure; ///< combined robust pressure value that should be used - std::vector time; ///< time stamps of all pressure values + std::vector time; ///< time stamps of all pressure values TimeStampType timeInterval; ///< time interval used for rolling statistics TimeStampType timeIntervalRef; ///< reference time interval used for normalization of pressure sensors float maxDist{}; ///< maximum allowed time distance between sensors to be accepted for robust pressure calculation float maxDiff{0.2f}; ///< maximum allowed pressure difference between sensors to be accepted for robust pressure calculation - ClassDefNV(RobustPressure, 1); + ClassDefNV(RobustPressure, 2); }; struct Pressure { diff --git a/DataFormats/Detectors/TPC/src/DCS.cxx b/DataFormats/Detectors/TPC/src/DCS.cxx index 3c2524b6ed0fe..14c3887f8e8ae 100644 --- a/DataFormats/Detectors/TPC/src/DCS.cxx +++ b/DataFormats/Detectors/TPC/src/DCS.cxx @@ -357,7 +357,7 @@ void Pressure::makeRobustPressure(TimeStampType timeInterval, TimeStampType time if (nIntervals == 0) { nIntervals = 1; // at least one interval } - std::vector times; + std::vector times; times.reserve(nIntervals); for (int i = 0; i < nIntervals; ++i) { times.emplace_back(tStart + (i + 0.5) * timeInterval); diff --git a/Detectors/TPC/calibration/include/TPCCalibration/PressureTemperatureHelper.h b/Detectors/TPC/calibration/include/TPCCalibration/PressureTemperatureHelper.h index b636fdd2f296d..671c2efb78a8f 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/PressureTemperatureHelper.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/PressureTemperatureHelper.h @@ -49,7 +49,7 @@ class PressureTemperatureHelper static void setOutputs(std::vector& outputs); /// send temperature and pressure for given time stamp - void sendPTForTS(o2::framework::ProcessingContext& pc, const uint64_t timestamp) const; + void sendPTForTS(o2::framework::ProcessingContext& pc, const ULong64_t timestamp) const; /// set fit interval range for temperature in ms void setFitIntervalTemp(const int fitIntervalMS) { mFitIntervalMS = fitIntervalMS; } @@ -58,13 +58,13 @@ class PressureTemperatureHelper /// \param timestamps time stamps of the data /// \param values data points /// \param timestamp time where to interpolate the values - float interpolate(const std::vector& timestamps, const std::vector& values, uint64_t timestamp) const; + float interpolate(const std::vector& timestamps, const std::vector& values, ULong64_t timestamp) const; /// get pressure for given time stamp in ms - float getPressure(const uint64_t timestamp) const { return interpolate(mPressure.second, mPressure.first, timestamp); } + float getPressure(const ULong64_t timestamp) const { return interpolate(mPressure.second, mPressure.first, timestamp); } /// get temperature for given time stamp in ms - dataformats::Pair getTemperature(const uint64_t timestamp) const { return dataformats::Pair{interpolate(mTemperatureA.second, mTemperatureA.first, timestamp), interpolate(mTemperatureC.second, mTemperatureC.first, timestamp)}; } + dataformats::Pair getTemperature(const ULong64_t timestamp) const { return dataformats::Pair{interpolate(mTemperatureA.second, mTemperatureA.first, timestamp), interpolate(mTemperatureC.second, mTemperatureC.first, timestamp)}; } static constexpr o2::header::DataDescription getDataDescriptionPressure() { return o2::header::DataDescription{"pressure"}; } static constexpr o2::header::DataDescription getDataDescriptionTemperature() { return o2::header::DataDescription{"temperature"}; } @@ -73,10 +73,10 @@ class PressureTemperatureHelper static void addInput(std::vector& inputs, o2::framework::InputSpec&& isp); static void addOutput(std::vector& outputs, o2::framework::OutputSpec&& osp); - std::pair, std::vector> mPressure; ///< pressure values for both measurements - std::pair, std::vector> mTemperatureA; ///< temperature values A-side - std::pair, std::vector> mTemperatureC; ///< temperature values C-side - int mFitIntervalMS{5 * 60 * 1000}; ///< fit interval for the temperature + std::pair, std::vector> mPressure; ///< pressure values for both measurements + std::pair, std::vector> mTemperatureA; ///< temperature values A-side + std::pair, std::vector> mTemperatureC; ///< temperature values C-side + int mFitIntervalMS{5 * 60 * 1000}; ///< fit interval for the temperature ClassDefNV(PressureTemperatureHelper, 1); }; diff --git a/Detectors/TPC/calibration/src/PressureTemperatureHelper.cxx b/Detectors/TPC/calibration/src/PressureTemperatureHelper.cxx index 54145f0ecfaf1..d9a55e4aed2b9 100644 --- a/Detectors/TPC/calibration/src/PressureTemperatureHelper.cxx +++ b/Detectors/TPC/calibration/src/PressureTemperatureHelper.cxx @@ -91,13 +91,13 @@ void PressureTemperatureHelper::addOutput(std::vector& outputs, Outp } } -float PressureTemperatureHelper::interpolate(const std::vector& timestamps, const std::vector& values, uint64_t timestamp) const +float PressureTemperatureHelper::interpolate(const std::vector& timestamps, const std::vector& values, ULong64_t timestamp) const { if (auto idxClosest = o2::math_utils::findClosestIndices(timestamps, timestamp)) { auto [idxLeft, idxRight] = *idxClosest; if (idxRight > idxLeft) { - const uint64_t x0 = timestamps[idxLeft]; - const uint64_t x1 = timestamps[idxRight]; + const auto x0 = timestamps[idxLeft]; + const auto x1 = timestamps[idxRight]; const float y0 = values[idxLeft]; const float y1 = values[idxRight]; const float y = (y0 * (x1 - timestamp) + y1 * (timestamp - x0)) / (x1 - x0); @@ -109,7 +109,7 @@ float PressureTemperatureHelper::interpolate(const std::vector& timest return 0; // this should never happen } -void PressureTemperatureHelper::sendPTForTS(o2::framework::ProcessingContext& pc, const uint64_t timestamp) const +void PressureTemperatureHelper::sendPTForTS(o2::framework::ProcessingContext& pc, const ULong64_t timestamp) const { const float pressure = getPressure(timestamp); const auto temp = getTemperature(timestamp); diff --git a/Detectors/TPC/workflow/src/TPCPressureTemperatureSpec.cxx b/Detectors/TPC/workflow/src/TPCPressureTemperatureSpec.cxx index e03a0ffe4308b..4cb25471b55f8 100644 --- a/Detectors/TPC/workflow/src/TPCPressureTemperatureSpec.cxx +++ b/Detectors/TPC/workflow/src/TPCPressureTemperatureSpec.cxx @@ -57,7 +57,7 @@ class PressureTemperatureDevice : public o2::framework::Task mPTHelper.extractCCDBInputs(pc); const auto orbitResetTimeMS = o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS(); const auto firstTFOrbit = pc.services().get().firstTForbit; - const uint64_t timestamp = orbitResetTimeMS + firstTFOrbit * o2::constants::lhc::LHCOrbitMUS * 0.001; + const ULong64_t timestamp = orbitResetTimeMS + firstTFOrbit * o2::constants::lhc::LHCOrbitMUS * 0.001; mPTHelper.sendPTForTS(pc, timestamp); if (mStreamer) {