CMS 3D CMS Logo

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

#include <VariableHelper.h>

Public Member Functions

VariableHelperget ()
 
VariableHelperinit (std::string user, const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
void postProcess (const edm::Event &event, const edm::EventSetup &setup)
 
void preModule (const edm::ModuleDescription &desc)
 
VariableHelperset (std::string user)
 
 VariableHelperService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &r)
 
 ~VariableHelperService ()
 

Private Attributes

std::map< std::string,
VariableHelper * > 
multipleInstance_
 
bool printValuesForEachEvent_
 
std::string printValuesForEachEventCategory_
 
VariableHelperSetVariableHelperUniqueInstance_
 

Detailed Description

Definition at line 35 of file VariableHelper.h.

Constructor & Destructor Documentation

VariableHelperService::VariableHelperService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry r 
)
inline

Definition at line 43 of file VariableHelper.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), postProcess(), preModule(), printValuesForEachEvent_, printValuesForEachEventCategory_, AlCaHLTBitMon_QueryRunRegistry::string, edm::ActivityRegistry::watchPostProcessEvent(), and edm::ActivityRegistry::watchPreModule().

43  {
46  printValuesForEachEvent_ = iConfig.exists("printValuesForEachEventCategory");
48  printValuesForEachEventCategory_ = iConfig.getParameter<std::string>("printValuesForEachEventCategory");
49  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::string printValuesForEachEventCategory_
void watchPreModule(PreModule::slot_type const &iSlot)
void preModule(const edm::ModuleDescription &desc)
void postProcess(const edm::Event &event, const edm::EventSetup &setup)
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
VariableHelperService::~VariableHelperService ( )
inline

Definition at line 50 of file VariableHelper.h.

References multipleInstance_.

50  {
51  for (std::map<std::string, VariableHelper* > :: iterator it=multipleInstance_.begin(); it!=multipleInstance_.end(); ++it){
52  delete it->second;
53  }
54  }
std::map< std::string, VariableHelper * > multipleInstance_

Member Function Documentation

VariableHelper& VariableHelperService::get ( void  )
inline
VariableHelper& VariableHelperService::init ( std::string  user,
const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
inline
void VariableHelperService::postProcess ( const edm::Event event,
const edm::EventSetup setup 
)
inline

Definition at line 86 of file VariableHelper.h.

References f, multipleInstance_, printValuesForEachEvent_, and printValuesForEachEventCategory_.

Referenced by VariableHelperService().

86  {
87  if (!printValuesForEachEvent_) return;
88  std::map<std::string, VariableHelper* >::iterator f= multipleInstance_.begin();
89  for (; f!=multipleInstance_.end();++f){
90  // std::cout<<" category is: "<<printValuesForEachEventCategory_+"|"+f->first<<std::endl;
91  // std::cout<<f->first<<"\n" <<f->second->printValues(event);
92 
93  edm::LogInfo(printValuesForEachEventCategory_+"|"+f->first)<<f->first<<"\n"
94  <<f->second->printValues(event);
95  }
96  }
std::map< std::string, VariableHelper * > multipleInstance_
std::string printValuesForEachEventCategory_
double f[11][100]
void VariableHelperService::preModule ( const edm::ModuleDescription desc)
inline

Definition at line 77 of file VariableHelper.h.

References f, edm::ModuleDescription::moduleLabel(), multipleInstance_, and SetVariableHelperUniqueInstance_.

Referenced by VariableHelperService().

77  {
78  //does a set with the module name, except that it does not throw on non-configured modules
79  std::map<std::string, VariableHelper* >::iterator f=multipleInstance_.find(desc.moduleLabel());
80  if (f != multipleInstance_.end()) SetVariableHelperUniqueInstance_ = (f->second);
81  else {
82  //do not say anything but set it to zero to get a safe crash in get() if ever called
84  }
std::map< std::string, VariableHelper * > multipleInstance_
VariableHelper * SetVariableHelperUniqueInstance_
std::string const & moduleLabel() const
double f[11][100]
VariableHelper& VariableHelperService::set ( std::string  user)
inline

Definition at line 98 of file VariableHelper.h.

References dtNoiseDBValidation_cfg::cerr, f, multipleInstance_, and SetVariableHelperUniqueInstance_.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

98  {
99  std::map<std::string, VariableHelper* >::iterator f=multipleInstance_.find(user);
100  if (f == multipleInstance_.end()){
101  std::cerr<<user<<" VariableHelper user not defined."<<std::endl;
102  throw;
103  }
104  else{
105  SetVariableHelperUniqueInstance_ = (f->second);
107  }
108  }
std::map< std::string, VariableHelper * > multipleInstance_
VariableHelper * SetVariableHelperUniqueInstance_
double f[11][100]

Member Data Documentation

std::map<std::string, VariableHelper* > VariableHelperService::multipleInstance_
private

Definition at line 38 of file VariableHelper.h.

Referenced by init(), postProcess(), preModule(), set(), and ~VariableHelperService().

bool VariableHelperService::printValuesForEachEvent_
private

Definition at line 40 of file VariableHelper.h.

Referenced by postProcess(), and VariableHelperService().

std::string VariableHelperService::printValuesForEachEventCategory_
private

Definition at line 41 of file VariableHelper.h.

Referenced by postProcess(), and VariableHelperService().

VariableHelper* VariableHelperService::SetVariableHelperUniqueInstance_
private

Definition at line 37 of file VariableHelper.h.

Referenced by get(), init(), preModule(), and set().