CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Classes | Typedefs | Functions
edm::eventsetup Namespace Reference

Namespaces

 depends_on
 
 heterocontainer
 
 looper
 
 produce
 

Classes

class  Callback
 
struct  CallbackBase
 
class  CallbackProxy
 
struct  CallbackSimpleDecorator
 
struct  ComponentDescription
 
class  ComponentFactory
 
class  ComponentMaker
 
class  ComponentMakerBase
 
class  ComponentMakerBaseHelper
 
struct  data_default_record_trait
 
class  DataKey
 
class  DataProxy
 
class  DataProxyProvider
 
class  DataProxyTemplate
 
struct  DecoratorFromArg
 
struct  DecoratorFromArg< T, TRecord, depends_on::OneHolder< T, TDependsOnRecord > >
 
struct  DecoratorFromArg< T, TRecord, depends_on::TwoHolder< T1, T2 > >
 
class  DependentEventSetupRecordProvider
 
class  DependentEventSetupRecordProviderTemplate
 
class  DependentRecordImplementation
 
class  DependentRecordIntervalFinder
 
struct  DependentRecordTag
 
struct  DependsOnCaller
 
struct  DependsOnDoNothingCaller
 
class  ESPreFunctorDecorator
 
class  EventSetupProvider
 
class  EventSetupRecord
 
class  EventSetupRecordImplementation
 
class  EventSetupRecordKey
 
class  EventSetupRecordProvider
 
class  EventSetupRecordProviderFactory
 
class  EventSetupRecordProviderFactoryManager
 
class  EventSetupRecordProviderFactoryTemplate
 
class  EventSetupRecordProviderTemplate
 
class  EventSetupsController
 
struct  FactoryInfo
 
class  IntersectingIOVRecordIntervalFinder
 
struct  LooperMaker
 
struct  LooperMakerTraits
 
class  MakeDataException
 
struct  ModuleMaker
 
struct  ModuleMakerTraits
 
struct  MUST_GET_RECORD_FROM_EVENTSETUP_TO_GET_DATA
 
class  NameTag
 
class  NoDataException
 
class  NoDataExceptionBase
 
class  NoProxyException
 
class  NoRecordException
 
class  ProxyArgumentFactoryTemplate
 
class  ProxyFactoryBase
 
class  ProxyFactoryTemplate
 
class  SimpleStringTag
 
struct  SourceMaker
 
struct  SourceMakerTraits
 

Typedefs

typedef NameTag IdTags
 
typedef Providers::iterator Itr
 
typedef ComponentFactory
< LooperMakerTraits
LooperFactory
 
typedef
edmplugin::PluginFactory
< edm::eventsetup::ComponentMakerBase
< LooperMakerTraits > *()> 
LooperPluginFactory
 
typedef ComponentFactory
< ModuleMakerTraits
ModuleFactory
 
typedef
edmplugin::PluginFactory
< edm::eventsetup::ComponentMakerBase
< ModuleMakerTraits > *()> 
ModulePluginFactory
 
typedef std::map
< EventSetupRecordKey,
boost::shared_ptr
< EventSetupRecordProvider > > 
Providers
 
typedef std::map< DataKey,
const DataProxy * > 
Proxies
 
typedef std::map
< EventSetupRecordKey,
EventSetupRecordProvider::DataToPreferredProviderMap
RecordToPreferred
 
typedef ComponentFactory
< SourceMakerTraits
SourceFactory
 
typedef
edmplugin::PluginFactory
< edm::eventsetup::ComponentMakerBase
< edm::eventsetup::SourceMakerTraits > *()> 
SourcePluginFactory
 
typedef heterocontainer::HCTypeTag TypeTag
 

Functions

template<class T >
void addProviderTo (EventSetupProvider &iProvider, boost::shared_ptr< T > iComponent, const DataProxyProvider *)
 
template<class T >
void addProviderTo (EventSetupProvider &, boost::shared_ptr< T >, const void *)
 
template<typename FromT , typename ToT >
void copyFromTo (FromT &iFrom, ToT &iTo)
 
template<typename T , typename TRecord , typename TDecorator >
const TDecorator & createDecoratorFrom (T *, const TRecord *, const TDecorator &iDec)
 
template<typename T , typename TRecord , typename TDependsOnRecord >
ESPreFunctorDecorator< TRecord,
DependsOnCaller< T, TRecord,
TDependsOnRecord,
DependsOnDoNothingCaller
< TRecord > > > 
createDecoratorFrom (T *iT, const TRecord *iRec, const depends_on::OneHolder< T, TDependsOnRecord > &iHolder)
 
template<typename T , typename TRecord , typename T1 , typename T2 >
ESPreFunctorDecorator< TRecord,
typename
depends_on::HolderToCaller
< TRecord,
depends_on::TwoHolder< T1, T2 >
>::Caller_t > 
createDecoratorFrom (T *iT, const TRecord *iRec, const depends_on::TwoHolder< T1, T2 > &iHolder)
 
template<class T , class TRecord , class TDependsOnRecord , class TCallerChain >
DependsOnCaller< T, TRecord,
TDependsOnRecord, TCallerChain > 
createDependsOnCaller (T *iCallee, const TRecord *, void(T::*iMethod)(const TDependsOnRecord &), const TCallerChain &iChain)
 
template<typename T , typename TDependsOnRecord >
depends_on::OneHolder< T,
TDependsOnRecord > 
dependsOn (void(T::*iT)(const TDependsOnRecord &))
 
template<typename T , typename T1 , typename T2 >
depends_on::TwoHolder
< depends_on::OneHolder< T, T1 >
, T2 > 
dependsOn (void(T::*iT1)(const T1 &), T2 iT2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
depends_on::TwoHolder
< depends_on::TwoHolder
< depends_on::OneHolder< T, T1 >
, T2 >, T3 > 
dependsOn (void(T::*iT1)(const T1 &), T2 iT2, T3 iT3)
 
static RecordToPreferred determinePreferred (const EventSetupProvider::PreferredProviderInfo *iInfo, const Providers &iProviders)
 
static const ComponentDescriptiondummyDescription ()
 
template<class T >
void eventSetupGetImplementation (EventSetup const &, T const *&)
 
template<>
void EventSetupRecord::get< fwliteeswriter::Handle > (const std::string &iName, fwliteeswriter::Handle &iHolder) const
 
template<>
void EventSetupRecord::getImplementation< fwliteeswriter::DummyType > (fwliteeswriter::DummyType const *&iData, const char *iName, const ComponentDescription *&iDesc, bool iTransientAccessOnly) const
 
void fillEventSetupProvider (EventSetupProvider &cp, ParameterSet &params, CommonParams const &common)
 
static void findDependents (const EventSetupRecordKey &iKey, Itr itBegin, Itr itEnd, std::vector< boost::shared_ptr< EventSetupRecordProvider > > &oDependents)
 
template<class ProxyT >
void insertProxy (DataProxyProvider::KeyedProxies &iList, boost::shared_ptr< ProxyT > iProxy, const char *iName="")
 
std::auto_ptr< EventSetupProvidermakeEventSetupProvider (ParameterSet const &params)
 
void no_dependent_record_exception_message_builder (cms::Exception &, const EventSetupRecordKey &, const char *)
 
void no_record_exception_message_builder (cms::Exception &, const char *)
 
static void preferEverything (const ComponentDescription &iComponent, const Providers &iProviders, RecordToPreferred &iReturnValue)
 find everything made by a DataProxyProvider and add it to the 'preferred' list More...
 
void swap (DataKey &a, DataKey &b)
 
void validateEventSetupParameters (ParameterSet &pset)
 

Typedef Documentation

Definition at line 52 of file DataKeyTags.h.

typedef Providers::iterator edm::eventsetup::Itr

Definition at line 350 of file EventSetupProvider.cc.

Definition at line 93 of file LooperFactory.h.

Definition at line 95 of file LooperFactory.h.

Definition at line 43 of file ModuleFactory.h.

Definition at line 44 of file ModuleFactory.h.

typedef std::map< EventSetupRecordKey, boost::shared_ptr< EventSetupRecordProvider > > edm::eventsetup::Providers

Definition at line 100 of file EventSetupProvider.cc.

typedef std::map< DataKey , const DataProxy* > edm::eventsetup::Proxies

Definition at line 29 of file EventSetupRecord.cc.

Definition at line 101 of file EventSetupProvider.cc.

Definition at line 68 of file SourceFactory.h.

Definition at line 70 of file SourceFactory.h.

Definition at line 31 of file DataKeyTags.h.

Function Documentation

template<class T >
void edm::eventsetup::addProviderTo ( EventSetupProvider iProvider,
boost::shared_ptr< T >  iComponent,
const DataProxyProvider  
)

Definition at line 39 of file SourceFactory.h.

References edm::eventsetup::EventSetupProvider::add(), idDealer::description, and edm::eventsetup::ComponentDescription::isSource_.

Referenced by edm::eventsetup::SourceMakerTraits::addTo().

40  {
41  boost::shared_ptr<DataProxyProvider> pProvider(iComponent);
42  ComponentDescription description = pProvider->description();
43  description.isSource_=true;
44  pProvider->setDescription(description);
45  iProvider.add(pProvider);
46  }
tuple description
Definition: idDealer.py:66
template<class T >
void edm::eventsetup::addProviderTo ( EventSetupProvider ,
boost::shared_ptr< T >  ,
const void *   
)

Definition at line 48 of file SourceFactory.h.

49  {
50  //do nothing
51  }
template<typename FromT , typename ToT >
void edm::eventsetup::copyFromTo ( FromT &  iFrom,
ToT &  iTo 
)

Definition at line 33 of file produce_helpers.h.

Referenced by edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::setData().

34  {
35  iTo = iFrom;
36  }
template<typename T , typename TRecord , typename TDecorator >
const TDecorator& edm::eventsetup::createDecoratorFrom ( T *  ,
const TRecord *  ,
const TDecorator &  iDec 
)
inline

Definition at line 93 of file ESProducer.h.

Referenced by edm::ESProducer::setWhatProduced().

93  {
94  return iDec;
95  }
template<typename T , typename TRecord , typename TDependsOnRecord >
ESPreFunctorDecorator<TRecord,DependsOnCaller<T,TRecord, TDependsOnRecord, DependsOnDoNothingCaller<TRecord> > > edm::eventsetup::createDecoratorFrom ( T *  iT,
const TRecord *  iRec,
const depends_on::OneHolder< T, TDependsOnRecord > &  iHolder 
)
inline

Definition at line 168 of file eventsetup_dependsOn.h.

References createDependsOnCaller(), edm::eventsetup::depends_on::OneHolder< T, TDependsOnRecord >::holdee_, and cond::rpcobtemp::temp.

168  {
169  DependsOnDoNothingCaller<TRecord> tCaller;
171  temp(createDependsOnCaller(iT, iRec, iHolder.holdee_, tCaller));
172  return temp;
173  }
DependsOnCaller< T, TRecord, TDependsOnRecord, TCallerChain > createDependsOnCaller(T *iCallee, const TRecord *, void(T::*iMethod)(const TDependsOnRecord &), const TCallerChain &iChain)
template<typename T , typename TRecord , typename T1 , typename T2 >
ESPreFunctorDecorator<TRecord,typename depends_on::HolderToCaller<TRecord, depends_on::TwoHolder<T1, T2> >::Caller_t > edm::eventsetup::createDecoratorFrom ( T *  iT,
const TRecord *  iRec,
const depends_on::TwoHolder< T1, T2 > &  iHolder 
)
inline

Definition at line 182 of file eventsetup_dependsOn.h.

References createDependsOnCaller(), edm::eventsetup::depends_on::TwoHolder< T, U >::h1_, edm::eventsetup::depends_on::TwoHolder< T, U >::h2_, and edm::eventsetup::depends_on::makeCaller().

182  {
184  (createDependsOnCaller(iT, iRec, iHolder.h2_, makeCaller(iT, iRec, iHolder.h1_)));
185  }
DependsOnCaller< T, TRecord, TDependsOnRecord, DependsOnDoNothingCaller< TRecord > > makeCaller(T *iT, const TRecord *iRec, const OneHolder< T, TDependsOnRecord > &iHolder)
DependsOnCaller< T, TRecord, TDependsOnRecord, TCallerChain > createDependsOnCaller(T *iCallee, const TRecord *, void(T::*iMethod)(const TDependsOnRecord &), const TCallerChain &iChain)
template<class T , class TRecord , class TDependsOnRecord , class TCallerChain >
DependsOnCaller<T,TRecord, TDependsOnRecord, TCallerChain> edm::eventsetup::createDependsOnCaller ( T *  iCallee,
const TRecord *  ,
void(T::*)(const TDependsOnRecord &)  iMethod,
const TCallerChain &  iChain 
)

Definition at line 90 of file eventsetup_dependsOn.h.

Referenced by createDecoratorFrom(), and edm::eventsetup::depends_on::makeCaller().

91  {
92  return DependsOnCaller<T,TRecord, TDependsOnRecord, TCallerChain>(iCallee, iMethod, iChain);
93  }
template<typename T , typename TDependsOnRecord >
depends_on::OneHolder<T,TDependsOnRecord> edm::eventsetup::dependsOn ( void(T::*)(const TDependsOnRecord &)  iT)
template<typename T , typename T1 , typename T2 >
depends_on::TwoHolder<depends_on::OneHolder<T,T1>, T2> edm::eventsetup::dependsOn ( void(T::*)(const T1 &)  iT1,
T2  iT2 
)

Definition at line 195 of file eventsetup_dependsOn.h.

195 { return depends_on::OneHolder<T, T1>(iT1) & iT2; }
template<typename T , typename T1 , typename T2 , typename T3 >
depends_on::TwoHolder< depends_on::TwoHolder<depends_on::OneHolder<T,T1>, T2>, T3> edm::eventsetup::dependsOn ( void(T::*)(const T1 &)  iT1,
T2  iT2,
T3  iT3 
)

Definition at line 199 of file eventsetup_dependsOn.h.

199 { return depends_on::OneHolder<T,T1>(iT1) & iT2 & iT3; }
static RecordToPreferred edm::eventsetup::determinePreferred ( const EventSetupProvider::PreferredProviderInfo *  iInfo,
const Providers iProviders 
)
static

Definition at line 160 of file EventSetupProvider.cc.

References edm::hlt::Exception, edm::eventsetup::heterocontainer::HCTypeTag::findType(), first, preferEverything(), ecalTPGAnalyzer_cfg::recordName, and edm::eventsetup::EventSetupRecordKey::type().

Referenced by edm::eventsetup::EventSetupProvider::finishConfiguration().

162 {
163  using namespace edm::eventsetup;
164  RecordToPreferred returnValue;
165  if(0 != iInfo){
166  for(EventSetupProvider::PreferredProviderInfo::const_iterator itInfo = iInfo->begin(),
167  itInfoEnd = iInfo->end();
168  itInfo != itInfoEnd;
169  ++itInfo) {
170  if(itInfo->second.empty()) {
171  //want everything
172  preferEverything(itInfo->first, iProviders, returnValue);
173  } else {
174  for(EventSetupProvider::RecordToDataMap::const_iterator itRecData = itInfo->second.begin(),
175  itRecDataEnd = itInfo->second.end();
176  itRecData != itRecDataEnd;
177  ++itRecData) {
178  std::string recordName= itRecData->first;
180  if(recordKey.type() == eventsetup::EventSetupRecordKey::TypeTag()) {
181  throw cms::Exception("ESPreferUnknownRecord") <<"Unknown record \""<<recordName
182  <<"\" used in es_prefer statement for type="
183  <<itInfo->first.type_<<" label=\""<<itInfo->first.label_
184  <<"\"\n Please check spelling.";
185  //record not found
186  }
187  //See if the ProxyProvider provides something for this Record
188  Providers::const_iterator itRecordProvider = iProviders.find(recordKey);
189  assert(itRecordProvider != iProviders.end());
190 
191  std::set<ComponentDescription> components = itRecordProvider->second->proxyProviderDescriptions();
192  std::set<ComponentDescription>::iterator itProxyProv = components.find(itInfo->first);
193  if(itProxyProv == components.end()){
194  throw cms::Exception("ESPreferWrongRecord")<<"The type="<<itInfo->first.type_<<" label=\""<<
195  itInfo->first.label_<<"\" does not provide data for the Record "<<recordName;
196  }
197  //Does it data type exist?
198  eventsetup::TypeTag datumType = eventsetup::TypeTag::findType(itRecData->second.first);
199  if(datumType == eventsetup::TypeTag()) {
200  //not found
201  throw cms::Exception("ESPreferWrongDataType")<<"The es_prefer statement for type="<<itInfo->first.type_<<" label=\""<<
202  itInfo->first.label_<<"\" has the unknown data type \""<<itRecData->second.first<<"\""
203  <<"\n Please check spelling";
204  }
205  eventsetup::DataKey datumKey(datumType, itRecData->second.second.c_str());
206 
207  //Does the proxyprovider make this?
208  boost::shared_ptr<DataProxyProvider> proxyProv =
209  itRecordProvider->second->proxyProvider(*itProxyProv);
210  const DataProxyProvider::KeyedProxies& keyedProxies = proxyProv->keyedProxies(recordKey);
211  if(std::find_if(keyedProxies.begin(), keyedProxies.end(),
212  boost::bind(std::equal_to<DataKey>(), datumKey, boost::bind(&DataProxyProvider::KeyedProxies::value_type::first,_1))) ==
213  keyedProxies.end()){
214  throw cms::Exception("ESPreferWrongData")<<"The es_prefer statement for type="<<itInfo->first.type_<<" label=\""<<
215  itInfo->first.label_<<"\" specifies the data item \n"
216  <<" type=\""<<itRecData->second.first<<"\" label=\""<<itRecData->second.second<<"\""
217  <<" which is not provided. Please check spelling.";
218  }
219 
221  =returnValue[recordKey];
222  //has another provider already been specified?
223  if(dataToProviderMap.end() != dataToProviderMap.find(datumKey)) {
224  EventSetupRecordProvider::DataToPreferredProviderMap::iterator itFind =
225  dataToProviderMap.find(datumKey);
226  throw cms::Exception("ESPreferConflict") <<"Two providers have been set to be preferred for\n"
227  <<datumKey.type().name()<<" \""<<datumKey.name().value()<<"\""
228  <<"\n the providers are "
229  <<"\n 1) type="<<itFind->second.type_<<" label=\""<<itFind->second.label_<<"\""
230  <<"\n 2) type="<<itProxyProv->type_<<" label=\""<<itProxyProv->label_<<"\""
231  <<"\nPlease modify configuration so only one is preferred";
232  }
233  dataToProviderMap.insert(std::make_pair(datumKey,*itProxyProv));
234  }
235  }
236  }
237  }
238  return returnValue;
239 }
std::map< DataKey, ComponentDescription > DataToPreferredProviderMap
static HCTypeTag findType(const char *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:126
std::map< EventSetupRecordKey, EventSetupRecordProvider::DataToPreferredProviderMap > RecordToPreferred
heterocontainer::HCTypeTag TypeTag
Definition: DataKeyTags.h:31
std::vector< std::pair< DataKey, boost::shared_ptr< DataProxy > > > KeyedProxies
bool first
Definition: L1TdeRCT.cc:79
static void preferEverything(const ComponentDescription &iComponent, const Providers &iProviders, RecordToPreferred &iReturnValue)
find everything made by a DataProxyProvider and add it to the &#39;preferred&#39; list
heterocontainer::HCTypeTag TypeTag
static const ComponentDescription* edm::eventsetup::dummyDescription ( )
static

Definition at line 32 of file DataProxy.cc.

33 {
34  static ComponentDescription s_desc;
35  return &s_desc;
36 }
template<class T >
void edm::eventsetup::eventSetupGetImplementation ( EventSetup const &  ,
T const *&   
)

Referenced by edm::EventSetup::get().

template<>
void edm::eventsetup::EventSetupRecord::get< fwliteeswriter::Handle > ( const std::string &  iName,
fwliteeswriter::Handle iHolder 
) const

Definition at line 89 of file FWLiteESRecordWriterAnalyzer.cc.

References fwliteeswriter::DummyType::m_data, fwliteeswriter::DummyType::m_tag, matplotRender::t, and relativeConstraints::value.

89  {
91  t.m_tag = &(iHolder.m_info->m_tag);
93  const ComponentDescription* desc = 0;
94  this->getImplementation(value, iName.c_str(),desc,true);
95  iHolder.m_data = t.m_data;
96  iHolder.m_desc = desc;
97  }
const edm::eventsetup::heterocontainer::HCTypeTag * m_tag
const edm::eventsetup::ComponentDescription * m_desc
template<>
void edm::eventsetup::EventSetupRecord::getImplementation< fwliteeswriter::DummyType > ( fwliteeswriter::DummyType const *&  iData,
const char *  iName,
const ComponentDescription *&  iDesc,
bool  iTransientAccessOnly 
) const

Definition at line 73 of file FWLiteESRecordWriterAnalyzer.cc.

References edm::hlt::Exception, and edm::eventsetup::DataKey::kDoNotCopyMemory.

76  {
77  DataKey dataKey(*(iData->m_tag),
78  iName,
79  DataKey::kDoNotCopyMemory);
80 
81  const void* pValue = this->getFromProxy(dataKey,iDesc,iTransientAccessOnly);
82  if(0==pValue) {
83  throw cms::Exception("NoProxyException");
84  }
85  iData->m_data = pValue;
86  }
void edm::eventsetup::fillEventSetupProvider ( EventSetupProvider cp,
ParameterSet params,
CommonParams const &  common 
)

Definition at line 102 of file EventSetupProviderMaker.cc.

References edm::eventsetup::ComponentFactory< T >::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getPSetForUpdate(), edm::CommonParams::passID_, edm::CommonParams::processName_, edm::ParameterSet::registerIt(), edm::CommonParams::releaseVersion_, and validateEventSetupParameters().

Referenced by edm::eventsetup::EventSetupsController::makeProvider().

104  {
105  std::vector<std::string> providers =
106  params.getParameter<std::vector<std::string> >("@all_esmodules");
107 
108  for(std::vector<std::string>::iterator itName = providers.begin(), itNameEnd = providers.end();
109  itName != itNameEnd;
110  ++itName) {
111  ParameterSet* providerPSet = params.getPSetForUpdate(*itName);
112  validateEventSetupParameters(*providerPSet);
113  providerPSet->registerIt();
114  ModuleFactory::get()->addTo(cp,
115  *providerPSet,
116  common.processName_,
117  common.releaseVersion_,
118  common.passID_);
119  }
120 
121  std::vector<std::string> sources =
122  params.getParameter<std::vector<std::string> >("@all_essources");
123 
124  for(std::vector<std::string>::iterator itName = sources.begin(), itNameEnd = sources.end();
125  itName != itNameEnd;
126  ++itName) {
127  ParameterSet* providerPSet = params.getPSetForUpdate(*itName);
128  validateEventSetupParameters(*providerPSet);
129  providerPSet->registerIt();
130  SourceFactory::get()->addTo(cp,
131  *providerPSet,
132  common.processName_,
133  common.releaseVersion_,
134  common.passID_);
135  }
136  }
void validateEventSetupParameters(ParameterSet &pset)
T get(const Candidate &c)
Definition: component.h:56
static void edm::eventsetup::findDependents ( const EventSetupRecordKey iKey,
Itr  itBegin,
Itr  itEnd,
std::vector< boost::shared_ptr< EventSetupRecordProvider > > &  oDependents 
)
static

Definition at line 353 of file EventSetupProvider.cc.

Referenced by edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords().

357 {
358 
359  for(Itr it = itBegin; it != itEnd; ++it) {
360  //does it depend on the record in question?
361  const std::set<EventSetupRecordKey>& deps = it->second->dependentRecords();
362  if(deps.end() != deps.find(iKey)) {
363  oDependents.push_back(it->second);
364  //now see who is dependent on this record since they will be indirectly dependent on iKey
365  findDependents(it->first, itBegin, itEnd, oDependents);
366  }
367  }
368 }
static void findDependents(const EventSetupRecordKey &iKey, Itr itBegin, Itr itEnd, std::vector< boost::shared_ptr< EventSetupRecordProvider > > &oDependents)
Providers::iterator Itr
template<class ProxyT >
void edm::eventsetup::insertProxy ( DataProxyProvider::KeyedProxies &  iList,
boost::shared_ptr< ProxyT >  iProxy,
const char *  iName = "" 
)
inline

Definition at line 109 of file DataProxyProvider.h.

111  {
113  DataKey(DataKey::makeTypeTag<typename ProxyT::value_type>(),
114  iName),
115  iProxy));
116 
117 }
Container::value_type value_type
std::auto_ptr< EventSetupProvider > edm::eventsetup::makeEventSetupProvider ( ParameterSet const &  params)

Definition at line 24 of file EventSetupProviderMaker.cc.

References cms::Exception::append(), edm::errors::Configuration, edm::hlt::Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), and edm::ParameterSet::getParameterSet().

Referenced by edm::eventsetup::EventSetupsController::makeProvider().

24  {
25  std::vector<std::string> prefers =
26  params.getParameter<std::vector<std::string> >("@all_esprefers");
27 
28  if(prefers.empty()) {
29  return std::auto_ptr<EventSetupProvider>(new EventSetupProvider());
30  }
31 
32  EventSetupProvider::PreferredProviderInfo preferInfo;
33  EventSetupProvider::RecordToDataMap recordToData;
34 
35  //recordToData.insert(std::make_pair(std::string("DummyRecord"),
36  // std::make_pair(std::string("DummyData"), std::string())));
37  //preferInfo[ComponentDescription("DummyProxyProvider", "", false)]=
38  // recordToData;
39 
40  for(std::vector<std::string>::iterator itName = prefers.begin(), itNameEnd = prefers.end();
41  itName != itNameEnd;
42  ++itName) {
43  recordToData.clear();
44  ParameterSet const& preferPSet = params.getParameterSet(*itName);
45  std::vector<std::string> recordNames = preferPSet.getParameterNames();
46  for(std::vector<std::string>::iterator itRecordName = recordNames.begin(),
47  itRecordNameEnd = recordNames.end();
48  itRecordName != itRecordNameEnd;
49  ++itRecordName) {
50 
51  if((*itRecordName)[0] == '@') {
52  //this is a 'hidden parameter' so skip it
53  continue;
54  }
55 
56  //this should be a record name with its info
57  try {
58  std::vector<std::string> dataInfo =
59  preferPSet.getParameter<std::vector<std::string> >(*itRecordName);
60 
61  if(dataInfo.empty()) {
62  //FUTURE: empty should just mean all data
64  << "The record named "
65  << *itRecordName << " specifies no data items";
66  }
67  //FUTURE: 'any' should be a special name
68  for(std::vector<std::string>::iterator itDatum = dataInfo.begin(),
69  itDatumEnd = dataInfo.end();
70  itDatum != itDatumEnd;
71  ++itDatum){
72  std::string datumName(*itDatum, 0, itDatum->find_first_of("/"));
73  std::string labelName;
74 
75  if(itDatum->size() != datumName.size()) {
76  labelName = std::string(*itDatum, datumName.size() + 1);
77  }
78  recordToData.insert(std::make_pair(std::string(*itRecordName),
79  std::make_pair(datumName,
80  labelName)));
81  }
82  } catch(cms::Exception const& iException) {
83  cms::Exception theError("ESPreferConfigurationError");
84  theError << "While parsing the es_prefer statement for type="
85  << preferPSet.getParameter<std::string>("@module_type")
86  << " label=\""
87  << preferPSet.getParameter<std::string>("@module_label")
88  << "\" an error occurred.";
89  theError.append(iException);
90  throw theError;
91  }
92  }
93  preferInfo[ComponentDescription(preferPSet.getParameter<std::string>("@module_type"),
94  preferPSet.getParameter<std::string>("@module_label"),
95  false)] = recordToData;
96  }
97  return std::auto_ptr<EventSetupProvider>(new EventSetupProvider(&preferInfo));
98  }
void edm::eventsetup::no_dependent_record_exception_message_builder ( cms::Exception oException,
const EventSetupRecordKey iKey,
const char *  iName 
)

Definition at line 30 of file NoRecordException.cc.

References edm::eventsetup::heterocontainer::HCTypeTag::name(), and edm::eventsetup::EventSetupRecordKey::type().

Referenced by edm::eventsetup::NoRecordException< T >::NoRecordException().

30  {
31  oException
32  << "No \""
33  << iName
34  << "\" record found in the dependent record \""<<iKey.type().name()
35  << "\".\n Please add an ESSource or ESProducer that delivers the \""
36  << iName<<"\" record.";
37 }
void edm::eventsetup::no_record_exception_message_builder ( cms::Exception oException,
const char *  iName 
)

Definition at line 22 of file NoRecordException.cc.

Referenced by edm::eventsetup::NoRecordException< T >::NoRecordException().

22  {
23  oException
24  << "No \""
25  << iName
26  << "\" record found in the EventSetup.\n Please add an ESSource or ESProducer that delivers such a record.\n";
27 }
static void edm::eventsetup::preferEverything ( const ComponentDescription iComponent,
const Providers iProviders,
RecordToPreferred iReturnValue 
)
static

find everything made by a DataProxyProvider and add it to the 'preferred' list

Definition at line 105 of file EventSetupProvider.cc.

References edm::hlt::Exception, edm::eventsetup::ComponentDescription::label_, and edm::eventsetup::ComponentDescription::type_.

Referenced by determinePreferred().

108 {
109  //need to get our hands on the actual DataProxyProvider
110  bool foundProxyProvider = false;
111  for(Providers::const_iterator itProvider = iProviders.begin(), itProviderEnd = iProviders.end();
112  itProvider!= itProviderEnd;
113  ++itProvider) {
114  std::set<ComponentDescription> components = itProvider->second->proxyProviderDescriptions();
115  if(components.find(iComponent)!= components.end()) {
116  boost::shared_ptr<DataProxyProvider> proxyProv =
117  itProvider->second->proxyProvider(*(components.find(iComponent)));
118  assert(proxyProv.get());
119 
120  std::set<EventSetupRecordKey> records = proxyProv->usingRecords();
121  for(std::set<EventSetupRecordKey>::iterator itRecord = records.begin(),
122  itRecordEnd = records.end();
123  itRecord != itRecordEnd;
124  ++itRecord){
125  const DataProxyProvider::KeyedProxies& keyedProxies = proxyProv->keyedProxies(*itRecord);
126  if(!keyedProxies.empty()){
127  //add them to our output
128  EventSetupRecordProvider::DataToPreferredProviderMap& dataToProviderMap =
129  iReturnValue[*itRecord];
130 
131  for(DataProxyProvider::KeyedProxies::const_iterator itProxy = keyedProxies.begin(),
132  itProxyEnd = keyedProxies.end();
133  itProxy != itProxyEnd;
134  ++itProxy) {
135  EventSetupRecordProvider::DataToPreferredProviderMap::iterator itFind =
136  dataToProviderMap.find(itProxy->first);
137  if(itFind != dataToProviderMap.end()){
138  throw cms::Exception("ESPreferConflict") <<"Two providers have been set to be preferred for\n"
139  <<itProxy->first.type().name()<<" \""<<itProxy->first.name().value()<<"\""
140  <<"\n the providers are "
141  <<"\n 1) type="<<itFind->second.type_<<" label=\""<<itFind->second.label_<<"\""
142  <<"\n 2) type="<<iComponent.type_<<" label=\""<<iComponent.label_<<"\""
143  <<"\nPlease modify configuration so only one is preferred";
144  }
145  dataToProviderMap.insert(std::make_pair(itProxy->first,iComponent));
146  }
147  }
148  }
149  foundProxyProvider=true;
150  break;
151  }
152  }
153  if(!foundProxyProvider) {
154  throw cms::Exception("ESPreferNoProvider")<<"Could not make type=\""<<iComponent.type_
155  <<"\" label=\""<<iComponent.label_<<"\" a preferred Provider."<<
156  "\n Please check spelling of name, or that it was loaded into the job.";
157  }
158 }
void edm::eventsetup::swap ( DataKey a,
DataKey b 
)
inline

Definition at line 100 of file DataKey.h.

References edm::eventsetup::DataKey::swap.

Referenced by edm::eventsetup::DataProxyProvider::keyedProxies().

101  {
102  a.swap(b);
103  }
void edm::eventsetup::validateEventSetupParameters ( ParameterSet pset)

Definition at line 139 of file EventSetupProviderMaker.cc.

References cms::Exception::append(), edm::errors::Configuration, SurfaceDeformationFactory::create(), reco::get(), edm::ParameterSet::getParameter(), moduleLabel(), and edm::ConfigurationDescriptions::validate().

Referenced by fillEventSetupProvider().

139  {
140  std::string modtype;
141  std::string moduleLabel;
142  try {
143  modtype = pset.getParameter<std::string>("@module_type");
144  moduleLabel = pset.getParameter<std::string>("@module_label");
145  // Check for the "unlabeled" case
146  // This is an artifact left over from the old configuration language
147  // we were using before switching to the python configuration
148  // This is handled in the validation code and python configuration
149  // files by using a label equal to the module typename.
150  if (moduleLabel == std::string("")) {
151  moduleLabel = modtype;
152  }
153 
154  std::auto_ptr<ParameterSetDescriptionFillerBase> filler(
156  ConfigurationDescriptions descriptions(filler->baseType());
157  filler->fill(descriptions);
158  descriptions.validate(pset, moduleLabel);
159  }
160  catch (cms::Exception& iException) {
161  Exception toThrow(errors::Configuration, "Failed validating configuration of ESProducer or ESSource.");
162  toThrow << "\nThe plugin name is \"" << modtype << "\"\n";
163  toThrow << "The module label is \"" << moduleLabel << "\"\n";
164  toThrow.append(iException);
165  throw toThrow;
166  }
167  }
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:56
const std::string * moduleLabel() const
Definition: HLTadd.h:40