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 Attributes
EgammaHLTHcalPFClusterIsolationProducer Class Reference

#include <EgammaHLTHcalPFClusterIsolationProducer.h>

Inheritance diagram for EgammaHLTHcalPFClusterIsolationProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTHcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTHcalPFClusterIsolationProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool doRhoCorrection_
 
double drMax_
 
double drVetoBarrel_
 
double drVetoEndcap_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
double energyBarrel_
 
double energyEndcap_
 
double etaStripBarrel_
 
double etaStripEndcap_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHCAL_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFEM_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFHAD_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
float rhoMax_
 
edm::EDGetTokenT< double > rhoProducer_
 
float rhoScale_
 
bool useHF_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 25 of file EgammaHLTHcalPFClusterIsolationProducer.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file EgammaHLTHcalPFClusterIsolationProducer.cc.

References doRhoCorrection_, drMax_, drVetoBarrel_, drVetoEndcap_, effectiveAreaBarrel_, effectiveAreaEndcap_, energyBarrel_, energyEndcap_, etaStripBarrel_, etaStripEndcap_, edm::ParameterSet::getParameter(), pfClusterProducerHCAL_, pfClusterProducerHFEM_, pfClusterProducerHFHAD_, recoEcalCandidateProducer_, rhoMax_, rhoProducer_, rhoScale_, and useHF_.

19  {
20 
21  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
22  pfClusterProducerHCAL_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"));
23  useHF_ = config.getParameter<bool>("useHF");
24  if (useHF_) {
25  pfClusterProducerHFEM_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"));
26  pfClusterProducerHFHAD_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"));
27  }
28 
29  drMax_ = config.getParameter<double>("drMax");
30  drVetoBarrel_ = config.getParameter<double>("drVetoBarrel");
31  drVetoEndcap_ = config.getParameter<double>("drVetoEndcap");
32  etaStripBarrel_ = config.getParameter<double>("etaStripBarrel");
33  etaStripEndcap_ = config.getParameter<double>("etaStripEndcap");
34  energyBarrel_ = config.getParameter<double>("energyBarrel");
35  energyEndcap_ = config.getParameter<double>("energyEndcap");
36 
37  doRhoCorrection_ = config.getParameter<bool>("doRhoCorrection");
38  if (doRhoCorrection_)
39  rhoProducer_ = consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"));
40 
41  rhoMax_ = config.getParameter<double>("rhoMax");
42  rhoScale_ = config.getParameter<double>("rhoScale");
43  effectiveAreaBarrel_ = config.getParameter<double>("effectiveAreaBarrel");
44  effectiveAreaEndcap_ = config.getParameter<double>("effectiveAreaEndcap");
45 
46  produces < reco::RecoEcalCandidateIsolationMap >();
47 
48 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
EgammaHLTHcalPFClusterIsolationProducer::~EgammaHLTHcalPFClusterIsolationProducer ( )

Definition at line 50 of file EgammaHLTHcalPFClusterIsolationProducer.cc.

51 {}

Member Function Documentation

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

Definition at line 53 of file EgammaHLTHcalPFClusterIsolationProducer.cc.

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

53  {
55  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
56  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("hltParticleFlowClusterHCAL"));
57  desc.ifValue(edm::ParameterDescription<bool>("useHF", false, true),
58  true >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
59  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
60  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
61  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
62  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
63  desc.add<bool>("doRhoCorrection", false);
64  desc.add<double>("rhoMax", 9.9999999E7);
65  desc.add<double>("rhoScale", 1.0);
66  desc.add<double>("effectiveAreaBarrel", 0.101);
67  desc.add<double>("effectiveAreaEndcap", 0.046);
68  desc.add<double>("drMax", 0.3);
69  desc.add<double>("drVetoBarrel", 0.0);
70  desc.add<double>("drVetoEndcap", 0.0);
71  desc.add<double>("etaStripBarrel", 0.0);
72  desc.add<double>("etaStripEndcap", 0.0);
73  desc.add<double>("energyBarrel", 0.0);
74  desc.add<double>("energyEndcap", 0.0);
75  descriptions.add(("hltEgammaHLTHcalPFClusterIsolationProducer"), desc);
76 }
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)
void EgammaHLTHcalPFClusterIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 78 of file EgammaHLTHcalPFClusterIsolationProducer.cc.

References deltaR(), doRhoCorrection_, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, drMax_, drVetoBarrel_, drVetoEndcap_, effectiveAreaBarrel_, effectiveAreaEndcap_, reco::PFCluster::energy(), energyBarrel_, energyEndcap_, reco::CaloCluster::eta(), etaStripBarrel_, etaStripEndcap_, edm::Event::getByToken(), i, edm::AssociationMap< Tag >::insert(), pfClusterProducerHCAL_, pfClusterProducerHFEM_, pfClusterProducerHFHAD_, reco::CaloCluster::phi(), edm::Handle< T >::product(), reco::PFCluster::pt(), edm::Event::put(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, rhoScale_, and useHF_.

78  {
79 
80  edm::Handle<double> rhoHandle;
81  double rho = 0.0;
82  if (doRhoCorrection_) {
83  iEvent.getByToken(rhoProducer_, rhoHandle);
84  rho = *(rhoHandle.product());
85  }
86 
87  if (rho > rhoMax_)
88  rho = rhoMax_;
89 
90  rho = rho*rhoScale_;
91 
95  edm::Handle<reco::PFClusterCollection> clusterHfhadHandle;
96 
97  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
98  iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
99  const reco::PFClusterCollection* forIsolationHcal = clusterHcalHandle.product();
100 
101  if (useHF_) {
102  iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
103  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
104  }
105 
106  reco::RecoEcalCandidateIsolationMap recoEcalCandMap;
107 
108  float dRVeto = -1.;
109  float etaStrip = -1;
110 
111  for (unsigned int iReco = 0; iReco < recoecalcandHandle->size(); iReco++) {
112  reco::RecoEcalCandidateRef candRef(recoecalcandHandle, iReco);
113 
114  if (fabs(candRef->eta()) < 1.479) {
115  dRVeto = drVetoBarrel_;
116  etaStrip = etaStripBarrel_;
117  } else {
118  dRVeto = drVetoEndcap_;
119  etaStrip = etaStripEndcap_;
120  }
121 
122  float sum = 0;
123 
124  // Loop over the 3 types of PFClusters
125 
126  for(unsigned i=0; i<forIsolationHcal->size(); i++) {
127  const reco::PFCluster& pfclu = (*forIsolationHcal)[i];
128 
129  if (fabs(candRef->eta()) < 1.479) {
130  if (fabs(pfclu.pt()) < energyBarrel_)
131  continue;
132  } else {
133  if (fabs(pfclu.energy()) < energyEndcap_)
134  continue;
135  }
136 
137  float dEta = fabs(candRef->eta() - pfclu.eta());
138  if(dEta < etaStrip) continue;
139 
140  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
141  if(dR > drMax_ || dR < dRVeto) continue;
142 
143  sum += pfclu.pt();
144  }
145 
146  if (useHF_) {
147  const reco::PFClusterCollection* forIsolationHfem = clusterHfemHandle.product();
148  const reco::PFClusterCollection* forIsolationHfhad = clusterHfhadHandle.product();
149 
150  for(unsigned i=0; i<forIsolationHfem->size(); i++) {
151  const reco::PFCluster& pfclu = (*forIsolationHfem)[i];
152 
153  if (fabs(candRef->eta()) < 1.479) {
154  if (fabs(pfclu.pt()) < energyBarrel_)
155  continue;
156  } else {
157  if (fabs(pfclu.energy()) < energyEndcap_)
158  continue;
159  }
160 
161  float dEta = fabs(candRef->eta() - pfclu.eta());
162  if(dEta < etaStrip) continue;
163 
164  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
165  if(dR > drMax_ || dR < dRVeto) continue;
166 
167  sum += pfclu.pt();
168  }
169 
170  for(unsigned i=0; i<forIsolationHfhad->size(); i++) {
171  const reco::PFCluster& pfclu = (*forIsolationHfhad)[i];
172 
173  if (fabs(candRef->eta()) < 1.479) {
174  if (fabs(pfclu.pt()) < energyBarrel_)
175  continue;
176  } else {
177  if (fabs(pfclu.energy()) < energyEndcap_)
178  continue;
179  }
180 
181  float dEta = fabs(candRef->eta() - pfclu.eta());
182  if(dEta < etaStrip) continue;
183 
184  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
185  if(dR > drMax_ || dR < dRVeto) continue;
186 
187  sum += pfclu.pt();
188  }
189  }
190 
191  if (doRhoCorrection_) {
192  if (fabs(candRef->eta()) < 1.479)
193  sum = sum - rho*effectiveAreaBarrel_;
194  else
195  sum = sum - rho*effectiveAreaEndcap_;
196  }
197 
198  recoEcalCandMap.insert(candRef, sum);
199  }
200 
201  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap));
202  iEvent.put(mapForEvent);
203 
204 }
int i
Definition: DBlmapReader.cc:9
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
Definition: DDAxes.h:10
double pt() const
transverse momentum, massless approximation
Definition: PFCluster.h:132
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_
double energy() const
cluster energy
Definition: PFCluster.h:79
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
void insert(const key_type &k, const data_type &v)
insert an association
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:164
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_

Member Data Documentation

bool EgammaHLTHcalPFClusterIsolationProducer::doRhoCorrection_
private
double EgammaHLTHcalPFClusterIsolationProducer::drMax_
private
double EgammaHLTHcalPFClusterIsolationProducer::drVetoBarrel_
private
double EgammaHLTHcalPFClusterIsolationProducer::drVetoEndcap_
private
float EgammaHLTHcalPFClusterIsolationProducer::effectiveAreaBarrel_
private
float EgammaHLTHcalPFClusterIsolationProducer::effectiveAreaEndcap_
private
double EgammaHLTHcalPFClusterIsolationProducer::energyBarrel_
private
double EgammaHLTHcalPFClusterIsolationProducer::energyEndcap_
private
double EgammaHLTHcalPFClusterIsolationProducer::etaStripBarrel_
private
double EgammaHLTHcalPFClusterIsolationProducer::etaStripEndcap_
private
edm::EDGetTokenT<reco::PFClusterCollection> EgammaHLTHcalPFClusterIsolationProducer::pfClusterProducerHCAL_
private
edm::EDGetTokenT<reco::PFClusterCollection> EgammaHLTHcalPFClusterIsolationProducer::pfClusterProducerHFEM_
private
edm::EDGetTokenT<reco::PFClusterCollection> EgammaHLTHcalPFClusterIsolationProducer::pfClusterProducerHFHAD_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTHcalPFClusterIsolationProducer::recoEcalCandidateProducer_
private
float EgammaHLTHcalPFClusterIsolationProducer::rhoMax_
private
edm::EDGetTokenT<double> EgammaHLTHcalPFClusterIsolationProducer::rhoProducer_
private
float EgammaHLTHcalPFClusterIsolationProducer::rhoScale_
private
bool EgammaHLTHcalPFClusterIsolationProducer::useHF_
private