Calibration
HcalIsolatedTrackReco
src
SubdetFEDSelector.cc
Go to the documentation of this file.
1
2
#include "
Calibration/HcalIsolatedTrackReco/interface/SubdetFEDSelector.h
"
3
4
SubdetFEDSelector::SubdetFEDSelector
(
const
edm::ParameterSet
& iConfig) {
5
getEcal_
= iConfig.
getParameter
<
bool
>(
"getECAL"
);
6
getStrip_
= iConfig.
getParameter
<
bool
>(
"getSiStrip"
);
7
getPixel_
= iConfig.
getParameter
<
bool
>(
"getSiPixel"
);
8
getHcal_
= iConfig.
getParameter
<
bool
>(
"getHCAL"
);
9
getMuon_
= iConfig.
getParameter
<
bool
>(
"getMuon"
);
10
getTrigger_
= iConfig.
getParameter
<
bool
>(
"getTrigger"
);
11
12
tok_raw_
= consumes<FEDRawDataCollection>(iConfig.
getParameter
<
edm::InputTag
>(
"rawInputLabel"
));
13
14
produces<FEDRawDataCollection>();
15
}
16
17
SubdetFEDSelector::~SubdetFEDSelector
() {}
18
19
void
SubdetFEDSelector::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
20
auto
producedData = std::make_unique<FEDRawDataCollection>();
21
22
edm::Handle<FEDRawDataCollection>
rawIn;
23
iEvent
.getByToken(
tok_raw_
, rawIn);
24
25
std::vector<int> selFEDs;
26
27
if
(
getEcal_
) {
28
for
(
int
i
=
FEDNumbering::MINECALFEDID
;
i
<=
FEDNumbering::MAXECALFEDID
;
i
++) {
29
selFEDs.push_back(
i
);
30
}
31
for
(
int
i
=
FEDNumbering::MINPreShowerFEDID
;
i
<=
FEDNumbering::MAXPreShowerFEDID
;
i
++) {
32
selFEDs.push_back(
i
);
33
}
34
}
35
36
if
(
getMuon_
) {
37
for
(
int
i
=
FEDNumbering::MINCSCFEDID
;
i
<=
FEDNumbering::MAXCSCFEDID
;
i
++) {
38
selFEDs.push_back(
i
);
39
}
40
for
(
int
i
=
FEDNumbering::MINCSCTFFEDID
;
i
<=
FEDNumbering::MAXCSCTFFEDID
;
i
++) {
41
selFEDs.push_back(
i
);
42
}
43
for
(
int
i
=
FEDNumbering::MINDTFEDID
;
i
<=
FEDNumbering::MAXDTFEDID
;
i
++) {
44
selFEDs.push_back(
i
);
45
}
46
for
(
int
i
=
FEDNumbering::MINDTTFFEDID
;
i
<=
FEDNumbering::MAXDTTFFEDID
;
i
++) {
47
selFEDs.push_back(
i
);
48
}
49
for
(
int
i
=
FEDNumbering::MINRPCFEDID
;
i
<=
FEDNumbering::MAXRPCFEDID
;
i
++) {
50
selFEDs.push_back(
i
);
51
}
52
for
(
int
i
=
FEDNumbering::MINCSCDDUFEDID
;
i
<=
FEDNumbering::MAXCSCDDUFEDID
;
i
++) {
53
selFEDs.push_back(
i
);
54
}
55
for
(
int
i
=
FEDNumbering::MINCSCContingencyFEDID
;
i
<=
FEDNumbering::MAXCSCContingencyFEDID
;
i
++) {
56
selFEDs.push_back(
i
);
57
}
58
for
(
int
i
=
FEDNumbering::MINCSCTFSPFEDID
;
i
<=
FEDNumbering::MAXCSCTFSPFEDID
;
i
++) {
59
selFEDs.push_back(
i
);
60
}
61
}
62
63
if
(
getHcal_
) {
64
for
(
int
i
=
FEDNumbering::MINHCALFEDID
;
i
<=
FEDNumbering::MAXHCALFEDID
;
i
++) {
65
selFEDs.push_back(
i
);
66
}
67
}
68
69
if
(
getStrip_
) {
70
for
(
int
i
=
FEDNumbering::MINSiStripFEDID
;
i
<=
FEDNumbering::MAXSiStripFEDID
;
i
++) {
71
selFEDs.push_back(
i
);
72
}
73
}
74
75
if
(
getPixel_
) {
76
for
(
int
i
=
FEDNumbering::MINSiPixelFEDID
;
i
<=
FEDNumbering::MAXSiPixelFEDID
;
i
++) {
77
selFEDs.push_back(
i
);
78
}
79
}
80
81
if
(
getTrigger_
) {
82
for
(
int
i
=
FEDNumbering::MINTriggerEGTPFEDID
;
i
<=
FEDNumbering::MAXTriggerEGTPFEDID
;
i
++) {
83
selFEDs.push_back(
i
);
84
}
85
for
(
int
i
=
FEDNumbering::MINTriggerGTPFEDID
;
i
<=
FEDNumbering::MAXTriggerGTPFEDID
;
i
++) {
86
selFEDs.push_back(
i
);
87
}
88
for
(
int
i
=
FEDNumbering::MINTriggerLTCFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCFEDID
;
i
++) {
89
selFEDs.push_back(
i
);
90
}
91
for
(
int
i
=
FEDNumbering::MINTriggerLTCmtccFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCmtccFEDID
;
i
++) {
92
selFEDs.push_back(
i
);
93
}
94
for
(
int
i
=
FEDNumbering::MINTriggerGCTFEDID
;
i
<=
FEDNumbering::MAXTriggerGCTFEDID
;
i
++) {
95
selFEDs.push_back(
i
);
96
}
97
98
for
(
int
i
=
FEDNumbering::MINTriggerLTCTriggerFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCTriggerFEDID
;
i
++) {
99
selFEDs.push_back(
i
);
100
}
101
102
for
(
int
i
=
FEDNumbering::MINTriggerLTCHCALFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCHCALFEDID
;
i
++) {
103
selFEDs.push_back(
i
);
104
}
105
106
for
(
int
i
=
FEDNumbering::MINTriggerLTCSiStripFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCSiStripFEDID
;
i
++) {
107
selFEDs.push_back(
i
);
108
}
109
110
for
(
int
i
=
FEDNumbering::MINTriggerLTCECALFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCECALFEDID
;
i
++) {
111
selFEDs.push_back(
i
);
112
}
113
114
for
(
int
i
=
FEDNumbering::MINTriggerLTCTotemCastorFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCTotemCastorFEDID
;
i
++) {
115
selFEDs.push_back(
i
);
116
}
117
for
(
int
i
=
FEDNumbering::MINTriggerLTCRPCFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCRPCFEDID
;
i
++) {
118
selFEDs.push_back(
i
);
119
}
120
121
for
(
int
i
=
FEDNumbering::MINTriggerLTCCSCFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCCSCFEDID
;
i
++) {
122
selFEDs.push_back(
i
);
123
}
124
for
(
int
i
=
FEDNumbering::MINTriggerLTCDTFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCDTFEDID
;
i
++) {
125
selFEDs.push_back(
i
);
126
}
127
for
(
int
i
=
FEDNumbering::MINTriggerLTCSiPixelFEDID
;
i
<=
FEDNumbering::MAXTriggerLTCSiPixelFEDID
;
i
++) {
128
selFEDs.push_back(
i
);
129
}
130
}
131
132
for
(
int
i
=
FEDNumbering::MINDAQeFEDFEDID
;
i
<=
FEDNumbering::MAXDAQeFEDFEDID
;
i
++) {
133
selFEDs.push_back(
i
);
134
}
135
136
// Copying:
137
const
FEDRawDataCollection
* rdc = rawIn.
product
();
138
139
// if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
140
// continue ; // skip all raw collections not produced by the current process
141
142
for
(
int
j
= 0;
j
<
FEDNumbering::MAXFEDID
; ++
j
) {
143
bool
rightFED =
false
;
144
for
(uint32_t
k
= 0;
k
< selFEDs.size();
k
++) {
145
if
(
j
== selFEDs[
k
]) {
146
rightFED =
true
;
147
}
148
}
149
if
(!rightFED)
150
continue
;
151
const
FEDRawData
& fedData = rdc->
FEDData
(
j
);
152
size_t
size
= fedData.
size
();
153
154
if
(
size
> 0) {
155
// this fed has data -- lets copy it
156
FEDRawData
& fedDataProd = producedData->FEDData(
j
);
157
if
(fedDataProd.
size
() != 0) {
158
// std::cout << " More than one FEDRawDataCollection with data in FED ";
159
// std::cout << j << " Skipping the 2nd\n";
160
continue
;
161
}
162
fedDataProd.
resize
(
size
);
163
unsigned
char
* dataProd = fedDataProd.
data
();
164
const
unsigned
char
*
data
= fedData.
data
();
165
for
(
unsigned
int
k
= 0;
k
<
size
; ++
k
) {
166
dataProd[
k
] =
data
[
k
];
167
}
168
}
169
}
170
171
iEvent
.put(
std::move
(producedData));
172
}
173
174
// ------------ method called once each job just before starting event loop ------------
175
void
SubdetFEDSelector::beginJob
() {}
176
177
// ------------ method called once each job just after ending the event loop ------------
178
void
SubdetFEDSelector::endJob
() {}
FEDNumbering::MINTriggerLTCFEDID
Definition:
FEDNumbering.h:67
FEDNumbering::MAXTriggerLTCSiStripFEDID
Definition:
FEDNumbering.h:76
SubdetFEDSelector::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
SubdetFEDSelector.cc:19
FEDNumbering::MINCSCFEDID
Definition:
FEDNumbering.h:51
mps_fire.i
i
Definition:
mps_fire.py:428
FEDNumbering::MAXTriggerLTCCSCFEDID
Definition:
FEDNumbering.h:84
FEDNumbering::MINTriggerEGTPFEDID
Definition:
FEDNumbering.h:63
FEDNumbering::MAXCSCTFFEDID
Definition:
FEDNumbering.h:54
FEDNumbering::MINTriggerLTCRPCFEDID
Definition:
FEDNumbering.h:81
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
FEDNumbering::MAXTriggerLTCFEDID
Definition:
FEDNumbering.h:68
FEDNumbering::MAXTriggerLTCECALFEDID
Definition:
FEDNumbering.h:78
FEDNumbering::MINSiPixelFEDID
Definition:
FEDNumbering.h:27
FEDNumbering::MAXTriggerLTCRPCFEDID
Definition:
FEDNumbering.h:82
FEDNumbering::MAXSiPixelFEDID
Definition:
FEDNumbering.h:28
FEDRawDataCollection
Definition:
FEDRawDataCollection.h:18
FEDNumbering::MINDTTFFEDID
Definition:
FEDNumbering.h:57
FEDNumbering::MAXCSCDDUFEDID
Definition:
FEDNumbering.h:90
FEDNumbering::MINTriggerGCTFEDID
Definition:
FEDNumbering.h:65
FEDNumbering::MINTriggerLTCSiStripFEDID
Definition:
FEDNumbering.h:75
FEDNumbering::MAXFEDID
Definition:
FEDNumbering.h:26
FEDNumbering::MAXECALFEDID
Definition:
FEDNumbering.h:44
FEDNumbering::MAXDTFEDID
Definition:
FEDNumbering.h:56
SubdetFEDSelector::getMuon_
bool getMuon_
Definition:
SubdetFEDSelector.h:28
edm::Handle< FEDRawDataCollection >
FEDNumbering::MAXTriggerGCTFEDID
Definition:
FEDNumbering.h:66
FEDNumbering::MINTriggerLTCCSCFEDID
Definition:
FEDNumbering.h:83
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition:
FEDRawData.cc:24
FEDRawData
Definition:
FEDRawData.h:19
FEDNumbering::MINTriggerGTPFEDID
Definition:
FEDNumbering.h:61
FEDNumbering::MAXHCALFEDID
Definition:
FEDNumbering.h:48
SubdetFEDSelector::endJob
void endJob() override
Definition:
SubdetFEDSelector.cc:178
FEDNumbering::MAXTriggerLTCTotemCastorFEDID
Definition:
FEDNumbering.h:80
FEDNumbering::MINTriggerLTCHCALFEDID
Definition:
FEDNumbering.h:73
FEDNumbering::MAXTriggerGTPFEDID
Definition:
FEDNumbering.h:62
SubdetFEDSelector::getTrigger_
bool getTrigger_
Definition:
SubdetFEDSelector.h:29
FEDNumbering::MINSiStripFEDID
Definition:
FEDNumbering.h:29
FEDNumbering::MINRPCFEDID
Definition:
FEDNumbering.h:59
FEDNumbering::MINDAQeFEDFEDID
Definition:
FEDNumbering.h:95
SubdetFEDSelector::getStrip_
bool getStrip_
Definition:
SubdetFEDSelector.h:26
FEDNumbering::MAXCSCTFSPFEDID
Definition:
FEDNumbering.h:94
FEDNumbering::MAXDTTFFEDID
Definition:
FEDNumbering.h:58
dqmdumpme.k
k
Definition:
dqmdumpme.py:60
FEDNumbering::MINTriggerLTCTriggerFEDID
Definition:
FEDNumbering.h:71
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition:
FEDRawDataCollection.cc:19
FEDNumbering::MAXDAQeFEDFEDID
Definition:
FEDNumbering.h:96
edm::ParameterSet
Definition:
ParameterSet.h:47
FEDNumbering::MINTriggerLTCTotemCastorFEDID
Definition:
FEDNumbering.h:79
FEDNumbering::MINHCALFEDID
Definition:
FEDNumbering.h:47
SubdetFEDSelector::getPixel_
bool getPixel_
Definition:
SubdetFEDSelector.h:27
FEDNumbering::MINCSCDDUFEDID
Definition:
FEDNumbering.h:89
iEvent
int iEvent
Definition:
GenABIO.cc:224
FEDNumbering::MINPreShowerFEDID
Definition:
FEDNumbering.h:31
FEDNumbering::MAXTriggerLTCDTFEDID
Definition:
FEDNumbering.h:86
SubdetFEDSelector::getEcal_
bool getEcal_
Definition:
SubdetFEDSelector.h:24
edm::EventSetup
Definition:
EventSetup.h:58
FEDNumbering::MAXTriggerLTCTriggerFEDID
Definition:
FEDNumbering.h:72
SubdetFEDSelector::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition:
SubdetFEDSelector.h:31
FEDNumbering::MAXTriggerLTCmtccFEDID
Definition:
FEDNumbering.h:70
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition:
FEDRawData.h:45
FEDNumbering::MINCSCTFFEDID
Definition:
FEDNumbering.h:53
FEDNumbering::MINCSCContingencyFEDID
Definition:
FEDNumbering.h:91
FEDNumbering::MINTriggerLTCmtccFEDID
Definition:
FEDNumbering.h:69
SubdetFEDSelector::SubdetFEDSelector
SubdetFEDSelector(const edm::ParameterSet &)
Definition:
SubdetFEDSelector.cc:4
eostools.move
def move(src, dest)
Definition:
eostools.py:511
FEDNumbering::MAXTriggerLTCSiPixelFEDID
Definition:
FEDNumbering.h:88
FEDNumbering::MAXTriggerEGTPFEDID
Definition:
FEDNumbering.h:64
SubdetFEDSelector::~SubdetFEDSelector
~SubdetFEDSelector() override
Definition:
SubdetFEDSelector.cc:17
FEDNumbering::MAXCSCFEDID
Definition:
FEDNumbering.h:52
FEDRawData::resize
void resize(size_t newsize)
Definition:
FEDRawData.cc:28
FEDNumbering::MINTriggerLTCDTFEDID
Definition:
FEDNumbering.h:85
SubdetFEDSelector.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
SubdetFEDSelector::beginJob
void beginJob() override
Definition:
SubdetFEDSelector.cc:175
FEDNumbering::MINECALFEDID
Definition:
FEDNumbering.h:43
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
FEDNumbering::MAXSiStripFEDID
Definition:
FEDNumbering.h:30
FEDNumbering::MAXCSCContingencyFEDID
Definition:
FEDNumbering.h:92
FEDNumbering::MINCSCTFSPFEDID
Definition:
FEDNumbering.h:93
FEDNumbering::MINDTFEDID
Definition:
FEDNumbering.h:55
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
FEDNumbering::MINTriggerLTCSiPixelFEDID
Definition:
FEDNumbering.h:87
edm::Event
Definition:
Event.h:73
FEDNumbering::MAXRPCFEDID
Definition:
FEDNumbering.h:60
edm::InputTag
Definition:
InputTag.h:15
SubdetFEDSelector::getHcal_
bool getHcal_
Definition:
SubdetFEDSelector.h:25
FEDNumbering::MINTriggerLTCECALFEDID
Definition:
FEDNumbering.h:77
FEDNumbering::MAXTriggerLTCHCALFEDID
Definition:
FEDNumbering.h:74
FEDNumbering::MAXPreShowerFEDID
Definition:
FEDNumbering.h:32
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
Generated for CMSSW Reference Manual by
1.8.16