forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVDriftHelper.h
More file actions
84 lines (73 loc) · 3.3 KB
/
VDriftHelper.h
File metadata and controls
84 lines (73 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// 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 VDriftHelper.h
/// \brief Helper class to extract VDrift from different sources
/// \author ruben.shahoian@cern.ch
#ifndef TPC_VDRIFT_HELPER_H_
#define TPC_VDRIFT_HELPER_H_
#include "GPUCommonRtypes.h"
#include "DataFormatsTPC/VDriftCorrFact.h"
#include "TPCCalibration/PressureTemperatureHelper.h"
#include <array>
#include <vector>
#include <string_view>
namespace o2::framework
{
class ProcessingContext;
class ConcreteDataMatcher;
class InputSpec;
} // namespace o2::framework
namespace o2::tpc
{
class LtrCalibData;
class VDriftHelper
{
public:
enum Source : int { Param,
Laser,
ITSTPCTgl,
NSources
};
static constexpr std::array<std::string_view, NSources> SourceNames = {
"Param",
"Laser",
"TPCITSTgl"};
VDriftHelper();
void accountLaserCalibration(const LtrCalibData* calib, long fallBackTimeStamp = 2);
void accountDriftCorrectionITSTPCTgl(const VDriftCorrFact* calib);
bool isUpdated() const { return mUpdated; }
void acknowledgeUpdate() { mUpdated = false; }
const VDriftCorrFact& getVDriftObject() const { return mVD; }
Source getSource() const { return mSource; }
static std::string_view getSourceName(Source s) { return SourceNames[s]; }
std::string_view getSourceName() const { return SourceNames[mSource]; }
const auto& getPTHelper() const { return mPTHelper; }
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher& matcher, void* obj);
void extractCCDBInputs(o2::framework::ProcessingContext& pc, bool laser = true, bool itstpcTgl = true);
static void requestCCDBInputs(std::vector<o2::framework::InputSpec>& inputs, bool laser = true, bool itstpcTgl = true);
protected:
static void addInput(std::vector<o2::framework::InputSpec>& inputs, o2::framework::InputSpec&& isp);
bool extractTPForVDrift(VDriftCorrFact& vdrift, int64_t tsStepMS = 100 * 1000);
VDriftCorrFact mVDLaser{};
VDriftCorrFact mVDTPCITSTgl{};
VDriftCorrFact mVD{};
Source mSource{Source::Param}; // update source
bool mUpdated = false; // signal update, must be reset once new value is fetched
bool mIsTPScalingPossible = false; // if T/P scaling is possible always perform the updating
bool mForceParamDrift = false; // enforce vdrift from gasParam
bool mForceParamOffset = false; // enforce offset from DetectorParam
bool mForceTPScaling = false; // enforce T/P scaling from gasParam (scaling disabled by negative T or P)
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
PressureTemperatureHelper mPTHelper; // helper to extract pressure and temperature from CCDB
ClassDefNV(VDriftHelper, 2);
};
} // namespace o2::tpc
#endif