Newer
Older

lintao@ihep.ac.cn
committed
#include "DetSimInterface/CommonUserEventInfo.hh"

lintao@ihep.ac.cn
committed
CommonUserEventInfo::CommonUserEventInfo() {
}
CommonUserEventInfo::~CommonUserEventInfo() {
}
void
CommonUserEventInfo::Print() const {
}
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
bool
CommonUserEventInfo::setIdxG4Track2Edm4hep(int idxG4, int idxEdm4hep) {
auto it = m_g4track_to_edm4hep.find(idxG4);
// if already exists, return false
if (it != m_g4track_to_edm4hep.end()) {
return false;
}
m_g4track_to_edm4hep[idxG4] = idxEdm4hep;
return true;
}
int
CommonUserEventInfo::idxG4Track2Edm4hep(int idxG4) const {
int ret = -1;
auto it = m_g4track_to_edm4hep.find(idxG4);
// if found
if (it != m_g4track_to_edm4hep.end()) {
ret = it->second;
}
return ret;
}
void
CommonUserEventInfo::dumpIdxG4Track2Edm4hep() const {
std::cout << "---- Dumping IdxG4Track2Edm4hep: "
<< " total size: " << m_g4track_to_edm4hep.size()
<< std::endl;
for (auto [idxG4, idxE4]: m_g4track_to_edm4hep) {
std::cout << " - " << idxG4 << " -> " << idxE4 << std::endl;
}
}