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.

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")) {}
T getParameter(std::string const &) const
EGHcalRecHitSelector::~EGHcalRecHitSelector ( )
inline

Definition at line 20 of file EGHcalRecHitSelector.h.

References addDetIds(), and FastTrackerRecHitMaskProducer_cfi::recHits.

20 {}

Member Function Documentation

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

Definition at line 46 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().

48  {
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 }
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:17
l1t::HGCalTowerID towerId
Definition: classes.h:36
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
int EGHcalRecHitSelector::calDIEta ( int  iEta1,
int  iEta2 
)
staticprivate

Definition at line 22 of file EGHcalRecHitSelector.cc.

References HLT_2018_cff::dEta.

Referenced by addDetIds(), and setup().

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

Definition at line 33 of file EGHcalRecHitSelector.cc.

References HLT_2018_cff::dPhi.

Referenced by addDetIds(), and setup().

33  {
34  int dPhi = iPhi1 - iPhi2;
35  if (dPhi > 72 / 2)
36  dPhi -= 72;
37  else if (dPhi < -72 / 2)
38  dPhi += 72;
39  return dPhi;
40 }
float EGHcalRecHitSelector::getMinEnergyHCAL_ ( HcalDetId  id) const
private

Definition at line 42 of file EGHcalRecHitSelector.cc.

References LEDCalibrationChannels::depth, HcalBarrel, HcalEndcap, SiStripPI::max, minEnergyHB_, minEnergyHEDefault_, and minEnergyHEDepth1_.

Referenced by addDetIds(), and setup().

42  {
43  if (id.subdetId() == HcalBarrel)
44  return minEnergyHB_;
45  else if (id.subdetId() == HcalEndcap) {
46  if (id.depth() == 1)
47  return minEnergyHEDepth1_;
48  else
49  return minEnergyHEDefault_;
50  } else
52 }
edm::ParameterSetDescription EGHcalRecHitSelector::makePSetDescription ( )
static

Definition at line 12 of file EGHcalRecHitSelector.cc.

References edm::ParameterSetDescription::add().

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

12  {
14  desc.add<int>("maxDIEta", 5);
15  desc.add<int>("maxDIPhi", 5);
16  desc.add<double>("minEnergyHB", 0.8);
17  desc.add<double>("minEnergyHEDepth1", 0.1);
18  desc.add<double>("minEnergyHEDefault", 0.2);
19  return desc;
20 }
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 36 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

int EGHcalRecHitSelector::maxDIPhi_
private

Definition at line 37 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

float EGHcalRecHitSelector::minEnergyHB_
private

Definition at line 38 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

float EGHcalRecHitSelector::minEnergyHEDefault_
private

Definition at line 40 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

float EGHcalRecHitSelector::minEnergyHEDepth1_
private

Definition at line 39 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

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

Definition at line 42 of file EGHcalRecHitSelector.h.

Referenced by addDetIds(), and setup().