CMS 3D CMS Logo

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

#include <FWHLTValidator.h>

Inheritance diagram for FWHLTValidator:
FWValidatorBase

Public Member Functions

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

Private Member Functions

 FWHLTValidator (const FWHLTValidator &)
 
const FWHLTValidatoroperator= (const FWHLTValidator &)
 

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::FWHLTValidator ( std::string &  x)
inline

Definition at line 18 of file FWHLTValidator.h.

18 :m_process(x){}
std::string m_process
virtual FWHLTValidator::~FWHLTValidator ( )
inlinevirtual

Definition at line 19 of file FWHLTValidator.h.

19 {}
FWHLTValidator::FWHLTValidator ( const FWHLTValidator )
private

Member Function Documentation

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

Implements FWValidatorBase.

Definition at line 24 of file FWHLTValidator.cc.

References fwLog, edm::EventBase::getByLabel(), FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), mps_fire::i, fwlog::kWarning, m_process, m_triggerNames, edm::TriggerNames::size(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, edm::TriggerNames::triggerName(), and edm::TriggerNames::triggerNames().

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

Member Data Documentation

std::string FWHLTValidator::m_process
private

Definition at line 29 of file FWHLTValidator.h.

Referenced by fillOptions().

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

Definition at line 30 of file FWHLTValidator.h.

Referenced by fillOptions().