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< ParameterSet
const > 
getProcessPSet () const
 get the parameter set More...
 
std::shared_ptr< ParameterSet > & getProcessPSet ()
 
std::shared_ptr< std::vector
< ParameterSet > const > 
getServicesPSets () const
 get the descriptions of the services More...
 
std::shared_ptr< std::vector
< ParameterSet > > & 
getServicesPSets ()
 
 ProcessDesc (std::shared_ptr< ParameterSet > pset)
 
 ProcessDesc (std::string const &config)
 construct from the configuration language string More...
 
 ~ProcessDesc ()
 

Private Attributes

edm::propagate_const
< std::shared_ptr
< ParameterSet > > 
pset_
 
edm::propagate_const
< std::shared_ptr< std::vector
< ParameterSet > > > 
services_
 

Detailed Description

Definition at line 14 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  }
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
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  }
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
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 32 of file ProcessDesc.cc.

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

Referenced by addServices().

32  {
33  typedef std::vector<ParameterSet>::iterator Iter;
34  for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
35  std::string name = it->getParameter<std::string>("@service_type");
36  if (name == service) {
37  // Use the configured service. Don't add a default.
38  // However, the service needs to be moved to the front because it is a standard service.
39  ParameterSet pset = *it;
40  services_->erase(it);
41  addService(pset);
42  return;
43  }
44  }
45  addService(service);
46  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:21
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
void edm::ProcessDesc::addForcedService ( std::string const &  service)

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

Definition at line 48 of file ProcessDesc.cc.

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

Referenced by addServices().

48  {
49  typedef std::vector<ParameterSet>::iterator Iter;
50  for(Iter it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
51  std::string name = it->getParameter<std::string>("@service_type");
52  if (name == service) {
53  // Remove the configured service before adding the default.
54  services_->erase(it);
55  break;
56  }
57  }
58  addService(service);
59  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:21
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
void edm::ProcessDesc::addService ( ParameterSet pset)

Definition at line 21 of file ProcessDesc.cc.

References TrackValidation_cff::pset, and services_.

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

21  {
22  // The standard services should be initialized first.
23  services_->insert(services_->begin(), pset);
24  }
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
void edm::ProcessDesc::addService ( std::string const &  service)

add a service as an empty pset

Definition at line 26 of file ProcessDesc.cc.

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

26  {
27  ParameterSet newpset;
28  newpset.addParameter<std::string>("@service_type", service);
29  addService(newpset);
30  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:21
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 61 of file ProcessDesc.cc.

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

62  {
63  // Add the default services to services_.
64  for(std::vector<std::string>::const_iterator i = defaultServices.begin(), iEnd = defaultServices.end();
65  i != iEnd; ++i) {
67  }
68  // Add the forced services to services_.
69  for(std::vector<std::string>::const_iterator i = forcedServices.begin(), iEnd = forcedServices.end();
70  i != iEnd; ++i) {
72  }
73  }
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:32
void addForcedService(std::string const &service)
add a service and replace it if it&#39;s already there
Definition: ProcessDesc.cc:48
std::string edm::ProcessDesc::dump ( void  ) const

Definition at line 75 of file ProcessDesc.cc.

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

75  {
76  std::string out = pset_->dump();
77  for (std::vector<ParameterSet>::const_iterator it = services_->begin(), itEnd = services_->end(); it != itEnd; ++it) {
78  out += it->dump();
79  }
80  return out;
81  }
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
std::shared_ptr<ParameterSet const> edm::ProcessDesc::getProcessPSet ( ) const
inline

get the parameter set

Definition at line 25 of file ProcessDesc.h.

References edm::get_underlying_safe(), and pset_.

25 {return get_underlying_safe(pset_);}
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<ParameterSet>& edm::ProcessDesc::getProcessPSet ( )
inline

Definition at line 26 of file ProcessDesc.h.

References edm::get_underlying_safe(), and pset_.

26 {return get_underlying_safe(pset_);}
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<std::vector<ParameterSet> const> edm::ProcessDesc::getServicesPSets ( ) const
inline

get the descriptions of the services

Definition at line 29 of file ProcessDesc.h.

References edm::get_underlying_safe(), and services_.

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46
std::shared_ptr<std::vector<ParameterSet> >& edm::ProcessDesc::getServicesPSets ( )
inline

Definition at line 30 of file ProcessDesc.h.

References edm::get_underlying_safe(), and services_.

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< std::vector< ParameterSet > > > services_
Definition: ProcessDesc.h:46

Member Data Documentation

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

Definition at line 45 of file ProcessDesc.h.

Referenced by dump(), and getProcessPSet().

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