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
 
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 const & processHistoryID () const
 
std::string const & processName () const
 
BranchDescription const & product () const
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenanceproductProvenance () const
 
bool productProvenanceValid () const
 
 Provenance ()
 
 Provenance (boost::shared_ptr< ConstBranchDescription > const &p, ProductID const &pid)
 
ParameterSetID psetID () const
 
ReleaseVersion const & releaseVersion () const
 
void resetProductProvenance () const
 
ProductProvenanceresolve () const
 
void setBranchDescription (boost::shared_ptr< ConstBranchDescription > const &p)
 
void setProcessHistoryID (ProcessHistoryID const &phid)
 
void setProductID (ProductID const &pid)
 
void setProductProvenance (ProductProvenance const &prov) const
 
void setStore (boost::shared_ptr< BranchMapper > store) const
 
boost::shared_ptr
< BranchMapper > const & 
store () const
 
void swap (Provenance &)
 
void write (std::ostream &os) const
 

Private Attributes

boost::shared_ptr
< ConstBranchDescription
branchDescription_
 
ProcessHistoryID const * processHistoryID_
 
ProductID productID_
 
boost::shared_ptr
< ProductProvenance
productProvenancePtr_
 
bool productProvenanceValid_
 
boost::shared_ptr< BranchMapperstore_
 

Detailed Description

Definition at line 37 of file Provenance.h.

Constructor & Destructor Documentation

edm::Provenance::Provenance ( )

Definition at line 13 of file Provenance.cc.

13  :
15  productID_(),
18  productProvenancePtr_(new ProductProvenance),
19  store_() {
20  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
ProductID productID_
Definition: Provenance.h:106
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
ProcessHistoryID const * processHistoryID_
Definition: Provenance.h:107
edm::Provenance::Provenance ( boost::shared_ptr< ConstBranchDescription > const &  p,
ProductID const &  pid 
)

Definition at line 22 of file Provenance.cc.

22  :
24  productID_(pid),
27  productProvenancePtr_(new ProductProvenance),
28  store_() {
29  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
ProductID productID_
Definition: Provenance.h:106
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
ProcessHistoryID const * processHistoryID_
Definition: Provenance.h:107

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:105
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().

Referenced by HLTJetTag< T >::hltFilter().

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_.

Referenced by HLTJetTag< T >::hltFilter().

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

Definition at line 48 of file Provenance.h.

References branchDescription_.

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

48 {return branchDescription_;}
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
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 65 of file Provenance.h.

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

65 {return product().friendlyClassName();}
std::string const & friendlyClassName() const
BranchDescription const & product() const
Definition: Provenance.h:44
std::string const& edm::Provenance::moduleLabel ( ) const
inline
std::string edm::Provenance::moduleName ( ) const

Definition at line 92 of file Provenance.cc.

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

Referenced by HadronAndPartonSelector::produce().

92  {
93  if (!product().moduleName().empty()) {
94  return product().moduleName();
95  }
96  if (moduleNames().size() == 1) {
97  return moduleNames().begin()->second;
98  }
99  std::map<ProcessConfigurationID, std::string>::const_iterator it =
101  if (it == moduleNames().end()) {
102  return std::string();
103  }
104  return it->second;
105  }
#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:92
std::map< ProcessConfigurationID, std::string > const & moduleNames() const
Definition: Provenance.h:75
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:47
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 edm::ProductProvenance::parentage(), and productProvenance().

Referenced by event(), and parents().

58 {return productProvenance()->parentage();}
ProductProvenance * productProvenance() const
Definition: Provenance.h:51
Parentage const & parentage() const
std::vector<BranchID> const& edm::Provenance::parents ( ) const
inline

Definition at line 80 of file Provenance.h.

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

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

Definition at line 47 of file Provenance.cc.

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

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

47  {
48  if (parameterSetIDs().size() == 1) {
49  return parameterSetIDs().begin()->first;
50  }
51  if (moduleNames().size() == 1) {
52  return moduleNames().begin()->first;
53  }
54  // Get the ProcessHistory for this event.
56  ProcessHistory ph;
57  if (!phr->getMapped(processHistoryID(), ph)) {
58  return ProcessConfigurationID();
59  }
60 
61  ProcessConfiguration config;
62  if (!ph.getConfigurationForProcess(processName(), config)) {
63  return ProcessConfigurationID();
64  }
65  return config.id();
66  }
static ThreadSafeRegistry * instance()
std::string const & processName() const
Definition: Provenance.h:63
edm::detail::ThreadSafeRegistry< edm::ProcessHistoryID, edm::ProcessHistory, edm::FullHistoryToReducedHistoryMap > ProcessHistoryRegistry
Hash< ProcessConfigurationType > ProcessConfigurationID
std::map< ProcessConfigurationID, ParameterSetID > const & parameterSetIDs() const
Definition: Provenance.h:72
ProcessHistoryID const & processHistoryID() const
Definition: Provenance.h:67
std::map< ProcessConfigurationID, std::string > const & moduleNames() const
Definition: Provenance.h:75
tuple size
Write out results.
ProcessHistoryID const& edm::Provenance::processHistoryID ( ) const
inline

Definition at line 67 of file Provenance.h.

References processHistoryID_.

Referenced by processConfigurationID(), and edm::SubProcess::propagateProducts().

67 {return *processHistoryID_;}
ProcessHistoryID const * processHistoryID_
Definition: Provenance.h:107
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
ProductProvenance* edm::Provenance::productProvenance ( ) const
inline

Definition at line 51 of file Provenance.h.

References productProvenancePtr_, productProvenanceValid_, and resolve().

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

51  {
53  return resolve();
54  }
ProductProvenance * resolve() const
Definition: Provenance.cc:32
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
bool edm::Provenance::productProvenanceValid ( ) const
inline

Definition at line 55 of file Provenance.h.

References productProvenanceValid_.

Referenced by edm::SubProcess::propagateProducts().

55  {
57  }
bool productProvenanceValid_
Definition: Provenance.h:108
ParameterSetID edm::Provenance::psetID ( ) const

Definition at line 76 of file Provenance.cc.

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

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

76  {
77  if (product().parameterSetID().isValid()) {
78  return product().parameterSetID();
79  }
80  if (parameterSetIDs().size() == 1) {
81  return parameterSetIDs().begin()->second;
82  }
83  std::map<ProcessConfigurationID, ParameterSetID>::const_iterator it =
85  if (it == parameterSetIDs().end()) {
86  return ParameterSetID();
87  }
88  return it->second;
89  }
#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:47
tuple size
Write out results.
ReleaseVersion const & edm::Provenance::releaseVersion ( ) const

Definition at line 69 of file Provenance.cc.

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

69  {
70  ProcessConfiguration pc;
72  return pc.releaseVersion();
73  }
static ThreadSafeRegistry * instance()
bool getMapped(key_type const &k, value_type &result) const
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:47
void edm::Provenance::resetProductProvenance ( ) const

Definition at line 120 of file Provenance.cc.

References productProvenancePtr_, and productProvenanceValid_.

Referenced by edm::SubProcess::propagateProducts(), and edm::ProductData::resetProductData().

120  {
121  *productProvenancePtr_ = ProductProvenance();
122  productProvenanceValid_ = false;
123  }
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
ProductProvenance * edm::Provenance::resolve ( ) const

Definition at line 32 of file Provenance.cc.

References branchDescription_, productProvenancePtr_, productProvenanceValid_, and store_.

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

32  {
33  if(!store_) {
34  return 0;
35  }
37  ProductProvenance const* prov = store_->branchIDToProvenance(branchDescription_->branchID());
38  if (prov) {
39  *productProvenancePtr_ = *prov;
41  }
42  }
43  return productProvenancePtr_.get();
44  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
void edm::Provenance::setBranchDescription ( boost::shared_ptr< ConstBranchDescription > const &  p)
inline

Definition at line 96 of file Provenance.h.

References branchDescription_, and AlCaHLTBitMon_ParallelJobs::p.

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

96  {
98  }
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
void edm::Provenance::setProcessHistoryID ( ProcessHistoryID const &  phid)
inline

Definition at line 86 of file Provenance.h.

References processHistoryID_.

Referenced by edm::SubProcess::propagateProducts(), edm::Group::setProcessHistoryID(), and edm::Group::setProvenance().

86 {processHistoryID_ = &phid;}
ProcessHistoryID const * processHistoryID_
Definition: Provenance.h:107
void edm::Provenance::setProductID ( ProductID const &  pid)
inline

Definition at line 92 of file Provenance.h.

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

Referenced by edm::SubProcess::propagateProducts(), and edm::Group::setProvenance().

92  {
93  productID_ = pid;
94  }
ProductID productID_
Definition: Provenance.h:106
void edm::Provenance::setProductProvenance ( ProductProvenance const &  prov) const

Definition at line 126 of file Provenance.cc.

References productProvenancePtr_, and productProvenanceValid_.

Referenced by edm::SubProcess::propagateProducts(), and edm::Group::setProductProvenance().

126  {
127  *productProvenancePtr_ = prov;
129  }
bool productProvenanceValid_
Definition: Provenance.h:108
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
void edm::Provenance::setStore ( boost::shared_ptr< BranchMapper store) const
inline

Definition at line 84 of file Provenance.h.

References store(), and store_.

Referenced by edm::SubProcess::propagateProducts(), and edm::Group::setProvenance().

84 {store_ = store;}
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
boost::shared_ptr< BranchMapper > const & store() const
Definition: Provenance.h:66
boost::shared_ptr<BranchMapper> const& edm::Provenance::store ( ) const
inline

Definition at line 66 of file Provenance.h.

References store_.

Referenced by edm::SubProcess::propagateProducts(), and setStore().

66 {return store_;}
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
void edm::Provenance::swap ( Provenance iOther)

Definition at line 132 of file Provenance.cc.

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

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

132  {
133  branchDescription_.swap(iOther.branchDescription_);
134  productID_.swap(iOther.productID_);
135  productProvenancePtr_.swap(iOther.productProvenancePtr_);
136  store_.swap(iOther.store_);
137  }
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
ProductID productID_
Definition: Provenance.h:106
void swap(ProductID &other)
Definition: ProductID.cc:17
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
void edm::Provenance::write ( std::ostream &  os) const

Definition at line 108 of file Provenance.cc.

References product(), productProvenance(), edm::ProductProvenance::write(), and edm::BranchDescription::write().

Referenced by edm::operator<<().

108  {
109  // This is grossly inadequate, but it is not critical for the
110  // first pass.
111  product().write(os);
112  productProvenance()->write(os);
113  }
ProductProvenance * productProvenance() const
Definition: Provenance.h:51
void write(std::ostream &os) const
void write(std::ostream &os) const
BranchDescription const & product() const
Definition: Provenance.h:44

Member Data Documentation

boost::shared_ptr<ConstBranchDescription> edm::Provenance::branchDescription_
private
ProcessHistoryID const* edm::Provenance::processHistoryID_
private

Definition at line 107 of file Provenance.h.

Referenced by processHistoryID(), and setProcessHistoryID().

ProductID edm::Provenance::productID_
private

Definition at line 106 of file Provenance.h.

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

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

Definition at line 110 of file Provenance.h.

Referenced by resolve(), setStore(), store(), and swap().