Skip to content

Commit c12278b

Browse files
authored
Merge c4aa33d into sapling-pr-archive-ehellbar
2 parents 41c1189 + c4aa33d commit c12278b

File tree

75 files changed

+1840
-756
lines changed

Some content is hidden

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

75 files changed

+1840
-756
lines changed

DataFormats/Headers/include/Headers/Stack.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ struct Stack {
3636

3737
private:
3838
struct freeobj {
39-
freeobj(memory_resource* mr) : resource(mr) {}
39+
freeobj(memory_resource* mr, size_t s) : resource(mr), size(s) {}
4040
memory_resource* resource{nullptr};
41-
void operator()(std::byte* ptr) { resource->deallocate(ptr, 0, 0); }
41+
size_t size{0};
42+
void operator()(std::byte* ptr) { resource->deallocate(ptr, size, alignof(std::max_align_t)); }
4243
};
4344

4445
public:
@@ -99,7 +100,7 @@ struct Stack {
99100
Stack(const allocator_type allocatorArg, Headers&&... headers)
100101
: allocator{allocatorArg},
101102
bufferSize{calculateSize(std::forward<Headers>(headers)...)},
102-
buffer{static_cast<std::byte*>(allocator.resource()->allocate(bufferSize, alignof(std::max_align_t))), freeobj{allocator.resource()}}
103+
buffer{static_cast<std::byte*>(allocator.resource()->allocate(bufferSize, alignof(std::max_align_t))), freeobj{allocator.resource(), bufferSize}}
103104
{
104105
if constexpr (sizeof...(headers) > 1) {
105106
injectAll(buffer.get(), std::forward<Headers>(headers)...);
@@ -142,7 +143,7 @@ struct Stack {
142143
private:
143144
allocator_type allocator{fair::mq::pmr::new_delete_resource()};
144145
size_t bufferSize{0};
145-
BufferType buffer{nullptr, freeobj{allocator.resource()}};
146+
BufferType buffer{nullptr, freeobj{allocator.resource(), 0}};
146147

147148
//______________________________________________________________________________________________
148149
template <typename T>

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ class MatchInfoTOF
8686
hasT0_1BCbefore = 0x1 << 8,
8787
hasT0_2BCbefore = 0x1 << 9 };
8888

89+
void setFT0Best(double val, float res = 200.)
90+
{
91+
mFT0Best = val;
92+
mFT0BestRes = res;
93+
}
94+
double getFT0Best() const { return mFT0Best; }
95+
float getFT0BestRes() const { return mFT0BestRes; }
96+
8997
private:
9098
int mIdLocal; // track id in sector of the pair track-TOFcluster
9199
float mChi2; // chi2 of the pair track-TOFcluster
@@ -106,7 +114,10 @@ class MatchInfoTOF
106114
float mTgeant = 0.0; ///< geant time in MC
107115
double mT0true = 0.0; ///< t0true
108116

109-
ClassDefNV(MatchInfoTOF, 8);
117+
double mFT0Best = 0.0; //< best info for collision time
118+
float mFT0BestRes = 200.0; //< resolution (in ps) of the best info for collision time
119+
120+
ClassDefNV(MatchInfoTOF, 9);
110121
};
111122
} // namespace dataformats
112123
} // namespace o2

Detectors/CTF/test/test_ctf_io_cpv.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <TRandom.h>
2929
#include <TStopwatch.h>
3030
#include <TSystem.h>
31+
#include <TMath.h>
3132
#include <cstring>
3233

3334
using namespace o2::cpv;

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,8 @@ void MatchTOF::doMatchingForTPC(int sec)
15811581
//______________________________________________
15821582
int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit)
15831583
{
1584+
const auto& FT0Params = o2::ft0::InteractionTag::Instance();
1585+
15841586
if ((!mHasFillScheme) && o2::tof::Utils::hasFillScheme()) {
15851587
mHasFillScheme = true;
15861588
for (int ibc = 0; ibc < o2::tof::Utils::getNinteractionBC(); ibc++) {
@@ -1598,6 +1600,10 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI
15981600
const int distThr = 8;
15991601

16001602
for (unsigned int i = 0; i < FITRecPoints.size(); i++) {
1603+
const auto& ft = FITRecPoints[i];
1604+
if (!FT0Params.isSelected(ft)) {
1605+
continue;
1606+
}
16011607
const o2::InteractionRecord ir = FITRecPoints[i].getInteractionRecord();
16021608
if (mHasFillScheme && !mFillScheme[ir.bc]) {
16031609
continue;
@@ -1702,8 +1708,8 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17021708
matchingPair.setT0true(TOFClusWork[matchingPair.getTOFClIndex()].getT0true());
17031709

17041710
// let's check if cluster has multiple-hits (noferini)
1705-
if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) {
1706-
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1711+
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1712+
if (tofcl.getNumOfContributingChannels() > 1) {
17071713
// has an additional hit Up or Down (Z-dir)
17081714
matchingPair.setHitPatternUpDown(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) ||
17091715
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
@@ -1719,6 +1725,19 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17191725
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) ||
17201726
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight));
17211727
}
1728+
1729+
// estimate collision time using FT0 info if available
1730+
ULong64_t bclongtofCal = (matchingPair.getSignal() - 10000) * o2::tof::Geo::BC_TIME_INPS_INV;
1731+
double t0Best = bclongtofCal * o2::tof::Geo::BC_TIME_INPS; // here just BC
1732+
float t0BestRes = 200;
1733+
if (FITRecPoints.size() > 0) {
1734+
int index = findFITIndex(bclongtofCal, FITRecPoints, mFirstTForbit);
1735+
if (index > -1 && FITRecPoints[index].isValidTime(1) && FITRecPoints[index].isValidTime(2)) { // require A and C
1736+
t0Best += FITRecPoints[index].getCollisionTime(0);
1737+
t0BestRes = 15;
1738+
}
1739+
}
1740+
matchingPair.setFT0Best(t0Best, t0BestRes);
17221741
matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF
17231742

17241743
// get fit info

Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
114114
}
115115
}
116116

117-
if (!writecalib) {
118-
useFIT = false;
119-
}
117+
// if (!writecalib) {
118+
// useFIT = false;
119+
// }
120120

121121
LOG(debug) << "TOF MATCHER WORKFLOW configuration";
122122
LOG(debug) << "TOF track inputs = " << configcontext.options().get<std::string>("track-sources");

Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-residual-aggregator.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@
1414
#include "TPCInterpolationWorkflow/TPCResidualAggregatorSpec.h"
1515
#include "TPCInterpolationWorkflow/TPCUnbinnedResidualReaderSpec.h"
1616
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
17+
#include "DetectorsRaw/HBFUtilsInitializer.h"
18+
#include "Framework/CallbacksPolicy.h"
1719

1820
using namespace o2::framework;
1921
using GID = o2::dataformats::GlobalTrackID;
2022

23+
void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
24+
{
25+
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
26+
}
27+
2128
// we need to add workflow options before including Framework/runDataProcessing
2229
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2330
{
@@ -27,6 +34,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2734
{"enable-ctp", VariantType::Bool, false, {"Subscribe to lumi info from CTP"}},
2835
{"disable-root-input", VariantType::Bool, false, {"disable root-files input readers"}},
2936
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
37+
o2::raw::HBFUtilsInitializer::addConfigOption(options);
3038
std::swap(workflowOptions, options);
3139
}
3240

@@ -79,5 +87,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
7987
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, maskClusters, maskNone, maskNone, false);
8088
}
8189

90+
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
91+
o2::raw::HBFUtilsInitializer hbfIni(configcontext, specs);
92+
8293
return specs;
8394
}

Detectors/ITSMFT/ITS/postprocessing/studies/src/Helpers.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include <cassert>
13+
#include <cmath>
1314

1415
// o2 includes
1516
#include "ITSStudies/Helpers.h"

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ template <int nLayers = 7>
2828
class TimeFrameGPU : public TimeFrame<nLayers>
2929
{
3030
using typename TimeFrame<nLayers>::CellSeedN;
31+
using typename TimeFrame<nLayers>::IndexTableUtilsN;
3132

3233
public:
3334
TimeFrameGPU();
@@ -36,8 +37,8 @@ class TimeFrameGPU : public TimeFrame<nLayers>
3637
/// Most relevant operations
3738
void registerHostMemory(const int);
3839
void unregisterHostMemory(const int);
39-
void initialise(const int, const TrackingParameters&, const int, IndexTableUtils* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
40-
void initDevice(IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
40+
void initialise(const int, const TrackingParameters&, const int, IndexTableUtilsN* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
41+
void initDevice(IndexTableUtilsN*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
4142
void initDeviceSAFitting();
4243
void loadIndexTableUtils(const int);
4344
void loadTrackingFrameInfoDevice(const int, const int);
@@ -98,7 +99,7 @@ class TimeFrameGPU : public TimeFrame<nLayers>
9899

99100
/// interface
100101
int getNClustersInRofSpan(const int, const int, const int) const;
101-
IndexTableUtils* getDeviceIndexTableUtils() { return mIndexTableUtilsDevice; }
102+
IndexTableUtilsN* getDeviceIndexTableUtils() { return mIndexTableUtilsDevice; }
102103
int* getDeviceROFramesClusters(const int layer) { return mROFramesClustersDevice[layer]; }
103104
auto& getTrackITSExt() { return mTrackITSExt; }
104105
Vertex* getDeviceVertices() { return mPrimaryVerticesDevice; }
@@ -165,7 +166,7 @@ class TimeFrameGPU : public TimeFrame<nLayers>
165166
std::array<int, nLayers - 3> mNNeighbours;
166167

167168
// Device pointers
168-
IndexTableUtils* mIndexTableUtilsDevice;
169+
IndexTableUtilsN* mIndexTableUtilsDevice;
169170

170171
// Hybrid pref
171172
uint8_t* mMultMaskDevice;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ namespace o2::its
2222
template <int nLayers = 7>
2323
class TrackerTraitsGPU final : public TrackerTraits<nLayers>
2424
{
25+
using typename TrackerTraits<nLayers>::IndexTableUtilsN;
26+
2527
public:
2628
TrackerTraitsGPU() = default;
2729
~TrackerTraitsGPU() final = default;
@@ -48,7 +50,7 @@ class TrackerTraitsGPU final : public TrackerTraits<nLayers>
4850
int getTFNumberOfCells() const override;
4951

5052
private:
51-
IndexTableUtils* mDeviceIndexTableUtils;
53+
IndexTableUtilsN* mDeviceIndexTableUtils;
5254
gpu::TimeFrameGPU<nLayers>* mTimeFrameGPU;
5355
};
5456

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ template <int>
2727
class CellSeed;
2828
class TrackingFrameInfo;
2929
class Tracklet;
30+
template <int>
3031
class IndexTableUtils;
3132
class Cluster;
3233
class TrackITSExt;
3334
class ExternalAllocator;
3435

3536
template <int nLayers = 7>
36-
void countTrackletsInROFsHandler(const IndexTableUtils* utils,
37+
void countTrackletsInROFsHandler(const IndexTableUtils<nLayers>* utils,
3738
const uint8_t* multMask,
3839
const int layer,
3940
const int startROF,
@@ -66,7 +67,7 @@ void countTrackletsInROFsHandler(const IndexTableUtils* utils,
6667
gpu::Streams& streams);
6768

6869
template <int nLayers = 7>
69-
void computeTrackletsInROFsHandler(const IndexTableUtils* utils,
70+
void computeTrackletsInROFsHandler(const IndexTableUtils<nLayers>* utils,
7071
const uint8_t* multMask,
7172
const int layer,
7273
const int startROF,

0 commit comments

Comments
 (0)