File indexing completed on 2025-01-18 09:55:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDDIGI_DIGISTOREDUMP_H
0014 #define DDDIGI_DIGISTOREDUMP_H
0015
0016
0017 #include <DDDigi/DigiEventAction.h>
0018
0019
0020 #include <mutex>
0021
0022
0023 namespace dd4hep {
0024
0025
0026 namespace digi {
0027
0028
0029 class DigiEvent;
0030 class DataSegment;
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 class DigiStoreDump : public DigiEventAction {
0042 protected:
0043
0044 bool m_dump_history { false };
0045
0046 std::vector<std::string> m_segments { };
0047 std::vector<std::string> m_containers { };
0048 std::vector<int> m_masks { };
0049 std::vector<Key::itemkey_type> m_container_items { };
0050
0051 using records_t = std::vector<std::string>;
0052
0053 protected:
0054
0055 DDDIGI_DEFINE_ACTION_CONSTRUCTORS(DigiStoreDump);
0056
0057
0058 virtual ~DigiStoreDump();
0059
0060 template <typename T> std::string data_header(Key key, const std::string& tag, const T& data) const;
0061 template <typename T> records_t dump_history(context_t& context, Key key, const T& container) const;
0062 template <typename T> records_t dump_history(context_t& context, Key key, const T& item, std::size_t seq_no) const;
0063 template <typename T> records_t dump_deposit_history(context_t& context, Key container_key, const T& container) const;
0064
0065 records_t
0066 dump_particle_history(context_t& context, Key container_key, const ParticleMapping& container) const;
0067
0068
0069 void dump_headers(const std::string& tag, const DigiEvent& event, const DataSegment& segment) const;
0070
0071
0072 void dump_history(context_t& context, const std::string& tag, const DigiEvent& event, const DataSegment& cont) const;
0073
0074
0075 virtual void initialize();
0076
0077 public:
0078
0079 DigiStoreDump(const DigiKernel& kernel, const std::string& nam);
0080
0081 virtual void execute(context_t& context) const;
0082 };
0083 }
0084 }
0085 #endif