CMS 3D CMS Logo

HEBRecHitFromSoA.cc
Go to the documentation of this file.
1 #include <memory>
2 
10 
13 
15 public:
16  explicit HEBRecHitFromSoA(const edm::ParameterSet& ps);
17  ~HEBRecHitFromSoA() override;
18 
19  void produce(edm::Event&, const edm::EventSetup&) override;
21 
22 private:
23  std::unique_ptr<HGChefRecHitCollection> rechits_;
26 };
27 
29  recHitSoAToken_ = consumes<HGCRecHitCPUProduct>(ps.getParameter<edm::InputTag>("HEBRecHitSoATok"));
30  recHitCollectionToken_ = produces<HGChebRecHitCollection>();
31 }
32 
34 
36  const HGCRecHitCPUProduct& recHits = event.get(recHitSoAToken_);
37  ConstHGCRecHitSoA recHitsSoA = recHits.get();
38  rechits_ = std::make_unique<HGCRecHitCollection>();
39  convert_soa_data_to_collection_(recHits.nHits(), *rechits_, &recHitsSoA);
40  event.put(std::move(rechits_));
41 }
42 
45  ConstHGCRecHitSoA* h_calibSoA) {
46  rechits.reserve(nhits);
47  for (uint i = 0; i < nhits; ++i) {
48  DetId id_converted(h_calibSoA->id_[i]);
49  rechits.emplace_back(id_converted,
50  h_calibSoA->energy_[i],
51  h_calibSoA->time_[i],
52  0,
53  h_calibSoA->flagBits_[i],
54  h_calibSoA->son_[i],
55  h_calibSoA->timeError_[i]);
56  }
57 }
58 
HEBRecHitFromSoA::convert_soa_data_to_collection_
void convert_soa_data_to_collection_(uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)
Definition: HEBRecHitFromSoA.cc:43
mps_fire.i
i
Definition: mps_fire.py:428
HEBRecHitFromSoA::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HEBRecHitFromSoA.cc:35
ConstHGCRecHitSoA.h
HEBRecHitFromSoA::HEBRecHitFromSoA
HEBRecHitFromSoA(const edm::ParameterSet &ps)
Definition: HEBRecHitFromSoA.cc:28
HGCRecHitCPUProduct
Definition: HGCRecHitCPUProduct.h:12
edm::EDGetTokenT< HGCRecHitCPUProduct >
edm::EDPutTokenT
Definition: EDPutToken.h:33
HEBRecHitFromSoA::recHitCollectionToken_
edm::EDPutTokenT< HGChefRecHitCollection > recHitCollectionToken_
Definition: HEBRecHitFromSoA.cc:25
HGCSiliconDetId.h
EDProducer.h
edm::SortedCollection
Definition: SortedCollection.h:49
HEBRecHitFromSoA
Definition: HEBRecHitFromSoA.cc:14
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
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
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
HEBRecHitFromSoA::~HEBRecHitFromSoA
~HEBRecHitFromSoA() override
Definition: HEBRecHitFromSoA.cc:33
eostools.move
def move(src, dest)
Definition: eostools.py:511
ConstHGCRecHitSoA
Definition: ConstHGCRecHitSoA.h:6
HEBRecHitFromSoA::recHitSoAToken_
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
Definition: HEBRecHitFromSoA.cc:24
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
HEBRecHitFromSoA::rechits_
std::unique_ptr< HGChefRecHitCollection > rechits_
Definition: HEBRecHitFromSoA.cc:23