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
EGHcalRecHitSelector::setup
void setup(const edm::EventSetup &iSetup)
Definition: EGHcalRecHitSelector.h:27
EGHcalRecHitSelector::getMinEnergyHCAL_
float getMinEnergyHCAL_(HcalDetId id) const
Definition: EGHcalRecHitSelector.cc:42
MessageLogger.h
ESHandle.h
reco::SuperCluster
Definition: SuperCluster.h:18
CaloTowerConstituentsMap.h
EGHcalRecHitSelector::maxDIEta_
int maxDIEta_
Definition: EGHcalRecHitSelector.h:36
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EGHcalRecHitSelector::minEnergyHEDefault_
float minEnergyHEDefault_
Definition: EGHcalRecHitSelector.h:40
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
EGHcalRecHitSelector::minEnergyHB_
float minEnergyHB_
Definition: EGHcalRecHitSelector.h:38
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::SortedCollection
Definition: SortedCollection.h:49
EGHcalRecHitSelector::EGHcalRecHitSelector
EGHcalRecHitSelector(const edm::ParameterSet &config)
Definition: EGHcalRecHitSelector.cc:5
EGHcalRecHitSelector::addDetIds
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
Definition: EGHcalRecHitSelector.h:46
EGHcalRecHitSelector::~EGHcalRecHitSelector
~EGHcalRecHitSelector()
Definition: EGHcalRecHitSelector.h:20
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
config
Definition: config.py:1
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
EGHcalRecHitSelector::makePSetDescription
static edm::ParameterSetDescription makePSetDescription()
Definition: EGHcalRecHitSelector.cc:12
edm::ESHandle< CaloTowerConstituentsMap >
ParameterSetDescription.h
CaloGeometryRecord.h
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
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:42
edm::EventSetup
Definition: EventSetup.h:57
EGHcalRecHitSelector::minEnergyHEDepth1_
float minEnergyHEDepth1_
Definition: EGHcalRecHitSelector.h:39
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
DetId::Ecal
Definition: DetId.h:27
get
#define get
EGHcalRecHitSelector::maxDIPhi_
int maxDIPhi_
Definition: EGHcalRecHitSelector.h:37
EGHcalRecHitSelector
Definition: EGHcalRecHitSelector.h:17
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
EGHcalRecHitSelector::calDIEta
static int calDIEta(int iEta1, int iEta2)
Definition: EGHcalRecHitSelector.cc:22
SuperClusterFwd.h
SuperCluster.h
EventSetup.h
HcalRecHitCollections.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:33
CaloTowerDetId
Definition: CaloTowerDetId.h:12