CMS 3D CMS Logo

UpdaterService.cc

Go to the documentation of this file.
00001 #include "FWCore/Services/interface/UpdaterService.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "DataFormats/Provenance/interface/EventID.h"
00004 
00005 #include <iostream>
00006 #include "DataFormats/Common/interface/Trie.h"
00007 
00008 UpdaterService::UpdaterService(const edm::ParameterSet & cfg, edm::ActivityRegistry & r ) :
00009   theEventId(0) {
00010   r.watchPreProcessEvent( this, & UpdaterService::init );
00011   theInit();
00012 }
00013 
00014 UpdaterService::~UpdaterService(){
00015 }
00016 
00017 void UpdaterService::init(const edm::EventID& eId, const edm::Timestamp&){
00018   theInit();
00019   theEventId = &eId;
00020 }
00021 
00022 void UpdaterService::theInit(){
00023   theCounts.clear();  
00024 }
00025 
00026 bool UpdaterService::checkOnce(std::string tag){
00027   bool answer=true;
00028 
00029   std::map<std::string, uint>::iterator i=theCounts.find(tag);
00030   if (i!=theCounts.end()){
00031     i->second++;
00032     answer=false;
00033   }
00034   else{
00035     theCounts[tag]=1;
00036     answer=true;
00037   }
00038 
00039   if (theEventId){ LogDebug("UpdaterService")<<"checking ONCE on tag: "<<tag
00040                                              <<"on run: "<<theEventId->run()<<" event: "<<theEventId->event()
00041                                              <<((answer)?" -> true":" -> false");
00042   }
00043   return answer;
00044 }
00045 
00046 bool UpdaterService::check(std::string tag, std::string label){
00047   return true;
00048 }

Generated on Tue Jun 9 17:36:40 2009 for CMSSW by  doxygen 1.5.4