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 Member Functions | Private Attributes
EgammaHLTBcHcalIsolationProducersRegional Class Reference

#include <EgammaHLTBcHcalIsolationProducersRegional.h>

Inheritance diagram for EgammaHLTBcHcalIsolationProducersRegional:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase 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 ()
 
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 Member Functions

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

Private Attributes

edm::EDGetTokenT
< CaloTowerCollection
caloTowerProducer_
 
int depth_
 
bool doEtSum_
 
bool doRhoCorrection_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
float etMin_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelperhcalHelper_
 
float innerCone_
 
float outerCone_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
float rhoMax_
 
edm::EDGetTokenT< double > rhoProducer_
 
float rhoScale_
 
bool useSingleTower_
 

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 34 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 26 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_, useSingleTower_, and ElectronHcalHelper::Configuration::useTowers.

26  {
27 
28  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
29  caloTowerProducer_ = consumes<CaloTowerCollection>(config.getParameter<edm::InputTag>("caloTowerProducer"));
30 
31  doRhoCorrection_ = config.getParameter<bool>("doRhoCorrection");
32  if (doRhoCorrection_)
33  rhoProducer_ = consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"));
34 
35  rhoMax_ = config.getParameter<double>("rhoMax");
36  rhoScale_ = config.getParameter<double>("rhoScale");
37 
38  etMin_ = config.getParameter<double>("etMin");
39  innerCone_ = config.getParameter<double>("innerCone");
40  outerCone_ = config.getParameter<double>("outerCone");
41  depth_ = config.getParameter<int>("depth");
42  doEtSum_ = config.getParameter<bool>("doEtSum");
43  effectiveAreaBarrel_ = config.getParameter<double>("effectiveAreaBarrel");
44  effectiveAreaEndcap_ = config.getParameter<double>("effectiveAreaEndcap");
45 
46  useSingleTower_ = config.getParameter<bool>("useSingleTower");
47 
49  hcalCfg_.useTowers = true;
52 
54 
55  produces <reco::RecoEcalCandidateIsolationMap>();
56 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
EgammaHLTBcHcalIsolationProducersRegional::~EgammaHLTBcHcalIsolationProducersRegional ( )

Definition at line 58 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References hcalHelper_.

EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional ( const EgammaHLTBcHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 40 of file EgammaHLTBcHcalIsolationProducersRegional.h.

40 {}

Member Function Documentation

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

Definition at line 62 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

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

62  {
63 
65 
66  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
67  desc.add<edm::InputTag>(("caloTowerProducer"), edm::InputTag("hltTowerMakerForAll"));
68  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
69  desc.add<bool>(("doRhoCorrection"), false);
70  desc.add<double>(("rhoMax"), 999999.);
71  desc.add<double>(("rhoScale"), 1.0);
72  desc.add<double>(("etMin"), -1.0);
73  desc.add<double>(("innerCone"), 0);
74  desc.add<double>(("outerCone"), 0.15);
75  desc.add<int>(("depth"), -1);
76  desc.add<bool>(("doEtSum"), false);
77  desc.add<double>(("effectiveAreaBarrel"), 0.021);
78  desc.add<double>(("effectiveAreaEndcap"), 0.040);
79  desc.add<bool>(("useSingleTower"), false);
80  descriptions.add(("hltEgammaHLTBcHcalIsolationProducersRegional"), desc);
81 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
EgammaHLTBcHcalIsolationProducersRegional& EgammaHLTBcHcalIsolationProducersRegional::operator= ( const EgammaHLTBcHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 41 of file EgammaHLTBcHcalIsolationProducersRegional.h.

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

Implements edm::EDProducer.

Definition at line 83 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References caloTowerProducer_, ElectronHcalHelper::checkSetup(), depth_, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, etMin_, edm::Event::getByToken(), EgammaTowerIsolation::getTowerEtSum(), ElectronHcalHelper::hcalESum(), 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_, rhoScale_, and useSingleTower_.

83  {
84 
85  // Get the HLT filtered objects
87  iEvent.getByToken(recoEcalCandidateProducer_, recoEcalCandHandle);
88 
89  edm::Handle<CaloTowerCollection> caloTowersHandle;
90  iEvent.getByToken(caloTowerProducer_, caloTowersHandle);
91 
92  edm::Handle<double> rhoHandle;
93  double rho = 0.0;
94 
95  if (doRhoCorrection_) {
96  iEvent.getByToken(rhoProducer_, rhoHandle);
97  rho = *(rhoHandle.product());
98  }
99 
100  if (rho > rhoMax_)
101  rho = rhoMax_;
102 
103  rho = rho*rhoScale_;
104 
105  hcalHelper_->checkSetup(iSetup);
106  hcalHelper_->readEvent(iEvent);
107 
109 
110  for(unsigned int iRecoEcalCand=0; iRecoEcalCand <recoEcalCandHandle->size(); iRecoEcalCand++) {
111 
112  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand);
113 
114  float isol = 0;
115 
116  std::vector<CaloTowerDetId> towersBehindCluster;
117 
118  if (useSingleTower_)
119  towersBehindCluster = hcalHelper_->hcalTowersBehindClusters(*(recoEcalCandRef->superCluster()));
120 
121  if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E
122  EgammaTowerIsolation isolAlgo(outerCone_, innerCone_, etMin_, depth_, caloTowersHandle.product());
123  if (useSingleTower_)
124  isol = isolAlgo.getTowerEtSum(&(*recoEcalCandRef), &(towersBehindCluster)); // towersBehindCluster are excluded from the isolation sum
125  else
126  isol = isolAlgo.getTowerEtSum(&(*recoEcalCandRef));
127 
128  if (doRhoCorrection_) {
129  if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442)
130  isol = isol - rho*effectiveAreaBarrel_;
131  else
132  isol = isol - rho*effectiveAreaEndcap_;
133  }
134  } else { //calcuate H for H/E
135  if (useSingleTower_)
136  isol = hcalHelper_->hcalESumDepth1BehindClusters(towersBehindCluster) + hcalHelper_->hcalESumDepth2BehindClusters(towersBehindCluster);
137  else
138  isol = hcalHelper_->hcalESum(*(recoEcalCandRef->superCluster()));
139  }
140 
141  isoMap.insert(recoEcalCandRef, isol);
142  }
143 
144  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
145  iEvent.put(isolMap);
146 }
double hcalESum(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
void readEvent(const edm::Event &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
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
double getTowerEtSum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const

Member Data Documentation

edm::EDGetTokenT<CaloTowerCollection> 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::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTBcHcalIsolationProducersRegional::recoEcalCandidateProducer_
private
float EgammaHLTBcHcalIsolationProducersRegional::rhoMax_
private
edm::EDGetTokenT<double> EgammaHLTBcHcalIsolationProducersRegional::rhoProducer_
private
float EgammaHLTBcHcalIsolationProducersRegional::rhoScale_
private
bool EgammaHLTBcHcalIsolationProducersRegional::useSingleTower_
private