CMS 3D CMS Logo

HistoryAppender.cc
Go to the documentation of this file.
4 
5 #include <string>
6 #include <cassert>
7 
8 namespace {
9  edm::ProcessHistory initializeEmpty() {
11  tmp.setProcessHistoryID();
12  return tmp;
13  }
14 } // namespace
15 static const edm::ProcessHistory s_emptyHistory = initializeEmpty();
16 
17 namespace edm {
18 
20 
21  std::shared_ptr<ProcessHistory const> HistoryAppender::appendToProcessHistory(
22  ProcessHistoryID const& inputPHID, ProcessHistory const* iInputProcessHistory, ProcessConfiguration const& pc) {
23  assert((iInputProcessHistory) == nullptr or (inputPHID == iInputProcessHistory->id()));
24  if (m_cachedHistory.get() != nullptr and inputPHID == m_cachedInputPHID) {
25  return m_cachedHistory;
26  }
27 
28  ProcessHistory const* inputProcessHistory = iInputProcessHistory ? iInputProcessHistory : &s_emptyHistory;
29 
30  if (inputPHID.isValid()) {
31  if (iInputProcessHistory == nullptr) {
32  throw Exception(errors::LogicError) << "HistoryAppender::appendToProcessHistory\n"
33  << "Input ProcessHistory has valid ID but is nullptr\n"
34  << "Contact a Framework developer\n";
35  }
36  }
37 
38  auto newProcessHistory = std::make_shared<ProcessHistory>();
39  *newProcessHistory = *inputProcessHistory;
40  checkProcessHistory(*newProcessHistory, pc);
41  newProcessHistory->push_back(pc);
42  //force it to create the ID
43  newProcessHistory->setProcessHistoryID();
44  m_cachedInputPHID = inputPHID;
45  m_cachedHistory = newProcessHistory;
46  return m_cachedHistory;
47  }
48 
50  std::string const& processName = pc.processName();
51  for (auto const& process : ph) {
52  if (processName == process.processName()) {
53  throw edm::Exception(errors::Configuration, "Duplicate Process.")
54  << "The process name " << processName << " was already in the ProcessHistory.\n"
55  << "Please modify the configuration file to use a distinct process name.\n";
56  }
57  }
58  }
59 } // namespace edm
edm::errors::LogicError
Definition: EDMException.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::HistoryAppender::checkProcessHistory
void checkProcessHistory(ProcessHistory const &ph, ProcessConfiguration const &pc) const
Definition: HistoryAppender.cc:49
edm::ProcessHistory::id
ProcessHistoryID id() const
Definition: ProcessHistory.cc:10
cms::cuda::assert
assert(be >=bs)
edm::HistoryAppender::HistoryAppender
HistoryAppender()
Definition: HistoryAppender.cc:19
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
EDMException.h
edm::HistoryAppender::m_cachedHistory
std::shared_ptr< ProcessHistory const > m_cachedHistory
Definition: HistoryAppender.h:32
ProcessConfiguration.h
edm::Hash< ProcessHistoryType >
edm::ProcessConfiguration::processName
std::string const & processName() const
Definition: ProcessConfiguration.h:24
HistoryAppender.h
s_emptyHistory
static const edm::ProcessHistory s_emptyHistory
Definition: HistoryAppender.cc:15
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::HistoryAppender::appendToProcessHistory
std::shared_ptr< ProcessHistory const > appendToProcessHistory(ProcessHistoryID const &inputPHID, ProcessHistory const *inputProcessHistory, ProcessConfiguration const &pc)
Definition: HistoryAppender.cc:21
Exception
Definition: hltDiff.cc:245
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ProcessHistory
Definition: ProcessHistory.h:13
edm::HistoryAppender::m_cachedInputPHID
ProcessHistoryID m_cachedInputPHID
Definition: HistoryAppender.h:31
edm::errors::Configuration
Definition: EDMException.h:36
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14