CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HLTHcalPFClusterIsolationProducer< T1 > Class Template Reference
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
 
 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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 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::PFClusterCollection
pfClusterProducerHCAL_
 
const edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFEM_
 
const edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFHAD_
 
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::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

template<typename T1>
class HLTHcalPFClusterIsolationProducer< T1 >

Definition at line 35 of file HLTHcalPFClusterIsolationProducer.cc.

Member Typedef Documentation

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

Definition at line 36 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 38 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 37 of file HLTHcalPFClusterIsolationProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 73 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.

75  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"))),
76  rhoProducer_(consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"))),
78  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"))),
80  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"))),
81  useHF_(config.getParameter<bool>("useHF")),
82  drMax_(config.getParameter<double>("drMax")),
83  drVetoBarrel_(config.getParameter<double>("drVetoBarrel")),
84  drVetoEndcap_(config.getParameter<double>("drVetoEndcap")),
85  etaStripBarrel_(config.getParameter<double>("etaStripBarrel")),
86  etaStripEndcap_(config.getParameter<double>("etaStripEndcap")),
87  energyBarrel_(config.getParameter<double>("energyBarrel")),
88  energyEndcap_(config.getParameter<double>("energyEndcap")),
89  useEt_(config.getParameter<bool>("useEt")),
90  doRhoCorrection_(config.getParameter<bool>("doRhoCorrection")),
91  rhoMax_(config.getParameter<double>("rhoMax")),
92  rhoScale_(config.getParameter<double>("rhoScale")),
93  effectiveAreas_(config.getParameter<std::vector<double>>("effectiveAreas")),
94  absEtaLowEdges_(config.getParameter<std::vector<double>>("absEtaLowEdges")) {
95  if (doRhoCorrection_) {
96  if (absEtaLowEdges_.size() != effectiveAreas_.size())
97  throw cms::Exception("IncompatibleVects") << "absEtaLowEdges and effectiveAreas should be of the same size. \n";
98 
99  if (absEtaLowEdges_.at(0) != 0.0)
100  throw cms::Exception("IncompleteCoverage") << "absEtaLowEdges should start from 0. \n";
101 
102  for (unsigned int aIt = 0; aIt < absEtaLowEdges_.size() - 1; aIt++) {
103  if (!(absEtaLowEdges_.at(aIt) < absEtaLowEdges_.at(aIt + 1)))
104  throw cms::Exception("ImproperBinning") << "absEtaLowEdges entries should be in increasing order. \n";
105  }
106  }
107 
108  std::string recoCandidateProducerName = "recoCandidateProducer";
111  recoCandidateProducerName = "recoEcalCandidateProducer";
112  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
113 
114  produces<T1IsolationMap>();
115 }
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
template<typename T1 >
HLTHcalPFClusterIsolationProducer< T1 >::~HLTHcalPFClusterIsolationProducer ( )
override

Definition at line 118 of file HLTHcalPFClusterIsolationProducer.cc.

118 {}

Member Function Documentation

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

Definition at line 121 of file HLTHcalPFClusterIsolationProducer.cc.

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

121  {
122  std::string recoCandidateProducerName = "recoCandidateProducer";
125  recoCandidateProducerName = "recoEcalCandidateProducer";
126 
128  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
129  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("hltParticleFlowClusterHCAL"));
130  desc.ifValue(
131  edm::ParameterDescription<bool>("useHF", false, true),
133  "pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
135  "pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
136  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
137  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
138  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
139  desc.add<bool>("doRhoCorrection", false);
140  desc.add<double>("rhoMax", 9.9999999E7);
141  desc.add<double>("rhoScale", 1.0);
142  desc.add<double>("drMax", 0.3);
143  desc.add<double>("drVetoBarrel", 0.0);
144  desc.add<double>("drVetoEndcap", 0.0);
145  desc.add<double>("etaStripBarrel", 0.0);
146  desc.add<double>("etaStripEndcap", 0.0);
147  desc.add<double>("energyBarrel", 0.0);
148  desc.add<double>("energyEndcap", 0.0);
149  desc.add<bool>("useEt", true);
150  desc.add<std::vector<double>>("effectiveAreas", {0.2, 0.25}); // 2016 post-ichep sinEle default
151  desc.add<std::vector<double>>("absEtaLowEdges", {0.0, 1.479}); // Barrel, Endcap
153 }
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::string defaultModuleLabel()
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  
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 156 of file HLTHcalPFClusterIsolationProducer.cc.

References funct::abs(), edm::Event::getByToken(), HcalPFClusterIsolation< T1 >::getSum(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), and HLT_FULL_cff::rho.

158  {
159  edm::Handle<double> rhoHandle;
160  double rho = 0.0;
161  if (doRhoCorrection_) {
162  iEvent.getByToken(rhoProducer_, rhoHandle);
163  rho = *(rhoHandle.product());
164  }
165 
166  if (rho > rhoMax_)
167  rho = rhoMax_;
168 
169  rho = rho * rhoScale_;
170 
171  edm::Handle<T1Collection> recoCandHandle;
172 
173  std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
174  edm::Handle<reco::PFClusterCollection> clusterHcalHandle;
175  edm::Handle<reco::PFClusterCollection> clusterHfemHandle;
176  edm::Handle<reco::PFClusterCollection> clusterHfhadHandle;
177 
178  iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
179  iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
180  //const reco::PFClusterCollection* forIsolationHcal = clusterHcalHandle.product();
181  clusterHandles.push_back(clusterHcalHandle);
182 
183  if (useHF_) {
184  iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
185  clusterHandles.push_back(clusterHfemHandle);
186  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
187  clusterHandles.push_back(clusterHfhadHandle);
188  }
189 
190  T1IsolationMap recoCandMap(recoCandHandle);
193 
194  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
195  T1Ref candRef(recoCandHandle, iReco);
196 
197  float sum = isoAlgo.getSum(candRef, clusterHandles);
198 
199  if (doRhoCorrection_) {
200  int iEA = -1;
201  auto cEta = std::abs(candRef->eta());
202  for (int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
203  if (cEta > absEtaLowEdges_.at(bIt)) {
204  iEA = bIt;
205  break;
206  }
207  }
208 
209  sum = sum - rho * effectiveAreas_.at(iEA);
210  }
211 
212  recoCandMap.insert(candRef, sum);
213  }
214 
215  iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
216 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
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:70
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

Definition at line 56 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 57 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 58 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 61 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 62 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 59 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 60 of file HLTHcalPFClusterIsolationProducer.cc.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHCAL_
private

Definition at line 49 of file HLTHcalPFClusterIsolationProducer.cc.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFEM_
private

Definition at line 51 of file HLTHcalPFClusterIsolationProducer.cc.

template<typename T1 >
const edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFHAD_
private

Definition at line 52 of file HLTHcalPFClusterIsolationProducer.cc.

template<typename T1 >
edm::EDGetTokenT<T1Collection> HLTHcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_
private
template<typename T1 >
const double HLTHcalPFClusterIsolationProducer< T1 >::rhoMax_
private

Definition at line 66 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 50 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 67 of file HLTHcalPFClusterIsolationProducer.cc.

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

Definition at line 63 of file HLTHcalPFClusterIsolationProducer.cc.

template<typename T1 >
const bool HLTHcalPFClusterIsolationProducer< T1 >::useHF_
private

Definition at line 54 of file HLTHcalPFClusterIsolationProducer.cc.