CMS 3D CMS Logo

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::TriggerResultssrc_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool, valueTypeevalType
 
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::HLTBitVariable ( CachingVariableFactoryArg  arg,
edm::ConsumesCollector iC 
)
inline

Definition at line 94 of file TriggerVariables.h.

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

◆ eval()

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

Reimplemented from CachingVariable.

Definition at line 101 of file TriggerVariables.h.

References edm::HLTGlobalStatus::accept(), bitName_, edm::HandleBase::failedToGet(), iEvent, edm::TriggerNames::size(), src_, and edm::TriggerNames::triggerIndex().

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  }
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< edm::TriggerResults > src_
unsigned int triggerIndex(std::string_view name) const
Definition: TriggerNames.cc:52
bool failedToGet() const
Definition: HandleBase.h:72
int iEvent
Definition: GenABIO.cc:224
std::size_t size() const
Definition: TriggerNames.cc:59
std::string bitName_

Member Data Documentation

◆ bitName_

std::string HLTBitVariable::bitName_
private

Definition at line 116 of file TriggerVariables.h.

Referenced by eval().

◆ src_

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

Definition at line 115 of file TriggerVariables.h.

Referenced by eval().