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 9 of file UpdaterService.cc.

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

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

Definition at line 15 of file UpdaterService.cc.

15  {
16 }

Member Function Documentation

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

Definition at line 52 of file UpdaterService.cc.

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

Definition at line 32 of file UpdaterService.cc.

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

32  {
33  bool answer=true;
34 
35  std::map<std::string, unsigned int>::iterator i=theCounts.find(tag);
36  if (i!=theCounts.end()){
37  i->second++;
38  answer=false;
39  }
40  else{
41  theCounts[tag]=1;
42  answer=true;
43  }
44 
45  if (theEventId){ LogDebug("UpdaterService")<<"checking ONCE on tag: "<<tag
46  <<"on run: "<<theEventId->run()<<" event: "<<theEventId->event()
47  <<((answer)?" -> true":" -> false");
48  }
49  return answer;
50 }
#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 18 of file UpdaterService.cc.

References edm::ConfigurationDescriptions::add().

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

Definition at line 23 of file UpdaterService.cc.

References theEventId, and theInit().

Referenced by UpdaterService().

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

Definition at line 28 of file UpdaterService.cc.

References theCounts.

Referenced by init(), and UpdaterService().

28  {
29  theCounts.clear();
30 }
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().