CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::Provenance Class Reference

#include <Provenance.h>

List of all members.

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 (boost::shared_ptr< ConstBranchDescription > const &p, ProductID const &pid)
 Provenance ()
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.

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

Definition at line 22 of file Provenance.cc.


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

{return product().branchAliases();}
BranchDescription const& edm::Provenance::branchDescription ( ) const [inline]
BranchID const& edm::Provenance::branchID ( ) const [inline]
std::string const& edm::Provenance::branchName ( ) const [inline]

Definition at line 60 of file Provenance.h.

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

{return product().branchName();}
std::string const& edm::Provenance::className ( ) const [inline]

Definition at line 61 of file Provenance.h.

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

{return product().className();}
ConstBranchDescription const& edm::Provenance::constBranchDescription ( ) const [inline]

Definition at line 47 of file Provenance.h.

References branchDescription_.

{return *branchDescription_;}
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().

Parentage const& edm::Provenance::event ( ) const [inline]

Definition at line 43 of file Provenance.h.

References parentage().

{return parentage();}
std::string const& edm::Provenance::friendlyClassName ( ) const [inline]

Definition at line 65 of file Provenance.h.

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

{return product().friendlyClassName();}
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.

                               {
    if (!product().moduleName().empty()) {
      return product().moduleName();
    }
    if (moduleNames().size() == 1) {
      return moduleNames().begin()->second;
    }
    std::map<ProcessConfigurationID, std::string>::const_iterator it =
        moduleNames().find(processConfigurationID());
    if (it == moduleNames().end()) {
      return std::string();
    }
    return it->second;
  }
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().

                                                                         {
      return product().moduleNames();
    }
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().

                                                                                  {
      return product().parameterSetIDs();
    }
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().

{return productProvenance()->parentage();}
std::vector<BranchID> const& edm::Provenance::parents ( ) const [inline]

Definition at line 80 of file Provenance.h.

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

{return parentage().parents();}
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(), instance, moduleNames(), parameterSetIDs(), processHistoryID(), processName(), and findQualityFiles::size.

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

                                           {
    if (parameterSetIDs().size() == 1) {
      return parameterSetIDs().begin()->first;
    }
    if (moduleNames().size() == 1) {
      return moduleNames().begin()->first;
    }
    // Get the ProcessHistory for this event.
    ProcessHistoryRegistry* phr = ProcessHistoryRegistry::instance();
    ProcessHistory ph;
    if (!phr->getMapped(processHistoryID(), ph)) {
      return ProcessConfigurationID();
    }

    ProcessConfiguration config;
    if (!ph.getConfigurationForProcess(processName(), config)) {
      return ProcessConfigurationID();
    }
    return config.id();
  }
ProcessHistoryID const& edm::Provenance::processHistoryID ( ) const [inline]

Definition at line 67 of file Provenance.h.

References processHistoryID_.

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

{return *processHistoryID_;}
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]
bool edm::Provenance::productProvenanceValid ( ) const [inline]

Definition at line 55 of file Provenance.h.

References productProvenanceValid_.

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

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(), and EcalSelectiveReadoutProducer::getBinOfMax().

                           {
    if (product().parameterSetID().isValid()) {
      return product().parameterSetID();
    }
    if (parameterSetIDs().size() == 1) {
      return parameterSetIDs().begin()->second;
    }
    std::map<ProcessConfigurationID, ParameterSetID>::const_iterator it =
        parameterSetIDs().find(processConfigurationID());
    if (it == parameterSetIDs().end()) {
      return ParameterSetID();
    }
    return it->second;
  }
ReleaseVersion const & edm::Provenance::releaseVersion ( ) const

Definition at line 69 of file Provenance.cc.

References instance, processConfigurationID(), and edm::ProcessConfiguration::releaseVersion().

                                   {
    ProcessConfiguration pc;
    ProcessConfigurationRegistry::instance()->getMapped(processConfigurationID(), pc);
    return pc.releaseVersion();
  }
void edm::Provenance::resetProductProvenance ( ) const
ProductProvenance * edm::Provenance::resolve ( ) const

Definition at line 32 of file Provenance.cc.

References branchDescription_, productProvenancePtr_, productProvenanceValid_, and store_.

Referenced by productProvenance().

                            {
    if(!store_) {
      return 0;
    }
    if (!productProvenanceValid_) {
      ProductProvenance const* prov  = store_->branchIDToProvenance(branchDescription_->branchID());
      if (prov) {
        *productProvenancePtr_ = *prov;
        productProvenanceValid_ = true;
      }
    }
    return productProvenancePtr_.get();
  }
void edm::Provenance::setBranchDescription ( boost::shared_ptr< ConstBranchDescription > const &  p) [inline]
void edm::Provenance::setProcessHistoryID ( ProcessHistoryID const &  phid) [inline]
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().

                                            {
      productID_ = pid;
    }
void edm::Provenance::setProductProvenance ( ProductProvenance const &  prov) const
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().

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

{return store_;}
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().

                                     {
    branchDescription_.swap(iOther.branchDescription_);
    productID_.swap(iOther.productID_);
    productProvenancePtr_.swap(iOther.productProvenancePtr_);
    store_.swap(iOther.store_);
 }
void edm::Provenance::write ( std::ostream &  os) const

Definition at line 108 of file Provenance.cc.

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

Referenced by edm::operator<<().

                                        {
    // This is grossly inadequate, but it is not critical for the
    // first pass.
    product().write(os);
    productProvenance()->write(os);
  }

Member Data Documentation

Definition at line 107 of file Provenance.h.

Referenced by processHistoryID(), and setProcessHistoryID().

Definition at line 106 of file Provenance.h.

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

boost::shared_ptr<ProductProvenance> edm::Provenance::productProvenancePtr_ [mutable, private]
boost::shared_ptr<BranchMapper> edm::Provenance::store_ [mutable, private]

Definition at line 110 of file Provenance.h.

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