Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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 <map>
11
#include <unordered_set>
12
#include <chrono>
13
14
#include "
DQMMonitoringService.h
"
15
16
namespace
dqmservices {
17
18
class
DQMFileIterator
{
19
public
:
20
struct
LumiEntry
{
21
std::string
filename
;
22
23
unsigned
int
file_ls
;
24
std::size_t
n_events
;
25
std::string
datafn
;
26
27
static
LumiEntry
load_json
(
const
std::string
&
filename
,
int
lumiNumber,
28
unsigned
int
datafn_position);
29
30
std::string
state
;
31
};
32
33
struct
EorEntry
{
34
bool
loaded
=
false
;
35
std::string
filename
;
36
37
std::size_t
n_events
;
38
std::size_t
n_lumi
;
39
40
static
EorEntry
load_json
(
const
std::string
&
filename
);
41
};
42
43
enum
State
{
44
OPEN
= 0,
45
EOR_CLOSING
= 1,
// EoR file found, but lumis are still pending
46
EOR
= 2,
47
};
48
49
DQMFileIterator
(
edm::ParameterSet
const
& pset);
50
~DQMFileIterator
();
51
void
initialise
(
int
run
,
const
std::string
&,
const
std::string
&);
52
53
State
state
();
54
55
/* methods to iterate the actual files */
56
57
/* nextLumiNumber_ is the first unprocessed lumi number
58
* lumiReady() returns if the next lumi is ready to be loaded
59
* open() opens a file and advances the pointer to the next lumi
60
*
61
* front() a reference to the description (LumiEntry)
62
* pop() advances to the next lumi
63
*/
64
bool
lumiReady
();
65
LumiEntry
open
();
66
67
void
pop
();
68
std::string
make_path
(
const
std::string
& fn);
69
70
/* control */
71
void
reset
();
72
void
update_state
();
73
74
/* misc helpers for input sources */
75
void
logFileAction
(
const
std::string
&
msg
,
76
const
std::string
&
fileName
=
""
)
const
;
77
void
logLumiState
(
const
LumiEntry&
lumi
,
const
std::string
&
msg
);
78
79
void
delay
();
80
81
unsigned
int
runNumber
();
82
unsigned
int
lastLumiFound
();
83
void
advanceToLumi
(
unsigned
int
lumi
,
std::string
reason);
84
85
static
void
fillDescription
(
edm::ParameterSetDescription
& d);
86
87
private
:
88
unsigned
int
runNumber_
;
89
std::string
runInputDir_
;
90
std::string
streamLabel_
;
91
unsigned
long
delayMillis_
;
92
long
nextLumiTimeoutMillis_
;
93
long
forceFileCheckTimeoutMillis_
;
94
95
// file name position in the json file
96
unsigned
int
datafnPosition_
;
97
std::string
runPath_
;
98
99
EorEntry
eor_
;
100
State
state_
;
101
102
unsigned
int
nextLumiNumber_
;
103
std::map<unsigned int, LumiEntry>
lumiSeen_
;
104
std::unordered_set<std::string>
filesSeen_
;
105
106
/* this should be different,
107
* since time between hosts might be not in sync */
108
std::time_t
runPathMTime_
;
109
std::chrono::high_resolution_clock::time_point
runPathLastCollect_
;
110
111
/* this is for missing lumi files */
112
std::chrono::high_resolution_clock::time_point
lastLumiLoad_
;
113
114
void
collect
(
bool
ignoreTimers);
115
void
monUpdateLumi
(
const
LumiEntry
&
lumi
);
116
117
/* this is for monitoring */
118
edm::Service<DQMMonitoringService>
mon_
;
119
};
120
121
}
/* end of namespace */
122
123
#endif
dqmservices::DQMFileIterator::eor_
EorEntry eor_
Definition:
DQMFileIterator.h:99
dqmservices::DQMFileIterator::State
State
Definition:
DQMFileIterator.h:43
dqmservices::DQMFileIterator::delayMillis_
unsigned long delayMillis_
Definition:
DQMFileIterator.h:91
DQMMonitoringService.h
edm::Service
Definition:
Service.h:30
dqmservices::DQMFileIterator::make_path
std::string make_path(const std::string &fn)
Definition:
DQMFileIterator.cc:160
dqmservices::DQMFileIterator::LumiEntry::datafn
std::string datafn
Definition:
DQMFileIterator.h:25
dqmservices::DQMFileIterator::lastLumiFound
unsigned int lastLumiFound()
Definition:
DQMFileIterator.cc:117
dqmservices::DQMFileIterator::mon_
edm::Service< DQMMonitoringService > mon_
Definition:
DQMFileIterator.h:118
dqmservices::DQMFileIterator::logLumiState
void logLumiState(const LumiEntry &lumi, const std::string &msg)
Definition:
DQMFileIterator.cc:343
fjr2json.lumi
tuple lumi
Definition:
fjr2json.py:35
dqmservices::DQMFileIterator::pop
void pop()
dqmservices::DQMFileIterator::initialise
void initialise(int run, const std::string &, const std::string &)
dqmservices::DQMFileIterator::LumiEntry::file_ls
unsigned int file_ls
Definition:
DQMFileIterator.h:23
dqmservices::DQMFileIterator::lumiSeen_
std::map< unsigned int, LumiEntry > lumiSeen_
Definition:
DQMFileIterator.h:103
dqmservices::DQMFileIterator::EorEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:37
convertXMLtoSQLite_cfg.fileName
tuple fileName
Definition:
convertXMLtoSQLite_cfg.py:13
dqmservices::DQMFileIterator::EorEntry::n_lumi
std::size_t n_lumi
Definition:
DQMFileIterator.h:38
dqmservices::DQMFileIterator::EorEntry::loaded
bool loaded
Definition:
DQMFileIterator.h:34
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
producerFileCleanner.msg
string msg
Definition:
producerFileCleanner.py:91
dqmservices::DQMFileIterator::DQMFileIterator
DQMFileIterator(edm::ParameterSet const &pset)
Definition:
DQMFileIterator.cc:58
dqmservices::DQMFileIterator::EOR_CLOSING
Definition:
DQMFileIterator.h:45
dqmservices::DQMFileIterator
Definition:
DQMFileIterator.h:18
ParameterSetDescription.h
dqmservices::DQMFileIterator::nextLumiTimeoutMillis_
long nextLumiTimeoutMillis_
Definition:
DQMFileIterator.h:92
dqmservices::DQMFileIterator::runNumber_
unsigned int runNumber_
Definition:
DQMFileIterator.h:88
dqmservices::DQMFileIterator::runNumber
unsigned int runNumber()
Definition:
DQMFileIterator.cc:115
Service.h
dqmservices::DQMFileIterator::logFileAction
void logFileAction(const std::string &msg, const std::string &fileName="") const
Definition:
DQMFileIterator.cc:336
dqmservices::DQMFileIterator::LumiEntry::state
std::string state
Definition:
DQMFileIterator.h:30
dqmservices::DQMFileIterator::~DQMFileIterator
~DQMFileIterator()
Definition:
DQMFileIterator.cc:73
dqmservices::DQMFileIterator::EorEntry::load_json
static EorEntry load_json(const std::string &filename)
Definition:
DQMFileIterator.cc:40
DTTTrigCorrFirst.run
run
Definition:
DTTTrigCorrFirst.py:63
dqmservices::DQMFileIterator::lastLumiLoad_
std::chrono::high_resolution_clock::time_point lastLumiLoad_
Definition:
DQMFileIterator.h:112
dqmservices::DQMFileIterator::runPath_
std::string runPath_
Definition:
DQMFileIterator.h:97
dqmservices::DQMFileIterator::EorEntry::filename
std::string filename
Definition:
DQMFileIterator.h:35
dqmservices::DQMFileIterator::open
LumiEntry open()
Definition:
DQMFileIterator.cc:101
dqmservices::DQMFileIterator::reset
void reset()
Definition:
DQMFileIterator.cc:75
dqmservices::DQMFileIterator::LumiEntry::load_json
static LumiEntry load_json(const std::string &filename, int lumiNumber, unsigned int datafn_position)
Definition:
DQMFileIterator.cc:19
dqmservices::DQMFileIterator::EorEntry
Definition:
DQMFileIterator.h:33
dqmservices::DQMFileIterator::OPEN
Definition:
DQMFileIterator.h:44
dqmservices::DQMFileIterator::streamLabel_
std::string streamLabel_
Definition:
DQMFileIterator.h:90
dqmservices::DQMFileIterator::delay
void delay()
Definition:
DQMFileIterator.cc:353
dqmservices::DQMFileIterator::LumiEntry
Definition:
DQMFileIterator.h:20
dqmservices::DQMFileIterator::lumiReady
bool lumiReady()
Definition:
DQMFileIterator.cc:107
dqmservices::DQMFileIterator::nextLumiNumber_
unsigned int nextLumiNumber_
Definition:
DQMFileIterator.h:102
dqmservices::DQMFileIterator::datafnPosition_
unsigned int datafnPosition_
Definition:
DQMFileIterator.h:96
dqmservices::DQMFileIterator::forceFileCheckTimeoutMillis_
long forceFileCheckTimeoutMillis_
Definition:
DQMFileIterator.h:93
dqmservices::DQMFileIterator::monUpdateLumi
void monUpdateLumi(const LumiEntry &lumi)
Definition:
DQMFileIterator.cc:151
dqmservices::DQMFileIterator::runPathLastCollect_
std::chrono::high_resolution_clock::time_point runPathLastCollect_
Definition:
DQMFileIterator.h:109
dqmservices::DQMFileIterator::filesSeen_
std::unordered_set< std::string > filesSeen_
Definition:
DQMFileIterator.h:104
edm::ParameterSet
Definition:
ParameterSet.h:35
ConfigurationDescriptions.h
dqmservices::DQMFileIterator::runPathMTime_
std::time_t runPathMTime_
Definition:
DQMFileIterator.h:108
dqmservices::DQMFileIterator::state_
State state_
Definition:
DQMFileIterator.h:100
dqmservices::DQMFileIterator::runInputDir_
std::string runInputDir_
Definition:
DQMFileIterator.h:89
dqmservices::DQMFileIterator::LumiEntry::filename
std::string filename
Definition:
DQMFileIterator.h:21
dqmservices::DQMFileIterator::advanceToLumi
void advanceToLumi(unsigned int lumi, std::string reason)
Definition:
DQMFileIterator.cc:125
dqmservices::DQMFileIterator::state
State state()
Definition:
DQMFileIterator.cc:99
dqmservices::DQMFileIterator::EOR
Definition:
DQMFileIterator.h:46
dqmservices::DQMFileIterator::fillDescription
static void fillDescription(edm::ParameterSetDescription &d)
Definition:
DQMFileIterator.cc:360
dqmservices::DQMFileIterator::update_state
void update_state()
Definition:
DQMFileIterator.cc:277
dqmservices::DQMFileIterator::collect
void collect(bool ignoreTimers)
Definition:
DQMFileIterator.cc:168
dqmservices::DQMFileIterator::LumiEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:24
Generated for CMSSW Reference Manual by
1.8.5