Skip to content

Commit 9c4883c

Browse files
authored
Merge branch 'AliceO2Group:dev' into new-detector4
2 parents 73d3a4a + 2dd3745 commit 9c4883c

42 files changed

Lines changed: 1237 additions & 1079 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CCDB/src/CCDBDownloader.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ void CCDBDownloader::transferFinished(CURL* easy_handle, CURLcode curlCode)
485485
bool contentRetrieved = false;
486486

487487
if (curlCode != 0) {
488-
LOG(error) << "CCDBDownloader: " << curl_easy_strerror(curlCode) << "\n";
488+
LOG(error) << "CCDBDownloader CURL transfer error - " << curl_easy_strerror(curlCode) << "\n";
489489
}
490490

491491
switch (performData->type) {
@@ -520,15 +520,14 @@ void CCDBDownloader::transferFinished(CURL* easy_handle, CURLcode curlCode)
520520
} else if (300 <= httpCode && httpCode < 400 && performData->locInd < locations.size()) {
521521
followRedirect(performData, easy_handle, locations, rescheduled, contentRetrieved);
522522
} else if (200 <= httpCode && httpCode < 300) {
523-
contentRetrieved = true; // Can be overruled by following timeout check
523+
contentRetrieved = true; // Can be overruled by following error check
524524
}
525525
} else {
526526
LOG(error) << loggingMessage;
527527
}
528528

529-
// Check for timeout
530-
if (curlCode == CURLE_OPERATION_TIMEDOUT) {
531-
LOG(error) << "Connection timed out.\n";
529+
// Check for errors
530+
if (curlCode != 0) {
532531
contentRetrieved = false;
533532
}
534533

DataFormats/Reconstruction/src/TrackParametrization.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,10 @@ GPUd() typename TrackParametrization<value_T>::value_t TrackParametrization<valu
956956

957957
namespace o2::track
958958
{
959+
#if !defined(GPUCA_GPUCODE) || defined(GPUCA_GPUCODE_DEVICE) // FIXME: DR: WORKAROUND to avoid CUDA bug creating host symbols for device code.
959960
template class TrackParametrization<float>;
960-
#ifndef GPUCA_GPUCODE_DEVICE
961+
#endif
962+
#ifndef GPUCA_GPUCODE
961963
template class TrackParametrization<double>;
962964
#endif
963965
} // namespace o2::track

DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,10 @@ GPUd() void TrackParametrizationWithError<value_T>::printHexadecimal()
12451245

12461246
namespace o2::track
12471247
{
1248+
#if !defined(GPUCA_GPUCODE) || defined(GPUCA_GPUCODE_DEVICE) // FIXME: DR: WORKAROUND to avoid CUDA bug creating host symbols for device code.
12481249
template class TrackParametrizationWithError<float>;
1249-
#ifndef GPUCA_GPUCODE_DEVICE
1250+
#endif
1251+
#ifndef GPUCA_GPUCODE
12501252
template class TrackParametrizationWithError<double>;
12511253
#endif
12521254
} // namespace o2::track

Detectors/Base/src/Propagator.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,10 @@ GPUd() void PropagatorImpl<value_T>::getFieldXYZ(const math_utils::Point3D<doubl
786786

787787
namespace o2::base
788788
{
789+
#if !defined(GPUCA_GPUCODE) || defined(GPUCA_GPUCODE_DEVICE) // FIXME: DR: WORKAROUND to avoid CUDA bug creating host symbols for device code.
789790
template class PropagatorImpl<float>;
790-
#ifndef GPUCA_GPUCODE_DEVICE
791+
#endif
792+
#ifndef GPUCA_GPUCODE
791793
template class PropagatorImpl<double>;
792794
#endif
793795
#ifndef __HIPCC__ // TODO: Fixme: must prevent HIP from compiling this, should file bug report

Detectors/Calibration/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ In order to prepare only one CCDB object at the end of the run you can use `setU
4242

4343
See e.g. LHCClockCalibrator.h/cxx in AliceO2/Detectors/TOF/calibration/include/TOFCalibration/LHCClockCalibrator.h and AliceO2/Detectors/TOF/calibration/srcLHCClockCalibrator.cxx
4444

45+
Sometimes it might be useful to define the 1st slot of the run shorter than the nominal slot length, e.g. to not rely to long on the previous run or default calibration. In this case one can impose to the
46+
calibration class an offset using method `setStartOffsetFrac(float offset)`, where `offset` is a fractional of the nominal slot length to be subtracted from the nominal boundaries of all slots (except the
47+
very 1st one, whose startTF is set to 0). The fractional offset should be in `[0:0.95)` range, any value outside this range will be overridden to the nearest boundary.
48+
This feature is supported only for the finite slot-length calibrations. E.g. if the nominal slot length is 10 minutes `(==~210000 TFs)`, setting `setStartOffsetFrac(float 0.7)` will lead to 1st slot
49+
finalized after the first 3 minutes, while the rest of the slots will be defined with nominal 10 minutes coverage. If statistics of this 1st short slot is insufficient, it will be merged as usual
50+
with the next slot (note this if this happens, in the example above the 1st calibration will be available in 13 minutes...).
51+
4552
## TimeSlot<Container>
4653

4754
The TimeSlot is a templated class which takes as input type the Container that will hold the calibration data needed to produce the calibration objects (histograms, vectors, array...). Each calibration device could implement its own Container, according to its needs.

Detectors/Calibration/include/DetectorsCalibration/TimeSlotCalibration.h

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,35 @@ class TimeSlotCalibration
8787
setSlotLength(ntf);
8888
mSlotLengthInOrbits = 0;
8989
}
90+
setStartOffsetFrac(mStartOffsetFrac); // set once more to account for eventual dependencies
91+
mStartOffsetTFs = TFType(mSlotLength * mStartOffsetFrac);
92+
}
93+
94+
void setStartOffsetFrac(float f)
95+
{
96+
if (mUpdateAtTheEndOfRunOnly || mFinalizeWhenReady || mSlotLength == INFINITE_TF) { // offset makes no sense for run-wide objects
97+
if (f) {
98+
LOGP(info, "Start offset is not supported in the INFINITE_TF slot length or UpdateAtTheEndOfRunOnly or FinalizeWhenReady modes");
99+
}
100+
return;
101+
}
102+
if (f < 0.) {
103+
mStartOffsetFrac = 0.;
104+
} else if (f > 0.95) {
105+
mStartOffsetFrac = 0.95;
106+
} else {
107+
mStartOffsetFrac = f;
108+
}
109+
if (mStartOffsetFrac || f != mStartOffsetFrac) {
110+
LOGP(info, "Imposing offset of {:4.2} x nominal slot length", mStartOffsetFrac);
111+
}
90112
}
91113

92114
void setFinalizeWhenReady()
93115
{
94116
mFinalizeWhenReady = true;
95117
setSlotLength(INFINITE_TF);
118+
mStartOffsetFrac = 0;
96119
}
97120

98121
void setUpdateAtTheEndOfRunOnly() { mUpdateAtTheEndOfRunOnly = kTRUE; }
@@ -219,7 +242,6 @@ class TimeSlotCalibration
219242
}
220243

221244
TFType tf2SlotMin(TFType tf) const;
222-
223245
std::deque<Slot> mSlots;
224246

225247
o2::dataformats::TFIDInfo mCurrentTFInfo{};
@@ -229,6 +251,8 @@ class TimeSlotCalibration
229251
TFType mFirstTF = 0;
230252
TFType mMaxSeenTF = 0; // largest TF processed
231253
TFType mSlotLength = 1; // slot length in TFs
254+
TFType mStartOffsetTFs = 0; // shift start of all TFs backwards by this amount (to make 1st slot effectively shorter: run_1st_tf to run_1st_tf - offset + mSlotLength), derived from mStartOffsetFrac
255+
float mStartOffsetFrac = 0.; // shift start of all TFs backwards mSlotLength*mStartOffsetFrac TFs.
232256
TFType mCheckIntervalInfiniteSlot = 1; // will be used if the TF length is INFINITE_TF_int64 to decide
233257
// when to check if to call the finalize; otherwise it is called
234258
// at every new TF; note that this is an approximation,
@@ -381,16 +405,20 @@ void TimeSlotCalibration<Container>::finalizeOldestSlot()
381405
template <typename Container>
382406
inline TFType TimeSlotCalibration<Container>::tf2SlotMin(TFType tf) const
383407
{
384-
385408
// returns the min TF of the slot to which "tf" belongs
386-
387409
if (tf < mFirstTF) {
388410
throw std::runtime_error("invalid TF");
389411
}
390412
if (mUpdateAtTheEndOfRunOnly) {
391413
return mFirstTF;
392414
}
393-
uint64_t tft = int64_t(((tf - mFirstTF) / mSlotLength) * mSlotLength) + mFirstTF;
415+
int64_t tft = 0;
416+
tft = int64_t(((tf - mFirstTF + mStartOffsetTFs) / mSlotLength) * mSlotLength) + mFirstTF;
417+
if (tft > mStartOffsetTFs) {
418+
tft -= mStartOffsetTFs;
419+
} else {
420+
tft = 0;
421+
}
394422
return tft < o2::calibration::INFINITE_TF ? TFType(tft) : INFINITE_TF;
395423
}
396424

@@ -415,7 +443,7 @@ TimeSlot<Container>& TimeSlotCalibration<Container>::getSlotForTF(TFType tf)
415443
auto tfmn = tf2SlotMin(mSlots.front().getTFStart() - 1); // min TF of the slot corresponding to a TF smaller than the first seen
416444
auto tftgt = tf2SlotMin(tf); // min TF of the slot to which the TF "tf" would belong
417445
while (tfmn >= tftgt) {
418-
uint64_t tft = uint64_t(tfmn) + mSlotLength - 1;
446+
uint64_t tft = mSlots.front().getTFStart() - 1;
419447
TFType tfmx = tft < o2::calibration::INFINITE_TF ? TFType(tft) : o2::calibration::INFINITE_TF;
420448
LOG(info) << "Adding new slot for " << tfmn << " <= TF <= " << tfmx;
421449
auto& sl = emplaceNewSlot(true, tfmn, tfmx);
@@ -438,12 +466,15 @@ TimeSlot<Container>& TimeSlotCalibration<Container>::getSlotForTF(TFType tf)
438466
auto tfmn = mSlots.empty() ? tf2SlotMin(tf) : tf2SlotMin(mSlots.back().getTFEnd() + 1);
439467
do {
440468
uint64_t tft = uint64_t(tfmn) + mSlotLength - 1;
469+
if (mSlots.empty() && mStartOffsetTFs && tf < mStartOffsetTFs) { // if this was lowest possible TF, its length might be smaller than mSlotLength
470+
tft -= mStartOffsetTFs;
471+
}
441472
TFType tfmx = tft < o2::calibration::INFINITE_TF ? TFType(tft) : o2::calibration::INFINITE_TF;
442473
LOG(info) << "Adding new slot for " << tfmn << " <= TF <= " << tfmx;
443474
auto& sl = emplaceNewSlot(false, tfmn, tfmx);
444475
sl.setRunStartOrbit(getRunStartOrbit());
445476
sl.setStaticStartTimeMS(sl.getStartTimeMS());
446-
tfmn = tf2SlotMin(mSlots.back().getTFEnd() + 1);
477+
tfmn = tft < o2::calibration::INFINITE_TF ? mSlots.back().getTFEnd() + 1 : tft;
447478
} while (tf > mSlots.back().getTFEnd());
448479

449480
return mSlots.back();

Detectors/FIT/macros/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ o2_add_test_root_macro(readFITDCSdata.C
4040
O2::CCDB
4141
LABELS fit)
4242

43-
o2_data_file(COPY readFITDCSdata.C DESTINATION Detectors/FIT/macros/readFITDCSdata.C)
43+
o2_data_file(COPY readFITDCSdata.C DESTINATION Detectors/FIT/macros/readFITDCSdata.C)
44+
o2_data_file(COPY readFITDeadChannelMap.C DESTINATION Detectors/FIT/macros/readFITDeadChannelMap.C)

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ class GpuTimeFrameChunk
174174
template <int nLayers = 7>
175175
class TimeFrameGPU : public TimeFrame
176176
{
177-
public:
178177
friend class GpuTimeFrameChunk<nLayers>;
179178

179+
public:
180180
TimeFrameGPU();
181181
~TimeFrameGPU();
182182

@@ -185,7 +185,7 @@ class TimeFrameGPU : public TimeFrame
185185
void unregisterHostMemory(const int);
186186
void initialise(const int, const TrackingParameters&, const int, IndexTableUtils* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
187187
void initialiseHybrid(const int, const TrackingParameters&, const int, IndexTableUtils* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
188-
void initDevice(const int, IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
188+
void initDevice(IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
189189
void initDeviceSAFitting();
190190
void loadTrackingFrameInfoDevice(const int);
191191
void loadUnsortedClustersDevice();
@@ -227,7 +227,8 @@ class TimeFrameGPU : public TimeFrame
227227
TrackITSExt* getDeviceTrackITSExt() { return mTrackITSExtDevice; }
228228
gpuPair<int, int>* getDeviceNeighbours(const int layer) { return mNeighboursDevice[layer]; }
229229
TrackingFrameInfo* getDeviceTrackingFrameInfo(const int);
230-
TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() { return mTrackingFrameInfoDeviceArray; }
230+
// TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() { return mTrackingFrameInfoDeviceArray; }
231+
const TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() const { return mTrackingFrameInfoDeviceArray; }
231232
Cluster** getDeviceArrayClusters() const { return mClustersDeviceArray; }
232233
Cluster** getDeviceArrayUnsortedClusters() const { return mUnsortedClustersDeviceArray; }
233234
Tracklet** getDeviceArrayTracklets() const { return mTrackletsDeviceArray; }
@@ -275,7 +276,7 @@ class TimeFrameGPU : public TimeFrame
275276
TrackITSExt* mTrackITSExtDevice;
276277
std::array<gpuPair<int, int>*, nLayers - 2> mNeighboursDevice;
277278
std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
278-
TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
279+
const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
279280

280281
// State
281282
std::vector<Stream> mGpuStreams;

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
#include "DetectorsBase/Propagator.h"
1717
#include "GPUCommonDef.h"
1818

19-
namespace o2
20-
{
21-
namespace its
19+
namespace o2::its
2220
{
2321
class CellSeed;
2422
namespace gpu
@@ -40,9 +38,9 @@ GPUd() bool fitTrack(TrackITSExt& track,
4038
template <int nLayers = 7>
4139
GPUg() void fitTrackSeedsKernel(
4240
CellSeed* trackSeeds,
43-
TrackingFrameInfo** foundTrackingFrameInfo,
41+
const TrackingFrameInfo** foundTrackingFrameInfo,
4442
o2::its::TrackITSExt* tracks,
45-
const size_t nSeeds,
43+
const unsigned int nSeeds,
4644
const float Bz,
4745
const int startLevel,
4846
float maxChi2ClusterAttachment,
@@ -53,15 +51,14 @@ GPUg() void fitTrackSeedsKernel(
5351
} // namespace gpu
5452

5553
void trackSeedHandler(CellSeed* trackSeeds,
56-
TrackingFrameInfo** foundTrackingFrameInfo,
54+
const TrackingFrameInfo** foundTrackingFrameInfo,
5755
o2::its::TrackITSExt* tracks,
58-
const size_t nSeeds,
56+
const unsigned int nSeeds,
5957
const float Bz,
6058
const int startLevel,
6159
float maxChi2ClusterAttachment,
6260
float maxChi2NDF,
6361
const o2::base::Propagator* propagator,
6462
const o2::base::PropagatorF::MatCorrType matCorrType);
65-
} // namespace its
66-
} // namespace o2
63+
} // namespace o2::its
6764
#endif // ITSTRACKINGGPU_TRACKINGKERNELS_H_
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
13+
#ifndef ITSTRACKINGGPU_VERTEXINGKERNELS_H_
14+
#define ITSTRACKINGGPU_VERTEXINGKERNELS_H_
15+
#include "ITStracking/MathUtils.h"
16+
#include "ITStracking/Configuration.h"
17+
#include "ITStracking/ClusterLines.h"
18+
#include "ITStracking/Tracklet.h"
19+
20+
#include "ITStrackingGPU/Utils.h"
21+
#include "ITStrackingGPU/ClusterLinesGPU.h"
22+
#include "ITStrackingGPU/VertexerTraitsGPU.h"
23+
#include "ITStrackingGPU/TracerGPU.h"
24+
25+
#include "GPUCommonArray.h"
26+
27+
namespace o2::its::gpu
28+
{
29+
#ifdef GPUCA_GPUCODE // GPUg() global kernels must only when compiled by GPU compiler
30+
template <TrackletMode Mode>
31+
GPUg() void trackleterKernelMultipleRof(
32+
const Cluster* clustersNextLayer, // 0 2
33+
const Cluster* clustersCurrentLayer, // 1 1
34+
const int* sizeNextLClusters,
35+
const int* sizeCurrentLClusters,
36+
const int* nextIndexTables,
37+
Tracklet* Tracklets,
38+
int* foundTracklets,
39+
const IndexTableUtils* utils,
40+
const unsigned int startRofId,
41+
const unsigned int rofSize,
42+
const float phiCut,
43+
const size_t maxTrackletsPerCluster);
44+
#endif
45+
template <TrackletMode Mode>
46+
void trackletFinderHandler(const Cluster* clustersNextLayer, // 0 2
47+
const Cluster* clustersCurrentLayer, // 1 1
48+
const int* sizeNextLClusters,
49+
const int* sizeCurrentLClusters,
50+
const int* nextIndexTables,
51+
Tracklet* Tracklets,
52+
int* foundTracklets,
53+
const IndexTableUtils* utils,
54+
const unsigned int startRofId,
55+
const unsigned int rofSize,
56+
const float phiCut,
57+
const size_t maxTrackletsPerCluster = 1e2);
58+
} // namespace o2::its::gpu
59+
#endif

0 commit comments

Comments
 (0)