CMS 3D CMS Logo

Functions
edm::pdtentry Namespace Reference

Functions

PdtEntry getPdtEntry (Entry const &e, char const *name)
 
std::vector< PdtEntrygetPdtEntryVector (Entry const &e, char const *name)
 

Function Documentation

◆ getPdtEntry()

PdtEntry edm::pdtentry::getPdtEntry ( Entry const &  e,
char const *  name 
)

Definition at line 45 of file PdtEntry.cc.

References edm::errors::Configuration, MillePedeFileConverter_cfg::e, Exception, and Skims_PA_cff::name.

Referenced by edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

45  {
46  if (e.typeCode() == 'I')
47  return PdtEntry(e.getInt32());
48  else if (e.typeCode() == 'S')
49  return PdtEntry(e.getString());
50  else if (e.typeCode() == 'Z')
51  return PdtEntry(e.getString());
52  else
53  throw Exception(errors::Configuration, "EntryError")
54  << "can not convert representation of " << name << " to value of type PdtEntry. "
55  << "Please, provide a parameter either of type int32 or string.";
56  }

◆ getPdtEntryVector()

std::vector< PdtEntry > edm::pdtentry::getPdtEntryVector ( Entry const &  e,
char const *  name 
)

Definition at line 58 of file PdtEntry.cc.

References edm::errors::Configuration, MillePedeFileConverter_cfg::e, Exception, mps_fire::i, Skims_PA_cff::name, runTheMatrix::ret, and findQualityFiles::v.

Referenced by edm::ParameterSet::getParameter< std::vector< PdtEntry > >(), and edm::ParameterSet::getUntrackedParameter< std::vector< PdtEntry > >().

58  {
59  std::vector<PdtEntry> ret;
60  if (e.typeCode() == 'i') {
61  std::vector<int> v(e.getVInt32());
62  for (std::vector<int>::const_iterator i = v.begin(); i != v.end(); ++i)
63  ret.push_back(PdtEntry(*i));
64  return ret;
65  } else if (e.typeCode() == 's') {
66  std::vector<std::string> v(e.getVString());
67  for (std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
68  ret.push_back(PdtEntry(*i));
69  return ret;
70  } else if (e.typeCode() == 'z') {
71  std::vector<std::string> v(e.getVString());
72  for (std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
73  ret.push_back(PdtEntry(*i));
74  return ret;
75  } else
76  throw Exception(errors::Configuration, "EntryError")
77  << "can not convert representation of " << name << " to value of type PdtEntry. "
78  << "Please, provide a parameter either of type int32 or string.";
79  }
ret
prodAgent to be discontinued