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
explicit
CTPPSPixelDAQMappingAnalyzer
(
edm::ParameterSet
const
& iConfig)
25
: label_(iConfig.getUntrackedParameter<
string
>(
"label"
,
"RPix"
)),
26
daqmappingiov_(iConfig.getParameter<unsigned long long>(
"daqmappingiov"
)),
27
analysismaskiov_(iConfig.getParameter<unsigned long long>(
"analysismaskiov"
)) {}
28
explicit
CTPPSPixelDAQMappingAnalyzer
(
int
i
) {}
29
~CTPPSPixelDAQMappingAnalyzer
()
override
{}
30
void
analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
c
)
override
;
31
};
32
33
void
CTPPSPixelDAQMappingAnalyzer::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
& context) {
34
using namespace
edm
;
35
36
/*edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelDAQMappingRcd"));
37
if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
38
//record not found
39
std::cout <<"Record \"CTPPSPixelDAQMappingRcd"<<"\" does not exist "<<std::endl;
40
}*/
41
42
//this part gets the handle of the event source and the record (i.e. the Database)
43
if
(
e
.id().run() == daqmappingiov_) {
44
ESHandle<CTPPSPixelDAQMapping>
mapping
;
45
context.
get
<
CTPPSPixelDAQMappingRcd
>().
get
(
"RPix"
,
mapping
);
46
47
// print mapping
48
/*printf("* DAQ mapping\n");
49
for (const auto &p : mapping->ROCMapping)
50
std::cout << " " << p.first << " -> " << p.second << std::endl;*/
51
}
52
53
//edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("CTPPSPixelAnalysisMaskRcd"));
54
//if( recordKey.type() == edm::eventsetup::EventSetupRecordKey::TypeTag()) {
55
//record not found
56
//std::cout <<"Record \"CTPPSPixelAnalysisMaskRcd"<<"\" does not exist "<<std::endl;
57
//}
58
59
if
(
e
.id().run() == analysismaskiov_) {
60
// get analysis mask to mask channels
61
ESHandle<CTPPSPixelAnalysisMask>
analysisMask;
62
context.
get
<
CTPPSPixelAnalysisMaskRcd
>().
get
(label_, analysisMask);
63
64
// print mask
65
/*printf("* mask\n");
66
for (const auto &p : analysisMask->analysisMask)
67
cout << " " << p.first
68
<< ": fullMask=" << p.second.fullMask
69
<< ", number of masked channels " << p.second.maskedPixels.size() << endl;
70
*/
71
}
72
}
73
DEFINE_FWK_MODULE
(
CTPPSPixelDAQMappingAnalyzer
);
CTPPSPixelDAQMappingAnalyzer::CTPPSPixelDAQMappingAnalyzer
CTPPSPixelDAQMappingAnalyzer(edm::ParameterSet const &iConfig)
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:24
CTPPSPixelAnalysisMaskRcd.h
EDAnalyzer.h
mps_fire.i
i
Definition:
mps_fire.py:428
CTPPSPixelDAQMappingRcd.h
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
CTPPSPixelDAQMappingAnalyzer
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:18
CTPPSPixelDAQMappingAnalyzer::label_
string label_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:20
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MakerMacros.h
CTPPSPixelDAQMappingAnalyzer::daqmappingiov_
cond::Time_t daqmappingiov_
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:21
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:87
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:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelAnalysisMaskRcd
Definition:
CTPPSPixelAnalysisMaskRcd.h:23
CTPPSPixelAnalysisMask.h
Time.h
CTPPSPixelDAQMappingAnalyzer::~CTPPSPixelDAQMappingAnalyzer
~CTPPSPixelDAQMappingAnalyzer() override
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:29
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
get
#define get
std
Definition:
JetResolutionObject.h:76
CTPPSPixelDAQMapping.h
EventSetup.h
CTPPSPixelDAQMappingAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
CTPPSPixelDAQMappingAnalyzer.cc:33
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:46
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