src
Alignment
MillePedeAlignmentAlgorithm
plugins
MillePedeFileExtractor.h
Go to the documentation of this file.
1
#ifndef MillePedeFileExtractor_h
2
#define MillePedeFileExtractor_h
3
4
// Original Author: Broen van Besien
5
// Created: Mon, 23 Mar 2015 14:56:15 GMT
6
7
/*
8
* This analyzer will extract all fileblobs in the input edm/root file and
9
* write them as files to the file system.
10
*
11
* It searches for the files in the vector of fileblobs that should exist on
12
* the level of the run. Unique filenames for each file are generated based
13
* on a formating directive in the output filename parameter.
14
*
15
* The operation is performed during the endRun phase.
16
*
17
* The original embedding of the (binary) files in the edm/root files can be
18
* done with the corresponding module MillePedeFileConverer.
19
*
20
* For more info about the possible parameters, type:
21
* edmPluginHelp -p MillePedeFileExtractor
22
*/
23
24
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
25
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
29
#include "
CondFormats/Common/interface/FileBlobCollection.h
"
30
31
class
MillePedeFileExtractor
:
public
edm::one::EDAnalyzer
<edm::one::WatchLuminosityBlocks> {
32
public
:
33
explicit
MillePedeFileExtractor
(
const
edm::ParameterSet
&);
34
~MillePedeFileExtractor
()
override
=
default
;
35
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
36
37
private
:
38
void
beginLuminosityBlock
(
const
edm::LuminosityBlock
&,
const
edm::EventSetup
&)
override
{}
39
void
endLuminosityBlock
(
const
edm::LuminosityBlock
&,
const
edm::EventSetup
&)
override
;
40
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
{}
41
42
bool
enoughBinaries
() {
return
(
nBinaries_
>=
maxNumberOfBinaries_
) &&
hasBinaryNumberLimit
(); }
43
bool
hasBinaryNumberLimit
() {
return
maxNumberOfBinaries_
> -1; }
44
45
static
void
writeGzipped
(
const
FileBlob
&,
const
std::string
&);
46
47
const
std::string
outputDir_
;
48
const
std::string
outputFileName_
;
49
50
edm::InputTag
fileBlobInputTag_
;
51
edm::EDGetTokenT<FileBlobCollection>
fileBlobToken_
;
52
53
const
int
maxNumberOfBinaries_
;
54
int
nBinaries_
{0};
55
};
56
57
// define this as a plug-in
58
DEFINE_FWK_MODULE
(
MillePedeFileExtractor
);
59
60
#endif
MillePedeFileExtractor::fileBlobToken_
edm::EDGetTokenT< FileBlobCollection > fileBlobToken_
Definition:
MillePedeFileExtractor.h:51
MillePedeFileExtractor::outputFileName_
const std::string outputFileName_
Definition:
MillePedeFileExtractor.h:48
Event.h
edm::LuminosityBlock
Definition:
LuminosityBlock.h:50
MillePedeFileExtractor::MillePedeFileExtractor
MillePedeFileExtractor(const edm::ParameterSet &)
Definition:
MillePedeFileExtractor.cc:16
FileBlobCollection.h
MillePedeFileExtractor::maxNumberOfBinaries_
const int maxNumberOfBinaries_
Definition:
MillePedeFileExtractor.h:53
MillePedeFileExtractor::fileBlobInputTag_
edm::InputTag fileBlobInputTag_
Definition:
MillePedeFileExtractor.h:50
edm::EDGetTokenT< FileBlobCollection >
Frameworkfwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ParameterSet.h
MillePedeFileExtractor::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:38
MillePedeFileExtractor::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.cc:27
MillePedeFileExtractor::nBinaries_
int nBinaries_
Definition:
MillePedeFileExtractor.h:54
FileBlob
Definition:
FileBlob.h:11
MillePedeFileExtractor::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
MillePedeFileExtractor.cc:98
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::EventSetup
Definition:
EventSetup.h:56
MillePedeFileExtractor::outputDir_
const std::string outputDir_
Definition:
MillePedeFileExtractor.h:47
EDAnalyzer.h
MillePedeFileExtractor::~MillePedeFileExtractor
~MillePedeFileExtractor() override=default
edm::InputTag
Definition:
InputTag.h:15
MillePedeFileExtractor::enoughBinaries
bool enoughBinaries()
Definition:
MillePedeFileExtractor.h:42
edm::ParameterSet
Definition:
ParameterSet.h:48
edm::Event
Definition:
Event.h:73
MakerMacros.h
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MillePedeFileExtractor::hasBinaryNumberLimit
bool hasBinaryNumberLimit()
Definition:
MillePedeFileExtractor.h:43
MillePedeFileExtractor::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
MillePedeFileExtractor.h:40
MillePedeFileExtractor
Definition:
MillePedeFileExtractor.h:31
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
MillePedeFileExtractor::writeGzipped
static void writeGzipped(const FileBlob &, const std::string &)
Definition:
MillePedeFileExtractor.cc:78
Generated for CMSSW Reference Manual by
1.8.14