CMS 3D CMS Logo

EGHcalRecHitSelector.h
Go to the documentation of this file.
1 #ifndef RecoEgamam_EgammaIsolationAlgos_EGHcalRecHitSelector_h
2 #define RecoEgamam_EgammaIsolationAlgos_EGHcalRecHitSelector_h
3 
9 
12 
16 
18 public:
21 
22  template <typename CollType>
23  void addDetIds(const reco::SuperCluster& superClus,
25  CollType& detIdsToStore) const;
26 
27  void setup(const edm::EventSetup& iSetup) { iSetup.get<CaloGeometryRecord>().get(towerMap_); }
28 
30 
31 private:
32  static int calDIPhi(int iPhi1, int iPhi2);
33  static int calDIEta(int iEta1, int iEta2);
34  float getMinEnergyHCAL_(HcalDetId id) const;
35 
36  int maxDIEta_;
37  int maxDIPhi_;
38  float minEnergyHB_;
41 
43 };
44 
45 template <typename CollType>
48  CollType& detIdsToStore) const {
49  DetId seedId = superClus.seed()->seed();
50  if (seedId.det() != DetId::Ecal && seedId.det() != DetId::Forward) {
51  edm::LogError("EgammaIsoHcalDetIdCollectionProducerError")
52  << "Somehow the supercluster has a seed which is not ECAL, something is badly wrong";
53  return;
54  }
55  //so we are using CaloTowers to get the iEta/iPhi of the HCAL rec hit behind the seed cluster, this might go funny on tower 28 but shouldnt matter there
56 
57  if (seedId.det() == DetId::Forward)
58  return;
59 
61  int seedHcalIEta = towerId.ieta();
62  int seedHcalIPhi = towerId.iphi();
63 
64  for (auto& recHit : recHits) {
65  int dIEtaAbs = std::abs(calDIEta(seedHcalIEta, recHit.id().ieta()));
66  int dIPhiAbs = std::abs(calDIPhi(seedHcalIPhi, recHit.id().iphi()));
67 
68  if (dIEtaAbs <= maxDIEta_ && dIPhiAbs <= maxDIPhi_ && recHit.energy() > getMinEnergyHCAL_(recHit.id()))
69  detIdsToStore.insert(detIdsToStore.end(), recHit.id().rawId());
70  }
71 }
72 
73 #endif
static int calDIPhi(int iPhi1, int iPhi2)
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
void setup(const edm::EventSetup &iSetup)
Definition: config.py:1
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
static int calDIEta(int iEta1, int iEta2)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static edm::ParameterSetDescription makePSetDescription()
Definition: DetId.h:17
EGHcalRecHitSelector(const edm::ParameterSet &config)
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
l1t::HGCalTowerID towerId
Definition: classes.h:36
T get() const
Definition: EventSetup.h:73
float getMinEnergyHCAL_(HcalDetId id) const
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46