CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FWHLTValidator Class Reference

#include <FWHLTValidator.h>

Inheritance diagram for FWHLTValidator:
FWValidatorBase

Public Member Functions

void fillOptions (const char *iBegin, const char *iEnd, std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &oOptions) const override
 
 FWHLTValidator (std::string &x)
 
 FWHLTValidator (const FWHLTValidator &)=delete
 
const FWHLTValidatoroperator= (const FWHLTValidator &)=delete
 
void setProcess (const char *x)
 
 ~FWHLTValidator () override
 
- Public Member Functions inherited from FWValidatorBase
 FWValidatorBase ()
 
 FWValidatorBase (const FWValidatorBase &)=delete
 
const FWValidatorBaseoperator= (const FWValidatorBase &)=delete
 
virtual ~FWValidatorBase ()
 

Private Attributes

std::string m_process
 
std::vector< std::string > m_triggerNames
 

Detailed Description

Definition at line 15 of file FWHLTValidator.h.

Constructor & Destructor Documentation

◆ FWHLTValidator() [1/2]

FWHLTValidator::FWHLTValidator ( std::string &  x)
inline

Definition at line 17 of file FWHLTValidator.h.

17 : m_process(x) {}
std::string m_process

◆ ~FWHLTValidator()

FWHLTValidator::~FWHLTValidator ( )
inlineoverride

Definition at line 18 of file FWHLTValidator.h.

18 {}

◆ FWHLTValidator() [2/2]

FWHLTValidator::FWHLTValidator ( const FWHLTValidator )
delete

Member Function Documentation

◆ fillOptions()

void FWHLTValidator::fillOptions ( const char *  iBegin,
const char *  iEnd,
std::vector< std::pair< std::shared_ptr< std::string >, std::string > > &  oOptions 
) const
overridevirtual

Implements FWValidatorBase.

Definition at line 23 of file FWHLTValidator.cc.

References fwLog, edm::EventBase::getByLabel(), FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), mps_fire::i, fwlog::kWarning, m_process, m_triggerNames, jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and L1TEGammaOffline_cfi::triggerNames.

25  {
26  oOptions.clear();
27  std::string part(iBegin, iEnd);
28  part = boost::regex_replace(part, boost::regex(".*?(\\&\\&|\\|\\||\\s)+"), "");
29 
30  if (m_triggerNames.empty()) {
31  edm::Handle<edm::TriggerResults> hTriggerResults;
32  edm::TriggerNames const* triggerNames(nullptr);
33  try {
34  edm::InputTag tag("TriggerResults", "", m_process.c_str());
36  event->getByLabel(tag, hTriggerResults);
37  triggerNames = &event->triggerNames(*hTriggerResults);
38  } catch (...) {
39  fwLog(fwlog::kWarning) << " no trigger results with process name " << m_process << " is available" << std::endl;
40  return;
41  }
42  for (unsigned int i = 0; i < triggerNames->size(); ++i)
43  m_triggerNames.push_back(triggerNames->triggerName(i));
44  std::sort(m_triggerNames.begin(), m_triggerNames.end());
45  }
46 
47  //only use add items which begin with the part of the member we are trying to match
48  unsigned int part_size = part.size();
49  for (std::vector<std::string>::const_iterator trigger = m_triggerNames.begin(); trigger != m_triggerNames.end();
50  ++trigger)
51  if (part == trigger->substr(0, part_size)) {
52  oOptions.push_back(std::make_pair(std::make_shared<std::string>(*trigger),
53  trigger->substr(part_size, trigger->size() - part_size)));
54  }
55 }
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:97
const edm::EventBase * getCurrentEvent() const
std::string m_process
std::vector< std::string > m_triggerNames
static FWGUIManager * getGUIManager()
#define fwLog(_level_)
Definition: fwLog.h:45
part
Definition: HCALResponse.h:20

◆ operator=()

const FWHLTValidator& FWHLTValidator::operator= ( const FWHLTValidator )
delete

◆ setProcess()

void FWHLTValidator::setProcess ( const char *  x)
inline

Definition at line 20 of file FWHLTValidator.h.

References m_process, m_triggerNames, and x.

Referenced by FWGUIEventSelector::triggerProcessCallback().

20  {
21  m_process = x;
22  m_triggerNames.clear();
23  }
std::string m_process
std::vector< std::string > m_triggerNames

Member Data Documentation

◆ m_process

std::string FWHLTValidator::m_process
private

Definition at line 33 of file FWHLTValidator.h.

Referenced by fillOptions(), and setProcess().

◆ m_triggerNames

std::vector<std::string> FWHLTValidator::m_triggerNames
mutableprivate

Definition at line 34 of file FWHLTValidator.h.

Referenced by fillOptions(), and setProcess().