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
LoadAllDictionaries
(
const
LoadAllDictionaries
&) =
delete
;
// stop default
36
const
LoadAllDictionaries
&
operator=
(
const
LoadAllDictionaries
&) =
delete
;
// stop default
37
38
//virtual ~LoadAllDictionaries();
39
40
// ---------- const member functions ---------------------
41
42
// ---------- static member functions --------------------
43
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
44
45
// ---------- member functions ---------------------------
46
47
private
:
48
// ---------- member data --------------------------------
49
};
50
}
// namespace service
51
}
// namespace edm
52
53
//
54
// constants, enums and typedefs
55
//
56
57
//
58
// static data member definitions
59
//
60
61
//
62
// constructors and destructor
63
//
64
edm::service::LoadAllDictionaries::LoadAllDictionaries
(
const
edm::ParameterSet
& iConfig) {
65
bool
doLoad(iConfig.
getUntrackedParameter
<
bool
>(
"doLoad"
));
66
if
(doLoad) {
67
edmplugin::PluginManager
*
db
=
edmplugin::PluginManager::get
();
68
69
typedef
edmplugin::PluginManager::CategoryToInfos
CatToInfos;
70
71
CatToInfos::const_iterator itFound =
db
->categoryToInfos().find(
"Capability"
);
72
73
if
(itFound ==
db
->categoryToInfos().end()) {
74
return
;
75
}
76
std::string
lastClass;
77
const
std::string
mystring(
"edm::Wrapper"
);
78
79
for
(edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
80
itInfoEnd = itFound->second.end();
81
itInfo != itInfoEnd;
82
++itInfo) {
83
if
(lastClass == itInfo->name_) {
84
continue
;
85
}
86
87
lastClass = itInfo->name_;
88
if
(lastClass.find(mystring) != std::string::npos) {
89
edmplugin::PluginCapabilities::get
()->
load
(lastClass);
90
}
91
//NOTE: since we have the library already, we could be more efficient if we just load it ourselves
92
}
93
}
94
}
95
96
void
edm::service::LoadAllDictionaries::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
97
edm::ParameterSetDescription
desc
;
98
desc
.addUntracked<
bool
>(
"doLoad"
,
true
)->setComment(
"Only if 'true' do we load all dictionaries"
);
99
descriptions.
add
(
"LoadAllDictionaries"
,
desc
);
100
descriptions.
setComment
(
101
"This service allows you to force all known dictionaries to be loaded at the beginning of the job"
);
102
}
103
104
using
edm::service::LoadAllDictionaries
;
105
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:96
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
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition:
ConfigurationDescriptions.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
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:64
ParameterSet.h
edmplugin::PluginCapabilities::load
void load(const std::string &iName)
Definition:
PluginCapabilities.cc:83
Generated for CMSSW Reference Manual by
1.8.16