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
 
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 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<>
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 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.

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 }

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

◆ ~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.

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 }

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

◆ produce()

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

Definition at line 145 of file HLTEcalPFClusterIsolationProducer.cc.

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 }

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

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.

edm::Handle::product
T const * product() const
Definition: Handle.h:70
HLTEcalPFClusterIsolationProducer::etaStripEndcap_
const double etaStripEndcap_
Definition: HLTEcalPFClusterIsolationProducer.cc:66
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTEcalPFClusterIsolationProducer::effectiveAreas_
const std::vector< double > effectiveAreas_
Definition: HLTEcalPFClusterIsolationProducer.cc:73
HLTEcalPFClusterIsolationProducer::energyEndcap_
const double energyEndcap_
Definition: HLTEcalPFClusterIsolationProducer.cc:68
edm::Handle< double >
HLTEcalPFClusterIsolationProducer::recoCandidateProducer_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
Definition: HLTEcalPFClusterIsolationProducer.cc:58
HLTEcalPFClusterIsolationProducer::T1Ref
edm::Ref< T1Collection > T1Ref
Definition: HLTEcalPFClusterIsolationProducer.cc:45
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTEcalPFClusterIsolationProducer::absEtaLowEdges_
const std::vector< double > absEtaLowEdges_
Definition: HLTEcalPFClusterIsolationProducer.cc:74
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTEcalPFClusterIsolationProducer::drVetoEndcap_
const double drVetoEndcap_
Definition: HLTEcalPFClusterIsolationProducer.cc:64
HLTEcalPFClusterIsolationProducer::pfClusterProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_
Definition: HLTEcalPFClusterIsolationProducer.cc:59
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
HLTEcalPFClusterIsolationProducer::etaStripBarrel_
const double etaStripBarrel_
Definition: HLTEcalPFClusterIsolationProducer.cc:65
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTEcalPFClusterIsolationProducer::rhoMax_
const double rhoMax_
Definition: HLTEcalPFClusterIsolationProducer.cc:71
HLTEcalPFClusterIsolationProducer::rhoScale_
const double rhoScale_
Definition: HLTEcalPFClusterIsolationProducer.cc:72
HLTEcalPFClusterIsolationProducer::drMax_
const double drMax_
Definition: HLTEcalPFClusterIsolationProducer.cc:62
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTEcalPFClusterIsolationProducer
Definition: HLTEcalPFClusterIsolationProducer.cc:43
HLTEcalPFClusterIsolationProducer::doRhoCorrection_
const bool doRhoCorrection_
Definition: HLTEcalPFClusterIsolationProducer.cc:70
Exception
Definition: hltDiff.cc:246
HLTEcalPFClusterIsolationProducer::T1IsolationMap
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
Definition: HLTEcalPFClusterIsolationProducer.cc:46
EcalPFClusterIsolation
Definition: EcalPFClusterIsolation.h:17
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLTEcalPFClusterIsolationProducer::drVetoBarrel_
const double drVetoBarrel_
Definition: HLTEcalPFClusterIsolationProducer.cc:63
HLTEcalPFClusterIsolationProducer::rhoProducer_
const edm::EDGetTokenT< double > rhoProducer_
Definition: HLTEcalPFClusterIsolationProducer.cc:60
edm::InputTag
Definition: InputTag.h:15
HLTEcalPFClusterIsolationProducer::energyBarrel_
const double energyBarrel_
Definition: HLTEcalPFClusterIsolationProducer.cc:67