56 const bool enableZDCTDCCorr,
const bool enableZDCEnergyParam,
const bool enableZDCTowerParam,
const bool enableBaselineParam)
57 : mVerbosity(
verbosity), mDebugOut(debugOut), mEnableZDCTDCCorr(enableZDCTDCCorr), mEnableZDCEnergyParam(enableZDCEnergyParam), mEnableZDCTowerParam(enableZDCTowerParam), mEnableBaselineParam(enableBaselineParam)
67 LOG(warning) <<
"Limiting the number of waveforms in ourput to " << mMaxWave;
69 mRecoFraction = ic.
options().
get<
double>(
"tf-fraction");
70 if (mRecoFraction < 0 || mRecoFraction > 1) {
71 LOG(
error) <<
"Unphysical reconstructed fraction " << mRecoFraction <<
" set to 1.0";
74 if (mRecoFraction < 1) {
75 LOG(warning) <<
"Target fraction for reconstructed TFs = " << mRecoFraction;
85 if (mEnableZDCTDCCorr) {
88 if (mEnableZDCEnergyParam) {
91 if (mEnableZDCTowerParam) {
94 if (mEnableBaselineParam) {
161 LOG(info) <<
"DigitRecoSpec::run initialization";
170 auto cput = mTimer.CpuTime();
173 auto bcdata = pc.
inputs().
get<gsl::span<o2::zdc::BCData>>(
"trig");
174 auto chans = pc.
inputs().
get<gsl::span<o2::zdc::ChannelData>>(
"chan");
175 auto peds = pc.
inputs().
get<gsl::span<o2::zdc::OrbitData>>(
"peds");
178 bool toProcess =
true;
179 if (mRecoFraction <= 0.) {
181 }
else if (mRecoFraction < 1.0) {
182 double frac = std::rand() / double(RAND_MAX);
183 if (frac > mRecoFraction) {
191 int rval = mWorker.
process(peds, bcdata, chans);
192 if (rval != 0 || mWorker.
inError()) {
193 LOG(warning) << bcdata.size() <<
" BC " << chans.size() <<
" CH " << peds.size() <<
" OD -> processing ended in ERROR @ line " << rval;
195 const std::vector<o2::zdc::RecEventAux>& recAux = mWorker.
getReco();
199 if (mVerbosity > 0 || fullinter) {
200 LOGF(info,
"BC processed during reconstruction %d%s", recAux.size(), (fullinter ?
" FullInterpolation" :
""));
202 uint32_t nte = 0, ntt = 0, nti = 0, ntw = 0;
203 for (
auto reca : recAux) {
209 for (
int32_t ih = 0; ih < reca.ntdc[it]; ih++) {
211 recEvent.
addBC(reca);
215 recEvent.
addTDC(it, reca.TDCVal[it][ih], reca.TDCAmp[it][ih], reca.isBeg[it], reca.isEnd[it]);
221 if (reca.inter[isig].size() ==
NIS) {
223 recEvent.
addBC(reca);
231 if (mMaxWave > 0 && ntw >= mMaxWave) {
233 LOG(warning) <<
"Maximum number of output waveforms per TF reached: " << mMaxWave;
240 recEvent.
addBC(reca);
243 std::map<uint8_t, float>::iterator it;
244 for (it = reca.ezdc.begin(); it != reca.ezdc.end(); it++) {
245 recEvent.
addEnergy(it->first, it->second);
250 if (mVerbosity > 1 && (nt > 0 || ne > 0)) {
251 printf(
"Orbit %9u bc %4u ntdc %2d ne %2d channels=0x%08x\n", reca.ir.orbit, reca.ir.bc, nt, ne, reca.channels);
256 LOG(info) << bcdata.size() <<
" BC " << chans.size() <<
" CH " << peds.size() <<
" OD "
257 <<
"-> Reconstructed " << ntt <<
" signal TDCs and " << nte <<
" ZDC energies and "
258 << nti <<
" info messages in " << recEvent.
mRecBC.size() <<
"/" << recAux.size() <<
" b.c. and "
259 << ntw <<
" waveform chunks";
262 LOG(info) << bcdata.size() <<
" BC " << chans.size() <<
" CH " << peds.size() <<
" OD "
263 <<
"-> SKIPPED because of requested reconstruction fraction = " << mRecoFraction;
278 LOGF(info,
"ZDC Reconstruction total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
283 std::vector<InputSpec> inputs;
284 inputs.emplace_back(
"trig",
"ZDC",
"DIGITSBC", 0, Lifetime::Timeframe);
285 inputs.emplace_back(
"chan",
"ZDC",
"DIGITSCH", 0, Lifetime::Timeframe);
286 inputs.emplace_back(
"peds",
"ZDC",
"DIGITSPD", 0, Lifetime::Timeframe);
290 if (enableZDCTDCCorr) {
293 LOG(warning) <<
"ZDCTDCCorr has been disabled - no correction is applied";
295 if (enableZDCEnergyParam) {
298 LOG(warning) <<
"ZDCEnergyParam has been disabled - no energy calibration is applied";
300 if (enableZDCTowerParam) {
303 LOG(warning) <<
"ZDCTowerParam has been disabled - no tower intercalibration";
305 if (enableBaselineParam) {
308 LOG(warning) <<
"BaselineParam has been disabled - no fallback in case orbit pedestals are missing";
311 std::vector<OutputSpec> outputs;
312 outputs.emplace_back(
"ZDC",
"BCREC", 0, Lifetime::Timeframe);
313 outputs.emplace_back(
"ZDC",
"ENERGY", 0, Lifetime::Timeframe);
314 outputs.emplace_back(
"ZDC",
"TDCDATA", 0, Lifetime::Timeframe);
315 outputs.emplace_back(
"ZDC",
"INFO", 0, Lifetime::Timeframe);
316 outputs.emplace_back(
"ZDC",
"WAVE", 0, Lifetime::Timeframe);
322 AlgorithmSpec{adaptFromTask<DigitRecoSpec>(
verbosity, enableDebugOut, enableZDCTDCCorr, enableZDCEnergyParam, enableZDCTowerParam, enableBaselineParam)},
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
Baseline calibration data.
Run ZDC digits reconstruction.
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
char error[CURL_ERROR_SIZE]
Definition of the Names Generator class.
Class to describe pedestal data accumulated over the orbit.
Class to describe reconstructed ZDC event (single BC with signal in one of detectors)
ZDC reconstruction parameters.
ZDC TDC correction parameters.
Parameters to correct TDCs (produced by QA)
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
void setDebugOutput(bool state=true)
void setTowerParam(const ZDCTowerParam *param)
bool getFullInterpolation()
void setRecoConfigZDC(const RecoConfigZDC *cfg)
void setModuleConfig(const ModuleConfig *moduleConfig)
void setBaselineParam(const BaselineParam *param)
const std::vector< o2::zdc::RecEventAux > & getReco()
void setTDCParam(const ZDCTDCParam *param)
void setEnergyParam(const ZDCEnergyParam *param)
void setTDCCorr(const ZDCTDCCorr *param)
int process(const gsl::span< const o2::zdc::OrbitData > &orbitdata, const gsl::span< const o2::zdc::BCData > &bcdata, const gsl::span< const o2::zdc::ChannelData > &chdata)
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(o2::framework::InitContext &ic) final
void updateTimeDependentParams(o2::framework::ProcessingContext &pc)
void run(o2::framework::ProcessingContext &pc) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
struct o2::upgrades_utils::@482 zdc
structure to keep FT0 information
framework::DataProcessorSpec getDigitRecoSpec(const int verbosity, const bool enableDebugOut, const bool enableZDCTDCCorr, const bool enableZDCEnergyParam, const bool enableZDCTowerParam, const bool enableBaselineParam)
create a processor spec
const std::string CCDBPathTDCCorr
const std::string CCDBPathBaselineCalib
constexpr int NTDCChannels
const std::string CCDBPathRecoConfigZDC
const std::string CCDBPathEnergyCalib
const std::string CCDBPathTDCCalib
const std::string CCDBPathTowerCalib
const std::string CCDBPathConfigModule
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void print(bool printall=true) const
uint32_t addInfos(const RecEventAux &reca)
void addTDC(uint8_t ch, int16_t val, int16_t amp, bool isbeg=false, bool isend=false)
std::vector< o2::zdc::ZDCWaveform > mWaveform
Event quality information.
void addEnergy(uint8_t ch, float energy)
void addWaveform(uint8_t ch, std::vector< float > &wave)
std::vector< o2::zdc::ZDCEnergy > mEnergy
Interaction record and references to data.
std::vector< uint16_t > mInfo
ZDC TDC.
void addBC(const RecEventAux &reca)
ZDC waveform.
std::vector< o2::zdc::BCRecData > mRecBC
std::vector< o2::zdc::ZDCTDCData > mTDCData
ZDC energy.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"