CMS 3D CMS Logo

HGCRecHitNavigator.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_HGCRecHitNavigator_h
2 #define RecoParticleFlow_PFClusterProducer_HGCRecHitNavigator_h
3 
7 
11 
12 template <ForwardSubdetector D1,
13  typename hgcee,
15  typename hgchef,
17  typename hgcheb>
19 public:
20  HGCRecHitNavigator() = default;
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
24 
25  desc.add<std::string>("name", "PFRecHitHGCNavigator");
26 
28  descee.add<std::string>("name", "PFRecHitHGCEENavigator");
29  descee.add<std::string>("topologySource", "HGCalEESensitive");
30  desc.add<edm::ParameterSetDescription>("hgcee", descee);
31 
33  deschef.add<std::string>("name", "PFRecHitHGCHENavigator");
34  deschef.add<std::string>("topologySource", "HGCalHESiliconSensitive");
35  desc.add<edm::ParameterSetDescription>("hgchef", deschef);
36 
38  descheb.add<std::string>("name", "PFRecHitHGCHENavigator");
39  descheb.add<std::string>("topologySource", "HGCalHEScintillatorSensitive");
40  desc.add<edm::ParameterSetDescription>("hgcheb", descheb);
41 
42  descriptions.add("navigator", desc);
43  }
44 
46  const auto& pset_hgcee = iConfig.getParameter<edm::ParameterSet>("hgcee");
47  if (!pset_hgcee.empty() && !pset_hgcee.getParameter<std::string>("name").empty()) {
48  eeNav_ = new hgcee(pset_hgcee, cc);
49  } else {
50  eeNav_ = nullptr;
51  }
52  const auto& pset_hgchef = iConfig.getParameter<edm::ParameterSet>("hgchef");
53  if (!pset_hgchef.empty() && !pset_hgchef.getParameter<std::string>("name").empty()) {
54  hefNav_ = new hgchef(pset_hgchef, cc);
55  } else {
56  hefNav_ = nullptr;
57  }
58  const auto& pset_hgcheb = iConfig.getParameter<edm::ParameterSet>("hgcheb");
59  if (!pset_hgcheb.empty() && !pset_hgcheb.getParameter<std::string>("name").empty()) {
60  hebNav_ = new hgcheb(pset_hgcheb, cc);
61  } else {
62  hebNav_ = nullptr;
63  }
64  }
65 
66  void init(const edm::EventSetup& iSetup) override {
67  if (nullptr != eeNav_)
68  eeNav_->init(iSetup);
69  if (nullptr != hefNav_)
70  hefNav_->init(iSetup);
71  if (nullptr != hebNav_)
72  hebNav_->init(iSetup);
73  }
74 
76  std::unique_ptr<reco::PFRecHitCollection>& hits,
77  edm::RefProd<reco::PFRecHitCollection>& refProd) override {
78  switch (DetId(hit.detId()).subdetId()) {
79  case D1:
80  if (nullptr != eeNav_)
81  eeNav_->associateNeighbours(hit, hits, refProd);
82  break;
83  case D2:
84  if (nullptr != hefNav_)
85  hefNav_->associateNeighbours(hit, hits, refProd);
86  break;
87  case D3:
88  if (nullptr != hebNav_)
89  hebNav_->associateNeighbours(hit, hits, refProd);
90  break;
91  default:
92  break;
93  }
94  }
95 
96 protected:
100 };
101 
102 #endif
Divides< B, C > D2
Definition: Factorize.h:137
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
HGCRecHitNavigator()=default
ForwardSubdetector
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
void init(const edm::EventSetup &iSetup) override
Divides< A, C > D1
Definition: Factorize.h:136
HGCRecHitNavigator(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
void associateNeighbours(reco::PFRecHit &hit, std::unique_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DetId.h:17
void add(std::string const &label, ParameterSetDescription const &psetDescription)