CMS 3D CMS Logo

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::VariableHelperService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry r 
)
inline

Definition at line 43 of file VariableHelper.h.

45  //r.watchPreModule(this, &VariableHelperService::preModule );
46  r.watchPreModuleEvent(this, &VariableHelperService::preModule);
47  //r.watchPostProcessEvent(this, &VariableHelperService::postProcess );
48  r.watchPostEvent(this, &VariableHelperService::postProcess);
49  printValuesForEachEvent_ = iConfig.exists("printValuesForEachEventCategory");
51  printValuesForEachEventCategory_ = iConfig.getParameter<std::string>("printValuesForEachEventCategory");
52  }

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), postProcess(), preModule(), printValuesForEachEvent_, printValuesForEachEventCategory_, alignCSCRings::r, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~VariableHelperService()

VariableHelperService::~VariableHelperService ( )
inline

Definition at line 53 of file VariableHelper.h.

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

References multipleInstance_.

Member Function Documentation

◆ get()

VariableHelper& VariableHelperService::get ( )
inline

◆ init()

VariableHelper& VariableHelperService::init ( std::string  user,
const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
inline

◆ postProcess()

void VariableHelperService::postProcess ( edm::StreamContext const &  sc)
inline

Definition at line 92 of file VariableHelper.h.

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  }

References printValuesForEachEvent_.

Referenced by VariableHelperService().

◆ preModule()

void VariableHelperService::preModule ( edm::StreamContext const &  ,
edm::ModuleCallingContext const &  mcc 
)
inline

Definition at line 81 of file VariableHelper.h.

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  }

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

Referenced by VariableHelperService().

◆ set()

VariableHelper& VariableHelperService::set ( std::string  user)
inline

Definition at line 108 of file VariableHelper.h.

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 {
116  }
117  }

References beam_dqm_sourceclient-live_cfg::cerr, f, multipleInstance_, SetVariableHelperUniqueInstance_, and EnviromentSettings::user.

Member Data Documentation

◆ multipleInstance_

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

Definition at line 37 of file VariableHelper.h.

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

◆ printValuesForEachEvent_

bool VariableHelperService::printValuesForEachEvent_
private

Definition at line 39 of file VariableHelper.h.

Referenced by postProcess(), and VariableHelperService().

◆ printValuesForEachEventCategory_

std::string VariableHelperService::printValuesForEachEventCategory_
private

Definition at line 40 of file VariableHelper.h.

Referenced by VariableHelperService().

◆ SetVariableHelperUniqueInstance_

VariableHelper* VariableHelperService::SetVariableHelperUniqueInstance_
private

Definition at line 36 of file VariableHelper.h.

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

edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
VariableHelper::print
void print() const
Definition: VariableHelper.cc:29
edm::ModuleDescription
Definition: ModuleDescription.h:21
VariableHelperService::preModule
void preModule(edm::StreamContext const &, edm::ModuleCallingContext const &mcc)
Definition: VariableHelper.h:81
VariableHelper
Definition: VariableHelper.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
VariableHelper::setHolder
void setHolder(std::string hn)
Definition: VariableHelper.cc:22
VariableHelperService::postProcess
void postProcess(edm::StreamContext const &sc)
Definition: VariableHelper.h:92
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
VariableHelperService::printValuesForEachEvent_
bool printValuesForEachEvent_
Definition: VariableHelper.h:39
EnviromentSettings.user
user
Definition: EnviromentSettings.py:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
VariableHelperService::SetVariableHelperUniqueInstance_
VariableHelper * SetVariableHelperUniqueInstance_
Definition: VariableHelper.h:36
VariableHelperService::multipleInstance_
std::map< std::string, VariableHelper * > multipleInstance_
Definition: VariableHelper.h:37
VariableHelperService::printValuesForEachEventCategory_
std::string printValuesForEachEventCategory_
Definition: VariableHelper.h:40