![]() |
|
|||
File indexing completed on 2025-09-18 09:09:06
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/io/EventData.hh 0006 //---------------------------------------------------------------------------// 0007 #pragma once 0008 0009 #include <array> 0010 #include <map> 0011 #include <vector> 0012 0013 namespace celeritas 0014 { 0015 //---------------------------------------------------------------------------// 0016 /*! 0017 * Example of a calorimeter hit. 0018 */ 0019 struct EventHitData 0020 { 0021 int volume{0}; //!< Logical volume ID 0022 int copy_num{0}; //!< Physical volume copy number 0023 double energy_dep{0}; //!< Energy deposition [MeV] 0024 double time{0}; //!< Pre-step global time [time] 0025 }; 0026 0027 //---------------------------------------------------------------------------// 0028 /*! 0029 * Event data to be used within a Geant4/Celeritas offloading application. 0030 * 0031 * The hits are designed to be assigned to each sensitive volume, so that a 0032 * vector of hits of a given volume can be retrieved by doing 0033 * 0034 * \code 0035 * auto const& sd_hits = event_data.hits[sensdet_id]; 0036 * for (auto const& hit : sd_hits) 0037 * { 0038 * // Access hit information from this given detector in this event. 0039 * } 0040 * \endcode 0041 * 0042 * Therefore, sensitive detector IDs must be contiguously assigned and mapped 0043 * to their sensitive detector name at startup. 0044 */ 0045 struct EventData 0046 { 0047 int event_id{0}; 0048 std::vector<std::vector<EventHitData>> hits; 0049 }; 0050 0051 //---------------------------------------------------------------------------// 0052 } // namespace celeritas
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |