CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::ProcessHistory Class Reference

#include <ProcessHistory.h>

Classes

struct  Transients
 

Public Types

typedef std::vector< value_typecollection_type
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::const_reference const_reference
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef collection_type::reference reference
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef collection_type::size_type size_type
 
typedef ProcessConfiguration value_type
 

Public Member Functions

reference at (size_type i)
 
const_reference at (size_type i) const
 
const_iterator begin () const
 
size_type capacity () const
 
void clear ()
 
collection_type const & data () const
 
template<typename... Args>
void emplace_back (Args &&... args)
 
bool empty () const
 
const_iterator end () const
 
bool getConfigurationForProcess (std::string const &name, ProcessConfiguration &config) const
 
ProcessHistoryID id () const
 
void initializeTransients ()
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
 ProcessHistory ()
 
 ProcessHistory (size_type n)
 
 ProcessHistory (collection_type const &vec)
 
void push_back (const_reference t)
 
void push_front (const_reference t)
 
const_reverse_iterator rbegin () const
 
ProcessHistoryreduce ()
 
const_reverse_iterator rend () const
 
void reserve (size_type n)
 
ProcessHistoryID setProcessHistoryID ()
 
size_type size () const
 
void swap (ProcessHistory &other)
 

Private Member Functions

ProcessHistoryIDphid ()
 

Private Attributes

collection_type data_
 
Transients transient_
 

Detailed Description

Definition at line 13 of file ProcessHistory.h.

Member Typedef Documentation

◆ collection_type

Definition at line 16 of file ProcessHistory.h.

◆ const_iterator

typedef collection_type::const_iterator edm::ProcessHistory::const_iterator

Definition at line 19 of file ProcessHistory.h.

◆ const_reference

typedef collection_type::const_reference edm::ProcessHistory::const_reference

Definition at line 25 of file ProcessHistory.h.

◆ const_reverse_iterator

typedef collection_type::const_reverse_iterator edm::ProcessHistory::const_reverse_iterator

Definition at line 22 of file ProcessHistory.h.

◆ iterator

typedef collection_type::iterator edm::ProcessHistory::iterator

Definition at line 18 of file ProcessHistory.h.

◆ reference

typedef collection_type::reference edm::ProcessHistory::reference

Definition at line 24 of file ProcessHistory.h.

◆ reverse_iterator

typedef collection_type::reverse_iterator edm::ProcessHistory::reverse_iterator

Definition at line 21 of file ProcessHistory.h.

◆ size_type

typedef collection_type::size_type edm::ProcessHistory::size_type

Definition at line 27 of file ProcessHistory.h.

◆ value_type

Definition at line 15 of file ProcessHistory.h.

Constructor & Destructor Documentation

◆ ProcessHistory() [1/3]

edm::ProcessHistory::ProcessHistory ( )
inline

Definition at line 29 of file ProcessHistory.h.

29 : data_(), transient_() {}
collection_type data_

◆ ProcessHistory() [2/3]

edm::ProcessHistory::ProcessHistory ( size_type  n)
inlineexplicit

Definition at line 30 of file ProcessHistory.h.

30 : data_(n), transient_() {}
collection_type data_

◆ ProcessHistory() [3/3]

edm::ProcessHistory::ProcessHistory ( collection_type const &  vec)
inlineexplicit

Definition at line 31 of file ProcessHistory.h.

31 : data_(vec), transient_() {}
collection_type data_

Member Function Documentation

◆ at() [1/2]

reference edm::ProcessHistory::at ( size_type  i)
inline

Definition at line 59 of file ProcessHistory.h.

References data_, and mps_fire::i.

59 { return data_.at(i); }
collection_type data_

◆ at() [2/2]

const_reference edm::ProcessHistory::at ( size_type  i) const
inline

Definition at line 60 of file ProcessHistory.h.

References data_, and mps_fire::i.

60 { return data_.at(i); }
collection_type data_

◆ begin()

const_iterator edm::ProcessHistory::begin ( void  ) const
inline

Definition at line 62 of file ProcessHistory.h.

References data_.

Referenced by HLTConfigProvider::init().

62 { return data_.begin(); }
collection_type data_

◆ capacity()

size_type edm::ProcessHistory::capacity ( ) const
inline

Definition at line 53 of file ProcessHistory.h.

References data_.

53 { return data_.capacity(); }
collection_type data_

◆ clear()

void edm::ProcessHistory::clear ( void  )
inline

Definition at line 84 of file ProcessHistory.h.

References data_, and phid().

84  {
85  data_.clear();
86  phid() = ProcessHistoryID();
87  }
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryID & phid()
collection_type data_

◆ data()

collection_type const& edm::ProcessHistory::data ( ) const
inline

Definition at line 74 of file ProcessHistory.h.

References data_.

74 { return data_; }
collection_type data_

◆ emplace_back()

template<typename... Args>
void edm::ProcessHistory::emplace_back ( Args &&...  args)
inline

Definition at line 34 of file ProcessHistory.h.

References writedatasetfile::args, data_, and phid().

Referenced by edm::ProvenanceAdaptor::fixProcessHistory(), and edm::test::TestProcessor::TestProcessor().

34  {
35  data_.emplace_back(std::forward<Args>(args)...);
36  phid() = ProcessHistoryID();
37  }
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryID & phid()
collection_type data_

◆ empty()

bool edm::ProcessHistory::empty ( ) const
inline

Definition at line 51 of file ProcessHistory.h.

References data_.

51 { return data_.empty(); }
collection_type data_

◆ end()

const_iterator edm::ProcessHistory::end ( void  ) const
inline

Definition at line 63 of file ProcessHistory.h.

References data_.

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and HLTConfigProvider::init().

63 { return data_.end(); }
collection_type data_

◆ getConfigurationForProcess()

bool edm::ProcessHistory::getConfigurationForProcess ( std::string const &  name,
ProcessConfiguration config 
) const

Definition at line 34 of file ProcessHistory.cc.

References B2GTnPMonitor_cfi::item, and mergeVDriftHistosByStation::name.

Referenced by edm::Event::getProcessParameterSet(), HLTConfigProvider::init(), and L1GTAlgoBlockProducer::init().

34  {
35  for (auto const& item : *this) {
36  if (item.processName() == name) {
37  config = item;
38  return true;
39  }
40  }
41  // Name not found!
42  return false;
43  }
Definition: config.py:1

◆ id()

ProcessHistoryID edm::ProcessHistory::id ( ) const

Definition at line 10 of file ProcessHistory.cc.

References cms::Digest::digest(), edm::Hash< I >::isValid(), B2GTnPMonitor_cfi::item, IsoPhotonEBSkim_cff::phID, edm::ProcessHistory::Transients::phid_, AlCaHLTBitMon_QueryRunRegistry::string, cms::MD5Result::toString(), and transient_.

Referenced by edm::HistoryAppender::appendToProcessHistory(), edm::test::TestProcessor::beginLuminosityBlock(), edm::test::TestProcessor::beginRun(), edm::test::TestProcessor::event(), edm::ProvenanceAdaptor::fixProcessHistory(), and setProcessHistoryID().

10  {
11  if (transient_.phid_.isValid()) {
12  return transient_.phid_;
13  }
14  // This implementation is ripe for optimization.
15  // We do not use operator<< because it does not write out everything.
16  std::ostringstream oss;
17  for (auto const& item : *this) {
18  oss << item.processName() << ' ' << item.parameterSetID() << ' ' << item.releaseVersion() << ' ' << item.passID()
19  << ' ';
20  }
21  std::string stringrep = oss.str();
22  cms::Digest md5alg(stringrep);
23  ProcessHistoryID phID(md5alg.digest().toString());
24  return phID;
25  }
bool isValid() const
Definition: Hash.h:141
Hash< ProcessHistoryType > ProcessHistoryID

◆ initializeTransients()

void edm::ProcessHistory::initializeTransients ( )
inline

◆ operator[]() [1/2]

reference edm::ProcessHistory::operator[] ( size_type  i)
inline

Definition at line 56 of file ProcessHistory.h.

References data_, and mps_fire::i.

56 { return data_[i]; }
collection_type data_

◆ operator[]() [2/2]

const_reference edm::ProcessHistory::operator[] ( size_type  i) const
inline

Definition at line 57 of file ProcessHistory.h.

References data_, and mps_fire::i.

57 { return data_[i]; }
collection_type data_

◆ phid()

ProcessHistoryID& edm::ProcessHistory::phid ( )
inlineprivate

Definition at line 100 of file ProcessHistory.h.

References edm::ProcessHistory::Transients::phid_, and transient_.

Referenced by clear(), emplace_back(), push_back(), push_front(), reduce(), and swap().

100 { return transient_.phid_; }

◆ push_back()

void edm::ProcessHistory::push_back ( const_reference  t)
inline

Definition at line 43 of file ProcessHistory.h.

References data_, phid(), and submitPVValidationJobs::t.

43  {
44  data_.push_back(t);
45  phid() = ProcessHistoryID();
46  }
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryID & phid()
collection_type data_

◆ push_front()

void edm::ProcessHistory::push_front ( const_reference  t)
inline

Definition at line 39 of file ProcessHistory.h.

References data_, phid(), and submitPVValidationJobs::t.

39  {
40  data_.insert(data_.begin(), t);
41  phid() = ProcessHistoryID();
42  }
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryID & phid()
collection_type data_

◆ rbegin()

const_reverse_iterator edm::ProcessHistory::rbegin ( ) const
inline

Definition at line 65 of file ProcessHistory.h.

References data_.

Referenced by findBinOfMaximum().

65 { return data_.rbegin(); }
collection_type data_

◆ reduce()

ProcessHistory & edm::ProcessHistory::reduce ( )

Definition at line 45 of file ProcessHistory.cc.

References data_, B2GTnPMonitor_cfi::item, and phid().

45  {
46  phid() = ProcessHistoryID();
47  for (auto& item : data_) {
48  item.reduce();
49  }
50  return *this;
51  }
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryID & phid()
collection_type data_

◆ rend()

const_reverse_iterator edm::ProcessHistory::rend ( ) const
inline

Definition at line 66 of file ProcessHistory.h.

References data_.

Referenced by findBinOfMaximum().

66 { return data_.rend(); }
collection_type data_

◆ reserve()

void edm::ProcessHistory::reserve ( size_type  n)
inline

Definition at line 54 of file ProcessHistory.h.

References data_, and create_idmaps::n.

54 { data_.reserve(n); }
collection_type data_

◆ setProcessHistoryID()

ProcessHistoryID edm::ProcessHistory::setProcessHistoryID ( )

Definition at line 27 of file ProcessHistory.cc.

References id(), edm::Hash< I >::isValid(), edm::ProcessHistory::Transients::phid_, and transient_.

Referenced by fwlite::Run::history(), fwlite::LuminosityBlock::history(), and fwlite::Event::history().

27  {
28  if (!transient_.phid_.isValid()) {
29  transient_.phid_ = id();
30  }
31  return transient_.phid_;
32  }
ProcessHistoryID id() const
bool isValid() const
Definition: Hash.h:141

◆ size()

size_type edm::ProcessHistory::size ( void  ) const
inline

◆ swap()

void edm::ProcessHistory::swap ( ProcessHistory other)
inline

Definition at line 47 of file ProcessHistory.h.

References data_, trackingPlots::other, phid(), and edm::Hash< I >::swap().

47  {
48  data_.swap(other.data_);
49  phid().swap(other.phid());
50  }
void swap(Hash< I > &other)
Definition: Hash.h:181
ProcessHistoryID & phid()
collection_type data_

Member Data Documentation

◆ data_

collection_type edm::ProcessHistory::data_
private

◆ transient_

Transients edm::ProcessHistory::transient_
private

Definition at line 102 of file ProcessHistory.h.

Referenced by id(), initializeTransients(), phid(), and setProcessHistoryID().