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
EgammaHLTPFNeutralIsolationProducer Class Reference

#include <EgammaHLTPFNeutralIsolationProducer.h>

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

Public Member Functions

 EgammaHLTPFNeutralIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTPFNeutralIsolationProducer ()
 
- 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
 
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

edm::ParameterSet conf_
 
bool doRhoCorrection_
 
double drMax_
 
double drVetoBarrel_
 
double drVetoEndcap_
 
double energyBarrel_
 
double energyEndcap_
 
double etaStripBarrel_
 
double etaStripEndcap_
 
edm::InputTag pfCandidates_
 
int pfToUse_
 
edm::InputTag recoEcalCandidateProducer_
 
float rhoMax_
 
float rhoScale_
 

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 23 of file EgammaHLTPFNeutralIsolationProducer.h.

Constructor & Destructor Documentation

EgammaHLTPFNeutralIsolationProducer::EgammaHLTPFNeutralIsolationProducer ( const edm::ParameterSet config)
explicit
Author
Matteo Sani (UCSD)

$Id:

Definition at line 33 of file EgammaHLTPFNeutralIsolationProducer.cc.

References conf_, drMax_, drVetoBarrel_, drVetoEndcap_, energyBarrel_, energyEndcap_, etaStripBarrel_, etaStripEndcap_, edm::ParameterSet::getParameter(), pfCandidates_, pfToUse_, and recoEcalCandidateProducer_.

33  : conf_(config) {
34 
35  // use configuration file to setup input/output collection names
36  pfCandidates_ = conf_.getParameter<edm::InputTag>("pfCandidatesProducer");
37  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
38 
39  drMax_ = conf_.getParameter<double>("drMax");
40  drVetoBarrel_ = conf_.getParameter<double>("drVetoBarrel");
41  drVetoEndcap_ = conf_.getParameter<double>("drVetoEndcap");
42  etaStripBarrel_ = conf_.getParameter<double>("etaStripBarrel");
43  etaStripEndcap_ = conf_.getParameter<double>("etaStripEndcap");
44  energyBarrel_ = conf_.getParameter<double>("energyBarrel");
45  energyEndcap_ = conf_.getParameter<double>("energyEndcap");
46  pfToUse_ = conf_.getParameter<int>("pfCandidateType");
47 
48  produces < reco::RecoEcalCandidateIsolationMap >();
49 }
T getParameter(std::string const &) const
EgammaHLTPFNeutralIsolationProducer::~EgammaHLTPFNeutralIsolationProducer ( )

Definition at line 51 of file EgammaHLTPFNeutralIsolationProducer.cc.

52 {}

Member Function Documentation

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

Definition at line 54 of file EgammaHLTPFNeutralIsolationProducer.cc.

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

54  {
56  desc.add<edm::InputTag>("pfCandidatesProducer", edm::InputTag("hltParticleFlowReg"));
57  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
58  desc.add<double>("drMax", 0.3);
59  desc.add<double>("drVetoBarrel", 0.0);
60  desc.add<double>("drVetoEndcap", 0.0);
61  desc.add<double>("etaStripBarrel", 0.0);
62  desc.add<double>("etaStripEndcap", 0.0);
63  desc.add<double>("energyBarrel", 0.0);
64  desc.add<double>("energyEndcap", 0.0);
65  desc.add<int>("pfCandidateType", 5);
66  descriptions.add(("hltEgammaHLTPFNeutralIsolationProducer"), desc);
67 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTPFNeutralIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 69 of file EgammaHLTPFNeutralIsolationProducer.cc.

References deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, drMax_, drVetoBarrel_, drVetoEndcap_, reco::LeafCandidate::energy(), energyBarrel_, energyEndcap_, etaStripBarrel_, etaStripEndcap_, edm::Event::getByLabel(), i, edm::AssociationMap< Tag >::insert(), reco::LeafCandidate::momentum(), reco::PFCandidate::particleId(), pfCandidates_, pfToUse_, edm::Handle< T >::product(), reco::LeafCandidate::pt(), edm::Event::put(), recoEcalCandidateProducer_, and reco::PFCandidate::vertex().

69  {
70 
72  iEvent.getByLabel(pfCandidates_, pfHandle);
73 
75  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
76 
78 
79  float dRVeto = -1.;
80  float etaStrip = -1;
81 
82  for (unsigned int iReco = 0; iReco < recoecalcandHandle->size(); iReco++) {
83 
84  reco::RecoEcalCandidateRef candRef(recoecalcandHandle, iReco);
85 
86  if (fabs(candRef->eta()) < 1.479) {
87  dRVeto = drVetoBarrel_;
88  etaStrip = etaStripBarrel_;
89  } else {
90  dRVeto = drVetoEndcap_;
91  etaStrip = etaStripEndcap_;
92  }
93 
94  const reco::PFCandidateCollection* forIsolation = pfHandle.product();
95 
96  float sum = 0;
97  for(unsigned i=0; i<forIsolation->size(); i++) {
98 
99  const reco::PFCandidate& pfc = (*forIsolation)[i];
100 
101  if (pfc.particleId() == pfToUse_) {
102 
103  if (fabs(candRef->eta()) < 1.479) {
104  if (fabs(pfc.pt()) < energyBarrel_)
105  continue;
106  } else {
107  if (fabs(pfc.energy()) < energyEndcap_)
108  continue;
109  }
110 
111  // Shift the photon direction vector according to the PF vertex
112  math::XYZPoint pfvtx = pfc.vertex();
113  math::XYZVector photon_directionWrtVtx(candRef->superCluster()->x() - pfvtx.x(),
114  candRef->superCluster()->y() - pfvtx.y(),
115  candRef->superCluster()->z() - pfvtx.z());
116 
117  float dEta = fabs(photon_directionWrtVtx.Eta() - pfc.momentum().Eta());
118  float dR = deltaR(photon_directionWrtVtx.Eta(), photon_directionWrtVtx.Phi(), pfc.momentum().Eta(), pfc.momentum().Phi());
119 
120  if (dEta < etaStrip)
121  continue;
122 
123  if(dR > drMax_ || dR < dRVeto)
124  continue;
125 
126  sum += pfc.pt();
127  }
128  }
129 
130  isoMap.insert(candRef, sum);
131  }
132 
133  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
134  iEvent.put(isolMap);
135 }
virtual double energy() const GCC11_FINAL
energy
int i
Definition: DBlmapReader.cc:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
virtual const Point & vertex() const
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:643
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void insert(const key_type &k, const data_type &v)
insert an association
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
virtual Vector momentum() const GCC11_FINAL
spatial momentum vector
T const * product() const
Definition: Handle.h:81
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:38
virtual ParticleType particleId() const
Definition: PFCandidate.h:355
virtual float pt() const GCC11_FINAL
transverse momentum

Member Data Documentation

edm::ParameterSet EgammaHLTPFNeutralIsolationProducer::conf_
private
bool EgammaHLTPFNeutralIsolationProducer::doRhoCorrection_
private

Definition at line 44 of file EgammaHLTPFNeutralIsolationProducer.h.

double EgammaHLTPFNeutralIsolationProducer::drMax_
private
double EgammaHLTPFNeutralIsolationProducer::drVetoBarrel_
private
double EgammaHLTPFNeutralIsolationProducer::drVetoEndcap_
private
double EgammaHLTPFNeutralIsolationProducer::energyBarrel_
private
double EgammaHLTPFNeutralIsolationProducer::energyEndcap_
private
double EgammaHLTPFNeutralIsolationProducer::etaStripBarrel_
private
double EgammaHLTPFNeutralIsolationProducer::etaStripEndcap_
private
edm::InputTag EgammaHLTPFNeutralIsolationProducer::pfCandidates_
private
int EgammaHLTPFNeutralIsolationProducer::pfToUse_
private
edm::InputTag EgammaHLTPFNeutralIsolationProducer::recoEcalCandidateProducer_
private
float EgammaHLTPFNeutralIsolationProducer::rhoMax_
private

Definition at line 46 of file EgammaHLTPFNeutralIsolationProducer.h.

float EgammaHLTPFNeutralIsolationProducer::rhoScale_
private

Definition at line 45 of file EgammaHLTPFNeutralIsolationProducer.h.