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, edm::ConsumesCollector)
 
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_
 
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecordtowerMapToken_
 

Detailed Description

Definition at line 19 of file EGHcalRecHitSelector.h.

Constructor & Destructor Documentation

◆ EGHcalRecHitSelector()

EGHcalRecHitSelector::EGHcalRecHitSelector ( const edm::ParameterSet config,
edm::ConsumesCollector  cc 
)
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")),
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
Definition: config.py:1
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_

◆ ~EGHcalRecHitSelector()

EGHcalRecHitSelector::~EGHcalRecHitSelector ( )
inline

Definition at line 22 of file EGHcalRecHitSelector.h.

22 {}

Member Function Documentation

◆ addDetIds()

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

Definition at line 49 of file EGHcalRecHitSelector.h.

References funct::abs(), calDIEta(), calDIPhi(), DetId::Ecal, DetId::Forward, getMinEnergyHCAL_(), maxDIEta_, maxDIPhi_, rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, reco::SuperCluster::seed(), run3scouting_cff::seedId, ecaldqm::towerId(), towerMap_, and CaloTowerConstituentsMap::towerOf().

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

51  {
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 }
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)
Log< level::Error, false > LogError
float getMinEnergyHCAL_(HcalDetId id) const
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
static int calDIEta(int iEta1, int iEta2)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:17
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79

◆ calDIEta()

int EGHcalRecHitSelector::calDIEta ( int  iEta1,
int  iEta2 
)
staticprivate

Definition at line 23 of file EGHcalRecHitSelector.cc.

References HLT_2024v14_cff::dEta.

Referenced by addDetIds().

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

◆ calDIPhi()

int EGHcalRecHitSelector::calDIPhi ( int  iPhi1,
int  iPhi2 
)
staticprivate

Definition at line 34 of file EGHcalRecHitSelector.cc.

References HLT_2024v14_cff::dPhi.

Referenced by addDetIds().

34  {
35  int dPhi = iPhi1 - iPhi2;
36  if (dPhi > 72 / 2)
37  dPhi -= 72;
38  else if (dPhi < -72 / 2)
39  dPhi += 72;
40  return dPhi;
41 }

◆ getMinEnergyHCAL_()

float EGHcalRecHitSelector::getMinEnergyHCAL_ ( HcalDetId  id) const
private

Definition at line 43 of file EGHcalRecHitSelector.cc.

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

Referenced by addDetIds().

43  {
44  if (id.subdetId() == HcalBarrel)
45  return minEnergyHB_;
46  else if (id.subdetId() == HcalEndcap) {
47  if (id.depth() == 1)
48  return minEnergyHEDepth1_;
49  else
50  return minEnergyHEDefault_;
51  } else
53 }

◆ makePSetDescription()

edm::ParameterSetDescription EGHcalRecHitSelector::makePSetDescription ( )
static

Definition at line 13 of file EGHcalRecHitSelector.cc.

References submitPVResolutionJobs::desc.

Referenced by EgammaIsoHcalDetIdCollectionProducer::fillDescriptions().

13  {
15  desc.add<int>("maxDIEta", 5);
16  desc.add<int>("maxDIPhi", 5);
17  desc.add<double>("minEnergyHB", 0.8);
18  desc.add<double>("minEnergyHEDepth1", 0.1);
19  desc.add<double>("minEnergyHEDefault", 0.2);
20  return desc;
21 }

◆ setup()

void EGHcalRecHitSelector::setup ( const edm::EventSetup iSetup)
inline

Definition at line 29 of file EGHcalRecHitSelector.h.

References edm::EventSetup::getHandle(), towerMap_, and towerMapToken_.

Referenced by EgammaIsoHcalDetIdCollectionProducer::beginRun(), and ReducedEGProducer::beginRun().

29 { towerMap_ = iSetup.getHandle(towerMapToken_); }
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130

Member Data Documentation

◆ maxDIEta_

int EGHcalRecHitSelector::maxDIEta_
private

Definition at line 38 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

◆ maxDIPhi_

int EGHcalRecHitSelector::maxDIPhi_
private

Definition at line 39 of file EGHcalRecHitSelector.h.

Referenced by addDetIds().

◆ minEnergyHB_

float EGHcalRecHitSelector::minEnergyHB_
private

Definition at line 40 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

◆ minEnergyHEDefault_

float EGHcalRecHitSelector::minEnergyHEDefault_
private

Definition at line 42 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

◆ minEnergyHEDepth1_

float EGHcalRecHitSelector::minEnergyHEDepth1_
private

Definition at line 41 of file EGHcalRecHitSelector.h.

Referenced by getMinEnergyHCAL_().

◆ towerMap_

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

Definition at line 44 of file EGHcalRecHitSelector.h.

Referenced by addDetIds(), and setup().

◆ towerMapToken_

edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> EGHcalRecHitSelector::towerMapToken_
private

Definition at line 45 of file EGHcalRecHitSelector.h.

Referenced by setup().