CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTHcalIsolationProducersRegional Class Reference

#include <RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h>

Inheritance diagram for EgammaHLTHcalIsolationProducersRegional:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTHcalIsolationProducersRegional (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTHcalIsolationProducersRegional () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const bool doEtSum_
 
const bool doRhoCorrection_
 
const float effectiveAreaBarrel_
 
const float effectiveAreaEndcap_
 
const edm::EDGetTokenT< HBHERecHitCollectionhbheRecHitProducer_
 
EgammaHLTHcalIsolation const *const isolAlgo_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
const float rhoMax_
 
const edm::EDGetTokenT< double > rhoProducer_
 
const float rhoScale_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Author
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 38 of file EgammaHLTHcalIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file EgammaHLTHcalIsolationProducersRegional.cc.

28  : recoEcalCandidateProducer_ (consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer")))
29  , hbheRecHitProducer_ (consumes<HBHERecHitCollection>(config.getParameter<edm::InputTag>("hbheRecHitProducer")))
30  , rhoProducer_ (consumes<double>(config.getParameter<edm::InputTag>("rhoProducer")))
31  , doRhoCorrection_ (config.getParameter<bool>("doRhoCorrection"))
32  , rhoMax_ (config.getParameter<double>("rhoMax"))
33  , rhoScale_ (config.getParameter<double>("rhoScale"))
34  , doEtSum_ (config.getParameter<bool>("doEtSum"))
35  , effectiveAreaBarrel_ (config.getParameter<double>("effectiveAreaBarrel"))
36  , effectiveAreaEndcap_ (config.getParameter<double>("effectiveAreaEndcap"))
37  , isolAlgo_ (new EgammaHLTHcalIsolation(config.getParameter<double>("eMinHB"),
38  config.getParameter<double>("eMinHE"),
39  config.getParameter<double>("etMinHB"),
40  config.getParameter<double>("etMinHE"),
41  config.getParameter<double>("innerCone"),
42  config.getParameter<double>("outerCone"),
43  config.getParameter<int>("depth")))
44 {
45  //register your products
46  produces < reco::RecoEcalCandidateIsolationMap >();
47 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTHcalIsolationProducersRegional::~EgammaHLTHcalIsolationProducersRegional ( )
override

Definition at line 49 of file EgammaHLTHcalIsolationProducersRegional.cc.

References isolAlgo_.

49  {
50  delete isolAlgo_;
51 }

Member Function Documentation

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

Definition at line 53 of file EgammaHLTHcalIsolationProducersRegional.cc.

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

53  {
55  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
56  desc.add<edm::InputTag>(("hbheRecHitProducer"), edm::InputTag("hltHbhereco"));
57  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
58  desc.add<bool>(("doRhoCorrection"), false);
59  desc.add<double>(("rhoMax"), 9.9999999E7);
60  desc.add<double>(("rhoScale"), 1.0);
61  desc.add<double>(("eMinHB"), 0.7);
62  desc.add<double>(("eMinHE"), 0.8);
63  desc.add<double>(("etMinHB"), -1.0);
64  desc.add<double>(("etMinHE"), -1.0);
65  desc.add<double>(("innerCone"), 0);
66  desc.add<double>(("outerCone"), 0.15);
67  desc.add<int>(("depth"), -1);
68  desc.add<bool>(("doEtSum"), false);
69  desc.add<double>(("effectiveAreaBarrel"), 0.105);
70  desc.add<double>(("effectiveAreaEndcap"), 0.170);
71  descriptions.add(("hltEgammaHLTHcalIsolationProducersRegional"), desc);
72 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTHcalIsolationProducersRegional::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 74 of file EgammaHLTHcalIsolationProducersRegional.cc.

References begin, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, edm::EventSetup::get(), edm::Event::getByToken(), EgammaHLTHcalIsolation::getESum(), EgammaHLTHcalIsolation::getEtSum(), hbheRecHitProducer_, edm::AssociationMap< Tag >::insert(), isolAlgo_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

74  {
75 
76  // Get the HLT filtered objects
78  iEvent.getByToken(recoEcalCandidateProducer_,recoEcalCandHandle);
79 
80  // Get the barrel hcal hits
81  edm::Handle<HBHERecHitCollection> hbheRecHitHandle;
82  iEvent.getByToken(hbheRecHitProducer_, hbheRecHitHandle);
83  const HBHERecHitCollection* hbheRecHitCollection = hbheRecHitHandle.product();
84 
85  edm::ESHandle<HcalChannelQuality> hcalChStatusHandle;
86  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatusHandle );
87  const HcalChannelQuality* hcalChStatus = hcalChStatusHandle.product();
88 
90  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComp);
91 
92  edm::Handle<double> rhoHandle;
93  double rho = 0.0;
94  if (doRhoCorrection_) {
95  iEvent.getByToken(rhoProducer_, rhoHandle);
96  rho = *(rhoHandle.product());
97  }
98 
99  if (rho > rhoMax_)
100  rho = rhoMax_;
101 
102  rho = rho*rhoScale_;
103 
104  edm::ESHandle<CaloGeometry> caloGeomHandle;
105  iSetup.get<CaloGeometryRecord>().get(caloGeomHandle);
106  const CaloGeometry* caloGeom = caloGeomHandle.product();
107 
108  reco::RecoEcalCandidateIsolationMap isoMap(recoEcalCandHandle);
109 
110 
111  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
112 
113  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand -recoEcalCandHandle ->begin());
114 
115  float isol = 0;
116  if(doEtSum_) {
117  isol = isolAlgo_->getEtSum(recoEcalCandRef->superCluster()->eta(),
118  recoEcalCandRef->superCluster()->phi(),hbheRecHitCollection,caloGeom,
119  hcalSevLvlComp.product(),hcalChStatus);
120 
121  if (doRhoCorrection_) {
122  if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442)
123  isol = isol - rho*effectiveAreaBarrel_;
124  else
125  isol = isol - rho*effectiveAreaEndcap_;
126  }
127  } else {
128  isol = isolAlgo_->getESum(recoEcalCandRef->superCluster()->eta(),recoEcalCandRef->superCluster()->phi(),
129  hbheRecHitCollection,caloGeom,
130  hcalSevLvlComp.product(),hcalChStatus);
131  }
132 
133  isoMap.insert(recoEcalCandRef, isol);
134  }
135 
136  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
137 
138 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
float getEtSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const
T const * product() const
Definition: Handle.h:74
#define begin
Definition: vmac.h:32
float getESum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

const bool EgammaHLTHcalIsolationProducersRegional::doEtSum_
private

Definition at line 55 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const bool EgammaHLTHcalIsolationProducersRegional::doRhoCorrection_
private

Definition at line 52 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTHcalIsolationProducersRegional::effectiveAreaBarrel_
private

Definition at line 56 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTHcalIsolationProducersRegional::effectiveAreaEndcap_
private

Definition at line 57 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const edm::EDGetTokenT<HBHERecHitCollection> EgammaHLTHcalIsolationProducersRegional::hbheRecHitProducer_
private

Definition at line 49 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

EgammaHLTHcalIsolation const* const EgammaHLTHcalIsolationProducersRegional::isolAlgo_
private
const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTHcalIsolationProducersRegional::recoEcalCandidateProducer_
private

Definition at line 48 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTHcalIsolationProducersRegional::rhoMax_
private

Definition at line 53 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

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

Definition at line 50 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().

const float EgammaHLTHcalIsolationProducersRegional::rhoScale_
private

Definition at line 54 of file EgammaHLTHcalIsolationProducersRegional.h.

Referenced by produce().