CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTHGCalIDVarProducer Class Reference
Inheritance diagram for EgammaHLTHGCalIDVarProducer:
edm::stream::EDProducer<>

Classes

class  PCAAssocMap
 

Public Member Functions

 EgammaHLTHGCalIDVarProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EgammaHLTHGCalIDVarProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT< reco::PFRecHitCollectionhgcalRecHitToken_
 
float hOverECone_
 
const edm::EDGetTokenT< reco::CaloClusterCollectionlayerClusterToken_
 
std::vector< PCAAssocMappcaAssocMaps_
 
float rCylinder_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateToken_
 
HGCalShowerShapeHelper ssHelper_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 21 of file EgammaHLTHGCalIDVarProducer.cc.

Constructor & Destructor Documentation

◆ EgammaHLTHGCalIDVarProducer()

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

Definition at line 61 of file EgammaHLTHGCalIDVarProducer.cc.

62  : rCylinder_(config.getParameter<double>("rCylinder")),
63  hOverECone_(config.getParameter<double>("hOverECone")),
65  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
66  hgcalRecHitToken_(consumes<reco::PFRecHitCollection>(config.getParameter<edm::InputTag>("hgcalRecHits"))),
67  layerClusterToken_(consumes<reco::CaloClusterCollection>(config.getParameter<edm::InputTag>("layerClusters"))),
68  ssHelper_(consumesCollector()) {
69  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2xx, "sigma2xx"));
70  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2yy, "sigma2yy"));
71  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2zz, "sigma2zz"));
72  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2xy, "sigma2xy"));
73  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2yz, "sigma2yz"));
74  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2zx, "sigma2zx"));
75  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2uu, "sigma2uu"));
76  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2vv, "sigma2vv"));
77  pcaAssocMaps_.emplace_back(PCAAssocMap(&HGCalShowerShapeHelper::ShowerWidths::sigma2ww, "sigma2ww"));
78 
79  produces<reco::RecoEcalCandidateIsolationMap>("rVar");
80  produces<reco::RecoEcalCandidateIsolationMap>("hForHOverE");
81  for (auto& var : pcaAssocMaps_) {
82  produces<reco::RecoEcalCandidateIsolationMap>(var.name());
83  }
84 }

References pcaAssocMaps_, HGCalShowerShapeHelper::ShowerWidths::sigma2uu, HGCalShowerShapeHelper::ShowerWidths::sigma2vv, HGCalShowerShapeHelper::ShowerWidths::sigma2ww, HGCalShowerShapeHelper::ShowerWidths::sigma2xx, HGCalShowerShapeHelper::ShowerWidths::sigma2xy, HGCalShowerShapeHelper::ShowerWidths::sigma2yy, HGCalShowerShapeHelper::ShowerWidths::sigma2yz, HGCalShowerShapeHelper::ShowerWidths::sigma2zx, HGCalShowerShapeHelper::ShowerWidths::sigma2zz, and trigObjTnPSource_cfi::var.

◆ ~EgammaHLTHGCalIDVarProducer()

EgammaHLTHGCalIDVarProducer::~EgammaHLTHGCalIDVarProducer ( )
override

Definition at line 86 of file EgammaHLTHGCalIDVarProducer.cc.

86 {}

Member Function Documentation

◆ fillDescriptions()

void EgammaHLTHGCalIDVarProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 88 of file EgammaHLTHGCalIDVarProducer.cc.

88  {
90  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag("hltL1SeededRecoEcalCandidate"));
91  desc.add<edm::InputTag>("hgcalRecHits", edm::InputTag("hgcalRecHits"));
92  desc.add<edm::InputTag>("layerClusters", edm::InputTag("layerClusters"));
93  desc.add<double>("rCylinder", EgammaHGCALIDParamDefaults::kRCylinder);
94  desc.add<double>("hOverECone", 0.15);
95  descriptions.add(("hltEgammaHLTHGCalIDVarProducer"), desc);
96 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and EgammaHGCALIDParamDefaults::kRCylinder.

◆ produce()

void EgammaHLTHGCalIDVarProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 98 of file EgammaHLTHGCalIDVarProducer.cc.

98  {
99  auto recoEcalCandHandle = iEvent.getHandle(recoEcalCandidateToken_);
100  const auto& hgcalRecHits = iEvent.get(hgcalRecHitToken_);
101  const auto& layerClusters = iEvent.get(layerClusterToken_);
102 
104 
105  auto rVarMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
106  auto hForHoverEMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
107  for (auto& pcaMap : pcaAssocMaps_) {
108  pcaMap.initMap(recoEcalCandHandle);
109  }
110 
111  for (size_t candNr = 0; candNr < recoEcalCandHandle->size(); candNr++) {
112  reco::RecoEcalCandidateRef candRef(recoEcalCandHandle, candNr);
113  auto ssCalc = ssHelper_.createCalc(*candRef->superCluster());
114  rVarMap->insert(candRef, ssCalc.getRvar(rCylinder_));
115 
116  float hForHoverE = HGCalClusterTools::hadEnergyInCone(
117  candRef->superCluster()->eta(), candRef->superCluster()->phi(), layerClusters, 0., hOverECone_, 0., 0.);
118  hForHoverEMap->insert(candRef, hForHoverE);
119  auto pcaWidths = ssCalc.getPCAWidths(rCylinder_);
120  for (auto& pcaMap : pcaAssocMaps_) {
121  pcaMap.insert(candRef, pcaWidths);
122  }
123  }
124  iEvent.put(std::move(rVarMap), "rVar");
125  iEvent.put(std::move(hForHoverEMap), "hForHOverE");
126  for (auto& pcaMap : pcaAssocMaps_) {
127  iEvent.put(pcaMap.releaseMap(), pcaMap.name());
128  }
129 }

References HGCalShowerShapeHelper::createCalc(), HGCalClusterTools::hadEnergyInCone(), particleFlowSuperClusteringSequence_cff::hgcalRecHits, hgcalRecHitToken_, hOverECone_, iEvent, HGCalShowerShapeHelper::initPerEvent(), HLTEgPhaseIITestSequence_cff::layerClusters, layerClusterToken_, eostools::move(), pcaAssocMaps_, rCylinder_, recoEcalCandidateToken_, and ssHelper_.

Member Data Documentation

◆ hgcalRecHitToken_

const edm::EDGetTokenT<reco::PFRecHitCollection> EgammaHLTHGCalIDVarProducer::hgcalRecHitToken_
private

Definition at line 56 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ hOverECone_

float EgammaHLTHGCalIDVarProducer::hOverECone_
private

Definition at line 53 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ layerClusterToken_

const edm::EDGetTokenT<reco::CaloClusterCollection> EgammaHLTHGCalIDVarProducer::layerClusterToken_
private

Definition at line 57 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ pcaAssocMaps_

std::vector<PCAAssocMap> EgammaHLTHGCalIDVarProducer::pcaAssocMaps_
private

Definition at line 54 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by EgammaHLTHGCalIDVarProducer(), and produce().

◆ rCylinder_

float EgammaHLTHGCalIDVarProducer::rCylinder_
private

Definition at line 52 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ recoEcalCandidateToken_

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTHGCalIDVarProducer::recoEcalCandidateToken_
private

Definition at line 55 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ ssHelper_

HGCalShowerShapeHelper EgammaHLTHGCalIDVarProducer::ssHelper_
private

Definition at line 58 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HGCalShowerShapeHelper::ShowerWidths::sigma2yy
double sigma2yy
Definition: HGCalShowerShapeHelper.h:65
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HGCalShowerShapeHelper::ShowerWidths::sigma2uu
double sigma2uu
Definition: HGCalShowerShapeHelper.h:72
EgammaHLTHGCalIDVarProducer::hOverECone_
float hOverECone_
Definition: EgammaHLTHGCalIDVarProducer.cc:53
edm::Ref
Definition: AssociativeIterator.h:58
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHLTHGCalIDVarProducer::recoEcalCandidateToken_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
Definition: EgammaHLTHGCalIDVarProducer.cc:55
HGCalShowerShapeHelper::ShowerWidths::sigma2vv
double sigma2vv
Definition: HGCalShowerShapeHelper.h:73
HGCalShowerShapeHelper::ShowerWidths::sigma2zz
double sigma2zz
Definition: HGCalShowerShapeHelper.h:66
HLTEgPhaseIITestSequence_cff.layerClusters
layerClusters
Definition: HLTEgPhaseIITestSequence_cff.py:2506
HGCalShowerShapeHelper::ShowerWidths::sigma2yz
double sigma2yz
Definition: HGCalShowerShapeHelper.h:69
EgammaHLTHGCalIDVarProducer::hgcalRecHitToken_
const edm::EDGetTokenT< reco::PFRecHitCollection > hgcalRecHitToken_
Definition: EgammaHLTHGCalIDVarProducer.cc:56
EgammaHLTHGCalIDVarProducer::layerClusterToken_
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterToken_
Definition: EgammaHLTHGCalIDVarProducer.cc:57
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
HGCalShowerShapeHelper::createCalc
HGCalShowerShapeHelper::ShowerShapeCalc createCalc(const std::vector< std::pair< DetId, float > > &hitsAndFracs, double rawEnergy, double minHitE=0, double minHitET=0, int minLayer=1, int maxLayer=-1, DetId::Detector subDet=DetId::HGCalEE) const
EgammaHGCALIDParamDefaults::kRCylinder
static constexpr float kRCylinder
Definition: EgammaHGCALIDParamDefaults.h:5
iEvent
int iEvent
Definition: GenABIO.cc:224
HGCalShowerShapeHelper::ShowerWidths::sigma2xy
double sigma2xy
Definition: HGCalShowerShapeHelper.h:68
HGCalShowerShapeHelper::ShowerWidths::sigma2ww
double sigma2ww
Definition: HGCalShowerShapeHelper.h:74
EgammaHLTHGCalIDVarProducer::ssHelper_
HGCalShowerShapeHelper ssHelper_
Definition: EgammaHLTHGCalIDVarProducer.cc:58
particleFlowSuperClusteringSequence_cff.hgcalRecHits
hgcalRecHits
Definition: particleFlowSuperClusteringSequence_cff.py:38
EgammaHLTHGCalIDVarProducer::rCylinder_
float rCylinder_
Definition: EgammaHLTHGCalIDVarProducer.cc:52
eostools.move
def move(src, dest)
Definition: eostools.py:511
HGCalClusterTools::hadEnergyInCone
static float hadEnergyInCone(const float eta, const float phi, const std::vector< reco::CaloCluster > &layerClusters, const float minDR, const float maxDR, const float minEt, const float minEnergy, const HGCalClusterTools::EType &eType=EType::ENERGY)
Definition: HGCalClusterTools.h:21
EgammaHLTHGCalIDVarProducer::pcaAssocMaps_
std::vector< PCAAssocMap > pcaAssocMaps_
Definition: EgammaHLTHGCalIDVarProducer.cc:54
HGCalShowerShapeHelper::ShowerWidths::sigma2zx
double sigma2zx
Definition: HGCalShowerShapeHelper.h:70
HGCalShowerShapeHelper::ShowerWidths::sigma2xx
double sigma2xx
Definition: HGCalShowerShapeHelper.h:64
HGCalShowerShapeHelper::initPerEvent
void initPerEvent(const std::vector< reco::PFRecHit > &recHits)
Definition: HGCalShowerShapeHelper.cc:303
edm::InputTag
Definition: InputTag.h:15