Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:01:40

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