Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:41:59

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Clusterization/TimedClusterization.hpp"
0012 
0013 namespace Acts::Ccl {
0014 
0015 template <Acts::Ccl::HasRetrievableTimeInfo Cell, std::size_t N>
0016 TimedConnect<Cell, N>::TimedConnect(double time) : timeTolerance(time) {}
0017 
0018 template <Acts::Ccl::HasRetrievableTimeInfo Cell, std::size_t N>
0019 TimedConnect<Cell, N>::TimedConnect(double time, bool commonCorner)
0020   requires(N == 2)
0021     : Acts::Ccl::DefaultConnect<Cell, N>(commonCorner), timeTolerance(time) {}
0022 
0023 template <Acts::Ccl::HasRetrievableTimeInfo Cell, std::size_t N>
0024 Acts::Ccl::ConnectResult TimedConnect<Cell, N>::operator()(
0025     const Cell& ref, const Cell& iter) const {
0026   Acts::Ccl::ConnectResult spaceCompatibility =
0027       Acts::Ccl::DefaultConnect<Cell, N>::operator()(ref, iter);
0028   if (spaceCompatibility != Acts::Ccl::ConnectResult::eConn) {
0029     return spaceCompatibility;
0030   }
0031 
0032   if (std::abs(getCellTime(ref) - getCellTime(iter)) < timeTolerance) {
0033     return Acts::Ccl::ConnectResult::eConn;
0034   }
0035 
0036   return Acts::Ccl::ConnectResult::eNoConn;
0037 }
0038 
0039 }  // namespace Acts::Ccl