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 <map>
11
#include <queue>
12
#include <chrono>
13
14
#include "
DQMMonitoringService.h
"
15
16
namespace
dqmservices {
17
18
class
DQMFileIterator
{
19
public
:
20
struct
LumiEntry
{
21
bool
loaded
=
false
;
22
std::string
filename
;
23
24
int
ls
;
25
std::size_t
n_events
;
26
std::string
datafilename
;
27
28
static
LumiEntry
load_json
(
const
std::string
&
filename
,
int
lumiNumber,
29
unsigned
int
datafn_position);
30
};
31
32
struct
EorEntry
{
33
bool
loaded
=
false
;
34
std::string
filename
;
35
36
std::size_t
n_events
;
37
std::size_t
n_lumi
;
38
std::string
datafilename
;
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
/* currentLumi_ is the first unprocessed lumi number
58
* lumiReady() returns if it is loadable
59
* front() a reference to the description (LumiEntry)
60
* pop() advances to the next lumi
61
*/
62
bool
lumiReady
();
63
const
LumiEntry&
front
();
64
void
pop
();
65
std::string
make_path_data
(
const
LumiEntry&
lumi
);
66
67
/* control */
68
void
reset
();
69
void
update_state
();
70
71
/* misc helpers for input sources */
72
void
logFileAction
(
const
std::string
&
msg
,
73
const
std::string
&
fileName
=
""
)
const
;
74
void
delay
();
75
void
updateWatchdog
();
76
unsigned
int
runNumber
();
77
78
unsigned
int
lastLumiFound
();
79
void
advanceToLumi
(
unsigned
int
lumi
);
80
81
static
void
fillDescription
(
edm::ParameterSetDescription
& d);
82
83
private
:
84
unsigned
int
runNumber_
;
85
std::string
runInputDir_
;
86
std::string
streamLabel_
;
87
unsigned
long
delayMillis_
;
88
long
nextLumiTimeoutMillis_
;
89
long
forceFileCheckTimeoutMillis_
;
90
91
// file name position in the json file
92
unsigned
int
datafnPosition_
;
93
94
std::string
runPath_
;
95
96
EorEntry
eor_
;
97
State
state_
;
98
99
unsigned
int
currentLumi_
;
100
std::map<unsigned int, LumiEntry>
lumiSeen_
;
101
102
/* this should be different,
103
* since time between hosts might be not in sync */
104
std::time_t
runPathMTime_
;
105
std::chrono::high_resolution_clock::time_point
runPathLastCollect_
;
106
107
/* this is for missing lumi files */
108
std::chrono::high_resolution_clock::time_point
lastLumiLoad_
;
109
110
void
collect
(
bool
ignoreTimers);
111
112
/* this is for monitoring */
113
edm::Service<DQMMonitoringService>
mon_
;
114
};
115
116
}
/* end of namespace */
117
118
#endif
dqmservices::DQMFileIterator::eor_
EorEntry eor_
Definition:
DQMFileIterator.h:96
dqmservices::DQMFileIterator::State
State
Definition:
DQMFileIterator.h:43
dqmservices::DQMFileIterator::delayMillis_
unsigned long delayMillis_
Definition:
DQMFileIterator.h:87
DQMMonitoringService.h
edm::Service
Definition:
Service.h:30
dqmservices::DQMFileIterator::lastLumiFound
unsigned int lastLumiFound()
Definition:
DQMFileIterator.cc:112
dqmservices::DQMFileIterator::mon_
edm::Service< DQMMonitoringService > mon_
Definition:
DQMFileIterator.h:113
dqmservices::DQMFileIterator::front
const LumiEntry & front()
Definition:
DQMFileIterator.cc:94
fjr2json.lumi
tuple lumi
Definition:
fjr2json.py:35
dqmservices::DQMFileIterator::pop
void pop()
Definition:
DQMFileIterator.cc:98
dqmservices::DQMFileIterator::initialise
void initialise(int run, const std::string &, const std::string &)
dqmservices::DQMFileIterator::lumiSeen_
std::map< unsigned int, LumiEntry > lumiSeen_
Definition:
DQMFileIterator.h:100
dqmservices::DQMFileIterator::EorEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:36
dqmservices::DQMFileIterator::LumiEntry::loaded
bool loaded
Definition:
DQMFileIterator.h:21
dqmservices::DQMFileIterator::LumiEntry::datafilename
std::string datafilename
Definition:
DQMFileIterator.h:26
dqmservices::DQMFileIterator::updateWatchdog
void updateWatchdog()
Definition:
DQMFileIterator.cc:301
dqmservices::DQMFileIterator::currentLumi_
unsigned int currentLumi_
Definition:
DQMFileIterator.h:99
convertXMLtoSQLite_cfg.fileName
tuple fileName
Definition:
convertXMLtoSQLite_cfg.py:12
dqmservices::DQMFileIterator::EorEntry::n_lumi
std::size_t n_lumi
Definition:
DQMFileIterator.h:37
dqmservices::DQMFileIterator::EorEntry::loaded
bool loaded
Definition:
DQMFileIterator.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
dqmservices::DQMFileIterator::advanceToLumi
void advanceToLumi(unsigned int lumi)
Definition:
DQMFileIterator.cc:120
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:50
dqmservices::DQMFileIterator::make_path_data
std::string make_path_data(const LumiEntry &lumi)
Definition:
DQMFileIterator.cc:143
producerFileCleanner.msg
string msg
Definition:
producerFileCleanner.py:91
dqmservices::DQMFileIterator::DQMFileIterator
DQMFileIterator(edm::ParameterSet const &pset)
Definition:
DQMFileIterator.cc:61
dqmservices::DQMFileIterator::EOR_CLOSING
Definition:
DQMFileIterator.h:45
dqmservices::DQMFileIterator
Definition:
DQMFileIterator.h:18
ParameterSetDescription.h
dqmservices::DQMFileIterator::nextLumiTimeoutMillis_
long nextLumiTimeoutMillis_
Definition:
DQMFileIterator.h:88
dqmservices::DQMFileIterator::runNumber_
unsigned int runNumber_
Definition:
DQMFileIterator.h:84
dqmservices::DQMFileIterator::runNumber
unsigned int runNumber()
Definition:
DQMFileIterator.cc:110
Service.h
dqmservices::DQMFileIterator::logFileAction
void logFileAction(const std::string &msg, const std::string &fileName="") const
Definition:
DQMFileIterator.cc:294
dqmservices::DQMFileIterator::~DQMFileIterator
~DQMFileIterator()
Definition:
DQMFileIterator.cc:76
dqmservices::DQMFileIterator::EorEntry::load_json
static EorEntry load_json(const std::string &filename)
Definition:
DQMFileIterator.cc:41
DTTTrigCorrFirst.run
run
Definition:
DTTTrigCorrFirst.py:63
dqmservices::DQMFileIterator::lastLumiLoad_
std::chrono::high_resolution_clock::time_point lastLumiLoad_
Definition:
DQMFileIterator.h:108
dqmservices::DQMFileIterator::EorEntry::datafilename
std::string datafilename
Definition:
DQMFileIterator.h:38
dqmservices::DQMFileIterator::runPath_
std::string runPath_
Definition:
DQMFileIterator.h:94
dqmservices::DQMFileIterator::EorEntry::filename
std::string filename
Definition:
DQMFileIterator.h:34
dqmservices::DQMFileIterator::reset
void reset()
Definition:
DQMFileIterator.cc:78
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:32
dqmservices::DQMFileIterator::OPEN
Definition:
DQMFileIterator.h:44
dqmservices::DQMFileIterator::streamLabel_
std::string streamLabel_
Definition:
DQMFileIterator.h:86
dqmservices::DQMFileIterator::delay
void delay()
Definition:
DQMFileIterator.cc:309
dqmservices::DQMFileIterator::LumiEntry
Definition:
DQMFileIterator.h:20
dqmservices::DQMFileIterator::lumiReady
bool lumiReady()
Definition:
DQMFileIterator.cc:102
dqmservices::DQMFileIterator::datafnPosition_
unsigned int datafnPosition_
Definition:
DQMFileIterator.h:92
dqmservices::DQMFileIterator::forceFileCheckTimeoutMillis_
long forceFileCheckTimeoutMillis_
Definition:
DQMFileIterator.h:89
dqmservices::DQMFileIterator::runPathLastCollect_
std::chrono::high_resolution_clock::time_point runPathLastCollect_
Definition:
DQMFileIterator.h:105
edm::ParameterSet
Definition:
ParameterSet.h:35
ConfigurationDescriptions.h
dqmservices::DQMFileIterator::runPathMTime_
std::time_t runPathMTime_
Definition:
DQMFileIterator.h:104
dqmservices::DQMFileIterator::state_
State state_
Definition:
DQMFileIterator.h:97
dqmservices::DQMFileIterator::runInputDir_
std::string runInputDir_
Definition:
DQMFileIterator.h:85
dqmservices::DQMFileIterator::LumiEntry::filename
std::string filename
Definition:
DQMFileIterator.h:22
dqmservices::DQMFileIterator::state
State state()
Definition:
DQMFileIterator.cc:92
dqmservices::DQMFileIterator::EOR
Definition:
DQMFileIterator.h:46
dqmservices::DQMFileIterator::fillDescription
static void fillDescription(edm::ParameterSetDescription &d)
Definition:
DQMFileIterator.cc:317
dqmservices::DQMFileIterator::update_state
void update_state()
Definition:
DQMFileIterator.cc:240
dqmservices::DQMFileIterator::collect
void collect(bool ignoreTimers)
Definition:
DQMFileIterator.cc:151
dqmservices::DQMFileIterator::LumiEntry::n_events
std::size_t n_events
Definition:
DQMFileIterator.h:25
dqmservices::DQMFileIterator::LumiEntry::ls
int ls
Definition:
DQMFileIterator.h:24
Generated for CMSSW Reference Manual by
1.8.5