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

#include <EgammaHLTPFPhotonIsolationProducer.h>

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

Public Member Functions

 EgammaHLTPFPhotonIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTPFPhotonIsolationProducer ()
 
- 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 24 of file EgammaHLTPFPhotonIsolationProducer.h.

Constructor & Destructor Documentation

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

$Id:

Definition at line 33 of file EgammaHLTPFPhotonIsolationProducer.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
EgammaHLTPFPhotonIsolationProducer::~EgammaHLTPFPhotonIsolationProducer ( )

Definition at line 51 of file EgammaHLTPFPhotonIsolationProducer.cc.

52 {}

Member Function Documentation

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

Definition at line 54 of file EgammaHLTPFPhotonIsolationProducer.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.070);
61  desc.add<double>("etaStripBarrel", 0.015);
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", 4);
66  descriptions.add(("hltEgammaHLTPFPhotonIsolationProducer"), desc);
67 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTPFPhotonIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 69 of file EgammaHLTPFPhotonIsolationProducer.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  // FIXME
104  // Do not include the PFCandidate associated by SC Ref to the reco::Photon
105  //if(pfc.superClusterRef().isNonnull() && localPho->superCluster().isNonnull()) {
106  // if (pfc.superClusterRef() == localPho->superCluster())
107  // continue;
108  //}
109 
110  if (fabs(candRef->eta()) < 1.479) {
111  if (fabs(pfc.pt()) < energyBarrel_)
112  continue;
113  } else {
114  if (fabs(pfc.energy()) < energyEndcap_)
115  continue;
116  }
117 
118  // Shift the photon direction vector according to the PF vertex
119  math::XYZPoint pfvtx = pfc.vertex();
120  math::XYZVector photon_directionWrtVtx(candRef->superCluster()->x() - pfvtx.x(),
121  candRef->superCluster()->y() - pfvtx.y(),
122  candRef->superCluster()->z() - pfvtx.z());
123 
124  float dEta = fabs(photon_directionWrtVtx.Eta() - pfc.momentum().Eta());
125  float dR = deltaR(photon_directionWrtVtx.Eta(), photon_directionWrtVtx.Phi(), pfc.momentum().Eta(), pfc.momentum().Phi());
126 
127  if (dEta < etaStrip)
128  continue;
129 
130  if(dR > drMax_ || dR < dRVeto)
131  continue;
132 
133  sum += pfc.pt();
134  }
135  }
136 
137  isoMap.insert(candRef, sum);
138  }
139 
140  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
141  iEvent.put(isolMap);
142 }
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 EgammaHLTPFPhotonIsolationProducer::conf_
private
bool EgammaHLTPFPhotonIsolationProducer::doRhoCorrection_
private

Definition at line 45 of file EgammaHLTPFPhotonIsolationProducer.h.

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

Definition at line 47 of file EgammaHLTPFPhotonIsolationProducer.h.

float EgammaHLTPFPhotonIsolationProducer::rhoScale_
private

Definition at line 46 of file EgammaHLTPFPhotonIsolationProducer.h.