Project
Loading...
Searching...
No Matches
ZDCTDCParam.cxx
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
12#include "Framework/Logger.h"
14
15using namespace o2::zdc;
16
17void ZDCTDCParam::setShift(uint32_t ich, float val)
18{
19 if (ich >= 0 && ich < NTDCChannels) {
20 tdc_shift[ich] = val;
21 } else {
22 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
23 }
24}
25
26float ZDCTDCParam::getShift(uint32_t ich) const
27{
28 if (ich >= 0 && ich < NTDCChannels) {
29 return tdc_shift[ich];
30 } else {
31 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
32 return 0;
33 }
34}
35
36void ZDCTDCParam::setFactor(uint32_t ich, float val)
37{
38 if (ich >= 0 && ich < NTDCChannels) {
39 tdc_calib[ich] = val;
40 } else {
41 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
42 }
43}
44
45float ZDCTDCParam::getFactor(uint32_t ich) const
46{
47 if (ich >= 0 && ich < NTDCChannels) {
48 return tdc_calib[ich];
49 } else {
50 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
51 return 0;
52 }
53}
54
55void ZDCTDCParam::setOffset(uint32_t ich, float val)
56{
57 if (ich >= 0 && ich < NTDCChannels) {
58 tdc_offset[ich] = val;
59 } else {
60 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
61 }
62}
63
64float ZDCTDCParam::getOffset(uint32_t ich) const
65{
66 if (ich >= 0 && ich < NTDCChannels) {
67 return tdc_offset[ich];
68 } else {
69 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
70 return 0;
71 }
72}
73
75{
76 for (int itdc = 0; itdc < o2::zdc::NTDCChannels; itdc++) {
77 LOG(info) << ChannelNames[TDCSignal[itdc]] << " shift = " << tdc_shift[itdc] << " ns factor = " << tdc_calib[itdc] << " offset = " << tdc_offset[itdc];
78 }
79}
Parameters to correct TDCs (produced by QA)
GLuint GLfloat * val
Definition glcorearb.h:1582
const int TDCSignal[NTDCChannels]
Definition Constants.h:181
constexpr int NTDCChannels
Definition Constants.h:90
constexpr std::string_view ChannelNames[]
Definition Constants.h:147
float getOffset(uint32_t ich) const
float tdc_calib[NTDCChannels]
Definition ZDCTDCParam.h:29
void setFactor(uint32_t ich, float val)
float tdc_shift[NTDCChannels]
Definition ZDCTDCParam.h:28
void setOffset(uint32_t ich, float val)
void setShift(uint32_t ich, float val)
float tdc_offset[NTDCChannels]
Definition ZDCTDCParam.h:30
float getFactor(uint32_t ich) const
float getShift(uint32_t ich) const
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"