CMS 3D CMS Logo

Public Member Functions | Private Member Functions

edm::Group Class Reference

#include <Group.h>

Inheritance diagram for edm::Group:
edm::InputGroup edm::ProducedGroup edm::ScheduledGroup edm::SourceGroup edm::UnscheduledGroup

List of all members.

Public Member Functions

ConstBranchDescription const & branchDescription () const
void checkType (WrapperOwningHolder const &prod) const
void deleteProduct ()
 Group ()
void mergeProduct (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
void mergeProduct (WrapperOwningHolder const &edp) const
void mergeTheProduct (WrapperOwningHolder const &edp) const
std::string const & moduleLabel () const
bool onDemand () const
std::string const & processName () const
boost::shared_ptr< void const > product () const
virtual ProductDataproductData ()=0
virtual ProductData const & productData () const =0
ProductID const & productID () const
std::string const & productInstanceName () const
ProductProvenanceproductProvenancePtr () const
TypeID productType () const
bool productUnavailable () const
bool productWasDeleted () const
Provenanceprovenance () const
bool provenanceAvailable () const
bool putOrMergeProduct () const
void putProduct (WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
void putProduct (WrapperOwningHolder const &edp) const
void reallyCheckType (WrapperOwningHolder const &prod) const
void resetBranchDescription (boost::shared_ptr< ConstBranchDescription > bd)
void resetProductData ()
void setProcessHistoryID (ProcessHistoryID const &phid)
void setProductProvenance (ProductProvenance const &prov) const
void setProvenance (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid, ProductID const &pid)
void setProvenance (boost::shared_ptr< BranchMapper > mapper, ProcessHistoryID const &phid)
void swap (Group &rhs)
WrapperHolder wrapper () const
void write (std::ostream &os) const
virtual ~Group ()

Private Member Functions

virtual void checkType_ (WrapperOwningHolder const &prod) const =0
virtual void mergeProduct_ (WrapperOwningHolder const &edp, ProductProvenance &productProvenance)=0
virtual void mergeProduct_ (WrapperOwningHolder const &edp) const =0
virtual bool onDemand_ () const =0
virtual bool productUnavailable_ () const =0
virtual bool productWasDeleted_ () const =0
virtual bool putOrMergeProduct_ () const =0
virtual void putProduct_ (WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)=0
virtual void putProduct_ (WrapperOwningHolder const &edp) const =0
virtual void resetStatus ()=0
virtual void setProductDeleted ()=0
virtual void swap_ (Group &rhs)=0

Detailed Description

Definition at line 28 of file Group.h.


Constructor & Destructor Documentation

Group< TOutput >::Group ( )

Definition at line 11 of file Group.cc.

{}
Group< TOutput >::~Group ( ) [virtual]

Definition at line 13 of file Group.cc.

{}

Member Function Documentation

ConstBranchDescription const& edm::Group::branchDescription ( ) const [inline]
void edm::Group::checkType ( WrapperOwningHolder const &  prod) const [inline]

Definition at line 135 of file Group.h.

References checkType_().

Referenced by edm::Principal::checkUniquenessAndType(), and edm::Principal::putOrMerge().

virtual void edm::Group::checkType_ ( WrapperOwningHolder const &  prod) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by checkType().

void edm::Group::deleteProduct ( ) [inline]

Definition at line 37 of file Group.h.

References productData(), edm::ProductData::resetProductData(), and setProductDeleted().

Referenced by edm::Principal::deleteProduct().

                         {
      productData().resetProductData();
      setProductDeleted();
    }
void edm::Group::mergeProduct ( WrapperOwningHolder const &  edp) const [inline]

Definition at line 126 of file Group.h.

References mergeProduct_().

                                                            {
      mergeProduct_(edp);
    }
void edm::Group::mergeProduct ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
) [inline]

Definition at line 122 of file Group.h.

References mergeProduct_().

Referenced by edm::Principal::putOrMerge().

                                                                                            {
      mergeProduct_(edp, productProvenance);
    }
virtual void edm::Group::mergeProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance productProvenance 
) [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by mergeProduct().

virtual void edm::Group::mergeProduct_ ( WrapperOwningHolder const &  edp) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

void Group< TOutput >::mergeTheProduct ( WrapperOwningHolder const &  edp) const

Definition at line 115 of file Group.cc.

References branchDescription(), edm::ConstBranchDescription::className(), edm::WrapperHolder::hasIsProductEqual(), edm::WrapperHolder::isProductEqual(), edm::WrapperHolder::mergeProduct(), moduleLabel(), processName(), productInstanceName(), wrapper(), and edm::WrapperHolder::wrapper().

Referenced by edm::InputGroup::mergeProduct_(), and edm::ProducedGroup::mergeProduct_().

                                                             {
    if(wrapper().isMergeable()) {
      wrapper().mergeProduct(edp.wrapper());
    } else if(wrapper().hasIsProductEqual()) {
      if(!wrapper().isProductEqual(edp.wrapper())) {
        LogError("RunLumiMerging")
              << "Group::mergeGroup\n"
              << "Two run/lumi products for the same run/lumi which should be equal are not\n"
              << "Using the first, ignoring the second\n"
              << "className = " << branchDescription().className() << "\n"
              << "moduleLabel = " << moduleLabel() << "\n"
              << "instance = " << productInstanceName() << "\n"
              << "process = " << processName() << "\n";
      }
    } else {
      LogWarning("RunLumiMerging")
          << "Group::mergeGroup\n"
          << "Run/lumi product has neither a mergeProduct nor isProductEqual function\n"
          << "Using the first, ignoring the second in merge\n"
          << "className = " << branchDescription().className() << "\n"
          << "moduleLabel = " << moduleLabel() << "\n"
          << "instance = " << productInstanceName() << "\n"
          << "process = " << processName() << "\n";
    }
  }
std::string const& edm::Group::moduleLabel ( ) const [inline]

Definition at line 75 of file Group.h.

References branchDescription(), and edm::ConstBranchDescription::moduleLabel().

Referenced by mergeTheProduct().

{return branchDescription().moduleLabel();}
bool edm::Group::onDemand ( ) const [inline]
virtual bool edm::Group::onDemand_ ( ) const [private, pure virtual]
std::string const& edm::Group::processName ( ) const [inline]

Definition at line 81 of file Group.h.

References branchDescription(), and edm::ConstBranchDescription::processName().

Referenced by mergeTheProduct().

{return branchDescription().processName();}
boost::shared_ptr<void const> edm::Group::product ( ) const [inline]
virtual ProductData const& edm::Group::productData ( ) const [pure virtual]
virtual ProductData& edm::Group::productData ( ) [pure virtual]
ProductID const& edm::Group::productID ( ) const [inline]

Definition at line 104 of file Group.h.

References productData(), edm::Provenance::productID(), and edm::ProductData::prov_.

Referenced by write().

{return productData().prov_.productID();}
std::string const& edm::Group::productInstanceName ( ) const [inline]

Definition at line 78 of file Group.h.

References branchDescription(), and edm::ConstBranchDescription::productInstanceName().

Referenced by mergeTheProduct().

{return branchDescription().productInstanceName();}
ProductProvenance* edm::Group::productProvenancePtr ( ) const [inline]

Definition at line 61 of file Group.h.

References edm::Provenance::productProvenance(), and provenance().

                                                    {
      return provenance()->productProvenance();
    }
TypeID Group< TOutput >::productType ( ) const

Definition at line 212 of file Group.cc.

References wrapper().

                           {
    return TypeID(wrapper().interface()->wrappedTypeInfo());
  }
bool edm::Group::productUnavailable ( ) const [inline]
virtual bool edm::Group::productUnavailable_ ( ) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by productUnavailable().

bool edm::Group::productWasDeleted ( ) const [inline]

Definition at line 52 of file Group.h.

References productWasDeleted_().

{return productWasDeleted_();}
virtual bool edm::Group::productWasDeleted_ ( ) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by productWasDeleted().

Provenance * Group< TOutput >::provenance ( ) const
bool Group< TOutput >::provenanceAvailable ( ) const

Definition at line 200 of file Group.cc.

References branchDescription(), edm::WrapperHolder::isPresent(), edm::es::produced, product(), and wrapper().

                                   {
    // If this product is from a the current process,
    // the provenance is available if and only if a product has been put.
    if(branchDescription().produced()) {
      return product() && wrapper().isPresent();
    }
    // If this product is from a prior process, the provenance is available,
    // although the per event part may have been dropped.
    return true;
  }
bool edm::Group::putOrMergeProduct ( ) const [inline]

Definition at line 117 of file Group.h.

References putOrMergeProduct_().

Referenced by edm::Principal::putOrMerge().

                                   {
      return putOrMergeProduct_();
    }
virtual bool edm::Group::putOrMergeProduct_ ( ) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by putOrMergeProduct().

void edm::Group::putProduct ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
) [inline]
void edm::Group::putProduct ( WrapperOwningHolder const &  edp) const [inline]

Definition at line 112 of file Group.h.

References putProduct_().

                                                          {
      putProduct_(edp);
    }
virtual void edm::Group::putProduct_ ( WrapperOwningHolder const &  edp,
ProductProvenance const &  productProvenance 
) [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by putProduct().

virtual void edm::Group::putProduct_ ( WrapperOwningHolder const &  edp) const [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

void Group< TOutput >::reallyCheckType ( WrapperOwningHolder const &  prod) const

Definition at line 217 of file Group.cc.

References branchDescription(), edm::ConstBranchDescription::branchName(), edm::ConstBranchDescription::className(), edm::WrapperHolder::dynamicTypeInfo(), edm::errors::EventCorruption, Exception, and edm::ConstBranchDescription::typeID().

Referenced by edm::ProducedGroup::checkType_().

                                                              {
    // Check if the types match.
    TypeID typeID(prod.dynamicTypeInfo());
    if(typeID != branchDescription().typeID()) {
      // Types do not match.
      throw Exception(errors::EventCorruption)
          << "Product on branch " << branchDescription().branchName() << " is of wrong type.\n"
          << "It is supposed to be of type " << branchDescription().className() << ".\n"
          << "It is actually of type " << typeID.className() << ".\n";
    }
  }
void edm::Group::resetBranchDescription ( boost::shared_ptr< ConstBranchDescription bd) [inline]

Definition at line 72 of file Group.h.

References productData(), and edm::ProductData::resetBranchDescription().

Referenced by edm::Principal::adjustToNewProductRegistry().

{productData().resetBranchDescription(bd);}
void edm::Group::resetProductData ( ) [inline]

Definition at line 32 of file Group.h.

References productData(), edm::ProductData::resetProductData(), and resetStatus().

                            {
      productData().resetProductData();
      resetStatus();
    }
virtual void edm::Group::resetStatus ( ) [private, pure virtual]
void Group< TOutput >::setProcessHistoryID ( ProcessHistoryID const &  phid)

Definition at line 244 of file Group.cc.

References productData(), edm::ProductData::prov_, and edm::Provenance::setProcessHistoryID().

                                                         {
    productData().prov_.setProcessHistoryID(phid);
  }
virtual void edm::Group::setProductDeleted ( ) [private, pure virtual]

Implemented in edm::InputGroup, and edm::ProducedGroup.

Referenced by deleteProduct().

void Group< TOutput >::setProductProvenance ( ProductProvenance const &  prov) const
void Group< TOutput >::setProvenance ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid 
)

Definition at line 238 of file Group.cc.

References productData(), edm::ProductData::prov_, edm::Provenance::setProcessHistoryID(), and edm::Provenance::setStore().

                                                                                         {
    productData().prov_.setStore(mapper);
    productData().prov_.setProcessHistoryID(phid);
  }
void Group< TOutput >::setProvenance ( boost::shared_ptr< BranchMapper mapper,
ProcessHistoryID const &  phid,
ProductID const &  pid 
)

Definition at line 230 of file Group.cc.

References productData(), edm::ProductData::prov_, edm::Provenance::setProcessHistoryID(), edm::Provenance::setProductID(), and edm::Provenance::setStore().

                                                                                                               {
    //assert(!productData().prov_);
    productData().prov_.setProductID(pid);
    productData().prov_.setStore(mapper);
    productData().prov_.setProcessHistoryID(phid);
  }
void edm::Group::swap ( Group rhs) [inline]
virtual void edm::Group::swap_ ( Group rhs) [private, pure virtual]
WrapperHolder edm::Group::wrapper ( ) const [inline]

Definition at line 58 of file Group.h.

References edm::ProductData::getInterface(), and productData().

Referenced by mergeTheProduct(), productType(), edm::InputGroup::productUnavailable_(), edm::ProducedGroup::productUnavailable_(), and provenanceAvailable().

{ return WrapperHolder(productData().wrapper_.get(), productData().getInterface()); }
void Group< TOutput >::write ( std::ostream &  os) const

Definition at line 254 of file Group.cc.

References productID().

Referenced by edm::operator<<().

                                   {
    // This is grossly inadequate. It is also not critical for the
    // first pass.
    os << std::string("Group for product with ID: ")
       << productID();
  }