CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDInputSource.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 ----------------------------------------------------------------------*/
3 
9 
10 namespace edm {
11 
12  // The default value provided as the second argument to the getUntrackedParameter function call
13  // is not used when the ParameterSet has been validated and the parameters are not optional
14  // in the description. As soon as all primary input sources and all modules with a secondary
15  // input sources have defined descriptions, the defaults in the getUntrackedParameterSet function
16  // calls can and should be deleted from the code.
18  InputSource(pset, desc),
19  catalog_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames"),
20  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
21  secondaryCatalog_(pset.getUntrackedParameter<std::vector<std::string> >("secondaryFileNames", std::vector<std::string>()),
22  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())) {
23 
24  if (secondaryCatalog_.empty() && pset.getUntrackedParameter<bool>("needSecondaryFileNames", false)) {
25  throw Exception(errors::Configuration, "EDInputSource") << "'secondaryFileNames' must be specified\n";
26  }
27  }
28 
30  }
31 
32  void
34  std::vector<std::string> defaultStrings;
35  desc.addUntracked<std::vector<std::string> >("fileNames")
36  ->setComment("Names of files to be processed.");
37  desc.addUntracked<std::vector<std::string> >("secondaryFileNames", defaultStrings)
38  ->setComment("Names of secondary files to be processed.");
39  desc.addUntracked<bool>("needSecondaryFileNames", false)
40  ->setComment("If True, 'secondaryFileNames' must be specified and be non-empty.");
41  desc.addUntracked<std::string>("overrideCatalog", std::string());
43  }
44 }
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescription(ParameterSetDescription &desc)
EDInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
InputFileCatalog secondaryCatalog_
Definition: EDInputSource.h:39
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:135
virtual ~EDInputSource()