CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HEBRecHitFromSoA Class Reference
Inheritance diagram for HEBRecHitFromSoA:
edm::stream::EDProducer<>

Public Member Functions

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

Private Attributes

edm::EDPutTokenT
< HGChefRecHitCollection
recHitCollectionToken_
 
std::unique_ptr
< HGChefRecHitCollection
rechits_
 
edm::EDGetTokenT
< HGCRecHitCPUProduct
recHitSoAToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 14 of file HEBRecHitFromSoA.cc.

Constructor & Destructor Documentation

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

Definition at line 28 of file HEBRecHitFromSoA.cc.

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

28  {
29  recHitSoAToken_ = consumes<HGCRecHitCPUProduct>(ps.getParameter<edm::InputTag>("HEBRecHitSoATok"));
30  recHitCollectionToken_ = produces<HGChebRecHitCollection>();
31 }
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDPutTokenT< HGChefRecHitCollection > recHitCollectionToken_
HEBRecHitFromSoA::~HEBRecHitFromSoA ( )
override

Definition at line 33 of file HEBRecHitFromSoA.cc.

33 {}

Member Function Documentation

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

Definition at line 43 of file HEBRecHitFromSoA.cc.

References ConstHGCRecHitSoA::energy_, ConstHGCRecHitSoA::flagBits_, mps_fire::i, ConstHGCRecHitSoA::id_, nhits, edm::SortedCollection< T, SORT >::reserve(), ConstHGCRecHitSoA::son_, ConstHGCRecHitSoA::time_, ConstHGCRecHitSoA::timeError_, and parallelization::uint().

Referenced by produce().

45  {
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 }
uint32_t const * id_
float const * time_
Definition: DetId.h:17
float const * energy_
uint32_t const * flagBits_
void reserve(size_type n)
float const * timeError_
uint8_t const * son_
void HEBRecHitFromSoA::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 35 of file HEBRecHitFromSoA.cc.

References convert_soa_data_to_collection_(), HGCRecHitCPUProduct::get(), eostools::move(), HGCRecHitCPUProduct::nHits(), HLT_FULL_cff::recHits, rechits_, and recHitSoAToken_.

35  {
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 }
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
uint32_t nHits() const
std::unique_ptr< HGChefRecHitCollection > rechits_
def move
Definition: eostools.py:511
void convert_soa_data_to_collection_(uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)

Member Data Documentation

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

Definition at line 25 of file HEBRecHitFromSoA.cc.

Referenced by HEBRecHitFromSoA().

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

Definition at line 23 of file HEBRecHitFromSoA.cc.

Referenced by produce().

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

Definition at line 24 of file HEBRecHitFromSoA.cc.

Referenced by HEBRecHitFromSoA(), and produce().