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
 
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 getImpl (std::type_info const &iProductType, ProductID const &iTag) const =0
 

Detailed Description

Definition at line 46 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 63 of file EventBase.h.

63 { return eventAuxiliary().experimentType(); }

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

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

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

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  }

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

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

◆ 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

◆ 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 65 of file EventBase.h.

65 { return eventAuxiliary().orbitNumber(); }

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

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

◆ 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

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

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  }

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

◆ triggerResultsByName()

virtual TriggerResultsByName edm::EventBase::triggerResultsByName ( edm::TriggerResults const &  triggerResults) const
pure virtual
edm::ParameterSet::registerIt
ParameterSet const & registerIt()
Definition: ParameterSet.cc:113
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
edm::TypeWithDict::byName
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
edm::EventBase::triggerNames
virtual TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const =0
edm::ParameterSet::id
ParameterSetID id() const
Definition: ParameterSet.cc:189
edm::convert_handle
Handle< T > convert_handle(BasicHandle &&bh) noexcept(true)
Definition: ConvertHandle.h:22
edm::EventAuxiliary::bunchCrossing
int bunchCrossing() const
Definition: EventAuxiliary.h:76
edm::Wrapper
Definition: Product.h:10
edm::EventAuxiliary::id
EventID const & id() const
Definition: EventAuxiliary.h:63
edm::EventAuxiliary::experimentType
ExperimentType experimentType() const
Definition: EventAuxiliary.h:75
edm::EventBase::eventAuxiliary
virtual edm::EventAuxiliary const & eventAuxiliary() const =0
edm::EventAuxiliary::orbitNumber
int orbitNumber() const
Definition: EventAuxiliary.h:77
edm::EventBase::getByLabelImpl
virtual BasicHandle getByLabelImpl(std::type_info const &iWrapperType, std::type_info const &iProductType, InputTag const &iTag) const =0
edm::TypeWithDict
Definition: TypeWithDict.h:38
edm::ParameterSet
Definition: ParameterSet.h:47
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
edm::EventAuxiliary::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventAuxiliary.h:67
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
edm::EventAuxiliary::time
Timestamp const & time() const
Definition: EventAuxiliary.h:66
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::TriggerNames::size
std::size_t size() const
Definition: TriggerNames.cc:59
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:245
edm::triggerResults
static const std::string triggerResults("TriggerResults")
mps_fire.result
result
Definition: mps_fire.py:311
edm::EventAuxiliary::isRealData
bool isRealData() const
Definition: EventAuxiliary.h:74
edm::pset::Registry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
edm::pset::Registry
Definition: Registry.h:26
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::EventBase::getImpl
virtual BasicHandle getImpl(std::type_info const &iProductType, ProductID const &iTag) const =0