FWCore
Services
plugins
LoadAllDictionaries.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: Services
4
// Class : LoadAllDictionaries
5
//
14
//
15
// Original Author: Chris Jones
16
// Created: Thu Sep 15 09:47:48 EDT 2005
17
//
18
19
// system include files
20
21
// user include files
22
#include "
FWCore/ServiceRegistry/interface/ServiceMaker.h
"
23
24
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
25
#include "
FWCore/PluginManager/interface/PluginManager.h
"
26
#include "
FWCore/PluginManager/interface/PluginCapabilities.h
"
27
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
29
30
namespace
edm
{
31
namespace
service
{
32
class
LoadAllDictionaries
{
33
public
:
34
LoadAllDictionaries
(
const
edm::ParameterSet
&);
35
//virtual ~LoadAllDictionaries();
36
37
// ---------- const member functions ---------------------
38
39
// ---------- static member functions --------------------
40
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
41
42
// ---------- member functions ---------------------------
43
44
private
:
45
LoadAllDictionaries
(
const
LoadAllDictionaries
&) =
delete
;
// stop default
46
47
const
LoadAllDictionaries
&
operator=
(
const
LoadAllDictionaries
&) =
delete
;
// stop default
48
49
// ---------- member data --------------------------------
50
};
51
}
// namespace service
52
}
// namespace edm
53
54
//
55
// constants, enums and typedefs
56
//
57
58
//
59
// static data member definitions
60
//
61
62
//
63
// constructors and destructor
64
//
65
edm::service::LoadAllDictionaries::LoadAllDictionaries
(
const
edm::ParameterSet
& iConfig) {
66
bool
doLoad(iConfig.
getUntrackedParameter
<
bool
>(
"doLoad"
));
67
if
(doLoad) {
68
edmplugin::PluginManager
*
db
=
edmplugin::PluginManager::get
();
69
70
typedef
edmplugin::PluginManager::CategoryToInfos
CatToInfos;
71
72
CatToInfos::const_iterator itFound =
db
->categoryToInfos().find(
"Capability"
);
73
74
if
(itFound ==
db
->categoryToInfos().end()) {
75
return
;
76
}
77
std::string
lastClass;
78
const
std::string
mystring(
"edm::Wrapper"
);
79
80
for
(edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
81
itInfoEnd = itFound->second.end();
82
itInfo != itInfoEnd;
83
++itInfo) {
84
if
(lastClass == itInfo->name_) {
85
continue
;
86
}
87
88
lastClass = itInfo->name_;
89
if
(lastClass.find(mystring) != std::string::npos) {
90
edmplugin::PluginCapabilities::get
()->
load
(lastClass);
91
}
92
//NOTE: since we have the library already, we could be more efficient if we just load it ourselves
93
}
94
}
95
}
96
97
void
edm::service::LoadAllDictionaries::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
98
edm::ParameterSetDescription
desc
;
99
desc
.addUntracked<
bool
>(
"doLoad"
,
true
)->setComment(
"Only if 'true' do we load all dictionaries"
);
100
descriptions.
add
(
"LoadAllDictionaries"
,
desc
);
101
descriptions.
setComment
(
102
"This service allows you to force all known dictionaries to be loaded at the beginning of the job"
);
103
}
104
105
using
edm::service::LoadAllDictionaries
;
106
DEFINE_FWK_SERVICE_MAKER
(
LoadAllDictionaries
,
edm::serviceregistry::ParameterSetMaker<LoadAllDictionaries>
);
ConfigurationDescriptions.h
service
Definition:
service.py:1
edm::serviceregistry::ParameterSetMaker
Definition:
ServiceMaker.h:54
edmplugin::PluginCapabilities::get
static PluginCapabilities * get()
Definition:
PluginCapabilities.cc:156
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
PluginCapabilities.h
edm::service::LoadAllDictionaries::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
LoadAllDictionaries.cc:97
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edmplugin::PluginManager::get
static PluginManager * get()
Definition:
PluginManager.cc:306
edmplugin::PluginManager
Definition:
PluginManager.h:45
dqmiodatasetharvest.db
db
Definition:
dqmiodatasetharvest.py:119
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edmplugin::PluginManager::CategoryToInfos
std::map< std::string, Infos > CategoryToInfos
Definition:
PluginManager.h:51
DEFINE_FWK_SERVICE_MAKER
#define DEFINE_FWK_SERVICE_MAKER(concrete, maker)
Definition:
ServiceMaker.h:100
ParameterSetDescription.h
edm::service::LoadAllDictionaries
Definition:
LoadAllDictionaries.cc:32
ServiceMaker.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition:
ConfigurationDescriptions.cc:48
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
PluginManager.h
edm::service::LoadAllDictionaries::operator=
const LoadAllDictionaries & operator=(const LoadAllDictionaries &)=delete
edm::service::LoadAllDictionaries::LoadAllDictionaries
LoadAllDictionaries(const edm::ParameterSet &)
Definition:
LoadAllDictionaries.cc:65
ParameterSet.h
edmplugin::PluginCapabilities::load
void load(const std::string &iName)
Definition:
PluginCapabilities.cc:83
Generated for CMSSW Reference Manual by
1.8.16