Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-18 09:15:20

0001 #ifndef RecoParticleFlow_PFClusterProducer_PFRecHitDualNavigator_h
0002 #define RecoParticleFlow_PFClusterProducer_PFRecHitDualNavigator_h
0003 
0004 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h"
0005 #include "DataFormats/ParticleFlowReco/interface/PFLayer.h"
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 
0008 template <PFLayer::Layer D1, typename barrel, PFLayer::Layer D2, typename endcap>
0009 class PFRecHitDualNavigator : public PFRecHitNavigatorBase {
0010 public:
0011   PFRecHitDualNavigator() = default;
0012 
0013   PFRecHitDualNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) {
0014     barrelNav_ = new barrel(iConfig.getParameter<edm::ParameterSet>("barrel"), cc);
0015     endcapNav_ = new endcap(iConfig.getParameter<edm::ParameterSet>("endcap"), cc);
0016   }
0017 
0018   void init(const edm::EventSetup& iSetup) override {
0019     barrelNav_->init(iSetup);
0020     endcapNav_->init(iSetup);
0021   }
0022 
0023   void associateNeighbours(reco::PFRecHit& hit,
0024                            std::unique_ptr<reco::PFRecHitCollection>& hits,
0025                            edm::RefProd<reco::PFRecHitCollection>& refProd) override {
0026     if (hit.layer() == D1)
0027       barrelNav_->associateNeighbours(hit, hits, refProd);
0028     else if (hit.layer() == D2)
0029       endcapNav_->associateNeighbours(hit, hits, refProd);
0030   }
0031 
0032 protected:
0033   barrel* barrelNav_;
0034   endcap* endcapNav_;
0035 };
0036 
0037 #endif