CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 34 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::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  }
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)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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();
55  ++it) {
56  delete it->second;
57  }
58  }
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 92 of file VariableHelper.h.

References printValuesForEachEvent_.

Referenced by VariableHelperService().

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

Definition at line 81 of file VariableHelper.h.

References submitPVResolutionJobs::desc, validate-o2o-wbm::f, edm::ModuleCallingContext::moduleDescription(), edm::ModuleDescription::moduleLabel(), multipleInstance_, and SetVariableHelperUniqueInstance_.

Referenced by VariableHelperService().

81  {
82  const edm::ModuleDescription& desc = *mcc.moduleDescription();
83  //does a set with the module name, except that it does not throw on non-configured modules
84  std::map<std::string, VariableHelper*>::iterator f = multipleInstance_.find(desc.moduleLabel());
85  if (f != multipleInstance_.end()) {
87  return;
88  }
90  }
VariableHelper * SetVariableHelperUniqueInstance_
std::string const & moduleLabel() const
std::map< std::string, VariableHelper * > multipleInstance_
VariableHelper& VariableHelperService::set ( std::string  user)
inline

Definition at line 108 of file VariableHelper.h.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, validate-o2o-wbm::f, multipleInstance_, and SetVariableHelperUniqueInstance_.

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

Member Data Documentation

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

Definition at line 37 of file VariableHelper.h.

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

bool VariableHelperService::printValuesForEachEvent_
private

Definition at line 39 of file VariableHelper.h.

Referenced by postProcess(), and VariableHelperService().

std::string VariableHelperService::printValuesForEachEventCategory_
private

Definition at line 40 of file VariableHelper.h.

Referenced by VariableHelperService().

VariableHelper* VariableHelperService::SetVariableHelperUniqueInstance_
private

Definition at line 36 of file VariableHelper.h.

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