CMS 3D CMS Logo

ParameterDescription.cc
Go to the documentation of this file.
1 
3 
16 
17 #include <cassert>
18 #include <cstdlib>
19 #include <iomanip>
20 #include <ostream>
21 #include <sstream>
22 
23 namespace edm {
24 
25  // =================================================================
26 
29  bool isTracked,
30  Comment const& iComment)
31  : ParameterDescriptionBase(iLabel, k_PSet, isTracked, true, iComment),
32  psetDesc_(new ParameterSetDescription(value)) {}
33 
36  bool isTracked,
37  Comment const& iComment)
38  : ParameterDescriptionBase(iLabel, k_PSet, isTracked, true, iComment),
39  psetDesc_(new ParameterSetDescription(value)) {}
40 
42 
44  std::set<std::string>& validatedLabels,
45  bool optional) const {
46  bool exists = pset.existsAs<ParameterSet>(label(), isTracked());
47 
48  if (exists) {
49  validatedLabels.insert(label());
50  } else if (pset.existsAs<ParameterSet>(label(), !isTracked())) {
52  } else if (pset.exists(label())) {
54  }
55 
56  if (!optional && !exists) {
57  if (isTracked()) {
58  pset.addParameter(label(), ParameterSet());
59  } else {
61  }
62  validatedLabels.insert(label());
63  }
64 
65  exists = pset.existsAs<ParameterSet>(label(), isTracked());
66 
67  if (exists) {
68  if (pset.isRegistered()) {
69  pset.invalidateRegistration("");
70  }
71  ParameterSet* containedPSet = pset.getPSetForUpdate(label());
72  psetDesc_->validate(*containedPSet);
73  }
74  }
75 
77  bool writeToCfi,
78  DocFormatHelper& dfh) const {
79  os << "see Section " << dfh.section() << "." << dfh.counter();
80  if (!writeToCfi)
81  os << " (do not write to cfi)";
82  os << "\n";
83  }
84 
86 
88  bool /*optional*/,
89  DocFormatHelper& dfh) const {
90  int indentation = dfh.indentation();
91  if (dfh.parent() != DocFormatHelper::TOP) {
93  }
94 
95  std::stringstream ss;
96  ss << dfh.section() << "." << dfh.counter();
97  std::string newSection = ss.str();
98 
99  printSpaces(os, indentation);
100  os << "Section " << newSection << " " << label() << " PSet description:\n";
101  if (!dfh.brief())
102  os << "\n";
103 
104  DocFormatHelper new_dfh(dfh);
105  new_dfh.init();
106  new_dfh.setSection(newSection);
107  if (dfh.parent() == DocFormatHelper::TOP) {
108  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
109  }
110  psetDesc_->print(os, new_dfh);
111  }
112 
114  return pset.existsAs<ParameterSet>(label(), isTracked());
115  }
116 
118  return psetDesc_.operator->();
119  }
120 
122  return psetDesc_.operator->();
123  }
124 
125  void ParameterDescription<ParameterSetDescription>::writeCfi_(std::ostream& os, int indentation) const {
126  bool startWithComma = false;
127  indentation += 2;
128  psetDesc_->writeCfi(os, startWithComma, indentation);
129  }
130 
131  void ParameterDescription<ParameterSetDescription>::writeDoc_(std::ostream&, int /*indentation*/) const {}
132 
133  // These next two should not be needed for this specialization
136  return true;
137  }
138 
141  return;
142  }
143 
144  // =================================================================
145 
147  ParameterSetDescription const& psetDesc,
148  bool isTracked,
149  std::vector<ParameterSet> const& vPset,
150  Comment const& iComment)
151  : ParameterDescriptionBase(iLabel, k_VPSet, isTracked, true, iComment),
152  psetDesc_(new ParameterSetDescription(psetDesc)),
153  vPset_(vPset),
154  partOfDefaultOfVPSet_(false) {}
155 
157  ParameterSetDescription const& psetDesc,
158  bool isTracked,
159  std::vector<ParameterSet> const& vPset,
160  Comment const& iComment)
161  : ParameterDescriptionBase(iLabel, k_VPSet, isTracked, true, iComment),
162  psetDesc_(new ParameterSetDescription(psetDesc)),
163  vPset_(vPset),
164  partOfDefaultOfVPSet_(false) {}
165 
167  ParameterSetDescription const& psetDesc,
168  bool isTracked,
169  Comment const& iComment)
170  : ParameterDescriptionBase(iLabel, k_VPSet, isTracked, false, iComment),
171  psetDesc_(new ParameterSetDescription(psetDesc)),
172  vPset_(),
173  partOfDefaultOfVPSet_(false) {}
174 
176  ParameterSetDescription const& psetDesc,
177  bool isTracked,
178  Comment const& iComment)
179  : ParameterDescriptionBase(iLabel, k_VPSet, isTracked, false, iComment),
180  psetDesc_(new ParameterSetDescription(psetDesc)),
181  vPset_(),
182  partOfDefaultOfVPSet_(false) {}
183 
185 
187  return psetDesc_.operator->();
188  }
189 
191  return psetDesc_.operator->();
192  }
193 
195  std::set<std::string>& validatedLabels,
196  bool optional) const {
197  bool exists = pset.existsAs<std::vector<ParameterSet> >(label(), isTracked());
198 
199  if (exists) {
200  validatedLabels.insert(label());
201  } else if (pset.existsAs<std::vector<ParameterSet> >(label(), !isTracked())) {
203  } else if (pset.exists(label())) {
205  }
206 
207  if (!exists && !optional) {
208  if (hasDefault()) {
209  if (isTracked()) {
210  pset.addParameter(label(), vPset_);
211  } else {
212  pset.addUntrackedParameter(label(), vPset_);
213  }
214  validatedLabels.insert(label());
215  } else {
217  }
218  }
219 
220  exists = pset.existsAs<std::vector<ParameterSet> >(label(), isTracked());
221  if (exists) {
222  VParameterSetEntry* vpsetEntry = pset.getPSetVectorForUpdate(label());
223  assert(vpsetEntry);
224 
225  for (unsigned i = 0; i < vpsetEntry->size(); ++i) {
226  psetDesc_->validate(vpsetEntry->psetInVector(i));
227  }
228  }
229  }
230 
232  bool writeToCfi,
233  DocFormatHelper& dfh) const {
234  os << "see Section " << dfh.section() << "." << dfh.counter();
235  if (!writeToCfi)
236  os << " (do not write to cfi)";
237  os << "\n";
238  }
239 
241 
243  bool /*optional*/,
244  DocFormatHelper& dfh) const {
245  int indentation = dfh.indentation();
246  if (dfh.parent() != DocFormatHelper::TOP) {
247  indentation -= DocFormatHelper::offsetSectionContent();
248  }
249 
250  if (!partOfDefaultOfVPSet_) {
251  printSpaces(os, indentation);
252  os << "Section " << dfh.section() << "." << dfh.counter() << " " << label() << " VPSet description:\n";
253 
255  os << "All elements will be validated using the PSet description in Section " << dfh.section() << "."
256  << dfh.counter() << ".1.\n";
257  } else {
258  printSpaces(os, indentation);
259  os << "Section " << dfh.section() << "." << dfh.counter() << " "
260  << " VPSet description for VPSet that is part of the default of a containing VPSet:\n";
261  }
262 
264 
265  unsigned subsectionOffset = 2;
266  if (partOfDefaultOfVPSet_)
267  subsectionOffset = 1;
268 
269  if (hasDefault()) {
270  if (vPset_.empty())
271  os << "The default VPSet is empty.\n";
272  else if (vPset_.size() == 1U)
273  os << "The default VPSet has 1 element.\n";
274  else
275  os << "The default VPSet has " << vPset_.size() << " elements.\n";
276 
277  if (!vPset_.empty()) {
278  for (unsigned i = 0; i < vPset_.size(); ++i) {
280  os << "[" << (i) << "]: see Section " << dfh.section() << "." << dfh.counter() << "."
281  << (i + subsectionOffset) << "\n";
282  }
283  }
284  } else {
285  os << "Does not have a default VPSet.\n";
286  }
287 
288  if (!dfh.brief())
289  os << "\n";
290 
291  if (!partOfDefaultOfVPSet_) {
292  std::stringstream ss;
293  ss << dfh.section() << "." << dfh.counter() << ".1";
294  std::string newSection = ss.str();
295 
296  printSpaces(os, indentation);
297  os << "Section " << newSection << " description of PSet used to validate elements of VPSet:\n";
298  if (!dfh.brief())
299  os << "\n";
300 
301  DocFormatHelper new_dfh(dfh);
302  new_dfh.init();
303  new_dfh.setSection(newSection);
304  if (dfh.parent() == DocFormatHelper::TOP) {
305  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
306  }
307  psetDesc_->print(os, new_dfh);
308  }
309 
310  if (hasDefault()) {
311  for (unsigned i = 0; i < vPset_.size(); ++i) {
312  std::stringstream ss;
313  ss << dfh.section() << "." << dfh.counter() << "." << (i + subsectionOffset);
314  std::string newSection = ss.str();
315 
316  printSpaces(os, indentation);
317  os << "Section " << newSection << " PSet description of "
318  << "default VPSet element [" << i << "]\n";
319  if (!dfh.brief())
320  os << "\n";
321 
322  DocFormatHelper new_dfh(dfh);
323  new_dfh.init();
324  new_dfh.setSection(newSection);
325  if (dfh.parent() == DocFormatHelper::TOP) {
326  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
327  }
328 
329  ParameterSetDescription defaultDescription;
330  fillDescriptionFromPSet(vPset_[i], defaultDescription);
331  defaultDescription.print(os, new_dfh);
332  }
333  }
334  }
335 
337  return pset.existsAs<std::vector<ParameterSet> >(label(), isTracked());
338  }
339 
341  std::ostream& os,
342  int indentation,
343  bool& nextOneStartsWithAComma) {
344  if (nextOneStartsWithAComma)
345  os << ",";
346  nextOneStartsWithAComma = true;
347  os << "\n";
348  printSpaces(os, indentation + 2);
349 
350  os << "cms.PSet(";
351 
352  bool startWithComma = false;
353  int indent = indentation + 4;
354 
355  ParameterSetDescription psetDesc;
356  fillDescriptionFromPSet(pset, psetDesc);
357  psetDesc.writeCfi(os, startWithComma, indent);
358 
359  os << ")";
360  }
361 
362  void ParameterDescription<std::vector<ParameterSet> >::writeCfi_(std::ostream& os, int indentation) const {
363  bool nextOneStartsWithAComma = false;
364  for_all(
365  vPset_,
366  std::bind(
367  &writeOneElementToCfi, std::placeholders::_1, std::ref(os), indentation, std::ref(nextOneStartsWithAComma)));
368  os << "\n";
369  printSpaces(os, indentation);
370  }
371 
372  void ParameterDescription<std::vector<ParameterSet> >::writeDoc_(std::ostream&, int /*indentation*/) const {}
373 
374  // These next two should not be needed for this specialization
377  return true;
378  }
379 
382  return;
383  }
384 
385  // =================================================================
386 
387  namespace writeParameterValue {
388 
389  template <typename T>
390  void writeSingleValue(std::ostream& os, T const& value, ValueFormat) {
391  os << value;
392  }
393 
394  // Specialize this for cases where the operator<< does not give
395  // the proper formatting for a configuration file.
396 
397  // Formatting the doubles is a little tricky. It is a requirement
398  // that when a value of ***type double*** is added to a ParameterSetDescription
399  // the EXACT same value of type double will be created and passed to the
400  // ParameterSet after the cfi files have been read. The tricky part
401  // is these values usually appear in the C++ code and cfi file as text
402  // strings (in decimal form). We do our best to force the text
403  // string in the C++ code to be the same as the text string in the
404  // cfi file by judiciously rounding to smaller precision when possible.
405  // But it is not always possible to force the text strings to be the
406  // same. Generally, there are differences when the text string in the
407  // C++ code has many digits (probably more than a human will ever type).
408  // Even in cases where the text strings differ, the values stored in
409  // memory in variables of type double will be exactly the same.
410  // The alternative to the approach here is to store the values as strings,
411  // but that approach was rejected because it would require the
412  // ParameterSetDescription to know how to parse the strings.
414  std::stringstream s;
415  s << std::setprecision(17) << value;
416  result = s.str();
417 
418  if (result.size() > 15 && std::string::npos != result.find(".")) {
419  std::stringstream s;
420  s << std::setprecision(15) << value;
421  std::string resultLessPrecision = s.str();
422 
423  if (resultLessPrecision.size() < result.size() - 2) {
424  double test = std::strtod(resultLessPrecision.c_str(), nullptr);
425  if (test == value) {
426  result = resultLessPrecision;
427  }
428  }
429  }
430  }
431 
432  template <>
433  void writeSingleValue<double>(std::ostream& os, double const& value, ValueFormat) {
434  std::string sValue;
435  formatDouble(value, sValue);
436  os << sValue;
437  }
438 
439  template <>
440  void writeSingleValue<bool>(std::ostream& os, bool const& value, ValueFormat) {
441  value ? os << "True" : os << "False";
442  }
443 
444  template <>
445  void writeSingleValue<std::string>(std::ostream& os, std::string const& value, ValueFormat) {
446  os << "'" << value << "'";
447  }
448 
449  template <>
450  void writeSingleValue<EventID>(std::ostream& os, EventID const& value, ValueFormat format) {
451  if (format == CFI) {
452  os << value.run() << ", " << value.luminosityBlock() << ", " << value.event();
453  } else {
454  if (value.luminosityBlock() == 0U) {
455  os << value.run() << ":" << value.event();
456  } else {
457  os << value.run() << ":" << value.luminosityBlock() << ":" << value.event();
458  }
459  }
460  }
461 
462  template <>
464  if (format == CFI)
465  os << value.run() << ", " << value.luminosityBlock();
466  else
467  os << value.run() << ":" << value.luminosityBlock();
468  }
469 
470  template <>
472  if (value.startLumi() == 0U) {
473  if (format == CFI)
474  os << "'" << value.startRun() << ":" << value.startEvent() << "-" << value.endRun() << ":" << value.endEvent()
475  << "'";
476  else
477  os << value.startRun() << ":" << value.startEvent() << "-" << value.endRun() << ":" << value.endEvent();
478  } else {
479  if (format == CFI)
480  os << "'" << value.startRun() << ":" << value.startLumi() << ":" << value.startEvent() << "-"
481  << value.endRun() << ":" << value.endLumi() << ":" << value.endEvent() << "'";
482  else
483  os << value.startRun() << ":" << value.startLumi() << ":" << value.startEvent() << "-" << value.endRun()
484  << ":" << value.endLumi() << ":" << value.endEvent();
485  }
486  }
487 
488  template <>
492  if (format == CFI)
493  os << "'" << value.startRun() << ":" << value.startLumi() << "-" << value.endRun() << ":" << value.endLumi()
494  << "'";
495  else
496  os << value.startRun() << ":" << value.startLumi() << "-" << value.endRun() << ":" << value.endLumi();
497  }
498 
499  template <>
500  void writeSingleValue<InputTag>(std::ostream& os, InputTag const& value, ValueFormat format) {
501  if (format == CFI) {
502  os << "'" << value.label() << "'";
503  if (!value.instance().empty() || !value.process().empty()) {
504  os << ", '" << value.instance() << "'";
505  }
506  if (!value.process().empty()) {
507  os << ", '" << value.process() << "'";
508  }
509  } else {
510  os << "'" << value.label();
511  if (!value.instance().empty() || !value.process().empty()) {
512  os << ":" << value.instance();
513  }
514  if (!value.process().empty()) {
515  os << ":" << value.process();
516  }
517  os << "'";
518  }
519  }
520 
521  template <>
522  void writeSingleValue<FileInPath>(std::ostream& os, FileInPath const& value, ValueFormat) {
523  os << "'" << value.relativePath() << "'";
524  }
525 
526  template <typename T>
527  void writeValue(std::ostream& os, T const& value_, ValueFormat format) {
528  std::ios_base::fmtflags ff = os.flags(std::ios_base::dec);
529  os.width(0);
530  writeSingleValue<T>(os, value_, format);
531  os.flags(ff);
532  }
533 
534  template <typename T>
535  void writeValueInVector(std::ostream& os, T const& value, ValueFormat format) {
536  writeSingleValue<T>(os, value, format);
537  }
538 
539  // Specializations for cases where we write the single values into
540  // vectors differently than when there is only one not in a vector.
541  template <>
542  void writeValueInVector<EventID>(std::ostream& os, EventID const& value, ValueFormat format) {
543  if (value.luminosityBlock() == 0U) {
544  if (format == CFI)
545  os << "'" << value.run() << ":" << value.event() << "'";
546  else
547  os << value.run() << ":" << value.event();
548  } else {
549  if (format == CFI)
550  os << "'" << value.run() << ":" << value.luminosityBlock() << ":" << value.event() << "'";
551  else
552  os << value.run() << ":" << value.luminosityBlock() << ":" << value.event();
553  }
554  }
555 
556  template <>
558  if (format == CFI)
559  os << "'" << value.run() << ":" << value.luminosityBlock() << "'";
560  else
561  os << value.run() << ":" << value.luminosityBlock();
562  }
563 
564  template <>
565  void writeValueInVector<InputTag>(std::ostream& os, InputTag const& value, ValueFormat) {
566  os << "'" << value.label();
567  if (!value.instance().empty() || !value.process().empty()) {
568  os << ":" << value.instance();
569  }
570  if (!value.process().empty()) {
571  os << ":" << value.process();
572  }
573  os << "'";
574  }
575 
576  template <typename T>
578  T const& value, std::ostream& os, int indentation, bool& startWithComma, ValueFormat format, int& i) {
579  if (startWithComma && format == CFI)
580  os << ",";
581  startWithComma = true;
582  os << "\n" << std::setw(indentation) << "";
583  if (format == DOC)
584  os << "[" << i << "]: ";
585  writeValueInVector<T>(os, value, format);
586  ++i;
587  }
588 
589  template <typename T>
590  void writeVector(std::ostream& os, int indentation, std::vector<T> const& value_, ValueFormat format) {
591  std::ios_base::fmtflags ff = os.flags(std::ios_base::dec);
592  char oldFill = os.fill();
593  os.width(0);
594  if (value_.empty() && format == DOC) {
595  os << "empty";
596  } else if (value_.size() == 1U && format == CFI) {
597  writeValueInVector<T>(os, value_[0], format);
598  } else if (!value_.empty()) {
599  if (format == DOC)
600  os << "(vector size = " << value_.size() << ")";
601  if (format == CFI and value_.size() > 255U)
602  os << " *(";
603  os.fill(' ');
604  bool startWithComma = false;
605  int i = 0;
606  for_all(value_,
607  std::bind(&writeValueInVectorWithSpace<T>,
608  std::placeholders::_1,
609  std::ref(os),
610  indentation + 2,
611  std::ref(startWithComma),
612  format,
613  std::ref(i)));
614  if (format == CFI)
615  os << "\n" << std::setw(indentation) << "";
616  if (format == CFI and value_.size() > 255U)
617  os << ") ";
618  }
619  os.flags(ff);
620  os.fill(oldFill);
621  }
622 
623  void writeValue(std::ostream& os, int, int const& value_, ValueFormat format) {
624  writeValue<int>(os, value_, format);
625  }
626 
627  void writeValue(std::ostream& os, int indentation, std::vector<int> const& value_, ValueFormat format) {
628  writeVector<int>(os, indentation, value_, format);
629  }
630 
631  void writeValue(std::ostream& os, int, unsigned const& value_, ValueFormat format) {
632  writeValue<unsigned>(os, value_, format);
633  }
634 
635  void writeValue(std::ostream& os, int indentation, std::vector<unsigned> const& value_, ValueFormat format) {
636  writeVector<unsigned>(os, indentation, value_, format);
637  }
638 
639  void writeValue(std::ostream& os, int, long long const& value_, ValueFormat format) {
640  writeValue<long long>(os, value_, format);
641  }
642 
643  void writeValue(std::ostream& os, int indentation, std::vector<long long> const& value_, ValueFormat format) {
644  writeVector<long long>(os, indentation, value_, format);
645  }
646 
647  void writeValue(std::ostream& os, int, unsigned long long const& value_, ValueFormat format) {
648  writeValue<unsigned long long>(os, value_, format);
649  }
650 
651  void writeValue(std::ostream& os,
652  int indentation,
653  std::vector<unsigned long long> const& value_,
655  writeVector<unsigned long long>(os, indentation, value_, format);
656  }
657 
658  void writeValue(std::ostream& os, int, double const& value_, ValueFormat format) {
659  writeValue<double>(os, value_, format);
660  }
661 
662  void writeValue(std::ostream& os, int indentation, std::vector<double> const& value_, ValueFormat format) {
663  writeVector<double>(os, indentation, value_, format);
664  }
665 
666  void writeValue(std::ostream& os, int, bool const& value_, ValueFormat format) {
667  writeValue<bool>(os, value_, format);
668  }
669 
670  void writeValue(std::ostream& os, int, std::string const& value_, ValueFormat format) {
671  writeValue<std::string>(os, value_, format);
672  }
673 
674  void writeValue(std::ostream& os, int indentation, std::vector<std::string> const& value_, ValueFormat format) {
675  writeVector<std::string>(os, indentation, value_, format);
676  }
677 
678  void writeValue(std::ostream& os, int, EventID const& value_, ValueFormat format) {
679  writeValue<EventID>(os, value_, format);
680  }
681 
682  void writeValue(std::ostream& os, int indentation, std::vector<EventID> const& value_, ValueFormat format) {
683  writeVector<EventID>(os, indentation, value_, format);
684  }
685 
686  void writeValue(std::ostream& os, int, LuminosityBlockID const& value_, ValueFormat format) {
687  writeValue<LuminosityBlockID>(os, value_, format);
688  }
689 
690  void writeValue(std::ostream& os,
691  int indentation,
692  std::vector<LuminosityBlockID> const& value_,
694  writeVector<LuminosityBlockID>(os, indentation, value_, format);
695  }
696 
697  void writeValue(std::ostream& os, int, LuminosityBlockRange const& value_, ValueFormat format) {
698  writeValue<LuminosityBlockRange>(os, value_, format);
699  }
700 
701  void writeValue(std::ostream& os,
702  int indentation,
703  std::vector<LuminosityBlockRange> const& value_,
705  writeVector<LuminosityBlockRange>(os, indentation, value_, format);
706  }
707 
708  void writeValue(std::ostream& os, int, EventRange const& value_, ValueFormat format) {
709  writeValue<EventRange>(os, value_, format);
710  }
711 
712  void writeValue(std::ostream& os, int indentation, std::vector<EventRange> const& value_, ValueFormat format) {
713  writeVector<EventRange>(os, indentation, value_, format);
714  }
715 
716  void writeValue(std::ostream& os, int, InputTag const& value_, ValueFormat format) {
717  writeValue<InputTag>(os, value_, format);
718  }
719 
720  void writeValue(std::ostream& os, int indentation, std::vector<InputTag> const& value_, ValueFormat format) {
721  writeVector<InputTag>(os, indentation, value_, format);
722  }
723 
724  void writeValue(std::ostream& os, int, FileInPath const& value_, ValueFormat format) {
725  writeValue<FileInPath>(os, value_, format);
726  }
727 
728  bool hasNestedContent(int const&) { return false; }
729  bool hasNestedContent(std::vector<int> const& value) { return value.size() > 5U; }
730  bool hasNestedContent(unsigned const&) { return false; }
731  bool hasNestedContent(std::vector<unsigned> const& value) { return value.size() > 5U; }
732  bool hasNestedContent(long long const&) { return false; }
733  bool hasNestedContent(std::vector<long long> const& value) { return value.size() > 5U; }
734  bool hasNestedContent(unsigned long long const&) { return false; }
735  bool hasNestedContent(std::vector<unsigned long long> const& value) { return value.size() > 5U; }
736  bool hasNestedContent(double const&) { return false; }
737  bool hasNestedContent(std::vector<double> const& value) { return value.size() > 5U; }
738  bool hasNestedContent(bool const&) { return false; }
739  bool hasNestedContent(std::string const&) { return false; }
740  bool hasNestedContent(std::vector<std::string> const& value) { return value.size() > 5U; }
741  bool hasNestedContent(EventID const&) { return false; }
742  bool hasNestedContent(std::vector<EventID> const& value) { return value.size() > 5U; }
743  bool hasNestedContent(LuminosityBlockID const&) { return false; }
744  bool hasNestedContent(std::vector<LuminosityBlockID> const& value) { return value.size() > 5U; }
745  bool hasNestedContent(LuminosityBlockRange const&) { return false; }
746  bool hasNestedContent(std::vector<LuminosityBlockRange> const& value) { return value.size() > 5U; }
747  bool hasNestedContent(EventRange const&) { return false; }
748  bool hasNestedContent(std::vector<EventRange> const& value) { return value.size() > 5U; }
749  bool hasNestedContent(InputTag const&) { return false; }
750  bool hasNestedContent(std::vector<InputTag> const& value) { return value.size() > 5U; }
751  bool hasNestedContent(FileInPath const&) { return false; }
752  } // namespace writeParameterValue
753 } // namespace edm
void writeDoc_(std::ostream &os, int indentation) const override
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
void writeValueInVectorWithSpace(T const &value, std::ostream &os, int indentation, bool &startWithComma, ValueFormat format, int &i)
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
bool exists_(ParameterSet const &pset) const override
bool exists(std::string const &parameterName) const
checks if a parameter exists
void writeSingleValue< double >(std::ostream &os, double const &value, ValueFormat)
void writeSingleValue< bool >(std::ostream &os, bool const &value, ValueFormat)
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const
void insert(bool ok_to_replace, char const *, Entry const &)
void writeCfi(std::ostream &os, bool startWithComma, int indentation) const
void fillDescriptionFromPSet(ParameterSet const &pset, ParameterSetDescription &desc)
void writeSingleValue< FileInPath >(std::ostream &os, FileInPath const &value, ValueFormat)
DescriptionParent parent() const
void writeVector(std::ostream &os, int indentation, std::vector< T > const &value_, ValueFormat format)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
int indentation() const
void writeValue(std::ostream &os, T const &value_, ValueFormat format)
VParameterSetEntry * getPSetVectorForUpdate(std::string const &name)
void writeCfi_(std::ostream &os, int indentation) const override
void writeSingleValue< EventID >(std::ostream &os, EventID const &value, ValueFormat format)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:125
void writeSingleValue< EventRange >(std::ostream &os, EventRange const &value, ValueFormat format)
void writeValueInVector< EventID >(std::ostream &os, EventID const &value, ValueFormat format)
void print(std::ostream &os, DocFormatHelper &dfh) const
static int offsetSectionContent()
void writeSingleValue(std::ostream &os, T const &value, ValueFormat)
format
Some error handling for the usage.
Definition: value.py:1
bool isRegistered() const
Definition: ParameterSet.h:61
void writeValueInVector< InputTag >(std::ostream &os, InputTag const &value, ValueFormat)
void writeValueInVector(std::ostream &os, T const &value, ValueFormat format)
void invalidateRegistration(std::string const &nameOfTracked)
Definition: ParameterSet.cc:32
ParameterDescription(std::string const &iLabel, T const &value, bool isTracked, Comment const &iComment=Comment())
static void printSpaces(std::ostream &os, int n)
bool exists(ParameterSet const &pset) const
void insertDefault_(ParameterSet &pset) const override
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
void writeValueInVector< LuminosityBlockID >(std::ostream &os, LuminosityBlockID const &value, ValueFormat format)
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:182
bool hasNestedContent_() const override
virtual ParameterSetDescription const * parameterSetDescription() const
HLT enums.
void formatDouble(double value, std::string &result)
void writeSingleValue< InputTag >(std::ostream &os, InputTag const &value, ValueFormat format)
std::vector< ParameterSet >::size_type size() const
ParameterSet & psetInVector(int i)
void setSection(std::string const &value)
long double T
void writeSingleValue< LuminosityBlockID >(std::ostream &os, LuminosityBlockID const &value, ValueFormat format)
void writeSingleValue< LuminosityBlockRange >(std::ostream &os, LuminosityBlockRange const &value, ValueFormat format)
void setIndentation(int value)
ParameterSet * getPSetForUpdate(std::string const &name, bool &isTracked)
std::string const & label() const
std::string const & section() const