CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends
edm::Event Class Reference

#include <Event.h>

Inheritance diagram for edm::Event:
edm::EventBase

Public Types

typedef unsigned long CacheIdentifier_t
 
typedef std::vector< edm::propagate_const< std::unique_ptr< WrapperBase > > > ProductPtrVec
 

Public Member Functions

CacheIdentifier_t cacheIdentifier () const
 
template<typename PROD , typename... Args>
OrphanHandle< PRODemplace (EDPutTokenT< PROD > token, Args &&... args)
 puts a new product More...
 
template<typename PROD , typename... Args>
OrphanHandle< PRODemplace (EDPutToken token, Args &&... args)
 
 Event (EventTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *)
 
 Event (EventPrincipal const &, ModuleDescription const &, ModuleCallingContext const *)
 
EventAuxiliary const & eventAuxiliary () const override
 
EventSelectionIDVector const & eventSelectionIDs () const
 
template<typename ELEMENT >
Handle< View< ELEMENT > > fillView_ (BasicHandle &bh) const
 
template<typename PROD >
bool get (ProductID const &oid, Handle< PROD > &result) const
 
template<typename ELEMENT >
bool get (ProductID const &oid, Handle< View< ELEMENT >> &result) const
 
template<typename PROD >
PROD const & get (EDGetTokenT< PROD > token) const noexcept(false)
 
template<typename ELEMENT >
View< ELEMENT > const & get (EDGetTokenT< View< ELEMENT >> token) const noexcept(false)
 
void getAllProvenance (std::vector< Provenance const *> &provenances) const
 
void getAllStableProvenance (std::vector< StableProvenance const *> &provenances) const
 
template<>
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< GenericObject > &result) const
 Specialize the getByLabel method to work with a Handle<GenericObject> More...
 
template<>
bool getByLabel (InputTag const &tag, Handle< GenericObject > &result) const
 
template<>
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< GenericObject > &result) const
 Specialize the Event's getByLabel method to work with a Handle<GenericObject> More...
 
template<>
bool getByLabel (InputTag const &tag, Handle< GenericObject > &result) const
 
template<typename PROD >
bool getByLabel (InputTag const &tag, Handle< PROD > &result) 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 ELEMENT >
bool getByLabel (std::string const &label, Handle< View< ELEMENT >> &result) const
 
template<typename ELEMENT >
bool getByLabel (std::string const &label, std::string const &productInstanceName, Handle< View< ELEMENT >> &result) const
 
template<typename ELEMENT >
bool getByLabel (InputTag const &tag, Handle< View< ELEMENT >> &result) const
 
template<>
bool getByToken (EDGetToken token, Handle< GenericObject > &result) const
 Specialize the Event's getByToken method to work with a Handle<GenericObject> More...
 
template<>
bool getByToken (EDGetToken token, Handle< GenericObject > &result) const
 Specialize the Event's getByToken method to work with a Handle<GenericObject> More...
 
template<typename PROD >
bool getByToken (EDGetToken token, Handle< PROD > &result) const
 
template<typename PROD >
bool getByToken (EDGetTokenT< PROD > token, Handle< PROD > &result) const
 
template<typename ELEMENT >
bool getByToken (EDGetToken token, Handle< View< ELEMENT >> &result) const
 
template<typename ELEMENT >
bool getByToken (EDGetTokenT< View< ELEMENT >> token, Handle< View< ELEMENT >> &result) const
 
template<typename PROD >
Handle< PRODgetHandle (EDGetTokenT< PROD > token) const
 
template<typename ELEMENT >
Handle< View< ELEMENT > > getHandle (EDGetTokenT< View< ELEMENT >> token) const
 
LuminosityBlock const & getLuminosityBlock () const
 
bool getProcessParameterSet (std::string const &processName, ParameterSet &ps) const
 
Provenance const & getProvenance (BranchID const &theID) const
 
Provenance const & getProvenance (ProductID const &theID) const
 
template<typename PROD >
RefProd< PRODgetRefBeforePut ()
 
template<typename PROD >
RefProd< PRODgetRefBeforePut (std::string const &productInstanceName)
 
template<typename PROD >
RefProd< PRODgetRefBeforePut (EDPutTokenT< PROD >)
 
template<typename PROD >
RefProd< PRODgetRefBeforePut (EDPutToken)
 
Run const & getRun () const
 
StableProvenance const & getStableProvenance (BranchID const &theID) const
 
StableProvenance const & getStableProvenance (ProductID const &theID) const
 
void labelsForToken (EDGetToken const &iToken, ProductLabels &oLabels) const
 
ModuleCallingContext const * moduleCallingContext () const
 
edm::ParameterSet const * parameterSet (edm::ParameterSetID const &psID) const override
 
unsigned int processBlockIndex (std::string const &processName) const
 
ProcessHistory const & processHistory () const override
 
ProcessHistoryID const & processHistoryID () const
 
EDProductGetter const & productGetter () const
 
template<typename PROD >
OrphanHandle< PRODput (std::unique_ptr< PROD > product)
 Put a new product. More...
 
template<typename PROD >
OrphanHandle< PRODput (std::unique_ptr< PROD > product, std::string const &productInstanceName)
 Put a new product with a 'product instance name'. More...
 
template<typename PROD >
OrphanHandle< PRODput (EDPutToken token, std::unique_ptr< PROD > product)
 
template<typename PROD >
OrphanHandle< PRODput (EDPutTokenT< PROD > token, std::unique_ptr< PROD > product)
 
RunNumber_t run () const
 
void setConsumer (EDConsumerBase const *iConsumer)
 
void setProducer (ProducerBase const *iProd, std::vector< BranchID > *previousParentage, std::vector< BranchID > *gotBranchIDsFromAcquire=nullptr)
 
void setProducerCommon (ProducerBase const *iProd, std::vector< BranchID > *previousParentage)
 
void setProducerForAcquire (ProducerBase const *iProd, std::vector< BranchID > *previousParentage, std::vector< BranchID > &gotBranchIDsFromAcquire)
 
void setSharedResourcesAcquirer (SharedResourcesAcquirer *iResourceAcquirer)
 
size_t size () const
 
StreamID streamID () const
 
edm::TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const override
 
TriggerResultsByName triggerResultsByName (edm::TriggerResults const &triggerResults) const override
 
 ~Event () override
 
- Public Member Functions inherited from edm::EventBase
int bunchCrossing () const
 
 EventBase ()
 
edm::EventAuxiliary::ExperimentType experimentType () const
 
template<typename T >
bool get (ProductID const &, Handle< T > &) const
 
template<>
bool getByLabel (edm::InputTag const &tag, Handle< FWGenericObject > &result) const
 Specialize the getByLabel method to work with a Handle<FWGenericObject> More...
 
template<typename T >
bool getByLabel (InputTag const &, Handle< T > &) const
 
template<typename T >
bool getByToken (edm::EDGetTokenT< T > const &token, edm::Handle< T > &result) const
 
edm::EventID id () const
 
bool isRealData () const
 
edm::LuminosityBlockNumber_t luminosityBlock () const
 
int orbitNumber () const
 
edm::Timestamp time () const
 
virtual ~EventBase ()
 

Private Types

typedef std::unordered_set< BranchID::value_typeBranchIDSet
 

Private Member Functions

void addToGotBranchIDs (Provenance const &prov) const
 
void addToGotBranchIDs (BranchID const &branchID) const
 
void commit_ (std::vector< edm::ProductResolverIndex > const &iShouldPut, ParentageID *previousParentageId=nullptr)
 
void commit_aux (ProductPtrVec &products, ParentageID *previousParentageId=nullptr)
 
template<typename PROD , typename... Args>
OrphanHandle< PRODemplaceImpl (EDPutToken::value_type token, Args &&... args)
 
EventPrincipal const & eventPrincipal () const
 
void fillLuminosityBlock () const
 
BasicHandle getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const override
 
BasicHandle getByProductID_ (ProductID const &oid) const
 
BasicHandle getByTokenImpl (std::type_info const &iProductType, EDGetToken iToken) const override
 
BasicHandle getImpl (std::type_info const &iProductType, ProductID const &pid) const override
 
ProductID makeProductID (BranchDescription const &desc) const
 
template<typename PROD >
OrphanHandle< PRODputImpl (EDPutToken::value_type token, std::unique_ptr< PROD > product)
 
ProductPtrVecputProducts ()
 
ProductPtrVec const & putProducts () const
 

Private Attributes

EventAuxiliary const & aux_
 
BranchIDSet gotBranchIDs_
 
std::vector< BranchID > * gotBranchIDsFromAcquire_ = nullptr
 
std::vector< bool > gotBranchIDsFromPrevious_
 
std::vector< std::shared_ptr< ViewBase > > gotViews_
 
std::optional< LuminosityBlockluminosityBlock_
 
ModuleCallingContext const * moduleCallingContext_
 
std::vector< BranchID > * previousBranchIDs_ = nullptr
 
PrincipalGetAdapter provRecorder_
 
ProductPtrVec putProducts_
 
StreamID streamID_
 

Static Private Attributes

static const std::string emptyString_
 

Friends

class ::testEvent
 
class ::testEventGetRefBeforePut
 
class InputSource
 
class ProducerBase
 
class ProducerSourceBase
 
class RawInputSource
 
template<typename T >
class stream::ProducingModuleAdaptorBase
 

Additional Inherited Members

- Static Protected Member Functions inherited from edm::EventBase
static edm::ParameterSet const * parameterSetForID_ (edm::ParameterSetID const &psID)
 
static TriggerNames const * triggerNames_ (edm::TriggerResults const &triggerResults)
 

Detailed Description

Definition at line 73 of file Event.h.

Member Typedef Documentation

◆ BranchIDSet

typedef std::unordered_set<BranchID::value_type> edm::Event::BranchIDSet
private

Definition at line 325 of file Event.h.

◆ CacheIdentifier_t

typedef unsigned long edm::Event::CacheIdentifier_t

If you are caching data from the Event, you should also keep this number. If this number changes then you know that the data you have cached is invalid. The value of '0' will never be returned so you can use that to denote that you have not yet checked the value.

Definition at line 117 of file Event.h.

◆ ProductPtrVec

typedef std::vector<edm::propagate_const<std::unique_ptr<WrapperBase> > > edm::Event::ProductPtrVec

Definition at line 256 of file Event.h.

Constructor & Destructor Documentation

◆ Event() [1/2]

Event::Event ( EventTransitionInfo const &  info,
ModuleDescription const &  md,
ModuleCallingContext const *  mcc 
)

Definition at line 23 of file Event.cc.

24  : Event(info.principal(), md, mcc) {}
static const TGPicture * info(bool iBackgroundIsBlack)
Event(EventTransitionInfo const &, ModuleDescription const &, ModuleCallingContext const *)
Definition: Event.cc:23

◆ Event() [2/2]

Event::Event ( EventPrincipal const &  ep,
ModuleDescription const &  md,
ModuleCallingContext const *  moduleCallingContext 
)

Definition at line 26 of file Event.cc.

27  : provRecorder_(ep, md, true /*always at end*/),
28  aux_(ep.aux()),
30  gotBranchIDs_(),
31  gotViews_(),
32  streamID_(ep.streamID()),
std::optional< LuminosityBlock > luminosityBlock_
Definition: Event.h:319
BranchIDSet gotBranchIDs_
Definition: Event.h:326
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
std::vector< std::shared_ptr< ViewBase > > gotViews_
Definition: Event.h:335
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
EventAuxiliary const & aux_
Definition: Event.h:316
ModuleCallingContext const * moduleCallingContext() const
Definition: Event.h:250
StreamID streamID_
Definition: Event.h:337

◆ ~Event()

Event::~Event ( )
override

Definition at line 35 of file Event.cc.

35 {}

Member Function Documentation

◆ addToGotBranchIDs() [1/2]

void Event::addToGotBranchIDs ( Provenance const &  prov) const
private

Definition at line 235 of file Event.cc.

References edm::Provenance::originalBranchID().

Referenced by fillView_(), get(), getByLabel(), getByLabelImpl(), getByToken(), getByTokenImpl(), getHandle(), getImpl(), and setProducer().

235 { addToGotBranchIDs(prov.originalBranchID()); }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235

◆ addToGotBranchIDs() [2/2]

void Event::addToGotBranchIDs ( BranchID const &  branchID) const
private

Definition at line 237 of file Event.cc.

References gotBranchIDs_, gotBranchIDsFromAcquire_, gotBranchIDsFromPrevious_, edm::BranchID::id(), previousBranchIDs_, and FastTimerService_cff::range.

237  {
238  if (previousBranchIDs_) {
239  auto range = std::equal_range(previousBranchIDs_->begin(), previousBranchIDs_->end(), branchID);
240  if (range.first == range.second) {
241  gotBranchIDs_.insert(branchID.id());
242  } else {
243  gotBranchIDsFromPrevious_[range.first - previousBranchIDs_->begin()] = true;
244  }
245  } else if (gotBranchIDsFromAcquire_) {
246  gotBranchIDsFromAcquire_->push_back(branchID);
247  }
248  }
BranchIDSet gotBranchIDs_
Definition: Event.h:326
std::vector< BranchID > * gotBranchIDsFromAcquire_
Definition: Event.h:329
std::vector< bool > gotBranchIDsFromPrevious_
Definition: Event.h:327
std::vector< BranchID > * previousBranchIDs_
Definition: Event.h:328

◆ cacheIdentifier()

Event::CacheIdentifier_t Event::cacheIdentifier ( ) const

◆ commit_()

void Event::commit_ ( std::vector< edm::ProductResolverIndex > const &  iShouldPut,
ParentageID previousParentageId = nullptr 
)
private

Definition at line 156 of file Event.cc.

References commit_aux(), runTheMatrix::const, AlCaHLTBitMon_ParallelJobs::p, edm::PrincipalGetAdapter::principal(), provRecorder_, and putProducts().

156  {
157  size_t nPut = 0;
158  for (auto const& p : putProducts()) {
159  if (p) {
160  ++nPut;
161  }
162  }
163  if (nPut > 0) {
164  commit_aux(putProducts(), previousParentageId);
165  }
166  auto sz = iShouldPut.size();
167  if (sz != 0 and sz != nPut) {
168  //some were missed
169  auto& p = provRecorder_.principal();
170  for (auto index : iShouldPut) {
171  auto resolver = p.getProductResolverByIndex(index);
172  if (not resolver->productResolved()) {
173  dynamic_cast<ProductPutterBase const*>(resolver)->putProduct(std::unique_ptr<WrapperBase>());
174  }
175  }
176  }
177  }
void commit_aux(ProductPtrVec &products, ParentageID *previousParentageId=nullptr)
Definition: Event.cc:179
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const
ProductPtrVec & putProducts()
Definition: Event.h:306

◆ commit_aux()

void Event::commit_aux ( Event::ProductPtrVec products,
ParentageID previousParentageId = nullptr 
)
private

Definition at line 179 of file Event.cc.

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, eventPrincipal(), edm::get_underlying_safe(), gotBranchIDs_, gotBranchIDsFromPrevious_, mps_fire::i, edm::ParentageRegistry::insertMapped(), edm::ParentageRegistry::instance(), eostools::move(), dqmiodumpmetadata::n, AlCaHLTBitMon_ParallelJobs::p, previousBranchIDs_, edm::es::products(), provRecorder_, edm::PrincipalGetAdapter::putTokenIndexToProductResolverIndex(), edm::PrincipalGetAdapter::recordProvenanceList(), and jetUpdater_cfi::sort.

Referenced by commit_().

179  {
180  // fill in guts of provenance here
181  auto& ep = eventPrincipal();
182 
183  //If we don't have a valid previousParentage then we want to use a temp value in order to
184  // avoid constantly recalculating the ParentageID which is a time consuming operation
185  ParentageID const* presentParentageId;
186 
187  if (previousBranchIDs_) {
188  bool sameAsPrevious = gotBranchIDs_.empty();
189  if (sameAsPrevious) {
190  for (auto i : gotBranchIDsFromPrevious_) {
191  if (not i) {
192  sameAsPrevious = false;
193  break;
194  }
195  }
196  }
197  if (not sameAsPrevious) {
198  std::vector<BranchID> gotBranchIDVector{gotBranchIDs_.begin(), gotBranchIDs_.end()};
199  //add items in common from previous
200  auto n = gotBranchIDsFromPrevious_.size();
201  for (size_t i = 0; i < n; ++i) {
203  gotBranchIDVector.push_back((*previousBranchIDs_)[i]);
204  }
205  }
206  std::sort(gotBranchIDVector.begin(), gotBranchIDVector.end());
207  previousBranchIDs_->assign(gotBranchIDVector.begin(), gotBranchIDVector.end());
208 
209  Parentage p;
210  p.setParents(std::move(gotBranchIDVector));
211  *previousParentageId = p.id();
213  }
214  presentParentageId = previousParentageId;
215  } else {
216  presentParentageId = &s_emptyParentage;
217  }
218 
219  auto const& recordProv = provRecorder_.recordProvenanceList();
220  for (unsigned int i = 0; i < products.size(); ++i) {
221  auto& p = get_underlying_safe(products[i]);
222  if (p) {
223  if (recordProv[i]) {
224  ep.put(provRecorder_.putTokenIndexToProductResolverIndex()[i], std::move(p), *presentParentageId);
225  } else {
226  ep.put(provRecorder_.putTokenIndexToProductResolverIndex()[i], std::move(p), s_emptyParentage);
227  }
228  }
229  }
230 
231  // the cleanup is all or none
232  products.clear();
233  }
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
BranchIDSet gotBranchIDs_
Definition: Event.h:326
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::vector< bool > const & recordProvenanceList() const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
std::vector< bool > gotBranchIDsFromPrevious_
Definition: Event.h:327
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:8
std::vector< BranchID > * previousBranchIDs_
Definition: Event.h:328
bool insertMapped(value_type const &v)
def move(src, dest)
Definition: eostools.py:511

◆ emplace() [1/2]

template<typename PROD , typename... Args>
OrphanHandle< PROD > Event::emplace ( EDPutTokenT< PROD token,
Args &&...  args 
)

◆ emplace() [2/2]

template<typename PROD , typename... Args>
OrphanHandle< PROD > Event::emplace ( EDPutToken  token,
Args &&...  args 
)

Definition at line 439 of file Event.h.

References writedatasetfile::args, emplaceImpl(), edm::PrincipalGetAdapter::getTypeIDForPutTokenIndex(), PROD, provRecorder_, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), unpackBuffers-CaloStage2::token, and UNLIKELY.

439  {
440  if (UNLIKELY(token.isUninitialized())) {
442  }
443  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
446  }
447 
448  return emplaceImpl(token.index(), std::forward<Args>(args)...);
449  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
OrphanHandle< PROD > emplaceImpl(EDPutToken::value_type token, Args &&... args)
Definition: Event.h:452
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const

◆ emplaceImpl()

template<typename PROD , typename... Args>
OrphanHandle< PROD > Event::emplaceImpl ( EDPutToken::value_type  token,
Args &&...  args 
)
private

Definition at line 452 of file Event.h.

References writedatasetfile::args, cms::cuda::assert(), edm::PrincipalGetAdapter::getProductID(), eostools::move(), dumpMFGeometry_cfg::prod, PROD, provRecorder_, putProducts(), size(), relativeConstraints::value, and pfClustersFromHGC3DClusters_cfi::wp.

Referenced by emplace().

452  {
453  assert(index < putProducts().size());
454 
455  std::unique_ptr<Wrapper<PROD>> wp(new Wrapper<PROD>(WrapperBase::Emplace{}, std::forward<Args>(args)...));
456 
457  // The following will call post_insert if T has such a function,
458  // and do nothing if T has no such function.
459  std::conditional_t<detail::has_postinsert<PROD>::value, DoPostInsert<PROD>, DoNotPostInsert<PROD>> maybe_inserter;
460  maybe_inserter(&(wp->bareProduct()));
461 
462  PROD const* prod = wp->product();
463 
465  auto const& prodID = provRecorder_.getProductID(index);
466  return (OrphanHandle<PROD>(prod, prodID));
467  }
assert(be >=bs)
ProductID const & getProductID(unsigned int iPutTokenIndex) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
size_t size() const
Definition: Event.cc:252
ProductPtrVec & putProducts()
Definition: Event.h:306
#define PROD(A, B)
def move(src, dest)
Definition: eostools.py:511

◆ eventAuxiliary()

EventAuxiliary const& edm::Event::eventAuxiliary ( ) const
inlineoverridevirtual

Implements edm::EventBase.

Definition at line 95 of file Event.h.

References aux_.

Referenced by DetStatus::filter().

95 { return aux_; }
EventAuxiliary const & aux_
Definition: Event.h:316

◆ eventPrincipal()

EventPrincipal const & Event::eventPrincipal ( ) const
private

Definition at line 102 of file Event.cc.

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

Referenced by cacheIdentifier(), commit_aux(), eventSelectionIDs(), fillLuminosityBlock(), getByProductID_(), getProvenance(), getStableProvenance(), makeProductID(), and processHistoryID().

102  {
103  return dynamic_cast<EventPrincipal const&>(provRecorder_.principal());
104  }
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const

◆ eventSelectionIDs()

EventSelectionIDVector const & Event::eventSelectionIDs ( ) const

Definition at line 114 of file Event.cc.

References eventPrincipal(), and edm::EventPrincipal::eventSelectionIDs().

114 { return eventPrincipal().eventSelectionIDs(); }
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102
EventSelectionIDVector const & eventSelectionIDs() const

◆ fillLuminosityBlock()

void Event::fillLuminosityBlock ( ) const
private

Definition at line 54 of file Event.cc.

References eventPrincipal(), edm::PrincipalGetAdapter::getConsumer(), edm::PrincipalGetAdapter::getSharedResourcesAcquirer(), luminosityBlock_, moduleCallingContext_, edm::PrincipalGetAdapter::moduleDescription(), and provRecorder_.

Referenced by getLuminosityBlock().

54  {
55  luminosityBlock_.emplace(
56  eventPrincipal().luminosityBlockPrincipal(), provRecorder_.moduleDescription(), moduleCallingContext_, false);
58  luminosityBlock_->setSharedResourcesAcquirer(provRecorder_.getSharedResourcesAcquirer());
59  }
std::optional< LuminosityBlock > luminosityBlock_
Definition: Event.h:319
SharedResourcesAcquirer * getSharedResourcesAcquirer() const
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
EDConsumerBase const * getConsumer() const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102
ModuleDescription const & moduleDescription() const

◆ fillView_()

template<typename ELEMENT >
Handle< View< ELEMENT > > Event::fillView_ ( BasicHandle bh) const

Definition at line 650 of file Event.h.

References addToGotBranchIDs(), edm::WrapperBase::fillView(), gotViews_, edm::BasicHandle::id(), productGetter(), edm::BasicHandle::provenance(), and edm::BasicHandle::wrapper().

650  {
651  std::vector<void const*> pointersToElements;
653  // the following must initialize the
654  // fill the helper vector
655  bh.wrapper()->fillView(bh.id(), pointersToElements, helpers);
656 
657  auto newview = std::make_shared<View<ELEMENT>>(pointersToElements, helpers, &(productGetter()));
658 
659  addToGotBranchIDs(*bh.provenance());
660  gotViews_.push_back(newview);
661  return Handle<View<ELEMENT>>(newview.get(), bh.provenance());
662  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
std::vector< std::shared_ptr< ViewBase > > gotViews_
Definition: Event.h:335
EDProductGetter const & productGetter() const
Definition: Event.cc:106
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector

◆ get() [1/4]

template<typename PROD >
bool Event::get ( ProductID const &  oid,
Handle< PROD > &  result 
) const

Definition at line 344 of file Event.h.

References addToGotBranchIDs(), getByProductID_(), eostools::move(), edm::BasicHandle::provenance(), and mps_fire::result.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), ElectronHcalHelper::beginEvent(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), GlobalVariablesTableProducer::VariableT< ValType, ColType, Converter >::fill(), TtEvtBuilder< C >::fillSpecific(), ptHatFilter::filter(), StringCutObjectEvtFilter< T >::filter(), ALPAKA_ACCELERATOR_NAMESPACE::device::Event::get(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtSemiLepJetCombWMassMaxSumPt::produce(), PATTauIDEmbedder::produce(), TtSemiLepJetCombGeom::produce(), EcalUncalibRecHitPhase2WeightsProducer::produce(), TtSemiLepJetCombWMassDeltaTopMass::produce(), HGCalRecHitMapProducer::produce(), ParticleBasedIsoProducer::produce(), TtFullHadSignalSelMVAComputer::produce(), TrackstersMergeProducerV3::produce(), EcalRecHitProducer::produce(), TrackFromPackedCandidateProducer::produce(), TtEvtBuilder< C >::produce(), TrackstersProducer::produce(), RecoTauGenericJetRegionProducer< JetType, CandType >::produce(), UniqueMerger< InputCollection, OutputCollection, P >::produce(), TtJetPartonMatch< C >::produce(), ConversionTrackCandidateProducer::produce(), SimTrackstersProducer::produce(), TrackstersMergeProducer::produce(), BetaBoostEvtVtxGenerator::produce(), HLTRechitInRegionsProducer< T1 >::produce(), GEDPhotonProducer::produce(), rrapi.RRApi::report(), rrapi.RRApi::reports(), AnalyticalTrackSelector::run(), AlignmentTrackFromVertexSelector::select(), EGRegressionModifierV2::setEvent(), EGRegressionModifierV1::setEvent(), EGRegressionModifierV3::setEvent(), EGRegressionModifierDRN::setEvent(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

344  {
345  result.clear();
346  BasicHandle bh = this->getByProductID_(oid);
347  result = convert_handle_check_type<PROD>(std::move(bh)); // throws on conversion error
348  if (result.failedToGet()) {
349  return false;
350  }
351  addToGotBranchIDs(*bh.provenance());
352  return true;
353  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
BasicHandle getByProductID_(ProductID const &oid) const
Definition: Event.cc:154
def move(src, dest)
Definition: eostools.py:511

◆ get() [2/4]

template<typename ELEMENT >
bool Event::get ( ProductID const &  oid,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 356 of file Event.h.

References edm::BasicHandle::failedToGet(), getByProductID_(), edm::makeHandleExceptionFactory(), edm::errors::ProductNotFound, and mps_fire::result.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

356  {
357  result.clear();
358  BasicHandle bh = this->getByProductID_(oid);
359 
360  if (bh.failedToGet()) {
361  result = Handle<View<ELEMENT>>(makeHandleExceptionFactory([oid]() -> std::shared_ptr<cms::Exception> {
362  std::shared_ptr<cms::Exception> whyFailed = std::make_shared<edm::Exception>(edm::errors::ProductNotFound);
363  *whyFailed << "get View by ID failed: no product with ID = " << oid << "\n";
364  return whyFailed;
365  }));
366  return false;
367  }
368 
369  result = fillView_<ELEMENT>(bh);
370  return true;
371  }
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
BasicHandle getByProductID_(ProductID const &oid) const
Definition: Event.cc:154

◆ get() [3/4]

template<typename PROD >
PROD const & Event::get ( EDGetTokenT< PROD token) const
noexcept

Definition at line 562 of file Event.h.

References LIKELY, eostools::move(), PROD, edm::PRODUCT_TYPE, mps_fire::result, and unpackBuffers-CaloStage2::token.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

562  {
563  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
564  auto result = convert_handle<PROD>(std::move(bh));
565  if LIKELY (not result.failedToGet()) {
566  addToGotBranchIDs(*result.provenance());
567  }
568  return *result;
569  }
#define LIKELY(x)
Definition: Likely.h:20
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
def move(src, dest)
Definition: eostools.py:511

◆ get() [4/4]

template<typename ELEMENT >
View< ELEMENT > const & Event::get ( EDGetTokenT< View< ELEMENT >>  token) const
noexcept

Definition at line 641 of file Event.h.

References edm::ELEMENT_TYPE, edm::BasicHandle::failedToGet(), unpackBuffers-CaloStage2::token, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), rrapi.RRApi::columns(), rrapi.RRApi::count(), rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), and rrapi.RRApi::workspaces().

641  {
642  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(ELEMENT)), ELEMENT_TYPE, token, moduleCallingContext_);
643  if UNLIKELY (bh.failedToGet()) {
644  bh.whyFailedFactory()->make()->raise();
645  }
646  return *fillView_<ELEMENT>(bh);
647  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getAllProvenance()

void Event::getAllProvenance ( std::vector< Provenance const *> &  provenances) const

Definition at line 132 of file Event.cc.

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

132  {
134  }
void getAllProvenance(std::vector< Provenance const *> &provenances) const
Definition: Principal.cc:796
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const

◆ getAllStableProvenance()

void Event::getAllStableProvenance ( std::vector< StableProvenance const *> &  provenances) const

Definition at line 136 of file Event.cc.

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

Referenced by FWFFMetadataManager::hasModuleLabel().

136  {
138  }
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const
void getAllStableProvenance(std::vector< StableProvenance const *> &provenances) const
Definition: Principal.cc:813

◆ getByLabel() [1/10]

template<>
bool edm::Event::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< GenericObject > &  result 
) const

Specialize the getByLabel method to work with a Handle<GenericObject>

Definition at line 47 of file GenericHandle.cc.

References edm::convert_handle(), label, eostools::move(), edm::BasicHandle::provenance(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

49  {
50  BasicHandle bh = provRecorder_.getByLabel_(
51  TypeID(result.type().typeInfo()), label, productInstanceName, std::string(), moduleCallingContext_);
52  convert_handle(std::move(bh), result); // throws on conversion error
53  if (!result.failedToGet()) {
54  addToGotBranchIDs(*bh.provenance());
55  return true;
56  }
57  return false;
58  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
char const * label
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Handle< T > convert_handle(BasicHandle &&bh) noexcept(true)
Definition: ConvertHandle.h:22
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [2/10]

template<>
bool edm::Event::getByLabel ( InputTag const &  tag,
Handle< GenericObject > &  result 
) const

Definition at line 61 of file GenericHandle.cc.

References edm::convert_handle(), eostools::move(), edm::BasicHandle::provenance(), mps_fire::result, and makeGlobalPositionRcd_cfg::tag.

61  {
62  if (tag.process().empty()) {
63  return this->getByLabel(tag.label(), tag.instance(), result);
64  } else {
65  BasicHandle bh = provRecorder_.getByLabel_(
66  TypeID(result.type().typeInfo()), tag.label(), tag.instance(), tag.process(), moduleCallingContext_);
67  convert_handle(std::move(bh), result); // throws on conversion error
68  if (!result.failedToGet()) {
69  addToGotBranchIDs(*bh.provenance());
70  return true;
71  }
72  }
73  return false;
74  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Handle< T > convert_handle(BasicHandle &&bh) noexcept(true)
Definition: ConvertHandle.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:498
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [3/10]

template<>
bool edm::Event::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< GenericObject > &  result 
) const

Specialize the Event's getByLabel method to work with a Handle<GenericObject>

◆ getByLabel() [4/10]

template<>
bool edm::Event::getByLabel ( InputTag const &  tag,
Handle< GenericObject > &  result 
) const

◆ getByLabel() [5/10]

template<typename PROD >
bool Event::getByLabel ( InputTag const &  tag,
Handle< PROD > &  result 
) const

Definition at line 498 of file Event.h.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByLabel_(), moduleCallingContext_, eostools::move(), PROD, provRecorder_, mps_fire::result, makeGlobalPositionRcd_cfg::tag, and UNLIKELY.

Referenced by SimpleJetDump::analyze(), CaloTowersExample::analyze(), myFastSimVal::analyze(), JetToDigiDump::analyze(), JetPlotsExample< Jet >::analyze(), JetValidation::analyze(), JetAnaPythia< Jet >::analyze(), myRawAna::analyze(), DijetMass< Jet >::analyze(), LaserAlignmentT0ProducerDQM::analyze(), PhotonIDSimpleAnalyzer::analyze(), edmtest::OtherThingAnalyzer::doit(), LaserAlignment::fillDataProfiles(), BTagSkimMC::filter(), RecHitEnergyFilter::filter(), getByLabel(), readEventData(), and LaserDQM::trackerStatistics().

498  {
499  result.clear();
500  BasicHandle bh = provRecorder_.getByLabel_(TypeID(typeid(PROD)), tag, moduleCallingContext_);
501  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
502  if UNLIKELY (result.failedToGet()) {
503  return false;
504  }
505  addToGotBranchIDs(*result.provenance());
506  return true;
507  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [6/10]

template<typename PROD >
bool Event::getByLabel ( std::string const &  label,
Handle< PROD > &  result 
) const

Definition at line 523 of file Event.h.

References emptyString_, getByLabel(), label, and mps_fire::result.

523  {
525  }
char const * label
static const std::string emptyString_
Definition: Event.h:340
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:498

◆ getByLabel() [7/10]

template<typename PROD >
bool Event::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< PROD > &  result 
) const

Definition at line 510 of file Event.h.

References addToGotBranchIDs(), emptyString_, edm::PrincipalGetAdapter::getByLabel_(), label, moduleCallingContext_, eostools::move(), PROD, provRecorder_, mps_fire::result, and UNLIKELY.

510  {
511  result.clear();
512  BasicHandle bh = provRecorder_.getByLabel_(
513  TypeID(typeid(PROD)), label, productInstanceName, emptyString_, moduleCallingContext_);
514  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
515  if UNLIKELY (result.failedToGet()) {
516  return false;
517  }
518  addToGotBranchIDs(*result.provenance());
519  return true;
520  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
char const * label
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
static const std::string emptyString_
Definition: Event.h:340
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [8/10]

template<typename ELEMENT >
bool Event::getByLabel ( std::string const &  label,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 601 of file Event.h.

References emptyString_, getByLabel(), HerwigMaxPtPartonFilter_cfi::moduleLabel, and mps_fire::result.

601  {
603  }
static const std::string emptyString_
Definition: Event.h:340
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:498

◆ getByLabel() [9/10]

template<typename ELEMENT >
bool Event::getByLabel ( std::string const &  label,
std::string const &  productInstanceName,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 585 of file Event.h.

References emptyString_, edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getMatchingSequenceByLabel_(), h, moduleCallingContext_, HerwigMaxPtPartonFilter_cfi::moduleLabel, eostools::move(), provRecorder_, mps_fire::result, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

587  {
588  result.clear();
590  TypeID(typeid(ELEMENT)), moduleLabel, productInstanceName, emptyString_, moduleCallingContext_);
591  if UNLIKELY (bh.failedToGet()) {
592  Handle<View<ELEMENT>> h(std::move(bh.whyFailedFactory()));
593  h.swap(result);
594  return false;
595  }
596  result = fillView_<ELEMENT>(bh);
597  return true;
598  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
BasicHandle getMatchingSequenceByLabel_(TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
#define UNLIKELY(x)
Definition: Likely.h:21
static const std::string emptyString_
Definition: Event.h:340
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ getByLabel() [10/10]

template<typename ELEMENT >
bool Event::getByLabel ( InputTag const &  tag,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 572 of file Event.h.

References edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getMatchingSequenceByLabel_(), h, moduleCallingContext_, eostools::move(), provRecorder_, mps_fire::result, makeGlobalPositionRcd_cfg::tag, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

572  {
573  result.clear();
574  BasicHandle bh = provRecorder_.getMatchingSequenceByLabel_(TypeID(typeid(ELEMENT)), tag, moduleCallingContext_);
575  if UNLIKELY (bh.failedToGet()) {
576  Handle<View<ELEMENT>> h(std::move(bh.whyFailedFactory()));
577  h.swap(result);
578  return false;
579  }
580  result = fillView_<ELEMENT>(bh);
581  return true;
582  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
BasicHandle getMatchingSequenceByLabel_(TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
#define UNLIKELY(x)
Definition: Likely.h:21
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ getByLabelImpl()

BasicHandle Event::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 257 of file Event.cc.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByLabel_(), h, moduleCallingContext_, and provRecorder_.

259  {
260  BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType), iTag, moduleCallingContext_);
261  if (h.isValid()) {
262  addToGotBranchIDs(*(h.provenance()));
263  }
264  return h;
265  }
BasicHandle getByLabel_(TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getByProductID_()

BasicHandle Event::getByProductID_ ( ProductID const &  oid) const
private

Definition at line 154 of file Event.cc.

References eventPrincipal(), and edm::EventPrincipal::getByProductID().

Referenced by get(), and getImpl().

154 { return eventPrincipal().getByProductID(oid); }
BasicHandle getByProductID(ProductID const &oid) const
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102

◆ getByToken() [1/6]

template<>
bool edm::Event::getByToken ( EDGetToken  token,
Handle< GenericObject > &  result 
) const

Specialize the Event's getByToken method to work with a Handle<GenericObject>

Definition at line 78 of file GenericHandle.cc.

References edm::convert_handle(), eostools::move(), edm::PRODUCT_TYPE, mps_fire::result, unpackBuffers-CaloStage2::token, and UNLIKELY.

78  {
79  result.clear();
80  BasicHandle bh =
82  convert_handle(std::move(bh), result); // throws on conversion error
83  if (UNLIKELY(result.failedToGet())) {
84  return false;
85  }
86  addToGotBranchIDs(*result.provenance());
87  return true;
88  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Handle< T > convert_handle(BasicHandle &&bh) noexcept(true)
Definition: ConvertHandle.h:22
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getByToken() [2/6]

template<>
bool edm::Event::getByToken ( EDGetToken  token,
Handle< GenericObject > &  result 
) const

Specialize the Event's getByToken method to work with a Handle<GenericObject>

◆ getByToken() [3/6]

template<typename PROD >
bool Event::getByToken ( EDGetToken  token,
Handle< PROD > &  result 
) const

Definition at line 528 of file Event.h.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, mps_fire::result, unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by PatElectronAnalyzer::analyze(), PatTauAnalyzer::analyze(), EgammaBasicClusters::analyze(), L1TStage2CPPF::analyze(), EgammaSuperClusters::analyze(), EcalDQMonitorTask::analyze(), EcalFEDMonitorTemp< SUBDET >::analyze(), sistrip::SpyExtractRunModule::analyze(), L1TStage2OMTF::analyze(), sistrip::SpyIdentifyRunsModule::analyze(), L1TStage2uGTTiming::analyze(), TopDiLeptonDQM::analyze(), L1TStage2uGT::analyze(), ContainmentCorrectionAnalyzer::analyze(), EnergyScaleAnalyzer::analyze(), PDFWeightsTest::analyze(), L1TStage2BMTF::analyze(), SusyDQM< Mu, Ele, Jet, Met >::analyze(), EgammaObjects::analyzeElectrons(), EgammaObjects::analyzePhotons(), ecaldqm::OccupancyTask::beginEvent(), reco::tau::RecoTauDiscriminantCleanerPlugin::beginEvent(), reco::tau::RecoTauTagInfoWorkaroundModifer::beginEvent(), ecaldqm::TrigPrimTask::beginEvent(), reco::tau::PFRecoTauLostTrackPlugin::beginEvent(), ecaldqm::ClusterTask::beginEvent(), TauDiscriminationAgainstElectronMVA6< TauType, TauDiscriminator, ElectronType >::beginEvent(), TauDiscriminantCutMultiplexerT< TauType, TauTypeRef, ParentClass >::beginEvent(), reco::tau::RecoTauBuilderPlugin::beginEvent(), PFRecoTauDiscriminationByIsolationMVA2::beginEvent(), reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::beginEvent(), reco::tau::PATTauDiscriminationByMVAIsolationRun2::beginEvent(), TtFullLepHypKinSolution::buildHypo(), TtFullHadHypGenMatch::buildHypo(), TtFullHadHypKinFit::buildHypo(), TtSemiLepHypHitFit::buildHypo(), TtSemiLepHypKinFit::buildHypo(), TtSemiLepHypGenMatch::buildHypo(), TtFullLepHypGenMatch::buildHypo(), TtFullLepHypGenMatch::buildMatchingNeutrinos(), MuonDetLayerMeasurements::checkCSCRecHits(), MuonDetLayerMeasurements::checkDTRecHits(), MuonDetLayerMeasurements::checkGEMRecHits(), MuonDetLayerMeasurements::checkME0RecHits(), MTDDetLayerMeasurements::checkMTDRecHits(), AlignmentTrackSelector::checkPrescaledHits(), MuonDetLayerMeasurements::checkRPCRecHits(), CosmicClusterProducer::clusterizeECALPart(), METCorrectionAlgorithm::compMETCorrection(), reco::PFMETProducerMVA::computeLeptonInfo(), SiStripGainFromCalibTree::connect(), PFClusterEMEnergyCorrector::correctEnergies(), MergeClusterProducer::createMerge(), PFTauExtractor::depositFromObject(), SiStripFineDelayHit::detId(), HcalSignalGenerator< HBHEDigitizerTraits >::fill(), TauDiscriminationProducerBase< TauType, TauDiscriminator, TauDiscriminatorDataType, ConsumeType >::TauDiscInfo::fill(), EcalSignalGenerator< EEDigitizerTraits >::fill(), DeepTauIdBase< Producer >::TauDiscInfo< ConsumeType >::fill(), DetStatus::filter(), DetectorStateFilter::filter(), EvtPlaneFilter::filter(), JetMETDQMDCSFilter::filter(), RecoTauPileUpVertexSelector::filter(), EcalMonitorPrescaler::filter(), LHEJetFilter::filter(), GenHTFilter::filter(), ModelpMSSMFilter::filter(), ObjectSelectorBase< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >, OutputCollection, NonNullNumberSelector, PostProcessor, StoreManager, Base, ::reco::modules::EventSetupInit< SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder > >::type >::filter(), RunManagerMTWorker::generateEvent(), Multi5x5SuperClusterProducer::getClusterPtrVector(), Multi5x5ClusterProducer::getCollection(), IslandClusterProducer::getCollection(), AddCorrectionsToGenericMET::getCorrection(), JetMatchingTools::getEBRecHitCollection(), JetMatchingTools::getEBSimHitCollection(), JetMatchingTools::getEERecHitCollection(), JetMatchingTools::getEESimHitCollection(), DAFTrackProducer::getFromEvt(), JetMatchingTools::getGenParticlesCollection(), JetMatchingTools::getHBHERecHitCollection(), JetMatchingTools::getHcalSimHitCollection(), JetMatchingTools::getHFRecHitCollection(), JetMatchingTools::getHORecHitCollection(), MixEvtVtxGenerator::getRecVertex(), JetMatchingTools::getSimTrackCollection(), JetMatchingTools::getSimVertexCollection(), MixEvtVtxGenerator::getVertex(), TrackCollectionTokens::indicesInput(), AlignmentTrackSelector::isIsolated(), PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::loopOnTracks(), TrackerHitAssociator::makeMaps(), MergeClusterProducer::mergeTime(), OverlapExclusionSelector< C, T, O >::newEvent(), reco::modules::MCMatchCandRefSelector::newEvent(), CollectionCountEventSelector< C, S, N, CS >::operator()(), ObjectCountEventSelector< C, S, N, CS >::operator()(), reco::tau::PFRecoTauChargedHadronFromGenericTrackPlugin< TrackClass >::operator()(), MCPdgIndexFilter::pass(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), PATTauIDEmbedder::produce(), TopInitSubset::produce(), PATTauSignalCandidatesProducer::produce(), MTDUncalibratedRecHitProducer::produce(), PileupSummaryInfoSlimmer::produce(), reco::modules::CaloRecHitCandidateProducer< HitCollection >::produce(), PATTauHybridProducer::produce(), GsfTrackRefitter::produce(), TrackRefitter::produce(), MassKinFitterCandProducer::produce(), TICLLayerTileProducer::produce(), AssociationVectorSelector< KeyRefProd, CVal, KeySelector, ValSelector >::produce(), MultiClustersFromTrackstersProducer::produce(), EcalUncalibRecHitProducer::produce(), TtSemiLepHitFitProducer< LeptonCollection >::produce(), AssociationMapOneToOne2Association< CKey, CVal >::produce(), PFTICLProducer::produce(), GenParticleDecaySelector::produce(), CandOneToManyDeltaRMatcher::produce(), AssociationVector2ValueMap< KeyRefProd, CVal >::produce(), ScaleCorrMETData::produce(), TtSemiLepJetCombMVAComputer::produce(), DAFTrackProducer::produce(), MTDRecHitProducer::produce(), CandOneToOneDeltaRMatcher::produce(), TtSemiLepSignalSelMVAComputer::produce(), CandViewRefMerger::produce(), CollectionAdder< C >::produce(), GenParticlePruner::produce(), HGCalMultiClusterProducer::produce(), PATPuppiJetSpecificProducer::produce(), MCTrackMatcher::produce(), GenTrackMatcher::produce(), FilteredLayerClustersProducer::produce(), HPSPFTauProducer::produce(), ShiftedMETcorrInputProducer::produce(), EcalTPSkimmer::produce(), RecHitFilter::produce(), BaseEvtVtxGenerator::produce(), TICLCandidateFromTrackstersProducer::produce(), photonIsolationHIProducer::produce(), GenVisTauProducer::produce(), HGCalRecHitProducer::produce(), PassThroughEvtVtxGenerator::produce(), TrackstersMergeProducerV3::produce(), CaloTowerCandidateCreator::produce(), JVFJetIdProducer::produce(), ShallowCloneProducer< C >::produce(), MTDTrackingRecHitProducer::produce(), TrackProducerWithSCAssociation::produce(), reco::modules::MatcherBase< C1, C2, M >::produce(), reco::modulesNew::Matcher< C1, C2, S, D >::produce(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::produce(), MuonMETcorrInputProducer::produce(), PhotonCoreProducer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), ShiftedParticleMETcorrInputProducer::produce(), RecoTauPiZeroUnembedder::produce(), EcalTBWeightUncalibRecHitProducer::produce(), SysShiftMETcorrInputProducer::produce(), PATRefitVertexProducer::produce(), ShiftedPFCandidateProducerByMatchedObject::produce(), Type0PFMETcorrInputProducer::produce(), EcalBarrelClusterFastTimer::produce(), ShiftedJetProducerByMatchedObjectT< T >::produce(), TtFullHadHypothesis::produce(), EgammaHLTCaloTowerProducer::produce(), NoPileUpPFMEtProducer::produce(), EcalDigiSelector::produce(), PFCandMETcorrInputProducer::produce(), InputGenJetsParticleSelector::produce(), EcalRecalibRecHitProducer::produce(), CaloTowerFromL1TSeededCreatorForTauHLT::produce(), TrackInfoProducer::produce(), PFchsMETcorrInputProducer::produce(), UncleanSCRecoveryProducer::produce(), EgammaHLTRecoEcalCandidateProducers::produce(), ShiftedParticleProducer::produce(), CorrMETDataExtractor::produce(), TtSemiLepHypothesis::produce(), MultShiftMETcorrInputProducer::produce(), ShiftedPFCandidateProducerForPFMVAMEt::produce(), CleanAndMergeProducer::produce(), TtEvtBuilder< C >::produce(), HybridClusterProducer::produce(), MixEvtVtxGenerator::produce(), PreshowerClusterShapeProducer::produce(), TtFullLepHypothesis::produce(), HiEgammaSCCorrectionMaker::produce(), CaloTowerFromL1TCreatorForTauHLT::produce(), MultShiftMETcorrDBInputProducer::produce(), Merger< InputCollection, OutputCollection, P >::produce(), CaloTowerCreatorForTauHLT::produce(), CosmicTrackSelector::produce(), HGCalTrackCollectionProducer::produce(), TrackMVAClassifierBase::produce(), MinMETProducerT< T >::produce(), RecoTauGenericJetRegionProducer< JetType, CandType >::produce(), ShiftedPFCandidateProducerForNoPileUpPFMEt::produce(), ShiftedPFCandidateProducerForPFNoPUMEt::produce(), IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), TrackTimeValueMapProducer::produce(), PATLeptonTimeLifeInfoProducer< T >::produce(), CorrectedCaloMETProducer::produce(), ObjectSelectorProducer< Selector, OutputCollection, PostProcessor, StoreManager, Base, Init >::produce(), RecoTauPiZeroProducer::produce(), dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::produce(), CorrectedPATMETProducer::produce(), reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), EventShapeVarsProducer::produce(), reco::PFMETProducerMVA::produce(), pat::TauJetCorrFactorsProducer::produce(), EgammaSCCorrectionMaker::produce(), GenericBoostedTauSeedsProducer< JetType, CandType >::produce(), SimPFProducer::produce(), EgammaHLTNxNClusterProducer::produce(), ConvertedPhotonProducer::produce(), UnifiedSCCollectionProducer::produce(), PhotonProducer::produce(), EcalDetailedTimeRecHitProducer::produce(), PreshowerPhiClusterProducer::produce(), PreshowerClusterProducer::produce(), RecoTauProducer::produce(), SimTrackstersProducer::produce(), TrackstersMergeProducer::produce(), CorrectedPFMETProducer::produce(), HGCalLayerClusterProducer::produce(), PFRecoTauChargedHadronProducer::produce(), CorrectedPatMETProducer::produce(), RecoTauCleanerImpl< Prod >::produce(), FlavorHistoryProducer::produce(), reco::modules::HICaloCompatibleTrackSelector::produce(), GenHFHadronMatcher::produce(), ShiftedParticleProducerT< T >::produce(), reco::modules::TrackFullCloneSelectorBase< Selector >::produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >::produce(), HLTRechitInRegionsProducer< T1 >::produce(), ShiftedJetProducerT< T, Textractor >::produce(), GenParticleProducer::produce(), CaloJetMETcorrInputProducerT< T, Textractor >::produce(), GEDPhotonProducer::produce(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce(), Type2CorrectionProducer::produce(), JetCleanerForType1METT< T, Textractor >::produce(), GenPUProtonProducer::produce(), reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::produce(), PFJetMETcorrInputProducerT< T, Textractor >::produce(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), RunManagerMTWorker::resetGenParticleId(), EcalRecHitWorkerRecover::run(), AnalyticalTrackSelector::run(), MultiTrackSelector::run(), HIMultiTrackSelector::run(), EcalDQMonitorTask::runOnCollection(), AlignmentTrackFromVertexCompositeCandidateSelector::select(), AssociatedVariableCollectionSelector< InputCollection, VarCollection, Selector, OutputCollection, StoreContainer, RefAdder >::select(), DualByL2TSG::selectTSG(), EcalUncalibRecHitWorkerMultiFit::set(), reco::tau::RecoTauVertexAssociator::setEvent(), ConversionSeedFinder::setEvent(), IsoTrig::studyTiming(), FastTSGFromIOHit::trackerSeeds(), TrackCollectionTokens::tracks(), and TrackCollectionTokens::trajectories().

528  {
529  result.clear();
530  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
531  result = convert_handle<PROD>(std::move(bh)); // throws on conversion error
532  if UNLIKELY (result.failedToGet()) {
533  return false;
534  }
535  addToGotBranchIDs(*result.provenance());
536  return true;
537  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getByToken() [4/6]

template<typename PROD >
bool Event::getByToken ( EDGetTokenT< PROD token,
Handle< PROD > &  result 
) const

Definition at line 540 of file Event.h.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, mps_fire::result, unpackBuffers-CaloStage2::token, and UNLIKELY.

540  {
541  result.clear();
542  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
543  result = convert_handle<PROD>(std::move(bh));
544  if UNLIKELY (result.failedToGet()) {
545  return false;
546  }
547  addToGotBranchIDs(*result.provenance());
548  return true;
549  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getByToken() [5/6]

template<typename ELEMENT >
bool Event::getByToken ( EDGetToken  token,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 606 of file Event.h.

References edm::ELEMENT_TYPE, edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getByToken_(), h, moduleCallingContext_, eostools::move(), provRecorder_, mps_fire::result, unpackBuffers-CaloStage2::token, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

606  {
607  result.clear();
608  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(ELEMENT)), ELEMENT_TYPE, token, moduleCallingContext_);
609  if UNLIKELY (bh.failedToGet()) {
610  Handle<View<ELEMENT>> h(std::move(bh.whyFailedFactory()));
611  h.swap(result);
612  return false;
613  }
614  result = fillView_<ELEMENT>(bh);
615  return true;
616  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define UNLIKELY(x)
Definition: Likely.h:21
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ getByToken() [6/6]

template<typename ELEMENT >
bool Event::getByToken ( EDGetTokenT< View< ELEMENT >>  token,
Handle< View< ELEMENT >> &  result 
) const

Definition at line 619 of file Event.h.

References edm::ELEMENT_TYPE, edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getByToken_(), h, moduleCallingContext_, eostools::move(), provRecorder_, mps_fire::result, unpackBuffers-CaloStage2::token, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

619  {
620  result.clear();
621  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(ELEMENT)), ELEMENT_TYPE, token, moduleCallingContext_);
622  if UNLIKELY (bh.failedToGet()) {
623  Handle<View<ELEMENT>> h(std::move(bh.whyFailedFactory()));
624  h.swap(result);
625  return false;
626  }
627  result = fillView_<ELEMENT>(bh);
628  return true;
629  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define UNLIKELY(x)
Definition: Likely.h:21
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511

◆ getByTokenImpl()

BasicHandle Event::getByTokenImpl ( std::type_info const &  iProductType,
EDGetToken  iToken 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 267 of file Event.cc.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByToken_(), h, moduleCallingContext_, edm::PRODUCT_TYPE, and provRecorder_.

267  {
268  BasicHandle h = provRecorder_.getByToken_(TypeID(iProductType), PRODUCT_TYPE, iToken, moduleCallingContext_);
269  if (h.isValid()) {
270  addToGotBranchIDs(*(h.provenance()));
271  }
272  return h;
273  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getHandle() [1/2]

template<typename PROD >
Handle< PROD > Event::getHandle ( EDGetTokenT< PROD token) const

Definition at line 552 of file Event.h.

References addToGotBranchIDs(), edm::PrincipalGetAdapter::getByToken_(), LIKELY, moduleCallingContext_, eostools::move(), PROD, edm::PRODUCT_TYPE, provRecorder_, mps_fire::result, and unpackBuffers-CaloStage2::token.

Referenced by HcalTB06Analysis::analyze(), AntiElectronIDMVA6< TauType, ElectronType >::beginEvent(), GEDPhotonProducer::fillPhotonCollection(), CandCollectionExistFilter::filter(), HiSuperClusterProducer::getClusterPtrVector(), ALPAKA_ACCELERATOR_NAMESPACE::device::Event::getHandle(), MixBoostEvtVtxGenerator::getRecVertex(), MixBoostEvtVtxGenerator::getVertex(), CalibrationTrackSelector::isIsolated(), StGenEventReco::produce(), TtGenEventReco::produce(), TtSemiLepKinFitProducer< LeptonCollection >::produce(), HGCalUncalibRecHitProducer::produce(), TtFullLepKinSolutionProducer::produce(), ParticleBasedIsoProducer::produce(), PFTICLProducer::produce(), ChargedHadronPFTrackIsolationProducer::produce(), CandReducer::produce(), IPTCorrector::produce(), ConvertedPhotonProducer::produce(), ConversionTrackCandidateProducer::produce(), MixBoostEvtVtxGenerator::produce(), IsolatedPixelTrackCandidateProducer::produce(), IsolatedPixelTrackCandidateL1TProducer::produce(), AlignmentTrackFromVertexSelector::select(), EGFull5x5ShowerShapeModifierFromValueMaps::setEvent(), and EGExtraInfoModifierFromValueMaps< MapType, OutputType >::setEvent().

552  {
553  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(PROD)), PRODUCT_TYPE, token, moduleCallingContext_);
554  auto result = convert_handle<PROD>(std::move(bh));
555  if LIKELY (not result.failedToGet()) {
556  addToGotBranchIDs(*result.provenance());
557  }
558  return result;
559  }
#define LIKELY(x)
Definition: Likely.h:20
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
def move(src, dest)
Definition: eostools.py:511

◆ getHandle() [2/2]

template<typename ELEMENT >
Handle< View< ELEMENT > > Event::getHandle ( EDGetTokenT< View< ELEMENT >>  token) const

Definition at line 632 of file Event.h.

References edm::ELEMENT_TYPE, edm::BasicHandle::failedToGet(), edm::PrincipalGetAdapter::getByToken_(), moduleCallingContext_, eostools::move(), provRecorder_, unpackBuffers-CaloStage2::token, UNLIKELY, and edm::BasicHandle::whyFailedFactory().

632  {
633  BasicHandle bh = provRecorder_.getByToken_(TypeID(typeid(ELEMENT)), ELEMENT_TYPE, token, moduleCallingContext_);
634  if UNLIKELY (bh.failedToGet()) {
635  return Handle<View<ELEMENT>>(std::move(bh.whyFailedFactory()));
636  }
637  return fillView_<ELEMENT>(bh);
638  }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define UNLIKELY(x)
Definition: Likely.h:21
def move(src, dest)
Definition: eostools.py:511

◆ getImpl()

BasicHandle Event::getImpl ( std::type_info const &  iProductType,
ProductID const &  pid 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 275 of file Event.cc.

References addToGotBranchIDs(), getByProductID_(), and h.

275  {
276  BasicHandle h = this->getByProductID_(pid);
277  if (h.isValid()) {
278  addToGotBranchIDs(*(h.provenance()));
279  }
280  return h;
281  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
BasicHandle getByProductID_(ProductID const &oid) const
Definition: Event.cc:154
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getLuminosityBlock()

LuminosityBlock const& edm::Event::getLuminosityBlock ( ) const
inline

Definition at line 100 of file Event.h.

References fillLuminosityBlock(), and luminosityBlock_.

Referenced by EcalDQMonitorTask::analyze(), and getRun().

100  {
101  if (not luminosityBlock_) {
103  }
104  return *luminosityBlock_;
105  }
std::optional< LuminosityBlock > luminosityBlock_
Definition: Event.h:319
void fillLuminosityBlock() const
Definition: Event.cc:54

◆ getProcessParameterSet()

bool Event::getProcessParameterSet ( std::string const &  processName,
ParameterSet ps 
) const

Definition at line 140 of file Event.cc.

References cms::cuda::assert(), DiMuonV_cfg::config, edm::ParameterSet::empty(), edm::ProcessHistory::getConfigurationForProcess(), edm::pset::Registry::getMapped(), edm::pset::Registry::instance(), processHistory(), and SimL1EmulatorRepack_CalouGT_cff::processName.

140  {
141  ProcessConfiguration config;
143  if (process_found) {
144  pset::Registry::instance()->getMapped(config.parameterSetID(), ps);
145  assert(!ps.empty());
146  }
147  return process_found;
148  }
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
Definition: config.py:1
assert(be >=bs)
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30
ProcessHistory const & processHistory() const override
Definition: Event.cc:250
static Registry * instance()
Definition: Registry.cc:12

◆ getProvenance() [1/2]

Provenance const & Event::getProvenance ( BranchID const &  theID) const

Definition at line 118 of file Event.cc.

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

118  {
119  return provRecorder_.principal().getProvenance(bid);
120  }
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const
Provenance const & getProvenance(BranchID const &bid) const
Definition: Principal.cc:771

◆ getProvenance() [2/2]

Provenance const & Event::getProvenance ( ProductID const &  theID) const

Definition at line 122 of file Event.cc.

References eventPrincipal(), and edm::EventPrincipal::getProvenance().

122 { return eventPrincipal().getProvenance(pid); }
Provenance const & getProvenance(ProductID const &pid) const
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102

◆ getRefBeforePut() [1/4]

template<typename PROD >
RefProd<PROD> edm::Event::getRefBeforePut ( )
inline

◆ getRefBeforePut() [2/4]

template<typename PROD >
RefProd< PROD > Event::getRefBeforePut ( std::string const &  productInstanceName)

Definition at line 470 of file Event.h.

References edm::PrincipalGetAdapter::getProductID(), edm::PrincipalGetAdapter::getPutTokenIndex(), PROD, edm::PrincipalGetAdapter::prodGetter(), and provRecorder_.

470  {
471  auto index = provRecorder_.getPutTokenIndex(TypeID{typeid(PROD)}, productInstanceName);
472 
473  //should keep track of what Ref's have been requested and make sure they are 'put'
474  return RefProd<PROD>(provRecorder_.getProductID(index), provRecorder_.prodGetter());
475  }
EDPutToken::value_type getPutTokenIndex(TypeID const &type, std::string const &productInstanceName) const
EDProductGetter const * prodGetter() const
ProductID const & getProductID(unsigned int iPutTokenIndex) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)

◆ getRefBeforePut() [3/4]

template<typename PROD >
RefProd< PROD > Event::getRefBeforePut ( EDPutTokenT< PROD token)

Definition at line 478 of file Event.h.

References edm::PrincipalGetAdapter::getProductID(), PROD, edm::PrincipalGetAdapter::prodGetter(), provRecorder_, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), unpackBuffers-CaloStage2::token, and UNLIKELY.

478  {
479  if (UNLIKELY(token.isUninitialized())) {
481  }
482  return RefProd<PROD>(provRecorder_.getProductID(token.index()), provRecorder_.prodGetter());
483  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
EDProductGetter const * prodGetter() const
ProductID const & getProductID(unsigned int iPutTokenIndex) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21

◆ getRefBeforePut() [4/4]

template<typename PROD >
RefProd< PROD > Event::getRefBeforePut ( EDPutToken  token)

Definition at line 486 of file Event.h.

References edm::PrincipalGetAdapter::getProductID(), edm::PrincipalGetAdapter::getTypeIDForPutTokenIndex(), PROD, edm::PrincipalGetAdapter::prodGetter(), provRecorder_, edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), unpackBuffers-CaloStage2::token, and UNLIKELY.

486  {
487  if (UNLIKELY(token.isUninitialized())) {
489  }
490  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
493  }
494  return RefProd<PROD>(provRecorder_.getProductID(token.index()), provRecorder_.prodGetter());
495  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
EDProductGetter const * prodGetter() const
ProductID const & getProductID(unsigned int iPutTokenIndex) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const

◆ getRun()

Run const & Event::getRun ( ) const

◆ getStableProvenance() [1/2]

StableProvenance const & Event::getStableProvenance ( BranchID const &  theID) const

Definition at line 124 of file Event.cc.

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

Referenced by EcalSelectiveReadoutProducer::getBinOfMax().

124  {
126  }
StableProvenance const & getStableProvenance(BranchID const &bid) const
Definition: Principal.cc:784
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
Principal const & principal() const

◆ getStableProvenance() [2/2]

StableProvenance const & Event::getStableProvenance ( ProductID const &  theID) const

Definition at line 128 of file Event.cc.

References eventPrincipal(), and edm::EventPrincipal::getStableProvenance().

128  {
129  return eventPrincipal().getStableProvenance(pid);
130  }
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102
StableProvenance const & getStableProvenance(ProductID const &pid) const

◆ labelsForToken()

void edm::Event::labelsForToken ( EDGetToken const &  iToken,
ProductLabels oLabels 
) const
inline

Definition at line 252 of file Event.h.

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

Referenced by TrackerHitAssociator::makeMaps().

252  {
253  provRecorder_.labelsForToken(iToken, oLabels);
254  }
void labelsForToken(EDGetToken const &iToken, ProductLabels &oLabels) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309

◆ makeProductID()

ProductID Event::makeProductID ( BranchDescription const &  desc) const
private

Definition at line 108 of file Event.cc.

References edm::EventPrincipal::branchIDToProductID(), submitPVResolutionJobs::desc, and eventPrincipal().

108  {
109  return eventPrincipal().branchIDToProductID(desc.originalBranchID());
110  }
ProductID branchIDToProductID(BranchID const &bid) const
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102

◆ moduleCallingContext()

ModuleCallingContext const* edm::Event::moduleCallingContext ( ) const
inline

Definition at line 250 of file Event.h.

References moduleCallingContext_.

250 { return moduleCallingContext_; }
ModuleCallingContext const * moduleCallingContext_
Definition: Event.h:338

◆ parameterSet()

edm::ParameterSet const * Event::parameterSet ( edm::ParameterSetID const &  psID) const
overridevirtual

Implements edm::EventBase.

Definition at line 150 of file Event.cc.

References edm::EventBase::parameterSetForID_().

150  {
151  return parameterSetForID_(psID);
152  }
static edm::ParameterSet const * parameterSetForID_(edm::ParameterSetID const &psID)
Definition: EventBase.cc:41

◆ processBlockIndex()

unsigned int edm::Event::processBlockIndex ( std::string const &  processName) const
inline

Definition at line 260 of file Event.h.

References edm::PrincipalGetAdapter::processBlockIndex(), SimL1EmulatorRepack_CalouGT_cff::processName, and provRecorder_.

260  {
262  }
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
unsigned int processBlockIndex(std::string const &processName) const

◆ processHistory()

ProcessHistory const & Event::processHistory ( ) const
overridevirtual

◆ processHistoryID()

ProcessHistoryID const & Event::processHistoryID ( ) const

Definition at line 116 of file Event.cc.

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

Referenced by reco::tau::PFRecoTauDiscriminationByMVAIsolationRun2::beginEvent().

116 { return eventPrincipal().processHistoryID(); }
EventPrincipal const & eventPrincipal() const
Definition: Event.cc:102
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:136

◆ productGetter()

EDProductGetter const & Event::productGetter ( ) const

◆ put() [1/4]

template<typename PROD >
OrphanHandle<PROD> edm::Event::put ( std::unique_ptr< PROD product)
inline

Put a new product.

Definition at line 133 of file Event.h.

References eostools::move(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by Multi5x5ClusterProducer::clusterizeECALPart(), CosmicClusterProducer::clusterizeECALPart(), IslandClusterProducer::clusterizeECALPart(), EDMNeutronWriter::endEvent(), RecoTauPileUpVertexSelector::filter(), gen::Pythia6Gun::loadEvent(), EgammaHLTNxNClusterProducer::makeNxNClusters(), MultiTrackSelector::processMVA(), HIMultiTrackSelector::processMVA(), TtSemiLepJetCombMaxSumPtWMass::produce(), TtSemiLepJetCombWMassMaxSumPt::produce(), DoubleProducer::produce(), PATTauIDEmbedder::produce(), TopInitSubset::produce(), TtSemiLepKinFitProducer< LeptonCollection >::produce(), PATTauSignalCandidatesProducer::produce(), HGCalUncalibRecHitProducer::produce(), TtSemiLepJetCombGeom::produce(), EcalUncalibRecHitPhase2WeightsProducer::produce(), MTDUncalibratedRecHitProducer::produce(), PileupSummaryInfoSlimmer::produce(), TtSemiLepJetCombWMassDeltaTopMass::produce(), TtFullLepKinSolutionProducer::produce(), reco::modules::CaloRecHitCandidateProducer< HitCollection >::produce(), PATTauHybridProducer::produce(), HGCalRecHitMapProducer::produce(), MassKinFitterCandProducer::produce(), ParticleBasedIsoProducer::produce(), TICLLayerTileProducer::produce(), AssociationVectorSelector< KeyRefProd, CVal, KeySelector, ValSelector >::produce(), EcalUncalibRecHitProducer::produce(), AssociationMapOneToOne2Association< CKey, CVal >::produce(), TtSemiLepHitFitProducer< LeptonCollection >::produce(), MultiClustersFromTrackstersProducer::produce(), GenParticleDecaySelector::produce(), CandOneToManyDeltaRMatcher::produce(), AssociationVector2ValueMap< KeyRefProd, CVal >::produce(), PFTICLProducer::produce(), MTDRecHitProducer::produce(), TtSemiLepJetCombMVAComputer::produce(), ScaleCorrMETData::produce(), CandOneToOneDeltaRMatcher::produce(), CandViewRefMerger::produce(), GenParticlePruner::produce(), HGCalMultiClusterProducer::produce(), PATPuppiJetSpecificProducer::produce(), CollectionAdder< C >::produce(), MCTrackMatcher::produce(), GenTrackMatcher::produce(), EcalTPSkimmer::produce(), LmfSource::produce(), ChargedHadronPFTrackIsolationProducer::produce(), BaseEvtVtxGenerator::produce(), ShiftedMETcorrInputProducer::produce(), RecHitFilter::produce(), FilteredLayerClustersProducer::produce(), HPSPFTauProducer::produce(), photonIsolationHIProducer::produce(), GenVisTauProducer::produce(), HGCalRecHitProducer::produce(), PassThroughEvtVtxGenerator::produce(), TICLCandidateFromTrackstersProducer::produce(), CaloTowerCandidateCreator::produce(), MTDTrackingRecHitProducer::produce(), JVFJetIdProducer::produce(), ShallowCloneProducer< C >::produce(), TrackstersMergeProducerV3::produce(), EcalRecHitProducer::produce(), reco::modules::MatcherBase< C1, C2, M >::produce(), reco::modulesNew::Matcher< C1, C2, S, D >::produce(), ConstrainedFitCandProducer< Fitter, InputCollection, OutputCollection, Init >::produce(), CandReducer::produce(), TrackProducerWithSCAssociation::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), RecoTauPiZeroUnembedder::produce(), EcalTBWeightUncalibRecHitProducer::produce(), ShiftedParticleMETcorrInputProducer::produce(), MuonMETcorrInputProducer::produce(), PhotonCoreProducer::produce(), PATRefitVertexProducer::produce(), ShiftedPFCandidateProducerByMatchedObject::produce(), SysShiftMETcorrInputProducer::produce(), TICLSeedingRegionProducer::produce(), ShiftedJetProducerByMatchedObjectT< T >::produce(), Type0PFMETcorrInputProducer::produce(), TrackFromPackedCandidateProducer::produce(), NoPileUpPFMEtProducer::produce(), EcalDigiSelector::produce(), TtFullHadHypothesis::produce(), EgammaHLTCaloTowerProducer::produce(), InputGenJetsParticleSelector::produce(), EcalRecalibRecHitProducer::produce(), CaloTowerFromL1TSeededCreatorForTauHLT::produce(), PFCandMETcorrInputProducer::produce(), TrackInfoProducer::produce(), ShiftedPFCandidateProducerForPFMVAMEt::produce(), MergeClusterProducer::produce(), CleanAndMergeProducer::produce(), ShiftedParticleProducer::produce(), TtSemiLepHypothesis::produce(), MultShiftMETcorrInputProducer::produce(), UncleanSCRecoveryProducer::produce(), PFchsMETcorrInputProducer::produce(), EgammaHLTRecoEcalCandidateProducers::produce(), CorrMETDataExtractor::produce(), MixEvtVtxGenerator::produce(), HybridClusterProducer::produce(), TrackstersProducer::produce(), PreshowerClusterShapeProducer::produce(), HiEgammaSCCorrectionMaker::produce(), TtFullLepHypothesis::produce(), IPTCorrector::produce(), CaloTowerFromL1TCreatorForTauHLT::produce(), MultShiftMETcorrDBInputProducer::produce(), Merger< InputCollection, OutputCollection, P >::produce(), CaloTowerCreatorForTauHLT::produce(), CosmicTrackSelector::produce(), MinMETProducerT< T >::produce(), HGCalTrackCollectionProducer::produce(), RecoTauGenericJetRegionProducer< JetType, CandType >::produce(), TrackMVAClassifierBase::produce(), ShiftedPFCandidateProducerForNoPileUpPFMEt::produce(), ShiftedPFCandidateProducerForPFNoPUMEt::produce(), UniqueMerger< InputCollection, OutputCollection, P >::produce(), IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), PATLeptonTimeLifeInfoProducer< T >::produce(), CorrectedCaloMETProducer::produce(), RecoTauPiZeroProducer::produce(), reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), CorrectedPATMETProducer::produce(), dqmBmtfAlgoSelector::L1TBMTFAlgoSelector::produce(), reco::PFMETProducerMVA::produce(), EgammaSCCorrectionMaker::produce(), pat::TauJetCorrFactorsProducer::produce(), TtJetPartonMatch< C >::produce(), EventShapeVarsProducer::produce(), GenericBoostedTauSeedsProducer< JetType, CandType >::produce(), SimPFProducer::produce(), UnifiedSCCollectionProducer::produce(), PhotonProducer::produce(), EcalDetailedTimeRecHitProducer::produce(), PreshowerPhiClusterProducer::produce(), RecoTauProducer::produce(), PreshowerClusterProducer::produce(), ConversionTrackCandidateProducer::produce(), SimTrackstersProducer::produce(), TrackstersMergeProducer::produce(), EcalSimpleProducer::produce(), HGCalLayerClusterProducer::produce(), CorrectedPFMETProducer::produce(), CorrectedPatMETProducer::produce(), MixBoostEvtVtxGenerator::produce(), PFRecoTauChargedHadronProducer::produce(), FlavorHistoryProducer::produce(), reco::modules::HICaloCompatibleTrackSelector::produce(), RecoTauCleanerImpl< Prod >::produce(), BetaBoostEvtVtxGenerator::produce(), ShiftedParticleProducerT< T >::produce(), reco::modules::TrackFullCloneSelectorBase< Selector >::produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >::produce(), IsolatedPixelTrackCandidateProducer::produce(), IsolatedPixelTrackCandidateL1TProducer::produce(), HLTRechitInRegionsProducer< T1 >::produce(), ShiftedJetProducerT< T, Textractor >::produce(), GenParticleProducer::produce(), CaloJetMETcorrInputProducerT< T, Textractor >::produce(), GEDPhotonProducer::produce(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >::produce(), Type2CorrectionProducer::produce(), JetCleanerForType1METT< T, Textractor >::produce(), GenPUProtonProducer::produce(), reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >::produce(), PFJetMETcorrInputProducerT< T, Textractor >::produce(), helper::MuonCollectionStoreManager::put(), helper::TrackCollectionStoreManager::put(), put(), helper::CollectionStoreManager< OutputCollection, ClonePolicy >::put(), helper::GsfElectronCollectionStoreManager::put(), ALPAKA_ACCELERATOR_NAMESPACE::device::Event::put(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), DAFTrackProducer::putInEvtTrajAnn(), SiStripZeroSuppression::putOutputs(), AnalyticalTrackSelector::run(), MultiTrackSelector::run(), HIMultiTrackSelector::run(), l1t::stage2::BMTFCollections::~BMTFCollections(), l1t::stage2::CaloCollections::~CaloCollections(), l1t::stage1::CaloCollections::~CaloCollections(), l1t::stage2::CaloLayer1Collections::~CaloLayer1Collections(), l1t::stage2::CaloSummaryCollections::~CaloSummaryCollections(), l1t::stage2::EMTFCollections::~EMTFCollections(), GctUnpackCollections::~GctUnpackCollections(), l1t::stage2::GMTCollections::~GMTCollections(), l1t::stage2::GTCollections::~GTCollections(), and RctUnpackCollections::~RctUnpackCollections().

133  {
134  return put<PROD>(std::move(product), std::string());
135  }
def move(src, dest)
Definition: eostools.py:511

◆ put() [2/4]

template<typename PROD >
OrphanHandle< PROD > Event::put ( std::unique_ptr< PROD product,
std::string const &  productInstanceName 
)

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

Definition at line 391 of file Event.h.

References edm::PrincipalGetAdapter::getPutTokenIndex(), eostools::move(), PROD, provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), and UNLIKELY.

391  {
392  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
393  TypeID typeID(typeid(PROD));
394  principal_get_adapter_detail::throwOnPutOfNullProduct("Event", typeID, productInstanceName);
395  }
396 
397  auto index = provRecorder_.getPutTokenIndex(TypeID(*product), productInstanceName);
398  return putImpl(index, std::move(product));
399  }
EDPutToken::value_type getPutTokenIndex(TypeID const &type, std::string const &productInstanceName) const
OrphanHandle< PROD > putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Event.h:374
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ put() [3/4]

template<typename PROD >
OrphanHandle< PROD > Event::put ( EDPutToken  token,
std::unique_ptr< PROD product 
)

Definition at line 414 of file Event.h.

References edm::PrincipalGetAdapter::getTypeIDForPutTokenIndex(), eostools::move(), PROD, edm::PrincipalGetAdapter::productInstanceLabel(), provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), edm::principal_get_adapter_detail::throwOnPutOfWrongType(), unpackBuffers-CaloStage2::token, and UNLIKELY.

414  {
415  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
416  TypeID typeID(typeid(PROD));
418  }
419  if (UNLIKELY(token.isUninitialized())) {
421  }
422  if (UNLIKELY(provRecorder_.getTypeIDForPutTokenIndex(token.index()) != TypeID{typeid(PROD)})) {
425  }
426 
427  return putImpl(token.index(), std::move(product));
428  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
OrphanHandle< PROD > putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Event.h:374
std::string const & productInstanceLabel(EDPutToken) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
void throwOnPutOfWrongType(std::type_info const &wrongType, TypeID const &rightType)
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511
TypeID const & getTypeIDForPutTokenIndex(EDPutToken::value_type index) const

◆ put() [4/4]

template<typename PROD >
OrphanHandle< PROD > Event::put ( EDPutTokenT< PROD token,
std::unique_ptr< PROD product 
)

Definition at line 402 of file Event.h.

References eostools::move(), PROD, edm::PrincipalGetAdapter::productInstanceLabel(), provRecorder_, putImpl(), edm::principal_get_adapter_detail::throwOnPutOfNullProduct(), edm::principal_get_adapter_detail::throwOnPutOfUninitializedToken(), unpackBuffers-CaloStage2::token, and UNLIKELY.

402  {
403  if (UNLIKELY(product.get() == nullptr)) { // null pointer is illegal
404  TypeID typeID(typeid(PROD));
406  }
407  if (UNLIKELY(token.isUninitialized())) {
409  }
410  return putImpl(token.index(), std::move(product));
411  }
void throwOnPutOfUninitializedToken(char const *principalType, std::type_info const &productType)
OrphanHandle< PROD > putImpl(EDPutToken::value_type token, std::unique_ptr< PROD > product)
Definition: Event.h:374
std::string const & productInstanceLabel(EDPutToken) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
#define PROD(A, B)
#define UNLIKELY(x)
Definition: Likely.h:21
void throwOnPutOfNullProduct(char const *principalType, TypeID const &productType, std::string const &productInstanceName)
def move(src, dest)
Definition: eostools.py:511

◆ putImpl()

template<typename PROD >
OrphanHandle< PROD > Event::putImpl ( EDPutToken::value_type  token,
std::unique_ptr< PROD product 
)
private

Definition at line 374 of file Event.h.

References cms::cuda::assert(), edm::PrincipalGetAdapter::getProductID(), eostools::move(), dumpMFGeometry_cfg::prod, PROD, provRecorder_, putProducts(), size(), relativeConstraints::value, and pfClustersFromHGC3DClusters_cfi::wp.

Referenced by put().

374  {
375  // The following will call post_insert if T has such a function,
376  // and do nothing if T has no such function.
377  std::conditional_t<detail::has_postinsert<PROD>::value, DoPostInsert<PROD>, DoNotPostInsert<PROD>> maybe_inserter;
378  maybe_inserter(product.get());
379 
380  assert(index < putProducts().size());
381 
382  std::unique_ptr<Wrapper<PROD>> wp(new Wrapper<PROD>(std::move(product)));
383  PROD const* prod = wp->product();
384 
386  auto const& prodID = provRecorder_.getProductID(index);
387  return (OrphanHandle<PROD>(prod, prodID));
388  }
assert(be >=bs)
ProductID const & getProductID(unsigned int iPutTokenIndex) const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
size_t size() const
Definition: Event.cc:252
ProductPtrVec & putProducts()
Definition: Event.h:306
#define PROD(A, B)
def move(src, dest)
Definition: eostools.py:511

◆ putProducts() [1/2]

ProductPtrVec& edm::Event::putProducts ( )
inlineprivate

Definition at line 306 of file Event.h.

References putProducts_.

Referenced by commit_(), emplaceImpl(), putImpl(), and size().

306 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Event.h:314

◆ putProducts() [2/2]

ProductPtrVec const& edm::Event::putProducts ( ) const
inlineprivate

Definition at line 307 of file Event.h.

References putProducts_.

307 { return putProducts_; }
ProductPtrVec putProducts_
Definition: Event.h:314

◆ run()

RunNumber_t edm::Event::run ( ) const
inline

Definition at line 109 of file Event.h.

References edm::EventBase::id(), and edm::EventID::run().

Referenced by Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), and LaserSorter::writeEventHeader().

109 { return id().run(); }
edm::EventID id() const
Definition: EventBase.h:63
RunNumber_t run() const
Definition: EventID.h:38

◆ setConsumer()

void Event::setConsumer ( EDConsumerBase const *  iConsumer)

Definition at line 39 of file Event.cc.

References gotBranchIDs_, luminosityBlock_, edm::PrincipalGetAdapter::numberOfProductsConsumed(), provRecorder_, and edm::PrincipalGetAdapter::setConsumer().

39  {
40  provRecorder_.setConsumer(iConsumer);
42  if (luminosityBlock_) {
43  luminosityBlock_->setConsumer(iConsumer);
44  }
45  }
void setConsumer(EDConsumerBase const *iConsumer)
std::optional< LuminosityBlock > luminosityBlock_
Definition: Event.h:319
BranchIDSet gotBranchIDs_
Definition: Event.h:326
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
size_t numberOfProductsConsumed() const

◆ setProducer()

void Event::setProducer ( ProducerBase const *  iProd,
std::vector< BranchID > *  previousParentage,
std::vector< BranchID > *  gotBranchIDsFromAcquire = nullptr 
)

Definition at line 68 of file Event.cc.

References addToGotBranchIDs(), gotBranchIDsFromPrevious_, previousBranchIDs_, provRecorder_, edm::PrincipalGetAdapter::recordProvenanceList(), setProducerCommon(), and findQualityFiles::v.

70  {
71  setProducerCommon(iProd, previousParentage);
72  if (previousParentage) {
73  //are we supposed to record parentage for at least one item?
74  bool record_parents = false;
75  for (auto v : provRecorder_.recordProvenanceList()) {
76  if (v) {
77  record_parents = true;
78  break;
79  }
80  }
81  if (not record_parents) {
82  previousBranchIDs_ = nullptr;
83  return;
84  }
85  gotBranchIDsFromPrevious_.resize(previousParentage->size(), false);
86  if (gotBranchIDsFromAcquire) {
87  for (auto const& branchID : *gotBranchIDsFromAcquire) {
88  addToGotBranchIDs(branchID);
89  }
90  }
91  }
92  }
void addToGotBranchIDs(Provenance const &prov) const
Definition: Event.cc:235
std::vector< bool > const & recordProvenanceList() const
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
void setProducerCommon(ProducerBase const *iProd, std::vector< BranchID > *previousParentage)
Definition: Event.cc:61
std::vector< bool > gotBranchIDsFromPrevious_
Definition: Event.h:327
std::vector< BranchID > * previousBranchIDs_
Definition: Event.h:328

◆ setProducerCommon()

void Event::setProducerCommon ( ProducerBase const *  iProd,
std::vector< BranchID > *  previousParentage 
)

Definition at line 61 of file Event.cc.

References previousBranchIDs_, provRecorder_, putProducts_, edm::PrincipalGetAdapter::putTokenIndexToProductResolverIndex(), and edm::PrincipalGetAdapter::setProducer().

Referenced by setProducer(), and setProducerForAcquire().

61  {
63  //set appropriate size
65  previousBranchIDs_ = previousParentage;
66  }
void setProducer(ProducerBase const *iProd)
PrincipalGetAdapter provRecorder_
Definition: Event.h:309
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
ProductPtrVec putProducts_
Definition: Event.h:314
std::vector< BranchID > * previousBranchIDs_
Definition: Event.h:328

◆ setProducerForAcquire()

void Event::setProducerForAcquire ( ProducerBase const *  iProd,
std::vector< BranchID > *  previousParentage,
std::vector< BranchID > &  gotBranchIDsFromAcquire 
)

Definition at line 94 of file Event.cc.

References gotBranchIDsFromAcquire_, and setProducerCommon().

96  {
97  setProducerCommon(iProd, previousParentage);
98  gotBranchIDsFromAcquire_ = &gotBranchIDsFromAcquire;
99  gotBranchIDsFromAcquire_->clear();
100  }
std::vector< BranchID > * gotBranchIDsFromAcquire_
Definition: Event.h:329
void setProducerCommon(ProducerBase const *iProd, std::vector< BranchID > *previousParentage)
Definition: Event.cc:61

◆ setSharedResourcesAcquirer()

void Event::setSharedResourcesAcquirer ( SharedResourcesAcquirer iResourceAcquirer)

Definition at line 47 of file Event.cc.

References luminosityBlock_, provRecorder_, and edm::PrincipalGetAdapter::setSharedResourcesAcquirer().

47  {
48  provRecorder_.setSharedResourcesAcquirer(iResourceAcquirer);
49  if (luminosityBlock_) {
50  luminosityBlock_->setSharedResourcesAcquirer(iResourceAcquirer);
51  }
52  }
std::optional< LuminosityBlock > luminosityBlock_
Definition: Event.h:319
void setSharedResourcesAcquirer(SharedResourcesAcquirer *iSra)
PrincipalGetAdapter provRecorder_
Definition: Event.h:309

◆ size()

size_t Event::size ( void  ) const

◆ streamID()

StreamID edm::Event::streamID ( ) const
inline

◆ triggerNames()

TriggerNames const & Event::triggerNames ( edm::TriggerResults const &  triggerResults) const
overridevirtual

Implements edm::EventBase.

Definition at line 283 of file Event.cc.

References Exception, names, edm::EventBase::triggerNames_(), and edm::triggerResults().

Referenced by TopDiLeptonDQM::analyze(), EwkElecTauHistManager::fillHistograms(), EwkMuTauHistManager::fillHistograms(), and egHLT::OffHelper::setTrigInfo().

283  {
285  if (names != nullptr)
286  return *names;
287 
288  throw cms::Exception("TriggerNamesNotFound") << "TriggerNames not found in ParameterSet registry";
289  return *names;
290  }
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:45
const std::string names[nVars_]
static std::string const triggerResults("TriggerResults")

◆ triggerResultsByName()

TriggerResultsByName Event::triggerResultsByName ( edm::TriggerResults const &  triggerResults) const
overridevirtual

Implements edm::EventBase.

Definition at line 292 of file Event.cc.

References names, edm::EventBase::triggerNames_(), and edm::triggerResults().

292  {
295  }
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:45
const std::string names[nVars_]
static std::string const triggerResults("TriggerResults")

Friends And Related Function Documentation

◆ ::testEvent

friend class ::testEvent
friend

Definition at line 267 of file Event.h.

◆ ::testEventGetRefBeforePut

friend class ::testEventGetRefBeforePut
friend

Definition at line 266 of file Event.h.

◆ InputSource

friend class InputSource
friend

Definition at line 295 of file Event.h.

◆ ProducerBase

friend class ProducerBase
friend

Definition at line 297 of file Event.h.

◆ ProducerSourceBase

friend class ProducerSourceBase
friend

Definition at line 294 of file Event.h.

◆ RawInputSource

friend class RawInputSource
friend

Definition at line 296 of file Event.h.

◆ stream::ProducingModuleAdaptorBase

template<typename T >
friend class stream::ProducingModuleAdaptorBase
friend

Definition at line 299 of file Event.h.

Member Data Documentation

◆ aux_

EventAuxiliary const& edm::Event::aux_
private

Definition at line 316 of file Event.h.

Referenced by eventAuxiliary().

◆ emptyString_

std::string const Event::emptyString_
staticprivate

Definition at line 340 of file Event.h.

Referenced by getByLabel().

◆ gotBranchIDs_

BranchIDSet edm::Event::gotBranchIDs_
mutableprivate

Definition at line 326 of file Event.h.

Referenced by addToGotBranchIDs(), commit_aux(), and setConsumer().

◆ gotBranchIDsFromAcquire_

std::vector<BranchID>* edm::Event::gotBranchIDsFromAcquire_ = nullptr
private

Definition at line 329 of file Event.h.

Referenced by addToGotBranchIDs(), and setProducerForAcquire().

◆ gotBranchIDsFromPrevious_

std::vector<bool> edm::Event::gotBranchIDsFromPrevious_
mutableprivate

Definition at line 327 of file Event.h.

Referenced by addToGotBranchIDs(), commit_aux(), and setProducer().

◆ gotViews_

std::vector<std::shared_ptr<ViewBase> > edm::Event::gotViews_
mutableprivate

Definition at line 335 of file Event.h.

Referenced by fillView_().

◆ luminosityBlock_

std::optional<LuminosityBlock> edm::Event::luminosityBlock_
mutableprivate

◆ moduleCallingContext_

ModuleCallingContext const* edm::Event::moduleCallingContext_
private

◆ previousBranchIDs_

std::vector<BranchID>* edm::Event::previousBranchIDs_ = nullptr
private

Definition at line 328 of file Event.h.

Referenced by addToGotBranchIDs(), commit_aux(), setProducer(), and setProducerCommon().

◆ provRecorder_

PrincipalGetAdapter edm::Event::provRecorder_
private

◆ putProducts_

ProductPtrVec edm::Event::putProducts_
private

Definition at line 314 of file Event.h.

Referenced by putProducts(), and setProducerCommon().

◆ streamID_

StreamID edm::Event::streamID_
private

Definition at line 337 of file Event.h.

Referenced by streamID().