CMS 3D CMS Logo

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

Public Member Functions

 HLTEcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTEcalPFClusterIsolationProducer () 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 Types

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

Private Member Functions

bool computedRVeto (T1Ref candRef, reco::PFClusterRef pfclu)
 

Private Attributes

const std::vector< double > absEtaLowEdges_
 
const bool doRhoCorrection_
 
const double drMax_
 
const double drVetoBarrel_
 
const double drVetoEndcap_
 
const std::vector< double > effectiveAreas_
 
const double energyBarrel_
 
const double energyEndcap_
 
const double etaStripBarrel_
 
const double etaStripEndcap_
 
const edm::EDGetTokenT< reco::PFClusterCollectionpfClusterProducer_
 
edm::EDGetTokenT< T1CollectionrecoCandidateProducer_
 
const double rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const double rhoScale_
 

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

template<typename T1>
class HLTEcalPFClusterIsolationProducer< T1 >

Definition at line 43 of file HLTEcalPFClusterIsolationProducer.cc.

Member Typedef Documentation

◆ T1Collection

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

Definition at line 44 of file HLTEcalPFClusterIsolationProducer.cc.

◆ T1IsolationMap

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

Definition at line 46 of file HLTEcalPFClusterIsolationProducer.cc.

◆ T1Ref

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

Definition at line 45 of file HLTEcalPFClusterIsolationProducer.cc.

Constructor & Destructor Documentation

◆ HLTEcalPFClusterIsolationProducer()

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

Definition at line 78 of file HLTEcalPFClusterIsolationProducer.cc.

References HLTEcalPFClusterIsolationProducer< T1 >::absEtaLowEdges_, HLTEcalPFClusterIsolationProducer< T1 >::doRhoCorrection_, HLTEcalPFClusterIsolationProducer< T1 >::effectiveAreas_, Exception, HLTEcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_, and AlCaHLTBitMon_QueryRunRegistry::string.

79  : pfClusterProducer_(consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducer"))),
80  rhoProducer_(consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"))),
81  drMax_(config.getParameter<double>("drMax")),
82  drVetoBarrel_(config.getParameter<double>("drVetoBarrel")),
83  drVetoEndcap_(config.getParameter<double>("drVetoEndcap")),
84  etaStripBarrel_(config.getParameter<double>("etaStripBarrel")),
85  etaStripEndcap_(config.getParameter<double>("etaStripEndcap")),
86  energyBarrel_(config.getParameter<double>("energyBarrel")),
87  energyEndcap_(config.getParameter<double>("energyEndcap")),
88  doRhoCorrection_(config.getParameter<bool>("doRhoCorrection")),
89  rhoMax_(config.getParameter<double>("rhoMax")),
90  rhoScale_(config.getParameter<double>("rhoScale")),
91  effectiveAreas_(config.getParameter<std::vector<double>>("effectiveAreas")),
92  absEtaLowEdges_(config.getParameter<std::vector<double>>("absEtaLowEdges")) {
93  if (doRhoCorrection_) {
94  if (absEtaLowEdges_.size() != effectiveAreas_.size())
95  throw cms::Exception("IncompatibleVects") << "absEtaLowEdges and effectiveAreas should be of the same size. \n";
96 
97  if (absEtaLowEdges_.at(0) != 0.0)
98  throw cms::Exception("IncompleteCoverage") << "absEtaLowEdges should start from 0. \n";
99 
100  for (unsigned int aIt = 0; aIt < absEtaLowEdges_.size() - 1; aIt++) {
101  if (!(absEtaLowEdges_.at(aIt) < absEtaLowEdges_.at(aIt + 1)))
102  throw cms::Exception("ImproperBinning") << "absEtaLowEdges entries should be in increasing order. \n";
103  }
104  }
105 
106  std::string recoCandidateProducerName = "recoCandidateProducer";
109  recoCandidateProducerName = "recoEcalCandidateProducer";
110 
111  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
112  produces<T1IsolationMap>();
113 }
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
Definition: config.py:1
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_

◆ ~HLTEcalPFClusterIsolationProducer()

template<typename T1 >
HLTEcalPFClusterIsolationProducer< T1 >::~HLTEcalPFClusterIsolationProducer ( )
override

Definition at line 116 of file HLTEcalPFClusterIsolationProducer.cc.

116 {}

Member Function Documentation

◆ computedRVeto()

template<typename T1 >
bool HLTEcalPFClusterIsolationProducer< T1 >::computedRVeto ( T1Ref  candRef,
reco::PFClusterRef  pfclu 
)
private

◆ fillDescriptions()

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

Definition at line 119 of file HLTEcalPFClusterIsolationProducer.cc.

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

119  {
120  std::string recoCandidateProducerName = "recoCandidateProducer";
123  recoCandidateProducerName = "recoEcalCandidateProducer";
124 
126  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
127  desc.add<edm::InputTag>("pfClusterProducer", edm::InputTag("hltParticleFlowClusterECAL"));
128  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
129  desc.add<bool>("doRhoCorrection", false);
130  desc.add<double>("rhoMax", 9.9999999E7);
131  desc.add<double>("rhoScale", 1.0);
132  desc.add<double>("drMax", 0.3);
133  desc.add<double>("drVetoBarrel", 0.0);
134  desc.add<double>("drVetoEndcap", 0.0);
135  desc.add<double>("etaStripBarrel", 0.0);
136  desc.add<double>("etaStripEndcap", 0.0);
137  desc.add<double>("energyBarrel", 0.0);
138  desc.add<double>("energyEndcap", 0.0);
139  desc.add<std::vector<double>>("effectiveAreas", {0.29, 0.21}); // 2016 post-ichep sinEle default
140  desc.add<std::vector<double>>("absEtaLowEdges", {0.0, 1.479}); // Barrel, Endcap
142 }
std::string defaultModuleLabel()
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 145 of file HLTEcalPFClusterIsolationProducer.cc.

References funct::abs(), EcalPFClusterIsolation< T1 >::getSum(), iEvent, edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), and IsoPhotonEBSkim_cff::rho.

145  {
146  edm::Handle<double> rhoHandle;
147  double rho = 0.0;
148  if (doRhoCorrection_) {
149  iEvent.getByToken(rhoProducer_, rhoHandle);
150  rho = *(rhoHandle.product());
151  }
152 
153  if (rho > rhoMax_)
154  rho = rhoMax_;
155 
156  rho = rho * rhoScale_;
157 
158  edm::Handle<T1Collection> recoCandHandle;
160 
161  iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
162  iEvent.getByToken(pfClusterProducer_, clusterHandle);
163 
166  T1IsolationMap recoCandMap(recoCandHandle);
167 
168  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
169  T1Ref candRef(recoCandHandle, iReco);
170 
171  float sum = isoAlgo.getSum(candRef, clusterHandle);
172 
173  if (doRhoCorrection_) {
174  int iEA = -1;
175  auto cEta = std::abs(candRef->eta());
176  for (int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
177  if (cEta > absEtaLowEdges_.at(bIt)) {
178  iEA = bIt;
179  break;
180  }
181  }
182 
183  sum = sum - rho * effectiveAreas_.at(iEA);
184  }
185 
186  recoCandMap.insert(candRef, sum);
187  }
188 
189  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
190 }
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
T const * product() const
Definition: Handle.h:70
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
int iEvent
Definition: GenABIO.cc:224
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_

Member Data Documentation

◆ absEtaLowEdges_

template<typename T1 >
const std::vector<double> HLTEcalPFClusterIsolationProducer< T1 >::absEtaLowEdges_
private

◆ doRhoCorrection_

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

◆ drMax_

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

Definition at line 62 of file HLTEcalPFClusterIsolationProducer.cc.

◆ drVetoBarrel_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::drVetoBarrel_
private

Definition at line 63 of file HLTEcalPFClusterIsolationProducer.cc.

◆ drVetoEndcap_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::drVetoEndcap_
private

Definition at line 64 of file HLTEcalPFClusterIsolationProducer.cc.

◆ effectiveAreas_

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

◆ energyBarrel_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::energyBarrel_
private

Definition at line 67 of file HLTEcalPFClusterIsolationProducer.cc.

◆ energyEndcap_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::energyEndcap_
private

Definition at line 68 of file HLTEcalPFClusterIsolationProducer.cc.

◆ etaStripBarrel_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::etaStripBarrel_
private

Definition at line 65 of file HLTEcalPFClusterIsolationProducer.cc.

◆ etaStripEndcap_

template<typename T1 >
const double HLTEcalPFClusterIsolationProducer< T1 >::etaStripEndcap_
private

Definition at line 66 of file HLTEcalPFClusterIsolationProducer.cc.

◆ pfClusterProducer_

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTEcalPFClusterIsolationProducer< T1 >::pfClusterProducer_
private

Definition at line 59 of file HLTEcalPFClusterIsolationProducer.cc.

◆ recoCandidateProducer_

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

◆ rhoMax_

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

Definition at line 71 of file HLTEcalPFClusterIsolationProducer.cc.

◆ rhoProducer_

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

Definition at line 60 of file HLTEcalPFClusterIsolationProducer.cc.

◆ rhoScale_

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

Definition at line 72 of file HLTEcalPFClusterIsolationProducer.cc.