CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 bool doRhoCorrection_
 
const double drMax_
 
const double drVetoBarrel_
 
const double drVetoEndcap_
 
const float effectiveAreaBarrel_
 
const float effectiveAreaEndcap_
 
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 float rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const float 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
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 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  doRhoCorrection_ ( config.getParameter<bool>("doRhoCorrection")),
35  rhoMax_ ( config.getParameter<double>("rhoMax")),
36  rhoScale_ ( config.getParameter<double>("rhoScale")),
37  effectiveAreaBarrel_ ( config.getParameter<double>("effectiveAreaBarrel")),
38  effectiveAreaEndcap_ ( config.getParameter<double>("effectiveAreaEndcap")),
39  useEt_ ( config.getParameter<bool>("useEt")) {
40 
41  std::string recoCandidateProducerName = "recoCandidateProducer";
42  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
43  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
44 
45  produces <T1IsolationMap >();
46 }
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_

Definition at line 49 of file HLTHcalPFClusterIsolationProducer.cc.

50 {}

Member Function Documentation

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

Definition at line 53 of file HLTHcalPFClusterIsolationProducer.cc.

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

53  {
54 
55  std::string recoCandidateProducerName = "recoCandidateProducer";
56  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
57 
59  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
60  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("hltParticleFlowClusterHCAL"));
61  desc.ifValue(edm::ParameterDescription<bool>("useHF", false, true),
62  true >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
63  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
64  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
65  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
66  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
67  desc.add<bool>("doRhoCorrection", false);
68  desc.add<double>("rhoMax", 9.9999999E7);
69  desc.add<double>("rhoScale", 1.0);
70  desc.add<double>("effectiveAreaBarrel", 0.101);
71  desc.add<double>("effectiveAreaEndcap", 0.046);
72  desc.add<double>("drMax", 0.3);
73  desc.add<double>("drVetoBarrel", 0.0);
74  desc.add<double>("drVetoEndcap", 0.0);
75  desc.add<double>("etaStripBarrel", 0.0);
76  desc.add<double>("etaStripEndcap", 0.0);
77  desc.add<double>("energyBarrel", 0.0);
78  desc.add<double>("energyEndcap", 0.0);
79  desc.add<bool>("useEt", true);
81 }
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
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
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 84 of file HLTHcalPFClusterIsolationProducer.cc.

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

84  {
85 
86  edm::Handle<double> rhoHandle;
87  double rho = 0.0;
88  if (doRhoCorrection_) {
89  iEvent.getByToken(rhoProducer_, rhoHandle);
90  rho = *(rhoHandle.product());
91  }
92 
93  if (rho > rhoMax_)
94  rho = rhoMax_;
95 
96  rho = rho*rhoScale_;
97 
98  edm::Handle<T1Collection> recoCandHandle;
99 
100  std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
101  edm::Handle<reco::PFClusterCollection> clusterHcalHandle;
102  edm::Handle<reco::PFClusterCollection> clusterHfemHandle;
103  edm::Handle<reco::PFClusterCollection> clusterHfhadHandle;
104 
105  iEvent.getByToken(recoCandidateProducer_,recoCandHandle);
106  iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
107  //const reco::PFClusterCollection* forIsolationHcal = clusterHcalHandle.product();
108  clusterHandles.push_back(clusterHcalHandle);
109 
110  if (useHF_) {
111  iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
112  clusterHandles.push_back(clusterHfemHandle);
113  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
114  clusterHandles.push_back(clusterHfhadHandle);
115  }
116 
117  T1IsolationMap recoCandMap(recoCandHandle);
119 
120  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
121  T1Ref candRef(recoCandHandle, iReco);
122 
123  float sum = isoAlgo.getSum(candRef, clusterHandles);
124 
125  if (doRhoCorrection_) {
126  if (fabs(candRef->eta()) < 1.479)
127  sum = sum - rho*effectiveAreaBarrel_;
128  else
129  sum = sum - rho*effectiveAreaEndcap_;
130  }
131 
132  recoCandMap.insert(candRef, sum);
133  }
134 
135  std::auto_ptr<T1IsolationMap> mapForEvent(new T1IsolationMap(recoCandMap));
136  iEvent.put(mapForEvent);
137 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
const edm::EDGetTokenT< double > rhoProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
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 bool HLTHcalPFClusterIsolationProducer< T1 >::doRhoCorrection_
private

Definition at line 60 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 52 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 53 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 54 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
const float HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreaBarrel_
private

Definition at line 63 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
const float HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreaEndcap_
private

Definition at line 64 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 57 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 58 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 55 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 56 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 45 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 47 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 48 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 61 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 46 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 62 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 65 of file HLTHcalPFClusterIsolationProducer.h.

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

Definition at line 50 of file HLTHcalPFClusterIsolationProducer.h.