CMS 3D CMS Logo

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

edm::LuminosityBlock Class Reference

#include <LuminosityBlock.h>

Inheritance diagram for edm::LuminosityBlock:
edm::LuminosityBlockBase

List of all members.

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
Run const & getRun () const
 LuminosityBlock (LuminosityBlockPrincipal &lbp, ModuleDescription const &md)
LuminosityBlockAuxiliary const & luminosityBlockAuxiliary () const
ProcessHistory const & processHistory () const
template<typename PROD >
void put (std::auto_ptr< PROD > product, std::string const &productInstanceName)
 Put a new product with a 'product instance name'.
template<typename PROD >
void put (std::auto_ptr< PROD > product)
 Put a new product.
 ~LuminosityBlock ()

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 (const std::type_info &iWrapperType, const std::type_info &iProductType, const InputTag &iTag) const
LuminosityBlockPrincipalluminosityBlockPrincipal ()
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
ProductPtrVecputProducts ()
ProductPtrVec const & putProducts () const

Private Attributes

LuminosityBlockAuxiliary const & aux_
BranchIDSet gotBranchIDs_
PrincipalGetAdapter provRecorder_
ProductPtrVec putProducts_
boost::shared_ptr< Run const >
const 
run_

Friends

class ConfigurableInputSource
class DaqSource
class EDFilter
class EDProducer
class InputSource
class RawInputSource

Detailed Description

Definition at line 34 of file LuminosityBlock.h.


Member Typedef Documentation

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

Definition at line 129 of file LuminosityBlock.h.

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

Definition at line 107 of file LuminosityBlock.h.


Constructor & Destructor Documentation

LuminosityBlock::LuminosityBlock ( LuminosityBlockPrincipal lbp,
ModuleDescription const &  md 
)

Definition at line 8 of file LuminosityBlock.cc.

                                                                                             :
        provRecorder_(lbp, md),
        aux_(lbp.aux()),
        run_(new Run(lbp.runPrincipal(), md)) {
  }
LuminosityBlock::~LuminosityBlock ( )

Definition at line 14 of file LuminosityBlock.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 LuminosityBlock::addToGotBranchIDs ( Provenance const &  prov) const [private]

Definition at line 72 of file LuminosityBlock.cc.

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

Referenced by getByLabelImpl().

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

Definition at line 44 of file LuminosityBlock.cc.

References begin, end, luminosityBlockPrincipal(), edm::productstatus::present(), edm::LuminosityBlockPrincipal::put(), and putProducts().

Referenced by edm::InputSource::doBeginLumi(), edm::EDFilter::doBeginLuminosityBlock(), edm::EDProducer::doBeginLuminosityBlock(), edm::InputSource::doEndLumi(), edm::EDFilter::doEndLuminosityBlock(), and edm::EDProducer::doEndLuminosityBlock().

                           {
    // fill in guts of provenance here
    LuminosityBlockPrincipal & lbp = luminosityBlockPrincipal();
    ProductPtrVec::iterator pit(putProducts().begin());
    ProductPtrVec::iterator pie(putProducts().end());

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

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

Definition at line 161 of file LuminosityBlock.h.

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

                                                                          {
    return provRecorder_.get(sel,result);
  }
void LuminosityBlock::getAllProvenance ( std::vector< Provenance const * > &  provenances) const

Definition at line 37 of file LuminosityBlock.cc.

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

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

same as above, but using the InputTag class

Reimplemented from edm::LuminosityBlockBase.

Definition at line 182 of file LuminosityBlock.h.

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

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

Definition at line 173 of file LuminosityBlock.h.

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

                                              {
    return provRecorder_.getByLabel(label,productInstanceName,result);
  }
template<typename PROD >
bool LuminosityBlock::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const
BasicHandle LuminosityBlock::getByLabelImpl ( const std::type_info &  iWrapperType,
const std::type_info &  iProductType,
const InputTag iTag 
) const [private, virtual]

Implements edm::LuminosityBlockBase.

Definition at line 77 of file LuminosityBlock.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 LuminosityBlock::getByType ( Handle< PROD > &  result) const

Definition at line 194 of file LuminosityBlock.h.

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

Referenced by GenFilterEfficiencyAnalyzer::endLuminosityBlock().

                                                       {
    return provRecorder_.getByType(result);
  }
template<typename PROD >
void LuminosityBlock::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD > > &  results 
) const
template<typename PROD >
void LuminosityBlock::getManyByType ( std::vector< Handle< PROD > > &  results) const
Provenance LuminosityBlock::getProvenance ( BranchID const &  theID) const

Definition at line 31 of file LuminosityBlock.cc.

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

  {
    return luminosityBlockPrincipal().getProvenance(bid);
  }
Run const& edm::LuminosityBlock::getRun ( ) const [inline]

Definition at line 74 of file LuminosityBlock.h.

References run_.

Referenced by edm::Event::getRun().

                   {
      return *run_;
    }
LuminosityBlockAuxiliary const& edm::LuminosityBlock::luminosityBlockAuxiliary ( ) const [inline, virtual]

Implements edm::LuminosityBlockBase.

Definition at line 40 of file LuminosityBlock.h.

References aux_.

{return aux_;}
LuminosityBlockPrincipal const & LuminosityBlock::luminosityBlockPrincipal ( ) const [private]

Definition at line 26 of file LuminosityBlock.cc.

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

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

                                                  {
    return dynamic_cast<LuminosityBlockPrincipal const&>(provRecorder_.principal());
  }
LuminosityBlockPrincipal & LuminosityBlock::luminosityBlockPrincipal ( ) [private]

Definition at line 21 of file LuminosityBlock.cc.

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

                                            {
    return dynamic_cast<LuminosityBlockPrincipal &>(provRecorder_.principal());
  }
ProcessHistory const & LuminosityBlock::processHistory ( ) const

Definition at line 67 of file LuminosityBlock.cc.

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

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

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

Definition at line 135 of file LuminosityBlock.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("LuminosityBlock", 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::LuminosityBlock::putProducts ( ) [inline, private]

Definition at line 108 of file LuminosityBlock.h.

References putProducts_.

Referenced by commit_(), and put().

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

Definition at line 109 of file LuminosityBlock.h.

References putProducts_.

{return putProducts_;}

Friends And Related Function Documentation

friend class ConfigurableInputSource [friend]

Definition at line 115 of file LuminosityBlock.h.

friend class DaqSource [friend]

Definition at line 117 of file LuminosityBlock.h.

friend class EDFilter [friend]

Definition at line 119 of file LuminosityBlock.h.

friend class EDProducer [friend]

Definition at line 120 of file LuminosityBlock.h.

friend class InputSource [friend]

Definition at line 116 of file LuminosityBlock.h.

friend class RawInputSource [friend]

Definition at line 118 of file LuminosityBlock.h.


Member Data Documentation

Definition at line 127 of file LuminosityBlock.h.

Referenced by luminosityBlockAuxiliary().

Definition at line 130 of file LuminosityBlock.h.

Referenced by addToGotBranchIDs().

Definition at line 126 of file LuminosityBlock.h.

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

boost::shared_ptr<Run const> const edm::LuminosityBlock::run_ [private]

Definition at line 128 of file LuminosityBlock.h.

Referenced by getRun().