Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:33:02

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 accel/detail/GeantSimpleCaloStorage.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <string>
0010 #include <unordered_map>
0011 #include <vector>
0012 
0013 #include "corecel/Types.hh"
0014 #include "corecel/cont/Array.hh"
0015 
0016 class G4LogicalVolume;
0017 
0018 namespace celeritas
0019 {
0020 namespace detail
0021 {
0022 //---------------------------------------------------------------------------//
0023 /*!
0024  * Shared storage for a single GeantSimpleCalo.
0025  *
0026  * This is created by the \c GeantSimpleCalo and passed to all the \c
0027  * G4VSensitiveDetector instances (one for each thread) for the calo.
0028  */
0029 struct GeantSimpleCaloStorage
0030 {
0031     using VecReal = std::vector<double>;
0032     using VecVecReal = std::vector<VecReal>;
0033     using MapVolumeIdx = std::unordered_map<G4LogicalVolume*, size_type>;
0034 
0035     //! SD name
0036     std::string name;
0037     //! Number of threads
0038     size_type num_threads{};
0039     //! Map of logical volume to "detector ID" index
0040     MapVolumeIdx volume_to_index;
0041     //! Accumulated energy deposition [thread][volume]
0042     VecVecReal data;
0043 };
0044 
0045 //---------------------------------------------------------------------------//
0046 }  // namespace detail
0047 }  // namespace celeritas