CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UpdaterService.cc
Go to the documentation of this file.
2 
7 
8 #include <iostream>
9 
11  theEventId(0) {
13  theInit();
14 }
15 
17 }
18 
21  descriptions.add("UpdaterService", desc);
22 }
23 
25  theInit();
26  theEventId = &eId;
27 }
28 
30  theCounts.clear();
31 }
32 
33 bool UpdaterService::checkOnce(std::string tag) {
34  bool answer = true;
35 
36  std::map<std::string, unsigned int>::iterator i = theCounts.find(tag);
37  if(i != theCounts.end()) {
38  ++i->second;
39  answer = false;
40  } else{
41  theCounts[tag] = 1;
42  answer = true;
43  }
44 
45  if(theEventId) {
46  LogDebug("UpdaterService")
47  << "checking ONCE on tag: " << tag << "on run: " << theEventId->run()
48  << " event: " << theEventId->event() << ((answer) ? " -> true" : " -> false");
49  }
50  return answer;
51 }
52 
53 bool UpdaterService::check(std::string /*tag*/, std::string /*label*/) {
54  return true;
55 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
answer
Definition: submit.py:44
int i
Definition: DBlmapReader.cc:9
UpdaterService(const edm::ParameterSet &cfg, edm::ActivityRegistry &r)
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
const edm::EventID * theEventId
bool checkOnce(std::string)
void init(const edm::EventID &, const edm::Timestamp &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< std::string, unsigned int > theCounts
bool check(std::string, std::string)