Skip to content

Commit 41c1189

Browse files
authored
Merge 9f9f6ce into sapling-pr-archive-ehellbar
2 parents 49242d5 + 9f9f6ce commit 41c1189

File tree

7 files changed

+68
-31
lines changed

7 files changed

+68
-31
lines changed

DataFormats/Detectors/TPC/src/DCS.cxx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,27 @@ void fillBuffer(std::pair<std::vector<float>, std::vector<TimeStampType>>& buffe
329329
}
330330
}
331331

332-
std::pair<std::vector<float>, std::vector<TimeStampType>> buffTmp{
333-
std::vector<float>(buffer.first.begin() + idxStartBuffer, buffer.first.end()),
334-
std::vector<TimeStampType>(buffer.second.begin() + idxStartBuffer, buffer.second.end())};
335-
336-
buffTmp.first.insert(buffTmp.first.end(), values.first.begin(), values.first.end());
337-
buffTmp.second.insert(buffTmp.second.end(), values.second.begin(), values.second.end());
332+
std::pair<std::vector<float>, std::vector<TimeStampType>> buffTmp;
333+
auto& [buffVals, buffTimes] = buffTmp;
334+
335+
// Preallocate enough capacity to avoid reallocations
336+
buffVals.reserve(buffer.first.size() - idxStartBuffer + values.first.size());
337+
buffTimes.reserve(buffer.second.size() - idxStartBuffer + values.second.size());
338+
// Insert the kept part of the old buffer
339+
buffVals.insert(buffVals.end(), buffer.first.begin() + idxStartBuffer, buffer.first.end());
340+
buffTimes.insert(buffTimes.end(), buffer.second.begin() + idxStartBuffer, buffer.second.end());
341+
// Insert the new values
342+
buffVals.insert(buffVals.end(), values.first.begin(), values.first.end());
343+
buffTimes.insert(buffTimes.end(), values.second.begin(), values.second.end());
344+
345+
// this should not happen
346+
if (!std::is_sorted(buffTimes.begin(), buffTimes.end())) {
347+
LOGP(info, "Pressure buffer not sorted after filling - sorting it");
348+
std::vector<size_t> idx(buffTimes.size());
349+
o2::math_utils::SortData(buffTimes, idx);
350+
o2::math_utils::Reorder(buffVals, idx);
351+
o2::math_utils::Reorder(buffTimes, idx);
352+
}
338353

339354
buffer = std::move(buffTmp);
340355
}

DataFormats/common/include/CommonDataFormat/InteractionRecord.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ struct InteractionRecord {
281281
return tmp;
282282
}
283283

284-
#ifndef GPUCA_ALIGPUCODE
284+
#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
285285
void print() const;
286286
std::string asString() const;
287287
friend std::ostream& operator<<(std::ostream& stream, InteractionRecord const& ir);
@@ -359,7 +359,7 @@ struct InteractionTimeRecord : public InteractionRecord {
359359
return !((*this) > other);
360360
}
361361

362-
#ifndef GPUCA_ALIGPUCODE
362+
#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
363363
void print() const;
364364
std::string asString() const;
365365
friend std::ostream& operator<<(std::ostream& stream, InteractionTimeRecord const& ir);

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ inline void GPUReconstructionCPU::runKernelBackend(const krnlSetupTime& _xyz, co
6666
int32_t nThreads = getNKernelHostThreads(false);
6767
if (nThreads > 1) {
6868
if (GetProcessingSettings().debugLevel >= 5) {
69-
printf("Running %d Threads\n", mThreading->activeThreads->max_concurrency());
69+
GPUInfo("Running %d Threads", mThreading->activeThreads->max_concurrency());
7070
}
7171
tbb::this_task_arena::isolate([&] {
7272
mThreading->activeThreads->execute([&] {
@@ -227,7 +227,7 @@ int32_t GPUReconstructionCPU::RunChains()
227227
mNEventsProcessed++;
228228

229229
if (GetProcessingSettings().debugLevel >= 3 || GetProcessingSettings().allocDebugLevel) {
230-
printf("Allocated memory when starting processing %34s", "");
230+
GPUInfo("Allocated memory when starting processing %34s", "");
231231
PrintMemoryOverview();
232232
}
233233
mTimerTotal.Start();
@@ -254,7 +254,7 @@ int32_t GPUReconstructionCPU::RunChains()
254254
mTimerTotal.Stop();
255255
mStatCPUTime += (double)(std::clock() - cpuTimerStart) / CLOCKS_PER_SEC;
256256
if (GetProcessingSettings().debugLevel >= 3 || GetProcessingSettings().allocDebugLevel) {
257-
printf("Allocated memory when ending processing %36s", "");
257+
GPUInfo("Allocated memory when ending processing %36s", "");
258258
PrintMemoryOverview();
259259
}
260260

GPU/GPUTracking/display/render/GPUDisplayDraw.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ void GPUDisplay::DrawFinal(int32_t iSector, int32_t /*iCol*/, const GPUTPCGMProp
539539
if (mc.pid < 0) {
540540
break;
541541
}
542+
if (mc.t0 == -100.f) {
543+
break;
544+
}
542545

543546
alphaOrg = mParam->Alpha(iSector);
544547
float c = cosf(alphaOrg);

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,27 @@ void GPUQA::InitO2MCData(GPUTrackingInOutPointers* updateIOPtr)
673673
std::vector<int32_t> refId;
674674

675675
auto dc = o2::steer::DigitizationContext::loadFromFile("collisioncontext.root");
676-
auto evrec = dc->getEventRecords();
676+
const auto& evrec = dc->getEventRecords();
677+
const auto& evparts = dc->getEventParts();
678+
std::vector<std::vector<float>> evTimeBins(mcReader.getNSources());
679+
for (uint32_t i = 0; i < evTimeBins.size(); i++) {
680+
evTimeBins[i].resize(mcReader.getNEvents(i), -100.f);
681+
}
682+
for (uint32_t i = 0; i < evrec.size(); i++) {
683+
const auto& ir = evrec[i];
684+
for (uint32_t j = 0; j < evparts[i].size(); j++) {
685+
const int iSim = evparts[i][j].sourceID;
686+
const int iEv = evparts[i][j].entryID;
687+
if (iSim == o2::steer::QEDSOURCEID || ir.differenceInBC(o2::raw::HBFUtils::Instance().getFirstIR()) >= 0) {
688+
auto ir0 = o2::raw::HBFUtils::Instance().getFirstIRofTF(ir);
689+
float timebin = (float)ir.differenceInBC(ir0) / o2::tpc::constants::LHCBCPERTIMEBIN;
690+
if (evTimeBins[iSim][iEv] >= 0) {
691+
throw std::runtime_error("Multiple time bins for same MC collision found");
692+
}
693+
evTimeBins[iSim][iEv] = timebin;
694+
}
695+
}
696+
}
677697

678698
uint32_t nSimSources = mcReader.getNSources();
679699
mMCEventOffset.resize(nSimSources);
@@ -686,13 +706,8 @@ void GPUQA::InitO2MCData(GPUTrackingInOutPointers* updateIOPtr)
686706

687707
mMCInfosCol.resize(nSimTotalEvents);
688708
for (int32_t iSim = 0; iSim < mcReader.getNSources(); iSim++) {
689-
if (iSim == o2::steer::QEDSOURCEID) {
690-
continue;
691-
}
692709
for (int32_t i = 0; i < mcReader.getNEvents(iSim); i++) {
693-
auto ir = evrec[i];
694-
auto ir0 = o2::raw::HBFUtils::Instance().getFirstIRofTF(ir);
695-
float timebin = (float)ir.differenceInBC(ir0) / o2::tpc::constants::LHCBCPERTIMEBIN;
710+
const float timebin = evTimeBins[iSim][i];
696711

697712
const std::vector<o2::MCTrack>& tracks = mcReader.getTracks(iSim, i);
698713
const std::vector<o2::TrackReference>& trackRefs = mcReader.getTrackRefsByEvent(iSim, i);
@@ -1298,6 +1313,9 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
12981313
if (mc1.pid < 0) {
12991314
continue;
13001315
}
1316+
if (mc1.t0 == -100.f) {
1317+
continue;
1318+
}
13011319
if (mConfig.filterCharge && mc1.charge * mConfig.filterCharge < 0) {
13021320
continue;
13031321
}

prodtests/full-system-test/aggregator-workflow.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,11 @@ if [[ $AGGREGATOR_TASKS == BARREL_TF ]] || [[ $AGGREGATOR_TASKS == ALL ]]; then
243243
add_W o2-itsmft-deadmap-builder-workflow "--runmft --ccdb-url $CCDB_POPULATOR_UPLOAD_PATH ${CALIB_MFT_DEADMAP_TIME_OPT:---skip-static-map}"
244244
fi
245245
# TOF
246-
if [[ $CALIB_TOF_LHCPHASE == 1 ]] || [[ $CALIB_TOF_CHANNELOFFSETS == 1 ]]; then
247-
if [[ $CALIB_TOF_LHCPHASE == 1 ]]; then
248-
add_W o2-calibration-tof-calib-workflow "--do-lhc-phase --tf-per-slot $LHCPHASE_TF_PER_SLOT --use-ccdb --max-delay 0 " "" 0
249-
fi
250-
if [[ $CALIB_TOF_CHANNELOFFSETS == 1 ]]; then
251-
add_W o2-calibration-tof-calib-workflow "--do-channel-offset --update-interval $TOF_CHANNELOFFSETS_UPDATE --delta-update-interval $TOF_CHANNELOFFSETS_DELTA_UPDATE --min-entries 100 --range 100000 --use-ccdb --condition-tf-per-query 2640 " "" 0
252-
fi
246+
if [[ $CALIB_TOF_LHCPHASE == 1 ]]; then
247+
add_W o2-calibration-tof-calib-workflow "--do-lhc-phase --tf-per-slot $LHCPHASE_TF_PER_SLOT --use-ccdb --max-delay 0 " "" 0
248+
fi
249+
if [[ $CALIB_TOF_CHANNELOFFSETS == 1 ]]; then
250+
add_W o2-calibration-tof-calib-workflow "--do-channel-offset --update-interval $TOF_CHANNELOFFSETS_UPDATE --delta-update-interval $TOF_CHANNELOFFSETS_DELTA_UPDATE --min-entries 100 --range 100000 --use-ccdb --condition-tf-per-query 2640 " "" 0
253251
fi
254252
if [[ $CALIB_TOF_DIAGNOSTICS == 1 ]]; then
255253
add_W o2-calibration-tof-diagnostic-workflow "--tf-per-slot $LHCPHASE_TF_PER_SLOT --max-delay 1" "" 0

prodtests/full-system-test/dpl-workflow.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ TOF_CONFIG=
8181
TOF_INPUT=raw
8282
TOF_OUTPUT=clusters
8383
ITS_CONFIG_KEY=
84+
ITS_STF_DEC_CONFIG=
8485
MFT_CONFIG=
86+
MFT_STF_DEC_CONFIG=
8587
MFT_CONFIG_KEY=
8688
TRD_CONFIG=
8789
TRD_CONFIG_KEY=
@@ -113,14 +115,15 @@ if [[ $CTFINPUT != 1 ]]; then
113115
fi
114116
if [[ $SYNCMODE == 1 ]]; then
115117
has_detectors_gpu TPC ITS && ITS_CONFIG_KEY+="ITSCATrackerParam.trackingMode=0;" # sets ITS gpu reco to sync
118+
ITS_STF_DEC_CONFIG+="ITSClustererParam.maxBCDiffToMaskBias=-1;"
119+
MFT_STF_DEC_CONFIG+="MFTClustererParam.maxBCDiffToMaskBias=-1;"
120+
[[ $BEAMTYPE == "PbPb" || $BEAMTYPE == "pp" || $LIGHTNUCLEI == "1" ]] && MFT_CONFIG_KEY+="MFTTracking.cutMultClusLow=0;MFTTracking.cutMultClusHigh=4000;"
116121
if [[ $BEAMTYPE == "PbPb" ]]; then
117-
ITS_CONFIG_KEY+="fastMultConfig.cutMultClusLow=${CUT_MULT_MIN_ITS:-100};fastMultConfig.cutMultClusHigh=${CUT_MULT_MAX_ITS:-200};fastMultConfig.cutMultVtxHigh=${CUT_MULT_VTX_ITS:-20};"
122+
ITS_CONFIG_KEY+="fastMultConfig.cutMultClusLow=${CUT_MULT_MIN_ITS:-0};fastMultConfig.cutMultClusHigh=${CUT_MULT_MAX_ITS:-400};fastMultConfig.cutMultVtxHigh=${CUT_MULT_VTX_ITS:-20};"
118123
MCH_CONFIG_KEY="MCHTracking.maxCandidates=50000;MCHTracking.maxTrackingDuration=20;"
119-
MFT_CONFIG_KEY+="MFTTracking.cutMultClusLow=0;MFTTracking.cutMultClusHigh=20000;"
120124
elif [[ $BEAMTYPE == "pp" || $LIGHTNUCLEI == "1" ]]; then
121125
ITS_CONFIG_KEY+="fastMultConfig.cutMultClusLow=${CUT_MULT_MIN_ITS:--1};fastMultConfig.cutMultClusHigh=${CUT_MULT_MAX_ITS:--1};fastMultConfig.cutMultVtxHigh=${CUT_MULT_VTX_ITS:--1};ITSVertexerParam.phiCut=0.5;ITSVertexerParam.clusterContributorsCut=3;ITSVertexerParam.tanLambdaCut=0.2;"
122126
MCH_CONFIG_KEY="MCHTracking.maxCandidates=20000;MCHTracking.maxTrackingDuration=10;"
123-
MFT_CONFIG_KEY+="MFTTracking.cutMultClusLow=0;MFTTracking.cutMultClusHigh=3000;"
124127
fi
125128
[[ -n ${CUT_RANDOM_FRACTION_ITS:-} ]] && ITS_CONFIG_KEY+="fastMultConfig.cutRandomFraction=$CUT_RANDOM_FRACTION_ITS;"
126129
ITS_CONFIG_KEY+="ITSCATrackerParam.trackletsPerClusterLimit=${CUT_TRACKLETSPERCLUSTER_MAX_ITS:--1};ITSCATrackerParam.cellsPerClusterLimit=${CUT_CELLSPERCLUSTER_MAX_ITS:--1};"
@@ -534,12 +537,12 @@ if [[ $CTFINPUT == 0 && $DIGITINPUT == 0 ]]; then
534537
add_W o2-tpc-raw-to-digits-workflow "--input-spec \"\" --remove-duplicates $RAWTODIGITOPTIONS --pipeline $(get_N tpc-raw-to-digits-0 TPC RAW 1 TPCRAWDEC)"
535538
add_W o2-tpc-reco-workflow "--input-type digitizer --output-type zsraw,disable-writer --pipeline $(get_N tpc-zsEncoder TPC RAW 1 TPCRAWDEC)" "GPU_rec_tpc.zsThreshold=0"
536539
fi
537-
has_detector ITS && ! has_detector_from_global_reader ITS && add_W o2-itsmft-stf-decoder-workflow "--nthreads ${NITSDECTHREADS} --raw-data-dumps $ALPIDE_ERR_DUMPS --pipeline $(get_N its-stf-decoder ITS RAW 1 ITSRAWDEC)" "$ITSMFT_STROBES;VerbosityConfig.rawParserSeverity=warn;"
538-
has_detector MFT && ! has_detector_from_global_reader MFT && add_W o2-itsmft-stf-decoder-workflow "--nthreads ${NMFTDECTHREADS} --raw-data-dumps $ALPIDE_ERR_DUMPS --pipeline $(get_N mft-stf-decoder MFT RAW 1 MFTRAWDEC) --runmft true" "$ITSMFT_STROBES;VerbosityConfig.rawParserSeverity=warn;"
540+
has_detector ITS && ! has_detector_from_global_reader ITS && add_W o2-itsmft-stf-decoder-workflow "--nthreads ${NITSDECTHREADS} --raw-data-dumps $ALPIDE_ERR_DUMPS --pipeline $(get_N its-stf-decoder ITS RAW 1 ITSRAWDEC)" "$ITS_STF_DEC_CONFIG;$ITSMFT_STROBES;VerbosityConfig.rawParserSeverity=warn;"
541+
has_detector MFT && ! has_detector_from_global_reader MFT && add_W o2-itsmft-stf-decoder-workflow "--nthreads ${NMFTDECTHREADS} --raw-data-dumps $ALPIDE_ERR_DUMPS --pipeline $(get_N mft-stf-decoder MFT RAW 1 MFTRAWDEC) --runmft true" "$MFT_STF_DEC_CONFIG;$ITSMFT_STROBES;VerbosityConfig.rawParserSeverity=warn;"
539542
has_detector FT0 && ! has_detector_from_global_reader FT0 && ! has_detector_flp_processing FT0 && add_W o2-ft0-flp-dpl-workflow "$DISABLE_ROOT_OUTPUT --pipeline $(get_N ft0-datareader-dpl FT0 RAW 1)"
540543
has_detector FV0 && ! has_detector_from_global_reader FV0 && ! has_detector_flp_processing FV0 && add_W o2-fv0-flp-dpl-workflow "$DISABLE_ROOT_OUTPUT --pipeline $(get_N fv0-datareader-dpl FV0 RAW 1)"
541544
has_detector MID && ! has_detector_from_global_reader MID && add_W o2-mid-raw-to-digits-workflow "$MIDDEC_CONFIG --pipeline $(get_N MIDRawDecoder MID RAW 1),$(get_N MIDDecodedDataAggregator MID RAW 1)"
542-
has_detector MCH && ! has_detector_from_global_reader MCH && add_W o2-mch-raw-to-digits-workflow "--pipeline $(get_N mch-data-decoder MCH RAW 1)"
545+
has_detector MCH && ! has_detector_from_global_reader MCH && add_W o2-mch-raw-to-digits-workflow "--pipeline $(get_N mch-data-decoder MCH RAW 1 MCHRAWDEC)"
543546
has_detector TOF && ! has_detector_from_global_reader TOF && ! has_detector_flp_processing TOF && add_W o2-tof-compressor "--tof-compressor-paranoid --pipeline $(get_N tof-compressor-0 TOF RAW 1)"
544547
has_detector FDD && ! has_detector_from_global_reader FDD && ! has_detector_flp_processing FDD && add_W o2-fdd-flp-dpl-workflow "$DISABLE_ROOT_OUTPUT --pipeline $(get_N fdd-datareader-dpl FDD RAW 1)"
545548
has_detector TRD && ! has_detector_from_global_reader TRD && add_W o2-trd-datareader "$DISABLE_ROOT_OUTPUT --sortDigits --pipeline $(get_N trd-datareader TRD RAW 1 TRDRAWDEC)" "" 0

0 commit comments

Comments
 (0)