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 ssCalc_
 

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 20 of file EgammaHLTHGCalIDVarProducer.cc.

Constructor & Destructor Documentation

◆ EgammaHLTHGCalIDVarProducer()

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

Definition at line 60 of file EgammaHLTHGCalIDVarProducer.cc.

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

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 85 of file EgammaHLTHGCalIDVarProducer.cc.

85 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 87 of file EgammaHLTHGCalIDVarProducer.cc.

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

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

◆ produce()

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

Definition at line 97 of file EgammaHLTHGCalIDVarProducer.cc.

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

References HGCalShowerShapeHelper::getPCAWidths(), HGCalShowerShapeHelper::getRvar(), HGCalClusterTools::hadEnergyInCone(), HLTEgPhaseIITestSequence_cff::hgcalRecHits, hgcalRecHitToken_, hOverECone_, iEvent, HGCalShowerShapeHelper::initPerEvent(), HGCalShowerShapeHelper::initPerObject(), HLTEgPhaseIITestSequence_cff::layerClusters, layerClusterToken_, eostools::move(), pcaAssocMaps_, rCylinder_, recoEcalCandidateToken_, and ssCalc_.

Member Data Documentation

◆ hgcalRecHitToken_

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

Definition at line 55 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ hOverECone_

float EgammaHLTHGCalIDVarProducer::hOverECone_
private

Definition at line 52 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ layerClusterToken_

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

Definition at line 56 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ pcaAssocMaps_

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

Definition at line 53 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by EgammaHLTHGCalIDVarProducer(), and produce().

◆ rCylinder_

float EgammaHLTHGCalIDVarProducer::rCylinder_
private

Definition at line 51 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ recoEcalCandidateToken_

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

Definition at line 54 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

◆ ssCalc_

HGCalShowerShapeHelper EgammaHLTHGCalIDVarProducer::ssCalc_
private

Definition at line 57 of file EgammaHLTHGCalIDVarProducer.cc.

Referenced by produce().

EgammaHLTHGCalIDVarProducer::ssCalc_
HGCalShowerShapeHelper ssCalc_
Definition: EgammaHLTHGCalIDVarProducer.cc:57
HLTEgPhaseIITestSequence_cff.hgcalRecHits
hgcalRecHits
Definition: HLTEgPhaseIITestSequence_cff.py:2505
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HGCalShowerShapeHelper::ShowerWidths::sigma2yy
double sigma2yy
Definition: HGCalShowerShapeHelper.h:64
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HGCalShowerShapeHelper::ShowerWidths::sigma2uu
double sigma2uu
Definition: HGCalShowerShapeHelper.h:71
EgammaHLTHGCalIDVarProducer::hOverECone_
float hOverECone_
Definition: EgammaHLTHGCalIDVarProducer.cc:52
HGCalShowerShapeHelper::initPerEvent
void initPerEvent(const edm::EventSetup &iSetup, const std::vector< reco::PFRecHit > &recHits)
Definition: HGCalShowerShapeHelper.cc:9
edm::Ref
Definition: AssociativeIterator.h:58
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
config
Definition: config.py:1
HGCalShowerShapeHelper::initPerObject
void initPerObject(const std::vector< std::pair< DetId, float > > &hitsAndFracs, double minHitE=0, double minHitET=0, int minLayer=1, int maxLayer=-1, DetId::Detector subDet=DetId::HGCalEE)
Definition: HGCalShowerShapeHelper.cc:14
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:54
HGCalShowerShapeHelper::ShowerWidths::sigma2vv
double sigma2vv
Definition: HGCalShowerShapeHelper.h:72
HGCalShowerShapeHelper::ShowerWidths::sigma2zz
double sigma2zz
Definition: HGCalShowerShapeHelper.h:65
HLTEgPhaseIITestSequence_cff.layerClusters
layerClusters
Definition: HLTEgPhaseIITestSequence_cff.py:2506
HGCalShowerShapeHelper::ShowerWidths::sigma2yz
double sigma2yz
Definition: HGCalShowerShapeHelper.h:68
EgammaHLTHGCalIDVarProducer::hgcalRecHitToken_
const edm::EDGetTokenT< reco::PFRecHitCollection > hgcalRecHitToken_
Definition: EgammaHLTHGCalIDVarProducer.cc:55
EgammaHLTHGCalIDVarProducer::layerClusterToken_
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterToken_
Definition: EgammaHLTHGCalIDVarProducer.cc:56
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
iEvent
int iEvent
Definition: GenABIO.cc:224
HGCalShowerShapeHelper::ShowerWidths::sigma2xy
double sigma2xy
Definition: HGCalShowerShapeHelper.h:67
HGCalShowerShapeHelper::getRvar
const double getRvar(double cylinderR, double energyNorm, bool useFractions=true, bool useCellSize=true)
Definition: HGCalShowerShapeHelper.cc:137
HGCalShowerShapeHelper::ShowerWidths::sigma2ww
double sigma2ww
Definition: HGCalShowerShapeHelper.h:73
EgammaHLTHGCalIDVarProducer::rCylinder_
float rCylinder_
Definition: EgammaHLTHGCalIDVarProducer.cc:51
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
HGCalShowerShapeHelper::getPCAWidths
const ShowerWidths getPCAWidths(double cylinderR, bool useFractions=false)
Definition: HGCalShowerShapeHelper.cc:188
EgammaHLTHGCalIDVarProducer::pcaAssocMaps_
std::vector< PCAAssocMap > pcaAssocMaps_
Definition: EgammaHLTHGCalIDVarProducer.cc:53
HGCalShowerShapeHelper::ShowerWidths::sigma2zx
double sigma2zx
Definition: HGCalShowerShapeHelper.h:69
HGCalShowerShapeHelper::ShowerWidths::sigma2xx
double sigma2xx
Definition: HGCalShowerShapeHelper.h:63
edm::InputTag
Definition: InputTag.h:15