CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HEFRecHitFromSoA Class Reference
Inheritance diagram for HEFRecHitFromSoA:
edm::stream::EDProducer<>

Public Member Functions

void convert_soa_data_to_collection_ (uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)
 
 HEFRecHitFromSoA (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HEFRecHitFromSoA () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::EDPutTokenT< HGChefRecHitCollectionrecHitCollectionToken_
 
std::unique_ptr< HGChefRecHitCollectionrechits_
 
edm::EDGetTokenT< HGCRecHitCPUProductrecHitSoAToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 12 of file HEFRecHitFromSoA.cc.

Constructor & Destructor Documentation

◆ HEFRecHitFromSoA()

HEFRecHitFromSoA::HEFRecHitFromSoA ( const edm::ParameterSet ps)
explicit

Definition at line 26 of file HEFRecHitFromSoA.cc.

26  {
27  recHitSoAToken_ = consumes<HGCRecHitCPUProduct>(ps.getParameter<edm::InputTag>("HEFRecHitSoATok"));
28  recHitCollectionToken_ = produces<HGChefRecHitCollection>();
29 }

References edm::ParameterSet::getParameter(), recHitCollectionToken_, and recHitSoAToken_.

◆ ~HEFRecHitFromSoA()

HEFRecHitFromSoA::~HEFRecHitFromSoA ( )
override

Definition at line 31 of file HEFRecHitFromSoA.cc.

31 {}

Member Function Documentation

◆ convert_soa_data_to_collection_()

void HEFRecHitFromSoA::convert_soa_data_to_collection_ ( uint32_t  nhits,
HGCRecHitCollection rechits,
ConstHGCRecHitSoA h_calibSoA 
)

Definition at line 41 of file HEFRecHitFromSoA.cc.

43  {
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 }

References ConstHGCRecHitSoA::energy_, ConstHGCRecHitSoA::flagBits_, mps_fire::i, ConstHGCRecHitSoA::id_, nhits, HI_PhotonSkim_cff::rechits, ConstHGCRecHitSoA::son_, ConstHGCRecHitSoA::time_, ConstHGCRecHitSoA::timeError_, and parallelization::uint.

Referenced by produce().

◆ produce()

void HEFRecHitFromSoA::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 33 of file HEFRecHitFromSoA.cc.

33  {
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 }

References convert_soa_data_to_collection_(), eostools::move(), FastTrackerRecHitMaskProducer_cfi::recHits, rechits_, and recHitSoAToken_.

Member Data Documentation

◆ recHitCollectionToken_

edm::EDPutTokenT<HGChefRecHitCollection> HEFRecHitFromSoA::recHitCollectionToken_
private

Definition at line 23 of file HEFRecHitFromSoA.cc.

Referenced by HEFRecHitFromSoA().

◆ rechits_

std::unique_ptr<HGChefRecHitCollection> HEFRecHitFromSoA::rechits_
private

Definition at line 21 of file HEFRecHitFromSoA.cc.

Referenced by produce().

◆ recHitSoAToken_

edm::EDGetTokenT<HGCRecHitCPUProduct> HEFRecHitFromSoA::recHitSoAToken_
private

Definition at line 22 of file HEFRecHitFromSoA.cc.

Referenced by HEFRecHitFromSoA(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
HEFRecHitFromSoA::recHitCollectionToken_
edm::EDPutTokenT< HGChefRecHitCollection > recHitCollectionToken_
Definition: HEFRecHitFromSoA.cc:23
HGCRecHitCPUProduct
Definition: HGCRecHitCPUProduct.h:12
HEFRecHitFromSoA::convert_soa_data_to_collection_
void convert_soa_data_to_collection_(uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)
Definition: HEFRecHitFromSoA.cc:41
ConstHGCRecHitSoA::energy_
const float * energy_
Definition: ConstHGCRecHitSoA.h:8
parallelization.uint
uint
Definition: parallelization.py:124
ConstHGCRecHitSoA::son_
const uint8_t * son_
Definition: ConstHGCRecHitSoA.h:13
DetId
Definition: DetId.h:17
ConstHGCRecHitSoA::time_
const float * time_
Definition: ConstHGCRecHitSoA.h:9
HEFRecHitFromSoA::recHitSoAToken_
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
Definition: HEFRecHitFromSoA.cc:22
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
nhits
Definition: HIMultiTrackSelector.h:42
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
HEFRecHitFromSoA::rechits_
std::unique_ptr< HGChefRecHitCollection > rechits_
Definition: HEFRecHitFromSoA.cc:21
ConstHGCRecHitSoA::flagBits_
const uint32_t * flagBits_
Definition: ConstHGCRecHitSoA.h:12
ConstHGCRecHitSoA::timeError_
const float * timeError_
Definition: ConstHGCRecHitSoA.h:10
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
edm::InputTag
Definition: InputTag.h:15
ConstHGCRecHitSoA::id_
const uint32_t * id_
Definition: ConstHGCRecHitSoA.h:11