15 : outputDir_(iConfig.getParameter<
std::
string>(
"fileDir")),
16 outputFileName_(iConfig.getParameter<
std::
string>(
"outputBinaryFile")),
17 maxNumberOfBinaries_(iConfig.getParameter<
int>(
"maxNumberOfBinaries")) {
23 <<
"Limiting the number of extracted binary files to " 38 if (fileBlobCollection.
isValid()) {
41 <<
"Root file contains " << fileBlobCollection->
size() <<
" FileBlob(s).";
43 for (
const auto& blob: *fileBlobCollection) {
49 char theNumberedOutputFileName[200];
54 <<
"Writing FileBlob file to file " 55 <<
outputDir_ + theNumberedOutputFileName <<
".";
64 <<
"Error: The root file does not contain any vector of FileBlob.";
74 gzFile fp = gzopen(fileName.c_str(),
"wb");
77 <<
"Problem while opening gzipped file '" << fileName <<
"'.";
79 auto nBytes = gzwrite(fp, &uncompressedBlob->front(), uncompressedBlob->size());
81 nBytes !=
static_cast<decltype(nBytes)
>(uncompressedBlob->size())) {
83 <<
"Problem while writing FileBlob to gzipped file '" << fileName <<
"'.";
85 auto zerr = gzclose(fp);
88 <<
"Problem while closing gzipped file '" << fileName <<
"'.";
100 "Keep the fileDir empty if you want to write to the current " 103 desc.
add<
std::string>(
"outputBinaryFile",
"milleBinary%04d.dat")->setComment(
104 "Base filename of the files that will be created. This must " 106 "a placeholder for an index number in the standard C formatting " 107 "style, like %04d.");
110 "Name of the module that should have generated the blob in the " 111 "root file. Make sure you overwrite this, if you have changed " 112 "this is the configuration of the MillePedeFileConverter.");
114 desc.
add<
int>(
"maxNumberOfBinaries", 1000)->setComment(
115 "Number of binaries to be extracted from the input files. " 116 "Use a negative value to apply no limit.");
118 descriptions.
add(
"millePedeFileExtractor", desc);
120 "This is the generic cfi file for the " 121 "MillePedeFileExtractor");
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< std::vector< unsigned char > > getUncompressedBlob() const
i didn't want to do two copies ... hope this works.