Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-07 10:01:47

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 celeritas/user/SDData.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include "corecel/Macros.hh"
0010 #include "corecel/data/Collection.hh"
0011 #include "corecel/data/CollectionBuilder.hh"
0012 #include "celeritas/Quantities.hh"
0013 #include "celeritas/Types.hh"
0014 
0015 namespace celeritas
0016 {
0017 template<Ownership W, MemSpace M>
0018 struct SDParamsData
0019 {
0020     //// DATA ////
0021 
0022     //! Mapping for volume -> sensitive detector
0023     Collection<DetectorId, W, M, VolumeId> detector;
0024 
0025     //! Whether the data is assigned
0026     explicit CELER_FUNCTION operator bool() const { return !detector.empty(); }
0027 
0028     //! Assign from another set of data
0029     template<Ownership W2, MemSpace M2>
0030     SDParamsData& operator=(SDParamsData<W2, M2> const& other)
0031     {
0032         CELER_EXPECT(other);
0033         detector = other.detector;
0034         return *this;
0035     }
0036 };
0037 
0038 //---------------------------------------------------------------------------//
0039 }  // namespace celeritas