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
38 float getVDrift() const { return refVDrift * corrFact; }
39 float getVDriftError() const { return refVDrift * corrFactErr; }
40
41 float getTimeOffset() const { return refTimeOffset + timeOffsetCorr; }
42
43 // renormalize VDrift reference and correction either to provided new reference (if >0) or to correction 1 wrt current reference
44 void normalize(float newVRef = 0.f)
45 {
46 if (newVRef == 0.f) {
47 newVRef = refVDrift * corrFact;
48 }
49 float fact = refVDrift / newVRef;
50 refVDrift = newVRef;
51 corrFactErr *= fact;
52 corrFact *= fact;
53 }
54
55 // similarly, the time offset reference is set to provided newRefTimeOffset (if > -998) or modified to have timeOffsetCorr to
56 // be 0 otherwise
57
58 void normalizeOffset(float newRefTimeOffset = -999.)
59 {
60 if (newRefTimeOffset > -999.) {
61 timeOffsetCorr = getTimeOffset() - newRefTimeOffset;
62 refTimeOffset = newRefTimeOffset;
63 } else {
65 timeOffsetCorr = 0.;
66 }
67 }
68
70};
71
72} // namespace o2::tpc
73#endif
Header to collect LHC related constants.
Global TPC definitions and constants.
Definition SimTraits.h:167
long creationTime
time of creation
ClassDefNV(VDriftCorrFact, 2)
void normalizeOffset(float newRefTimeOffset=-999.)
float corrFactErr
stat error of correction factor
void normalize(float newVRef=0.f)
float refTimeOffset
additive time offset reference (\mus)
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)
long firstTime
first time stamp of processed TFs
float getVDriftError() const