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 > & getProcessPSet ()
 
std::shared_ptr< ParameterSet const > getProcessPSet () const
 get the parameter set More...
 
auto & getServicesPSets ()
 
auto const & 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 (std::unique_ptr< ParameterSet > pset)
 
 ~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

◆ ProcessDesc() [1/3]

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

Definition at line 7 of file ProcessDesc.cc.

8  : pset_(pset), services_(pset_->popVParameterSet(std::string("services"))) {}

◆ ProcessDesc() [2/3]

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

Definition at line 10 of file ProcessDesc.cc.

11  : pset_(std::move(pset)), services_(pset_->popVParameterSet(std::string("services"))) {}

◆ ProcessDesc() [3/3]

edm::ProcessDesc::ProcessDesc ( std::string const &  config)
explicit

construct from the configuration language string

Definition at line 13 of file ProcessDesc.cc.

13  : pset_(new ParameterSet), services_{} {
14  throw Exception(errors::Configuration, "Old config strings no longer accepted");
15  }

◆ ~ProcessDesc()

edm::ProcessDesc::~ProcessDesc ( )

Definition at line 17 of file ProcessDesc.cc.

17 {}

Member Function Documentation

◆ addDefaultService()

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

add a service if it's not already there

Definition at line 30 of file ProcessDesc.cc.

30  {
31  for (auto it = services_.begin(), itEnd = services_.end(); it != itEnd; ++it) {
32  std::string name = it->getParameter<std::string>("@service_type");
33  if (name == service) {
34  // Use the configured service. Don't add a default.
35  // However, the service needs to be moved to the front because it is a standard service.
36  ParameterSet pset = *it;
37  services_.erase(it);
39  return;
40  }
41  }
43  }

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

Referenced by addServices().

◆ addForcedService()

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

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

Definition at line 45 of file ProcessDesc.cc.

45  {
46  for (auto it = services_.begin(), itEnd = services_.end(); it != itEnd; ++it) {
47  std::string name = it->getParameter<std::string>("@service_type");
48  if (name == service) {
49  // Remove the configured service before adding the default.
50  services_.erase(it);
51  break;
52  }
53  }
55  }

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

Referenced by addServices().

◆ addService() [1/2]

void edm::ProcessDesc::addService ( ParameterSet pset)

Definition at line 19 of file ProcessDesc.cc.

19  {
20  // The standard services should be initialized first.
21  services_.insert(services_.begin(), pset);
22  }

References muonDTDigis_cfi::pset, and services_.

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

◆ addService() [2/2]

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

add a service as an empty pset

Definition at line 24 of file ProcessDesc.cc.

24  {
25  ParameterSet newpset;
26  newpset.addParameter<std::string>("@service_type", service);
27  addService(newpset);
28  }

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

◆ addServices()

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

58  {
59  // Add the default services to services_.
60  for (auto const& service : defaultServices) {
62  }
63  // Add the forced services to services_.
64  for (auto const& service : forcedServices) {
66  }
67  }

References addDefaultService(), and addForcedService().

◆ dump()

std::string edm::ProcessDesc::dump ( void  ) const

Definition at line 69 of file ProcessDesc.cc.

69  {
70  std::string out = pset_->dump();
71  for (auto const& service : services_) {
72  out += service.dump();
73  }
74  return out;
75  }

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

◆ getProcessPSet() [1/2]

std::shared_ptr<ParameterSet>& edm::ProcessDesc::getProcessPSet ( )
inline

Definition at line 26 of file ProcessDesc.h.

26 { return get_underlying_safe(pset_); }

References edm::get_underlying_safe(), and pset_.

◆ getProcessPSet() [2/2]

std::shared_ptr<ParameterSet const> edm::ProcessDesc::getProcessPSet ( ) const
inline

get the parameter set

Definition at line 25 of file ProcessDesc.h.

25 { return get_underlying_safe(pset_); }

References edm::get_underlying_safe(), and pset_.

◆ getServicesPSets() [1/2]

auto& edm::ProcessDesc::getServicesPSets ( )
inline

Definition at line 30 of file ProcessDesc.h.

30 { return services_; }

References services_.

◆ getServicesPSets() [2/2]

auto const& edm::ProcessDesc::getServicesPSets ( ) const
inline

get the descriptions of the services

Definition at line 29 of file ProcessDesc.h.

29 { return services_; }

References services_.

Member Data Documentation

◆ pset_

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

Definition at line 46 of file ProcessDesc.h.

Referenced by dump(), and getProcessPSet().

◆ services_

std::vector<ParameterSet> edm::ProcessDesc::services_
private
service
Definition: service.py:1
edm::ProcessDesc::services_
std::vector< ParameterSet > services_
Definition: ProcessDesc.h:47
edm::get_underlying_safe
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:41
ParameterSet
Definition: Functions.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProcessDesc::addForcedService
void addForcedService(std::string const &service)
add a service and replace it if it's already there
Definition: ProcessDesc.cc:45
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:245
edm::ProcessDesc::addService
void addService(ParameterSet &pset)
Definition: ProcessDesc.cc:19
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::ProcessDesc::addDefaultService
void addDefaultService(std::string const &service)
add a service if it's not already there
Definition: ProcessDesc.cc:30
edm::ProcessDesc::pset_
edm::propagate_const< std::shared_ptr< ParameterSet > > pset_
Definition: ProcessDesc.h:46
edm::errors::Configuration
Definition: EDMException.h:36
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27