CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT
< reco::PFRecHitCollection
hgcalRecHitToken_
 
float hOverECone_
 
const edm::EDGetTokenT
< reco::CaloClusterCollection
layerClusterToken_
 
std::vector< PCAAssocMappcaAssocMaps_
 
float rCylinder_
 
const edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateToken_
 
HGCalShowerShapeHelper ssHelper_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 21 of file EgammaHLTHGCalIDVarProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 61 of file EgammaHLTHGCalIDVarProducer.cc.

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 ALCARECOEcalPhiSym_cff::var.

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 }
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterToken_
std::vector< PCAAssocMap > pcaAssocMaps_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< reco::PFRecHitCollection > hgcalRecHitToken_
EgammaHLTHGCalIDVarProducer::~EgammaHLTHGCalIDVarProducer ( )
override

Definition at line 86 of file EgammaHLTHGCalIDVarProducer.cc.

86 {}

Member Function Documentation

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

Definition at line 88 of file EgammaHLTHGCalIDVarProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and EgammaHGCALIDParamDefaults::kRCylinder.

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTHGCalIDVarProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 98 of file EgammaHLTHGCalIDVarProducer.cc.

References HGCalShowerShapeHelper::createCalc(), edm::Event::get(), edm::Event::getHandle(), HGCalClusterTools::hadEnergyInCone(), particleFlowSuperClusteringSequence_cff::hgcalRecHits, hgcalRecHitToken_, hOverECone_, HGCalShowerShapeHelper::initPerEvent(), layerClusterToken_, eostools::move(), pcaAssocMaps_, edm::Event::put(), rCylinder_, recoEcalCandidateToken_, and ssHelper_.

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 }
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterToken_
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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
std::vector< PCAAssocMap > pcaAssocMaps_
void initPerEvent(const std::vector< reco::PFRecHit > &recHits)
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
def move
Definition: eostools.py:511
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
const edm::EDGetTokenT< reco::PFRecHitCollection > hgcalRecHitToken_
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)

Member Data Documentation

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

Definition at line 56 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

float EgammaHLTHGCalIDVarProducer::hOverECone_
private

Definition at line 53 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

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

Definition at line 57 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

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

Definition at line 54 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by EgammaHLTHGCalIDVarProducer(), and produce().

float EgammaHLTHGCalIDVarProducer::rCylinder_
private

Definition at line 52 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

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

Definition at line 55 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

HGCalShowerShapeHelper EgammaHLTHGCalIDVarProducer::ssHelper_
private

Definition at line 58 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().