CMS 3D CMS Logo

Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends

edm::Run Class Reference

#include <Run.h>

Inheritance diagram for edm::Run:
edm::RunBase

List of all members.

Public Types

typedef PrincipalGetAdapter Base

Public Member Functions

void getAllProvenance (std::vector< Provenance const * > &provenances) const
template<typename PROD >
bool getByLabel (std::string const &label, Handle< PROD > &result) const
template<typename PROD >
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 same as above, but using the InputTag class
template<typename PROD >
void getManyByType (std::vector< Handle< PROD > > &results) const
Provenance getProvenance (BranchID const &theID) const
ProcessHistory const & processHistory () const
ProcessHistoryID const & processHistoryID () const
template<typename PROD >
void put (std::auto_ptr< PROD > product)
 Put a new product.
template<typename PROD >
void put (std::auto_ptr< PROD > product, std::string const &productInstanceName)
 Put a new product with a 'product instance name'.
 Run (RunPrincipal &rp, ModuleDescription const &md)
RunAuxiliary const & runAuxiliary () const
 ~Run ()

Private Types

typedef std::set< BranchIDBranchIDSet
typedef std::vector< std::pair
< WrapperOwningHolder,
ConstBranchDescription const * > > 
ProductPtrVec

Private Member Functions

void addToGotBranchIDs (Provenance const &prov) const
void commit_ ()
virtual BasicHandle getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const
ProductPtrVec const & putProducts () const
ProductPtrVecputProducts ()
RunPrincipal const & runPrincipal () const
RunPrincipalrunPrincipal ()

Private Attributes

RunAuxiliary const & aux_
BranchIDSet gotBranchIDs_
PrincipalGetAdapter provRecorder_
ProductPtrVec putProducts_

Friends

class DaqSource
class EDFilter
class EDProducer
class InputSource
class RawInputSource

Detailed Description

Definition at line 33 of file Run.h.


Member Typedef Documentation

Definition at line 38 of file Run.h.

typedef std::set<BranchID> edm::Run::BranchIDSet [private]

Definition at line 127 of file Run.h.

typedef std::vector<std::pair<WrapperOwningHolder, ConstBranchDescription const*> > edm::Run::ProductPtrVec [private]

Definition at line 107 of file Run.h.


Constructor & Destructor Documentation

Run::Run ( RunPrincipal rp,
ModuleDescription const &  md 
)

Definition at line 8 of file Run.cc.

                                                        :
        provRecorder_(rp, md),
        aux_(rp.aux()) {
  }
Run::~Run ( )

Definition at line 13 of file Run.cc.

References edm::for_all(), and putProducts_.

            {
    // anything left here must be the result of a failure
    // let's record them as failed attempts in the event principal
    for_all(putProducts_, principal_get_adapter_detail::deleter());
  }

Member Function Documentation

void Run::addToGotBranchIDs ( Provenance const &  prov) const [private]

Definition at line 104 of file Run.cc.

References edm::Provenance::branchID(), and gotBranchIDs_.

Referenced by getByLabelImpl().

                                                     {
    gotBranchIDs_.insert(prov.branchID());
  }
void Run::commit_ ( ) [private]

Definition at line 77 of file Run.cc.

References begin, end, edm::RunPrincipal::put(), putProducts(), and runPrincipal().

Referenced by edm::InputSource::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), and edm::InputSource::doEndRun().

               {
    RunPrincipal& rp = runPrincipal();
    ProductPtrVec::iterator pit(putProducts().begin());
    ProductPtrVec::iterator pie(putProducts().end());

    while(pit != pie) {
        rp.put(*pit->second, pit->first);
        // Ownership has passed, so clear the pointer.
        pit->first.reset();
        ++pit;
    }

    // the cleanup is all or none
    putProducts().clear();
  }
void Run::getAllProvenance ( std::vector< Provenance const * > &  provenances) const

Definition at line 35 of file Run.cc.

References edm::Principal::getAllProvenance(), and runPrincipal().

Referenced by GlobalHitsProdHistStripper::beginRun(), and L1GtUtils::getL1GtTriggerMenuLiteInputTag().

                                                                       {
    runPrincipal().getAllProvenance(provenances);
  }
template<typename PROD >
bool Run::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

same as above, but using the InputTag class

Reimplemented from edm::RunBase.

Definition at line 173 of file Run.h.

References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.

                                                                 {
    return provRecorder_.getByLabel(tag, result);
  }
template<typename PROD >
bool Run::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const
template<typename PROD >
bool Run::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const

Definition at line 164 of file Run.h.

References edm::PrincipalGetAdapter::getByLabel(), and provRecorder_.

                                              {
    return provRecorder_.getByLabel(label, productInstanceName, result);
  }
BasicHandle Run::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const [private, virtual]

Implements edm::RunBase.

Definition at line 109 of file Run.cc.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByLabel_(), h, edm::BasicHandle::isValid(), edm::BasicHandle::provenance(), and provRecorder_.

                                                                                                       {
    BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType), iTag);
    if(h.isValid()) {
      addToGotBranchIDs(*(h.provenance()));
    }
    return h;
  }
template<typename PROD >
void Run::getManyByType ( std::vector< Handle< PROD > > &  results) const
Provenance Run::getProvenance ( BranchID const &  theID) const

Definition at line 30 of file Run.cc.

References edm::Principal::getProvenance(), and runPrincipal().

                                              {
    return runPrincipal().getProvenance(bid);
  }
ProcessHistory const & Run::processHistory ( ) const
ProcessHistoryID const & Run::processHistoryID ( ) const

Definition at line 94 of file Run.cc.

References edm::Principal::processHistoryID(), and runPrincipal().

                              {
    return runPrincipal().processHistoryID();
  }
template<typename PROD >
void edm::Run::put ( std::auto_ptr< PROD >  product) [inline]
template<typename PROD >
void Run::put ( std::auto_ptr< PROD >  product,
std::string const &  productInstanceName 
)

Put a new product with a 'product instance name'.

Definition at line 133 of file Run.h.

References edm::PrincipalGetAdapter::getBranchDescription(), PROD, provRecorder_, putProducts(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), and relativeConstraints::value.

                                                                          {
    if (product.get() == 0) {                // null pointer is illegal
      TypeID typeID(typeid(PROD));
      principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, productInstanceName);
    }

    // The following will call post_insert if T has such a function,
    // and do nothing if T has no such function.
    typename boost::mpl::if_c<detail::has_postinsert<PROD>::value,
      DoPostInsert<PROD>,
      DoNotPostInsert<PROD> >::type maybe_inserter;
    maybe_inserter(product.get());

    ConstBranchDescription const& desc =
      provRecorder_.getBranchDescription(TypeID(*product), productInstanceName);

    WrapperOwningHolder edp(new Wrapper<PROD>(product), Wrapper<PROD>::getInterface());
    putProducts().push_back(std::make_pair(edp, &desc));

    // product.release(); // The object has been copied into the Wrapper.
    // The old copy must be deleted, so we cannot release ownership.
  }
ProductPtrVec const& edm::Run::putProducts ( ) const [inline, private]

Definition at line 109 of file Run.h.

References putProducts_.

{return putProducts_;}
ProductPtrVec& edm::Run::putProducts ( ) [inline, private]

Definition at line 108 of file Run.h.

References putProducts_.

Referenced by commit_(), and put().

{return putProducts_;}
RunAuxiliary const& edm::Run::runAuxiliary ( ) const [inline, virtual]

Implements edm::RunBase.

Definition at line 40 of file Run.h.

References aux_.

Referenced by L1GtUtils::getL1GtRunCache(), L1GtUtils::getL1GtTriggerMenuLiteInputTag(), and L1GtUtils::retrieveL1GtTriggerMenuLite().

{return aux_;}
RunPrincipal const & Run::runPrincipal ( ) const [private]

Definition at line 25 of file Run.cc.

References compareJSON::const, edm::PrincipalGetAdapter::principal(), and provRecorder_.

Referenced by commit_(), getAllProvenance(), getProvenance(), and processHistoryID().

                          {
    return dynamic_cast<RunPrincipal const&>(provRecorder_.principal());
  }
RunPrincipal & Run::runPrincipal ( ) [private]

Definition at line 20 of file Run.cc.

References edm::PrincipalGetAdapter::principal(), and provRecorder_.

                    {
    return dynamic_cast<RunPrincipal&>(provRecorder_.principal());
  }

Friends And Related Function Documentation

friend class DaqSource [friend]

Definition at line 115 of file Run.h.

friend class EDFilter [friend]

Definition at line 118 of file Run.h.

friend class EDProducer [friend]

Definition at line 119 of file Run.h.

friend class InputSource [friend]

Definition at line 116 of file Run.h.

friend class RawInputSource [friend]

Definition at line 117 of file Run.h.


Member Data Documentation

RunAuxiliary const& edm::Run::aux_ [private]

Definition at line 126 of file Run.h.

Referenced by runAuxiliary().

Definition at line 128 of file Run.h.

Referenced by addToGotBranchIDs().

Definition at line 124 of file Run.h.

Referenced by getByLabel(), getByLabelImpl(), getManyByType(), processHistory(), put(), and runPrincipal().

Definition at line 125 of file Run.h.

Referenced by putProducts(), and ~Run().