CMS 3D CMS Logo

ProcessHistoryRegistry.cc
Go to the documentation of this file.
3 
4 #include <cassert>
5 namespace edm {
7  // insert the mapping for an empty process history
8  extra_.insert(std::pair<ProcessHistoryID, ProcessHistoryID>(ProcessHistory().id(), ProcessHistory().reduce().id()));
9  }
10 
11  bool
13  //make sure the process history ID is cached
14  auto tmp = processHistory;
15  ProcessHistoryID id = tmp.setProcessHistoryID();
16  bool newlyAdded = (data_.find(id) == data_.end());
17  if(newlyAdded) {
18  data_.emplace(id, tmp);
19  extra_.emplace(std::move(id), tmp.reduce().id());
20  }
21  return newlyAdded;
22  }
23 
24  ProcessHistoryID const&
26  auto const& iter = extra_.find(fullID);
27  assert(iter != extra_.end());
28  return iter->second;
29  }
30 
31  bool
33  auto const& iter = data_.find(key);
34  bool found = (iter != data_.end());
35  if(found) {
36  value = iter->second;
37  }
38  return found;
39  }
40 
41  ProcessHistory const*
43  auto const& iter = data_.find(key);
44  if(iter == data_.end()) {
45  return nullptr;
46  }
47  return &iter->second;
48  }
49 }
bool getMapped(ProcessHistoryID const &key, ProcessHistory &value) const
bool registerProcessHistory(ProcessHistory const &processHistory)
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
Definition: value.py:1
std::map< ProcessHistoryID, ProcessHistoryID > extra_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HLT enums.
def move(src, dest)
Definition: eostools.py:511