LDMX Software
CascadeHistoryStore.h
Go to the documentation of this file.
1
6#ifndef SIMCORE_BERTINI_CASCADEHISTORYSTORE_H
7#define SIMCORE_BERTINI_CASCADEHISTORYSTORE_H
8
9#include <map>
10
12
13namespace simcore {
14namespace bertini {
15
25 public:
26 static CascadeHistoryStore& getInstance();
27
28 void clear() { histories_.clear(); }
29 void addHistory(int trackId, ldmx::CascadeHistory history);
30 bool empty() const { return histories_.empty(); }
31 size_t size() const { return histories_.size(); }
32
33 const std::map<int, ldmx::CascadeHistory>& getHistories() const {
34 return histories_;
35 }
36
38 std::map<int, ldmx::CascadeHistory> extractHistories();
39
40 bool hasHistory(int trackId) const {
41 return histories_.find(trackId) != histories_.end();
42 }
43
44 const ldmx::CascadeHistory* getHistory(int trackId) const;
45
46 private:
47 CascadeHistoryStore() = default;
48 ~CascadeHistoryStore() = default;
50 CascadeHistoryStore& operator=(const CascadeHistoryStore&) = delete;
51
52 std::map<int, ldmx::CascadeHistory> histories_;
53};
54
55} // namespace bertini
56} // namespace simcore
57
58#endif // SIMCORE_BERTINI_CASCADEHISTORYSTORE_H
Container for the complete history of a Bertini intranuclear cascade.
All CascadeSteps from a single photonuclear interaction.
Thread-local singleton for cascade histories during simulation.
std::map< int, ldmx::CascadeHistory > extractHistories()
Moves histories out and clears store.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...