RecoLocalCalo
HGCalRecProducers
plugins
EERecHitFromSoA.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
DataFormats/HGCRecHit/interface/HGCRecHit.h
"
4
#include "
DataFormats/HGCRecHit/interface/HGCRecHitCollections.h
"
5
#include "
DataFormats/ForwardDetId/interface/HGCSiliconDetId.h
"
6
#include "
FWCore/Utilities/interface/EDGetToken.h
"
7
#include "
FWCore/Utilities/interface/EDPutToken.h
"
8
9
#include "
CUDADataFormats/HGCal/interface/HGCRecHitCPUProduct.h
"
10
#include "
CUDADataFormats/HGCal/interface/ConstHGCRecHitSoA.h
"
11
12
class
EERecHitFromSoA
:
public
edm::stream::EDProducer
<> {
13
public
:
14
explicit
EERecHitFromSoA
(
const
edm::ParameterSet
& ps);
15
~EERecHitFromSoA
()
override
;
16
17
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
18
void
convert_soa_data_to_collection_
(uint32_t,
HGCRecHitCollection
&,
ConstHGCRecHitSoA
*);
19
20
private
:
21
std::unique_ptr<HGCeeRecHitCollection>
rechits_
;
22
edm::EDGetTokenT<HGCRecHitCPUProduct>
recHitSoAToken_
;
23
edm::EDPutTokenT<HGCeeRecHitCollection>
recHitCollectionToken_
;
24
};
25
26
EERecHitFromSoA::EERecHitFromSoA
(
const
edm::ParameterSet
& ps) {
27
recHitSoAToken_
= consumes<HGCRecHitCPUProduct>(ps.
getParameter
<
edm::InputTag
>(
"EERecHitSoATok"
));
28
recHitCollectionToken_
= produces<HGCeeRecHitCollection>();
29
}
30
31
EERecHitFromSoA::~EERecHitFromSoA
() {}
32
33
void
EERecHitFromSoA::produce
(
edm::Event
&
event
,
const
edm::EventSetup
&
setup
) {
34
const
HGCRecHitCPUProduct
&
recHits
=
event
.get(
recHitSoAToken_
);
35
ConstHGCRecHitSoA
recHitsSoA =
recHits
.get();
36
rechits_
= std::make_unique<HGCRecHitCollection>();
37
convert_soa_data_to_collection_
(
recHits
.nHits(), *
rechits_
, &recHitsSoA);
38
event
.put(
std::move
(
rechits_
));
39
}
40
41
void
EERecHitFromSoA::convert_soa_data_to_collection_
(uint32_t
nhits
,
42
HGCRecHitCollection
&
rechits
,
43
ConstHGCRecHitSoA
* h_calibSoA) {
44
rechits
.reserve(
nhits
);
45
for
(
uint
i
= 0;
i
<
nhits
; ++
i
) {
46
DetId
id_converted(h_calibSoA->
id_
[
i
]);
47
rechits
.emplace_back(id_converted,
48
h_calibSoA->
energy_
[
i
],
49
h_calibSoA->
time_
[
i
],
50
0,
51
h_calibSoA->
flagBits_
[
i
],
52
h_calibSoA->
son_
[
i
],
53
h_calibSoA->
timeError_
[
i
]);
54
}
55
}
56
57
#include "
FWCore/Framework/interface/MakerMacros.h
"
58
DEFINE_FWK_MODULE
(
EERecHitFromSoA
);
EERecHitFromSoA::EERecHitFromSoA
EERecHitFromSoA(const edm::ParameterSet &ps)
Definition:
EERecHitFromSoA.cc:26
EERecHitFromSoA
Definition:
EERecHitFromSoA.cc:12
mps_fire.i
i
Definition:
mps_fire.py:428
ConstHGCRecHitSoA.h
HGCRecHitCPUProduct
Definition:
HGCRecHitCPUProduct.h:12
edm::EDGetTokenT< HGCRecHitCPUProduct >
edm::EDPutTokenT
Definition:
EDPutToken.h:33
HGCSiliconDetId.h
EERecHitFromSoA::recHitSoAToken_
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
Definition:
EERecHitFromSoA.cc:22
EDProducer.h
edm::SortedCollection
Definition:
SortedCollection.h:49
EERecHitFromSoA::~EERecHitFromSoA
~EERecHitFromSoA() override
Definition:
EERecHitFromSoA.cc:31
ConstHGCRecHitSoA::energy_
const float * energy_
Definition:
ConstHGCRecHitSoA.h:8
HGCRecHitCPUProduct.h
parallelization.uint
uint
Definition:
parallelization.py:124
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
ConstHGCRecHitSoA::son_
const uint8_t * son_
Definition:
ConstHGCRecHitSoA.h:13
DetId
Definition:
DetId.h:17
MakerMacros.h
ConstHGCRecHitSoA::time_
const float * time_
Definition:
ConstHGCRecHitSoA.h:9
HGCRecHit.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
EERecHitFromSoA::convert_soa_data_to_collection_
void convert_soa_data_to_collection_(uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)
Definition:
EERecHitFromSoA.cc:41
HI_PhotonSkim_cff.rechits
rechits
Definition:
HI_PhotonSkim_cff.py:76
nhits
Definition:
HIMultiTrackSelector.h:42
EDGetToken.h
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition:
FastTrackerRecHitMaskProducer_cfi.py:8
HGCRecHitCollections.h
edm::ParameterSet
Definition:
ParameterSet.h:47
EDPutToken.h
EERecHitFromSoA::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
EERecHitFromSoA.cc:33
ConstHGCRecHitSoA::flagBits_
const uint32_t * flagBits_
Definition:
ConstHGCRecHitSoA.h:12
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:58
ConstHGCRecHitSoA::timeError_
const float * timeError_
Definition:
ConstHGCRecHitSoA.h:10
EERecHitFromSoA::rechits_
std::unique_ptr< HGCeeRecHitCollection > rechits_
Definition:
EERecHitFromSoA.cc:21
eostools.move
def move(src, dest)
Definition:
eostools.py:511
ConstHGCRecHitSoA
Definition:
ConstHGCRecHitSoA.h:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ParameterSet.h
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
ConstHGCRecHitSoA::id_
const uint32_t * id_
Definition:
ConstHGCRecHitSoA.h:11
EERecHitFromSoA::recHitCollectionToken_
edm::EDPutTokenT< HGCeeRecHitCollection > recHitCollectionToken_
Definition:
EERecHitFromSoA.cc:23
Generated for CMSSW Reference Manual by
1.8.16