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 (edm::StreamContext const &sc)
 
void preModule (edm::StreamContext const &, edm::ModuleCallingContext const &mcc)
 
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 36 of file VariableHelper.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file VariableHelper.h.

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

45  //r.watchPreModule(this, &VariableHelperService::preModule );
47  //r.watchPostProcessEvent(this, &VariableHelperService::postProcess );
49  printValuesForEachEvent_ = iConfig.exists("printValuesForEachEventCategory");
51  printValuesForEachEventCategory_ = iConfig.getParameter<std::string>("printValuesForEachEventCategory");
52  }
T getParameter(std::string const &) const
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void watchPostEvent(PostEvent::slot_type const &iSlot)
bool exists(std::string const &parameterName) const
checks if a parameter exists
VariableHelper * SetVariableHelperUniqueInstance_
std::string printValuesForEachEventCategory_
void postProcess(edm::StreamContext const &sc)
void preModule(edm::StreamContext const &, edm::ModuleCallingContext const &mcc)
VariableHelperService::~VariableHelperService ( )
inline

Definition at line 53 of file VariableHelper.h.

References multipleInstance_.

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

Member Function Documentation

VariableHelper& VariableHelperService::get ( )
inline
VariableHelper& VariableHelperService::init ( std::string  user,
const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
inline
void VariableHelperService::postProcess ( edm::StreamContext const &  sc)
inline

Definition at line 91 of file VariableHelper.h.

References printValuesForEachEvent_.

Referenced by VariableHelperService().

91  {
92 
93  if (!printValuesForEachEvent_) return;
94 
95  /*const edm::Event & event;
96  std::map<std::string, VariableHelper* >::iterator f= multipleInstance_.begin();
97  for (; f!=multipleInstance_.end();++f){
98  // std::cout<<" category is: "<<printValuesForEachEventCategory_+"|"+f->first<<std::endl;
99  // std::cout<<f->first<<"\n" <<f->second->printValues(event);
100 
101  edm::LogInfo(printValuesForEachEventCategory_+"|"+f->first)<<f->first<<"\n"
102  <<f->second->printValues(event);
103  }
104  */
105  }
void VariableHelperService::preModule ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &  mcc 
)
inline

Definition at line 80 of file VariableHelper.h.

References f, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), multipleInstance_, mathSSE::return(), and SetVariableHelperUniqueInstance_.

Referenced by VariableHelperService().

80  {
81  const edm::ModuleDescription & desc = *mcc.moduleDescription();
82  //does a set with the module name, except that it does not throw on non-configured modules
83  std::map<std::string, VariableHelper* >::iterator f=multipleInstance_.find(desc.moduleLabel());
84  if (f != multipleInstance_.end()) {
86  return ;
87  }
89  }
std::map< std::string, VariableHelper * > multipleInstance_
VariableHelper * SetVariableHelperUniqueInstance_
std::string const & moduleLabel() const
return((rh^lh)&mask)
double f[11][100]
VariableHelper& VariableHelperService::set ( std::string  user)
inline

Definition at line 107 of file VariableHelper.h.

References ecal_dqm_sourceclient-live_cfg::cerr, f, multipleInstance_, and SetVariableHelperUniqueInstance_.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

107  {
108  std::map<std::string, VariableHelper* >::iterator f=multipleInstance_.find(user);
109  if (f == multipleInstance_.end()){
110  std::cerr<<user<<" VariableHelper user not defined."<<std::endl;
111  throw;
112  }
113  else{
114  SetVariableHelperUniqueInstance_ = (f->second);
116  }
117  }
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 39 of file VariableHelper.h.

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

bool VariableHelperService::printValuesForEachEvent_
private

Definition at line 41 of file VariableHelper.h.

Referenced by postProcess(), and VariableHelperService().

std::string VariableHelperService::printValuesForEachEventCategory_
private

Definition at line 42 of file VariableHelper.h.

Referenced by VariableHelperService().

VariableHelper* VariableHelperService::SetVariableHelperUniqueInstance_
private

Definition at line 38 of file VariableHelper.h.

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