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
edm::ProcessDesc Class Reference

#include <ProcessDesc.h>

Public Member Functions

void addDefaultService (std::string const &service)
 add a service if it's not already there More...
 
void addForcedService (std::string const &service)
 add a service and replace it if it's already there More...
 
void addService (ParameterSet &pset)
 
void addService (std::string const &service)
 add a service as an empty pset More...
 
void addServices (std::vector< std::string > const &defaultServices, std::vector< std::string > const &forcedServices=std::vector< std::string >())
 add some default services and forced services More...
 
std::string dump () const
 
std::shared_ptr< ParameterSetgetProcessPSet () const
 get the parameter set More...
 
std::shared_ptr< std::vector
< ParameterSet > > 
getServicesPSets () const
 get the descriptions of the services More...
 
 ProcessDesc (std::shared_ptr< ParameterSet > pset)
 
 ProcessDesc (std::string const &config)
 construct from the configuration language string More...
 
 ~ProcessDesc ()
 

Private Attributes

std::shared_ptr< ParameterSetpset_
 
std::shared_ptr< std::vector
< ParameterSet > > 
services_
 

Detailed Description

Definition at line 12 of file ProcessDesc.h.

Constructor & Destructor Documentation

edm::ProcessDesc::ProcessDesc ( std::shared_ptr< ParameterSet pset)
explicit

Definition at line 8 of file ProcessDesc.cc.

8  :
9  pset_(pset), services_(pset_->popVParameterSet(std::string("services")).release()) {
10  }
std::shared_ptr< ParameterSet > pset_
Definition: ProcessDesc.h:41
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
edm::ProcessDesc::ProcessDesc ( std::string const &  config)
explicit

construct from the configuration language string

Definition at line 12 of file ProcessDesc.cc.

References edm::errors::Configuration, and Exception.

12  :
13  pset_(new ParameterSet),
14  services_(new std::vector<ParameterSet>()) {
15  throw Exception(errors::Configuration,"Old config strings no longer accepted");
16  }
std::shared_ptr< ParameterSet > pset_
Definition: ProcessDesc.h:41
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
edm::ProcessDesc::~ProcessDesc ( )

Definition at line 18 of file ProcessDesc.cc.

18  {
19  }

Member Function Documentation

void edm::ProcessDesc::addDefaultService ( std::string const &  service)

add a service if it's not already there

Definition at line 42 of file ProcessDesc.cc.

References addService(), mergeVDriftHistosByStation::name, services_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addServices().

42  {
43  typedef std::vector<ParameterSet>::iterator Iter;
44  for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
45  std::string name = it->getParameter<std::string>("@service_type");
46  if (name == service) {
47  // Use the configured service. Don't add a default.
48  // However, the service needs to be moved to the front because it is a standard service.
49  ParameterSet pset = *it;
50  services_->erase(it);
51  addService(pset);
52  return;
53  }
54  }
55  addService(service);
56  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:31
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
void edm::ProcessDesc::addForcedService ( std::string const &  service)

add a service and replace it if it's already there

Definition at line 58 of file ProcessDesc.cc.

References addService(), mergeVDriftHistosByStation::name, services_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addServices().

58  {
59  typedef std::vector<ParameterSet>::iterator Iter;
60  for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
61  std::string name = it->getParameter<std::string>("@service_type");
62  if (name == service) {
63  // Remove the configured service before adding the default.
64  services_->erase(it);
65  break;
66  }
67  }
68  addService(service);
69  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:31
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
void edm::ProcessDesc::addService ( ParameterSet pset)

Definition at line 31 of file ProcessDesc.cc.

References services_.

Referenced by addDefaultService(), addForcedService(), and addService().

31  {
32  // The standard services should be initialized first.
33  services_->insert(services_->begin(), pset);
34  }
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
void edm::ProcessDesc::addService ( std::string const &  service)

add a service as an empty pset

Definition at line 36 of file ProcessDesc.cc.

References edm::ParameterSet::addParameter(), addService(), and AlCaHLTBitMon_QueryRunRegistry::string.

36  {
37  ParameterSet newpset;
38  newpset.addParameter<std::string>("@service_type", service);
39  addService(newpset);
40  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:31
void edm::ProcessDesc::addServices ( std::vector< std::string > const &  defaultServices,
std::vector< std::string > const &  forcedServices = std::vector<std::string>() 
)

add some default services and forced services

Definition at line 71 of file ProcessDesc.cc.

References addDefaultService(), addForcedService(), and i.

72  {
73  // Add the default services to services_.
74  for(std::vector<std::string>::const_iterator i = defaultServices.begin(), iEnd = defaultServices.end();
75  i != iEnd; ++i) {
77  }
78  // Add the forced services to services_.
79  for(std::vector<std::string>::const_iterator i = forcedServices.begin(), iEnd = forcedServices.end();
80  i != iEnd; ++i) {
82  }
83  }
int i
Definition: DBlmapReader.cc:9
void addDefaultService(std::string const &service)
add a service if it&#39;s not already there
Definition: ProcessDesc.cc:42
void addForcedService(std::string const &service)
add a service and replace it if it&#39;s already there
Definition: ProcessDesc.cc:58
std::string edm::ProcessDesc::dump ( void  ) const

Definition at line 85 of file ProcessDesc.cc.

References dbtoconf::out, pset_, services_, and AlCaHLTBitMon_QueryRunRegistry::string.

85  {
86  std::string out = pset_->dump();
87  for (std::vector<ParameterSet>::const_iterator it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
88  out += it->dump();
89  }
90  return out;
91  }
std::shared_ptr< ParameterSet > pset_
Definition: ProcessDesc.h:41
tuple out
Definition: dbtoconf.py:99
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42
std::shared_ptr< ParameterSet > edm::ProcessDesc::getProcessPSet ( ) const

get the parameter set

Definition at line 22 of file ProcessDesc.cc.

References pset_.

22  {
23  return pset_;
24  }
std::shared_ptr< ParameterSet > pset_
Definition: ProcessDesc.h:41
std::shared_ptr< std::vector< ParameterSet > > edm::ProcessDesc::getServicesPSets ( ) const

get the descriptions of the services

Definition at line 27 of file ProcessDesc.cc.

References services_.

27  {
28  return services_;
29  }
std::shared_ptr< std::vector< ParameterSet > > services_
Definition: ProcessDesc.h:42

Member Data Documentation

std::shared_ptr<ParameterSet> edm::ProcessDesc::pset_
private

Definition at line 41 of file ProcessDesc.h.

Referenced by dump(), and getProcessPSet().

std::shared_ptr<std::vector<ParameterSet> > edm::ProcessDesc::services_
private