CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

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 More...
 
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)
 Put a new product. More...
 
template<typename PROD >
void put (std::auto_ptr< PROD > product, std::string const &productInstanceName)
 Put a new product with a 'product instance name'. More...
 
 ~LuminosityBlock ()
 
- Public Member Functions inherited from edm::LuminosityBlockBase
Timestamp const & beginTime () const
 
Timestamp const & endTime () const
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) const
 same as above, but using the InputTag class More...
 
template<class T >
bool getByLabel (const InputTag &tag, Handle< T > &result) const
 
LuminosityBlockID id () const
 
LuminosityBlockNumber_t luminosityBlock () const
 
 LuminosityBlockBase ()
 
RunNumber_t run () const
 
virtual ~LuminosityBlockBase ()
 

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
 
LuminosityBlockPrincipal const & luminosityBlockPrincipal () const
 
LuminosityBlockPrincipalluminosityBlockPrincipal ()
 
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 35 of file LuminosityBlock.h.

Member Typedef Documentation

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

Definition at line 130 of file LuminosityBlock.h.

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

Definition at line 108 of file LuminosityBlock.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file LuminosityBlock.cc.

8  :
9  provRecorder_(lbp, md),
10  aux_(lbp.aux()),
11  run_(new Run(lbp.runPrincipal(), md)) {
12  }
LuminosityBlockAuxiliary const & aux_
PrincipalGetAdapter provRecorder_
boost::shared_ptr< Run const > const run_
LuminosityBlock::~LuminosityBlock ( )

Definition at line 14 of file LuminosityBlock.cc.

References edm::for_all(), and putProducts_.

14  {
15  // anything left here must be the result of a failure
16  // let's record them as failed attempts in the event principal
17  for_all(putProducts_, principal_get_adapter_detail::deleter());
18  }
ProductPtrVec putProducts_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16

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().

72  {
73  gotBranchIDs_.insert(prov.branchID());
74  }
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::EDProducer::doBeginLuminosityBlock(), edm::EDFilter::doBeginLuminosityBlock(), edm::InputSource::doEndLumi(), edm::EDProducer::doEndLuminosityBlock(), and edm::EDFilter::doEndLuminosityBlock().

44  {
45  // fill in guts of provenance here
46  LuminosityBlockPrincipal & lbp = luminosityBlockPrincipal();
47  ProductPtrVec::iterator pit(putProducts().begin());
48  ProductPtrVec::iterator pie(putProducts().end());
49 
50  while(pit!=pie) {
51  // set provenance
52  std::auto_ptr<ProductProvenance> lumiEntryInfoPtr(
53  new ProductProvenance(pit->second->branchID(),
55  std::auto_ptr<EDProduct> pr(pit->first);
56  // Ownership has passed, so clear the pointer.
57  pit->first = 0;
58  lbp.put(*pit->second, pr, lumiEntryInfoPtr);
59  ++pit;
60  }
61 
62  // the cleanup is all or none
63  putProducts().clear();
64  }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
#define end
Definition: vmac.h:38
ProductPtrVec & putProducts()
ProductStatus present()
Definition: ProductStatus.h:17
#define begin
Definition: vmac.h:31
template<typename PROD >
bool LuminosityBlock::get ( SelectorBase const &  sel,
Handle< PROD > &  result 
) const

Definition at line 162 of file LuminosityBlock.h.

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

Referenced by Options.Options::__getitem__().

162  {
163  return provRecorder_.get(sel,result);
164  }
bool get(SelectorBase const &, Handle< PROD > &result) const
PrincipalGetAdapter provRecorder_
void LuminosityBlock::getAllProvenance ( std::vector< Provenance const * > &  provenances) const

Definition at line 37 of file LuminosityBlock.cc.

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

38  {
40  }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Principal.cc:562
template<typename PROD >
bool LuminosityBlock::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const
template<typename PROD >
bool LuminosityBlock::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const

Definition at line 174 of file LuminosityBlock.h.

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

176  {
177  return provRecorder_.getByLabel(label,productInstanceName,result);
178  }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
const std::string & label
Definition: MVAComputer.cc:186
PrincipalGetAdapter provRecorder_
template<typename PROD >
bool LuminosityBlock::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

same as above, but using the InputTag class

Definition at line 183 of file LuminosityBlock.h.

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

183  {
184  return provRecorder_.getByLabel(tag,result);
185  }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
PrincipalGetAdapter provRecorder_
BasicHandle LuminosityBlock::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
privatevirtual

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_.

77  {
78  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType),iTag);
79  if (h.isValid()) {
80  addToGotBranchIDs(*(h.provenance()));
81  }
82  return h;
83  }
void addToGotBranchIDs(Provenance const &prov) const
BasicHandle getByLabel_(TypeID const &tid, std::string const &label, std::string const &productInstanceName, std::string const &processName) const
PrincipalGetAdapter provRecorder_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
template<typename PROD >
bool LuminosityBlock::getByType ( Handle< PROD > &  result) const

Definition at line 195 of file LuminosityBlock.h.

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

Referenced by GenFilterEfficiencyAnalyzer::endLuminosityBlock().

195  {
196  return provRecorder_.getByType(result);
197  }
PrincipalGetAdapter provRecorder_
bool getByType(Handle< PROD > &result) const
template<typename PROD >
void LuminosityBlock::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD > > &  results 
) const

Definition at line 189 of file LuminosityBlock.h.

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

189  {
191  }
void getMany(SelectorBase const &, std::vector< Handle< PROD > > &results) const
PrincipalGetAdapter provRecorder_
template<typename PROD >
void LuminosityBlock::getManyByType ( std::vector< Handle< PROD > > &  results) const

Definition at line 201 of file LuminosityBlock.h.

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

201  {
203  }
void getManyByType(std::vector< Handle< PROD > > &results) const
PrincipalGetAdapter provRecorder_
Provenance LuminosityBlock::getProvenance ( BranchID const &  theID) const

Definition at line 31 of file LuminosityBlock.cc.

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

32  {
34  }
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
Provenance getProvenance(BranchID const &bid) const
Definition: Principal.cc:538
Run const& edm::LuminosityBlock::getRun ( ) const
inline

Definition at line 75 of file LuminosityBlock.h.

References run_.

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

75  {
76  return *run_;
77  }
boost::shared_ptr< Run const > const run_
LuminosityBlockAuxiliary const& edm::LuminosityBlock::luminosityBlockAuxiliary ( ) const
inlinevirtual

Implements edm::LuminosityBlockBase.

Definition at line 41 of file LuminosityBlock.h.

References aux_.

41 {return aux_;}
LuminosityBlockAuxiliary const & 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().

26  {
27  return dynamic_cast<LuminosityBlockPrincipal const&>(provRecorder_.principal());
28  }
string const
Definition: compareJSON.py:14
PrincipalGetAdapter provRecorder_
LuminosityBlockPrincipal & LuminosityBlock::luminosityBlockPrincipal ( )
private

Definition at line 21 of file LuminosityBlock.cc.

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

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

Definition at line 67 of file LuminosityBlock.cc.

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

67  {
69  }
ProcessHistory const & processHistory() const
PrincipalGetAdapter provRecorder_
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 136 of file LuminosityBlock.h.

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

136  {
137  if (product.get() == 0) { // null pointer is illegal
138  TypeID typeID(typeid(PROD));
139  principal_get_adapter_detail::throwOnPutOfNullProduct("LuminosityBlock", typeID, productInstanceName);
140  }
141 
142  // The following will call post_insert if T has such a function,
143  // and do nothing if T has no such function.
145  DoPostInsert<PROD>,
146  DoNotPostInsert<PROD> >::type maybe_inserter;
147  maybe_inserter(product.get());
148 
149  ConstBranchDescription const& desc =
150  provRecorder_.getBranchDescription(TypeID(*product), productInstanceName);
151 
152  Wrapper<PROD> *wp(new Wrapper<PROD>(product));
153 
154  putProducts().push_back(std::make_pair(wp, &desc));
155 
156  // product.release(); // The object has been copied into the Wrapper.
157  // The old copy must be deleted, so we cannot release ownership.
158  }
type
Definition: HCALResponse.h:22
ProductPtrVec & putProducts()
PrincipalGetAdapter provRecorder_
#define PROD(A, B)
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
ConstBranchDescription const & getBranchDescription(TypeID const &type, std::string const &productInstanceName) const
ProductPtrVec& edm::LuminosityBlock::putProducts ( )
inlineprivate

Definition at line 109 of file LuminosityBlock.h.

References putProducts_.

Referenced by commit_(), and put().

109 {return putProducts_;}
ProductPtrVec putProducts_
ProductPtrVec const& edm::LuminosityBlock::putProducts ( ) const
inlineprivate

Definition at line 110 of file LuminosityBlock.h.

References putProducts_.

110 {return putProducts_;}
ProductPtrVec putProducts_

Friends And Related Function Documentation

friend class ConfigurableInputSource
friend

Definition at line 116 of file LuminosityBlock.h.

friend class DaqSource
friend

Definition at line 118 of file LuminosityBlock.h.

friend class EDFilter
friend

Definition at line 120 of file LuminosityBlock.h.

friend class EDProducer
friend

Definition at line 121 of file LuminosityBlock.h.

friend class InputSource
friend

Definition at line 117 of file LuminosityBlock.h.

friend class RawInputSource
friend

Definition at line 119 of file LuminosityBlock.h.

Member Data Documentation

LuminosityBlockAuxiliary const& edm::LuminosityBlock::aux_
private

Definition at line 128 of file LuminosityBlock.h.

Referenced by luminosityBlockAuxiliary().

BranchIDSet edm::LuminosityBlock::gotBranchIDs_
mutableprivate

Definition at line 131 of file LuminosityBlock.h.

Referenced by addToGotBranchIDs().

PrincipalGetAdapter edm::LuminosityBlock::provRecorder_
private
ProductPtrVec edm::LuminosityBlock::putProducts_
private

Definition at line 127 of file LuminosityBlock.h.

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

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

Definition at line 129 of file LuminosityBlock.h.

Referenced by getRun().