CMS 3D CMS Logo

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

#include <UpdaterService.h>

Public Member Functions

bool check (std::string, std::string)
 
bool checkOnce (std::string)
 
void init (const edm::EventID &, const edm::Timestamp &)
 
 UpdaterService (const edm::ParameterSet &cfg, edm::ActivityRegistry &r)
 
 ~UpdaterService ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void theInit ()
 

Private Attributes

std::map< std::string,
unsigned int > 
theCounts
 
const edm::EventIDtheEventId
 

Detailed Description

Definition at line 16 of file UpdaterService.h.

Constructor & Destructor Documentation

UpdaterService::UpdaterService ( const edm::ParameterSet cfg,
edm::ActivityRegistry r 
)

Definition at line 10 of file UpdaterService.cc.

References init(), theInit(), and edm::ActivityRegistry::watchPreProcessEvent().

10  :
11  theEventId(0) {
13  theInit();
14 }
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
const edm::EventID * theEventId
void init(const edm::EventID &, const edm::Timestamp &)
UpdaterService::~UpdaterService ( )

Definition at line 16 of file UpdaterService.cc.

16  {
17 }

Member Function Documentation

bool UpdaterService::check ( std::string  ,
std::string   
)

Definition at line 53 of file UpdaterService.cc.

53  {
54  return true;
55 }
bool UpdaterService::checkOnce ( std::string  tag)

Definition at line 33 of file UpdaterService.cc.

References submit::answer, edm::EventID::event(), i, LogDebug, edm::EventID::run(), GlobalPosition_Frontier_DevDB_cff::tag, theCounts, and theEventId.

33  {
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 }
#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
const edm::EventID * theEventId
std::map< std::string, unsigned int > theCounts
void UpdaterService::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 19 of file UpdaterService.cc.

References edm::ConfigurationDescriptions::add().

19  {
21  descriptions.add("UpdaterService", desc);
22 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void UpdaterService::init ( const edm::EventID eId,
const edm::Timestamp  
)

Definition at line 24 of file UpdaterService.cc.

References theEventId, and theInit().

Referenced by UpdaterService().

24  {
25  theInit();
26  theEventId = &eId;
27 }
const edm::EventID * theEventId
void UpdaterService::theInit ( )
private

Definition at line 29 of file UpdaterService.cc.

References theCounts.

Referenced by init(), and UpdaterService().

29  {
30  theCounts.clear();
31 }
std::map< std::string, unsigned int > theCounts

Member Data Documentation

std::map< std::string, unsigned int > UpdaterService::theCounts
private

Definition at line 31 of file UpdaterService.h.

Referenced by checkOnce(), and theInit().

const edm::EventID* UpdaterService::theEventId
private

Definition at line 32 of file UpdaterService.h.

Referenced by checkOnce(), and init().