CMS 3D CMS Logo

MillePedeFileConverter.cc
Go to the documentation of this file.
1 // Original Author: Broen van Besien
2 // Created: Thu, 19 Mar 2015 18:12:35 GMT
3 
6 
9 
10 #include <memory>
11 #include <fstream>
12 
14  : inputDir_(iConfig.getParameter<std::string>("fileDir")),
15  inputFileName_(iConfig.getParameter<std::string>("inputBinaryFile")),
16  fileBlobLabel_(iConfig.getParameter<std::string>("fileBlobLabel")) {
17  // We define what this producer produces: A FileBlobCollection
18  produces<FileBlobCollection, edm::Transition::EndLuminosityBlock>(fileBlobLabel_);
19 }
20 
22 
24  edm::LogInfo("MillePedeFileActions") << "Inserting all data from file " << inputDir_ + inputFileName_
25  << " as a FileBlob to the lumi, using label \"" << fileBlobLabel_ << "\".";
26  // Preparing the FileBlobCollection:
27  auto fileBlobCollection = std::make_unique<FileBlobCollection>();
28 
29  // Creating the FileBlob:
30  // (The FileBlob will signal problems with the file itself.)
31  FileBlob fileBlob{inputDir_ + inputFileName_, true};
32 
33  if (fileBlob.size() > 0) { // skip if no data or FileBlob file not found
34  // Adding the FileBlob to the lumi:
35  fileBlobCollection->addFileBlob(fileBlob);
36  }
37  iLumi.put(std::move(fileBlobCollection), fileBlobLabel_);
38 }
39 
40 // Manage the parameters for the module:
41 // (Note that this will autogenerate the _cfi.py file.)
44 
45  desc.add<std::string>("fileDir", "")
46  ->setComment(
47  "Keep the fileDir empty if you want to write to the current "
48  "directory. If you use it, it should end with a slash.");
49 
50  desc.add<std::string>("inputBinaryFile", "milleBinary.dat")
51  ->setComment("Filename of the file created by Mille in the AlignmentProducer");
52 
53  desc.add<std::string>("fileBlobLabel", "milleBinary.dat")
54  ->setComment(
55  "It's probably a good idea to keep the label the same as the "
56  "original filename(s). See configuration of "
57  "MillePedeFileExtractor, it should be the same there.");
58 
59  descriptions.add("millePedeFileConverter", desc);
60  descriptions.setComment(
61  "This is the generic cfi file for the "
62  "MillePedeFileConverter");
63 }
FileBlobCollection.h
MessageLogger.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
LuminosityBlock.h
MillePedeFileConverter::inputDir_
const std::string inputDir_
Definition: MillePedeFileConverter.h:38
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MillePedeFileConverter::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: MillePedeFileConverter.cc:42
MillePedeFileConverter.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
MillePedeFileConverter::fileBlobLabel_
const std::string fileBlobLabel_
Definition: MillePedeFileConverter.h:40
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
edm::EventSetup
Definition: EventSetup.h:57
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: LuminosityBlock.h:116
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
MillePedeFileConverter::~MillePedeFileConverter
~MillePedeFileConverter() override
Definition: MillePedeFileConverter.cc:21
MillePedeFileConverter::MillePedeFileConverter
MillePedeFileConverter(const edm::ParameterSet &)
Definition: MillePedeFileConverter.cc:13
MillePedeFileConverter::endLuminosityBlockProduce
void endLuminosityBlockProduce(edm::LuminosityBlock &, const edm::EventSetup &) final
Definition: MillePedeFileConverter.cc:23
FileBlob
Definition: FileBlob.h:10
MillePedeFileConverter::inputFileName_
const std::string inputFileName_
Definition: MillePedeFileConverter.h:39