Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/Framework/interface/MakerMacros.h"
0002 #include "FWCore/Framework/interface/ConsumesCollector.h"
0003 
0004 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitFakeNavigator.h"
0005 
0006 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitNavigatorBase.h"
0007 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitDualNavigator.h"
0008 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigator.h"
0009 #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitCaloNavigatorWithTime.h"
0010 #include "RecoParticleFlow/PFClusterProducer/interface/PFHCALDenseIdNavigator.h"
0011 #include "RecoParticleFlow/PFClusterProducer/interface/PFECALHashNavigator.h"
0012 #include "RecoParticleFlow/PFClusterProducer/interface/HGCRecHitNavigator.h"
0013 
0014 class PFRecHitEcalBarrelNavigatorWithTime : public PFRecHitCaloNavigatorWithTime<EBDetId, EcalBarrelTopology> {
0015 public:
0016   PFRecHitEcalBarrelNavigatorWithTime(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0017       : PFRecHitCaloNavigatorWithTime(iConfig, cc),
0018         geomToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0019 
0020   void init(const edm::EventSetup& iSetup) override {
0021     edm::ESHandle<CaloGeometry> geoHandle = iSetup.getHandle(geomToken_);
0022     topology_ = std::make_unique<EcalBarrelTopology>(*geoHandle);
0023   }
0024 
0025 private:
0026   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;
0027 };
0028 
0029 class PFRecHitEcalEndcapNavigatorWithTime : public PFRecHitCaloNavigatorWithTime<EEDetId, EcalEndcapTopology> {
0030 public:
0031   PFRecHitEcalEndcapNavigatorWithTime(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0032       : PFRecHitCaloNavigatorWithTime(iConfig, cc),
0033         geomToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0034 
0035   void init(const edm::EventSetup& iSetup) override {
0036     edm::ESHandle<CaloGeometry> geoHandle = iSetup.getHandle(geomToken_);
0037     topology_ = std::make_unique<EcalEndcapTopology>(*geoHandle);
0038   }
0039 
0040 private:
0041   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;
0042 };
0043 
0044 class PFRecHitEcalBarrelNavigator final : public PFRecHitCaloNavigator<EBDetId, EcalBarrelTopology> {
0045 public:
0046   PFRecHitEcalBarrelNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0047       : geomToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0048 
0049   void init(const edm::EventSetup& iSetup) override {
0050     edm::ESHandle<CaloGeometry> geoHandle = iSetup.getHandle(geomToken_);
0051     topology_ = std::make_unique<EcalBarrelTopology>(*geoHandle);
0052   }
0053 
0054 private:
0055   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;
0056 };
0057 
0058 class PFRecHitEcalEndcapNavigator final : public PFRecHitCaloNavigator<EEDetId, EcalEndcapTopology> {
0059 public:
0060   PFRecHitEcalEndcapNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0061       : geomToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0062 
0063   void init(const edm::EventSetup& iSetup) override {
0064     edm::ESHandle<CaloGeometry> geoHandle = iSetup.getHandle(geomToken_);
0065     topology_ = std::make_unique<EcalEndcapTopology>(*geoHandle);
0066   }
0067 
0068 private:
0069   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;
0070 };
0071 
0072 class PFRecHitPreshowerNavigator final : public PFRecHitCaloNavigator<ESDetId, EcalPreshowerTopology> {
0073 public:
0074   PFRecHitPreshowerNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) {}
0075 
0076   void init(const edm::EventSetup& iSetup) override { topology_ = std::make_unique<EcalPreshowerTopology>(); }
0077 };
0078 
0079 class PFRecHitHCALDenseIdNavigator final : public PFHCALDenseIdNavigator<HcalDetId, HcalTopology, false> {
0080 public:
0081   PFRecHitHCALDenseIdNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0082       : PFHCALDenseIdNavigator(iConfig, cc) {}
0083 };
0084 
0085 class PFRecHitHCALNavigator : public PFRecHitCaloNavigator<HcalDetId, HcalTopology, false> {
0086 public:
0087   PFRecHitHCALNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0088       : hcalToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0089 
0090   void init(const edm::EventSetup& iSetup) override {
0091     edm::ESHandle<HcalTopology> hcalTopology = iSetup.getHandle(hcalToken_);
0092     topology_.release();
0093     topology_.reset(hcalTopology.product());
0094   }
0095 
0096 private:
0097   edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcalToken_;
0098 };
0099 
0100 class PFRecHitHCALNavigatorWithTime : public PFRecHitCaloNavigatorWithTime<HcalDetId, HcalTopology, false> {
0101 public:
0102   PFRecHitHCALNavigatorWithTime(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0103       : PFRecHitCaloNavigatorWithTime(iConfig, cc),
0104         hcalToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0105 
0106   void init(const edm::EventSetup& iSetup) override {
0107     edm::ESHandle<HcalTopology> hcalTopology = iSetup.getHandle(hcalToken_);
0108     topology_.release();
0109     topology_.reset(hcalTopology.product());
0110   }
0111 
0112 private:
0113   edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcalToken_;
0114 };
0115 
0116 class PFRecHitCaloTowerNavigator : public PFRecHitCaloNavigator<CaloTowerDetId, CaloTowerTopology> {
0117 public:
0118   PFRecHitCaloTowerNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
0119       : caloToken_(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()) {}
0120 
0121   void init(const edm::EventSetup& iSetup) override {
0122     edm::ESHandle<CaloTowerTopology> caloTowerTopology = iSetup.getHandle(caloToken_);
0123     topology_.release();
0124     topology_.reset(caloTowerTopology.product());
0125   }
0126 
0127 private:
0128   edm::ESGetToken<CaloTowerTopology, HcalRecNumberingRecord> caloToken_;
0129 };
0130 
0131 typedef PFRecHitDualNavigator<PFLayer::ECAL_BARREL,
0132                               PFRecHitEcalBarrelNavigator,
0133                               PFLayer::ECAL_ENDCAP,
0134                               PFRecHitEcalEndcapNavigator>
0135     PFRecHitECALNavigator;
0136 
0137 typedef PFRecHitDualNavigator<PFLayer::ECAL_BARREL,
0138                               PFRecHitEcalBarrelNavigatorWithTime,
0139                               PFLayer::ECAL_ENDCAP,
0140                               PFRecHitEcalEndcapNavigatorWithTime>
0141     PFRecHitECALNavigatorWithTime;
0142 
0143 #include "DataFormats/ForwardDetId/interface/HGCEEDetId.h"
0144 #include "DataFormats/ForwardDetId/interface/HGCHEDetId.h"
0145 #include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
0146 
0147 class PFRecHitHGCEENavigator : public PFRecHitFakeNavigator<HGCEEDetId> {
0148 public:
0149   PFRecHitHGCEENavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) {}
0150 
0151   void init(const edm::EventSetup& iSetup) override {}
0152 };
0153 
0154 class PFRecHitHGCHENavigator : public PFRecHitFakeNavigator<HGCHEDetId> {
0155 public:
0156   PFRecHitHGCHENavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) {}
0157 
0158   void init(const edm::EventSetup& iSetup) override {}
0159 };
0160 
0161 class PFRecHitHGCHexNavigator : public PFRecHitFakeNavigator<HGCalDetId> {
0162 public:
0163   PFRecHitHGCHexNavigator(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc) {}
0164 
0165   void init(const edm::EventSetup& iSetup) override {}
0166 };
0167 
0168 typedef HGCRecHitNavigator<HGCEE, PFRecHitHGCHexNavigator, HGCHEF, PFRecHitHGCHexNavigator, HGCHEB, PFRecHitHGCHENavigator>
0169     PFRecHitHGCNavigator;
0170 
0171 EDM_REGISTER_PLUGINFACTORY(PFRecHitNavigationFactory, "PFRecHitNavigationFactory");
0172 
0173 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitEcalBarrelNavigator, "PFRecHitEcalBarrelNavigator");
0174 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitEcalEndcapNavigator, "PFRecHitEcalEndcapNavigator");
0175 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory,
0176                   PFRecHitEcalBarrelNavigatorWithTime,
0177                   "PFRecHitEcalBarrelNavigatorWithTime");
0178 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory,
0179                   PFRecHitEcalEndcapNavigatorWithTime,
0180                   "PFRecHitEcalEndcapNavigatorWithTime");
0181 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFECALHashNavigator, "PFECALHashNavigator");
0182 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitECALNavigator, "PFRecHitECALNavigator");
0183 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitECALNavigatorWithTime, "PFRecHitECALNavigatorWithTime");
0184 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitCaloTowerNavigator, "PFRecHitCaloTowerNavigator");
0185 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitPreshowerNavigator, "PFRecHitPreshowerNavigator");
0186 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALDenseIdNavigator, "PFRecHitHCALDenseIdNavigator");
0187 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALNavigator, "PFRecHitHCALNavigator");
0188 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHCALNavigatorWithTime, "PFRecHitHCALNavigatorWithTime");
0189 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHGCEENavigator, "PFRecHitHGCEENavigator");
0190 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHGCHENavigator, "PFRecHitHGCHENavigator");
0191 DEFINE_EDM_PLUGIN(PFRecHitNavigationFactory, PFRecHitHGCNavigator, "PFRecHitHGCNavigator");