CMS 3D CMS Logo

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 ()
 
auto const & getServicesPSets () const
 get the descriptions of the services More...
 
auto & 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_
 
std::vector< ParameterSetservices_
 

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 7 of file ProcessDesc.cc.

7  :
8  pset_(pset), services_(pset_->popVParameterSet(std::string("services"))) {
9  }
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
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 11 of file ProcessDesc.cc.

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

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

Definition at line 17 of file ProcessDesc.cc.

17  {
18  }

Member Function Documentation

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

add a service if it's not already there

Definition at line 31 of file ProcessDesc.cc.

References addService(), dataset::name, muonDTDigis_cfi::pset, services_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addServices(), and getServicesPSets().

31  {
32  for(auto it = services_.begin(), itEnd = services_.end(); it != itEnd; ++it) {
33  std::string name = it->getParameter<std::string>("@service_type");
34  if (name == service) {
35  // Use the configured service. Don't add a default.
36  // However, the service needs to be moved to the front because it is a standard service.
37  ParameterSet pset = *it;
38  services_.erase(it);
39  addService(pset);
40  return;
41  }
42  }
44  }
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:20
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 46 of file ProcessDesc.cc.

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

Referenced by addServices(), and getServicesPSets().

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

Definition at line 20 of file ProcessDesc.cc.

References muonDTDigis_cfi::pset, and services_.

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

20  {
21  // The standard services should be initialized first.
22  services_.insert(services_.begin(), pset);
23  }
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 25 of file ProcessDesc.cc.

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

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

References addDefaultService(), and addForcedService().

Referenced by getServicesPSets().

59  {
60  // Add the default services to services_.
61  for(auto const& service: defaultServices) {
63  }
64  // Add the forced services to services_.
65  for(auto const& service : forcedServices) {
67  }
68  }
void addDefaultService(std::string const &service)
add a service if it&#39;s not already there
Definition: ProcessDesc.cc:31
void addForcedService(std::string const &service)
add a service and replace it if it&#39;s already there
Definition: ProcessDesc.cc:46
std::string edm::ProcessDesc::dump ( void  ) const

Definition at line 70 of file ProcessDesc.cc.

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

Referenced by getServicesPSets().

70  {
71  std::string out = pset_->dump();
72  for (auto const& service : services_) {
73  out += service.dump();
74  }
75  return out;
76  }
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:45
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)
auto const& edm::ProcessDesc::getServicesPSets ( ) const
inline

get the descriptions of the services

Definition at line 29 of file ProcessDesc.h.

References services_.

29 {return services_;}
std::vector< ParameterSet > services_
Definition: ProcessDesc.h:46
auto& edm::ProcessDesc::getServicesPSets ( )
inline

Definition at line 30 of file ProcessDesc.h.

References addDefaultService(), addForcedService(), addService(), addServices(), dump(), services_, and AlCaHLTBitMon_QueryRunRegistry::string.

30 {return services_;}
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().

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