Skip to content

Commit

Permalink
Cleanup of PRRecHit producer update for HCAL
Browse files Browse the repository at this point in the history
  • Loading branch information
hatakeyamak committed Feb 26, 2020
1 parent 6b156b8 commit b73f9f8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 200 deletions.
Expand Up @@ -35,17 +35,17 @@ class PFHCALDenseIdNavigator : public PFRecHitNavigatorBase {
}

void init(const edm::EventSetup& iSetup) override {

/*
if (!neighboursHcal_.empty())
return; // neighboursHcal_ is already defined. No need to redefine it.
*/
bool check = theRecNumberWatcher_.check(iSetup);
std::cout << "check: " << check << " " << neighboursHcal_.size() << std::endl;
if (!check) return;
if (!check)
return;

//std::cout << "checking" << std::endl;

edm::ESHandle<HcalTopology> hcalTopology;
iSetup.get<HcalRecNumberingRecord>().get(hcalTopology);
topology_.release();
Expand Down

This file was deleted.

19 changes: 16 additions & 3 deletions RecoParticleFlow/PFClusterProducer/plugins/Navigators.cc
Expand Up @@ -6,7 +6,7 @@
#include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitDualNavigator.h"
#include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h"
#include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigatorWithTime.h"
#include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitHCALCachedNavigator.h"
#include "RecoParticleFlow/PFClusterProducer/interface/PFHCALDenseIdNavigator.h"
#include "RecoParticleFlow/PFClusterProducer/interface/PFECALHashNavigator.h"
#include "RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h"

Expand Down Expand Up @@ -61,9 +61,21 @@ class PFRecHitPreshowerNavigator final : public PFRecHitCaloNavigator<ESDetId, E
void init(const edm::EventSetup& iSetup) override { topology_ = std::make_unique<EcalPreshowerTopology>(); }
};

class PFRecHitHCALNavigator final : public PFRecHitHCALCachedNavigator<HcalDetId, HcalTopology, false> {
class PFRecHitHCALDenseIdNavigator final : public PFHCALDenseIdNavigator<HcalDetId, HcalTopology, false> {
public:
PFRecHitHCALNavigator(const edm::ParameterSet& iConfig) : PFRecHitHCALCachedNavigator(iConfig) {}
PFRecHitHCALDenseIdNavigator(const edm::ParameterSet& iConfig) : PFHCALDenseIdNavigator(iConfig) {}
};

class PFRecHitHCALNavigator : public PFRecHitCaloNavigator<HcalDetId, HcalTopology, false> {
public:
PFRecHitHCALNavigator(const edm::ParameterSet& iConfig) {}

void init(const edm::EventSetup& iSetup) override {
edm::ESHandle<HcalTopology> hcalTopology;
iSetup.get<HcalRecNumberingRecord>().get(hcalTopology);
topology_.release();
topology_.reset(hcalTopology.product());
}
};

class PFRecHitHCALNavigatorWithTime : public PFRecHitCaloNavigatorWithTime<HcalDetId, HcalTopology, false> {
Expand Down Expand Up @@ -145,6 +157,7 @@ DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitECALNavigator, "PFRecHitECA
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitECALNavigatorWithTime, "PFRecHitECALNavigatorWithTime");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitCaloTowerNavigator, "PFRecHitCaloTowerNavigator");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitPreshowerNavigator, "PFRecHitPreshowerNavigator");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALDenseIdNavigator, "PFRecHitHCALDenseIdNavigator");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALNavigator, "PFRecHitHCALNavigator");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALNavigatorWithTime, "PFRecHitHCALNavigatorWithTime");
DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHGCEENavigator, "PFRecHitHGCEENavigator");
Expand Down
Expand Up @@ -30,14 +30,14 @@ PFRecHitProducer::~PFRecHitProducer() = default;
// member functions
//

void PFRecHitProducer::beginRun(const edm::Run&, const edm::EventSetup& iSetup) {
void PFRecHitProducer::beginLuminosityBlock(edm::LuminosityBlock const& iLumi, const edm::EventSetup& iSetup) {
for (const auto& creator : creators_) {
creator->init(iSetup);
}
navigator_->init(iSetup);
}

void PFRecHitProducer::endRun(const edm::Run&, const edm::EventSetup&) {}
void PFRecHitProducer::endLuminosityBlock(edm::LuminosityBlock const& iLumi, const edm::EventSetup&) {}

// ------------ method called to produce the data ------------
void PFRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
Expand Down
4 changes: 2 additions & 2 deletions RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h
Expand Up @@ -27,8 +27,8 @@ class PFRecHitProducer final : public edm::stream::EDProducer<> {

private:
void produce(edm::Event&, const edm::EventSetup&) override;
void beginRun(const edm::Run&, const edm::EventSetup&) override;
void endRun(const edm::Run&, const edm::EventSetup&) override;
void beginLuminosityBlock(edm::LuminosityBlock const&, const edm::EventSetup&) override;
void endLuminosityBlock(edm::LuminosityBlock const&, const edm::EventSetup&) override;
std::vector<std::unique_ptr<PFRecHitCreatorBase> > creators_;
std::unique_ptr<PFRecHitNavigatorBase> navigator_;
bool init_;
Expand Down
Expand Up @@ -9,7 +9,7 @@

particleFlowRecHitHBHE = cms.EDProducer("PFRecHitProducer",
navigator = cms.PSet(
name = cms.string("PFRecHitHCALNavigator"),
name = cms.string("PFRecHitHCALDenseIdNavigator"),
detectorEnums = cms.vint32(1,2)
),
producers = cms.VPSet(
Expand Down
Expand Up @@ -5,7 +5,7 @@
particleFlowRecHitHF = cms.EDProducer("PFRecHitProducer",

navigator = cms.PSet(
name = cms.string("PFRecHitHCALNavigator"),
name = cms.string("PFRecHitHCALDenseIdNavigator"),
detectorEnums = cms.vint32(4)
),
producers = cms.VPSet(
Expand Down Expand Up @@ -36,9 +36,9 @@
detectorEnum = cms.int32(4))
)
)

)
)
)
)

)
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms
particleFlowRecHitHO = cms.EDProducer("PFRecHitProducer",
navigator = cms.PSet(
name = cms.string("PFRecHitHCALNavigator"),
name = cms.string("PFRecHitHCALDenseIdNavigator"),
detectorEnums = cms.vint32(3)
),
producers = cms.VPSet(
Expand Down

0 comments on commit b73f9f8

Please sign in to comment.