CMS 3D CMS Logo

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

Public Member Functions

 LegacyPFRecHitProducer (edm::ParameterSet const &config)
 
- 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const edm::EDGetTokenT< reco::PFRecHitHostCollectionalpakaPfRecHitsToken_
 
std::unordered_map< PFLayer::Layer, const CaloSubdetectorGeometry * > caloGeo_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomToken_
 
const edm::EDPutTokenT< reco::PFRecHitCollectionlegacyPfRecHitsToken_
 

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 20 of file LegacyPFRecHitProducer.cc.

Constructor & Destructor Documentation

◆ LegacyPFRecHitProducer()

LegacyPFRecHitProducer::LegacyPFRecHitProducer ( edm::ParameterSet const &  config)
inline

Definition at line 22 of file LegacyPFRecHitProducer.cc.

23  : alpakaPfRecHitsToken_(consumes(config.getParameter<edm::InputTag>("src"))),
24  legacyPfRecHitsToken_(produces()),
25  geomToken_(esConsumes<edm::Transition::BeginRun>()) {}
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
Definition: config.py:1
const edm::EDPutTokenT< reco::PFRecHitCollection > legacyPfRecHitsToken_
const edm::EDGetTokenT< reco::PFRecHitHostCollection > alpakaPfRecHitsToken_

Member Function Documentation

◆ beginRun()

void LegacyPFRecHitProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  setup 
)
overrideprivate

Definition at line 44 of file LegacyPFRecHitProducer.cc.

References caloGeo_, DetId::Ecal, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, EcalBarrel, EcalEndcap, geomToken_, CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, HcalBarrel, HcalEndcap, and singleTopDQM_cfi::setup.

44  {
45  const CaloGeometry& geo = setup.getData(geomToken_);
50 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
std::unordered_map< PFLayer::Layer, const CaloSubdetectorGeometry * > caloGeo_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ fillDescriptions()

static void LegacyPFRecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

◆ produce()

void LegacyPFRecHitProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
overrideprivate

Definition at line 52 of file LegacyPFRecHitProducer.cc.

References reco::PFRecHit::addNeighbour(), alpakaPfRecHitsToken_, caloGeo_, PortableHostCollection< T >::const_view(), hcalRecHitTable_cff::depth, hcalRecHitTable_cff::detId, PVValHelper::eta, mps_fire::i, dqmdumpme::k, legacyPfRecHitsToken_, MillePedeFileConverter_cfg::out, phi, reco::PFRecHit::setDepth(), reco::PFRecHit::setTime(), and hcalRecHitTable_cff::time.

52  {
53  const reco::PFRecHitHostCollection& pfRecHitsAlpakaSoA = event.get(alpakaPfRecHitsToken_);
54  const reco::PFRecHitHostCollection::ConstView& alpakaPfRecHits = pfRecHitsAlpakaSoA.const_view();
55 
57  out.reserve(alpakaPfRecHits.size());
58 
59  for (size_t i = 0; i < alpakaPfRecHits.size(); i++) {
60  reco::PFRecHit& pfrh =
61  out.emplace_back(caloGeo_.at(alpakaPfRecHits[i].layer())->getGeometry(alpakaPfRecHits[i].detId()),
62  alpakaPfRecHits[i].detId(),
63  alpakaPfRecHits[i].layer(),
64  alpakaPfRecHits[i].energy());
65  pfrh.setTime(alpakaPfRecHits[i].time());
66  pfrh.setDepth(alpakaPfRecHits[i].depth());
67 
68  // order in Alpaka: N, S, E, W,NE,SW,SE,NW
69  const short eta[8] = {0, 0, 1, -1, 1, -1, 1, -1};
70  const short phi[8] = {1, -1, 0, 0, 1, -1, -1, 1};
71  for (size_t k = 0; k < 8; k++)
72  if (alpakaPfRecHits[i].neighbours()(k) != -1)
73  pfrh.addNeighbour(eta[k], phi[k], 0, alpakaPfRecHits[i].neighbours()(k));
74  }
75 
76  event.emplace(legacyPfRecHitsToken_, out);
77 }
void setDepth(int depth)
Definition: PFRecHit.h:74
void addNeighbour(short x, short y, short z, unsigned int)
Definition: PFRecHit.cc:5
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
ConstView const & const_view() const
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
const edm::EDPutTokenT< reco::PFRecHitCollection > legacyPfRecHitsToken_
void setTime(double time)
Definition: PFRecHit.h:73
std::unordered_map< PFLayer::Layer, const CaloSubdetectorGeometry * > caloGeo_
typename Layout::ConstView ConstView
const edm::EDGetTokenT< reco::PFRecHitHostCollection > alpakaPfRecHitsToken_

Member Data Documentation

◆ alpakaPfRecHitsToken_

const edm::EDGetTokenT<reco::PFRecHitHostCollection> LegacyPFRecHitProducer::alpakaPfRecHitsToken_
private

Definition at line 37 of file LegacyPFRecHitProducer.cc.

Referenced by produce().

◆ caloGeo_

std::unordered_map<PFLayer::Layer, const CaloSubdetectorGeometry*> LegacyPFRecHitProducer::caloGeo_
private

Definition at line 41 of file LegacyPFRecHitProducer.cc.

Referenced by beginRun(), and produce().

◆ geomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> LegacyPFRecHitProducer::geomToken_
private

Definition at line 40 of file LegacyPFRecHitProducer.cc.

Referenced by beginRun().

◆ legacyPfRecHitsToken_

const edm::EDPutTokenT<reco::PFRecHitCollection> LegacyPFRecHitProducer::legacyPfRecHitsToken_
private

Definition at line 38 of file LegacyPFRecHitProducer.cc.

Referenced by produce().