CMS 3D CMS Logo

List of all members | Public Member Functions | Static Protected Member Functions | Private Member Functions
edm::EventBase Class Referenceabstract

#include <EventBase.h>

Inheritance diagram for edm::EventBase:
edm::Event fwlite::EventBase fwlite::ChainEvent fwlite::Event fwlite::EventContainer fwlite::MultiChainEvent

Public Member Functions

int bunchCrossing () const
 
virtual edm::EventAuxiliary const & eventAuxiliary () const =0
 
 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
 
virtual edm::ParameterSet const * parameterSet (edm::ParameterSetID const &psID) const =0
 
virtual ProcessHistory const & processHistory () const =0
 
edm::Timestamp time () const
 
virtual TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const =0
 
virtual TriggerResultsByName triggerResultsByName (edm::TriggerResults const &triggerResults) const =0
 
virtual ~EventBase ()
 

Static Protected Member Functions

static edm::ParameterSet const * parameterSetForID_ (edm::ParameterSetID const &psID)
 
static TriggerNames const * triggerNames_ (edm::TriggerResults const &triggerResults)
 

Private Member Functions

virtual BasicHandle getByLabelImpl (std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const =0
 
virtual BasicHandle getByTokenImpl (std::type_info const &iProductType, EDGetToken) const =0
 
virtual BasicHandle getImpl (std::type_info const &iProductType, ProductID const &iTag) const =0
 

Detailed Description

Definition at line 47 of file EventBase.h.

Constructor & Destructor Documentation

◆ EventBase()

EventBase::EventBase ( )

Definition at line 37 of file EventBase.cc.

37 {}

◆ ~EventBase()

EventBase::~EventBase ( )
virtual

Reimplemented in fwlite::EventBase.

Definition at line 39 of file EventBase.cc.

39 {}

Member Function Documentation

◆ bunchCrossing()

int edm::EventBase::bunchCrossing ( ) const
inline

◆ eventAuxiliary()

virtual edm::EventAuxiliary const& edm::EventBase::eventAuxiliary ( ) const
pure virtual

◆ experimentType()

edm::EventAuxiliary::ExperimentType edm::EventBase::experimentType ( ) const
inline

Definition at line 67 of file EventBase.h.

References eventAuxiliary(), and edm::EventAuxiliary::experimentType().

Referenced by ecaldqm::RawDataTask::beginEvent().

67 { return eventAuxiliary().experimentType(); }
virtual edm::EventAuxiliary const & eventAuxiliary() const =0
ExperimentType experimentType() const

◆ get()

template<typename T >
bool EventBase::get ( ProductID const &  pid,
Handle< T > &  result 
) const

◆ getByLabel() [1/2]

bool edm::EventBase::getByLabel ( edm::InputTag const &  tag,
Handle< FWGenericObject > &  result 
) const

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

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

Definition at line 54 of file FWGenericHandle.cc.

References edm::TypeWithDict::byName(), edm::convert_handle(), edm::BasicHandle::failedToGet(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and edm::TypeWithDict::typeInfo().

54  {
55  std::string dataTypeName = result.type().name();
56  if (dataTypeName[dataTypeName.size() - 1] == '>')
57  dataTypeName += " ";
58  std::string wrapperName = "edm::Wrapper<" + dataTypeName + ">";
59 
60  edm::TypeWithDict wrapperType(edm::TypeWithDict::byName(wrapperName));
61 
62  BasicHandle bh = this->getByLabelImpl(wrapperType.typeInfo(), result.type().typeInfo(), tag);
63  convert_handle(bh, result); // throws on conversion error
64  if (bh.failedToGet())
65  return false;
66  return true;
67  }
virtual BasicHandle getByLabelImpl(std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const =0
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
Handle< T > convert_handle(BasicHandle &&bh) noexcept(true)
Definition: ConvertHandle.h:22

◆ getByLabel() [2/2]

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

◆ getByLabelImpl()

virtual BasicHandle edm::EventBase::getByLabelImpl ( std::type_info const &  iWrapperType,
std::type_info const &  iProductType,
InputTag const &  iTag 
) const
privatepure virtual

Implemented in edm::Event, and fwlite::EventBase.

Referenced by getByLabel().

◆ getByToken()

template<typename T >
bool EventBase::getByToken ( edm::EDGetTokenT< T > const &  token,
edm::Handle< T > &  result 
) const

Definition at line 108 of file EventBase.h.

References getByTokenImpl(), eostools::move(), mps_fire::result, and unpackBuffers-CaloStage2::token.

108  {
109  result.clear();
110  edm::BasicHandle bh = this->getByTokenImpl(typeid(T), token);
111  result = edm::convert_handle<T>(std::move(bh));
112  if (result.failedToGet()) {
113  return false;
114  }
115  return true;
116  }
virtual BasicHandle getByTokenImpl(std::type_info const &iProductType, EDGetToken) const =0
long double T
def move(src, dest)
Definition: eostools.py:511

◆ getByTokenImpl()

virtual BasicHandle edm::EventBase::getByTokenImpl ( std::type_info const &  iProductType,
EDGetToken   
) const
privatepure virtual

Implemented in edm::Event, and fwlite::EventBase.

Referenced by getByToken().

◆ getImpl()

virtual BasicHandle edm::EventBase::getImpl ( std::type_info const &  iProductType,
ProductID const &  iTag 
) const
privatepure virtual

Implemented in edm::Event, and fwlite::EventBase.

Referenced by get().

◆ id()

edm::EventID edm::EventBase::id ( void  ) const
inline

Definition at line 63 of file EventBase.h.

References eventAuxiliary(), and edm::EventAuxiliary::id().

Referenced by JetValidation::analyze(), SiStripPedestalsBuilder::analyze(), SiStripThresholdBuilder::analyze(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripSummaryBuilder::analyze(), SiStripDetVOffFakeBuilder::analyze(), EcalDQMonitorTask::analyze(), sistrip::SpyExtractRunModule::analyze(), sistrip::SpyIdentifyRunsModule::analyze(), ContainmentCorrectionAnalyzer::analyze(), FWHLTTriggerTableView::fillAverageAcceptFractions(), FWFileEntry::filterEventsWithCustomParser(), RunManagerMTWorker::generateEvent(), TrackProducer::getTransient(), TrackProducerWithSCAssociation::getTransient(), ALPAKA_ACCELERATOR_NAMESPACE::device::Event::id(), FWFFNavigator::isFirstEvent(), EgammaHLTNxNClusterProducer::makeNxNClusters(), GsfTrackProducer::produce(), TrackRefitter::produce(), GsfTrackRefitter::produce(), TrackProducer::produce(), DAFTrackProducer::produce(), EcalBarrelClusterFastTimer::produce(), PreshowerClusterShapeProducer::produce(), TrackTimeValueMapProducer::produce(), reco::PFMETProducerMVA::produce(), gen::Pythia6Gun::produce(), EgammaHLTNxNClusterProducer::produce(), RunManagerMTWorker::produce(), EcalSimpleProducer::produce(), LaserAlignment::produce(), edm::Event::run(), FWFFNavigator::setCurrentEvent(), reco::tau::RecoTauVertexAssociator::setEvent(), and LaserSorter::writeEventHeader().

63 { return eventAuxiliary().id(); }
virtual edm::EventAuxiliary const & eventAuxiliary() const =0
EventID const & id() const

◆ isRealData()

bool edm::EventBase::isRealData ( ) const
inline

◆ luminosityBlock()

edm::LuminosityBlockNumber_t edm::EventBase::luminosityBlock ( ) const
inline

◆ orbitNumber()

int edm::EventBase::orbitNumber ( ) const
inline

Definition at line 69 of file EventBase.h.

References eventAuxiliary(), and edm::EventAuxiliary::orbitNumber().

Referenced by ecaldqm::RawDataTask::beginEvent().

69 { return eventAuxiliary().orbitNumber(); }
virtual edm::EventAuxiliary const & eventAuxiliary() const =0
int orbitNumber() const

◆ parameterSet()

virtual edm::ParameterSet const* edm::EventBase::parameterSet ( edm::ParameterSetID const &  psID) const
pure virtual

◆ parameterSetForID_()

edm::ParameterSet const * EventBase::parameterSetForID_ ( edm::ParameterSetID const &  psID)
staticprotected

Definition at line 41 of file EventBase.cc.

References edm::pset::Registry::getMapped(), and edm::pset::Registry::instance().

Referenced by fwlite::Event::parameterSet(), and edm::Event::parameterSet().

41  {
43  }
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
static Registry * instance()
Definition: Registry.cc:12

◆ processHistory()

virtual ProcessHistory const& edm::EventBase::processHistory ( ) const
pure virtual

◆ time()

edm::Timestamp edm::EventBase::time ( ) const
inline

◆ triggerNames()

virtual TriggerNames const& edm::EventBase::triggerNames ( edm::TriggerResults const &  triggerResults) const
pure virtual

◆ triggerNames_()

TriggerNames const * EventBase::triggerNames_ ( edm::TriggerResults const &  triggerResults)
staticprotected

Definition at line 45 of file EventBase.cc.

References edm::ParameterSet::addParameter(), Exception, edm::pset::Registry::getMapped(), edm::ParameterSet::id(), edm::pset::Registry::instance(), muonDTDigis_cfi::pset, edm::ParameterSet::registerIt(), runTheMatrix::ret, edm::TriggerNames::size(), triggerNames(), and edm::triggerResults().

Referenced by fwlite::MultiChainEvent::triggerNames(), fwlite::Event::triggerNames(), edm::Event::triggerNames(), fwlite::MultiChainEvent::triggerResultsByName(), fwlite::Event::triggerResultsByName(), and edm::Event::triggerResultsByName().

45  {
46  // If TriggerNames was already created and cached here in the map,
47  // then look it up and return that one
48  TriggerNamesMap::const_iterator iter = triggerNamesMap.find(triggerResults.parameterSetID());
49  if (iter != triggerNamesMap.end()) {
50  return &iter->second;
51  }
52 
53  // Look for the parameter set containing the trigger names in the parameter
54  // set registry using the ID from TriggerResults as the key used to find it.
56  edm::ParameterSet const* pset = nullptr;
57  if (nullptr != (pset = psetRegistry->getMapped(triggerResults.parameterSetID()))) {
58  if (pset->existsAs<std::vector<std::string> >("@trigger_paths", true)) {
59  TriggerNames triggerNames(*pset);
60 
61  // This should never happen
62  if (triggerNames.size() != triggerResults.size()) {
63  throw cms::Exception("LogicError") << "edm::EventBase::triggerNames_ Encountered vector\n"
64  "of trigger names and a TriggerResults object with\n"
65  "different sizes. This should be impossible.\n"
66  "Please send information to reproduce this problem to\n"
67  "the edm developers.\n";
68  }
69 
70  std::pair<TriggerNamesMap::iterator, bool> ret = triggerNamesMap.insert(
71  std::pair<edm::ParameterSetID, edm::TriggerNames>(triggerResults.parameterSetID(), triggerNames));
72  return &(ret.first->second);
73  }
74  }
75  // For backward compatibility to very old data
76  if (!triggerResults.getTriggerNames().empty()) {
77  edm::ParameterSet fakePset;
78  fakePset.addParameter<std::vector<std::string> >("@trigger_paths", triggerResults.getTriggerNames());
79  fakePset.registerIt();
80  TriggerNames triggerNames(fakePset);
81 
82  // This should never happen
83  if (triggerNames.size() != triggerResults.size()) {
84  throw cms::Exception("LogicError") << "edm::EventBase::triggerNames_ Encountered vector\n"
85  "of trigger names and a TriggerResults object with\n"
86  "different sizes. This should be impossible.\n"
87  "Please send information to reproduce this problem to\n"
88  "the edm developers (2).\n";
89  }
90 
91  std::pair<TriggerNamesMap::iterator, bool> ret =
92  triggerNamesMap.insert(std::pair<edm::ParameterSetID, edm::TriggerNames>(fakePset.id(), triggerNames));
93  return &(ret.first->second);
94  }
95  return nullptr;
96  }
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
ret
prodAgent to be discontinued
ParameterSetID id() const
ParameterSet const & registerIt()
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
std::size_t size() const
Definition: TriggerNames.cc:59
static std::string const triggerResults("TriggerResults")
virtual TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const =0
static Registry * instance()
Definition: Registry.cc:12

◆ triggerResultsByName()

virtual TriggerResultsByName edm::EventBase::triggerResultsByName ( edm::TriggerResults const &  triggerResults) const
pure virtual