Project
Loading...
Searching...
No Matches
VDriftCorrFact.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
18
19#ifndef AliceO2_TPC_VDRIFT_CORRFACT_H
20#define AliceO2_TPC_VDRIFT_CORRFACT_H
21
22#include "GPUCommonRtypes.h"
24
25namespace o2::tpc
26{
27
29 long firstTime{};
30 long lastTime{};
31 long creationTime{};
32 float corrFact{1.0};
33 float corrFactErr{0.0};
34 float refVDrift{0.};
35 float refTimeOffset{0.};
36 float timeOffsetCorr{0.};
37 float refTP{0.};
38
39 float getVDrift() const { return refVDrift * corrFact; }
40 float getVDriftError() const { return refVDrift * corrFactErr; }
41
42 float getTimeOffset() const { return refTimeOffset + timeOffsetCorr; }
43
44 // renormalize VDrift reference and correction either to provided new reference (if >0) or to correction 1 wrt current reference
45 void normalize(float newVRef = 0.f, float tp = 0.f)
46 {
47 float normVDrift = newVRef;
48 if (newVRef == 0.f) {
49 normVDrift = refVDrift * corrFact;
50 newVRef = normVDrift;
51 if ((tp > 0) && (refTP > 0)) {
52 // linear scaling based on relative change of T/P
53 normVDrift *= refTP / tp;
54 refTP = tp; // update reference T/P
55 }
56 }
57 float fact = refVDrift / normVDrift;
58 refVDrift = newVRef;
59 corrFactErr *= fact;
60 corrFact *= fact;
61 }
62
63 // similarly, the time offset reference is set to provided newRefTimeOffset (if > -998) or modified to have timeOffsetCorr to
64 // be 0 otherwise
65
66 void normalizeOffset(float newRefTimeOffset = -999.)
67 {
68 if (newRefTimeOffset > -999.) {
69 timeOffsetCorr = getTimeOffset() - newRefTimeOffset;
70 refTimeOffset = newRefTimeOffset;
71 } else {
73 timeOffsetCorr = 0.;
74 }
75 }
76
78};
79
80} // namespace o2::tpc
81#endif
Header to collect LHC related constants.
Global TPC definitions and constants.
Definition SimTraits.h:167
long creationTime
time of creation
void normalizeOffset(float newRefTimeOffset=-999.)
float corrFactErr
stat error of correction factor
float refTimeOffset
additive time offset reference (\mus)
void normalize(float newVRef=0.f, float tp=0.f)
long lastTime
last time stamp of processed TFs
float refVDrift
reference vdrift for which factor was extracted
float getTimeOffset() const
float timeOffsetCorr
additive time offset correction (\mus)
float corrFact
drift velocity correction factor (multiplicative)
float refTP
reference temperature / pressure for which refVDrift was extracted
long firstTime
first time stamp of processed TFs
float getVDriftError() const
ClassDefNV(VDriftCorrFact, 3)