CMS 3D CMS Logo

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

Public Member Functions

void convert_soa_data_to_collection_ (uint32_t, HGCRecHitCollection &, ConstHGCRecHitSoA *)
 
 EERecHitFromSoA (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EERecHitFromSoA () 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< HGCeeRecHitCollectionrecHitCollectionToken_
 
std::unique_ptr< HGCeeRecHitCollectionrechits_
 
edm::EDGetTokenT< HGCRecHitCPUProductrecHitSoAToken_
 

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 12 of file EERecHitFromSoA.cc.

Constructor & Destructor Documentation

◆ EERecHitFromSoA()

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

Definition at line 26 of file EERecHitFromSoA.cc.

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

26  {
27  recHitSoAToken_ = consumes<HGCRecHitCPUProduct>(ps.getParameter<edm::InputTag>("EERecHitSoATok"));
28  recHitCollectionToken_ = produces<HGCeeRecHitCollection>();
29 }
edm::EDGetTokenT< HGCRecHitCPUProduct > recHitSoAToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDPutTokenT< HGCeeRecHitCollection > recHitCollectionToken_

◆ ~EERecHitFromSoA()

EERecHitFromSoA::~EERecHitFromSoA ( )
override

Definition at line 31 of file EERecHitFromSoA.cc.

31 {}

Member Function Documentation

◆ convert_soa_data_to_collection_()

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

Definition at line 41 of file EERecHitFromSoA.cc.

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().

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 }
uint32_t const * id_
float const * time_
Definition: DetId.h:17
float const * energy_
uint32_t const * flagBits_
float const * timeError_
uint8_t const * son_

◆ produce()

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

Definition at line 33 of file EERecHitFromSoA.cc.

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

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

Member Data Documentation

◆ recHitCollectionToken_

edm::EDPutTokenT<HGCeeRecHitCollection> EERecHitFromSoA::recHitCollectionToken_
private

Definition at line 23 of file EERecHitFromSoA.cc.

Referenced by EERecHitFromSoA().

◆ rechits_

std::unique_ptr<HGCeeRecHitCollection> EERecHitFromSoA::rechits_
private

Definition at line 21 of file EERecHitFromSoA.cc.

Referenced by produce().

◆ recHitSoAToken_

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

Definition at line 22 of file EERecHitFromSoA.cc.

Referenced by EERecHitFromSoA(), and produce().