CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTBcHcalIsolationProducersRegional Class Reference
Inheritance diagram for EgammaHLTBcHcalIsolationProducersRegional:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTBcHcalIsolationProducersRegional (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const final
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const std::vector< double > absEtaLowEdges_
 
const edm::EDGetTokenT< CaloTowerCollectioncaloTowerProducer_
 
const int depth_
 
const bool doEtSum_
 
const bool doRhoCorrection_
 
const std::vector< double > effectiveAreas_
 
const double etMin_
 
const double innerCone_
 
const double outerCone_
 
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMapputToken_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
const double rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const double rhoScale_
 
const bool useSingleTower_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 23 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Constructor & Destructor Documentation

◆ EgammaHLTBcHcalIsolationProducersRegional()

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

Definition at line 52 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

53  : doEtSum_(config.getParameter<bool>("doEtSum")),
54  etMin_(config.getParameter<double>("etMin")),
55  innerCone_(config.getParameter<double>("innerCone")),
56  outerCone_(config.getParameter<double>("outerCone")),
57  depth_(config.getParameter<int>("depth")),
58  useSingleTower_(config.getParameter<bool>("useSingleTower")),
59  doRhoCorrection_(config.getParameter<bool>("doRhoCorrection")),
60  rhoScale_(config.getParameter<double>("rhoScale")),
61  rhoMax_(config.getParameter<double>("rhoMax")),
62  effectiveAreas_(config.getParameter<std::vector<double> >("effectiveAreas")),
63  absEtaLowEdges_(config.getParameter<std::vector<double> >("absEtaLowEdges")),
65  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
66  caloTowerProducer_(consumes<CaloTowerCollection>(config.getParameter<edm::InputTag>("caloTowerProducer"))),
67  rhoProducer_(doRhoCorrection_ ? consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"))
69  putToken_{produces<reco::RecoEcalCandidateIsolationMap>()} {
70  if (doRhoCorrection_) {
71  if (absEtaLowEdges_.size() != effectiveAreas_.size()) {
72  throw cms::Exception("IncompatibleVects") << "absEtaLowEdges and effectiveAreas should be of the same size. \n";
73  }
74 
75  if (absEtaLowEdges_.at(0) != 0.0) {
76  throw cms::Exception("IncompleteCoverage") << "absEtaLowEdges should start from 0. \n";
77  }
78 
79  for (unsigned int aIt = 0; aIt < absEtaLowEdges_.size() - 1; aIt++) {
80  if (!(absEtaLowEdges_.at(aIt) < absEtaLowEdges_.at(aIt + 1))) {
81  throw cms::Exception("ImproperBinning") << "absEtaLowEdges entries should be in increasing order. \n";
82  }
83  }
84  }
85 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 87 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

87  {
89 
90  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
91  desc.add<edm::InputTag>(("caloTowerProducer"), edm::InputTag("hltTowerMakerForAll"));
92  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
93  desc.add<bool>(("doRhoCorrection"), false);
94  desc.add<double>(("rhoMax"), 999999.);
95  desc.add<double>(("rhoScale"), 1.0);
96  desc.add<double>(("etMin"), -1.0);
97  desc.add<double>(("innerCone"), 0);
98  desc.add<double>(("outerCone"), 0.15);
99  desc.add<int>(("depth"), -1);
100  desc.add<bool>(("doEtSum"), false);
101  desc.add<bool>(("useSingleTower"), false);
102  desc.add<std::vector<double> >("effectiveAreas", {0.079, 0.25}); // 2016 post-ichep sinEle default
103  desc.add<std::vector<double> >("absEtaLowEdges", {0.0, 1.479}); // Barrel, Endcap
104  descriptions.add(("hltEgammaHLTBcHcalIsolationProducersRegional"), desc);
105 }

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

◆ produce()

void EgammaHLTBcHcalIsolationProducersRegional::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
finalvirtual

Implements edm::global::EDProducerBase.

Definition at line 107 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

109  {
110  // Get the HLT filtered objects
111  auto recoEcalCandHandle = iEvent.getHandle(recoEcalCandidateProducer_);
112 
113  double rho = 0.0;
114 
115  if (doRhoCorrection_) {
116  rho = iEvent.get(rhoProducer_);
117  if (rho > rhoMax_) {
118  rho = rhoMax_;
119  }
120  rho = rho * rhoScale_;
121  }
122 
123  auto const &caloTowers = iEvent.get(caloTowerProducer_);
124  EgammaHadTower hadTower(iSetup);
125 
126  const EgammaTowerIsolation towerIso1(outerCone_, 0., etMin_, 1, &caloTowers);
127  const EgammaTowerIsolation towerIso2(outerCone_, 0., etMin_, 2, &caloTowers);
128 
129  reco::RecoEcalCandidateIsolationMap isoMap(recoEcalCandHandle);
130 
131  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoEcalCandHandle->size(); iRecoEcalCand++) {
132  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand);
133 
134  float isol = 0;
135 
136  auto towersBehindCluster =
137  useSingleTower_ ? hadTower.towersOf(*(recoEcalCandRef->superCluster())) : std::vector<CaloTowerDetId>{};
138 
139  if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E
141  if (useSingleTower_) {
142  // towersBehindCluster are excluded from the isolation sum
143  isol = isolAlgo.getTowerEtSum(recoEcalCandRef.get(), &towersBehindCluster);
144  } else {
145  isol = isolAlgo.getTowerEtSum(recoEcalCandRef.get());
146  }
147 
148  } else { //calcuate H for H/E
149  if (useSingleTower_)
150  isol = hadTower.getDepth1HcalESum(towersBehindCluster, caloTowers) +
151  hadTower.getDepth2HcalESum(towersBehindCluster, caloTowers);
152  else {
153  auto const &sc = recoEcalCandRef->superCluster().get();
154  isol = towerIso1.getTowerESum(sc) + towerIso2.getTowerESum(sc);
155  }
156  }
157 
158  if (doRhoCorrection_) {
159  int iEA = -1;
160  auto scEta = std::abs(recoEcalCandRef->superCluster()->eta());
161  for (int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
162  if (scEta > absEtaLowEdges_.at(bIt)) {
163  iEA = bIt;
164  break;
165  }
166  }
167  isol = isol - rho * effectiveAreas_.at(iEA);
168  }
169 
170  isoMap.insert(recoEcalCandRef, isol);
171  }
172 
173  iEvent.emplace(putToken_, isoMap);
174 }

References funct::abs(), absEtaLowEdges_, caloTowerProducer_, eleHcalExtractorBlocks_cff::caloTowers, depth_, doEtSum_, doRhoCorrection_, effectiveAreas_, etMin_, edm::Ref< C, T, F >::get(), EgammaHadTower::getDepth1HcalESum(), EgammaHadTower::getDepth2HcalESum(), EgammaTowerIsolation::getTowerESum(), EgammaTowerIsolation::getTowerEtSum(), iEvent, innerCone_, edm::AssociationMap< Tag >::insert(), outerCone_, putToken_, recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, rhoScale_, EgammaHadTower::towersOf(), and useSingleTower_.

Member Data Documentation

◆ absEtaLowEdges_

const std::vector<double> EgammaHLTBcHcalIsolationProducersRegional::absEtaLowEdges_
private

Definition at line 43 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ caloTowerProducer_

const edm::EDGetTokenT<CaloTowerCollection> EgammaHLTBcHcalIsolationProducersRegional::caloTowerProducer_
private

Definition at line 46 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ depth_

const int EgammaHLTBcHcalIsolationProducersRegional::depth_
private

Definition at line 36 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ doEtSum_

const bool EgammaHLTBcHcalIsolationProducersRegional::doEtSum_
private

Definition at line 32 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ doRhoCorrection_

const bool EgammaHLTBcHcalIsolationProducersRegional::doRhoCorrection_
private

Definition at line 39 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ effectiveAreas_

const std::vector<double> EgammaHLTBcHcalIsolationProducersRegional::effectiveAreas_
private

Definition at line 42 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ etMin_

const double EgammaHLTBcHcalIsolationProducersRegional::etMin_
private

Definition at line 33 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ innerCone_

const double EgammaHLTBcHcalIsolationProducersRegional::innerCone_
private

Definition at line 34 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ outerCone_

const double EgammaHLTBcHcalIsolationProducersRegional::outerCone_
private

Definition at line 35 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ putToken_

const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> EgammaHLTBcHcalIsolationProducersRegional::putToken_
private

Definition at line 49 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ recoEcalCandidateProducer_

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTBcHcalIsolationProducersRegional::recoEcalCandidateProducer_
private

Definition at line 45 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ rhoMax_

const double EgammaHLTBcHcalIsolationProducersRegional::rhoMax_
private

Definition at line 41 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ rhoProducer_

const edm::EDGetTokenT<double> EgammaHLTBcHcalIsolationProducersRegional::rhoProducer_
private

Definition at line 47 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ rhoScale_

const double EgammaHLTBcHcalIsolationProducersRegional::rhoScale_
private

Definition at line 40 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

◆ useSingleTower_

const bool EgammaHLTBcHcalIsolationProducersRegional::useSingleTower_
private

Definition at line 37 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

Referenced by produce().

EgammaHLTBcHcalIsolationProducersRegional::rhoProducer_
const edm::EDGetTokenT< double > rhoProducer_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:47
EgammaHLTBcHcalIsolationProducersRegional::outerCone_
const double outerCone_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:35
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
EgammaHLTBcHcalIsolationProducersRegional::rhoMax_
const double rhoMax_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:41
edm::EDGetTokenT< double >
EgammaHLTBcHcalIsolationProducersRegional::depth_
const int depth_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:36
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Ref
Definition: AssociativeIterator.h:58
config
Definition: config.py:1
EgammaHLTBcHcalIsolationProducersRegional::recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:45
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHLTBcHcalIsolationProducersRegional::effectiveAreas_
const std::vector< double > effectiveAreas_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:42
EgammaHLTBcHcalIsolationProducersRegional::caloTowerProducer_
const edm::EDGetTokenT< CaloTowerCollection > caloTowerProducer_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:46
DDAxes::rho
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
edm::AssociationMap
Definition: AssociationMap.h:48
EgammaHLTBcHcalIsolationProducersRegional::rhoScale_
const double rhoScale_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:40
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:196
iEvent
int iEvent
Definition: GenABIO.cc:224
EgammaHLTBcHcalIsolationProducersRegional::etMin_
const double etMin_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:33
EgammaHLTBcHcalIsolationProducersRegional::useSingleTower_
const bool useSingleTower_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:37
EgammaHLTBcHcalIsolationProducersRegional::putToken_
const edm::EDPutTokenT< reco::RecoEcalCandidateIsolationMap > putToken_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:49
EgammaHLTBcHcalIsolationProducersRegional::doEtSum_
const bool doEtSum_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:32
Exception
Definition: hltDiff.cc:246
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EgammaHadTower
Definition: EgammaHadTower.h:17
EgammaHLTBcHcalIsolationProducersRegional::innerCone_
const double innerCone_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:34
EgammaHLTBcHcalIsolationProducersRegional::doRhoCorrection_
const bool doRhoCorrection_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:39
edm::InputTag
Definition: InputTag.h:15
EgammaHLTBcHcalIsolationProducersRegional::absEtaLowEdges_
const std::vector< double > absEtaLowEdges_
Definition: EgammaHLTBcHcalIsolationProducersRegional.cc:43