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 Attributes
edm::Provenance Class Reference

#include <Provenance.h>

Public Member Functions

std::set< std::string > const & branchAliases () const
 
BranchDescription const & branchDescription () const
 
BranchID const & branchID () const
 
std::string const & branchName () const
 
std::string const & className () const
 
ConstBranchDescription const & constBranchDescription () const
 
boost::shared_ptr
< ConstBranchDescription >
const & 
constBranchDescriptionPtr () const
 
Parentage const & event () const
 
std::string const & friendlyClassName () const
 
bool isPresent () const
 
std::string const & moduleLabel () const
 
std::string moduleName () const
 
std::map
< ProcessConfigurationID,
std::string > const & 
moduleNames () const
 
std::map
< ProcessConfigurationID,
ParameterSetID > const & 
parameterSetIDs () const
 
Parentage const & parentage () const
 
std::vector< BranchID > const & parents () const
 
ProcessConfigurationID processConfigurationID () const
 
ProcessHistoryID processHistoryID () const
 
std::string const & processName () const
 
BranchDescription const & product () const
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
boost::shared_ptr
< ProductProvenance
productProvenancePtr () const
 
bool productProvenanceResolved () const
 
ProductStatus const & productStatus () const
 
 Provenance (boost::shared_ptr< ConstBranchDescription > const &p, ProductID const &pid)
 
ParameterSetID psetID () const
 
ReleaseVersion const & releaseVersion () const
 
void resetProductProvenance ()
 
boost::shared_ptr
< ProductProvenance
resolve () const
 
void setBranchDescription (boost::shared_ptr< ConstBranchDescription > const &p)
 
void setProductID (ProductID const &pid)
 
void setProductProvenance (boost::shared_ptr< ProductProvenance > prov) const
 
void setStore (boost::shared_ptr< BranchMapper > store) const
 
void swap (Provenance &)
 
void write (std::ostream &os) const
 
 ~Provenance ()
 

Private Attributes

boost::shared_ptr
< ConstBranchDescription
branchDescription_
 
ProductID productID_
 
boost::shared_ptr
< ProductProvenance
productProvenancePtr_
 
boost::shared_ptr< BranchMapperstore_
 

Detailed Description

Definition at line 37 of file Provenance.h.

Constructor & Destructor Documentation

edm::Provenance::Provenance ( boost::shared_ptr< ConstBranchDescription > const &  p,
ProductID const &  pid 
)

Definition at line 12 of file Provenance.cc.

12  :
14  productID_(pid),
16  }
ProductID productID_
Definition: Provenance.h:109
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
edm::Provenance::~Provenance ( )
inline

Definition at line 41 of file Provenance.h.

41 {}

Member Function Documentation

std::set<std::string> const& edm::Provenance::branchAliases ( ) const
inline

Definition at line 78 of file Provenance.h.

References edm::BranchDescription::branchAliases(), and product().

78 {return product().branchAliases();}
BranchDescription const & product() const
Definition: Provenance.h:44
std::set< std::string > const & branchAliases() const
BranchDescription const& edm::Provenance::branchDescription ( ) const
inline

Definition at line 46 of file Provenance.h.

References branchDescription_.

Referenced by edm::check(), FWFFMetadataManager::doUpdate(), TopProjector< Top, Bottom >::produce(), and TopProjector< Top, Bottom >::ptrToAncestor().

46 {return branchDescription_->me();}
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
BranchID const& edm::Provenance::branchID ( ) const
inline

Definition at line 59 of file Provenance.h.

References edm::BranchDescription::branchID(), and product().

Referenced by edm::LuminosityBlock::addToGotBranchIDs(), edm::Run::addToGotBranchIDs(), and edm::Event::addToGotBranchIDs().

59 {return product().branchID();}
BranchID const & branchID() const
BranchDescription const & product() const
Definition: Provenance.h:44
std::string const& edm::Provenance::branchName ( ) const
inline

Definition at line 60 of file Provenance.h.

References edm::BranchDescription::branchName(), and product().

60 {return product().branchName();}
std::string & branchName() const
BranchDescription const & product() const
Definition: Provenance.h:44
std::string const& edm::Provenance::className ( ) const
inline

Definition at line 61 of file Provenance.h.

References edm::BranchDescription::className(), and product().

61 {return product().className();}
std::string const & className() const
BranchDescription const & product() const
Definition: Provenance.h:44
ConstBranchDescription const& edm::Provenance::constBranchDescription ( ) const
inline

Definition at line 47 of file Provenance.h.

References branchDescription_.

47 {return *branchDescription_;}
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
boost::shared_ptr<ConstBranchDescription> const& edm::Provenance::constBranchDescriptionPtr ( ) const
inline

Definition at line 48 of file Provenance.h.

References branchDescription_.

Referenced by edm::GroupData::branchDescription().

48 {return branchDescription_;}
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
Parentage const& edm::Provenance::event ( ) const
inline

Definition at line 43 of file Provenance.h.

References parentage().

43 {return parentage();}
Parentage const & parentage() const
Definition: Provenance.h:58
std::string const& edm::Provenance::friendlyClassName ( ) const
inline

Definition at line 66 of file Provenance.h.

References edm::BranchDescription::friendlyClassName(), and product().

66 {return product().friendlyClassName();}
std::string const & friendlyClassName() const
BranchDescription const & product() const
Definition: Provenance.h:44
bool edm::Provenance::isPresent ( ) const
inline

Definition at line 80 of file Provenance.h.

References edm::productstatus::present(), and productStatus().

ProductStatus const & productStatus() const
Definition: Provenance.h:64
ProductStatus present()
Definition: ProductStatus.h:17
std::string const& edm::Provenance::moduleLabel ( ) const
inline
std::string edm::Provenance::moduleName ( ) const

Definition at line 72 of file Provenance.cc.

References relativeConstraints::empty, end, edm::BranchDescription::moduleName(), moduleNames(), processConfigurationID(), product(), and findQualityFiles::size.

72  {
73  if (!product().moduleName().empty()) {
74  return product().moduleName();
75  }
76  if (moduleNames().size() == 1) {
77  return moduleNames().begin()->second;
78  }
79  std::map<ProcessConfigurationID, std::string>::const_iterator it =
81  if (it == moduleNames().end()) {
82  return std::string();
83  }
84  return it->second;
85  }
#define end
Definition: vmac.h:38
BranchDescription const & product() const
Definition: Provenance.h:44
std::string const & moduleName() const
std::string moduleName() const
Definition: Provenance.cc:72
std::map< ProcessConfigurationID, std::string > const & moduleNames() const
Definition: Provenance.h:75
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:27
tuple size
Write out results.
std::map<ProcessConfigurationID, std::string> const& edm::Provenance::moduleNames ( ) const
inline

Definition at line 75 of file Provenance.h.

References edm::BranchDescription::moduleNames(), and product().

Referenced by moduleName(), and processConfigurationID().

75  {
76  return product().moduleNames();
77  }
std::map< ProcessConfigurationID, std::string > & moduleNames() const
BranchDescription const & product() const
Definition: Provenance.h:44
std::map<ProcessConfigurationID, ParameterSetID> const& edm::Provenance::parameterSetIDs ( ) const
inline

Definition at line 72 of file Provenance.h.

References edm::BranchDescription::parameterSetIDs(), and product().

Referenced by processConfigurationID(), and psetID().

72  {
73  return product().parameterSetIDs();
74  }
BranchDescription const & product() const
Definition: Provenance.h:44
std::map< ProcessConfigurationID, ParameterSetID > & parameterSetIDs() const
Parentage const& edm::Provenance::parentage ( ) const
inline

Definition at line 58 of file Provenance.h.

References productProvenancePtr().

Referenced by event(), and parents().

58 {return productProvenancePtr()->parentage();}
boost::shared_ptr< ProductProvenance > productProvenancePtr() const
Definition: Provenance.h:54
std::vector<BranchID> const& edm::Provenance::parents ( ) const
inline

Definition at line 82 of file Provenance.h.

References parentage(), and edm::Parentage::parents().

82 {return parentage().parents();}
std::vector< BranchID > const & parents() const
Definition: Parentage.h:39
Parentage const & parentage() const
Definition: Provenance.h:58
ProcessConfigurationID edm::Provenance::processConfigurationID ( ) const

Definition at line 27 of file Provenance.cc.

References cmsDriver::config, edm::ProcessHistory::getConfigurationForProcess(), edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::ProcessConfiguration::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), moduleNames(), parameterSetIDs(), processName(), findQualityFiles::size, and store_.

Referenced by moduleName(), psetID(), and releaseVersion().

27  {
28  if (parameterSetIDs().size() == 1) {
29  return parameterSetIDs().begin()->first;
30  }
31  if (moduleNames().size() == 1) {
32  return moduleNames().begin()->first;
33  }
34  // Get the ProcessHistory for this event.
36  ProcessHistory ph;
37  if (!phr->getMapped(store_->processHistoryID(), ph)) {
38  return ProcessConfigurationID();
39  }
40 
41  ProcessConfiguration config;
42  if (!ph.getConfigurationForProcess(processName(), config)) {
43  return ProcessConfigurationID();
44  }
45  return config.id();
46  }
edm::detail::ThreadSafeRegistry< edm::ProcessHistoryID, edm::ProcessHistory > ProcessHistoryRegistry
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:111
std::string const & processName() const
Definition: Provenance.h:63
Hash< ProcessConfigurationType > ProcessConfigurationID
std::map< ProcessConfigurationID, ParameterSetID > const & parameterSetIDs() const
Definition: Provenance.h:72
std::map< ProcessConfigurationID, std::string > const & moduleNames() const
Definition: Provenance.h:75
tuple config
Definition: cmsDriver.py:17
static ThreadSafeRegistry * instance()
tuple size
Write out results.
ProcessHistoryID edm::Provenance::processHistoryID ( ) const
inline

Definition at line 67 of file Provenance.h.

References store_.

67 {return store_->processHistoryID();}
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:111
std::string const& edm::Provenance::processName ( ) const
inline
BranchDescription const& edm::Provenance::product ( ) const
inline
ProductID const& edm::Provenance::productID ( ) const
inline
std::string const& edm::Provenance::productInstanceName ( ) const
inline
boost::shared_ptr<ProductProvenance> edm::Provenance::productProvenancePtr ( ) const
inline

Definition at line 54 of file Provenance.h.

References productProvenancePtr_, and resolve().

Referenced by parentage(), edm::Group::productProvenancePtr(), productStatus(), and write().

54  {
56  return resolve();
57  }
boost::shared_ptr< ProductProvenance > resolve() const
Definition: Provenance.cc:19
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
bool edm::Provenance::productProvenanceResolved ( ) const
inline

Definition at line 50 of file Provenance.h.

References productProvenancePtr_.

50  {
51  return productProvenancePtr_;
52  }
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
ProductStatus const& edm::Provenance::productStatus ( ) const
inline

Definition at line 64 of file Provenance.h.

References productProvenancePtr().

Referenced by isPresent().

64 {return productProvenancePtr()->productStatus();}
boost::shared_ptr< ProductProvenance > productProvenancePtr() const
Definition: Provenance.h:54
ParameterSetID edm::Provenance::psetID ( ) const

Definition at line 56 of file Provenance.cc.

References end, edm::BranchDescription::parameterSetID(), parameterSetIDs(), processConfigurationID(), product(), and findQualityFiles::size.

Referenced by HLTInfo::analyze(), GsfElectronBaseProducer::beginEvent(), and EcalSelectiveReadoutProducer::getBinOfMax().

56  {
57  if (product().parameterSetID().isValid()) {
58  return product().parameterSetID();
59  }
60  if (parameterSetIDs().size() == 1) {
61  return parameterSetIDs().begin()->second;
62  }
63  std::map<ProcessConfigurationID, ParameterSetID>::const_iterator it =
65  if (it == parameterSetIDs().end()) {
66  return ParameterSetID();
67  }
68  return it->second;
69  }
#define end
Definition: vmac.h:38
BranchDescription const & product() const
Definition: Provenance.h:44
Hash< ParameterSetType > ParameterSetID
std::map< ProcessConfigurationID, ParameterSetID > const & parameterSetIDs() const
Definition: Provenance.h:72
ParameterSetID const & parameterSetID() const
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:27
tuple size
Write out results.
ReleaseVersion const & edm::Provenance::releaseVersion ( ) const

Definition at line 49 of file Provenance.cc.

References edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), processConfigurationID(), and edm::ProcessConfiguration::releaseVersion().

49  {
50  ProcessConfiguration pc;
52  return pc.releaseVersion();
53  }
bool getMapped(key_type const &k, value_type &result) const
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:27
static ThreadSafeRegistry * instance()
void edm::Provenance::resetProductProvenance ( )
inline

Definition at line 101 of file Provenance.h.

References productProvenancePtr_.

Referenced by edm::GroupData::resetGroupData().

101  {
102  productProvenancePtr_.reset();
103  }
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
boost::shared_ptr< ProductProvenance > edm::Provenance::resolve ( ) const

Definition at line 19 of file Provenance.cc.

References branchDescription_, productProvenancePtr_, and store_.

Referenced by SequenceTypes._ModuleSequenceType::insertInto(), and productProvenancePtr().

19  {
20  if (productProvenancePtr_.get() == 0) {
21  productProvenancePtr_ = store_->branchIDToProvenance(branchDescription_->branchID());
22  }
23  return productProvenancePtr_;
24  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:111
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
void edm::Provenance::setBranchDescription ( boost::shared_ptr< ConstBranchDescription > const &  p)
inline

Definition at line 98 of file Provenance.h.

References branchDescription_, and L1TEmulatorMonitor_cff::p.

Referenced by edm::GroupData::resetBranchDescription().

98  {
100  }
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
void edm::Provenance::setProductID ( ProductID const &  pid)
inline

Definition at line 94 of file Provenance.h.

References evf::utils::pid, and productID_.

Referenced by edm::Group::setProvenance().

94  {
95  productID_ = pid;
96  }
ProductID productID_
Definition: Provenance.h:109
void edm::Provenance::setProductProvenance ( boost::shared_ptr< ProductProvenance prov) const
inline

Definition at line 90 of file Provenance.h.

References productProvenancePtr_.

Referenced by edm::Group::setProductProvenance().

90  {
91  productProvenancePtr_ = prov;
92  }
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
void edm::Provenance::setStore ( boost::shared_ptr< BranchMapper store) const
inline

Definition at line 86 of file Provenance.h.

References store_.

Referenced by edm::Group::setProvenance().

86 {store_ = store;}
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:111
void edm::Provenance::swap ( Provenance iOther)

Definition at line 102 of file Provenance.cc.

References branchDescription_, productID_, productProvenancePtr_, store_, and edm::ProductID::swap().

Referenced by edm::GroupData::swap().

102  {
103  branchDescription_.swap(iOther.branchDescription_);
104  productID_.swap(iOther.productID_);
105  productProvenancePtr_.swap(iOther.productProvenancePtr_);
106  store_.swap(iOther.store_);
107  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:111
ProductID productID_
Definition: Provenance.h:109
void swap(ProductID &other)
Definition: ProductID.cc:17
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:110
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:108
void edm::Provenance::write ( std::ostream &  os) const

Definition at line 88 of file Provenance.cc.

References product(), productProvenancePtr(), and edm::BranchDescription::write().

Referenced by edm::operator<<().

88  {
89  // This is grossly inadequate, but it is not critical for the
90  // first pass.
91  product().write(os);
92  productProvenancePtr()->write(os);
93  }
void write(std::ostream &os) const
BranchDescription const & product() const
Definition: Provenance.h:44
boost::shared_ptr< ProductProvenance > productProvenancePtr() const
Definition: Provenance.h:54

Member Data Documentation

boost::shared_ptr<ConstBranchDescription> edm::Provenance::branchDescription_
private
ProductID edm::Provenance::productID_
private

Definition at line 109 of file Provenance.h.

Referenced by productID(), setProductID(), and swap().

boost::shared_ptr<ProductProvenance> edm::Provenance::productProvenancePtr_
mutableprivate
boost::shared_ptr<BranchMapper> edm::Provenance::store_
mutableprivate

Definition at line 111 of file Provenance.h.

Referenced by processConfigurationID(), processHistoryID(), resolve(), setStore(), and swap().