5 #include <boost/regex.hpp>
31 static std::pair<std::vector<std::string>,
unsigned int>
34 unsigned int articleId = params.
getParameter<
unsigned int>(
"articleID");
37 <<
"Reading article id " << articleId <<
" from MCDB."
42 mcdb::Article article = mcdb.getArticle(articleId);
45 <<
"Title: " << article.title() << std::endl
46 <<
"First author: " << article.authors()[0].firstName() <<
" "
47 << article.authors()[0].lastName() << std::endl
48 <<
"Number of authors: " << article.authors().size() << std::endl
49 <<
"Abstract: " << article.abstract() << std::endl
50 <<
"Generator: " << article.generator().name()
51 <<
", " << article.generator().version() << std::endl
52 <<
"Number of files: " << article.files().size() << std::endl
53 <<
"Files: " << std::endl;
55 std::vector<std::string> supportedProtocols =
57 "supportedProtocols");
60 "filter",
"\\.lhef?$"),
61 boost::regex_constants::normal |
62 boost::regex_constants::icase);
67 std::vector<std::string> fileURLs;
68 for(std::vector<mcdb::File>::iterator
file = article.files().begin();
69 file != article.files().end(); ++
file) {
71 for(std::vector<std::string>::const_iterator prot =
72 supportedProtocols.begin();
73 prot != supportedProtocols.end(); ++prot) {
74 for(std::vector<std::string>::const_iterator
path =
75 file->paths().begin();
77 if (
path->substr(0, prot->length() + 1) ==
89 <<
"MCDB did not contain any URLs with"
90 " supported protocols for at least one"
91 " file." << std::endl;
93 if (!boost::regex_search(fileURL, filter))
97 if (nEvents > 0 && (
int)firstEvent >= nEvents) {
102 fileURLs.push_back(fileURL);
105 return std::make_pair(fileURLs, firstEvent);
116 std::pair<std::vector<std::string>,
unsigned int>
result =
121 "fileNames", result.first);
123 "skipEvents", result.second);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MCDBSource(const edm::ParameterSet ¶ms, const edm::InputSourceDescription &desc)
static std::pair< std::vector< std::string >, unsigned int > getFileURLs(const edm::ParameterSet ¶ms)
static edm::ParameterSet augmentPSetFromMCDB(const edm::ParameterSet ¶ms)
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
void addUntrackedParameter(std::string const &name, T const &value)