CMS 3D CMS Logo

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