Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-29 09:13:53

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file geocel/DetectorData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/data/Collection.hh"
0011 #include "geocel/Types.hh"
0012 
0013 namespace celeritas
0014 {
0015 //---------------------------------------------------------------------------//
0016 //! Sensitive detector mapping for geometry
0017 template<Ownership W, MemSpace M>
0018 struct DetectorParamsData
0019 {
0020     template<class T>
0021     using VolumeItems = Collection<T, W, M, VolumeId>;
0022 
0023     //// DATA ////
0024 
0025     //! Map volume -> sensitive detector
0026     VolumeItems<DetectorId> detector_ids;
0027 
0028     //! Whether the data is assigned
0029     explicit CELER_FUNCTION operator bool() const
0030     {
0031         return !detector_ids.empty();
0032     }
0033 
0034     //! Assign from another set of data
0035     template<Ownership W2, MemSpace M2>
0036     DetectorParamsData& operator=(DetectorParamsData<W2, M2> const& other)
0037     {
0038         CELER_EXPECT(other);
0039         detector_ids = other.detector_ids;
0040         return *this;
0041     }
0042 };
0043 
0044 //---------------------------------------------------------------------------//
0045 }  // namespace celeritas