Project
Loading...
Searching...
No Matches
RecoConfigZDC.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 RecoConfigZDC::setBit(uint32_t ibit, bool val)
18{
19 if (ibit >= 0 && ibit < NTDCChannels) {
20 bitset[ibit] = val;
21 } else {
22 LOG(fatal) << __func__ << " channel " << ibit << " not in allowed range";
23 }
24}
25
26void RecoConfigZDC::setSearch(uint32_t ich, int val)
27{
28 if (ich >= 0 && ich < NTDCChannels) {
29 tdc_search[ich] = val;
30 } else {
31 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
32 }
33}
34
35int RecoConfigZDC::getSearch(uint32_t ich) const
36{
37 if (ich >= 0 && ich < NTDCChannels) {
38 return tdc_search[ich];
39 } else {
40 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
41 return -1;
42 }
43}
44
45void RecoConfigZDC::setIntegration(uint32_t ich, int beg, int end, int beg_ped, int end_ped)
46{
47 int sig_l = 0;
48 int sig_h = NTimeBinsPerBC - 1;
49 int ped_l = -NTimeBinsPerBC;
50 int ped_h = NTimeBinsPerBC - 1;
51
52 if (ich >= 0 && ich < NChannels) {
53 if (beg < sig_l || beg > sig_h) {
54 LOG(fatal) << "Integration start = " << beg << " for signal " << ich << " (" << ChannelNames[ich] << ") not in allowed range [" << sig_l << "-" << sig_h << "]";
55 return;
56 }
57 if (end < sig_l || end > sig_h) {
58 LOG(fatal) << "Integration end = " << beg << " for signal " << ich << " (" << ChannelNames[ich] << ") not in allowed range [" << sig_l << "-" << sig_h << "]";
59 return;
60 }
61 if (end < beg) {
62 LOG(fatal) << "Inconsistent integration range for signal " << ich << " (" << ChannelNames[ich] << "): [" << beg << "-" << end << "]";
63 return;
64 }
65 if (beg_ped < ped_l || beg_ped > ped_h) {
66 LOG(fatal) << "Pedestal integration start = " << beg_ped << " for signal " << ich << " (" << ChannelNames[ich] << ") not in allowed range [" << ped_l << "-" << ped_h << "]";
67 return;
68 }
69 if (end_ped < ped_l || end_ped > ped_h) {
70 LOG(fatal) << "Pedestal integration end = " << end_ped << " for signal " << ich << " (" << ChannelNames[ich] << ") not in allowed range [" << ped_l << "-" << ped_h << "]";
71 return;
72 }
73 if (end_ped < beg_ped) {
74 LOG(fatal) << "Inconsistent integration range for pedestal " << ich << " (" << ChannelNames[ich] << "): [" << beg_ped << "-" << end_ped << "]";
75 return;
76 }
77 beg_int[ich] = beg;
78 end_int[ich] = end;
79 beg_ped_int[ich] = beg_ped;
80 end_ped_int[ich] = end_ped;
81 } else {
82 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
83 }
84}
85
86void RecoConfigZDC::setPedThreshold(int32_t ich, float high, float low)
87{
88 if (ich >= 0 && ich < NChannels) {
89 ped_thr_hi[ich] = high;
90 ped_thr_lo[ich] = low;
91 } else {
92 LOG(fatal) << __func__ << " channel " << ich << " not in allowed range";
93 }
94}
95
97{
98 LOGF(info, "RecoConfigZDC:%s%s%s%s%s%s%s",
99 (low_pass_filter ? " LowPassFilter" : ""),
100 (full_interpolation ? " FullInterpolation" : ""),
101 (extendedSearch ? " ExtendedSearch" : " NormalSearch"),
102 (corr_signal ? " CorrSignal" : ""),
103 (corr_background ? " CorrBackground" : ""),
104 (storeEvPileup ? " StoreEvPileup(EvE)" : " DontStoreEvPileup(EvE)"),
105 (triggerCondition == 0x1 ? " SINGLEtrigger" : (triggerCondition == 0x3 ? " DOUBLEtrigger" : (triggerCondition == 0x7 ? "TRIPLEtrigger" : "WRONGtrigger"))));
106 for (int itdc = 0; itdc < NTDCChannels; itdc++) {
107 LOG(info) << itdc << " " << ChannelNames[TDCSignal[itdc]] << " search= " << tdc_search[itdc] << " = " << tdc_search[itdc] * FTDCVal << " ns" << (bitset[itdc] ? " BITSET" : "");
108 }
109 for (Int_t ich = 0; ich < NChannels; ich++) {
110 LOG(info) << ChannelNames[ich] << " integration: signal=[" << beg_int[ich] << ":" << end_int[ich] << "] pedestal=[" << beg_ped_int[ich] << ":" << end_ped_int[ich]
111 << "] thresholds (" << ped_thr_hi[ich] << ", " << ped_thr_lo[ich] << ")";
112 }
113}
ZDC reconstruction parameters.
GLuint GLuint end
Definition glcorearb.h:469
GLuint GLfloat * val
Definition glcorearb.h:1582
const int TDCSignal[NTDCChannels]
Definition Constants.h:181
constexpr int NTimeBinsPerBC
Definition Constants.h:53
constexpr int NTDCChannels
Definition Constants.h:90
constexpr int NChannels
Definition Constants.h:65
constexpr std::string_view ChannelNames[]
Definition Constants.h:147
constexpr float FTDCVal
Definition Constants.h:103
void setIntegration(uint32_t ich, int beg, int end, int beg_ped, int end_ped)
int32_t beg_ped_int[NChannels]
int getSearch(uint32_t ich) const
float ped_thr_hi[NChannels]
int32_t beg_int[NChannels]
int32_t end_int[NChannels]
float ped_thr_lo[NChannels]
void setPedThreshold(int32_t ich, float high, float low)
void setSearch(uint32_t ich, int val)
int32_t end_ped_int[NChannels]
std::array< bool, NTDCChannels > bitset
void setBit(uint32_t ibit, bool val=true)
int tdc_search[NTDCChannels]
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"