DQM
EcalMonitorTasks
src
IntegrityTask.cc
Go to the documentation of this file.
1
#include "
DQM/EcalMonitorTasks/interface/IntegrityTask.h
"
2
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/Utilities/interface/Exception.h
"
5
6
namespace
ecaldqm
{
7
IntegrityTask::IntegrityTask
() :
DQWorkerTask
() {}
8
9
void
IntegrityTask::beginLuminosityBlock
(
edm::LuminosityBlock
const
&,
edm::EventSetup
const
&) {
10
// Reset by LS plots at beginning of every LS
11
MEs_
.at(
"MapByLumi"
).reset();
12
MEs_
.at(
"ByLumi"
).reset();
13
}
14
15
template
<
typename
IDCollection>
16
void
IntegrityTask::runOnDetIdCollection
(IDCollection
const
& _ids,
Collections
_collection) {
17
// Collection is empty if there are no errors
18
if
(_ids.empty())
19
return
;
20
21
MESet
* set(
nullptr
);
22
switch
(_collection) {
23
case
kEBGainErrors
:
24
case
kEEGainErrors
:
25
set = &
MEs_
.at(
"Gain"
);
26
break
;
27
case
kEBChIdErrors
:
28
case
kEEChIdErrors
:
29
set = &
MEs_
.at(
"ChId"
);
30
break
;
31
case
kEBGainSwitchErrors
:
32
case
kEEGainSwitchErrors
:
33
set = &
MEs_
.at(
"GainSwitch"
);
34
break
;
35
default
:
36
return
;
37
}
38
39
MESet
& meMapByLumi(
MEs_
.at(
"MapByLumi"
));
40
MESet
& meByLumi(
MEs_
.at(
"ByLumi"
));
41
MESet
& meTotal(
MEs_
.at(
"Total"
));
42
MESet
& meTrendNErrors(
MEs_
.at(
"TrendNErrors"
));
43
44
std::for_each(_ids.begin(), _ids.end(), [&](
typename
IDCollection::value_type
const
&
id
) {
45
set->
fill
(
id
);
46
int
dccid(
dccId
(
id
));
47
meByLumi.fill(dccid);
48
meTotal.fill(dccid);
49
// Fill Integrity Errors Map with channel errors for this lumi
50
meMapByLumi.fill(
id
);
51
52
meTrendNErrors.fill(
double
(
timestamp_
.
iLumi
), 1.);
53
});
54
}
55
56
void
IntegrityTask::runOnElectronicsIdCollection
(
EcalElectronicsIdCollection
const
& _ids,
Collections
_collection) {
57
// Collection is empty if there are no errors
58
if
(_ids.
empty
())
59
return
;
60
61
MESet
* set(
nullptr
);
62
switch
(_collection) {
63
case
kTowerIdErrors
:
64
set = &
MEs_
.at(
"TowerId"
);
65
break
;
66
case
kBlockSizeErrors
:
67
set = &
MEs_
.at(
"BlockSize"
);
68
break
;
69
default
:
70
return
;
71
}
72
73
MESet
& meMapByLumi(
MEs_
.at(
"MapByLumi"
));
74
MESet
& meByLumi(
MEs_
.at(
"ByLumi"
));
75
MESet
& meTotal(
MEs_
.at(
"Total"
));
76
MESet
& meTrendNErrors(
MEs_
.at(
"TrendNErrors"
));
77
78
std::for_each(_ids.
begin
(), _ids.
end
(), [&](
EcalElectronicsIdCollection::value_type
const
&
id
) {
79
set->
fill
(
id
);
80
int
dccid(
id
.
dccId
());
81
double
nCrystals
(0.);
82
std::vector<DetId> chIds(
getElectronicsMap
()->dccTowerConstituents(dccid,
id
.
towerId
()));
83
if
(dccid <= kEEmHigh + 1 || dccid >=
kEEpLow
+ 1)
84
nCrystals
= chIds.size();
85
else
86
nCrystals
= 25.;
87
meByLumi.fill(dccid,
nCrystals
);
88
meTotal.fill(dccid,
nCrystals
);
89
// Fill Integrity Errors Map with tower errors for this lumi
90
// Since binned by crystal for compatibility with channel errors,
91
// fill with constituent channels of tower
92
for
(std::vector<DetId>::iterator chItr(chIds.begin()); chItr != chIds.end(); ++chItr)
93
meMapByLumi.fill(*chItr);
94
95
meTrendNErrors.fill(
double
(
timestamp_
.
iLumi
),
nCrystals
);
96
});
97
}
98
99
DEFINE_ECALDQM_WORKER
(
IntegrityTask
);
100
}
// namespace ecaldqm
IntegrityTask.h
edm::EDCollection::begin
const_iterator begin() const
Definition:
EDCollection.h:117
edm::EDCollection::value_type
T value_type
Definition:
EDCollection.h:18
ecaldqm
Definition:
DQWorker.h:24
edm::LuminosityBlock
Definition:
LuminosityBlock.h:50
ecaldqm::kEEGainSwitchErrors
Definition:
Collections.h:16
ecaldqm::kEBGainErrors
Definition:
Collections.h:11
ecaldqm::kEBChIdErrors
Definition:
Collections.h:13
ecaldqm::kEEGainErrors
Definition:
Collections.h:12
ecaldqm::MESet::fill
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition:
MESet.h:46
ecaldqm::kTowerIdErrors
Definition:
Collections.h:17
ecaldqm::DQWorkerTask
Definition:
DQWorkerTask.h:71
ecaldqm::kEEChIdErrors
Definition:
Collections.h:14
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition:
DQWorker.h:78
edm::EDCollection::empty
bool empty() const
Definition:
EDCollection.h:77
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition:
EcalDQMCommonUtils.cc:334
ecaldqm::IntegrityTask
Definition:
IntegrityTask.h:13
ecaldqm::Collections
Collections
Definition:
Collections.h:8
edm::EventSetup
Definition:
EventSetup.h:57
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition:
JetExtendedAssociation.h:30
edm::EDCollection
Definition:
EDCollection.h:16
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition:
DQWorker.h:35
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition:
EcalDQMCommonUtils.cc:79
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:31
ecaldqm::IntegrityTask::runOnDetIdCollection
void runOnDetIdCollection(C const &, Collections)
ecaldqm::kEEpLow
Definition:
EcalDQMCommonUtils.h:83
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition:
DQWorker.h:81
ecaldqm::IntegrityTask::runOnElectronicsIdCollection
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)
Definition:
IntegrityTask.cc:56
Exception.h
ecaldqm::IntegrityTask::IntegrityTask
IntegrityTask()
Definition:
IntegrityTask.cc:7
DEFINE_ECALDQM_WORKER
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition:
DQWorker.h:112
ParameterSet.h
ecaldqm::getElectronicsMap
const EcalElectronicsMapping * getElectronicsMap()
Definition:
EcalDQMCommonUtils.cc:438
ecaldqm::IntegrityTask::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition:
IntegrityTask.cc:9
ecaldqm::kBlockSizeErrors
Definition:
Collections.h:18
ecaldqm::kEBGainSwitchErrors
Definition:
Collections.h:15
edm::EDCollection::end
const_iterator end() const
Definition:
EDCollection.h:122
ecaldqm::MESet
Definition:
MESet.h:27
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition:
EcalDQMCommonUtils.cc:16
Generated for CMSSW Reference Manual by
1.8.16