CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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< boost::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 16 of file FWHLTValidator.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file FWHLTValidator.h.

19 :m_process(x){}
std::string m_process
Definition: DDAxes.h:10
virtual FWHLTValidator::~FWHLTValidator ( )
inlinevirtual

Definition at line 20 of file FWHLTValidator.h.

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

Member Function Documentation

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

Implements FWValidatorBase.

Definition at line 25 of file FWHLTValidator.cc.

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

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

Definition at line 22 of file FWHLTValidator.h.

References m_process, m_triggerNames, and x.

Referenced by python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), and FWGUIEventSelector::triggerProcessCallback().

22 { m_process = x; m_triggerNames.clear(); }
std::string m_process
std::vector< std::string > m_triggerNames
Definition: DDAxes.h:10

Member Data Documentation

std::string FWHLTValidator::m_process
private

Definition at line 30 of file FWHLTValidator.h.

Referenced by fillOptions(), and setProcess().

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

Definition at line 31 of file FWHLTValidator.h.

Referenced by fillOptions(), and setProcess().