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 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 setProductID (ProductID const &pid)
void setProductProvenance (ProductProvenance const &prov) const
void setStore (boost::shared_ptr< BranchMapper > store) const
void swap (Provenance &)
void write (std::ostream &os) const

Private Attributes

boost::shared_ptr
< ConstBranchDescription
branchDescription_
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.

                          :
    branchDescription_(),
    productID_(),
    productProvenanceValid_(false),
    productProvenancePtr_(new ProductProvenance),
    store_() {
  }
edm::Provenance::Provenance ( boost::shared_ptr< ConstBranchDescription > const &  p,
ProductID const &  pid 
)

Definition at line 21 of file Provenance.cc.


Member Function Documentation

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

Definition at line 77 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 87 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 74 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 71 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 79 of file Provenance.h.

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

{return parentage().parents();}
ProcessConfigurationID edm::Provenance::processConfigurationID ( ) const

Definition at line 42 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(), processName(), findQualityFiles::size, and store_.

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(store_->processHistoryID(), ph)) {
      return ProcessConfigurationID();
    }

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

Definition at line 66 of file Provenance.h.

References store_.

{return store_->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_.

ParameterSetID edm::Provenance::psetID ( ) const

Definition at line 71 of file Provenance.cc.

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

Referenced by 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 64 of file Provenance.cc.

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

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

Definition at line 116 of file Provenance.cc.

References productProvenancePtr_, and productProvenanceValid_.

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

                                           {
    *productProvenancePtr_ = ProductProvenance();
    productProvenanceValid_ = false;
  }
ProductProvenance * edm::Provenance::resolve ( ) const

Definition at line 30 of file Provenance.cc.

References branchDescription_, productProvenancePtr_, productProvenanceValid_, and store_.

Referenced by productProvenance().

                            {
    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::setProductID ( ProductID const &  pid) [inline]

Definition at line 89 of file Provenance.h.

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

Referenced by 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 83 of file Provenance.h.

References store_.

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

{store_ = store;}
void edm::Provenance::swap ( Provenance iOther)

Definition at line 128 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 103 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 103 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 106 of file Provenance.h.

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