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 
4 
8 
11 
12 template <ForwardSubdetector D1, typename hgcee,
13  ForwardSubdetector D2, typename hgchef,
14  ForwardSubdetector D3, typename hgcheb>
16  public:
17  HGCRecHitNavigator() = default;
18 
19  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions) {
21 
22  desc.add<std::string>("name","PFRecHitHGCNavigator");
23 
25  descee.add<std::string>("name","PFRecHitHGCEENavigator");
26  descee.add<std::string>("topologySource","HGCalEESensitive");
27  desc.add<edm::ParameterSetDescription>("hgcee", descee);
28 
30  deschef.add<std::string>("name","PFRecHitHGCHENavigator");
31  deschef.add<std::string>("topologySource","HGCalHESiliconSensitive");
32  desc.add<edm::ParameterSetDescription>("hgchef", deschef);
33 
35  deschef.add<std::string>("name","PFRecHitHGCHENavigator");
36  deschef.add<std::string>("topologySource","HGCalHEScintillatorSensitive");
37  desc.add<edm::ParameterSetDescription>("hgcheb", descheb);
38 
39  descriptions.add("navigator", desc);
40  }
41 
42 
44  if( iConfig.exists("hgcee") ) {
45  eeNav_ = new hgcee(iConfig.getParameter<edm::ParameterSet>("hgcee"));
46  } else {
47  eeNav_ = nullptr;
48  }
49  if( iConfig.exists("hgchef") ) {
50  hefNav_ = new hgchef(iConfig.getParameter<edm::ParameterSet>("hgchef"));
51  } else {
52  hefNav_ = nullptr;
53  }
54  if( iConfig.exists("hgcheb") ) {
55  hebNav_ = new hgcheb(iConfig.getParameter<edm::ParameterSet>("hgcheb"));
56  } else {
57  hebNav_ = nullptr;
58  }
59  }
60 
61  void beginEvent(const edm::EventSetup& iSetup) override {
62  if( nullptr != eeNav_ ) eeNav_->beginEvent(iSetup);
63  if( nullptr != hefNav_ ) hefNav_->beginEvent(iSetup);
64  if( nullptr != hebNav_ ) hebNav_->beginEvent(iSetup);
65  }
66 
67  void associateNeighbours(reco::PFRecHit& hit,std::unique_ptr<reco::PFRecHitCollection>& hits,edm::RefProd<reco::PFRecHitCollection>& refProd) override {
68  switch( DetId(hit.detId()).subdetId() ) {
69  case D1:
70  if( nullptr != eeNav_ ) eeNav_->associateNeighbours(hit,hits,refProd);
71  break;
72  case D2:
73  if( nullptr != hefNav_ ) hefNav_->associateNeighbours(hit,hits,refProd);
74  break;
75  case D3:
76  if( nullptr != hebNav_ ) hebNav_->associateNeighbours(hit,hits,refProd);
77  break;
78  default:
79  break;
80  }
81  }
82 
83  protected:
87 };
88 
89 #endif
T getParameter(std::string const &) const
Divides< B, C > D2
Definition: Factorize.h:147
unsigned detId() const
rechit detId
Definition: PFRecHit.h:108
HGCRecHitNavigator(const edm::ParameterSet &iConfig)
bool exists(std::string const &parameterName) const
checks if a parameter exists
HGCRecHitNavigator()=default
ForwardSubdetector
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:32
void beginEvent(const edm::EventSetup &iSetup) override
Divides< A, C > D1
Definition: Factorize.h:146
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:18
void add(std::string const &label, ParameterSetDescription const &psetDescription)