Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DQMServices
StreamerIO
plugins
DQMFileIterator.h
Go to the documentation of this file.
1
#ifndef IOPool_DQMStreamer_DQMFilerIterator_h
2
#define IOPool_DQMStreamer_DQMFilerIterator_h
3
4
#include "
FWCore/ServiceRegistry/interface/Service.h
"
5
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
7
8
#include "boost/filesystem.hpp"
9
10
#include <memory>
11
#include <map>
12
#include <string>
13
#include <queue>
14
#include <iterator>
15
#include <chrono>
16
#include <boost/property_tree/json_parser.hpp>
17
#include <boost/property_tree/ptree.hpp>
18
19
namespace
edm {
20
21
class
DQMFileIterator
{
22
public
:
23
enum
JsonType
{
24
JS_PROTOBUF
,
25
JS_DATA
,
26
};
27
28
struct
LumiEntry
{
29
bool
loaded
=
false
;
30
std::string
filename
;
31
32
int
ls
;
33
std::size_t
n_events
;
34
std::string
datafilename
;
35
36
static
LumiEntry
load_json
(
const
std::string
&
filename
,
int
lumiNumber,
37
JsonType
type
);
38
};
39
40
struct
EorEntry
{
41
bool
loaded
=
false
;
42
std::string
filename
;
43
44
std::size_t
n_events
;
45
std::size_t
n_lumi
;
46
std::string
datafilename
;
47
48
static
EorEntry
load_json
(
const
std::string
&
filename
);
49
};
50
51
enum
State
{
52
OPEN
= 0,
53
EOR_CLOSING
= 1,
// EoR file found, but lumis are still pending
54
EOR
= 2,
55
};
56
57
DQMFileIterator
(
ParameterSet
const
& pset,
JsonType
t
);
58
~DQMFileIterator
();
59
void
initialise
(
int
run
,
const
std::string
&,
const
std::string
&);
60
61
State
state
();
62
63
/* methods to iterate the actual files */
64
65
/* currentLumi_ is the first unprocessed lumi number
66
* lumiReady() returns if it is loadable
67
* front() a reference to the description (LumiEntry)
68
* pop() advances to the next lumi
69
*/
70
bool
lumiReady
();
71
const
LumiEntry&
front
();
72
void
pop
();
73
std::string
make_path_data
(
const
LumiEntry&
lumi
);
74
75
/* control */
76
void
reset
();
77
void
update_state
();
78
79
/* misc helpers for input sources */
80
void
logFileAction
(
const
std::string
&
msg
,
81
const
std::string
&
fileName
=
""
)
const
;
82
void
delay
();
83
void
updateWatchdog
();
84
unsigned
int
runNumber
();
85
86
unsigned
int
lastLumiFound
();
87
void
advanceToLumi
(
unsigned
int
lumi
);
88
89
static
void
fillDescription
(
ParameterSetDescription
& d);
90
91
private
:
92
JsonType
type_
;
93
94
unsigned
int
runNumber_
;
95
std::string
runInputDir_
;
96
std::string
streamLabel_
;
97
unsigned
long
delayMillis_
;
98
long
nextLumiTimeoutMillis_
;
99
100
std::string
runPath_
;
101
102
EorEntry
eor_
;
103
State
state_
;
104
105
unsigned
int
currentLumi_
;
106
std::map<unsigned int, LumiEntry>
lumiSeen_
;
107
108
/* this should be different,
109
* since time between hosts might be not in sync */
110
std::time_t
runPathMTime_
;
111
std::chrono::high_resolution_clock::time_point
runPathLastCollect_
;
112
113
/* this is for missing lumi files */
114
std::chrono::high_resolution_clock::time_point
lastLumiLoad_
;
115
116
void
collect
(
bool
ignoreTimers);
117
};
118
119
}
/* end of namespace */
120
#endif
edm::DQMFileIterator::state
State state()
Definition:
DQMFileIterator.cc:91
type
type
Definition:
HCALResponse.h:21
edm::DQMFileIterator::runPath_
std::string runPath_
Definition:
DQMFileIterator.h:100
edm::DQMFileIterator::EOR
Definition:
DQMFileIterator.h:54
edm::DQMFileIterator::initialise
void initialise(int run, const std::string &, const std::string &)
edm::DQMFileIterator::make_path_data
std::string make_path_data(const LumiEntry &lumi)
Definition:
DQMFileIterator.cc:126
edm::DQMFileIterator::State
State
Definition:
DQMFileIterator.h:51
edm::DQMFileIterator::EorEntry
Definition:
DQMFileIterator.h:40
edm::DQMFileIterator::LumiEntry::load_json
static LumiEntry load_json(const std::string &filename, int lumiNumber, JsonType type)
Definition:
DQMFileIterator.cc:14
edm::DQMFileIterator::OPEN
Definition:
DQMFileIterator.h:52
fjr2json.lumi
tuple lumi
Definition:
fjr2json.py:35
edm::DQMFileIterator::delay
void delay()
Definition:
DQMFileIterator.cc:292
edm::DQMFileIterator::update_state
void update_state()
Definition:
DQMFileIterator.cc:223
edm::DQMFileIterator::LumiEntry::loaded
bool loaded
Definition:
DQMFileIterator.h:29
edm::DQMFileIterator::DQMFileIterator
DQMFileIterator(ParameterSet const &pset, JsonType t)
Definition:
DQMFileIterator.cc:62
edm::DQMFileIterator::EorEntry::n_lumi
std::size_t n_lumi
Definition:
DQMFileIterator.h:45
edm::DQMFileIterator::EorEntry::loaded
bool loaded
Definition:
DQMFileIterator.h:41
edm::DQMFileIterator::EorEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:44
edm::DQMFileIterator::eor_
EorEntry eor_
Definition:
DQMFileIterator.h:102
edm::DQMFileIterator::advanceToLumi
void advanceToLumi(unsigned int lumi)
Definition:
DQMFileIterator.cc:121
edm::DQMFileIterator::pop
void pop()
Definition:
DQMFileIterator.cc:97
edm::DQMFileIterator::LumiEntry::filename
std::string filename
Definition:
DQMFileIterator.h:30
edm::DQMFileIterator::runInputDir_
std::string runInputDir_
Definition:
DQMFileIterator.h:95
edm::DQMFileIterator::LumiEntry
Definition:
DQMFileIterator.h:28
edm::DQMFileIterator::JS_PROTOBUF
Definition:
DQMFileIterator.h:24
edm::DQMFileIterator::lumiSeen_
std::map< unsigned int, LumiEntry > lumiSeen_
Definition:
DQMFileIterator.h:106
convertXMLtoSQLite_cfg.fileName
tuple fileName
Definition:
convertXMLtoSQLite_cfg.py:12
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
edm::DQMFileIterator::reset
void reset()
Definition:
DQMFileIterator.cc:77
producerFileCleanner.msg
string msg
Definition:
producerFileCleanner.py:91
edm::DQMFileIterator::LumiEntry::ls
int ls
Definition:
DQMFileIterator.h:32
edm::DQMFileIterator::lumiReady
bool lumiReady()
Definition:
DQMFileIterator.cc:103
edm::DQMFileIterator::~DQMFileIterator
~DQMFileIterator()
Definition:
DQMFileIterator.cc:75
ParameterSetDescription.h
edmStreamStallGrapher.t
tuple t
Definition:
edmStreamStallGrapher.py:108
edm::DQMFileIterator::front
const LumiEntry & front()
Definition:
DQMFileIterator.cc:93
edm::DQMFileIterator::updateWatchdog
void updateWatchdog()
Definition:
DQMFileIterator.cc:284
edm::DQMFileIterator::logFileAction
void logFileAction(const std::string &msg, const std::string &fileName="") const
Definition:
DQMFileIterator.cc:277
edm::DQMFileIterator::state_
State state_
Definition:
DQMFileIterator.h:103
Service.h
edm::DQMFileIterator::fillDescription
static void fillDescription(ParameterSetDescription &d)
Definition:
DQMFileIterator.cc:300
edm::DQMFileIterator::type_
JsonType type_
Definition:
DQMFileIterator.h:92
edm::DQMFileIterator::runNumber
unsigned int runNumber()
Definition:
DQMFileIterator.cc:111
edm::DQMFileIterator
Definition:
DQMFileIterator.h:21
DTTTrigCorrFirst.run
run
Definition:
DTTTrigCorrFirst.py:63
edm::DQMFileIterator::lastLumiFound
unsigned int lastLumiFound()
Definition:
DQMFileIterator.cc:113
edm::DQMFileIterator::lastLumiLoad_
std::chrono::high_resolution_clock::time_point lastLumiLoad_
Definition:
DQMFileIterator.h:114
edm::DQMFileIterator::LumiEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:33
edm::DQMFileIterator::JsonType
JsonType
Definition:
DQMFileIterator.h:23
edm::DQMFileIterator::runPathLastCollect_
std::chrono::high_resolution_clock::time_point runPathLastCollect_
Definition:
DQMFileIterator.h:111
edm::DQMFileIterator::LumiEntry::datafilename
std::string datafilename
Definition:
DQMFileIterator.h:34
edm::DQMFileIterator::EorEntry::filename
std::string filename
Definition:
DQMFileIterator.h:42
edm::DQMFileIterator::delayMillis_
unsigned long delayMillis_
Definition:
DQMFileIterator.h:97
edm::DQMFileIterator::nextLumiTimeoutMillis_
long nextLumiTimeoutMillis_
Definition:
DQMFileIterator.h:98
edm::DQMFileIterator::JS_DATA
Definition:
DQMFileIterator.h:25
edm::DQMFileIterator::streamLabel_
std::string streamLabel_
Definition:
DQMFileIterator.h:96
edm::DQMFileIterator::EorEntry::load_json
static EorEntry load_json(const std::string &filename)
Definition:
DQMFileIterator.cc:42
edm::DQMFileIterator::EOR_CLOSING
Definition:
DQMFileIterator.h:53
edm::DQMFileIterator::EorEntry::datafilename
std::string datafilename
Definition:
DQMFileIterator.h:46
edm::ParameterSet
Definition:
ParameterSet.h:35
ConfigurationDescriptions.h
edm::DQMFileIterator::collect
void collect(bool ignoreTimers)
Definition:
DQMFileIterator.cc:134
edm::DQMFileIterator::currentLumi_
unsigned int currentLumi_
Definition:
DQMFileIterator.h:105
edm::DQMFileIterator::runNumber_
unsigned int runNumber_
Definition:
DQMFileIterator.h:94
edm::DQMFileIterator::runPathMTime_
std::time_t runPathMTime_
Definition:
DQMFileIterator.h:110
Generated for CMSSW Reference Manual by
1.8.5