Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "Cintex/Cintex.h"
00016
00017
00018 #include "FWCore/Services/src/LoadAllDictionaries.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "FWCore/PluginManager/interface/PluginManager.h"
00021 #include "FWCore/PluginManager/interface/PluginCapabilities.h"
00022 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 edm::service::LoadAllDictionaries::LoadAllDictionaries(const edm::ParameterSet& iConfig)
00037 {
00038 bool doLoad(iConfig.getUntrackedParameter<bool>("doLoad"));
00039 if(doLoad) {
00040 ROOT::Cintex::Cintex::Enable();
00041
00042 edmplugin::PluginManager*db = edmplugin::PluginManager::get();
00043
00044 typedef edmplugin::PluginManager::CategoryToInfos CatToInfos;
00045
00046 CatToInfos::const_iterator itFound = db->categoryToInfos().find("Capability");
00047
00048 if(itFound == db->categoryToInfos().end()) {
00049 return;
00050 }
00051 std::string lastClass;
00052 const std::string cPrefix("LCGReflex/");
00053 const std::string mystring("edm::Wrapper");
00054
00055 for (edmplugin::PluginManager::Infos::const_iterator itInfo = itFound->second.begin(),
00056 itInfoEnd = itFound->second.end();
00057 itInfo != itInfoEnd; ++itInfo)
00058 {
00059 if (lastClass == itInfo->name_) {
00060 continue;
00061 }
00062
00063 lastClass = itInfo->name_;
00064 if (lastClass.find(mystring) != std::string::npos) {
00065 edmplugin::PluginCapabilities::get()->load(lastClass);
00066 }
00067
00068 }
00069 }
00070 }
00071
00072 void edm::service::LoadAllDictionaries::fillDescriptions(edm::ConfigurationDescriptions & descriptions) {
00073 edm::ParameterSetDescription desc;
00074 desc.addUntracked<bool>("doLoad", true)->setComment("Only if 'true' do we load all dictionaries");
00075 descriptions.add("LoadAllDictionaries", desc);
00076 descriptions.setComment("This service allows you to force all known Reflex dictionaries to be loaded at the beginning of the job");
00077 }
00078