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

template<typename PROD >
bool get (SelectorBase const &, Handle< PROD > &result) const
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 >
bool getByType (Handle< PROD > &result) const
template<typename PROD >
void getMany (SelectorBase const &, std::vector< Handle< PROD > > &results) const
template<typename PROD >
void getManyByType (std::vector< Handle< PROD > > &results) const
Provenance getProvenance (BranchID const &theID) const
ProcessHistory const & processHistory () 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
< EDProduct
*, 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 ConfigurableInputSource
class DaqSource
class EDFilter
class EDProducer
class InputSource
class RawInputSource

Detailed Description

Definition at line 32 of file Run.h.


Member Typedef Documentation

Definition at line 37 of file Run.h.

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

Definition at line 137 of file Run.h.

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

Definition at line 116 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 105 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::productstatus::present(), edm::RunPrincipal::put(), putProducts(), and runPrincipal().

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

               {
    // fill in guts of provenance here
    RunPrincipal& rp = runPrincipal();
    ProductPtrVec::iterator pit(putProducts().begin());
    ProductPtrVec::iterator pie(putProducts().end());

    while(pit != pie) {
        // set provenance
        std::auto_ptr<ProductProvenance> runEntryInfoPtr(
                new ProductProvenance(pit->second->branchID(),
                                    productstatus::present()));
        std::auto_ptr<EDProduct> pr(pit->first);
        // Ownership has passed, so clear the pointer.
        pit->first = 0;
        rp.put(*pit->second, pr, runEntryInfoPtr);
        ++pit;
    }

    // the cleanup is all or none
    putProducts().clear();
  }
template<typename PROD >
bool Run::get ( SelectorBase const &  sel,
Handle< PROD > &  result 
) const

Definition at line 169 of file Run.h.

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

                                                              {
    return provRecorder_.get(sel, result);
  }
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 ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const

Definition at line 181 of file Run.h.

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

                                              {
    return provRecorder_.getByLabel(label, productInstanceName, result);
  }
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 190 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
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 110 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 >
bool Run::getByType ( Handle< PROD > &  result) const

Definition at line 202 of file Run.h.

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

Referenced by FWFFLooper::beginRun(), EveService::postBeginRun(), and FWFFService::postBeginRun().

                                           {
    return provRecorder_.getByType(result);
  }
template<typename PROD >
void Run::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD > > &  results 
) const

Definition at line 196 of file Run.h.

References edm::PrincipalGetAdapter::getMany(), provRecorder_, and python::entryComment::results.

                                                                               {
    return provRecorder_.getMany(sel, results);
  }
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
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 143 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);

    Wrapper<PROD> *wp(new Wrapper<PROD>(product));

    putProducts().push_back(std::make_pair(wp, &desc));

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

Definition at line 117 of file Run.h.

References putProducts_.

Referenced by commit_(), and put().

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

Definition at line 118 of file Run.h.

References putProducts_.

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

Implements edm::RunBase.

Definition at line 39 of file Run.h.

References aux_.

Referenced by 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(), and getProvenance().

                          {
    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 ConfigurableInputSource [friend]

Definition at line 124 of file Run.h.

friend class DaqSource [friend]

Definition at line 125 of file Run.h.

friend class EDFilter [friend]

Definition at line 128 of file Run.h.

friend class EDProducer [friend]

Definition at line 129 of file Run.h.

friend class InputSource [friend]

Definition at line 126 of file Run.h.

friend class RawInputSource [friend]

Definition at line 127 of file Run.h.


Member Data Documentation

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

Definition at line 136 of file Run.h.

Referenced by runAuxiliary().

Definition at line 138 of file Run.h.

Referenced by addToGotBranchIDs().

Definition at line 135 of file Run.h.

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