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