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
ProcessHistoryID const & processHistoryID () 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
< 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
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 37 of file LuminosityBlock.h.


Member Typedef Documentation

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

Definition at line 134 of file LuminosityBlock.h.

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

Definition at line 112 of file LuminosityBlock.h.


Constructor & Destructor Documentation

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

Definition at line 9 of file LuminosityBlock.cc.

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

Definition at line 15 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 69 of file LuminosityBlock.cc.

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

Referenced by getByLabelImpl().

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

Definition at line 42 of file LuminosityBlock.cc.

References begin, end, luminosityBlockPrincipal(), 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().

                           {
    LuminosityBlockPrincipal& lbp = luminosityBlockPrincipal();
    ProductPtrVec::iterator pit(putProducts().begin());
    ProductPtrVec::iterator pie(putProducts().end());

    while(pit != pie) {
        lbp.put(*pit->second, pit->first);
        // Ownership has passed, so clear the pointer.
        pit->first.reset();
        ++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 165 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 186 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 177 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 ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const [private, virtual]

Implements edm::LuminosityBlockBase.

Definition at line 74 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 198 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 32 of file LuminosityBlock.cc.

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

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

Definition at line 77 of file LuminosityBlock.h.

References run_.

Referenced by LumiCalculator::endLuminosityBlock(), and edm::Event::getRun().

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

Implements edm::LuminosityBlockBase.

Definition at line 43 of file LuminosityBlock.h.

References aux_.

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

Definition at line 27 of file LuminosityBlock.cc.

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

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

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

Definition at line 22 of file LuminosityBlock.cc.

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

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

Definition at line 64 of file LuminosityBlock.cc.

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

                                        {
    return provRecorder_.processHistory();
  }
ProcessHistoryID const & LuminosityBlock::processHistoryID ( ) const

Definition at line 59 of file LuminosityBlock.cc.

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

                                          {
    return luminosityBlockPrincipal().processHistoryID();
  }
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 140 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);

    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.
  }
template<typename PROD >
void edm::LuminosityBlock::put ( std::auto_ptr< PROD >  product) [inline]
ProductPtrVec const& edm::LuminosityBlock::putProducts ( ) const [inline, private]

Definition at line 114 of file LuminosityBlock.h.

References putProducts_.

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

Definition at line 113 of file LuminosityBlock.h.

References putProducts_.

Referenced by commit_(), and put().

{return putProducts_;}

Friends And Related Function Documentation

friend class ConfigurableInputSource [friend]

Definition at line 120 of file LuminosityBlock.h.

friend class DaqSource [friend]

Definition at line 122 of file LuminosityBlock.h.

friend class EDFilter [friend]

Definition at line 124 of file LuminosityBlock.h.

friend class EDProducer [friend]

Definition at line 125 of file LuminosityBlock.h.

friend class InputSource [friend]

Definition at line 121 of file LuminosityBlock.h.

friend class RawInputSource [friend]

Definition at line 123 of file LuminosityBlock.h.


Member Data Documentation

Definition at line 132 of file LuminosityBlock.h.

Referenced by luminosityBlockAuxiliary().

Definition at line 135 of file LuminosityBlock.h.

Referenced by addToGotBranchIDs().

Definition at line 131 of file LuminosityBlock.h.

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

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

Definition at line 133 of file LuminosityBlock.h.

Referenced by getRun().