@@ -32,7 +32,6 @@ o2::itsmft::tracking::DecodedCluster decodeCluster(
3232 gsl::span<const unsigned char >::iterator& patterns,
3333 const o2::itsmft::TopologyDictionary* dict)
3434{
35- o2::itsmft::tracking::DecodedCluster result;
3635 if (dict == nullptr ) {
3736 throw std::runtime_error (" Cluster dictionary is not available" );
3837 }
@@ -57,19 +56,18 @@ o2::itsmft::tracking::DecodedCluster decodeCluster(
5756 if constexpr (DetId == o2::detectors::DetID::ITS ) {
5857 const auto trkXYZ = geom->getMatrixT2L (sensorID) ^ clusterData.coordinates ;
5958 const auto gloXYZ = geom->getMatrixL2G (sensorID) * clusterData.coordinates ;
60- result = {{gloXYZ.x (), gloXYZ.y (), gloXYZ.z ()},
61- {trkXYZ.x (), trkXYZ.y (), trkXYZ.z (), geom->getSensorRefAlpha (sensorID)},
62- {sigma2Row, 0 .f , sigma2Col},
63- clusterData.nPixels ,
64- layer};
59+ return {{gloXYZ.x (), gloXYZ.y (), gloXYZ.z ()},
60+ {trkXYZ.x (), trkXYZ.y (), trkXYZ.z (), geom->getSensorRefAlpha (sensorID)},
61+ {sigma2Row, 0 .f , sigma2Col},
62+ clusterData.nPixels ,
63+ layer};
6564 } else {
6665 if (!geom->getCacheL2G ().isFilled () || geom->getCacheL2G ().getSize () <= sensorID) {
6766 throw std::runtime_error (" Cluster geometry is not available" );
6867 }
6968 const auto gloXYZ = geom->getMatrixL2G (sensorID) * clusterData.coordinates ;
70- result = {{gloXYZ.x (), gloXYZ.y (), gloXYZ.z ()}, {}, {sigma2Row, 0 .f , sigma2Col}, clusterData.nPixels , layer};
69+ return {{gloXYZ.x (), gloXYZ.y (), gloXYZ.z ()}, {}, {sigma2Row, 0 .f , sigma2Col}, clusterData.nPixels , layer};
7170 }
72- return result;
7371}
7472
7573template <o2::detectors::DetID::ID DetId, typename Consume>
@@ -108,8 +106,8 @@ GlobalMeasurement makeCylinderGlobalMeasurement(const DecodedCluster& decoded, u
108106 cosine * cosine * covariance.uu ,
109107 cosine * covariance.uv ,
110108 covariance.vv },
111- std::hypot (decoded. global . x , decoded. global . y ),
112- std::atan2 (decoded. global . y , decoded. global . x ) ,
109+ 0 . f , // Radius and phi are computed after subtracting the beam position.
110+ 0 . f ,
113111 clusterId};
114112}
115113
@@ -124,8 +122,8 @@ GlobalMeasurement makeDiskGlobalMeasurement(const DecodedCluster& decoded, uint3
124122 decoded.global .z ,
125123 {decoded.rowColumnCovariance .uu , decoded.rowColumnCovariance .uv , 0 .f ,
126124 decoded.rowColumnCovariance .vv , 0 .f , 0 .f },
127- std::hypot (decoded. global . x , decoded. global . y ),
128- std::atan2 (decoded. global . y , decoded. global . x ) ,
125+ 0 . f , // Radius and phi are computed after subtracting the beam position.
126+ 0 . f ,
129127 clusterId};
130128}
131129
@@ -181,7 +179,7 @@ bool globalCovarianceIsPositiveSemidefinite(const GlobalCovariance3F& covariance
181179bool decodedMeasurementIsValid (const GlobalMeasurement& global,
182180 const SurfaceMeasurement& local) noexcept
183181{
184- return globalCovarianceIsPositiveSemidefinite (global.covariance ) &
182+ return globalCovarianceIsPositiveSemidefinite (global.covariance ) &&
185183 covariance2DIsPositiveSemidefinite (local.covariance .uu , local.covariance .uv , local.covariance .vv );
186184}
187185
@@ -264,11 +262,8 @@ void prepareSources(TimeFrame& frame, const SurfaceCatalogView& catalog,
264262 throw std::runtime_error (std::format (" Invalid source-to-surface layer mapping source={}" , owner.value ()));
265263 }
266264 }
267- if (!sources.empty ()) {
268- frame.setROFViews (sources.front ().rofViews );
269- }
270265}
271- void validateSource (const ClusterSourceInput& src, const o2::InteractionRecord& origin )
266+ void validateClusterRanges (const ClusterSourceInput& src)
272267{
273268 int64_t expectedNext = 0 ;
274269 for (uint32_t r = 0 ; r < src.rofs .size (); ++r) {
@@ -286,13 +281,6 @@ void validateSource(const ClusterSourceInput& src, const o2::InteractionRecord&
286281 if (expectedNext != static_cast <int64_t >(src.clusters .size ())) {
287282 throw std::runtime_error (std::format (" Invalid ROF cluster range source={} rof={}" , src.id .value (), static_cast <uint32_t >(src.rofs .size ())));
288283 }
289-
290- for (uint32_t r = 0 ; r < src.rofs .size (); ++r) {
291- const auto built = computeROFIntervalBC (src.rofs [r].getBCData (), origin, src.timing , r);
292- if (!built.ok ()) {
293- throw std::runtime_error (std::format (" Invalid ROF timing: source={} rof={} timingError={}" , src.id .value (), r, static_cast <int >(built.error )));
294- }
295- }
296284}
297285void appendCluster (TimeFrame& frame, const SurfaceCatalogView& catalog,
298286 const ClusterSourceInput& src, const DecodedCluster& decoded,
@@ -337,17 +325,17 @@ void appendCluster(TimeFrame& frame, const SurfaceCatalogView& catalog,
337325 clusterSizes[expectedSurface.value ()].push_back (decoded.nPixels );
338326 externalIndices[expectedSurface.value ()].push_back (externalIndex);
339327}
340- void bindSourceROFNavigation (TimeFrame& frame, const ClusterSourceInput& source,
341- const std::vector<std::vector<int >>& boundaries)
328+ void storeSourceROFClusters (TimeFrame& frame, const ClusterSourceInput& source,
329+ const std::vector<std::vector<int >>& boundaries)
342330{
343331 for (uint16_t layer = 0 ; layer < source.layerToSurface .size (); ++layer) {
344- frame.setROFNavigation (source.layerToSurface [layer].value (), boundaries[layer], source. rofViews , layer );
332+ frame.setROFClusters (source.layerToSurface [layer].value (), boundaries[layer]);
345333 }
346334}
347335} // namespace detail
348336
349337void loadTimeFrameSources (TimeFrame& frame, gsl::span<const ClusterSourceInput> sources,
350- SurfaceCatalogView catalog, const o2::InteractionRecord& origin,
338+ SurfaceCatalogView catalog,
351339 std::vector<std::vector<uint32_t >>* externalIndicesBySurface,
352340 std::vector<std::vector<uint32_t >>* clusterSizesBySurface)
353341{
@@ -356,7 +344,7 @@ void loadTimeFrameSources(TimeFrame& frame, gsl::span<const ClusterSourceInput>
356344 std::vector<std::vector<uint32_t >> clusterSizes (catalog.nSurfaces );
357345 bool hasMCInformation = false ;
358346 for (const auto & source : sources) {
359- detail::validateSource (source, origin );
347+ detail::validateClusterRanges (source);
360348 const auto load = [&](const auto & decode) {
361349 detail::loadDecodedSource (frame, catalog, source, decode, externalIndices, clusterSizes);
362350 };
0 commit comments