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

#include <EgammaHLTEcalPFClusterIsolationProducer.h>

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

Public Member Functions

 EgammaHLTEcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTEcalPFClusterIsolationProducer ()
 
- 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
pfClusterProducer_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
float rhoMax_
 
edm::EDGetTokenT< double > rhoProducer_
 
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 EgammaHLTEcalPFClusterIsolationProducer.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file EgammaHLTEcalPFClusterIsolationProducer.cc.

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

29  {
30 
31  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
32  pfClusterProducer_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducer"));
33 
34  drMax_ = config.getParameter<double>("drMax");
35  drVetoBarrel_ = config.getParameter<double>("drVetoBarrel");
36  drVetoEndcap_ = config.getParameter<double>("drVetoEndcap");
37  etaStripBarrel_ = config.getParameter<double>("etaStripBarrel");
38  etaStripEndcap_ = config.getParameter<double>("etaStripEndcap");
39  energyBarrel_ = config.getParameter<double>("energyBarrel");
40  energyEndcap_ = config.getParameter<double>("energyEndcap");
41 
42  doRhoCorrection_ = config.getParameter<bool>("doRhoCorrection");
43  if (doRhoCorrection_)
44  rhoProducer_ = consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"));
45 
46  rhoMax_ = config.getParameter<double>("rhoMax");
47  rhoScale_ = config.getParameter<double>("rhoScale");
48  effectiveAreaBarrel_ = config.getParameter<double>("effectiveAreaBarrel");
49  effectiveAreaEndcap_ = config.getParameter<double>("effectiveAreaEndcap");
50 
51  produces < reco::RecoEcalCandidateIsolationMap >();
52 
53 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTEcalPFClusterIsolationProducer::~EgammaHLTEcalPFClusterIsolationProducer ( )

Definition at line 55 of file EgammaHLTEcalPFClusterIsolationProducer.cc.

56 {}

Member Function Documentation

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

Definition at line 58 of file EgammaHLTEcalPFClusterIsolationProducer.cc.

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

58  {
60  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
61  desc.add<edm::InputTag>("pfClusterProducer", edm::InputTag("hltParticleFlowClusterECAL"));
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(("hltEgammaHLTEcalPFClusterIsolationProducer"), desc);
76 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTEcalPFClusterIsolationProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 78 of file EgammaHLTEcalPFClusterIsolationProducer.cc.

References deltaR(), doRhoCorrection_, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, drMax_, drVetoBarrel_, drVetoEndcap_, effectiveAreaBarrel_, effectiveAreaEndcap_, energyBarrel_, energyEndcap_, etaStripBarrel_, etaStripEndcap_, edm::Event::getByToken(), i, edm::AssociationMap< Tag >::insert(), pfClusterProducer_, edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

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 
94 
95  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
96  iEvent.getByToken(pfClusterProducer_, clusterHandle);
97 
99 
100  float dRVeto = -1.;
101  float etaStrip = -1;
102 
103  for (unsigned int iReco = 0; iReco < recoecalcandHandle->size(); iReco++) {
104  reco::RecoEcalCandidateRef candRef(recoecalcandHandle, iReco);
105 
106  if (fabs(candRef->eta()) < 1.479) {
107  dRVeto = drVetoBarrel_;
108  etaStrip = etaStripBarrel_;
109  } else {
110  dRVeto = drVetoEndcap_;
111  etaStrip = etaStripEndcap_;
112  }
113 
114  float sum = 0;
115  for (size_t i=0; i<clusterHandle->size(); i++) {
116  reco::PFClusterRef pfclu(clusterHandle, i);
117 
118  if (fabs(candRef->eta()) < 1.479) {
119  if (fabs(pfclu->pt()) < energyBarrel_)
120  continue;
121  } else {
122  if (fabs(pfclu->energy()) < energyEndcap_)
123  continue;
124  }
125 
126  float dEta = fabs(candRef->eta() - pfclu->eta());
127  if(dEta < etaStrip) continue;
128 
129  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
130  if(dR > drMax_ || dR < dRVeto) continue;
131 
132  // Exclude clusters that are part of the candidate
133  bool isCandCluster = false;
134  for (reco::CaloCluster_iterator it = candRef->superCluster()->clustersBegin(); it != candRef->superCluster()->clustersEnd(); ++it) {
135  if ((*it)->seed() == pfclu->seed()) {
136  isCandCluster = true;
137  break;
138  }
139  }
140  if(isCandCluster) continue;
141 
142  sum += pfclu->pt();
143  }
144 
145  if (doRhoCorrection_) {
146  if (fabs(candRef->eta()) < 1.479)
147  sum = sum - rho*effectiveAreaBarrel_;
148  else
149  sum = sum - rho*effectiveAreaEndcap_;
150  }
151 
152  recoEcalCandMap.insert(candRef, sum);
153  }
154 
155  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap));
156  iEvent.put(mapForEvent);
157 
158 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
Definition: DDAxes.h:10
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_
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
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
T const * product() const
Definition: Handle.h:81

Member Data Documentation

bool EgammaHLTEcalPFClusterIsolationProducer::doRhoCorrection_
private
double EgammaHLTEcalPFClusterIsolationProducer::drMax_
private
double EgammaHLTEcalPFClusterIsolationProducer::drVetoBarrel_
private
double EgammaHLTEcalPFClusterIsolationProducer::drVetoEndcap_
private
float EgammaHLTEcalPFClusterIsolationProducer::effectiveAreaBarrel_
private
float EgammaHLTEcalPFClusterIsolationProducer::effectiveAreaEndcap_
private
double EgammaHLTEcalPFClusterIsolationProducer::energyBarrel_
private
double EgammaHLTEcalPFClusterIsolationProducer::energyEndcap_
private
double EgammaHLTEcalPFClusterIsolationProducer::etaStripBarrel_
private
double EgammaHLTEcalPFClusterIsolationProducer::etaStripEndcap_
private
edm::EDGetTokenT<reco::PFClusterCollection> EgammaHLTEcalPFClusterIsolationProducer::pfClusterProducer_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTEcalPFClusterIsolationProducer::recoEcalCandidateProducer_
private
float EgammaHLTEcalPFClusterIsolationProducer::rhoMax_
private
edm::EDGetTokenT<double> EgammaHLTEcalPFClusterIsolationProducer::rhoProducer_
private
float EgammaHLTEcalPFClusterIsolationProducer::rhoScale_
private