/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeFileConverter.cc
69 строк
3 KB
mmusich
some logging improvements to Alignment/MillePedeAlignmentAlgorithm plugins
17 янв 2024, 01:05
17 янв 2024, 01:05
e0abb7a
Код
Авторство
О чём код?
// Original Author: Broen van Besien // Created: Thu, 19 Mar 2015 18:12:35 GMT #include "Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeFileConverter.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CondFormats/Common/interface/FileBlobCollection.h" #include <memory> #include <fstream> MillePedeFileConverter::MillePedeFileConverter(const edm::ParameterSet& iConfig) : inputDir_(iConfig.getParameter<std::string>("fileDir")), inputFileName_(iConfig.getParameter<std::string>("inputBinaryFile")), fileBlobLabel_(iConfig.getParameter<std::string>("fileBlobLabel")) { // We define what this producer produces: A FileBlobCollection produces<FileBlobCollection, edm::Transition::EndLuminosityBlock>(fileBlobLabel_); } void MillePedeFileConverter::endLuminosityBlockProduce(edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) { auto const& moduleType = moduleDescription().moduleName(); auto const& moduleLabel = moduleDescription().moduleLabel(); edm::LogInfo("MillePedeFileActions") << "Inserting all data from file " << inputDir_ + inputFileName_ << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_ << "\"."; // Preparing the FileBlobCollection: auto fileBlobCollection = std::make_unique<FileBlobCollection>(); // Creating the FileBlob: // (The FileBlob will signal problems with the file itself.) FileBlob fileBlob{inputDir_ + inputFileName_, true}; if (fileBlob.size() > 0) { // skip if no data or FileBlob file not found // Adding the FileBlob to the lumi: fileBlobCollection->addFileBlob(fileBlob); edm::LogInfo(moduleType) << "[" << moduleLabel << "] fileBlob size was not empty, putting file blob with size " << fileBlob.size() << std::endl; } edm::LogInfo(moduleType) << "[" << moduleLabel << "]" << " Root file contains " << fileBlobCollection->size() << " FileBlob(s)."; iLumi.put(std::move(fileBlobCollection), fileBlobLabel_); } // Manage the parameters for the module: // (Note that this will autogenerate the _cfi.py file.) void MillePedeFileConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<std::string>("fileDir", "") ->setComment( "Keep the fileDir empty if you want to write to the current " "directory. If you use it, it should end with a slash."); desc.add<std::string>("inputBinaryFile", "milleBinary.dat") ->setComment("Filename of the file created by Mille in the AlignmentProducer"); desc.add<std::string>("fileBlobLabel", "milleBinary.dat") ->setComment( "It's probably a good idea to keep the label the same as the " "original filename(s). See configuration of " "MillePedeFileExtractor, it should be the same there."); descriptions.add("millePedeFileConverter", desc); descriptions.setComment( "This is the generic cfi file for the " "MillePedeFileConverter"); }