Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Riley authored and Dan Riley committed Aug 5, 2019
1 parent 5451686 commit 6337dab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion IOPool/Streamer/interface/StreamerInputFile.h
Expand Up @@ -19,7 +19,8 @@ namespace edm {
class StreamerInputFile {
public:
/**Reads a Streamer file */
explicit StreamerInputFile(std::string const& name, std::string const& LFN,
explicit StreamerInputFile(std::string const& name,
std::string const& LFN,
std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
explicit StreamerInputFile(std::string const& name,
std::shared_ptr<EventSkipperByID> eventSkipperByID = std::shared_ptr<EventSkipperByID>());
Expand Down
5 changes: 2 additions & 3 deletions IOPool/Streamer/src/StreamerFileReader.cc
Expand Up @@ -28,9 +28,8 @@ namespace edm {
if (streamerNames_.size() > 1) {
streamReader_ = std::make_unique<StreamerInputFile>(streamerNames_, eventSkipperByID());
} else if (streamerNames_.size() == 1) {
streamReader_ = std::make_unique<StreamerInputFile>(streamerNames_.at(0).fileName(),
streamerNames_.at(0).logicalFileName(),
eventSkipperByID());
streamReader_ = std::make_unique<StreamerInputFile>(
streamerNames_.at(0).fileName(), streamerNames_.at(0).logicalFileName(), eventSkipperByID());
} else {
throw Exception(errors::FileReadError, "StreamerFileReader::StreamerFileReader")
<< "No fileNames were specified\n";
Expand Down
13 changes: 5 additions & 8 deletions IOPool/Streamer/src/StreamerInputFile.cc
Expand Up @@ -40,11 +40,9 @@ namespace edm {
readStartMessage();
}

StreamerInputFile::StreamerInputFile(std::string const& name,
std::shared_ptr<EventSkipperByID> eventSkipperByID)
StreamerInputFile::StreamerInputFile(std::string const& name, std::shared_ptr<EventSkipperByID> eventSkipperByID)
: StreamerInputFile(name, name, eventSkipperByID) {}


StreamerInputFile::StreamerInputFile(std::vector<FileCatalogItem> const& names,
std::shared_ptr<EventSkipperByID> eventSkipperByID)
: startMsg_(),
Expand Down Expand Up @@ -74,16 +72,15 @@ namespace edm {
currentFileName_ = name;

// Check if the logical file name was found.
if(currentFileName_.empty()) {
if (currentFileName_.empty()) {
// LFN not found in catalog.
throw cms::Exception("LogicalFileNameNotFound", "StreamerInputFile::openStreamerFile()\n")
<< "Logical file name '" << LFN << "' was not found in the file catalog.\n"
<< "If you wanted a local file, you forgot the 'file:' prefix\n"
<< "before the file name in your configuration file.\n";
<< "Logical file name '" << LFN << "' was not found in the file catalog.\n"
<< "If you wanted a local file, you forgot the 'file:' prefix\n"
<< "before the file name in your configuration file.\n";
return;
}


logFileAction(" Initiating request to open file ");

IOOffset size = -1;
Expand Down
9 changes: 6 additions & 3 deletions IOPool/Streamer/test/ReadStreamerFile.cpp
Expand Up @@ -71,7 +71,8 @@ int readSingleStream(bool verbose) {

int readMultipleStreams(bool verbose) {
try {
std::unique_ptr<edm::SiteLocalConfig> slcptr = std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
std::unique_ptr<edm::SiteLocalConfig> slcptr =
std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
edm::ServiceToken slcToken = edm::ServiceRegistry::createContaining(slc);
edm::ServiceRegistry::Operate operate(slcToken);
Expand Down Expand Up @@ -119,7 +120,8 @@ int readMultipleStreams(bool verbose) {

int readInvalidLFN(bool verbose) {
try {
std::unique_ptr<edm::SiteLocalConfig> slcptr = std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
std::unique_ptr<edm::SiteLocalConfig> slcptr =
std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig> >(std::move(slcptr));
edm::ServiceToken slcToken = edm::ServiceRegistry::createContaining(slc);
edm::ServiceRegistry::Operate operate(slcToken);
Expand Down Expand Up @@ -159,7 +161,8 @@ int readInvalidLFN(bool verbose) {
std::cout << " TOTAL Events Read: " << evCount << std::endl;
} catch (cms::Exception& e) {
std::cerr << "Exception caught: " << e.what() << std::endl;
if (e.category() == "LogicalFileNameNotFound") return 0;
if (e.category() == "LogicalFileNameNotFound")
return 0;
}
return 1;
}
Expand Down

0 comments on commit 6337dab

Please sign in to comment.