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
InputTagDistributorService Class Reference

#include <InputTagDistributor.h>

Public Member Functions

InputTagDistributorget ()
 
InputTagDistributorget ()
 
InputTagDistributorinit (std::string user, const edm::ParameterSet &iConfig)
 
InputTagDistributorinit (std::string user, const edm::ParameterSet &iConfig)
 
 InputTagDistributorService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &r)
 
 InputTagDistributorService (const edm::ParameterSet &iConfig, edm::ActivityRegistry &r)
 
void preModule (const edm::ModuleDescription &desc)
 
void preModule (const edm::ModuleDescription &desc)
 
edm::InputTag retrieve (std::string src, const edm::ParameterSet &pset)
 
edm::InputTag retrieve (std::string src, const edm::ParameterSet &pset)
 
 ~InputTagDistributorService ()
 
 ~InputTagDistributorService ()
 

Private Attributes

std::map< std::string,
InputTagDistributor * > 
multipleInstance_
 
InputTagDistributorSetInputTagDistributorUniqueInstance_
 

Detailed Description

Definition at line 38 of file InputTagDistributor.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file InputTagDistributor.h.

References preModule(), and edm::ActivityRegistry::watchPreModule().

44  {
46  };
void watchPreModule(PreModule::slot_type const &iSlot)
void preModule(const edm::ModuleDescription &desc)
InputTagDistributorService::~InputTagDistributorService ( )
inline

Definition at line 47 of file InputTagDistributor.h.

47 {};
InputTagDistributorService::InputTagDistributorService ( const edm::ParameterSet iConfig,
edm::ActivityRegistry r 
)
inline

Definition at line 44 of file InputTagDistributor.h.

References preModule(), and edm::ActivityRegistry::watchPreModule().

44  {
46  };
void watchPreModule(PreModule::slot_type const &iSlot)
void preModule(const edm::ModuleDescription &desc)
InputTagDistributorService::~InputTagDistributorService ( )
inline

Definition at line 47 of file InputTagDistributor.h.

47 {};

Member Function Documentation

InputTagDistributor& InputTagDistributorService::get ( void  )
inline
InputTagDistributor& InputTagDistributorService::get ( void  )
inline
InputTagDistributor& InputTagDistributorService::init ( std::string  user,
const edm::ParameterSet iConfig 
)
inline
InputTagDistributor& InputTagDistributorService::init ( std::string  user,
const edm::ParameterSet iConfig 
)
inline
void InputTagDistributorService::preModule ( const edm::ModuleDescription desc)
inline

Definition at line 57 of file InputTagDistributor.h.

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

Referenced by InputTagDistributorService().

57  {
58  //does a set with the module name, except that it does not throw on non-configured modules
59  std::map<std::string, InputTagDistributor*>::iterator f=multipleInstance_.find(desc.moduleLabel());
60  if (f != multipleInstance_.end()) SetInputTagDistributorUniqueInstance_ = f->second;
61  else{
62  //do not say anything but set it to zero to get a safe crash in get() if ever called
64  }
std::string const & moduleLabel() const
std::map< std::string, InputTagDistributor * > multipleInstance_
double f[11][100]
InputTagDistributor * SetInputTagDistributorUniqueInstance_
void InputTagDistributorService::preModule ( const edm::ModuleDescription desc)
inline

Definition at line 57 of file InputTagDistributor.h.

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

57  {
58  //does a set with the module name, except that it does not throw on non-configured modules
59  std::map<std::string, InputTagDistributor*>::iterator f=multipleInstance_.find(desc.moduleLabel());
60  if (f != multipleInstance_.end()) SetInputTagDistributorUniqueInstance_ = f->second;
61  else{
62  //do not say anything but set it to zero to get a safe crash in get() if ever called
64  }
std::string const & moduleLabel() const
std::map< std::string, InputTagDistributor * > multipleInstance_
double f[11][100]
InputTagDistributor * SetInputTagDistributorUniqueInstance_
edm::InputTag InputTagDistributorService::retrieve ( std::string  src,
const edm::ParameterSet pset 
)
inline

Definition at line 84 of file InputTagDistributor.h.

References edm::ParameterSet::dump(), edm::ParameterSet::getParameter(), InputTagDistributor::inputTag(), LogDebug, edm::ParameterSet::retrieve(), alcazmumu_cfi::src, reco::typeCode(), and edm::Entry::typeCode().

84  {
85  //if used without setting any InputTag mapping
86  if (multipleInstance_.size()==0)
87  return pset.getParameter<edm::InputTag>(src);
88 
89  // some mapping was setup
90  InputTagDistributor & which=get();
91  std::map<std::string, InputTagDistributor*>::iterator inverseMap=multipleInstance_.begin();
92  std::map<std::string, InputTagDistributor*>::iterator inverseMap_end=multipleInstance_.end();
93  for (;inverseMap!=inverseMap_end;++inverseMap) if (inverseMap->second==&which) break;
94  LogDebug("InputTagDistributor")<<"typeCode: "<<pset.retrieve(src).typeCode()
95  <<"\n"<<pset.dump()<<"\n"
96  <<"looking for: "<<src
97  <<" by user: "<< inverseMap->first
98  <<std::endl;
99  std::string typeCode;
100  typeCode+=pset.retrieve(src).typeCode();
101  std::string iTC;iTC+='S';
102  if (typeCode==iTC)
103  return which.inputTag(pset.getParameter<std::string>(src));
104  else
105  return pset.getParameter<edm::InputTag>(src);
106  }
#define LogDebug(id)
T getParameter(std::string const &) const
Entry const & retrieve(char const *) const
std::map< std::string, InputTagDistributor * > multipleInstance_
TypeCode typeCode(const Type &t)
Definition: returnType.cc:21
const edm::InputTag & inputTag(std::string s)
char typeCode() const
Definition: Entry.h:175
std::string dump() const
edm::InputTag InputTagDistributorService::retrieve ( std::string  src,
const edm::ParameterSet pset 
)
inline

Definition at line 84 of file InputTagDistributor.h.

References edm::ParameterSet::dump(), edm::ParameterSet::getParameter(), InputTagDistributor::inputTag(), LogDebug, edm::ParameterSet::retrieve(), alcazmumu_cfi::src, reco::typeCode(), and edm::Entry::typeCode().

84  {
85  //if used without setting any InputTag mapping
86  if (multipleInstance_.size()==0)
87  return pset.getParameter<edm::InputTag>(src);
88 
89  // some mapping was setup
90  InputTagDistributor & which=get();
91  std::map<std::string, InputTagDistributor*>::iterator inverseMap=multipleInstance_.begin();
92  std::map<std::string, InputTagDistributor*>::iterator inverseMap_end=multipleInstance_.end();
93  for (;inverseMap!=inverseMap_end;++inverseMap) if (inverseMap->second==&which) break;
94  LogDebug("InputTagDistributor")<<"typeCode: "<<pset.retrieve(src).typeCode()
95  <<"\n"<<pset.dump()<<"\n"
96  <<"looking for: "<<src
97  <<" by user: "<< inverseMap->first
98  <<std::endl;
99  std::string typeCode;
100  typeCode+=pset.retrieve(src).typeCode();
101  std::string iTC;iTC+='S';
102  if (typeCode==iTC)
103  return which.inputTag(pset.getParameter<std::string>(src));
104  else
105  return pset.getParameter<edm::InputTag>(src);
106  }
#define LogDebug(id)
T getParameter(std::string const &) const
Entry const & retrieve(char const *) const
std::map< std::string, InputTagDistributor * > multipleInstance_
TypeCode typeCode(const Type &t)
Definition: returnType.cc:21
const edm::InputTag & inputTag(std::string s)
char typeCode() const
Definition: Entry.h:175
std::string dump() const

Member Data Documentation

std::map< std::string, InputTagDistributor * > InputTagDistributorService::multipleInstance_
private

Definition at line 41 of file InputTagDistributor.h.

Referenced by init(), and preModule().

InputTagDistributor * InputTagDistributorService::SetInputTagDistributorUniqueInstance_
private

Definition at line 40 of file InputTagDistributor.h.

Referenced by init(), and preModule().