CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HLTHcalPFClusterIsolationProducer< T1 > Class Template Reference

#include <HLTHcalPFClusterIsolationProducer.h>

Inheritance diagram for HLTHcalPFClusterIsolationProducer< T1 >:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTHcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTHcalPFClusterIsolationProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
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
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 Types

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

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::PFClusterCollectionpfClusterProducerHCAL_
 
const edm::EDGetTokenT< reco::PFClusterCollectionpfClusterProducerHFEM_
 
const edm::EDGetTokenT< reco::PFClusterCollectionpfClusterProducerHFHAD_
 
edm::EDGetTokenT< T1CollectionrecoCandidateProducer_
 
const double rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const double rhoScale_
 
const bool useEt_
 
const bool useHF_
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T1>
class HLTHcalPFClusterIsolationProducer< T1 >

Definition at line 29 of file HLTHcalPFClusterIsolationProducer.h.

Member Typedef Documentation

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

Definition at line 31 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 33 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 32 of file HLTHcalPFClusterIsolationProducer.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file HLTHcalPFClusterIsolationProducer.cc.

References HLTHcalPFClusterIsolationProducer< T1 >::absEtaLowEdges_, HLTHcalPFClusterIsolationProducer< T1 >::doRhoCorrection_, HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreas_, Exception, edm::ParameterSet::getParameter(), HLTHcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_, and AlCaHLTBitMon_QueryRunRegistry::string.

21  :
22  pfClusterProducerHCAL_ ( consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"))),
23  rhoProducer_ ( consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"))),
24  pfClusterProducerHFEM_ ( consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"))),
25  pfClusterProducerHFHAD_ ( consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"))),
26  useHF_ ( config.getParameter<bool>("useHF")),
27  drMax_ ( config.getParameter<double>("drMax")),
28  drVetoBarrel_ ( config.getParameter<double>("drVetoBarrel")),
29  drVetoEndcap_ ( config.getParameter<double>("drVetoEndcap")),
30  etaStripBarrel_ ( config.getParameter<double>("etaStripBarrel")),
31  etaStripEndcap_ ( config.getParameter<double>("etaStripEndcap")),
32  energyBarrel_ ( config.getParameter<double>("energyBarrel")),
33  energyEndcap_ ( config.getParameter<double>("energyEndcap")),
34  useEt_ ( config.getParameter<bool>("useEt")),
35  doRhoCorrection_ ( config.getParameter<bool>("doRhoCorrection")),
36  rhoMax_ ( config.getParameter<double>("rhoMax")),
37  rhoScale_ ( config.getParameter<double>("rhoScale")),
38  effectiveAreas_ ( config.getParameter<std::vector<double> >("effectiveAreas")) ,
39  absEtaLowEdges_ ( config.getParameter<std::vector<double> >("absEtaLowEdges")) {
40 
41  if (doRhoCorrection_) {
42  if (absEtaLowEdges_.size() != effectiveAreas_.size())
43  throw cms::Exception("IncompatibleVects") << "absEtaLowEdges and effectiveAreas should be of the same size. \n";
44 
45  if (absEtaLowEdges_.at(0) != 0.0)
46  throw cms::Exception("IncompleteCoverage") << "absEtaLowEdges should start from 0. \n";
47 
48  for (unsigned int aIt = 0; aIt < absEtaLowEdges_.size() - 1; aIt++) {
49  if ( !(absEtaLowEdges_.at( aIt ) < absEtaLowEdges_.at( aIt + 1 )) )
50  throw cms::Exception("ImproperBinning") << "absEtaLowEdges entries should be in increasing order. \n";
51  }
52  }
53 
54  std::string recoCandidateProducerName = "recoCandidateProducer";
55  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
56  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
57 
58  produces <T1IsolationMap >();
59 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< double > rhoProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
template<typename T1 >
HLTHcalPFClusterIsolationProducer< T1 >::~HLTHcalPFClusterIsolationProducer ( )
override

Definition at line 62 of file HLTHcalPFClusterIsolationProducer.cc.

63 {}

Member Function Documentation

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

Definition at line 66 of file HLTHcalPFClusterIsolationProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), edm::ParameterSetDescription::ifValue(), or, and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67 
68  std::string recoCandidateProducerName = "recoCandidateProducer";
69  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
70 
72  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
73  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("hltParticleFlowClusterHCAL"));
74  desc.ifValue(edm::ParameterDescription<bool>("useHF", false, true),
75  true >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
76  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
77  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
78  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
79  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
80  desc.add<bool>("doRhoCorrection", false);
81  desc.add<double>("rhoMax", 9.9999999E7);
82  desc.add<double>("rhoScale", 1.0);
83  desc.add<double>("drMax", 0.3);
84  desc.add<double>("drVetoBarrel", 0.0);
85  desc.add<double>("drVetoEndcap", 0.0);
86  desc.add<double>("etaStripBarrel", 0.0);
87  desc.add<double>("etaStripEndcap", 0.0);
88  desc.add<double>("energyBarrel", 0.0);
89  desc.add<double>("energyEndcap", 0.0);
90  desc.add<bool>("useEt", true);
91  desc.add<std::vector<double> >("effectiveAreas", {0.2, 0.25}); // 2016 post-ichep sinEle default
92  desc.add<std::vector<double> >("absEtaLowEdges", {0.0, 1.479}); // Barrel, Endcap
94 }
std::string defaultModuleLabel()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T > > cases)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T1 >
void HLTHcalPFClusterIsolationProducer< T1 >::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 97 of file HLTHcalPFClusterIsolationProducer.cc.

References funct::abs(), HLTHcalPFClusterIsolationProducer< T1 >::absEtaLowEdges_, HLTHcalPFClusterIsolationProducer< T1 >::doRhoCorrection_, HLTHcalPFClusterIsolationProducer< T1 >::drMax_, HLTHcalPFClusterIsolationProducer< T1 >::drVetoBarrel_, HLTHcalPFClusterIsolationProducer< T1 >::drVetoEndcap_, HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreas_, HLTHcalPFClusterIsolationProducer< T1 >::energyBarrel_, HLTHcalPFClusterIsolationProducer< T1 >::energyEndcap_, HLTHcalPFClusterIsolationProducer< T1 >::etaStripBarrel_, HLTHcalPFClusterIsolationProducer< T1 >::etaStripEndcap_, edm::Event::getByToken(), HcalPFClusterIsolation< T1 >::getSum(), edm::AssociationMap< Tag >::insert(), HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHCAL_, HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFEM_, HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFHAD_, edm::Handle< T >::product(), edm::Event::put(), HLTHcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_, rho, HLTHcalPFClusterIsolationProducer< T1 >::rhoMax_, HLTHcalPFClusterIsolationProducer< T1 >::rhoProducer_, HLTHcalPFClusterIsolationProducer< T1 >::rhoScale_, HLTHcalPFClusterIsolationProducer< T1 >::useEt_, and HLTHcalPFClusterIsolationProducer< T1 >::useHF_.

97  {
98 
99  edm::Handle<double> rhoHandle;
100  double rho = 0.0;
101  if (doRhoCorrection_) {
102  iEvent.getByToken(rhoProducer_, rhoHandle);
103  rho = *(rhoHandle.product());
104  }
105 
106  if (rho > rhoMax_)
107  rho = rhoMax_;
108 
109  rho = rho*rhoScale_;
110 
111  edm::Handle<T1Collection> recoCandHandle;
112 
113  std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
114  edm::Handle<reco::PFClusterCollection> clusterHcalHandle;
115  edm::Handle<reco::PFClusterCollection> clusterHfemHandle;
116  edm::Handle<reco::PFClusterCollection> clusterHfhadHandle;
117 
118  iEvent.getByToken(recoCandidateProducer_,recoCandHandle);
119  iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
120  //const reco::PFClusterCollection* forIsolationHcal = clusterHcalHandle.product();
121  clusterHandles.push_back(clusterHcalHandle);
122 
123  if (useHF_) {
124  iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
125  clusterHandles.push_back(clusterHfemHandle);
126  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
127  clusterHandles.push_back(clusterHfhadHandle);
128  }
129 
130  T1IsolationMap recoCandMap(recoCandHandle);
132 
133  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
134  T1Ref candRef(recoCandHandle, iReco);
135 
136  float sum = isoAlgo.getSum(candRef, clusterHandles);
137 
138  if (doRhoCorrection_) {
139  int iEA = -1;
140  auto cEta = std::abs(candRef->eta());
141  for (int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
142  if ( cEta > absEtaLowEdges_.at(bIt) ) {
143  iEA = bIt;
144  break;
145  }
146  }
147 
148  sum = sum - rho*effectiveAreas_.at(iEA);
149  }
150 
151  recoCandMap.insert(candRef, sum);
152  }
153 
154  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
155 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
const edm::EDGetTokenT< double > rhoProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
T const * product() const
Definition: Handle.h:81
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_

Member Data Documentation

template<typename T1 >
const std::vector<double> HLTHcalPFClusterIsolationProducer< T1 >::absEtaLowEdges_
private
template<typename T1 >
const bool HLTHcalPFClusterIsolationProducer< T1 >::doRhoCorrection_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::drMax_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::drVetoBarrel_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::drVetoEndcap_
private
template<typename T1 >
const std::vector<double> HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreas_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::energyBarrel_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::energyEndcap_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::etaStripBarrel_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::etaStripEndcap_
private
template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHCAL_
private
template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFEM_
private
template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFHAD_
private
template<typename T1 >
edm::EDGetTokenT<T1Collection> HLTHcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::rhoMax_
private
template<typename T1 >
const edm::EDGetTokenT<double> HLTHcalPFClusterIsolationProducer< T1 >::rhoProducer_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::rhoScale_
private
template<typename T1 >
const bool HLTHcalPFClusterIsolationProducer< T1 >::useEt_
private
template<typename T1 >
const bool HLTHcalPFClusterIsolationProducer< T1 >::useHF_
private