CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HLTHGCalLayerClusterIsolationProducer< T1 > Class Template Reference
Inheritance diagram for HLTHGCalLayerClusterIsolationProducer< T1 >:
edm::stream::EDProducer<>

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< T1 > T1Collection
 
typedef edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
 
typedef edm::Ref< T1CollectionT1Ref
 

Private Attributes

const bool doRhoCorrection_
 
const double drMax_
 
const double drVetoEM_
 
const double drVetoHad_
 
const std::vector< double > effectiveAreas_
 
const edm::EDGetTokenT< reco::CaloClusterCollectionlayerClusterProducer_
 
const double minEnergyEM_
 
const double minEnergyHad_
 
const double minEtEM_
 
const double minEtHad_
 
edm::EDGetTokenT< T1CollectionrecoCandidateProducer_
 
const double rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const double rhoScale_
 
const bool useEt_
 

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

template<typename T1>
class HLTHGCalLayerClusterIsolationProducer< T1 >

Definition at line 38 of file HLTHGCalLayerClusterIsolationProducer.cc.

Member Typedef Documentation

◆ T1Collection

template<typename T1 >
typedef std::vector<T1> HLTHGCalLayerClusterIsolationProducer< T1 >::T1Collection
private

Definition at line 39 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ T1IsolationMap

template<typename T1 >
typedef edm::AssociationMap<edm::OneToValue<std::vector<T1>, float> > HLTHGCalLayerClusterIsolationProducer< T1 >::T1IsolationMap
private

Definition at line 41 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ T1Ref

template<typename T1 >
typedef edm::Ref<T1Collection> HLTHGCalLayerClusterIsolationProducer< T1 >::T1Ref
private

Definition at line 40 of file HLTHGCalLayerClusterIsolationProducer.cc.

Constructor & Destructor Documentation

◆ HLTHGCalLayerClusterIsolationProducer()

template<typename T1 >
HLTHGCalLayerClusterIsolationProducer< T1 >::HLTHGCalLayerClusterIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 70 of file HLTHGCalLayerClusterIsolationProducer.cc.

72  consumes<reco::CaloClusterCollection>(config.getParameter<edm::InputTag>("layerClusterProducer"))),
73  rhoProducer_(consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"))),
74  drMax_(config.getParameter<double>("drMax")),
75  drVetoEM_(config.getParameter<double>("drVetoEM")),
76  drVetoHad_(config.getParameter<double>("drVetoHad")),
77  minEnergyEM_(config.getParameter<double>("minEnergyEM")),
78  minEnergyHad_(config.getParameter<double>("minEnergyHad")),
79  minEtEM_(config.getParameter<double>("minEtEM")),
80  minEtHad_(config.getParameter<double>("minEtHad")),
81  useEt_(config.getParameter<bool>("useEt")),
82  doRhoCorrection_(config.getParameter<bool>("doRhoCorrection")),
83  rhoMax_(config.getParameter<double>("rhoMax")),
84  rhoScale_(config.getParameter<double>("rhoScale")),
85  effectiveAreas_(config.getParameter<std::vector<double>>("effectiveAreas")) {
86  if (doRhoCorrection_) {
87  if (effectiveAreas_.size() != 2)
88  throw cms::Exception("IncompatibleVects")
89  << "effectiveAreas should have two elements for em and had components. \n";
90  }
91 
92  std::string recoCandidateProducerName = "recoCandidateProducer";
95  recoCandidateProducerName = "recoEcalCandidateProducer";
96 
97  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
98  produces<T1IsolationMap>();
99  produces<T1IsolationMap>("em");
100  produces<T1IsolationMap>("had");
101 }

References HLTHGCalLayerClusterIsolationProducer< T1 >::doRhoCorrection_, HLTHGCalLayerClusterIsolationProducer< T1 >::effectiveAreas_, HLTHGCalLayerClusterIsolationProducer< T1 >::recoCandidateProducer_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~HLTHGCalLayerClusterIsolationProducer()

template<typename T1 >
HLTHGCalLayerClusterIsolationProducer< T1 >::~HLTHGCalLayerClusterIsolationProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

template<typename T1 >
void HLTHGCalLayerClusterIsolationProducer< T1 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 104 of file HLTHGCalLayerClusterIsolationProducer.cc.

104  {
105  std::string recoCandidateProducerName = "recoCandidateProducer";
108  recoCandidateProducerName = "recoEcalCandidateProducer";
109 
111  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
112  desc.add<edm::InputTag>("layerClusterProducer", edm::InputTag("hltParticleFlowClusterECAL"));
113  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
114  desc.add<bool>("doRhoCorrection", false);
115  desc.add<bool>("useEt", false);
116  desc.add<double>("rhoMax", 9.9999999E7);
117  desc.add<double>("rhoScale", 1.0);
118  desc.add<double>("drMax", 0.3);
119  desc.add<double>("drVetoEM", 0.0);
120  desc.add<double>("drVetoHad", 0.0);
121  desc.add<double>("minEnergyEM", 0.0);
122  desc.add<double>("minEnergyHad", 0.0);
123  desc.add<double>("minEtEM", 0.0);
124  desc.add<double>("minEtHad", 0.0);
125  desc.add<std::vector<double>>("effectiveAreas", {0.0, 0.0}); // for em and had components
127 }

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

template<typename T1 >
void HLTHGCalLayerClusterIsolationProducer< T1 >::produce ( edm::Event iEvent,
const edm::EventSetup  
)
override

Definition at line 130 of file HLTHGCalLayerClusterIsolationProducer.cc.

130  {
131  edm::Handle<double> rhoHandle;
132  double rho = 0.0;
133  if (doRhoCorrection_) {
134  iEvent.getByToken(rhoProducer_, rhoHandle);
135  rho = *(rhoHandle.product());
136  }
137 
138  rho = std::min(rho, rhoMax_);
139  rho = rho * rhoScale_;
140 
141  edm::Handle<T1Collection> recoCandHandle;
143 
144  iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
145  iEvent.getByToken(layerClusterProducer_, clusterHandle);
146 
147  const std::vector<reco::CaloCluster> layerClusters = *(clusterHandle.product());
148 
149  T1IsolationMap recoCandMap(recoCandHandle);
150  T1IsolationMap recoCandMapEm(recoCandHandle);
151  T1IsolationMap recoCandMapHad(recoCandHandle);
152 
153  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
154  T1Ref candRef(recoCandHandle, iReco);
155 
156  float sumEm =
157  HGCalClusterTools::emEnergyInCone(candRef->eta(),
158  candRef->phi(),
160  drVetoEM_,
161  drMax_,
162  minEtEM_,
163  minEnergyEM_,
165 
166  float sumHad =
167  HGCalClusterTools::hadEnergyInCone(candRef->eta(),
168  candRef->phi(),
170  drVetoHad_,
171  drMax_,
172  minEtHad_,
175 
176  if (doRhoCorrection_) {
177  sumEm = sumEm - rho * effectiveAreas_.at(0);
178  sumHad = sumHad - rho * effectiveAreas_.at(1);
179  }
180 
181  float sum = sumEm + sumHad;
182 
183  recoCandMap.insert(candRef, sum);
184  recoCandMapEm.insert(candRef, sumEm);
185  recoCandMapHad.insert(candRef, sumHad);
186  }
187 
188  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
189  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMapEm), "em");
190  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMapHad), "had");
191 }

References HGCalClusterTools::emEnergyInCone(), HGCalClusterTools::ENERGY, HGCalClusterTools::ET, HGCalClusterTools::hadEnergyInCone(), iEvent, edm::AssociationMap< Tag >::insert(), HLTEgPhaseIITestSequence_cff::layerClusters, min(), edm::Handle< T >::product(), and ZElectronSkim_cff::rho.

Member Data Documentation

◆ doRhoCorrection_

template<typename T1 >
const bool HLTHGCalLayerClusterIsolationProducer< T1 >::doRhoCorrection_
private

◆ drMax_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::drMax_
private

Definition at line 55 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ drVetoEM_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::drVetoEM_
private

Definition at line 56 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ drVetoHad_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::drVetoHad_
private

Definition at line 57 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ effectiveAreas_

template<typename T1 >
const std::vector<double> HLTHGCalLayerClusterIsolationProducer< T1 >::effectiveAreas_
private

◆ layerClusterProducer_

template<typename T1 >
const edm::EDGetTokenT<reco::CaloClusterCollection> HLTHGCalLayerClusterIsolationProducer< T1 >::layerClusterProducer_
private

Definition at line 52 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ minEnergyEM_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::minEnergyEM_
private

Definition at line 58 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ minEnergyHad_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::minEnergyHad_
private

Definition at line 59 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ minEtEM_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::minEtEM_
private

Definition at line 60 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ minEtHad_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::minEtHad_
private

Definition at line 61 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ recoCandidateProducer_

template<typename T1 >
edm::EDGetTokenT<T1Collection> HLTHGCalLayerClusterIsolationProducer< T1 >::recoCandidateProducer_
private

◆ rhoMax_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::rhoMax_
private

Definition at line 64 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ rhoProducer_

template<typename T1 >
const edm::EDGetTokenT<double> HLTHGCalLayerClusterIsolationProducer< T1 >::rhoProducer_
private

Definition at line 53 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ rhoScale_

template<typename T1 >
const double HLTHGCalLayerClusterIsolationProducer< T1 >::rhoScale_
private

Definition at line 65 of file HLTHGCalLayerClusterIsolationProducer.cc.

◆ useEt_

template<typename T1 >
const bool HLTHGCalLayerClusterIsolationProducer< T1 >::useEt_
private

Definition at line 62 of file HLTHGCalLayerClusterIsolationProducer.cc.

HLTHGCalLayerClusterIsolationProducer::useEt_
const bool useEt_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:62
HLTHGCalLayerClusterIsolationProducer::rhoProducer_
const edm::EDGetTokenT< double > rhoProducer_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:53
edm::Handle::product
T const * product() const
Definition: Handle.h:70
min
T min(T a, T b)
Definition: MathUtil.h:58
HLTHGCalLayerClusterIsolationProducer::drMax_
const double drMax_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:55
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HGCalClusterTools::EType::ET
HGCalClusterTools::emEnergyInCone
static float emEnergyInCone(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:32
HLTHGCalLayerClusterIsolationProducer::drVetoHad_
const double drVetoHad_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:57
edm::Handle< double >
HLTHGCalLayerClusterIsolationProducer::effectiveAreas_
const std::vector< double > effectiveAreas_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:66
HLTHGCalLayerClusterIsolationProducer::drVetoEM_
const double drVetoEM_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:56
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTEgPhaseIITestSequence_cff.layerClusters
layerClusters
Definition: HLTEgPhaseIITestSequence_cff.py:2506
HLTHGCalLayerClusterIsolationProducer::doRhoCorrection_
const bool doRhoCorrection_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:63
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTHGCalLayerClusterIsolationProducer::T1Ref
edm::Ref< T1Collection > T1Ref
Definition: HLTHGCalLayerClusterIsolationProducer.cc:40
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
HLTHGCalLayerClusterIsolationProducer
Definition: HLTHGCalLayerClusterIsolationProducer.cc:38
HLTHGCalLayerClusterIsolationProducer::minEtHad_
const double minEtHad_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:61
HLTHGCalLayerClusterIsolationProducer::T1IsolationMap
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
Definition: HLTHGCalLayerClusterIsolationProducer.cc:41
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTHGCalLayerClusterIsolationProducer::minEnergyHad_
const double minEnergyHad_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:59
HLTHGCalLayerClusterIsolationProducer::recoCandidateProducer_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:51
HLTHGCalLayerClusterIsolationProducer::layerClusterProducer_
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterProducer_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:52
HGCalClusterTools::EType::ENERGY
HLTHGCalLayerClusterIsolationProducer::rhoScale_
const double rhoScale_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:65
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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
HLTHGCalLayerClusterIsolationProducer::minEnergyEM_
const double minEnergyEM_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:58
cms::Exception
Definition: Exception.h:70
edm::InputTag
Definition: InputTag.h:15
HLTHGCalLayerClusterIsolationProducer::minEtEM_
const double minEtEM_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:60
HLTHGCalLayerClusterIsolationProducer::rhoMax_
const double rhoMax_
Definition: HLTHGCalLayerClusterIsolationProducer.cc:64