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
HLTBitComputer Class Reference

#include <TriggerVariables.h>

Inheritance diagram for HLTBitComputer:
VariableComputer

Public Member Functions

void compute (const edm::Event &iEvent) const override
 
 HLTBitComputer (CachingVariable::CachingVariableFactoryArg arg, edm::ConsumesCollector &iC)
 
 ~HLTBitComputer () override
 
- Public Member Functions inherited from VariableComputer
void assign (std::string var, double &value) const
 
void declare (std::string var, edm::ConsumesCollector &iC)
 
void doesNotCompute () const
 
void doesNotCompute (std::string var) const
 
const std::string & name () const
 
bool notSeenThisEventAlready (const edm::Event &iEvent) const
 
 VariableComputer (const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
 
virtual ~VariableComputer ()
 

Private Attributes

edm::EDGetTokenT
< edm::TriggerResults
src_
 
std::vector< std::string > validTriggerNames_
 

Additional Inherited Members

- Protected Attributes inherited from VariableComputer
const
CachingVariable::CachingVariableFactoryArg
arg_
 
edm::Event::CacheIdentifier_t eventCacheID_ = 0
 
std::map< std::string, const
ComputedVariable * > 
iCompute_
 
std::string method_
 
std::string name_
 
std::string separator_
 

Detailed Description

Definition at line 57 of file TriggerVariables.h.

Constructor & Destructor Documentation

HLTBitComputer::HLTBitComputer ( CachingVariable::CachingVariableFactoryArg  arg,
edm::ConsumesCollector iC 
)
inline

Definition at line 59 of file TriggerVariables.h.

References edm::ConsumesCollector::consumes(), VariableComputer::declare(), CachingVariable::CachingVariableFactoryArg::iConfig, src_, AlCaHLTBitMon_QueryRunRegistry::string, tname(), and validTriggerNames_.

60  : VariableComputer(arg, iC) {
62  HLTConfigProvider provider;
63  //the function will not work anymore until a major redesign is performed. so long for HLT variables.
64  //provider.init(src_.process());
65  validTriggerNames_ = provider.triggerNames();
66  for (unsigned int iT = 0; iT != validTriggerNames_.size(); ++iT) {
67  TString tname(validTriggerNames_[iT]);
68  tname.ReplaceAll("HLT_", ""); //remove the "HLT_" prefix
69  declare(std::string(static_cast<const char*>(tname)), iC);
70  }
71  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > validTriggerNames_
VariableComputer(const CachingVariable::CachingVariableFactoryArg &arg, edm::ConsumesCollector &iC)
edm::EDGetTokenT< edm::TriggerResults > src_
std::string tname(const std::string &tableName, const std::string &schemaVersion)
void declare(std::string var, edm::ConsumesCollector &iC)
HLTBitComputer::~HLTBitComputer ( )
inlineoverride

Definition at line 72 of file TriggerVariables.h.

72 {}

Member Function Documentation

void HLTBitComputer::compute ( const edm::Event iEvent) const
inlineoverridevirtual

Implements VariableComputer.

Definition at line 73 of file TriggerVariables.h.

References VariableComputer::assign(), VariableComputer::doesNotCompute(), edm::Event::getByToken(), edm::HandleBase::isValid(), alignCSCRings::r, src_, AlCaHLTBitMon_QueryRunRegistry::string, tname(), edm::TriggerNames::triggerIndex(), L1TMuonDQMOffline_cfi::triggerNames, edm::Event::triggerNames(), and validTriggerNames_.

73  {
75  iEvent.getByToken(src_, trh);
76  if (!trh.isValid())
78  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*trh);
79  for (unsigned int iT = 0; iT != validTriggerNames_.size(); ++iT) {
80  TString tname(validTriggerNames_[iT]);
81  tname.ReplaceAll("HLT_", "");
82  double r = trh->accept(triggerNames.triggerIndex(validTriggerNames_[iT]));
83  assign(std::string(static_cast<const char*>(tname)), r);
84  }
85  }
std::vector< std::string > validTriggerNames_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
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
void assign(std::string var, double &value) const
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edm::TriggerResults > src_
std::string tname(const std::string &tableName, const std::string &schemaVersion)
void doesNotCompute() const

Member Data Documentation

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

Definition at line 88 of file TriggerVariables.h.

Referenced by compute(), and HLTBitComputer().

std::vector<std::string> HLTBitComputer::validTriggerNames_
private

Definition at line 89 of file TriggerVariables.h.

Referenced by compute(), and HLTBitComputer().