CMS 3D CMS Logo

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

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 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
 
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...
 
 Run (RunPrincipal &rp, ModuleDescription const &md)
 
RunAuxiliary const & runAuxiliary () const
 
 ~Run ()
 
- Public Member Functions inherited from edm::RunBase
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
 
RunID const & id () const
 
RunNumber_t run () const
 
 RunBase ()
 
virtual ~RunBase ()
 

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
 
ProductPtrVecputProducts ()
 
ProductPtrVec const & putProducts () const
 
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 31 of file Run.h.

Member Typedef Documentation

Definition at line 36 of file Run.h.

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

Definition at line 136 of file Run.h.

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

Definition at line 115 of file Run.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file Run.cc.

8  :
9  provRecorder_(rp, md),
10  aux_(rp.aux()) {
11  }
RunAuxiliary const & aux_
Definition: Run.h:135
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
Run::~Run ( )

Definition at line 13 of file Run.cc.

References edm::for_all(), and putProducts_.

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

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

105  {
106  gotBranchIDs_.insert(prov.branchID());
107  }
BranchIDSet gotBranchIDs_
Definition: Run.h:137
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::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::InputSource::doBeginRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), and edm::InputSource::doEndRun().

77  {
78  // fill in guts of provenance here
79  RunPrincipal& rp = runPrincipal();
80  ProductPtrVec::iterator pit(putProducts().begin());
81  ProductPtrVec::iterator pie(putProducts().end());
82 
83  while(pit != pie) {
84  // set provenance
85  std::auto_ptr<ProductProvenance> runEntryInfoPtr(
86  new ProductProvenance(pit->second->branchID(),
88  std::auto_ptr<EDProduct> pr(pit->first);
89  // Ownership has passed, so clear the pointer.
90  pit->first = 0;
91  rp.put(*pit->second, pr, runEntryInfoPtr);
92  ++pit;
93  }
94 
95  // the cleanup is all or none
96  putProducts().clear();
97  }
#define end
Definition: vmac.h:38
RunPrincipal const & runPrincipal() const
Definition: Run.cc:25
ProductStatus present()
Definition: ProductStatus.h:17
ProductPtrVec & putProducts()
Definition: Run.h:116
#define begin
Definition: vmac.h:31
template<typename PROD >
bool Run::get ( SelectorBase const &  sel,
Handle< PROD > &  result 
) const

Definition at line 168 of file Run.h.

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

Referenced by Options.Options::__getitem__().

168  {
169  return provRecorder_.get(sel,result);
170  }
bool get(SelectorBase const &, Handle< PROD > &result) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
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().

35  {
36  runPrincipal().getAllProvenance(provenances);
37  }
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Principal.cc:562
RunPrincipal const & runPrincipal() const
Definition: Run.cc:25
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 180 of file Run.h.

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

182  {
183  return provRecorder_.getByLabel(label,productInstanceName,result);
184  }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
const std::string & label
Definition: MVAComputer.cc:186
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
template<typename PROD >
bool Run::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

same as above, but using the InputTag class

Definition at line 189 of file Run.h.

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

189  {
190  return provRecorder_.getByLabel(tag,result);
191  }
bool getByLabel(std::string const &label, Handle< PROD > &result) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
BasicHandle Run::getByLabelImpl ( const std::type_info &  iWrapperType,
const std::type_info &  iProductType,
const InputTag iTag 
) const
privatevirtual

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

110  {
111  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType),iTag);
112  if (h.isValid()) {
113  addToGotBranchIDs(*(h.provenance()));
114  }
115  return h;
116  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Run.cc:105
BasicHandle getByLabel_(TypeID const &tid, std::string const &label, std::string const &productInstanceName, std::string const &processName) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
template<typename PROD >
bool Run::getByType ( Handle< PROD > &  result) const

Definition at line 201 of file Run.h.

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

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

201  {
202  return provRecorder_.getByType(result);
203  }
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
bool getByType(Handle< PROD > &result) const
template<typename PROD >
void Run::getMany ( SelectorBase const &  sel,
std::vector< Handle< PROD > > &  results 
) const

Definition at line 195 of file Run.h.

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

195  {
197  }
void getMany(SelectorBase const &, std::vector< Handle< PROD > > &results) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
template<typename PROD >
void Run::getManyByType ( std::vector< Handle< PROD > > &  results) const

Definition at line 207 of file Run.h.

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

Referenced by edm::HadronizerFilter< HAD, DEC >::beginRun(), and GlobalHitsProdHistStripper::endRun().

207  {
209  }
void getManyByType(std::vector< Handle< PROD > > &results) const
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
Provenance Run::getProvenance ( BranchID const &  theID) const

Definition at line 30 of file Run.cc.

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

30  {
31  return runPrincipal().getProvenance(bid);
32  }
RunPrincipal const & runPrincipal() const
Definition: Run.cc:25
Provenance getProvenance(BranchID const &bid) const
Definition: Principal.cc:538
ProcessHistory const & Run::processHistory ( ) const

Definition at line 100 of file Run.cc.

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

Referenced by pat::PATTriggerEventProducer::beginRun(), pat::PATTriggerProducer::beginRun(), and HLTConfigProvider::init().

100  {
101  return provRecorder_.processHistory();
102  }
ProcessHistory const & processHistory() const
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
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 142 of file Run.h.

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

142  {
143  if (product.get() == 0) { // null pointer is illegal
144  TypeID typeID(typeid(PROD));
145  principal_get_adapter_detail::throwOnPutOfNullProduct("Run", typeID, productInstanceName);
146  }
147 
148  // The following will call post_insert if T has such a function,
149  // and do nothing if T has no such function.
151  DoPostInsert<PROD>,
152  DoNotPostInsert<PROD> >::type maybe_inserter;
153  maybe_inserter(product.get());
154 
155  ConstBranchDescription const& desc =
156  provRecorder_.getBranchDescription(TypeID(*product), productInstanceName);
157 
158  Wrapper<PROD> *wp(new Wrapper<PROD>(product));
159 
160  putProducts().push_back(std::make_pair(wp, &desc));
161 
162  // product.release(); // The object has been copied into the Wrapper.
163  // The old copy must be deleted, so we cannot release ownership.
164  }
type
Definition: HCALResponse.h:22
ProductPtrVec & putProducts()
Definition: Run.h:116
#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
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
ProductPtrVec& edm::Run::putProducts ( )
inlineprivate

Definition at line 116 of file Run.h.

References putProducts_.

Referenced by commit_(), and put().

116 {return putProducts_;}
ProductPtrVec putProducts_
Definition: Run.h:134
ProductPtrVec const& edm::Run::putProducts ( ) const
inlineprivate

Definition at line 117 of file Run.h.

References putProducts_.

117 {return putProducts_;}
ProductPtrVec putProducts_
Definition: Run.h:134
RunAuxiliary const& edm::Run::runAuxiliary ( ) const
inlinevirtual

Implements edm::RunBase.

Definition at line 38 of file Run.h.

References aux_.

Referenced by L1GtUtils::retrieveL1GtTriggerMenuLite().

38 {return aux_;}
RunAuxiliary const & aux_
Definition: Run.h:135
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().

25  {
26  return dynamic_cast<RunPrincipal const&>(provRecorder_.principal());
27  }
string const
Definition: compareJSON.py:14
PrincipalGetAdapter provRecorder_
Definition: Run.h:133
RunPrincipal & Run::runPrincipal ( )
private

Definition at line 20 of file Run.cc.

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

20  {
21  return dynamic_cast<RunPrincipal&>(provRecorder_.principal());
22  }
PrincipalGetAdapter provRecorder_
Definition: Run.h:133

Friends And Related Function Documentation

friend class ConfigurableInputSource
friend

Definition at line 123 of file Run.h.

friend class DaqSource
friend

Definition at line 124 of file Run.h.

friend class EDFilter
friend

Definition at line 127 of file Run.h.

friend class EDProducer
friend

Definition at line 128 of file Run.h.

friend class InputSource
friend

Definition at line 125 of file Run.h.

friend class RawInputSource
friend

Definition at line 126 of file Run.h.

Member Data Documentation

RunAuxiliary const& edm::Run::aux_
private

Definition at line 135 of file Run.h.

Referenced by runAuxiliary().

BranchIDSet edm::Run::gotBranchIDs_
mutableprivate

Definition at line 137 of file Run.h.

Referenced by addToGotBranchIDs().

PrincipalGetAdapter edm::Run::provRecorder_
private
ProductPtrVec edm::Run::putProducts_
private

Definition at line 134 of file Run.h.

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