CMS 3D CMS Logo

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::TriggerResultssrc_
 
std::vector< std::string > validTriggerNames_
 

Additional Inherited Members

- Protected Attributes inherited from VariableComputer
const CachingVariable::CachingVariableFactoryArgarg_
 
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::HLTBitComputer ( CachingVariable::CachingVariableFactoryArg  arg,
edm::ConsumesCollector iC 
)
inline

Definition at line 59 of file TriggerVariables.h.

References edm::ConsumesCollector::consumes(), VariableComputer::declare(), 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)
A arg
Definition: Factorize.h:31
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::~HLTBitComputer ( )
inlineoverride

Definition at line 72 of file TriggerVariables.h.

72 {}

Member Function Documentation

◆ compute()

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

Implements VariableComputer.

Definition at line 73 of file TriggerVariables.h.

References edm::HLTGlobalStatus::accept(), VariableComputer::assign(), VariableComputer::doesNotCompute(), iEvent, edm::HandleBase::isValid(), alignCSCRings::r, src_, AlCaHLTBitMon_QueryRunRegistry::string, tname(), L1TEGammaOffline_cfi::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  }
bool accept() const
Has at least one path accepted the event?
std::vector< std::string > validTriggerNames_
void assign(std::string var, double &value) const
int iEvent
Definition: GenABIO.cc:224
void doesNotCompute() const
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edm::TriggerResults > src_
std::string tname(const std::string &tableName, const std::string &schemaVersion)

Member Data Documentation

◆ src_

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

Definition at line 88 of file TriggerVariables.h.

Referenced by compute(), and HLTBitComputer().

◆ validTriggerNames_

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

Definition at line 89 of file TriggerVariables.h.

Referenced by compute(), and HLTBitComputer().