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 
8 
16 
17 #include "boost/bind.hpp"
18 
19 #include <cassert>
20 #include <ostream>
21 #include <iomanip>
22 #include <sstream>
23 #include <cstdlib>
24 
25 namespace edm {
26 
27  // =================================================================
28 
30  ParameterDescription(std::string const& iLabel,
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  }
59  else if (pset.existsAs<ParameterSet>(label(), !isTracked())) {
61  }
62  else if (pset.exists(label())) {
64  }
65 
66  if (!optional && !exists) {
67  if (isTracked()) {
68  pset.addParameter(label(), ParameterSet());
69  }
70  else {
72  }
73  validatedLabels.insert(label());
74  }
75 
76  exists = pset.existsAs<ParameterSet>(label(), isTracked());
77 
78  if (exists) {
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) {
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) {
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& os, int indentation) const {
158  }
159 
160  // These next two should not be needed for this specialization
161  bool
163  exists_(ParameterSet const& pset, bool isTracked) const {
165  return true;
166  }
167 
168  void
172  return;
173  }
174 
175  // =================================================================
176 
178  ParameterDescription(std::string const& iLabel,
179  ParameterSetDescription const& psetDesc,
180  bool isTracked,
181  std::vector<ParameterSet> const& vPset) :
182  ParameterDescriptionBase(iLabel, k_VPSet, isTracked, true),
183  psetDesc_(new ParameterSetDescription(psetDesc)),
184  vPset_(vPset),
185  partOfDefaultOfVPSet_(false) {
186  }
187 
189  ParameterDescription(char const* iLabel,
190  ParameterSetDescription const& psetDesc,
191  bool isTracked,
192  std::vector<ParameterSet> const& vPset) :
193  ParameterDescriptionBase(iLabel, k_VPSet, isTracked, true),
194  psetDesc_(new ParameterSetDescription(psetDesc)),
195  vPset_(vPset),
196  partOfDefaultOfVPSet_(false) {
197  }
198 
200  ParameterDescription(std::string const& iLabel,
201  ParameterSetDescription const& psetDesc,
202  bool isTracked) :
203  ParameterDescriptionBase(iLabel, k_VPSet, isTracked, false),
204  psetDesc_(new ParameterSetDescription(psetDesc)),
205  vPset_(),
206  partOfDefaultOfVPSet_(false) {
207  }
208 
210  ParameterDescription(char const* iLabel,
211  ParameterSetDescription const& psetDesc,
212  bool isTracked) :
213  ParameterDescriptionBase(iLabel, k_VPSet, isTracked, false),
214  psetDesc_(new ParameterSetDescription(psetDesc)),
215  vPset_(),
216  partOfDefaultOfVPSet_(false) {
217  }
218 
220  ~ParameterDescription() { }
221 
224  parameterSetDescription() const {
225  return psetDesc_.operator->();
226  }
227 
230  parameterSetDescription() {
231  return psetDesc_.operator->();
232  }
233 
234  void
236  validate_(ParameterSet& pset,
237  std::set<std::string>& validatedLabels,
238  bool optional) const {
239 
240  bool exists = pset.existsAs<std::vector<ParameterSet> >(label(), isTracked());
241 
242  if (exists) {
243  validatedLabels.insert(label());
244  }
245  else if (pset.existsAs<std::vector<ParameterSet> >(label(), !isTracked())) {
246  throwParameterWrongTrackiness();
247  }
248  else if (pset.exists(label())) {
249  throwParameterWrongType();
250  }
251 
252  if (!exists && !optional) {
253  if (hasDefault()) {
254  if (isTracked()) {
255  pset.addParameter(label(), vPset_);
256  }
257  else {
258  pset.addUntrackedParameter(label(), vPset_);
259  }
260  validatedLabels.insert(label());
261  }
262  else {
263  throwMissingRequiredNoDefault();
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) {
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
292  hasNestedContent_() {
293  return true;
294  }
295 
296  void
298  printNestedContent_(std::ostream& os,
299  bool optional,
300  DocFormatHelper& dfh) {
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 
312  printSpaces(os, indentation + DocFormatHelper::offsetSectionContent());
313  os << "All elements will be validated using the PSet description in Section "
314  << dfh.section() << "." << dfh.counter() << ".1.\n";
315  }
316  else {
317  printSpaces(os, indentation);
318  os << "Section " << dfh.section() << "." << dfh.counter()
319  << " " << " VPSet description for VPSet that is part of the default of a containing VPSet:\n";
320  }
321 
322  printSpaces(os, indentation + DocFormatHelper::offsetSectionContent());
323 
324  unsigned subsectionOffset = 2;
325  if (partOfDefaultOfVPSet_) subsectionOffset = 1;
326 
327  if (hasDefault()) {
328  if (vPset_.size() == 0U) os << "The default VPSet is empty.\n";
329  else if (vPset_.size() == 1U) os << "The default VPSet has 1 element.\n";
330  else os << "The default VPSet has " << vPset_.size() << " elements.\n";
331 
332  if (vPset_.size() > 0U) {
333  for (unsigned i = 0; i < vPset_.size(); ++i) {
334  printSpaces(os, indentation + DocFormatHelper::offsetSectionContent());
335  os << "[" << (i) << "]: see Section " << dfh.section()
336  << "." << dfh.counter() << "." << (i + subsectionOffset) << "\n";
337  }
338  }
339  }
340  else {
341  os << "Does not have a default VPSet.\n";
342  }
343 
344  if (!dfh.brief()) os << "\n";
345 
346  if (!partOfDefaultOfVPSet_) {
347 
348  std::stringstream ss;
349  ss << dfh.section() << "." << dfh.counter() << ".1";
350  std::string newSection = ss.str();
351 
352  printSpaces(os, indentation);
353  os << "Section " << newSection << " description of PSet used to validate elements of VPSet:\n";
354  if (!dfh.brief()) os << "\n";
355 
356  DocFormatHelper new_dfh(dfh);
357  new_dfh.init();
358  new_dfh.setSection(newSection);
359  if (dfh.parent() == DocFormatHelper::TOP) {
360  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
361  }
362  psetDesc_->print(os, new_dfh);
363  }
364 
365  if (hasDefault()) {
366  for (unsigned i = 0; i < vPset_.size(); ++i) {
367 
368  std::stringstream ss;
369  ss << dfh.section() << "." << dfh.counter() << "." << (i + subsectionOffset);
370  std::string newSection = ss.str();
371 
372  printSpaces(os, indentation);
373  os << "Section " << newSection << " PSet description of "
374  << "default VPSet element [" << i << "]\n";
375  if (!dfh.brief()) os << "\n";
376 
377  DocFormatHelper new_dfh(dfh);
378  new_dfh.init();
379  new_dfh.setSection(newSection);
380  if (dfh.parent() == DocFormatHelper::TOP) {
381  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
382  }
383 
384  ParameterSetDescription defaultDescription;
385  fillDescriptionFromPSet(vPset_[i], defaultDescription);
386  defaultDescription.print(os, new_dfh);
387  }
388  }
389  }
390 
391  bool
393  exists_(ParameterSet const& pset) const {
394  return pset.existsAs<std::vector<ParameterSet> >(label(), isTracked());
395  }
396 
397  void
399  writeOneElementToCfi(ParameterSet const& pset,
400  std::ostream& os,
401  int indentation,
402  bool& nextOneStartsWithAComma) {
403  if (nextOneStartsWithAComma) os << ",";
404  nextOneStartsWithAComma = true;
405  os << "\n";
406  printSpaces(os, indentation + 2);
407 
408  os << "cms.PSet(";
409 
410  bool startWithComma = false;
411  int indent = indentation + 4;
412 
413  ParameterSetDescription psetDesc;
414  fillDescriptionFromPSet(pset, psetDesc);
415  psetDesc.writeCfi(os, startWithComma, indent);
416 
417  os << ")";
418  }
419 
420  void
422  writeCfi_(std::ostream& os, int indentation) const {
423  bool nextOneStartsWithAComma = false;
424  for_all(vPset_, boost::bind(&writeOneElementToCfi,
425  _1,
426  boost::ref(os),
427  indentation,
428  boost::ref(nextOneStartsWithAComma)));
429  os << "\n";
430  printSpaces(os, indentation);
431  }
432 
433  void
435  writeDoc_(std::ostream& os, int indentation) const {
436  }
437 
438  // These next two should not be needed for this specialization
439  bool
441  exists_(ParameterSet const& pset, bool isTracked) const {
443  return true;
444  }
445 
446  void
448  insertDefault_(ParameterSet& pset) const {
450  return;
451  }
452 
453  // =================================================================
454 
455  namespace writeParameterValue {
456 
457  template<typename T>
458  void writeSingleValue(std::ostream& os, T const& value, ValueFormat format) {
459  os << value;
460  }
461 
462  // Specialize this for cases where the operator<< does not give
463  // the proper formatting for a configuration file.
464 
465  // Formatting the doubles is a little tricky. It is a requirement
466  // that when a value of ***type double*** is added to a ParameterSetDescription
467  // the EXACT same value of type double will be created and passed to the
468  // ParameterSet after the cfi files have been read. The tricky part
469  // is these values usually appear in the C++ code and cfi file as text
470  // strings (in decimal form). We do our best to force the text
471  // string in the C++ code to be the same as the text string in the
472  // cfi file by judiciously rounding to smaller precision when possible.
473  // But it is not always possible to force the text strings to be the
474  // same. Generally, there are differences when the text string in the
475  // C++ code has many digits (probably more than a human will ever type).
476  // Even in cases where the text strings differ, the values stored in
477  // memory in variables of type double will be exactly the same.
478  // The alternative to the approach here is to store the values as strings,
479  // but that approach was rejected because it would require the
480  // ParameterSetDescription to know how to parse the strings.
481  void formatDouble(double value, std::string& result) {
482  std::stringstream s;
483  s << std::setprecision(17) << value;
484  result = s.str();
485 
486  if (result.size() > 15 && std::string::npos != result.find(".")) {
487  std::stringstream s;
488  s << std::setprecision(15) << value;
489  std::string resultLessPrecision = s.str();
490 
491  if (resultLessPrecision.size() < result.size() - 2) {
492  double test = std::strtod(resultLessPrecision.c_str(), 0);
493  if (test == value) {
494  result = resultLessPrecision;
495  }
496  }
497  }
498  }
499 
500  template<>
501  void writeSingleValue<double>(std::ostream& os, double const& value, ValueFormat format) {
502  std::string sValue;
503  formatDouble(value, sValue);
504  os << sValue;
505  }
506 
507  template<>
508  void writeSingleValue<bool>(std::ostream& os, bool const& value, ValueFormat format) {
509  value ? os << "True" : os << "False";
510  }
511 
512  template<>
513  void writeSingleValue<std::string>(std::ostream& os, std::string const& value, ValueFormat format) {
514  os << "'" << value << "'";
515  }
516 
517  template<>
518  void writeSingleValue<EventID>(std::ostream& os, EventID const& value, ValueFormat format) {
519  if (format == CFI) {
520  os << value.run() << ", " << value.luminosityBlock() << ", " << value.event();
521  } else {
522  if (value.luminosityBlock() == 0U) {
523  os << value.run() << ":" << value.event();
524  } else {
525  os << value.run() << ":" << value.luminosityBlock() << ":" << value.event();
526  }
527  }
528  }
529 
530  template<>
532  if (format == CFI) os << value.run() << ", " << value.luminosityBlock();
533  else os << value.run() << ":" << value.luminosityBlock();
534  }
535 
536  template<>
538  if (value.startLumi() == 0U) {
539  if (format == CFI) os << "'" << value.startRun() << ":" << value.startEvent() << "-"
540  << value.endRun() << ":" << value.endEvent() << "'";
541  else os << value.startRun() << ":" << value.startEvent() << "-"
542  << value.endRun() << ":" << value.endEvent();
543  } else {
544  if (format == CFI) os << "'" << value.startRun() << ":" << value.startLumi() << ":" << value.startEvent() << "-"
545  << value.endRun() << ":" << value.endLumi() << ":" << value.endEvent() << "'";
546  else os << value.startRun() << ":" << value.startLumi() << ":" << value.startEvent() << "-"
547  << value.endRun() << ":" << value.endLumi() << ":" << value.endEvent();
548  }
549  }
550 
551  template<>
553  if (format == CFI) os << "'" << value.startRun() << ":" << value.startLumi() << "-"
554  << value.endRun() << ":" << value.endLumi() << "'";
555  else os << value.startRun() << ":" << value.startLumi() << "-"
556  << value.endRun() << ":" << value.endLumi();
557  }
558 
559  template<>
560  void writeSingleValue<InputTag>(std::ostream& os, InputTag const& value, ValueFormat format) {
561  if (format == CFI) {
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  }
570  else {
571  os << "'" << value.label();
572  if (!value.instance().empty() || !value.process().empty()) {
573  os << ":" << value.instance();
574  }
575  if (!value.process().empty()) {
576  os << ":" << value.process();
577  }
578  os << "'";
579  }
580  }
581 
582  template<>
584  os << "'" << value.relativePath() << "'";
585  }
586 
587  template<typename T>
588  void writeValue(std::ostream& os, T const& value_, ValueFormat format) {
589  std::ios_base::fmtflags ff = os.flags(std::ios_base::dec);
590  os.width(0);
591  writeSingleValue<T>(os, value_, format);
592  os.flags(ff);
593  }
594 
595  template<typename T>
596  void writeValueInVector(std::ostream& os, T const& value, ValueFormat format) {
597  writeSingleValue<T>(os, value, format);
598  }
599 
600  // Specializations for cases where we write the single values into
601  // vectors differently than when there is only one not in a vector.
602  template<>
603  void writeValueInVector<EventID>(std::ostream& os, EventID const& value, ValueFormat format) {
604  if (value.luminosityBlock() == 0U) {
605  if (format == CFI) os << "'" << value.run() << ":" << value.event() << "'";
606  else os << value.run() << ":" << value.event();
607  } else {
608  if (format == CFI) os << "'" << value.run() << ":" << value.luminosityBlock() << ":" << value.event() << "'";
609  else os << value.run() << ":" << value.luminosityBlock() << ":" << value.event();
610  }
611  }
612 
613  template<>
615  if (format == CFI) os << "'" << value.run() << ":" << value.luminosityBlock() << "'";
616  else os << value.run() << ":" << value.luminosityBlock();
617  }
618 
619  template<>
621  os << "'" << value.label();
622  if (!value.instance().empty() || !value.process().empty()) {
623  os << ":" << value.instance();
624  }
625  if (!value.process().empty()) {
626  os << ":" << value.process();
627  }
628  os << "'";
629  }
630 
631  template<typename T>
633  std::ostream& os,
634  int indentation,
635  bool& startWithComma,
637  int& i) {
638  if (startWithComma && format == CFI) os << ",";
639  startWithComma = true;
640  os << "\n" << std::setw(indentation) << "";
641  if (format == DOC) os << "[" << i << "]: ";
642  writeValueInVector<T>(os, value, format);
643  ++i;
644  }
645 
646  template<typename T>
647  void writeVector(std::ostream& os, int indentation, std::vector<T> const& value_, ValueFormat format) {
648  std::ios_base::fmtflags ff = os.flags(std::ios_base::dec);
649  char oldFill = os.fill();
650  os.width(0);
651  if (value_.size() == 0U && format == DOC) {
652  os << "empty";
653  }
654  else if (value_.size() == 1U && format == CFI) {
655  writeValueInVector<T>(os, value_[0], format);
656  }
657  else if (value_.size() >= 1U) {
658  if (format == DOC) os << "(vector size = " << value_.size() << ")";
659  os.fill(' ');
660  bool startWithComma = false;
661  int i = 0;
662  for_all(value_, boost::bind(&writeValueInVectorWithSpace<T>,
663  _1,
664  boost::ref(os),
665  indentation + 2,
666  boost::ref(startWithComma),
667  format,
668  boost::ref(i)));
669  if (format == CFI) os << "\n" << std::setw(indentation) << "";
670  }
671  os.flags(ff);
672  os.fill(oldFill);
673  }
674 
675  void writeValue(std::ostream& os, int indentation, int const& value_, ValueFormat format) {
676  writeValue<int>(os, value_, format);
677  }
678 
679  void writeValue(std::ostream& os, int indentation, std::vector<int> const& value_, ValueFormat format) {
680  writeVector<int>(os, indentation, value_, format);
681  }
682 
683  void writeValue(std::ostream& os, int indentation, unsigned const& value_, ValueFormat format) {
684  writeValue<unsigned>(os, value_, format);
685  }
686 
687  void writeValue(std::ostream& os, int indentation, std::vector<unsigned> const& value_, ValueFormat format) {
688  writeVector<unsigned>(os, indentation, value_, format);
689  }
690 
691  void writeValue(std::ostream& os, int indentation, long long const& value_, ValueFormat format) {
692  writeValue<long long>(os, value_, format);
693  }
694 
695  void writeValue(std::ostream& os, int indentation, std::vector<long long> const& value_, ValueFormat format) {
696  writeVector<long long>(os, indentation, value_, format);
697  }
698 
699  void writeValue(std::ostream& os, int indentation, unsigned long long const& value_, ValueFormat format) {
700  writeValue<unsigned long long>(os, value_, format);
701  }
702 
703  void writeValue(std::ostream& os, int indentation, std::vector<unsigned long long> const& value_, ValueFormat format) {
704  writeVector<unsigned long long>(os, indentation, value_, format);
705  }
706 
707  void writeValue(std::ostream& os, int indentation, double const& value_, ValueFormat format) {
708  writeValue<double>(os, value_, format);
709  }
710 
711  void writeValue(std::ostream& os, int indentation, std::vector<double> const& value_, ValueFormat format) {
712  writeVector<double>(os, indentation, value_, format);
713  }
714 
715  void writeValue(std::ostream& os, int indentation, bool const& value_, ValueFormat format) {
716  writeValue<bool>(os, value_, format);
717  }
718 
719  void writeValue(std::ostream& os, int indentation, std::string const& value_, ValueFormat format) {
720  writeValue<std::string>(os, value_, format);
721  }
722 
723  void writeValue(std::ostream& os, int indentation, std::vector<std::string> const& value_, ValueFormat format) {
724  writeVector<std::string>(os, indentation, value_, format);
725  }
726 
727  void writeValue(std::ostream& os, int indentation, EventID const& value_, ValueFormat format) {
728  writeValue<EventID>(os, value_, format);
729  }
730 
731  void writeValue(std::ostream& os, int indentation, std::vector<EventID> const& value_, ValueFormat format) {
732  writeVector<EventID>(os, indentation, value_, format);
733  }
734 
735  void writeValue(std::ostream& os, int indentation, LuminosityBlockID const& value_, ValueFormat format) {
736  writeValue<LuminosityBlockID>(os, value_, format);
737  }
738 
739  void writeValue(std::ostream& os, int indentation, std::vector<LuminosityBlockID> const& value_, ValueFormat format) {
740  writeVector<LuminosityBlockID>(os, indentation, value_, format);
741  }
742 
743  void writeValue(std::ostream& os, int indentation, LuminosityBlockRange const& value_, ValueFormat format) {
744  writeValue<LuminosityBlockRange>(os, value_, format);
745  }
746 
747  void writeValue(std::ostream& os, int indentation, std::vector<LuminosityBlockRange> const& value_, ValueFormat format) {
748  writeVector<LuminosityBlockRange>(os, indentation, value_, format);
749  }
750 
751  void writeValue(std::ostream& os, int indentation, EventRange const& value_, ValueFormat format) {
752  writeValue<EventRange>(os, value_, format);
753  }
754 
755  void writeValue(std::ostream& os, int indentation, std::vector<EventRange> const& value_, ValueFormat format) {
756  writeVector<EventRange>(os, indentation, value_, format);
757  }
758 
759  void writeValue(std::ostream& os, int indentation, InputTag const& value_, ValueFormat format) {
760  writeValue<InputTag>(os, value_, format);
761  }
762 
763  void writeValue(std::ostream& os, int indentation, std::vector<InputTag> const& value_, ValueFormat format) {
764  writeVector<InputTag>(os, indentation, value_, format);
765  }
766 
767  void writeValue(std::ostream& os, int indentation, FileInPath const& value_, ValueFormat format) {
768  writeValue<FileInPath>(os, value_, format);
769  }
770 
771  bool hasNestedContent(int const& value) { return false; }
772  bool hasNestedContent(std::vector<int> const& value) { return value.size() > 5U; }
773  bool hasNestedContent(unsigned const& value) { return false; }
774  bool hasNestedContent(std::vector<unsigned> const& value) { return value.size() > 5U; }
775  bool hasNestedContent(long long const& value) { return false; }
776  bool hasNestedContent(std::vector<long long> const& value) { return value.size() > 5U; }
777  bool hasNestedContent(unsigned long long const& value) { return false; }
778  bool hasNestedContent(std::vector<unsigned long long> const& value) { return value.size() > 5U; }
779  bool hasNestedContent(double const& value) { return false; }
780  bool hasNestedContent(std::vector<double> const& value) { return value.size() > 5U; }
781  bool hasNestedContent(bool const& value) { return false; }
782  bool hasNestedContent(std::string const& value) { return false; }
783  bool hasNestedContent(std::vector<std::string> const& value) { return value.size() > 5U; }
784  bool hasNestedContent(EventID const& value) { return false; }
785  bool hasNestedContent(std::vector<EventID> const& value) { return value.size() > 5U; }
786  bool hasNestedContent(LuminosityBlockID const& value) { return false; }
787  bool hasNestedContent(std::vector<LuminosityBlockID> const& value) { return value.size() > 5U; }
788  bool hasNestedContent(LuminosityBlockRange const& value) { return false; }
789  bool hasNestedContent(std::vector<LuminosityBlockRange> const& value) { return value.size() > 5U; }
790  bool hasNestedContent(EventRange const& value) { return false; }
791  bool hasNestedContent(std::vector<EventRange> const& value) { return value.size() > 5U; }
792  bool hasNestedContent(InputTag const& value) { return false; }
793  bool hasNestedContent(std::vector<InputTag> const& value) { return value.size() > 5U; }
794  bool hasNestedContent(FileInPath const& value) { return false; }
795  }
796 }
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:180
const std::string & label
Definition: MVAComputer.cc:186
virtual bool exists_(ParameterSet const &pset) const
void writeSingleValue< double >(std::ostream &os, double const &value, ValueFormat format)
void writeSingleValue< FileInPath >(std::ostream &os, FileInPath const &value, ValueFormat format)
bool exists(std::string const &parameterName) const
checks if a parameter exists
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)
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< bool >(std::ostream &os, bool const &value, ValueFormat format)
void writeSingleValue< EventID >(std::ostream &os, EventID const &value, ValueFormat format)
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:138
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()
tuple pset
Definition: CrabTask.py:85
virtual void insertDefault_(ParameterSet &pset) const
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 writeSingleValue(std::ostream &os, T const &value, ValueFormat format)
void writeValueInVector< LuminosityBlockID >(std::ostream &os, LuminosityBlockID const &value, ValueFormat format)
void writeValueInVector< InputTag >(std::ostream &os, InputTag const &value, ValueFormat format)
tuple ff
Definition: createTree.py:204
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:202
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)
string s
Definition: asciidump.py:422
bool hasNestedContent(int const &value)
void setSection(std::string const &value)
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