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 
11 
14 
18 
20 public:
23 
24  template <typename CollType>
25  void addDetIds(const reco::SuperCluster& superClus,
27  CollType& detIdsToStore) const;
28 
29  void setup(const edm::EventSetup& iSetup) { towerMap_ = iSetup.getHandle(towerMapToken_); }
30 
32 
33 private:
34  static int calDIPhi(int iPhi1, int iPhi2);
35  static int calDIEta(int iEta1, int iEta2);
36  float getMinEnergyHCAL_(HcalDetId id) const;
37 
38  int maxDIEta_;
39  int maxDIPhi_;
40  float minEnergyHB_;
43 
46 };
47 
48 template <typename CollType>
51  CollType& detIdsToStore) const {
52  DetId seedId = superClus.seed()->seed();
53  if (seedId.det() != DetId::Ecal && seedId.det() != DetId::Forward) {
54  edm::LogError("EgammaIsoHcalDetIdCollectionProducerError")
55  << "Somehow the supercluster has a seed which is not ECAL, something is badly wrong";
56  return;
57  }
58  //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
59 
60  if (seedId.det() == DetId::Forward)
61  return;
62 
64  int seedHcalIEta = towerId.ieta();
65  int seedHcalIPhi = towerId.iphi();
66 
67  for (auto& recHit : recHits) {
68  int dIEtaAbs = std::abs(calDIEta(seedHcalIEta, recHit.id().ieta()));
69  int dIPhiAbs = std::abs(calDIPhi(seedHcalIPhi, recHit.id().iphi()));
70 
71  if (dIEtaAbs <= maxDIEta_ && dIPhiAbs <= maxDIPhi_ && recHit.energy() > getMinEnergyHCAL_(recHit.id()))
72  detIdsToStore.insert(detIdsToStore.end(), recHit.id().rawId());
73  }
74 }
75 
76 #endif
EGHcalRecHitSelector::setup
void setup(const edm::EventSetup &iSetup)
Definition: EGHcalRecHitSelector.h:29
EGHcalRecHitSelector::getMinEnergyHCAL_
float getMinEnergyHCAL_(HcalDetId id) const
Definition: EGHcalRecHitSelector.cc:43
MessageLogger.h
ESHandle.h
reco::SuperCluster
Definition: SuperCluster.h:18
CaloTowerConstituentsMap.h
EGHcalRecHitSelector::maxDIEta_
int maxDIEta_
Definition: EGHcalRecHitSelector.h:38
EGHcalRecHitSelector::minEnergyHEDefault_
float minEnergyHEDefault_
Definition: EGHcalRecHitSelector.h:42
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
EGHcalRecHitSelector::minEnergyHB_
float minEnergyHB_
Definition: EGHcalRecHitSelector.h:40
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::SortedCollection
Definition: SortedCollection.h:49
EGHcalRecHitSelector::addDetIds
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
Definition: EGHcalRecHitSelector.h:49
EGHcalRecHitSelector::~EGHcalRecHitSelector
~EGHcalRecHitSelector()
Definition: EGHcalRecHitSelector.h:22
ESGetToken.h
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
config
Definition: config.py:1
DetId
Definition: DetId.h:17
EGHcalRecHitSelector::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EGHcalRecHitSelector.cc:13
EGHcalRecHitSelector::EGHcalRecHitSelector
EGHcalRecHitSelector(const edm::ParameterSet &config, edm::ConsumesCollector)
Definition: EGHcalRecHitSelector.cc:5
edm::ESHandle< CaloTowerConstituentsMap >
EGHcalRecHitSelector::towerMapToken_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
Definition: EGHcalRecHitSelector.h:45
ParameterSetDescription.h
CaloGeometryRecord.h
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:47
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
HcalDetId
Definition: HcalDetId.h:12
EGHcalRecHitSelector::towerMap_
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
Definition: EGHcalRecHitSelector.h:44
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
edm::EventSetup
Definition: EventSetup.h:57
EGHcalRecHitSelector::minEnergyHEDepth1_
float minEnergyHEDepth1_
Definition: EGHcalRecHitSelector.h:41
CaloTowerConstituentsMap::towerOf
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
Definition: CaloTowerConstituentsMap.cc:26
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord >
EGHcalRecHitSelector::maxDIPhi_
int maxDIPhi_
Definition: EGHcalRecHitSelector.h:39
EGHcalRecHitSelector
Definition: EGHcalRecHitSelector.h:19
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
EGHcalRecHitSelector::calDIEta
static int calDIEta(int iEta1, int iEta2)
Definition: EGHcalRecHitSelector.cc:23
SuperClusterFwd.h
SuperCluster.h
EventSetup.h
HcalRecHitCollections.h
ConsumesCollector.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
DetId::Forward
Definition: DetId.h:30
EGHcalRecHitSelector::calDIPhi
static int calDIPhi(int iPhi1, int iPhi2)
Definition: EGHcalRecHitSelector.cc:34
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CaloTowerDetId
Definition: CaloTowerDetId.h:12