CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HLTBitVariable Class Reference

#include <TriggerVariables.h>

Inheritance diagram for HLTBitVariable:
CachingVariable

Public Member Functions

CachingVariable::evalType eval (const edm::Event &iEvent) const override
 
 HLTBitVariable (CachingVariableFactoryArg arg, edm::ConsumesCollector &iC)
 
- Public Member Functions inherited from CachingVariable
void addDescriptionLine (const std::string &s)
 
 CachingVariable (std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
bool compute (const edm::Event &iEvent) const
 
const Descriptiondescription () const
 
const std::string & holderName () const
 
const std::string & method () const
 
const std::string & name () const
 
valueType operator() (const edm::Event &iEvent) const
 
void print () const
 
void setHolder (std::string hn) const
 
virtual ~CachingVariable ()
 

Private Attributes

std::string bitName_
 
edm::EDGetTokenT
< edm::TriggerResults
src_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool,
valueType
evalType
 
typedef double valueType
 
typedef std::map< std::string,
const CachingVariable * > 
vMap
 
- Protected Member Functions inherited from CachingVariable
evalTypebaseEval (const edm::Event &iEvent) const
 
bool notSeenThisEventAlready (const edm::Event &iEvent) const
 
void setCache (valueType &v) const
 
void setNotCompute () const
 
- Protected Attributes inherited from CachingVariable
evalType cache_
 
edm::ParameterSet conf_
 
Description d_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::string holderName_
 
std::string method_
 
std::string name_
 

Detailed Description

Definition at line 92 of file TriggerVariables.h.

Constructor & Destructor Documentation

HLTBitVariable::HLTBitVariable ( CachingVariableFactoryArg  arg,
edm::ConsumesCollector iC 
)
inline

Definition at line 94 of file TriggerVariables.h.

References CachingVariable::CachingVariableFactoryArg::m, and CachingVariable::CachingVariableFactoryArg::n.

95  : CachingVariable("HLTBitVariable", arg.n, arg.iConfig, iC),
96  src_(
98  bitName_(arg.n) {
99  arg.m[arg.n] = this;
100  }
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::TriggerResults > src_
A arg
Definition: Factorize.h:31
std::string bitName_

Member Function Documentation

CachingVariable::evalType HLTBitVariable::eval ( const edm::Event iEvent) const
inlineoverridevirtual

Reimplemented from CachingVariable.

Definition at line 101 of file TriggerVariables.h.

References bitName_, edm::HandleBase::failedToGet(), edm::Event::getByToken(), edm::TriggerNames::size(), src_, edm::TriggerNames::triggerIndex(), and edm::Event::triggerNames().

101  {
103  iEvent.getByToken(src_, hltHandle);
104  if (hltHandle.failedToGet())
105  return std::make_pair(false, 0);
106  const edm::TriggerNames& trgNames = iEvent.triggerNames(*hltHandle);
107  unsigned int index = trgNames.triggerIndex(bitName_);
108  if (index == trgNames.size())
109  return std::make_pair(false, 0);
110  else
111  return std::make_pair(true, hltHandle->accept(index));
112  }
std::size_t size() const
Definition: TriggerNames.cc:59
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< edm::TriggerResults > src_
unsigned int triggerIndex(std::string_view name) const
Definition: TriggerNames.cc:52
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
bool failedToGet() const
Definition: HandleBase.h:72
std::string bitName_

Member Data Documentation

std::string HLTBitVariable::bitName_
private

Definition at line 116 of file TriggerVariables.h.

Referenced by eval().

edm::EDGetTokenT<edm::TriggerResults> HLTBitVariable::src_
private

Definition at line 115 of file TriggerVariables.h.

Referenced by eval().