CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
edm::PrincipalCache Class Reference

#include <PrincipalCache.h>

Public Member Functions

void adjustEventToNewProductRegistry (boost::shared_ptr< ProductRegistry const > reg)
 
void adjustIndexesAfterProductRegistryAddition ()
 
void deleteLowestLumi ()
 
void deleteLowestRun ()
 
void deleteLumi (ProcessHistoryID const &phid, int run, int lumi)
 
void deleteRun (ProcessHistoryID const &phid, int run)
 
EventPrincipaleventPrincipal ()
 
EventPrincipal const & eventPrincipal () const
 
bool insert (boost::shared_ptr< RunPrincipal > rp)
 
bool insert (boost::shared_ptr< LuminosityBlockPrincipal > lbp)
 
void insert (boost::shared_ptr< EventPrincipal > ep)
 
LuminosityBlockPrincipal const & lowestLumi () const
 
RunPrincipal const & lowestRun () const
 
LuminosityBlockPrincipallumiPrincipal (ProcessHistoryID const &phid, int run, int lumi)
 
LuminosityBlockPrincipal const & lumiPrincipal (ProcessHistoryID const &phid, int run, int lumi) const
 
LuminosityBlockPrincipallumiPrincipal ()
 
LuminosityBlockPrincipal const & lumiPrincipal () const
 
boost::shared_ptr
< LuminosityBlockPrincipal
lumiPrincipalPtr (ProcessHistoryID const &phid, int run, int lumi)
 
boost::shared_ptr
< LuminosityBlockPrincipal
lumiPrincipalPtr ()
 
bool merge (boost::shared_ptr< RunAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
 
bool merge (boost::shared_ptr< LuminosityBlockAuxiliary > aux, boost::shared_ptr< ProductRegistry const > reg)
 
bool noMoreLumis ()
 
bool noMoreRuns ()
 
 PrincipalCache ()
 
RunPrincipalrunPrincipal (ProcessHistoryID const &phid, int run)
 
RunPrincipal const & runPrincipal (ProcessHistoryID const &phid, int run) const
 
RunPrincipalrunPrincipal ()
 
RunPrincipal const & runPrincipal () const
 
boost::shared_ptr< RunPrincipalrunPrincipalPtr (ProcessHistoryID const &phid, int run)
 
boost::shared_ptr< RunPrincipalrunPrincipalPtr ()
 
 ~PrincipalCache ()
 

Private Types

typedef std::map< LumiKey,
boost::shared_ptr
< LuminosityBlockPrincipal >
>::const_iterator 
ConstLumiIterator
 
typedef std::map< RunKey,
boost::shared_ptr
< RunPrincipal >
>::const_iterator 
ConstRunIterator
 
typedef std::map< LumiKey,
boost::shared_ptr
< LuminosityBlockPrincipal >
>::iterator 
LumiIterator
 
typedef std::map< RunKey,
boost::shared_ptr
< RunPrincipal > >::iterator 
RunIterator
 

Private Attributes

boost::shared_ptr
< LuminosityBlockPrincipal
currentLumiPrincipal_
 
boost::shared_ptr< RunPrincipalcurrentRunPrincipal_
 
boost::shared_ptr< EventPrincipaleventPrincipal_
 
std::map< LumiKey,
boost::shared_ptr
< LuminosityBlockPrincipal > > 
lumiPrincipals_
 
std::vector< ProcessHistoryIDprocessHistoryIDs_
 
std::map< ProcessHistoryID, int > processHistoryIDsMap_
 
std::map< RunKey,
boost::shared_ptr
< RunPrincipal > > 
runPrincipals_
 

Detailed Description

Definition at line 64 of file PrincipalCache.h.

Member Typedef Documentation

typedef std::map<LumiKey, boost::shared_ptr<LuminosityBlockPrincipal> >::const_iterator edm::PrincipalCache::ConstLumiIterator
private

Definition at line 123 of file PrincipalCache.h.

typedef std::map<RunKey, boost::shared_ptr<RunPrincipal> >::const_iterator edm::PrincipalCache::ConstRunIterator
private

Definition at line 121 of file PrincipalCache.h.

typedef std::map<LumiKey, boost::shared_ptr<LuminosityBlockPrincipal> >::iterator edm::PrincipalCache::LumiIterator
private

Definition at line 122 of file PrincipalCache.h.

typedef std::map<RunKey, boost::shared_ptr<RunPrincipal> >::iterator edm::PrincipalCache::RunIterator
private

Definition at line 120 of file PrincipalCache.h.

Constructor & Destructor Documentation

edm::PrincipalCache::PrincipalCache ( )

Definition at line 9 of file PrincipalCache.cc.

9 { }
edm::PrincipalCache::~PrincipalCache ( )

Definition at line 11 of file PrincipalCache.cc.

11 { }

Member Function Documentation

void edm::PrincipalCache::adjustEventToNewProductRegistry ( boost::shared_ptr< ProductRegistry const >  reg)

Definition at line 281 of file PrincipalCache.cc.

References eventPrincipal_.

Referenced by edm::StreamerInputSource::deserializeAndMergeWithRegistry(), edm::RootInputFileSequence::nextFile(), and edm::RootInputFileSequence::previousFile().

281  {
282  if (eventPrincipal_) {
283  eventPrincipal_->adjustIndexesAfterProductRegistryAddition();
284  bool eventOK = eventPrincipal_->adjustToNewProductRegistry(*reg);
285  assert(eventOK);
286  }
287  }
boost::shared_ptr< EventPrincipal > eventPrincipal_
void edm::PrincipalCache::adjustIndexesAfterProductRegistryAddition ( )

Definition at line 289 of file PrincipalCache.cc.

References lumiPrincipals_, and runPrincipals_.

Referenced by edm::RootInputFileSequence::nextFile(), and edm::RootInputFileSequence::previousFile().

289  {
290  for (ConstRunIterator it = runPrincipals_.begin(), itEnd = runPrincipals_.end(); it != itEnd; ++it) {
291  it->second->adjustIndexesAfterProductRegistryAddition();
292  }
293  for (ConstLumiIterator it = lumiPrincipals_.begin(), itEnd = lumiPrincipals_.end(); it != itEnd; ++it) {
294  it->second->adjustIndexesAfterProductRegistryAddition();
295  }
296  }
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::const_iterator ConstRunIterator
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::const_iterator ConstLumiIterator
void edm::PrincipalCache::deleteLowestLumi ( )

Definition at line 263 of file PrincipalCache.cc.

References lumiPrincipals_.

263  {
264  lumiPrincipals_.erase(lumiPrincipals_.begin());
265  }
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
void edm::PrincipalCache::deleteLowestRun ( )

Definition at line 259 of file PrincipalCache.cc.

References runPrincipals_.

259  {
260  runPrincipals_.erase(runPrincipals_.begin());
261  }
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
void edm::PrincipalCache::deleteLumi ( ProcessHistoryID const &  phid,
int  run,
int  lumi 
)

Definition at line 274 of file PrincipalCache.cc.

References combine::key, lumiPrincipals_, and processHistoryIDsMap_.

Referenced by edm::EventProcessor::deleteLumiFromCache().

274  {
275  LumiKey key(processHistoryIDsMap_[phid], run, lumi);
276  LumiIterator iter = lumiPrincipals_.find(key);
277  assert(iter != lumiPrincipals_.end());
278  lumiPrincipals_.erase(iter);
279  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::iterator LumiIterator
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
list key
Definition: combine.py:13
void edm::PrincipalCache::deleteRun ( ProcessHistoryID const &  phid,
int  run 
)

Definition at line 267 of file PrincipalCache.cc.

References combine::key, processHistoryIDsMap_, and runPrincipals_.

Referenced by edm::EventProcessor::deleteRunFromCache().

267  {
268  RunKey key(processHistoryIDsMap_[phid], run);
269  RunIterator iter = runPrincipals_.find(key);
270  assert(iter != runPrincipals_.end());
271  runPrincipals_.erase(iter);
272  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::iterator RunIterator
list key
Definition: combine.py:13
EventPrincipal& edm::PrincipalCache::eventPrincipal ( )
inline

Definition at line 89 of file PrincipalCache.h.

References eventPrincipal_.

Referenced by edm::InputSource::eventPrincipalCache().

89 {return *eventPrincipal_;}
boost::shared_ptr< EventPrincipal > eventPrincipal_
EventPrincipal const& edm::PrincipalCache::eventPrincipal ( ) const
inline

Definition at line 90 of file PrincipalCache.h.

References eventPrincipal_.

90 {return *eventPrincipal_;}
boost::shared_ptr< EventPrincipal > eventPrincipal_
bool edm::PrincipalCache::insert ( boost::shared_ptr< RunPrincipal rp)

Definition at line 208 of file PrincipalCache.cc.

References currentRunPrincipal_, combine::key, processHistoryIDs_, processHistoryIDsMap_, CrabTask::run, and runPrincipals_.

Referenced by edm::InputSource::readAndCacheLumi(), edm::InputSource::readAndCacheRun(), and edm::EventProcessor::runCommon().

208  {
209  ProcessHistoryID phid = rp->aux().processHistoryID();
210  int run = rp->run();
211  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
212  if (iphid == processHistoryIDsMap_.end()) {
214  processHistoryIDs_.push_back(phid);
215  iphid = processHistoryIDsMap_.find(phid);
216  }
217  RunKey key(iphid->second, run);
218  assert(runPrincipals_.find(key) == runPrincipals_.end());
219  runPrincipals_[key] = rp;
221  return true;
222  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
Hash< ProcessHistoryType > ProcessHistoryID
std::vector< ProcessHistoryID > processHistoryIDs_
list key
Definition: combine.py:13
boost::shared_ptr< RunPrincipal > currentRunPrincipal_
bool edm::PrincipalCache::insert ( boost::shared_ptr< LuminosityBlockPrincipal lbp)

Definition at line 224 of file PrincipalCache.cc.

References currentLumiPrincipal_, combine::key, fjr2json::lumi, lumiPrincipals_, processHistoryIDs_, processHistoryIDsMap_, and CrabTask::run.

224  {
225  ProcessHistoryID phid = lbp->aux().processHistoryID();
226  int run = lbp->run();
227  int lumi = lbp->luminosityBlock();
228  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
229  if (iphid == processHistoryIDsMap_.end()) {
231  processHistoryIDs_.push_back(phid);
232  iphid = processHistoryIDsMap_.find(phid);
233  }
234  LumiKey key(iphid->second, run, lumi);
235  assert(lumiPrincipals_.find(key) == lumiPrincipals_.end());
236  lumiPrincipals_[key] = lbp;
237  currentLumiPrincipal_ = lbp;
238  return true;
239  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
boost::shared_ptr< LuminosityBlockPrincipal > currentLumiPrincipal_
Hash< ProcessHistoryType > ProcessHistoryID
std::vector< ProcessHistoryID > processHistoryIDs_
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
list key
Definition: combine.py:13
void edm::PrincipalCache::insert ( boost::shared_ptr< EventPrincipal ep)
inline

Definition at line 97 of file PrincipalCache.h.

References eventPrincipal_.

97 {eventPrincipal_ = ep;}
boost::shared_ptr< EventPrincipal > eventPrincipal_
LuminosityBlockPrincipal const & edm::PrincipalCache::lowestLumi ( ) const

Definition at line 254 of file PrincipalCache.cc.

References lumiPrincipals_.

254  {
255  ConstLumiIterator iter = lumiPrincipals_.begin();
256  return *iter->second.get();
257  }
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::const_iterator ConstLumiIterator
RunPrincipal const & edm::PrincipalCache::lowestRun ( ) const

Definition at line 249 of file PrincipalCache.cc.

References runPrincipals_.

249  {
250  ConstRunIterator iter = runPrincipals_.begin();
251  return *iter->second.get();
252  }
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::const_iterator ConstRunIterator
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
LuminosityBlockPrincipal & edm::PrincipalCache::lumiPrincipal ( ProcessHistoryID const &  phid,
int  run,
int  lumi 
)

Definition at line 91 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, lumiPrincipals_, and processHistoryIDsMap_.

Referenced by edm::EventProcessor::beginLumi(), edm::EventProcessor::endLumi(), edm::InputSource::markLumi(), and edm::EventProcessor::writeLumi().

91  {
92  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
93  LumiIterator iter;
94  if (iphid != processHistoryIDsMap_.end()) {
95  LumiKey key(iphid->second, run, lumi);
96  iter = lumiPrincipals_.find(key);
97  }
98  if (iphid == processHistoryIDsMap_.end() || iter == lumiPrincipals_.end()) {
100  << "PrincipalCache::lumiPrincipal\n"
101  << "Requested a lumi that is not in the cache (should never happen)\n"
102  << "Contact a Framework Developer\n";
103  }
104  return *iter->second.get();
105  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::iterator LumiIterator
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
list key
Definition: combine.py:13
LuminosityBlockPrincipal const & edm::PrincipalCache::lumiPrincipal ( ProcessHistoryID const &  phid,
int  run,
int  lumi 
) const

Definition at line 107 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, lumiPrincipals_, and processHistoryIDsMap_.

107  {
108  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
109  ConstLumiIterator iter;
110  if (iphid != processHistoryIDsMap_.end()) {
111  LumiKey key(iphid->second, run, lumi);
112  iter = lumiPrincipals_.find(key);
113  }
114  if (iphid == processHistoryIDsMap_.end() || iter == lumiPrincipals_.end()) {
116  << "PrincipalCache::lumiPrincipal\n"
117  << "Requested a lumi that is not in the cache (should never happen)\n"
118  << "Contact a Framework Developer\n";
119  }
120  return *iter->second.get();
121  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::const_iterator ConstLumiIterator
list key
Definition: combine.py:13
LuminosityBlockPrincipal & edm::PrincipalCache::lumiPrincipal ( )

Definition at line 139 of file PrincipalCache.cc.

References currentLumiPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

139  {
140  if (currentLumiPrincipal_.get() == 0) {
142  << "PrincipalCache::lumiPrincipal\n"
143  << "Requested current lumi and it is not initialized (should never happen)\n"
144  << "Contact a Framework Developer\n";
145  }
146  return *currentLumiPrincipal_.get();
147  }
boost::shared_ptr< LuminosityBlockPrincipal > currentLumiPrincipal_
LuminosityBlockPrincipal const & edm::PrincipalCache::lumiPrincipal ( ) const

Definition at line 149 of file PrincipalCache.cc.

References currentLumiPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

149  {
150  if (currentLumiPrincipal_.get() == 0) {
152  << "PrincipalCache::lumiPrincipal\n"
153  << "Requested current lumi and it is not initialized (should never happen)\n"
154  << "Contact a Framework Developer\n";
155  }
156  return *currentLumiPrincipal_.get();
157  }
boost::shared_ptr< LuminosityBlockPrincipal > currentLumiPrincipal_
boost::shared_ptr< LuminosityBlockPrincipal > edm::PrincipalCache::lumiPrincipalPtr ( ProcessHistoryID const &  phid,
int  run,
int  lumi 
)

Definition at line 123 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, lumiPrincipals_, and processHistoryIDsMap_.

Referenced by edm::InputSource::luminosityBlockPrincipal(), edm::InputSource::readAndCacheLumi(), and edm::EventProcessor::readAndProcessEvent().

123  {
124  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
125  LumiIterator iter;
126  if (iphid != processHistoryIDsMap_.end()) {
127  LumiKey key(iphid->second, run, lumi);
128  iter = lumiPrincipals_.find(key);
129  }
130  if (iphid == processHistoryIDsMap_.end() || iter == lumiPrincipals_.end()) {
132  << "PrincipalCache::lumiPrincipalPtr\n"
133  << "Requested a lumi that is not in the cache (should never happen)\n"
134  << "Contact a Framework Developer\n";
135  }
136  return iter->second;
137  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::iterator LumiIterator
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
list key
Definition: combine.py:13
boost::shared_ptr< LuminosityBlockPrincipal > edm::PrincipalCache::lumiPrincipalPtr ( )

Definition at line 159 of file PrincipalCache.cc.

References currentLumiPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

159  {
160  if (currentLumiPrincipal_.get() == 0) {
162  << "PrincipalCache::lumiPrincipalPtr\n"
163  << "Requested current lumi and it is not initialized (should never happen)\n"
164  << "Contact a Framework Developer\n";
165  }
166  return currentLumiPrincipal_;
167  }
boost::shared_ptr< LuminosityBlockPrincipal > currentLumiPrincipal_
bool edm::PrincipalCache::merge ( boost::shared_ptr< RunAuxiliary aux,
boost::shared_ptr< ProductRegistry const >  reg 
)

Definition at line 169 of file PrincipalCache.cc.

References currentRunPrincipal_, combine::key, processHistoryIDsMap_, CrabTask::run, and runPrincipals_.

Referenced by edm::InputSource::readAndCacheLumi(), and edm::InputSource::readAndCacheRun().

169  {
170  ProcessHistoryID phid = aux->processHistoryID();
171  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
172  RunIterator iter;
173  if (iphid != processHistoryIDsMap_.end()) {
174  int run = aux->run();
175  RunKey key(iphid->second, run);
176  iter = runPrincipals_.find(key);
177  }
178  if (iphid == processHistoryIDsMap_.end() || iter == runPrincipals_.end()) {
179  return false;
180  }
181  bool runOK = iter->second->adjustToNewProductRegistry(*reg);
182  assert(runOK);
183  iter->second->mergeAuxiliary(*aux);
184  currentRunPrincipal_ = iter->second;
185  return true;
186  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
Hash< ProcessHistoryType > ProcessHistoryID
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::iterator RunIterator
list key
Definition: combine.py:13
boost::shared_ptr< RunPrincipal > currentRunPrincipal_
bool edm::PrincipalCache::merge ( boost::shared_ptr< LuminosityBlockAuxiliary aux,
boost::shared_ptr< ProductRegistry const >  reg 
)

Definition at line 188 of file PrincipalCache.cc.

References currentLumiPrincipal_, combine::key, fjr2json::lumi, lumiPrincipals_, processHistoryIDsMap_, and CrabTask::run.

188  {
189  ProcessHistoryID phid = aux->processHistoryID();
190  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
191  LumiIterator iter;
192  if (iphid != processHistoryIDsMap_.end()) {
193  int run = aux->run();
194  int lumi = aux->luminosityBlock();
195  LumiKey key(iphid->second, run, lumi);
196  iter = lumiPrincipals_.find(key);
197  }
198  if (iphid == processHistoryIDsMap_.end() || iter == lumiPrincipals_.end()) {
199  return false;
200  }
201  bool lumiOK = iter->second->adjustToNewProductRegistry(*reg);
202  assert(lumiOK);
203  iter->second->mergeAuxiliary(*aux);
204  currentLumiPrincipal_ = iter->second;
205  return true;
206  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
tuple lumi
Definition: fjr2json.py:41
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > >::iterator LumiIterator
boost::shared_ptr< LuminosityBlockPrincipal > currentLumiPrincipal_
Hash< ProcessHistoryType > ProcessHistoryID
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
list key
Definition: combine.py:13
bool edm::PrincipalCache::noMoreLumis ( )

Definition at line 245 of file PrincipalCache.cc.

References lumiPrincipals_.

245  {
246  return lumiPrincipals_.empty();
247  }
std::map< LumiKey, boost::shared_ptr< LuminosityBlockPrincipal > > lumiPrincipals_
bool edm::PrincipalCache::noMoreRuns ( )

Definition at line 241 of file PrincipalCache.cc.

References runPrincipals_.

241  {
242  return runPrincipals_.empty();
243  }
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
RunPrincipal & edm::PrincipalCache::runPrincipal ( ProcessHistoryID const &  phid,
int  run 
)

Definition at line 13 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, processHistoryIDsMap_, and runPrincipals_.

Referenced by edm::EventProcessor::beginRun(), edm::EventProcessor::endRun(), edm::InputSource::markRun(), and edm::EventProcessor::writeRun().

13  {
14  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
15  RunIterator iter;
16  if (iphid != processHistoryIDsMap_.end()) {
17  RunKey key(iphid->second, run);
18  iter = runPrincipals_.find(key);
19  }
20  if (iphid == processHistoryIDsMap_.end() || iter == runPrincipals_.end()) {
22  << "PrincipalCache::runPrincipal\n"
23  << "Requested a run that is not in the cache (should never happen)\n"
24  << "Contact a Framework Developer\n";
25  }
26  return *iter->second.get();
27  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::iterator RunIterator
list key
Definition: combine.py:13
RunPrincipal const & edm::PrincipalCache::runPrincipal ( ProcessHistoryID const &  phid,
int  run 
) const

Definition at line 29 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, processHistoryIDsMap_, and runPrincipals_.

29  {
30  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
31  ConstRunIterator iter;
32  if (iphid != processHistoryIDsMap_.end()) {
33  RunKey key(iphid->second, run);
34  iter = runPrincipals_.find(key);
35  }
36  if (iphid == processHistoryIDsMap_.end() || iter == runPrincipals_.end()) {
38  << "PrincipalCache::runPrincipal\n"
39  << "Requested a run that is not in the cache (should never happen)\n"
40  << "Contact a Framework Developer\n";
41  }
42  return *iter->second.get();
43  }
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::const_iterator ConstRunIterator
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
list key
Definition: combine.py:13
RunPrincipal & edm::PrincipalCache::runPrincipal ( )

Definition at line 61 of file PrincipalCache.cc.

References currentRunPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

61  {
62  if (currentRunPrincipal_.get() == 0) {
64  << "PrincipalCache::runPrincipal\n"
65  << "Requested current run and it is not initialized (should never happen)\n"
66  << "Contact a Framework Developer\n";
67  }
68  return *currentRunPrincipal_.get();
69  }
boost::shared_ptr< RunPrincipal > currentRunPrincipal_
RunPrincipal const & edm::PrincipalCache::runPrincipal ( ) const

Definition at line 71 of file PrincipalCache.cc.

References currentRunPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

71  {
72  if (currentRunPrincipal_.get() == 0) {
74  << "PrincipalCache::runPrincipal\n"
75  << "Requested current run and it is not initialized (should never happen)\n"
76  << "Contact a Framework Developer\n";
77  }
78  return *currentRunPrincipal_.get();
79  }
boost::shared_ptr< RunPrincipal > currentRunPrincipal_
boost::shared_ptr< RunPrincipal > edm::PrincipalCache::runPrincipalPtr ( ProcessHistoryID const &  phid,
int  run 
)

Definition at line 45 of file PrincipalCache.cc.

References edm::hlt::Exception, combine::key, edm::errors::LogicError, processHistoryIDsMap_, and runPrincipals_.

Referenced by edm::InputSource::readAndCacheLumi(), edm::InputSource::readAndCacheRun(), and edm::InputSource::runPrincipal().

45  {
46  std::map<ProcessHistoryID, int>::const_iterator iphid = processHistoryIDsMap_.find(phid);
47  RunIterator iter;
48  if (iphid != processHistoryIDsMap_.end()) {
49  RunKey key(iphid->second, run);
50  iter = runPrincipals_.find(key);
51  }
52  if (iphid == processHistoryIDsMap_.end() || iter == runPrincipals_.end()) {
54  << "PrincipalCache::runPrincipalPtr\n"
55  << "Requested a run that is not in the cache (should never happen)\n"
56  << "Contact a Framework Developer\n";
57  }
58  return iter->second;
59  }
std::map< ProcessHistoryID, int > processHistoryIDsMap_
std::map< RunKey, boost::shared_ptr< RunPrincipal > > runPrincipals_
std::map< RunKey, boost::shared_ptr< RunPrincipal > >::iterator RunIterator
list key
Definition: combine.py:13
boost::shared_ptr< RunPrincipal > edm::PrincipalCache::runPrincipalPtr ( )

Definition at line 81 of file PrincipalCache.cc.

References currentRunPrincipal_, edm::hlt::Exception, and edm::errors::LogicError.

81  {
82  if (currentRunPrincipal_.get() == 0) {
84  << "PrincipalCache::runPrincipalPtr\n"
85  << "Requested current run and it is not initialized (should never happen)\n"
86  << "Contact a Framework Developer\n";
87  }
88  return currentRunPrincipal_;
89  }
boost::shared_ptr< RunPrincipal > currentRunPrincipal_

Member Data Documentation

boost::shared_ptr<LuminosityBlockPrincipal> edm::PrincipalCache::currentLumiPrincipal_
private

Definition at line 130 of file PrincipalCache.h.

Referenced by insert(), lumiPrincipal(), lumiPrincipalPtr(), and merge().

boost::shared_ptr<RunPrincipal> edm::PrincipalCache::currentRunPrincipal_
private

Definition at line 129 of file PrincipalCache.h.

Referenced by insert(), merge(), runPrincipal(), and runPrincipalPtr().

boost::shared_ptr<EventPrincipal> edm::PrincipalCache::eventPrincipal_
private

Definition at line 128 of file PrincipalCache.h.

Referenced by adjustEventToNewProductRegistry(), eventPrincipal(), and insert().

std::map<LumiKey, boost::shared_ptr<LuminosityBlockPrincipal> > edm::PrincipalCache::lumiPrincipals_
private
std::vector<ProcessHistoryID> edm::PrincipalCache::processHistoryIDs_
private

Definition at line 117 of file PrincipalCache.h.

Referenced by insert().

std::map<ProcessHistoryID, int> edm::PrincipalCache::processHistoryIDsMap_
private
std::map<RunKey, boost::shared_ptr<RunPrincipal> > edm::PrincipalCache::runPrincipals_
private