CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
heppy::TriggerBitChecker Class Reference

#include <TriggerBitChecker.h>

Classes

struct  pathStruct
 

Public Member Functions

bool check (const edm::EventBase &event, const edm::TriggerResults &result) const
 
 TriggerBitChecker (const std::string &path="DUMMY")
 
 TriggerBitChecker (const std::vector< std::string > &paths)
 
 ~TriggerBitChecker ()
 

Private Member Functions

pathStruct returnPathStruct (const std::string &path) const
 
void rmstar ()
 executes a 'rm -rf *' in current directory More...
 
void syncIndices (const edm::EventBase &event, const edm::TriggerResults &result) const
 sync indices with path names More...
 

Private Attributes

std::vector< unsigned int > indices_
 
unsigned int lastRun_
 
std::vector< pathStructpaths_
 

Detailed Description

Definition at line 11 of file TriggerBitChecker.h.

Constructor & Destructor Documentation

heppy::TriggerBitChecker::TriggerBitChecker ( const std::string &  path = "DUMMY")

Definition at line 7 of file TriggerBitChecker.cc.

References rmstar().

void rmstar()
executes a &#39;rm -rf *&#39; in current directory
std::vector< pathStruct > paths_
pathStruct returnPathStruct(const std::string &path) const
heppy::TriggerBitChecker::TriggerBitChecker ( const std::vector< std::string > &  paths)

Definition at line 9 of file TriggerBitChecker.cc.

References i, paths_, returnPathStruct(), and rmstar().

9  : paths_(paths.size()), lastRun_(0) {
10  for(size_t i = 0; i < paths.size(); ++ i) paths_[i] = returnPathStruct(paths[i]);
11  rmstar();
12 }
void rmstar()
executes a &#39;rm -rf *&#39; in current directory
int i
Definition: DBlmapReader.cc:9
std::vector< pathStruct > paths_
pathStruct returnPathStruct(const std::string &path) const
heppy::TriggerBitChecker::~TriggerBitChecker ( )
inline

Definition at line 23 of file TriggerBitChecker.h.

23 {}

Member Function Documentation

bool heppy::TriggerBitChecker::check ( const edm::EventBase event,
const edm::TriggerResults result 
) const

Definition at line 24 of file TriggerBitChecker.cc.

References edm::HLTGlobalStatus::accept(), edm::EventBase::id(), indices_, lastRun_, edm::EventID::run(), and syncIndices().

24  {
25  if (event.id().run() != lastRun_) { syncIndices(event, result); lastRun_ = event.id().run(); }
26  for (std::vector<unsigned int>::const_iterator it = indices_.begin(), ed = indices_.end(); it != ed; ++it) {
27  if (result.accept(*it)) return true;
28  }
29  return false;
30 }
RunNumber_t run() const
Definition: EventID.h:39
bool accept() const
Has at least one path accepted the event?
std::vector< unsigned int > indices_
edm::EventID id() const
Definition: EventBase.h:60
void syncIndices(const edm::EventBase &event, const edm::TriggerResults &result) const
sync indices with path names
TriggerBitChecker::pathStruct heppy::TriggerBitChecker::returnPathStruct ( const std::string &  path) const
private

Definition at line 14 of file TriggerBitChecker.cc.

References heppy::TriggerBitChecker::pathStruct::first, heppy::TriggerBitChecker::pathStruct::last, and heppy::TriggerBitChecker::pathStruct::pathName.

Referenced by TriggerBitChecker().

14  {
15  pathStruct newPathStruct(path);
16  if( path[0] > 48 /*'0'*/ && path[0] <= 57 /*'9'*/ ) {
17  newPathStruct.first = atoi(path.substr(0,path.find('-')).c_str());
18  newPathStruct.last = atoi(path.substr(path.find('-')+1,path.find(':')-path.find('-')-1).c_str());
19  newPathStruct.pathName = path.substr(path.find(':')+1);
20  }
21  return newPathStruct;
22 }
void heppy::TriggerBitChecker::rmstar ( )
private

executes a 'rm -rf *' in current directory

Definition at line 44 of file TriggerBitChecker.cc.

References customizeTrackingMonitorSeedNumber::idx, and paths_.

Referenced by TriggerBitChecker().

44  {
45  std::vector<pathStruct>::iterator itp, bgp = paths_.begin(), edp = paths_.end();
46  for (itp = bgp; itp != edp; ++itp) {
47  std::string::size_type idx = itp->pathName.find("*");
48  if (idx != std::string::npos) itp->pathName.erase(idx);
49  }
50 }
uint16_t size_type
std::vector< pathStruct > paths_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void heppy::TriggerBitChecker::syncIndices ( const edm::EventBase event,
const edm::TriggerResults result 
) const
private

sync indices with path names

Definition at line 32 of file TriggerBitChecker.cc.

References i, indices_, gen::n, cscdqm::h::names, paths_, edm::TriggerNames::size(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TriggerNames::triggerName().

Referenced by check().

32  {
33  indices_.clear();
34  const edm::TriggerNames &names = event.triggerNames(result);
35  std::vector<pathStruct>::const_iterator itp, bgp = paths_.begin(), edp = paths_.end();
36  for (size_t i = 0, n = names.size(); i < n; ++i) {
37  const std::string &thispath = names.triggerName(i);
38  for (itp = bgp; itp != edp; ++itp) {
39  if (thispath.find(itp->pathName) == 0 && event.id().run() >= itp->first && event.id().run() <= itp->last) indices_.push_back(i);
40  }
41  }
42 }
int i
Definition: DBlmapReader.cc:9
static const HistoName names[]
Strings::size_type size() const
Definition: TriggerNames.cc:39
std::vector< pathStruct > paths_
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
std::vector< unsigned int > indices_

Member Data Documentation

std::vector<unsigned int> heppy::TriggerBitChecker::indices_
mutableprivate

Definition at line 32 of file TriggerBitChecker.h.

Referenced by check(), and syncIndices().

unsigned int heppy::TriggerBitChecker::lastRun_
mutableprivate

Definition at line 31 of file TriggerBitChecker.h.

Referenced by check().

std::vector<pathStruct> heppy::TriggerBitChecker::paths_
private