Project
Loading...
Searching...
No Matches
PressureTemperatureHelper.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef PRESSURETEMPERATUREHELPER_H_
17#define PRESSURETEMPERATUREHELPER_H_
18
19#include "GPUCommonRtypes.h"
20#include "Headers/DataHeader.h"
22
23namespace o2::framework
24{
25class ProcessingContext;
27class InputSpec;
28class OutputSpec;
29} // namespace o2::framework
30
31namespace o2::tpc
32{
33
35{
36 public:
38
40 bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher& matcher, void* obj);
41
44
45 // add required inputs
46 static void requestCCDBInputs(std::vector<o2::framework::InputSpec>& inputs);
47
49 static void setOutputs(std::vector<o2::framework::OutputSpec>& outputs);
50
52 void sendPTForTS(o2::framework::ProcessingContext& pc, const uint64_t timestamp) const;
53
55 void setFitIntervalTemp(const int fitIntervalMS) { mFitIntervalMS = fitIntervalMS; }
56
61 float interpolate(const std::vector<uint64_t>& timestamps, const std::vector<float>& values, uint64_t timestamp) const;
62
64 float getPressure(const uint64_t timestamp) const { return interpolate(mPressure.second, mPressure.first, timestamp); }
65
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)}; }
68
71
72 protected:
73 static void addInput(std::vector<o2::framework::InputSpec>& inputs, o2::framework::InputSpec&& isp);
74 static void addOutput(std::vector<o2::framework::OutputSpec>& outputs, o2::framework::OutputSpec&& osp);
75
76 std::pair<std::vector<float>, std::vector<uint64_t>> mPressure;
77 std::pair<std::vector<float>, std::vector<uint64_t>> mTemperatureA;
78 std::pair<std::vector<float>, std::vector<uint64_t>> mTemperatureC;
79 int mFitIntervalMS{5 * 60 * 1000};
80
82};
83} // namespace o2::tpc
84#endif
dataformats::Pair< float, float > getTemperature(const uint64_t timestamp) const
get temperature for given time stamp in ms
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs)
float interpolate(const std::vector< uint64_t > &timestamps, const std::vector< float > &values, uint64_t timestamp) const
interpolate input values for given timestamp
void extractCCDBInputs(o2::framework::ProcessingContext &pc) const
trigger checking for CCDB objects
static constexpr o2::header::DataDescription getDataDescriptionTemperature()
std::pair< std::vector< float >, std::vector< uint64_t > > mTemperatureC
temperature values C-side
static void addOutput(std::vector< o2::framework::OutputSpec > &outputs, o2::framework::OutputSpec &&osp)
int mFitIntervalMS
fit interval for the temperature
std::pair< std::vector< float >, std::vector< uint64_t > > mTemperatureA
temperature values A-side
void sendPTForTS(o2::framework::ProcessingContext &pc, const uint64_t timestamp) const
send temperature and pressure for given time stamp
std::pair< std::vector< float >, std::vector< uint64_t > > mPressure
pressure values for both measurements
void setFitIntervalTemp(const int fitIntervalMS)
set fit interval range for temperature in ms
float getPressure(const uint64_t timestamp) const
get pressure for given time stamp in ms
static constexpr o2::header::DataDescription getDataDescriptionPressure()
static void addInput(std::vector< o2::framework::InputSpec > &inputs, o2::framework::InputSpec &&isp)
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
check for new CCDB objects
static void setOutputs(std::vector< o2::framework::OutputSpec > &outputs)
define outputs in case pressure and temperature will be send
ClassDefNV(PressureTemperatureHelper, 1)
GLenum GLsizei GLsizei GLint * values
Definition glcorearb.h:1576
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
Global TPC definitions and constants.
Definition SimTraits.h:167