CondTools
DQM
src
DQMReferenceHistogramRootFileSourceHandler.cc
Go to the documentation of this file.
1
#include "
CondTools/DQM/interface/DQMReferenceHistogramRootFileSourceHandler.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSetfwd.h
"
5
#include <iostream>
6
#include <sstream>
7
#include <vector>
8
9
namespace
popcon
{
10
DQMReferenceHistogramRootFileSourceHandler::DQMReferenceHistogramRootFileSourceHandler
(
const
edm::ParameterSet
&
pset
)
11
: m_name(
pset
.getUntrackedParameter<
std
::
string
>(
"name"
,
"DQMReferenceHistogramRootFileSourceHandler"
)),
12
m_file(
pset
.getUntrackedParameter<
std
::
string
>(
"ROOTFile"
,
"./file.root"
)),
13
m_zip(
pset
.getUntrackedParameter<
bool
>(
"zip"
,
false
)),
14
m_since(
pset
.getUntrackedParameter<unsigned long long>(
"firstSince"
, 1)),
15
m_debugMode(
pset
.getUntrackedParameter<
bool
>(
"debug"
,
false
)) {}
16
17
DQMReferenceHistogramRootFileSourceHandler::~DQMReferenceHistogramRootFileSourceHandler
() {}
18
19
void
DQMReferenceHistogramRootFileSourceHandler::getNewObjects
() {
20
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
)
21
<<
"[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] for PopCon application "
<<
m_name
;
22
if
(
m_debugMode
) {
23
std::stringstream
ss
;
24
ss
<<
"\n------- "
<<
m_name
<<
" - > getNewObjects\n"
;
25
if
(this->
tagInfo
().
size
> 0) {
26
//check what is already inside of the database
27
ss <<
"\ngot offlineInfo "
<< this->
tagInfo
().
name
<<
",\n size "
<< this->
tagInfo
().
size
<<
",\n"
28
<<
"last object valid since "
<< this->
tagInfo
().
lastInterval
.
since
<<
",\n token "
29
<< this->
tagInfo
().
lastInterval
.
payloadId
<<
",\n UserText "
<< this->
userTextLog
()
30
<<
";\n last entry info regarding the payload (if existing):"
31
<<
",\n logId"
<< this->
logDBEntry
().
logId
32
<<
",\n last record with the correct tag (if existing) has been written in the db "
33
<< this->
logDBEntry
().
destinationDB
<<
",\n provenance "
<< this->
logDBEntry
().
provenance
<<
",\n usertext "
34
<< this->
logDBEntry
().
usertext
<<
",\n iovtag "
<< this->
logDBEntry
().
iovtag
<<
",\n timetype "
35
<< this->
logDBEntry
().
iovtimetype
<<
",\n payload index "
<< this->
logDBEntry
().
payloadIdx
36
<<
",\n payload class "
<< this->
logDBEntry
().
payloadClass
<<
",\n payload token "
37
<< this->
logDBEntry
().
payloadToken
<<
",\n execution time "
<< this->
logDBEntry
().
exectime
38
<<
",\n execution message "
<< this->
logDBEntry
().
execmessage
<< std::endl;
39
Ref
payload
= this->
lastPayload
();
40
ss <<
"size of last payload "
<<
payload
->size() << std::endl;
41
}
else
{
42
ss
<<
" First object for this tag "
<< std::endl;
43
}
44
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
) <<
ss
.str();
45
}
46
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
) <<
"runnumber/first since = "
<<
m_since
<< std::endl;
47
if
(m_since <= this->
tagInfo
().lastInterval.since) {
48
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
)
49
<<
"[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] \nthe current starting iov "
<<
m_since
50
<<
"\nis not compatible with the last iov ("
<< this->
tagInfo
().
lastInterval
.
since
<<
") open for the object "
51
<< this->
logDBEntry
().
payloadClass
<<
" \nin the db "
<< this->
logDBEntry
().
destinationDB
52
<<
" \n NO TRANSFER NEEDED"
<< std::endl;
53
return
;
54
}
55
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
)
56
<<
"[DQMReferenceHistogramRootFileSourceHandler::getNewObjects] "
<<
m_name
57
<<
" getting data to be transferred "
<< std::endl;
58
FileBlob
* rootFile =
new
FileBlob
(
m_file
,
m_zip
);
59
/*if(!this->tagInfo().size)
60
m_since=1;
61
else
62
if (m_debugMode)
63
m_since=this->tagInfo().lastInterval.first+1; */
64
if
(rootFile->
size
() != 0) {
65
edm::LogInfo
(
"DQMReferenceHistogramRootFileSourceHandler"
)
66
<<
"setting runnumber/first since = "
<<
m_since
<< std::endl;
67
this->
m_to_transfer
.push_back(std::make_pair(rootFile,
m_since
));
68
}
else
{
69
edm::LogError
(
"DQMSummarySourceHandler"
) <<
"Root file "
<<
m_file
<<
" does not exist"
<< std::endl;
70
delete
rootFile;
71
}
72
edm::LogInfo
(
"DQMSummarySourceHandler"
) <<
"------- "
<<
m_name
<<
" - > getNewObjects"
<< std::endl;
73
}
74
75
std::string
DQMReferenceHistogramRootFileSourceHandler::id
()
const
{
return
m_name
; }
76
}
// namespace popcon
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
popcon::DQMReferenceHistogramRootFileSourceHandler::~DQMReferenceHistogramRootFileSourceHandler
~DQMReferenceHistogramRootFileSourceHandler() override
Definition:
DQMReferenceHistogramRootFileSourceHandler.cc:17
popcon::PopConSourceHandler< FileBlob >::m_to_transfer
OldContainer m_to_transfer
Definition:
PopConSourceHandler.h:162
MessageLogger.h
funct::false
false
Definition:
Factorize.h:29
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
cond::LogDBEntry_t::execmessage
std::string execmessage
Definition:
Types.h:98
cond::TagInfo_t::name
std::string name
Definition:
Types.h:72
contentValuesCheck.ss
ss
Definition:
contentValuesCheck.py:33
DQMReferenceHistogramRootFileSourceHandler.h
cond::LogDBEntry_t::provenance
std::string provenance
Definition:
Types.h:89
jets_cff.payload
payload
Definition:
jets_cff.py:32
popcon::DQMReferenceHistogramRootFileSourceHandler::m_since
unsigned long long m_since
Definition:
DQMReferenceHistogramRootFileSourceHandler.h:22
cond::LogDBEntry_t::payloadToken
std::string payloadToken
Definition:
Types.h:96
edm::ParameterSet
Definition:
ParameterSet.h:47
popcon::PopConSourceHandler< FileBlob >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition:
PopConSourceHandler.h:78
cond::Iov_t::payloadId
Hash payloadId
Definition:
Types.h:55
cond::LogDBEntry_t::usertext
std::string usertext
Definition:
Types.h:90
cond::Iov_t::since
Time_t since
Definition:
Types.h:53
cond::LogDBEntry_t::iovtag
std::string iovtag
Definition:
Types.h:91
popcon::DQMReferenceHistogramRootFileSourceHandler::DQMReferenceHistogramRootFileSourceHandler
DQMReferenceHistogramRootFileSourceHandler(const edm::ParameterSet &pset)
Definition:
DQMReferenceHistogramRootFileSourceHandler.cc:10
cond::LogDBEntry_t::destinationDB
std::string destinationDB
Definition:
Types.h:88
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
popcon::DQMReferenceHistogramRootFileSourceHandler::getNewObjects
void getNewObjects() override
Definition:
DQMReferenceHistogramRootFileSourceHandler.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition:
Types.h:73
cond::LogDBEntry_t::iovtimetype
std::string iovtimetype
Definition:
Types.h:92
cond::LogDBEntry_t::payloadClass
std::string payloadClass
Definition:
Types.h:95
std
Definition:
JetResolutionObject.h:76
popcon
Definition:
Exception.h:6
popcon::DQMReferenceHistogramRootFileSourceHandler::m_debugMode
bool m_debugMode
Definition:
DQMReferenceHistogramRootFileSourceHandler.h:23
popcon::DQMReferenceHistogramRootFileSourceHandler::id
std::string id() const override
Definition:
DQMReferenceHistogramRootFileSourceHandler.cc:75
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition:
JetExtendedAssociation.h:32
cond::LogDBEntry_t::logId
unsigned long long logId
Definition:
Types.h:87
popcon::PopConSourceHandler< FileBlob >::lastPayload
Ref lastPayload() const
Definition:
PopConSourceHandler.h:81
popcon::DQMReferenceHistogramRootFileSourceHandler::m_zip
bool m_zip
Definition:
DQMReferenceHistogramRootFileSourceHandler.h:20
FileBlob::size
int size() const
Definition:
FileBlob.h:36
ParameterSetfwd.h
ParameterSet.h
cond::LogDBEntry_t::payloadIdx
unsigned int payloadIdx
Definition:
Types.h:93
popcon::DQMReferenceHistogramRootFileSourceHandler::m_name
std::string m_name
Definition:
DQMReferenceHistogramRootFileSourceHandler.h:18
popcon::PopConSourceHandler< FileBlob >::logDBEntry
cond::LogDBEntry_t const & logDBEntry() const
Definition:
PopConSourceHandler.h:84
popcon::PopConSourceHandler< FileBlob >::userTextLog
std::string const & userTextLog() const
Definition:
PopConSourceHandler.h:111
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
cond::TagInfo_t::size
size_t size
Definition:
Types.h:74
FileBlob
Definition:
FileBlob.h:11
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
cond::LogDBEntry_t::exectime
std::string exectime
Definition:
Types.h:97
popcon::DQMReferenceHistogramRootFileSourceHandler::m_file
std::string m_file
Definition:
DQMReferenceHistogramRootFileSourceHandler.h:19
Generated for CMSSW Reference Manual by
1.8.16