File indexing completed on 2024-04-06 12:12:35
0001
0002 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004
0005 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0006 #include "FWCore/ParameterSet/interface/ParameterDescription.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0008
0009 #include <string>
0010
0011 namespace edmtest {
0012
0013 class TestDescriptionComments : public edm::global::EDAnalyzer<> {
0014 public:
0015 explicit TestDescriptionComments(edm::ParameterSet const&) {}
0016
0017 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0018
0019 void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const final {}
0020 };
0021
0022 void TestDescriptionComments::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0023 edm::ParameterSetDescription nestedDesc;
0024 nestedDesc.add<int>("x", 1);
0025
0026 std::vector<edm::ParameterSet> vectorOfPSets;
0027
0028 edm::ParameterSetDescription desc;
0029 desc.ifValue(
0030 edm::ParameterDescription<std::string>("sswitch", "b", true, edm::Comment("test1")),
0031 "a" >> edm::ParameterDescription<int>(std::string("x"), 100, true, edm::Comment("test2")) or
0032 "b" >> (edm::ParameterDescription<double>("y1", true, edm::Comment("test3")) and
0033 edm::ParameterDescription<double>(std::string("y2"), true, edm::Comment(std::string("test4")))) or
0034 "c" >> edm::ParameterDescription<std::string>("z", "102", true) or
0035 "d" >> edm::ParameterDescription<edm::ParameterSetDescription>(
0036 "nested1", nestedDesc, true, edm::Comment(std::string("test5"))) or
0037 "e" >> edm::ParameterDescription<edm::ParameterSetDescription>(
0038 std::string("nested2"), nestedDesc, true, edm::Comment(std::string("test6"))) or
0039 "f" >> edm::ParameterDescription<std::vector<edm::ParameterSet> >(
0040 "vpset1", nestedDesc, true, vectorOfPSets, edm::Comment("test7")) or
0041 "g" >> edm::ParameterDescription<std::vector<edm::ParameterSet> >(
0042 std::string("vpset2"), nestedDesc, true, vectorOfPSets, edm::Comment("test8")) or
0043 "h" >> edm::ParameterDescription<std::vector<edm::ParameterSet> >(
0044 "vpset3", nestedDesc, true, edm::Comment("test9")) or
0045 "i" >> edm::ParameterDescription<std::vector<edm::ParameterSet> >(
0046 std::string("vpset4"), nestedDesc, true, edm::Comment("test10")));
0047 descriptions.add("test", desc);
0048 }
0049 }
0050 using edmtest::TestDescriptionComments;
0051 DEFINE_FWK_MODULE(TestDescriptionComments);