CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
EGHcalRecHitSelector Class Reference

#include <EGHcalRecHitSelector.h>

Public Member Functions

template<typename CollType >
void addDetIds (const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
 
 EGHcalRecHitSelector (const edm::ParameterSet &config)
 
void setup (const edm::EventSetup &iSetup)
 
 ~EGHcalRecHitSelector ()
 

Static Public Member Functions

static edm::ParameterSetDescription makePSetDescription ()
 

Private Member Functions

float getMinEnergyHCAL_ (HcalDetId id) const
 

Static Private Member Functions

static int calDIEta (int iEta1, int iEta2)
 
static int calDIPhi (int iPhi1, int iPhi2)
 

Private Attributes

int maxDIEta_
 
int maxDIPhi_
 
float minEnergyHB_
 
float minEnergyHEDefault_
 
float minEnergyHEDepth1_
 
edm::ESHandle< CaloTowerConstituentsMaptowerMap_
 

Detailed Description

Definition at line 17 of file EGHcalRecHitSelector.h.

Constructor & Destructor Documentation

EGHcalRecHitSelector::EGHcalRecHitSelector ( const edm::ParameterSet config)
explicit

Definition at line 5 of file EGHcalRecHitSelector.cc.

5  :
6  maxDIEta_(config.getParameter<int>("maxDIEta")),
7  maxDIPhi_(config.getParameter<int>("maxDIPhi")),
8  minEnergyHB_(config.getParameter<double>("minEnergyHB")),
9  minEnergyHEDepth1_(config.getParameter<double>("minEnergyHEDepth1")),
10  minEnergyHEDefault_(config.getParameter<double>("minEnergyHEDefault"))
11 {
12 
13 }
T getParameter(std::string const &) const
EGHcalRecHitSelector::~EGHcalRecHitSelector ( )
inline

Definition at line 20 of file EGHcalRecHitSelector.h.

References addDetIds().

20 {}

Member Function Documentation

template<typename CollType >
void EGHcalRecHitSelector::addDetIds ( const reco::SuperCluster superClus,
const HBHERecHitCollection recHits,
CollType &  detIdsToStore 
) const

Definition at line 47 of file EGHcalRecHitSelector.h.

References funct::abs(), calDIEta(), calDIPhi(), DetId::det(), DetId::Ecal, DetId::Forward, getMinEnergyHCAL_(), maxDIEta_, maxDIPhi_, rpcPointValidation_cfi::recHit, reco::SuperCluster::seed(), DataFormats::L1THGCal::towerId, towerMap_, and CaloTowerConstituentsMap::towerOf().

Referenced by ReducedEGProducer::linkHcalHits(), EgammaIsoHcalDetIdCollectionProducer::produce(), and ~EGHcalRecHitSelector().

49 {
50  DetId seedId = superClus.seed()->seed();
51  if(seedId.det() != DetId::Ecal && seedId.det() != DetId::Forward) {
52  edm::LogError("EgammaIsoHcalDetIdCollectionProducerError") << "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 ) return;
58 
60  int seedHcalIEta = towerId.ieta();
61  int seedHcalIPhi = towerId.iphi();
62 
63  for(auto& recHit : recHits){
64  int dIEtaAbs = std::abs(calDIEta(seedHcalIEta,recHit.id().ieta()));
65  int dIPhiAbs = std::abs(calDIPhi(seedHcalIPhi,recHit.id().iphi()));
66 
67  if(dIEtaAbs<=maxDIEta_ && dIPhiAbs<=maxDIPhi_ && recHit.energy()>getMinEnergyHCAL_(recHit.id())) detIdsToStore.insert(detIdsToStore.end(),recHit.id().rawId());
68  }
69 }
static int calDIPhi(int iPhi1, int iPhi2)
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
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
Definition: DetId.h:18
l1t::HGCalTowerID towerId
Definition: classes.h:36
float getMinEnergyHCAL_(HcalDetId id) const
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
int EGHcalRecHitSelector::calDIEta ( int  iEta1,
int  iEta2 
)
staticprivate

Definition at line 26 of file EGHcalRecHitSelector.cc.

References particleFlow_cfi::dEta.

Referenced by addDetIds(), and setup().

27 {
28  int dEta = iEta1-iEta2;
29  if(iEta1*iEta2<0) {//-ve to +ve transistion and no crystal at zero
30  if(dEta<0) dEta++;
31  else dEta--;
32  }
33  return dEta;
34 }
int EGHcalRecHitSelector::calDIPhi ( int  iPhi1,
int  iPhi2 
)
staticprivate

Definition at line 37 of file EGHcalRecHitSelector.cc.

References particleFlow_cfi::dPhi.

Referenced by addDetIds(), and setup().

38 {
39  int dPhi = iPhi1-iPhi2;
40  if(dPhi>72/2) dPhi-=72;
41  else if(dPhi<-72/2) dPhi+=72;
42  return dPhi;
43 }
float EGHcalRecHitSelector::getMinEnergyHCAL_ ( HcalDetId  id) const
private
edm::ParameterSetDescription EGHcalRecHitSelector::makePSetDescription ( )
static

Definition at line 15 of file EGHcalRecHitSelector.cc.

References edm::ParameterSetDescription::add().

Referenced by EgammaIsoHcalDetIdCollectionProducer::fillDescriptions(), and setup().

16 {
18  desc.add<int>("maxDIEta",5);
19  desc.add<int>("maxDIPhi",5);
20  desc.add<double>("minEnergyHB",0.8);
21  desc.add<double>("minEnergyHEDepth1",0.1);
22  desc.add<double>("minEnergyHEDefault",0.2);
23  return desc;
24 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void EGHcalRecHitSelector::setup ( const edm::EventSetup iSetup)
inline

Member Data Documentation

int EGHcalRecHitSelector::maxDIEta_
private

Definition at line 35 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

int EGHcalRecHitSelector::maxDIPhi_
private

Definition at line 36 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

float EGHcalRecHitSelector::minEnergyHB_
private

Definition at line 37 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

float EGHcalRecHitSelector::minEnergyHEDefault_
private

Definition at line 39 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

float EGHcalRecHitSelector::minEnergyHEDepth1_
private

Definition at line 38 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

edm::ESHandle<CaloTowerConstituentsMap> EGHcalRecHitSelector::towerMap_
private

Definition at line 41 of file EGHcalRecHitSelector.h.

Referenced by addDetIds(), and setup().