CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EgammaHLTBcHcalIsolationProducersRegional Class Reference

#include <EgammaHLTBcHcalIsolationProducersRegional.h>

Inheritance diagram for EgammaHLTBcHcalIsolationProducersRegional:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTBcHcalIsolationProducersRegional (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTBcHcalIsolationProducersRegional ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

 EgammaHLTBcHcalIsolationProducersRegional (const EgammaHLTBcHcalIsolationProducersRegional &rhs)
 
EgammaHLTBcHcalIsolationProducersRegionaloperator= (const EgammaHLTBcHcalIsolationProducersRegional &rhs)
 

Private Attributes

edm::InputTag caloTowerProducer_
 
int depth_
 
bool doEtSum_
 
bool doRhoCorrection_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
float etMin_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelperhcalHelper_
 
float innerCone_
 
float outerCone_
 
edm::InputTag recoEcalCandidateProducer_
 
float rhoMax_
 
edm::InputTag rhoProducer_
 
float rhoScale_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 26 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References caloTowerProducer_, depth_, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, etMin_, edm::ParameterSet::getParameter(), hcalCfg_, hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, innerCone_, outerCone_, recoEcalCandidateProducer_, rhoMax_, rhoProducer_, rhoScale_, and ElectronHcalHelper::Configuration::useTowers.

36  {
37 
38  recoEcalCandidateProducer_ = config.getParameter<edm::InputTag>("recoEcalCandidateProducer");
39  caloTowerProducer_ = config.getParameter<edm::InputTag>("caloTowerProducer");
40  rhoProducer_ = config.getParameter<edm::InputTag>("rhoProducer");
41  doRhoCorrection_ = config.getParameter<bool>("doRhoCorrection");
42  rhoMax_ = config.getParameter<double>("rhoMax");
43  rhoScale_ = config.getParameter<double>("rhoScale");
44 
45  etMin_ = config.getParameter<double>("etMin");
46  innerCone_ = config.getParameter<double>("innerCone");
47  outerCone_ = config.getParameter<double>("outerCone");
48  depth_ = config.getParameter<int>("depth");
49  doEtSum_ = config.getParameter<bool>("doEtSum"); //this variable (which I cant change the name of) switches between hcal isolation and H for H/E
50  effectiveAreaBarrel_ = config.getParameter<double>("effectiveAreaBarrel");
51  effectiveAreaEndcap_ = config.getParameter<double>("effectiveAreaEndcap");
52 
53  hcalCfg_.hOverEConeSize = 0.15;
54  hcalCfg_.useTowers = true;
57 
59 
60  produces <reco::RecoEcalCandidateIsolationMap>();
61 }
T getParameter(std::string const &) const
EgammaHLTBcHcalIsolationProducersRegional::~EgammaHLTBcHcalIsolationProducersRegional ( )

Definition at line 63 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References hcalHelper_.

EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional ( const EgammaHLTBcHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 33 of file EgammaHLTBcHcalIsolationProducersRegional.h.

33 {}

Member Function Documentation

EgammaHLTBcHcalIsolationProducersRegional& EgammaHLTBcHcalIsolationProducersRegional::operator= ( const EgammaHLTBcHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 34 of file EgammaHLTBcHcalIsolationProducersRegional.h.

34 { return *this; }
void EgammaHLTBcHcalIsolationProducersRegional::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 68 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References caloTowerProducer_, ElectronHcalHelper::checkSetup(), depth_, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, etMin_, edm::Event::getByLabel(), EgammaTowerIsolation::getTowerEtSum(), ElectronHcalHelper::hcalESumDepth1BehindClusters(), ElectronHcalHelper::hcalESumDepth2BehindClusters(), hcalHelper_, ElectronHcalHelper::hcalTowersBehindClusters(), innerCone_, edm::AssociationMap< Tag >::insert(), outerCone_, edm::Handle< T >::product(), edm::Event::put(), ElectronHcalHelper::readEvent(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

68  {
69 
70  // Get the HLT filtered objects
72  iEvent.getByLabel(recoEcalCandidateProducer_, recoEcalCandHandle);
73 
74  edm::Handle<CaloTowerCollection> caloTowersHandle;
75  iEvent.getByLabel(caloTowerProducer_, caloTowersHandle);
76 
77  edm::Handle<double> rhoHandle;
78  double rho = 0.0;
79 
80  if (doRhoCorrection_) {
81  iEvent.getByLabel(rhoProducer_, rhoHandle);
82  rho = *(rhoHandle.product());
83  }
84 
85  if (rho > rhoMax_)
86  rho = rhoMax_;
87 
88  rho = rho*rhoScale_;
89 
90  hcalHelper_->checkSetup(iSetup);
91  hcalHelper_->readEvent(iEvent);
92 
94 
95  for(unsigned int iRecoEcalCand=0; iRecoEcalCand <recoEcalCandHandle->size(); iRecoEcalCand++) {
96 
97  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand);
98 
99  float isol = 0;
100 
101  std::vector<CaloTowerDetId> towersBehindCluster = hcalHelper_->hcalTowersBehindClusters(*(recoEcalCandRef->superCluster()));
102 
103  if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E
104  EgammaTowerIsolation isolAlgo(outerCone_, innerCone_, etMin_, depth_, caloTowersHandle.product());
105  isol = isolAlgo.getTowerEtSum(&(*recoEcalCandRef), &(towersBehindCluster)); // towersBehindCluster are excluded from the isolation sum
106 
107  if (doRhoCorrection_) {
108  if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442)
109  isol = isol - rho*effectiveAreaBarrel_;
110  else
111  isol = isol - rho*effectiveAreaEndcap_;
112  }
113  } else { //calcuate H for H/E
114  isol = hcalHelper_->hcalESumDepth1BehindClusters(towersBehindCluster) + hcalHelper_->hcalESumDepth2BehindClusters(towersBehindCluster); //towers beind the cluster are for H for H/E
115  }
116 
117  isoMap.insert(recoEcalCandRef, isol);
118  }
119 
120  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
121  iEvent.put(isolMap);
122 }
void readEvent(const edm::Event &)
Definition: DDAxes.h:10
double hcalESumDepth2BehindClusters(const std::vector< CaloTowerDetId > &towers)
std::vector< CaloTowerDetId > hcalTowersBehindClusters(const reco::SuperCluster &sc)
void checkSetup(const edm::EventSetup &)
double hcalESumDepth1BehindClusters(const std::vector< CaloTowerDetId > &towers)
double getTowerEtSum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void insert(const key_type &k, const data_type &v)
insert an association
T const * product() const
Definition: Handle.h:74

Member Data Documentation

edm::InputTag EgammaHLTBcHcalIsolationProducersRegional::caloTowerProducer_
private
int EgammaHLTBcHcalIsolationProducersRegional::depth_
private
bool EgammaHLTBcHcalIsolationProducersRegional::doEtSum_
private
bool EgammaHLTBcHcalIsolationProducersRegional::doRhoCorrection_
private
float EgammaHLTBcHcalIsolationProducersRegional::effectiveAreaBarrel_
private
float EgammaHLTBcHcalIsolationProducersRegional::effectiveAreaEndcap_
private
float EgammaHLTBcHcalIsolationProducersRegional::etMin_
private
ElectronHcalHelper::Configuration EgammaHLTBcHcalIsolationProducersRegional::hcalCfg_
private
ElectronHcalHelper* EgammaHLTBcHcalIsolationProducersRegional::hcalHelper_
private
float EgammaHLTBcHcalIsolationProducersRegional::innerCone_
private
float EgammaHLTBcHcalIsolationProducersRegional::outerCone_
private
edm::InputTag EgammaHLTBcHcalIsolationProducersRegional::recoEcalCandidateProducer_
private
float EgammaHLTBcHcalIsolationProducersRegional::rhoMax_
private
edm::InputTag EgammaHLTBcHcalIsolationProducersRegional::rhoProducer_
private
float EgammaHLTBcHcalIsolationProducersRegional::rhoScale_
private