DQM
CTPPS
plugins
TotemDAQTriggerDQMSource.cc
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* This is a part of TOTEM offline software.
4
* Authors:
5
* Jan Kašpar (jan.kaspar@gmail.com)
6
* Rafał Leszko (rafal.leszko@gmail.com)
7
*
8
****************************************************************************/
9
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
#include "
FWCore/Framework/interface/MakerMacros.h
"
12
#include "
FWCore/Framework/interface/Event.h
"
13
#include "
FWCore/Framework/interface/EventSetup.h
"
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
#include "
FWCore/Utilities/interface/InputTag.h
"
16
17
#include "
DQMServices/Core/interface/DQMEDAnalyzer.h
"
18
#include "
DQMServices/Core/interface/DQMStore.h
"
19
20
#include "
DataFormats/CTPPSDigi/interface/TotemFEDInfo.h
"
21
22
#include <string>
23
24
//----------------------------------------------------------------------------------------------------
25
26
class
TotemDAQTriggerDQMSource
:
public
DQMEDAnalyzer
{
27
public
:
28
TotemDAQTriggerDQMSource
(
const
edm::ParameterSet
&ps);
29
~TotemDAQTriggerDQMSource
()
override
;
30
31
protected
:
32
void
bookHistograms
(DQMStore::IBooker &,
edm::Run
const
&,
edm::EventSetup
const
&)
override
;
33
void
analyze
(
edm::Event
const
&
e
,
edm::EventSetup
const
&eSetup)
override
;
34
35
private
:
36
unsigned
int
verbosity
;
37
38
edm::EDGetTokenT<std::vector<TotemFEDInfo>
>
tokenFEDInfo
;
39
40
MonitorElement
*
daq_bx_diff
;
41
MonitorElement
*
daq_event_bx_diff
;
42
MonitorElement
*
daq_event_bx_diff_vs_fed
;
43
};
44
45
//----------------------------------------------------------------------------------------------------
46
//----------------------------------------------------------------------------------------------------
47
48
using namespace
std
;
49
using namespace
edm
;
50
51
//----------------------------------------------------------------------------------------------------
52
53
TotemDAQTriggerDQMSource::TotemDAQTriggerDQMSource
(
const
edm::ParameterSet
&ps)
54
:
verbosity
(ps.getUntrackedParameter<unsigned
int
>(
"verbosity"
, 0)) {
55
tokenFEDInfo
= consumes<vector<TotemFEDInfo>>(ps.
getParameter
<
edm::InputTag
>(
"tagFEDInfo"
));
56
}
57
58
//----------------------------------------------------------------------------------------------------
59
60
TotemDAQTriggerDQMSource::~TotemDAQTriggerDQMSource
() {}
61
62
//----------------------------------------------------------------------------------------------------
63
64
void
TotemDAQTriggerDQMSource::bookHistograms
(DQMStore::IBooker &ibooker,
edm::Run
const
&,
edm::EventSetup
const
&) {
65
ibooker.cd();
66
67
ibooker.setCurrentFolder(
"CTPPS/DAQ/"
);
68
69
daq_bx_diff
= ibooker.book1D(
"bx_diff"
,
";OptoRx_{i}.BX - OptoRx_{j}.BX"
, 21, -10.5, +10.5);
70
daq_event_bx_diff
= ibooker.book1D(
"daq_event_bx_diff"
,
";OptoRx_{i}.BX - Event.BX"
, 21, -10.5, +10.5);
71
daq_event_bx_diff_vs_fed
=
72
ibooker.book2D(
"daq_event_bx_diff_vs_fed"
,
";OptoRx.ID;OptoRx.BX - Event.BX"
, 10, 575.5, 585.5, 21, -10.5, +10.5);
73
}
74
75
//----------------------------------------------------------------------------------------------------
76
77
void
TotemDAQTriggerDQMSource::analyze
(
edm::Event
const
&
event
,
edm::EventSetup
const
&
eventSetup
) {
78
// get input
79
Handle<vector<TotemFEDInfo>
> fedInfo;
80
event
.getByToken(
tokenFEDInfo
, fedInfo);
81
82
// check validity
83
bool
daqValid = fedInfo.
isValid
();
84
85
if
(!daqValid) {
86
if
(
verbosity
) {
87
LogPrint
(
"TotemDAQTriggerDQMSource"
)
88
<<
"WARNING in TotemDAQTriggerDQMSource::analyze > some of the inputs are not valid.\n"
89
<<
" fedInfo.isValid = "
<< fedInfo.
isValid
();
90
}
91
}
92
93
// DAQ plots
94
if
(daqValid) {
95
for
(
auto
&it1 : *fedInfo) {
96
daq_event_bx_diff
->
Fill
(it1.bx() -
event
.bunchCrossing());
97
daq_event_bx_diff_vs_fed
->
Fill
(it1.fedId(), it1.bx() -
event
.bunchCrossing());
98
99
for
(
auto
&it2 : *fedInfo) {
100
if
(it2.fedId() <= it1.fedId())
101
continue
;
102
103
daq_bx_diff
->
Fill
(it2.bx() - it1.bx());
104
}
105
}
106
}
107
}
108
109
//----------------------------------------------------------------------------------------------------
110
111
DEFINE_FWK_MODULE
(
TotemDAQTriggerDQMSource
);
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition:
HIPAlignmentAlgorithm_cfi.py:7
ESHandle.h
edm::Run
Definition:
Run.h:45
edm::EDGetTokenT
Definition:
EDGetToken.h:33
edm
HLT enums.
Definition:
AlignableModifier.h:19
DQMStore.h
dqm::legacy::MonitorElement
Definition:
MonitorElement.h:461
edm::Handle
Definition:
AssociativeIterator.h:50
TotemDAQTriggerDQMSource::tokenFEDInfo
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo
Definition:
TotemDAQTriggerDQMSource.cc:43
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition:
MonitorElement.h:290
DQMEDAnalyzer.h
TotemDAQTriggerDQMSource::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition:
TotemDAQTriggerDQMSource.cc:76
DQMEDAnalyzer
Definition:
DQMEDAnalyzer.py:1
TotemDAQTriggerDQMSource::daq_event_bx_diff
MonitorElement * daq_event_bx_diff
Definition:
TotemDAQTriggerDQMSource.cc:46
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
TotemDAQTriggerDQMSource::TotemDAQTriggerDQMSource
TotemDAQTriggerDQMSource(const edm::ParameterSet &ps)
Definition:
TotemDAQTriggerDQMSource.cc:52
createfilelist.int
int
Definition:
createfilelist.py:10
edm::LogPrint
Definition:
MessageLogger.h:342
TotemDAQTriggerDQMSource::~TotemDAQTriggerDQMSource
~TotemDAQTriggerDQMSource() override
Definition:
TotemDAQTriggerDQMSource.cc:59
edm::EventSetup
Definition:
EventSetup.h:57
TotemDAQTriggerDQMSource::daq_bx_diff
MonitorElement * daq_bx_diff
Definition:
TotemDAQTriggerDQMSource.cc:45
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
std
Definition:
JetResolutionObject.h:76
options_cfi.eventSetup
eventSetup
Definition:
options_cfi.py:12
TotemDAQTriggerDQMSource
Definition:
TotemDAQTriggerDQMSource.cc:25
EventSetup.h
TotemDAQTriggerDQMSource::daq_event_bx_diff_vs_fed
MonitorElement * daq_event_bx_diff_vs_fed
Definition:
TotemDAQTriggerDQMSource.cc:47
TotemDAQTriggerDQMSource::verbosity
unsigned int verbosity
Definition:
TotemDAQTriggerDQMSource.cc:41
TotemFEDInfo.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition:
HandleBase.h:70
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
TotemDAQTriggerDQMSource::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition:
TotemDAQTriggerDQMSource.cc:63
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16