Skip to content

Commit 73bc03d

Browse files
matthias-kleinershahor02
authored andcommitted
TPC: changing uint64_t to unsigned long long for compatibility with Mac
1 parent 121ee3a commit 73bc03d

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

DataFormats/Detectors/TPC/include/DataFormatsTPC/DCS.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,13 @@ struct RobustPressure {
557557
Stats cavernAtmosPressure2S; ///< rolling statistics of cavernAtmosPressure2/surfaceAtmosPressure
558558
std::vector<uint8_t> isOk; ///< bit mask of valid sensors: cavernBit 0, cavern2Bit = 1, surfaceBit = 2
559559
std::vector<float> robustPressure; ///< combined robust pressure value that should be used
560-
std::vector<TimeStampType> time; ///< time stamps of all pressure values
560+
std::vector<ULong64_t> time; ///< time stamps of all pressure values
561561
TimeStampType timeInterval; ///< time interval used for rolling statistics
562562
TimeStampType timeIntervalRef; ///< reference time interval used for normalization of pressure sensors
563563
float maxDist{}; ///< maximum allowed time distance between sensors to be accepted for robust pressure calculation
564564
float maxDiff{0.2f}; ///< maximum allowed pressure difference between sensors to be accepted for robust pressure calculation
565565

566-
ClassDefNV(RobustPressure, 1);
566+
ClassDefNV(RobustPressure, 2);
567567
};
568568

569569
struct Pressure {

DataFormats/Detectors/TPC/src/DCS.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void Pressure::makeRobustPressure(TimeStampType timeInterval, TimeStampType time
357357
if (nIntervals == 0) {
358358
nIntervals = 1; // at least one interval
359359
}
360-
std::vector<TimeStampType> times;
360+
std::vector<ULong64_t> times;
361361
times.reserve(nIntervals);
362362
for (int i = 0; i < nIntervals; ++i) {
363363
times.emplace_back(tStart + (i + 0.5) * timeInterval);

Detectors/TPC/calibration/include/TPCCalibration/PressureTemperatureHelper.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PressureTemperatureHelper
4949
static void setOutputs(std::vector<o2::framework::OutputSpec>& outputs);
5050

5151
/// send temperature and pressure for given time stamp
52-
void sendPTForTS(o2::framework::ProcessingContext& pc, const uint64_t timestamp) const;
52+
void sendPTForTS(o2::framework::ProcessingContext& pc, const ULong64_t timestamp) const;
5353

5454
/// set fit interval range for temperature in ms
5555
void setFitIntervalTemp(const int fitIntervalMS) { mFitIntervalMS = fitIntervalMS; }
@@ -58,13 +58,13 @@ class PressureTemperatureHelper
5858
/// \param timestamps time stamps of the data
5959
/// \param values data points
6060
/// \param timestamp time where to interpolate the values
61-
float interpolate(const std::vector<uint64_t>& timestamps, const std::vector<float>& values, uint64_t timestamp) const;
61+
float interpolate(const std::vector<ULong64_t>& timestamps, const std::vector<float>& values, ULong64_t timestamp) const;
6262

6363
/// get pressure for given time stamp in ms
64-
float getPressure(const uint64_t timestamp) const { return interpolate(mPressure.second, mPressure.first, timestamp); }
64+
float getPressure(const ULong64_t timestamp) const { return interpolate(mPressure.second, mPressure.first, timestamp); }
6565

6666
/// get temperature for given time stamp in ms
67-
dataformats::Pair<float, float> getTemperature(const uint64_t timestamp) const { return dataformats::Pair<float, float>{interpolate(mTemperatureA.second, mTemperatureA.first, timestamp), interpolate(mTemperatureC.second, mTemperatureC.first, timestamp)}; }
67+
dataformats::Pair<float, float> getTemperature(const ULong64_t timestamp) const { return dataformats::Pair<float, float>{interpolate(mTemperatureA.second, mTemperatureA.first, timestamp), interpolate(mTemperatureC.second, mTemperatureC.first, timestamp)}; }
6868

6969
static constexpr o2::header::DataDescription getDataDescriptionPressure() { return o2::header::DataDescription{"pressure"}; }
7070
static constexpr o2::header::DataDescription getDataDescriptionTemperature() { return o2::header::DataDescription{"temperature"}; }
@@ -73,10 +73,10 @@ class PressureTemperatureHelper
7373
static void addInput(std::vector<o2::framework::InputSpec>& inputs, o2::framework::InputSpec&& isp);
7474
static void addOutput(std::vector<o2::framework::OutputSpec>& outputs, o2::framework::OutputSpec&& osp);
7575

76-
std::pair<std::vector<float>, std::vector<uint64_t>> mPressure; ///< pressure values for both measurements
77-
std::pair<std::vector<float>, std::vector<uint64_t>> mTemperatureA; ///< temperature values A-side
78-
std::pair<std::vector<float>, std::vector<uint64_t>> mTemperatureC; ///< temperature values C-side
79-
int mFitIntervalMS{5 * 60 * 1000}; ///< fit interval for the temperature
76+
std::pair<std::vector<float>, std::vector<ULong64_t>> mPressure; ///< pressure values for both measurements
77+
std::pair<std::vector<float>, std::vector<ULong64_t>> mTemperatureA; ///< temperature values A-side
78+
std::pair<std::vector<float>, std::vector<ULong64_t>> mTemperatureC; ///< temperature values C-side
79+
int mFitIntervalMS{5 * 60 * 1000}; ///< fit interval for the temperature
8080

8181
ClassDefNV(PressureTemperatureHelper, 1);
8282
};

Detectors/TPC/calibration/src/PressureTemperatureHelper.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ void PressureTemperatureHelper::addOutput(std::vector<OutputSpec>& outputs, Outp
9191
}
9292
}
9393

94-
float PressureTemperatureHelper::interpolate(const std::vector<uint64_t>& timestamps, const std::vector<float>& values, uint64_t timestamp) const
94+
float PressureTemperatureHelper::interpolate(const std::vector<ULong64_t>& timestamps, const std::vector<float>& values, ULong64_t timestamp) const
9595
{
9696
if (auto idxClosest = o2::math_utils::findClosestIndices(timestamps, timestamp)) {
9797
auto [idxLeft, idxRight] = *idxClosest;
9898
if (idxRight > idxLeft) {
99-
const uint64_t x0 = timestamps[idxLeft];
100-
const uint64_t x1 = timestamps[idxRight];
99+
const auto x0 = timestamps[idxLeft];
100+
const auto x1 = timestamps[idxRight];
101101
const float y0 = values[idxLeft];
102102
const float y1 = values[idxRight];
103103
const float y = (y0 * (x1 - timestamp) + y1 * (timestamp - x0)) / (x1 - x0);
@@ -109,7 +109,7 @@ float PressureTemperatureHelper::interpolate(const std::vector<uint64_t>& timest
109109
return 0; // this should never happen
110110
}
111111

112-
void PressureTemperatureHelper::sendPTForTS(o2::framework::ProcessingContext& pc, const uint64_t timestamp) const
112+
void PressureTemperatureHelper::sendPTForTS(o2::framework::ProcessingContext& pc, const ULong64_t timestamp) const
113113
{
114114
const float pressure = getPressure(timestamp);
115115
const auto temp = getTemperature(timestamp);

Detectors/TPC/workflow/src/TPCPressureTemperatureSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PressureTemperatureDevice : public o2::framework::Task
5757
mPTHelper.extractCCDBInputs(pc);
5858
const auto orbitResetTimeMS = o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS();
5959
const auto firstTFOrbit = pc.services().get<o2::framework::TimingInfo>().firstTForbit;
60-
const uint64_t timestamp = orbitResetTimeMS + firstTFOrbit * o2::constants::lhc::LHCOrbitMUS * 0.001;
60+
const ULong64_t timestamp = orbitResetTimeMS + firstTFOrbit * o2::constants::lhc::LHCOrbitMUS * 0.001;
6161
mPTHelper.sendPTForTS(pc, timestamp);
6262

6363
if (mStreamer) {

0 commit comments

Comments
 (0)