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

#include <EgammaHLTBcHcalIsolationProducersRegional.h>

Inheritance diagram for EgammaHLTBcHcalIsolationProducersRegional:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTBcHcalIsolationProducersRegional (const edm::ParameterSet &)
 
 EgammaHLTBcHcalIsolationProducersRegional (EgammaHLTBcHcalIsolationProducersRegional const &)=delete
 
EgammaHLTBcHcalIsolationProducersRegionaloperator= (EgammaHLTBcHcalIsolationProducersRegional const &)=delete
 
virtual void produce (edm::Event &, const edm::EventSetup &) overridefinal
 
 ~EgammaHLTBcHcalIsolationProducersRegional ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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_, etMin_, hcalHelper_, ElectronHcalHelper::Configuration::hcalTowers, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::hOverEPtMin, outerCone_, and ElectronHcalHelper::Configuration::useTowers.

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

Definition at line 52 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

References hcalHelper_.

EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional ( EgammaHLTBcHcalIsolationProducersRegional const &  )
delete

Member Function Documentation

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

Definition at line 56 of file EgammaHLTBcHcalIsolationProducersRegional.cc.

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

56  {
57 
59 
60  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltRecoEcalCandidate"));
61  desc.add<edm::InputTag>(("caloTowerProducer"), edm::InputTag("hltTowerMakerForAll"));
62  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
63  desc.add<bool>(("doRhoCorrection"), false);
64  desc.add<double>(("rhoMax"), 999999.);
65  desc.add<double>(("rhoScale"), 1.0);
66  desc.add<double>(("etMin"), -1.0);
67  desc.add<double>(("innerCone"), 0);
68  desc.add<double>(("outerCone"), 0.15);
69  desc.add<int>(("depth"), -1);
70  desc.add<bool>(("doEtSum"), false);
71  desc.add<double>(("effectiveAreaBarrel"), 0.021);
72  desc.add<double>(("effectiveAreaEndcap"), 0.040);
73  desc.add<bool>(("useSingleTower"), false);
74  descriptions.add(("hltEgammaHLTBcHcalIsolationProducersRegional"), desc);
75 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
EgammaHLTBcHcalIsolationProducersRegional& EgammaHLTBcHcalIsolationProducersRegional::operator= ( EgammaHLTBcHcalIsolationProducersRegional const &  )
delete
void EgammaHLTBcHcalIsolationProducersRegional::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finaloverridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 77 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_.

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

Member Data Documentation

const edm::EDGetTokenT<CaloTowerCollection> EgammaHLTBcHcalIsolationProducersRegional::caloTowerProducer_
private
const int EgammaHLTBcHcalIsolationProducersRegional::depth_
private

Definition at line 55 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const bool EgammaHLTBcHcalIsolationProducersRegional::doEtSum_
private

Definition at line 51 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const bool EgammaHLTBcHcalIsolationProducersRegional::doRhoCorrection_
private

Definition at line 48 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::effectiveAreaBarrel_
private

Definition at line 56 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::effectiveAreaEndcap_
private

Definition at line 57 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::etMin_
private
ElectronHcalHelper* EgammaHLTBcHcalIsolationProducersRegional::hcalHelper_
private
const float EgammaHLTBcHcalIsolationProducersRegional::innerCone_
private

Definition at line 53 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::outerCone_
private
const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTBcHcalIsolationProducersRegional::recoEcalCandidateProducer_
private

Definition at line 60 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::rhoMax_
private

Definition at line 50 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const edm::EDGetTokenT<double> EgammaHLTBcHcalIsolationProducersRegional::rhoProducer_
private

Definition at line 62 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTBcHcalIsolationProducersRegional::rhoScale_
private

Definition at line 49 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().

const bool EgammaHLTBcHcalIsolationProducersRegional::useSingleTower_
private

Definition at line 58 of file EgammaHLTBcHcalIsolationProducersRegional.h.

Referenced by produce().