Project
Loading...
Searching...
No Matches
ZDCTDCCorr.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
18{
19 LOG(info) << "o2::zdc::ZDCTDCCorr: NTDCChannels = " << NTDCChannels << " NBCAn = " << NBCAn << " NBucket = " << NBucket << " NFParA = " << NFParA << " NFParT = " << NFParT;
20 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
21 for (int32_t ibun = 0; ibun < NBCAn; ibun++) {
22 int nnan = 0;
23 for (int32_t ibukb = 0; ibukb < NBucket; ibukb++) {
24 for (int32_t ibuks = 0; ibuks < NBucket; ibuks++) {
25 for (int32_t ipar = 0; ipar < NFParA; ipar++) {
26 if (std::isnan(mAmpCorr[itdc][ibun][ibukb][ibuks][ipar])) {
27 nnan++;
28 }
29 }
30 }
31 }
32 if (nnan > 0) {
33 LOG(warning) << "o2::zdc::ZDCTDCCorr mAmpCorr: itdc = " << itdc << " bunch " << ibun << " unassigned = " << nnan;
34 }
35 }
36 }
37 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
38 for (int32_t ibun = 0; ibun < NBCAn; ibun++) {
39 int nnan = 0;
40 for (int32_t ibukb = 0; ibukb < NBucket; ibukb++) {
41 for (int32_t ibuks = 0; ibuks < NBucket; ibuks++) {
42 for (int32_t ipar = 0; ipar < NFParT; ipar++) {
43 if (std::isnan(mTDCCorr[itdc][ibun][ibukb][ibuks][ipar])) {
44 nnan++;
45 }
46 }
47 }
48 }
49 if (nnan > 0) {
50 LOG(warning) << "o2::zdc::ZDCTDCCorr mTDCCorr: itdc = " << itdc << " bunch " << ibun << " unassigned = " << nnan;
51 }
52 }
53 }
54}
55
56void ZDCTDCCorr::dump() const
57{
58 printf("std::array<double,NTDCChannels*NBCAn*NBucket*NBucket*NFParT+1> fit_ts_par={\n");
59 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
60 for (int32_t ibcan = 0; ibcan < NBCAn; ibcan++) {
61 // N.B. There is an ordering by signal in the flat file
62 for (int32_t ibuks = 0; ibuks < NBucket; ibuks++) {
63 for (int32_t ibukb = 0; ibukb < NBucket; ibukb++) {
64 for (int32_t ipar = 0; ipar < NFParA; ipar++) {
65 if (std::isnan(mTDCCorr[itdc][ibcan][ibukb][ibuks][ipar])) {
66 printf("std::numeric_limits<double>::quiet_NaN(),");
67 } else {
68 printf("%+e,", mTDCCorr[itdc][ibcan][ibukb][ibuks][ipar]);
69 }
70 }
71 printf(" // ts%d_bc%+d_bk%d_sn%d\n", itdc, -NBCAn + ibcan, ibukb, ibuks);
72 }
73 }
74 }
75 }
76 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
77 printf("};\n\n");
78
79 printf("std::array<double,NTDCChannels*NBCAn*NBucket*NBucket*NFParA+1> fit_as_par={\n");
80 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
81 for (int32_t ibcan = 0; ibcan < NBCAn; ibcan++) {
82 // N.B. There is an ordering by signal in the flat file
83 for (int32_t ibuks = 0; ibuks < NBucket; ibuks++) {
84 for (int32_t ibukb = 0; ibukb < NBucket; ibukb++) {
85 for (int32_t ipar = 0; ipar < NFParA; ipar++) {
86 if (std::isnan(mAmpCorr[itdc][ibcan][ibukb][ibuks][ipar])) {
87 printf("std::numeric_limits<double>::quiet_NaN(),");
88 } else {
89 printf("%+e,", mAmpCorr[itdc][ibcan][ibukb][ibuks][ipar]);
90 }
91 }
92 printf(" // as%d_bc%+d_bk%d_sn%d\n", itdc, -NBCAn + ibcan, ibukb, ibuks);
93 }
94 }
95 }
96 }
97 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
98 printf("};\n\n");
99
100 // Corrections for single signal
101 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParExtC*o2::zdc::NTDCChannels+1> ts_beg_c={\n");
102 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
103 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
104 if (std::isnan(mTSBegC[itdc][ipar])) {
105 printf("std::numeric_limits<double>::quiet_NaN(),");
106 } else {
107 printf("%+e,", mTSBegC[itdc][ipar]);
108 }
109 }
110 printf(" // ts_beg_c_%d\n", itdc);
111 }
112 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
113 printf("};\n\n");
114
115 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParMidC*o2::zdc::NTDCChannels+1> ts_mid_c={\n");
116 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
117 for (int32_t ipar = 0; ipar < NParMidC; ipar++) {
118 if (std::isnan(mTSMidC[itdc][ipar])) {
119 printf("std::numeric_limits<double>::quiet_NaN(),");
120 } else {
121 printf("%+e,", mTSMidC[itdc][ipar]);
122 }
123 }
124 printf(" // ts_mid_c_%d\n", itdc);
125 }
126 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
127 printf("};\n\n");
128
129 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParExtC*o2::zdc::NTDCChannels+1> ts_end_c={\n");
130 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
131 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
132 if (std::isnan(mTSEndC[itdc][ipar])) {
133 printf("std::numeric_limits<double>::quiet_NaN(),");
134 } else {
135 printf("%+e,", mTSEndC[itdc][ipar]);
136 }
137 }
138 printf(" // ts_end_c_%d\n", itdc);
139 }
140 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
141 printf("};\n\n");
142
143 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParExtC*o2::zdc::NTDCChannels+1> af_beg_c={\n");
144 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
145 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
146 if (std::isnan(mAFBegC[itdc][ipar])) {
147 printf("std::numeric_limits<double>::quiet_NaN(),");
148 } else {
149 printf("%+e,", mAFBegC[itdc][ipar]);
150 }
151 }
152 printf(" // af_beg_c_%d\n", itdc);
153 }
154 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
155 printf("};\n\n");
156
157 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParMidC*o2::zdc::NTDCChannels+1> af_mid_c={\n");
158 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
159 for (int32_t ipar = 0; ipar < NParMidC; ipar++) {
160 if (std::isnan(mAFMidC[itdc][ipar])) {
161 printf("std::numeric_limits<double>::quiet_NaN(),");
162 } else {
163 printf("%+e,", mAFMidC[itdc][ipar]);
164 }
165 }
166 printf(" // af_mid_c_%d\n", itdc);
167 }
168 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
169 printf("};\n\n");
170
171 printf("std::array<double,o2::zdc::ZDCTDCCorr::NParExtC*o2::zdc::NTDCChannels+1> af_end_c={\n");
172 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
173 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
174 if (std::isnan(mAFEndC[itdc][ipar])) {
175 printf("std::numeric_limits<double>::quiet_NaN(),");
176 } else {
177 printf("%+e,", mAFEndC[itdc][ipar]);
178 }
179 }
180 printf(" // af_end_c_%d\n", itdc);
181 }
182 printf("std::numeric_limits<double>::quiet_NaN() // End_of_array\n");
183 printf("};\n\n");
184}
185
187{
188 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
189 for (int32_t ibun = 0; ibun < NBCAn; ibun++) {
190 for (int32_t ibukb = 0; ibukb < NBucket; ibukb++) {
191 for (int32_t ibuks = 0; ibuks < NBucket; ibuks++) {
192 for (int32_t ipar = 0; ipar < NFParA; ipar++) {
193 mAmpCorr[itdc][ibun][ibukb][ibuks][ipar] = std::numeric_limits<double>::quiet_NaN();
194 }
195 for (int32_t ipar = 0; ipar < NFParT; ipar++) {
196 mTDCCorr[itdc][ibun][ibukb][ibuks][ipar] = std::numeric_limits<double>::quiet_NaN();
197 }
198 }
199 }
200 }
201 }
202 for (int32_t itdc = 0; itdc < NTDCChannels; itdc++) {
203 // TDC time correction, constant, beginning of sequence
204 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
205 mTSBegC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
206 }
207 // TDC time correction, constant, mid of sequence
208 for (int32_t ipar = 0; ipar < NParMidC; ipar++) {
209 mTSMidC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
210 }
211 // TDC time correction, constant, end of sequence
212 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
213 mTSEndC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
214 }
215 // TDC amplitude correction, constant, beginning of sequence
216 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
217 mAFBegC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
218 }
219 // TDC amplitude correction, constant, mid of sequence
220 for (int32_t ipar = 0; ipar < NParMidC; ipar++) {
221 mAFMidC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
222 }
223 // TDC amplitude correction, constant, end of sequence
224 for (int32_t ipar = 0; ipar < NParExtC; ipar++) {
225 mAFEndC[itdc][ipar] = std::numeric_limits<double>::quiet_NaN();
226 }
227 }
228}
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
ZDC TDC correction parameters.
constexpr int NBucket
Definition Constants.h:119
constexpr int NTDCChannels
Definition Constants.h:90
constexpr int NBCAn
Definition Constants.h:123
constexpr int NFParT
Definition Constants.h:122
constexpr int NFParA
Definition Constants.h:121
std::array< std::array< std::array< std::array< std::array< float, NFParA >, NBucket >, NBucket >, NBCAn >, NTDCChannels > mAmpCorr
Definition ZDCTDCCorr.h:33
std::array< std::array< float, NParExtC >, NTDCChannels > mTSBegC
Definition ZDCTDCCorr.h:35
static const int NParMidC
Definition ZDCTDCCorr.h:31
std::array< std::array< float, NParExtC >, NTDCChannels > mTSEndC
Definition ZDCTDCCorr.h:37
std::array< std::array< std::array< std::array< std::array< float, NFParT >, NBucket >, NBucket >, NBCAn >, NTDCChannels > mTDCCorr
Definition ZDCTDCCorr.h:32
std::array< std::array< float, NParMidC >, NTDCChannels > mAFMidC
Definition ZDCTDCCorr.h:39
void dump() const
void print() const
static const int NParExtC
Definition ZDCTDCCorr.h:29
std::array< std::array< float, NParExtC >, NTDCChannels > mAFEndC
Definition ZDCTDCCorr.h:40
std::array< std::array< float, NParMidC >, NTDCChannels > mTSMidC
Definition ZDCTDCCorr.h:36
std::array< std::array< float, NParExtC >, NTDCChannels > mAFBegC
Definition ZDCTDCCorr.h:38
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"