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