Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30c7b03
commit 2e888d5
Showing
10 changed files
with
203 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
RecoEgamma/EgammaIsolationAlgos/interface/EGHcalRecHitSelector.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#ifndef RecoEgamam_EgammaIsolationAlgos_EGHcalRecHitSelector_h | ||
#define RecoEgamam_EgammaIsolationAlgos_EGHcalRecHitSelector_h | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
|
||
#include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h" | ||
#include "Geometry/Records/interface/CaloGeometryRecord.h" | ||
|
||
#include "DataFormats/EgammaReco/interface/SuperCluster.h" | ||
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" | ||
#include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" | ||
|
||
class EGHcalRecHitSelector { | ||
public: | ||
explicit EGHcalRecHitSelector(const edm::ParameterSet& config); | ||
~EGHcalRecHitSelector(){} | ||
|
||
template<typename CollType> | ||
void addDetIds(const reco::SuperCluster& superClus,const HBHERecHitCollection& recHits, | ||
CollType& detIdsToStore)const; | ||
|
||
void setup(const edm::EventSetup& iSetup){iSetup.get<CaloGeometryRecord>().get(towerMap_);} | ||
|
||
static edm::ParameterSetDescription makePSetDescription(); | ||
|
||
private: | ||
static int calDIPhi(int iPhi1,int iPhi2); | ||
static int calDIEta(int iEta1,int iEta2); | ||
|
||
int maxDIEta_; | ||
int maxDIPhi_; | ||
float minEnergyHCAL_; | ||
edm::ESHandle<CaloTowerConstituentsMap> towerMap_; | ||
|
||
}; | ||
|
||
template <typename CollType> | ||
void EGHcalRecHitSelector:: | ||
addDetIds(const reco::SuperCluster& superClus,const HBHERecHitCollection& recHits, | ||
CollType& detIdsToStore)const | ||
{ | ||
DetId seedId = superClus.seed()->seed(); | ||
if(seedId.det() != DetId::Ecal && seedId.det() != DetId::Forward) { | ||
edm::LogError("EgammaIsoHcalDetIdCollectionProducerError") << "Somehow the supercluster has a seed which is not ECAL, something is badly wrong"; | ||
} | ||
//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 | ||
|
||
if( seedId.det() == DetId::Forward ) return; | ||
|
||
CaloTowerDetId towerId(towerMap_->towerOf(seedId)); | ||
int seedHcalIEta = towerId.ieta(); | ||
int seedHcalIPhi = towerId.iphi(); | ||
|
||
for(auto& recHit : recHits){ | ||
int dIEtaAbs = std::abs(calDIEta(seedHcalIEta,recHit.id().ieta())); | ||
int dIPhiAbs = std::abs(calDIPhi(seedHcalIPhi,recHit.id().iphi())); | ||
|
||
if(dIEtaAbs<=maxDIEta_ && dIPhiAbs<=maxDIPhi_ && recHit.energy()>minEnergyHCAL_) detIdsToStore.insert(detIdsToStore.end(),recHit.id().rawId()); | ||
} | ||
} | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
RecoEgamma/EgammaIsolationAlgos/python/interestingEgammaIsoHCALDetIdModule_cff.py
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
RecoEgamma/EgammaIsolationAlgos/src/EGHcalRecHitSelector.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "RecoEgamma/EgammaIsolationAlgos/interface/EGHcalRecHitSelector.h" | ||
|
||
EGHcalRecHitSelector::EGHcalRecHitSelector(const edm::ParameterSet& config): | ||
maxDIEta_(config.getParameter<int>("maxDIEta")), | ||
maxDIPhi_(config.getParameter<int>("maxDIPhi")), | ||
minEnergyHCAL_(config.getParameter<double>("minEnergyHCAL")) | ||
{ | ||
|
||
} | ||
|
||
edm::ParameterSetDescription EGHcalRecHitSelector::makePSetDescription() | ||
{ | ||
edm::ParameterSetDescription desc; | ||
desc.add<int>("maxDIEta",5); | ||
desc.add<int>("maxDIPhi",5); | ||
desc.add<double>("minEnergyHCAL",0.8); | ||
return desc; | ||
} | ||
|
||
int EGHcalRecHitSelector::calDIEta(int iEta1,int iEta2) | ||
{ | ||
int dEta = iEta1-iEta2; | ||
if(iEta1*iEta2<0) {//-ve to +ve transistion and no crystal at zero | ||
if(dEta<0) dEta++; | ||
else dEta--; | ||
} | ||
return dEta; | ||
} | ||
|
||
|
||
int EGHcalRecHitSelector::calDIPhi(int iPhi1,int iPhi2) | ||
{ | ||
int dPhi = iPhi1-iPhi2; | ||
if(dPhi>72/2) dPhi-=72; | ||
else if(dPhi<-72/2) dPhi+=72; | ||
return dPhi; | ||
} |
Oops, something went wrong.