CMS 3D CMS Logo

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