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