54 std::vector<DPID> vect;
55 mGasDPsUpdateInterval = ic.options().get<int64_t>(
"DPs-update-interval-gas");
56 if (mGasDPsUpdateInterval == 0) {
57 LOG(
error) <<
"TRD DPs update interval set to zero seconds --> changed to 900s";
58 mGasDPsUpdateInterval = 900;
60 mCurrentsDPsUpdateInterval = ic.options().get<int64_t>(
"DPs-update-interval-currents");
61 if (mCurrentsDPsUpdateInterval == 0) {
62 LOG(
error) <<
"TRD DPs update interval set to zero seconds --> changed to 120s";
63 mCurrentsDPsUpdateInterval = 120;
65 mVoltagesDPsUpdateInterval = ic.options().get<int64_t>(
"DPs-update-interval-voltages");
66 if (mVoltagesDPsUpdateInterval == 0) {
67 LOG(
error) <<
"TRD DPs update interval set to zero seconds --> changed to 600s";
68 mVoltagesDPsUpdateInterval = 600;
70 mMinUpdateIntervalU = ic.options().get<int64_t>(
"DPs-min-update-interval-voltages");
72 mEnvDPsUpdateInterval = ic.options().get<int64_t>(
"DPs-update-interval-env");
73 if (mEnvDPsUpdateInterval == 0) {
74 LOG(
error) <<
"TRD DPs update interval set to zero seconds --> changed to 1800s";
75 mEnvDPsUpdateInterval = 1800;
77 bool useCCDBtoConfigure = ic.options().get<
bool>(
"use-ccdb-to-configure");
78 if (useCCDBtoConfigure) {
79 LOG(info) <<
"Configuring via CCDB";
80 std::string ccdbpath = ic.options().get<std::string>(
"ccdb-path");
83 long ts = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
84 std::unordered_map<DPID, std::string>* dpid2DataDesc = mgr.getForTimeStamp<std::unordered_map<DPID, std::string>>(
"TRD/Config/DCSDPconfig", ts);
85 for (
auto&
i : *dpid2DataDesc) {
86 vect.push_back(
i.first);
89 LOG(info) <<
"Configuring via hardcoded strings";
90 std::vector<std::string> aliasesFloat;
91 std::vector<std::string> aliasesInt;
92 std::vector<std::string> aliasesString;
93 aliasesFloat.insert(aliasesFloat.end(), {
"trd_gasCO2",
"trd_gasH2O",
"trd_gasO2"});
94 aliasesFloat.insert(aliasesFloat.end(), {
"trd_gaschromatographCO2",
"trd_gaschromatographN2",
"trd_gaschromatographXe"});
95 aliasesFloat.insert(aliasesFloat.end(), {
"trd_hvAnodeImon[00..539]",
"trd_hvAnodeUmon[00..539]",
"trd_hvDriftImon[00..539]",
"trd_hvDriftUmon[00..539]"});
96 aliasesFloat.insert(aliasesFloat.end(), {
"CavernTemperature",
"temperature_P2_external"});
97 aliasesFloat.insert(aliasesFloat.end(), {
"CavernAtmosPressure",
"SurfaceAtmosPressure",
"CavernAtmosPressure2"});
98 aliasesFloat.insert(aliasesFloat.end(), {
"UXC2Humidity"});
99 aliasesInt.insert(aliasesInt.end(), {
"trd_fed_runNo"});
100 aliasesInt.insert(aliasesInt.end(), {
"trd_chamberStatus[00..539]"});
101 aliasesString.insert(aliasesString.end(), {
"trd_CFGtag[00..539]"});
114 LOG(info) <<
"Listing Data Points for TRD:";
115 for (
auto&
i : vect) {
119 mProcessor = std::make_unique<o2::trd::DCSProcessor>();
120 int verbosity = ic.options().get<
int>(
"processor-verbosity");
122 LOG(info) <<
"Using verbose mode for TRD DCS processor";
127 int alarmfed = ic.options().get<
int>(
"DPs-max-counter-alarm-fed");
129 LOG(info) <<
"Setting max number of alarms in FED objects changes to " << alarmfed;
130 mProcessor->setMaxCounterAlarmFed(alarmfed);
132 LOG(info) <<
"Invalid max number of alarms in FED objects changes " << alarmfed <<
", using default value of 1";
136 int minupdatefed = ic.options().get<
int>(
"DPs-min-counter-update-fed");
137 if (minupdatefed >= 0 && minupdatefed <= 540) {
138 LOG(info) <<
"Setting min number of DPs to update ChamberStatus/CFGtag to " << minupdatefed;
139 mProcessor->setFedMinimunDPsForUpdate(minupdatefed);
141 LOG(info) <<
"Invalid min number of DPs to update ChamberStatus/CFGtag " << alarmfed <<
", using default value of 522";
145 int utrigger = ic.options().get<
int>(
"DPs-voltage-variation-trigger");
147 LOG(info) <<
"Setting voltage variation trigger of DPs to update Anode/DriftUMon to " << utrigger;
148 mProcessor->setUVariationTriggerForUpdate(utrigger);
150 LOG(info) <<
"Invalid voltage variation trigger of DPs to update Anode/DriftUMon to " << utrigger <<
", using default value of 1 V";
153 mUploadAtEoS = ic.options().get<
bool>(
"enable-uploadAtEoS");
154 LOG(info) <<
"Setting upload of CCDB objects at end of stream to " << mUploadAtEoS;
156 mProcessor->init(vect);
157 mTimerGas = std::chrono::high_resolution_clock::now();
158 mTimerVoltages = mTimerGas;
159 mTimerCurrents = mTimerGas;
160 mTimerEnv = mTimerGas;
161 mTimerFedChamberStatus = mTimerGas;
162 mTimerFedCFGtag = mTimerGas;
164 mReportTiming = ic.options().get<
bool>(
"report-timing") ||
verbosity > 0;
171 auto dps = pc.inputs().get<gsl::span<DPCOM>>(
"input");
172 auto timeNow = std::chrono::high_resolution_clock::now();
173 if (currentTimeStamp < 1577833200000UL || currentTimeStamp > 2208985200000UL) {
174 LOG(warning) <<
"The creation time of this TF is set to " << currentTimeStamp <<
". Overwriting this with current time";
176 currentTimeStamp = std::chrono::duration_cast<std::chrono::milliseconds>(timeNow.time_since_epoch()).count();
178 mProcessor->setCurrentTS(currentTimeStamp);
179 mProcessor->process(dps);
181 auto elapsedTimeGas = timeNow - mTimerGas;
182 if (elapsedTimeGas.count() * 1
e-9 >= mGasDPsUpdateInterval) {
183 sendDPsoutputGas(pc.outputs());
187 auto elapsedTimeVoltages = timeNow - mTimerVoltages;
188 if ((elapsedTimeVoltages.count() * 1
e-9 >= mVoltagesDPsUpdateInterval) ||
189 (mProcessor->shouldUpdateVoltages() && (elapsedTimeVoltages.count() * 1
e-9 >= mMinUpdateIntervalU))) {
190 sendDPsoutputVoltages(pc.outputs());
191 mTimerVoltages = timeNow;
194 auto elapsedTimeCurrents = timeNow - mTimerCurrents;
195 if (elapsedTimeCurrents.count() * 1
e-9 >= mCurrentsDPsUpdateInterval) {
196 sendDPsoutputCurrents(pc.outputs());
197 mTimerCurrents = timeNow;
200 auto elapsedTimeEnv = timeNow - mTimerEnv;
201 if (elapsedTimeEnv.count() * 1
e-9 >= mEnvDPsUpdateInterval) {
202 sendDPsoutputEnv(pc.outputs());
206 if (mProcessor->shouldUpdateFedChamberStatus()) {
207 sendDPsoutputFedChamberStatus(pc.outputs());
210 if (mProcessor->shouldUpdateFedCFGtag()) {
211 sendDPsoutputFedCFGtag(pc.outputs());
225 LOG(info) <<
"End of stream upload of CCDB objects";
226 sendDPsoutputGas(ec.outputs());
227 sendDPsoutputVoltages(ec.outputs());
228 sendDPsoutputCurrents(ec.outputs());
229 sendDPsoutputEnv(ec.outputs());
231 LOG(info) <<
"No CCDB object upload done at the end of stream";
236 bool mUploadAtEoS =
false;
237 bool mReportTiming =
false;
238 std::unique_ptr<DCSProcessor> mProcessor;
239 std::chrono::high_resolution_clock::time_point mTimerGas;
240 std::chrono::high_resolution_clock::time_point mTimerVoltages;
241 std::chrono::high_resolution_clock::time_point mTimerCurrents;
242 std::chrono::high_resolution_clock::time_point mTimerEnv;
243 std::chrono::high_resolution_clock::time_point mTimerFedChamberStatus;
244 std::chrono::high_resolution_clock::time_point mTimerFedCFGtag;
246 int64_t mGasDPsUpdateInterval;
247 int64_t mVoltagesDPsUpdateInterval;
248 int64_t mCurrentsDPsUpdateInterval;
249 int64_t mMinUpdateIntervalU;
250 int64_t mEnvDPsUpdateInterval;
251 int64_t mFedChamberStatusDPsUpdateInterval;
252 int64_t mFedCFGtagDPsUpdateInterval;
257 if (mProcessor->updateVoltagesDPsCCDB()) {
258 const auto& payload = mProcessor->getTRDVoltagesDPsInfo();
259 auto& info = mProcessor->getccdbVoltagesDPsInfo();
261 LOG(info) <<
"Sending object " << info.getPath() <<
"/" << info.getFileName() <<
" of size " <<
image->size()
262 <<
" bytes, valid for " << info.getStartValidityTimestamp() <<
" : " << info.getEndValidityTimestamp();
265 mProcessor->clearVoltagesDPsInfo();
267 auto&
info = mProcessor->getccdbVoltagesDPsInfo();
268 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
275 if (mProcessor->updateCurrentsDPsCCDB()) {
276 const auto& payload = mProcessor->getTRDCurrentsDPsInfo();
277 auto&
info = mProcessor->getccdbCurrentsDPsInfo();
279 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
280 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
283 mProcessor->clearCurrentsDPsInfo();
285 auto&
info = mProcessor->getccdbCurrentsDPsInfo();
286 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
294 if (mProcessor->updateGasDPsCCDB()) {
295 const auto& payload = mProcessor->getTRDGasDPsInfo();
296 auto&
info = mProcessor->getccdbGasDPsInfo();
298 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
299 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
302 mProcessor->clearGasDPsInfo();
304 auto&
info = mProcessor->getccdbGasDPsInfo();
305 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
313 if (mProcessor->updateEnvDPsCCDB()) {
314 const auto& payload = mProcessor->getTRDEnvDPsInfo();
315 auto&
info = mProcessor->getccdbEnvDPsInfo();
317 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
318 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
321 mProcessor->clearEnvDPsInfo();
323 auto&
info = mProcessor->getccdbEnvDPsInfo();
324 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
332 if (mProcessor->updateFedChamberStatusDPsCCDB()) {
333 const auto& payload = mProcessor->getTRDFedChamberStatusDPsInfo();
334 auto&
info = mProcessor->getccdbFedChamberStatusDPsInfo();
336 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
337 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
340 mProcessor->clearFedChamberStatusDPsInfo();
342 auto&
info = mProcessor->getccdbFedChamberStatusDPsInfo();
343 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
351 if (mProcessor->updateFedCFGtagDPsCCDB()) {
352 const auto& payload = mProcessor->getTRDFedCFGtagDPsInfo();
353 auto&
info = mProcessor->getccdbFedCFGtagDPsInfo();
355 LOG(info) <<
"Sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" of size " <<
image->size()
356 <<
" bytes, valid for " <<
info.getStartValidityTimestamp() <<
" : " <<
info.getEndValidityTimestamp();
359 mProcessor->clearFedCFGtagDPsInfo();
361 auto&
info = mProcessor->getccdbFedCFGtagDPsInfo();
362 LOG(info) <<
"Not sending object " <<
info.getPath() <<
"/" <<
info.getFileName() <<
" since no DPs were processed for it";
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 trd