Project
Loading...
Searching...
No Matches
VDriftHelper.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 TPC_VDRIFT_HELPER_H_
17#define TPC_VDRIFT_HELPER_H_
18
19#include "GPUCommonRtypes.h"
22#include <array>
23#include <vector>
24#include <string_view>
25
26namespace o2::framework
27{
28class ProcessingContext;
30class InputSpec;
31} // namespace o2::framework
32
33namespace o2::ccdb
34{
35class BasicCCDBManager;
36} // namespace o2::ccdb
37
38namespace o2::tpc
39{
40class LtrCalibData;
41
43{
44 public:
45 enum Source : int { Param,
49 };
50 static constexpr std::array<std::string_view, NSources> SourceNames = {
51 "Param",
52 "Laser",
53 "TPCITSTgl"};
54
56 void accountLaserCalibration(const LtrCalibData* calib, long fallBackTimeStamp = 2);
58 bool isUpdated() const { return mUpdated; }
59 void acknowledgeUpdate() { mUpdated = false; }
60
61 const VDriftCorrFact& getVDriftObject() const { return mVD; }
62 Source getSource() const { return mSource; }
63 static std::string_view getSourceName(Source s) { return SourceNames[s]; }
64 std::string_view getSourceName() const { return SourceNames[mSource]; }
65 const auto& getPTHelper() const { return mPTHelper; }
66
67 bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher& matcher, void* obj);
68 void extractCCDBInputs(o2::framework::ProcessingContext& pc, bool laser = true, bool itstpcTgl = true);
69 static void requestCCDBInputs(std::vector<o2::framework::InputSpec>& inputs, bool laser = true, bool itstpcTgl = true);
70
73 void extractCCDBInputs(o2::ccdb::BasicCCDBManager& ccdb, long timestampMS, bool laser = false, bool itstpcTgl = true);
74
75 protected:
76 static void addInput(std::vector<o2::framework::InputSpec>& inputs, o2::framework::InputSpec&& isp);
77 bool extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS = 100 * 1000);
78
80 void updateVDrift(long currentTimeMS);
84 Source mSource{Source::Param}; // update source
85 bool mUpdated = false; // signal update, must be reset once new value is fetched
86 bool mIsTPScalingPossible = false; // if T/P scaling is possible always perform the updating
87 bool mForceParamDrift = false; // enforce vdrift from gasParam
88 bool mForceParamOffset = false; // enforce offset from DetectorParam
89 bool mForceTPScaling = false; // enforce T/P scaling from gasParam (scaling disabled by negative T or P)
90 uint32_t mMayRenormSrc = 0xffffffff; // if starting VDrift correction != 1, we will renorm reference in such a way that initial correction is 1.0, flag per source
91 PressureTemperatureHelper mPTHelper; // helper to extract pressure and temperature from CCDB
92
94};
95} // namespace o2::tpc
96#endif
uint64_t laser
Helper class to extract pressure and temperature.
calibration data from laser track calibration
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, bool laser=true, bool itstpcTgl=true)
bool extractTPForVDrift(VDriftCorrFact &vdrift, int64_t tsStepMS=100 *1000)
void updateVDrift(long currentTimeMS)
Combine the previously accounted laser/ITS-TPC-Tgl inputs, applying T/P scaling if possible,...
VDriftCorrFact mVDLaser
void extractCCDBInputs(o2::framework::ProcessingContext &pc, bool laser=true, bool itstpcTgl=true)
const auto & getPTHelper() const
const VDriftCorrFact & getVDriftObject() const
static void addInput(std::vector< o2::framework::InputSpec > &inputs, o2::framework::InputSpec &&isp)
std::string_view getSourceName() const
ClassDefNV(VDriftHelper, 2)
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
static std::string_view getSourceName(Source s)
static constexpr std::array< std::string_view, NSources > SourceNames
Source getSource() const
VDriftCorrFact mVD
void accountDriftCorrectionITSTPCTgl(const VDriftCorrFact *calib)
VDriftCorrFact mVDTPCITSTgl
PressureTemperatureHelper mPTHelper
bool isUpdated() const
void accountLaserCalibration(const LtrCalibData *calib, long fallBackTimeStamp=2)
information complementary to a CCDB object (path, metadata, startTimeValidity, endTimeValidity etc)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
Global TPC definitions and constants.
Definition SimTraits.h:172