CondTools
CTPPS
plugins
CTPPSPixelDAQMappingAnalyzer.cc
Go to the documentation of this file.
1
// system include files
2
#include <memory>
3
4
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/MakerMacros.h
"
9
#include "
CondCore/CondDB/interface/Time.h
"
10
11
#include "
CondFormats/PPSObjects/interface/CTPPSPixelDAQMapping.h
"
12
#include "
CondFormats/DataRecord/interface/CTPPSPixelDAQMappingRcd.h
"
13
#include "
CondFormats/PPSObjects/interface/CTPPSPixelAnalysisMask.h
"
14
#include "
CondFormats/DataRecord/interface/CTPPSPixelAnalysisMaskRcd.h
"
15
16
using namespace
std
;
17
18
class
CTPPSPixelDAQMappingAnalyzer
:
public
edm::one::EDAnalyzer
<> {
19
public
:
20
string
label_
;
21
cond::Time_t
daqmappingiov_
;
22
cond::Time_t
analysismaskiov_
;
23
24
edm::ESGetToken<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd>
tokenMapping_
;
25
edm::ESGetToken<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>
tokenMask_
;
26
27
explicit
CTPPSPixelDAQMappingAnalyzer
(
edm::ParameterSet
const
& iConfig)
28
: label_(iConfig.getUntrackedParameter<
string
>(
"label"
,
"RPix"
)),
29
daqmappingiov_(iConfig.getParameter<unsigned long long>(
"daqmappingiov"
)),
30
analysismaskiov_(iConfig.getParameter<unsigned long long>(
"analysismaskiov"
)),
31
tokenMapping_(
esConsumes
<
CTPPSPixelDAQMapping
,
CTPPSPixelDAQMappingRcd
>(
edm
::
ESInputTag
(
""
, label_))),
32
tokenMask_(
esConsumes
<
CTPPSPixelAnalysisMask
,
CTPPSPixelAnalysisMaskRcd
>(
edm
::
ESInputTag
(
""
, label_))) {}
33
explicit
CTPPSPixelDAQMappingAnalyzer
(
int
i
) {}
34
~CTPPSPixelDAQMappingAnalyzer
()
override
{}
35
void
analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
c
)
override
;
36
};
37
38
void
CTPPSPixelDAQMappingAnalyzer::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
context
) {
39
using namespace
edm
;
40
41
/*edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelDAQMappingRcd"));
42
if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
43
//record not found
44
std::cout <<"Record \"CTPPSPixelDAQMappingRcd"<<"\" does not exist "<<std::endl;
45
}*/
46
47
//this part gets the handle of the event source and the record (i.e. the Database)
48
if
(
e
.id().run() == daqmappingiov_) {
49
ESHandle<CTPPSPixelDAQMapping>
mapping
=
context
.getHandle(tokenMapping_);
50
51
// print mapping
52
/*printf("* DAQ mapping\n");
53
for (const auto &p : mapping->ROCMapping)
54
std::cout << " " << p.first << " -> " << p.second << std::endl;*/
55
}
56
57
//edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelAnalysisMaskRcd"));
58
//if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
59
//record not found
60
//std::cout <<"Record \"CTPPSPixelAnalysisMaskRcd"<<"\" does not exist "<<std::endl;
61
//}
62
63
if
(
e
.id().run() == analysismaskiov_) {
64
// get analysis mask to mask channels
65
ESHandle<CTPPSPixelAnalysisMask>
analysisMask =
context
.getHandle(tokenMask_);
66
67
// print mask
68
/*printf("* mask\n");
69
for (const auto &p : analysisMask->analysisMask)
70
cout << " " << p.first
71
<< ": fullMask=" << p.second.fullMask
72
<< ", number of masked channels " << p.second.maskedPixels.size() << endl;
73
*/
74
}
75
}
76
DEFINE_FWK_MODULE
(
CTPPSPixelDAQMappingAnalyzer
);
CTPPSPixelDAQMappingAnalyzer::CTPPSPixelDAQMappingAnalyzer
CTPPSPixelDAQMappingAnalyzer(edm::ParameterSet const &iConfig)
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:27
CTPPSPixelAnalysisMaskRcd.h
EDAnalyzer.h
mps_fire.i
i
Definition:
mps_fire.py:428
CTPPSPixelDAQMappingRcd.h
ESHandle.h
ESInputTag
edm
HLT enums.
Definition:
AlignableModifier.h:19
CTPPSPixelDAQMappingAnalyzer::tokenMask_
edm::ESGetToken< CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd > tokenMask_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:25
CTPPSPixelDAQMappingAnalyzer
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:18
CTPPSPixelDAQMappingAnalyzer::label_
string label_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:20
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
CTPPSPixelDAQMappingAnalyzer::tokenMapping_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > tokenMapping_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:24
visDQMUpload.context
context
Definition:
visDQMUpload.py:37
MakerMacros.h
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition:
CTPPSPixelAnalysisMask.h:34
CTPPSPixelDAQMappingAnalyzer::daqmappingiov_
cond::Time_t daqmappingiov_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:21
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ESHandle
Definition:
DTSurvey.h:22
CTPPSPixelDAQMappingAnalyzer::analysismaskiov_
cond::Time_t analysismaskiov_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:22
CTPPSPixelDAQMappingRcd
Definition:
CTPPSPixelDAQMappingRcd.h:23
CTPPSPixelDAQMappingAnalyzer::CTPPSPixelDAQMappingAnalyzer
CTPPSPixelDAQMappingAnalyzer(int i)
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:33
CTPPSPixelAnalysisMaskRcd
Definition:
CTPPSPixelAnalysisMaskRcd.h:23
CTPPSPixelAnalysisMask.h
Time.h
CTPPSPixelDAQMappingAnalyzer::~CTPPSPixelDAQMappingAnalyzer
~CTPPSPixelDAQMappingAnalyzer() override
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:34
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition:
EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd >
std
Definition:
JetResolutionObject.h:76
CTPPSPixelDAQMapping.h
CTPPSPixelDAQMapping
The mapping between FramePosition and ROCInfo.
Definition:
CTPPSPixelDAQMapping.h:40
EventSetup.h
CTPPSPixelDAQMappingAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:38
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition:
DeDxTools.cc:283
edm::Event
Definition:
Event.h:73
taus_updatedMVAIds_cff.mapping
mapping
Definition:
taus_updatedMVAIds_cff.py:29
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16