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  LogWarning("IllegalCall")
35  << "EDInputSource::setRun()\n"
36  << "Run number cannot be modified for an EDInputSource\n";
37  }
38 
39  void
41  LogWarning("IllegalCall")
42  << "EDInputSource::setLumi()\n"
43  << "Luminosity Block ID cannot be modified for an EDInputSource\n";
44  }
45 
46  void
48  std::vector<std::string> defaultStrings;
49  desc.addUntracked<std::vector<std::string> >("fileNames")
50  ->setComment("Names of files to be processed.");
51  desc.addUntracked<std::vector<std::string> >("secondaryFileNames", defaultStrings)
52  ->setComment("Names of secondary files to be processed.");
53  desc.addUntracked<bool>("needSecondaryFileNames", false)
54  ->setComment("If True, 'secondaryFileNames' must be specified and be non-empty.");
55  desc.addUntracked<std::string>("overrideCatalog", std::string());
57  }
58 }
T getUntrackedParameter(std::string const &, T const &) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillDescription(ParameterSetDescription &desc)
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
EDInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
virtual void setLumi(LuminosityBlockNumber_t lb)
InputFileCatalog secondaryCatalog_
Definition: EDInputSource.h:42
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:129
virtual void setRun(RunNumber_t)
unsigned int RunNumber_t
Definition: EventRange.h:32
virtual ~EDInputSource()