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")),

◆ ~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.

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 }

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

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

◆ calDIEta()

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

Definition at line 23 of file EGHcalRecHitSelector.cc.

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 }

References HLT_FULL_cff::dEta.

Referenced by addDetIds().

◆ calDIPhi()

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

Definition at line 34 of file EGHcalRecHitSelector.cc.

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 }

References HLT_FULL_cff::dPhi.

Referenced by addDetIds().

◆ getMinEnergyHCAL_()

float EGHcalRecHitSelector::getMinEnergyHCAL_ ( HcalDetId  id) const
private

Definition at line 43 of file EGHcalRecHitSelector.cc.

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 }

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

Referenced by addDetIds().

◆ makePSetDescription()

edm::ParameterSetDescription EGHcalRecHitSelector::makePSetDescription ( )
static

Definition at line 13 of file EGHcalRecHitSelector.cc.

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 }

References submitPVResolutionJobs::desc.

Referenced by EgammaIsoHcalDetIdCollectionProducer::fillDescriptions().

◆ setup()

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

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().

EGHcalRecHitSelector::getMinEnergyHCAL_
float getMinEnergyHCAL_(HcalDetId id) const
Definition: EGHcalRecHitSelector.cc:43
EGHcalRecHitSelector::maxDIEta_
int maxDIEta_
Definition: EGHcalRecHitSelector.h:38
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EGHcalRecHitSelector::minEnergyHEDefault_
float minEnergyHEDefault_
Definition: EGHcalRecHitSelector.h:42
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
EGHcalRecHitSelector::minEnergyHB_
float minEnergyHB_
Definition: EGHcalRecHitSelector.h:40
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HcalBarrel
Definition: HcalAssistant.h:33
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13695
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
ecaldqm::towerId
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:77
config
Definition: config.py:1
DetId
Definition: DetId.h:17
CaloTowerConstituentsMap
Definition: CaloTowerConstituentsMap.h:18
EGHcalRecHitSelector::towerMapToken_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
Definition: EGHcalRecHitSelector.h:45
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
EGHcalRecHitSelector::towerMap_
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
Definition: EGHcalRecHitSelector.h:44
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
EGHcalRecHitSelector::minEnergyHEDepth1_
float minEnergyHEDepth1_
Definition: EGHcalRecHitSelector.h:41
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
cc
EGHcalRecHitSelector::maxDIPhi_
int maxDIPhi_
Definition: EGHcalRecHitSelector.h:39
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
EGHcalRecHitSelector::calDIEta
static int calDIEta(int iEta1, int iEta2)
Definition: EGHcalRecHitSelector.cc:23
HcalEndcap
Definition: HcalAssistant.h:34
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13694
edm::Transition::BeginRun
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId::Forward
Definition: DetId.h:30
EGHcalRecHitSelector::calDIPhi
static int calDIPhi(int iPhi1, int iPhi2)
Definition: EGHcalRecHitSelector.cc:34
CaloTowerDetId
Definition: CaloTowerDetId.h:12