CMS 3D CMS Logo

AllowedLabelsDescription.cc
Go to the documentation of this file.
1 
5 
6 #include <cassert>
7 
8 namespace edm {
9 
11  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_() {}
12 
14  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_() {}
15 
18  bool isTracked)
19  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_(new ParameterSetDescription(value)) {}
20 
23  bool isTracked)
24  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_(new ParameterSetDescription(value)) {}
25 
27 
29  return new AllowedLabelsDescription(*this);
30  }
31 
33  bool optional,
34  DocFormatHelper& dfh) const {
36 
37  int indentation = dfh.indentation();
38  if (dfh.parent() != DocFormatHelper::TOP) {
40  }
41 
42  std::stringstream ss;
43  ss << dfh.section() << "." << dfh.counter() << ".1";
44  std::string newSection = ss.str();
45 
46  if (dfh.brief()) {
48  } else {
49  dfh.indent2(os);
50  }
51  os << "see Section " << newSection << "\n";
52  if (!dfh.brief())
53  os << "\n";
54 
56  os << "Section " << newSection << " PSet description:\n";
57  if (!dfh.brief())
58  os << "\n";
59 
60  DocFormatHelper new_dfh(dfh);
61  new_dfh.setSection(newSection);
64 
65  psetDesc_->print(os, new_dfh);
66  }
67 
69  std::string const& allowedLabel, ParameterSet& pset, std::set<std::string>& validatedLabels) const {
70  if (pset.existsAs<ParameterSet>(allowedLabel, isTracked())) {
71  validatedLabels.insert(allowedLabel);
72  if (psetDesc_) {
73  ParameterSet* containedPSet = pset.getPSetForUpdate(allowedLabel);
74  psetDesc_->validate(*containedPSet);
75  }
76  }
77  }
78 
79  // -----------------------------------------------------------------------
80 
82  bool isTracked)
83  : AllowedLabelsDescriptionBase(label, k_VPSet, isTracked), psetDesc_() {}
84 
86  : AllowedLabelsDescriptionBase(label, k_VPSet, isTracked), psetDesc_() {}
87 
90  bool isTracked)
92 
95  bool isTracked)
97 
98  AllowedLabelsDescription<std::vector<ParameterSet> >::~AllowedLabelsDescription() {}
99 
101  return new AllowedLabelsDescription(*this);
102  }
103 
104  void AllowedLabelsDescription<std::vector<ParameterSet> >::printNestedContent_(std::ostream& os,
105  bool optional,
106  DocFormatHelper& dfh) const {
107  printNestedContentBase_(os, optional, dfh);
108 
109  int indentation = dfh.indentation();
110  if (dfh.parent() != DocFormatHelper::TOP) {
112  }
113 
114  std::stringstream ss;
115  ss << dfh.section() << "." << dfh.counter() << ".1";
116  std::string newSection = ss.str();
117 
118  if (dfh.brief()) {
120  } else {
121  dfh.indent2(os);
122  }
123  os << "see Section " << newSection << "\n";
124  if (!dfh.brief())
125  os << "\n";
126 
127  printSpaces(os, indentation);
128  os << "Section " << newSection << " PSet description used to validate all elements of VPSet's:\n";
129  if (!dfh.brief())
130  os << "\n";
131 
132  DocFormatHelper new_dfh(dfh);
133  new_dfh.setSection(newSection);
136 
137  psetDesc_->print(os, new_dfh);
138  }
139 
141  std::string const& allowedLabel, ParameterSet& pset, std::set<std::string>& validatedLabels) const {
142  if (pset.existsAs<std::vector<ParameterSet> >(allowedLabel, isTracked())) {
143  validatedLabels.insert(allowedLabel);
144 
145  if (psetDesc_) {
146  VParameterSetEntry* vpsetEntry = pset.getPSetVectorForUpdate(allowedLabel);
147  assert(vpsetEntry);
148  for (unsigned i = 0; i < vpsetEntry->size(); ++i) {
149  psetDesc_->validate(vpsetEntry->psetInVector(i));
150  }
151  }
152  }
153  }
154 } // namespace edm
edm::AllowedLabelsDescription::validateAllowedLabel_
void validateAllowedLabel_(std::string const &allowedLabel, ParameterSet &pset, std::set< std::string > &validatedLabels) const override
Definition: AllowedLabelsDescription.h:36
edm::DocFormatHelper::TOP
Definition: DocFormatHelper.h:17
mps_fire.i
i
Definition: mps_fire.py:355
edm::AllowedLabelsDescriptionBase
Definition: AllowedLabelsDescriptionBase.h:16
edm::VParameterSetEntry::size
std::vector< ParameterSet >::size_type size() const
Definition: VParameterSetEntry.cc:105
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::DocFormatHelper::setSection
void setSection(std::string const &value)
Definition: DocFormatHelper.h:44
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
Types.optional
optional
Definition: Types.py:167
edm::VParameterSetEntry::psetInVector
ParameterSet & psetInVector(int i)
Definition: VParameterSetEntry.cc:100
cms::cuda::assert
assert(be >=bs)
edm::DocFormatHelper::parent
DescriptionParent parent() const
Definition: DocFormatHelper.h:71
edm::AllowedLabelsDescription::~AllowedLabelsDescription
~AllowedLabelsDescription() override
Definition: AllowedLabelsDescription.h:31
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
edm::DocFormatHelper
Definition: DocFormatHelper.h:15
edm::AllowedLabelsDescriptionBase::printNestedContentBase_
void printNestedContentBase_(std::ostream &os, bool optional, DocFormatHelper &dfh) const
Definition: AllowedLabelsDescriptionBase.cc:103
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
edm::AllowedLabelsDescriptionBase::isTracked
bool isTracked() const
Definition: AllowedLabelsDescriptionBase.h:21
edm::AllowedLabelsDescriptionBase::printNestedContent_
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
Definition: AllowedLabelsDescriptionBase.cc:97
edm::AllowedLabelsDescription::clone
ParameterDescriptionNode * clone() const override
Definition: AllowedLabelsDescription.h:33
VParameterSetEntry.h
ParameterSetDescription.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
edm::DocFormatHelper::brief
bool brief() const
Definition: DocFormatHelper.h:34
AllowedLabelsDescription.h
edm::DocFormatHelper::setParent
void setParent(DescriptionParent value)
Definition: DocFormatHelper.h:72
edm::DocFormatHelper::setIndentation
void setIndentation(int value)
Definition: DocFormatHelper.h:41
value
Definition: value.py:1
edm::AllowedLabelsDescription
Definition: AllowedLabelsDescription.h:23
edm::k_PSet
Definition: ParameterDescriptionNode.h:60
edm::AllowedLabelsDescription::AllowedLabelsDescription
AllowedLabelsDescription(std::string const &label, bool isTracked)
Definition: AllowedLabelsDescription.h:25
edm::DocFormatHelper::indent2
void indent2(std::ostream &os) const
Definition: DocFormatHelper.cc:139
edm::ParameterDescriptionNode::printSpaces
static void printSpaces(std::ostream &os, int n)
Definition: ParameterDescriptionNode.cc:124
edm::DocFormatHelper::counter
int counter() const
Definition: DocFormatHelper.h:66
edm::DocFormatHelper::offsetSectionContent
static int offsetSectionContent()
Definition: DocFormatHelper.h:83
edm::VParameterSetEntry
Definition: VParameterSetEntry.h:24
printContent_cfi.indentation
indentation
Definition: printContent_cfi.py:10
edm::DocFormatHelper::section
std::string const & section() const
Definition: DocFormatHelper.h:43
edm::DocFormatHelper::OTHER
Definition: DocFormatHelper.h:17
edm::ParameterDescriptionNode
Definition: ParameterDescriptionNode.h:82
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::DocFormatHelper::indentation
int indentation() const
Definition: DocFormatHelper.h:36
edm::k_VPSet
Definition: ParameterDescriptionNode.h:61