Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:54:43

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file accel/detail/GeantSimpleCaloStorage.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <string>
0011 #include <unordered_map>
0012 #include <vector>
0013 
0014 #include "corecel/Types.hh"
0015 #include "corecel/cont/Array.hh"
0016 
0017 class G4LogicalVolume;
0018 
0019 namespace celeritas
0020 {
0021 namespace detail
0022 {
0023 //---------------------------------------------------------------------------//
0024 /*!
0025  * Shared storage for a single GeantSimpleCalo.
0026  *
0027  * This is created by the \c GeantSimpleCalo and passed to all the \c
0028  * G4VSensitiveDetector instances (one for each thread) for the calo.
0029  */
0030 struct GeantSimpleCaloStorage
0031 {
0032     using VecReal = std::vector<double>;
0033     using VecVecReal = std::vector<VecReal>;
0034     using MapVolumeIdx = std::unordered_map<G4LogicalVolume*, size_type>;
0035 
0036     //! SD name
0037     std::string name;
0038     //! Number of threads
0039     size_type num_threads{};
0040     //! Map of logical volume to "detector ID" index
0041     MapVolumeIdx volume_to_index;
0042     //! Accumulated energy deposition [thread][volume]
0043     VecVecReal data;
0044 };
0045 
0046 //---------------------------------------------------------------------------//
0047 }  // namespace detail
0048 }  // namespace celeritas