CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
18  }
19 
20  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions) {
22 
23  desc.add<std::string>("name","PFRecHitHGCNavigator");
24 
26  descee.add<std::string>("name","PFRecHitHGCEENavigator");
27  descee.add<std::string>("topologySource","HGCalEESensitive");
28  desc.add<edm::ParameterSetDescription>("hgcee", descee);
29 
31  deschef.add<std::string>("name","PFRecHitHGCHENavigator");
32  deschef.add<std::string>("topologySource","HGCalHESiliconSensitive");
33  desc.add<edm::ParameterSetDescription>("hgchef", deschef);
34 
36  deschef.add<std::string>("name","PFRecHitHGCHENavigator");
37  deschef.add<std::string>("topologySource","HGCalHEScintillatorSensitive");
38  desc.add<edm::ParameterSetDescription>("hgcheb", descheb);
39 
40  descriptions.add("navigator", desc);
41  }
42 
43 
45  if( iConfig.exists("hgcee") ) {
46  eeNav_ = new hgcee(iConfig.getParameter<edm::ParameterSet>("hgcee"));
47  } else {
48  eeNav_ = nullptr;
49  }
50  if( iConfig.exists("hgchef") ) {
51  hefNav_ = new hgchef(iConfig.getParameter<edm::ParameterSet>("hgchef"));
52  } else {
53  hefNav_ = nullptr;
54  }
55  if( iConfig.exists("hgcheb") ) {
56  hebNav_ = new hgcheb(iConfig.getParameter<edm::ParameterSet>("hgcheb"));
57  } else {
58  hebNav_ = nullptr;
59  }
60  }
61 
62  void beginEvent(const edm::EventSetup& iSetup) override {
63  if( nullptr != eeNav_ ) eeNav_->beginEvent(iSetup);
64  if( nullptr != hefNav_ ) hefNav_->beginEvent(iSetup);
65  if( nullptr != hebNav_ ) hebNav_->beginEvent(iSetup);
66  }
67 
68  void associateNeighbours(reco::PFRecHit& hit,std::auto_ptr<reco::PFRecHitCollection>& hits,edm::RefProd<reco::PFRecHitCollection>& refProd) override {
69  switch( DetId(hit.detId()).subdetId() ) {
70  case D1:
71  if( nullptr != eeNav_ ) eeNav_->associateNeighbours(hit,hits,refProd);
72  break;
73  case D2:
74  if( nullptr != hefNav_ ) hefNav_->associateNeighbours(hit,hits,refProd);
75  break;
76  case D3:
77  if( nullptr != hebNav_ ) hebNav_->associateNeighbours(hit,hits,refProd);
78  break;
79  default:
80  break;
81  }
82  }
83 
84  protected:
85  hgcee *eeNav_;
86  hgchef *hefNav_;
87  hgcheb *hebNav_;
88 };
89 
90 #endif
T getParameter(std::string const &) const
Divides< B, C > D2
Definition: Factorize.h:145
void associateNeighbours(reco::PFRecHit &hit, std::auto_ptr< reco::PFRecHitCollection > &hits, edm::RefProd< reco::PFRecHitCollection > &refProd) override
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
ForwardSubdetector
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
void beginEvent(const edm::EventSetup &iSetup) override
Divides< A, C > D1
Definition: Factorize.h:144
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)