CMS 3D CMS Logo

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

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

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

Public Member Functions

 EgammaHLTHcalIsolationProducersRegional (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EgammaHLTHcalIsolationProducersRegional ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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

 EgammaHLTHcalIsolationProducersRegional (const EgammaHLTHcalIsolationProducersRegional &rhs)
 
EgammaHLTHcalIsolationProducersRegionaloperator= (const EgammaHLTHcalIsolationProducersRegional &rhs)
 

Private Attributes

bool doEtSum_
 
bool doRhoCorrection_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
edm::EDGetTokenT< HBHERecHitCollectionhbheRecHitProducer_
 
EgammaHLTHcalIsolationisolAlgo_
 
edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
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
 
- 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 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.

References particleFlowClusterECALTimeSelected_cfi::depth, doEtSum_, doRhoCorrection_, effectiveAreaBarrel_, effectiveAreaEndcap_, edm::ParameterSet::getParameter(), hbheRecHitProducer_, isolAlgo_, recoEcalCandidateProducer_, rhoMax_, rhoProducer_, and rhoScale_.

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

Definition at line 56 of file EgammaHLTHcalIsolationProducersRegional.cc.

References isolAlgo_.

56  {
57  delete isolAlgo_;
58 }
EgammaHLTHcalIsolationProducersRegional::EgammaHLTHcalIsolationProducersRegional ( const EgammaHLTHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 47 of file EgammaHLTHcalIsolationProducersRegional.h.

47 {}

Member Function Documentation

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

Definition at line 60 of file EgammaHLTHcalIsolationProducersRegional.cc.

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

60  {
62  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
63  desc.add<edm::InputTag>(("hbheRecHitProducer"), edm::InputTag("hltHbhereco"));
64  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
65  desc.add<bool>(("doRhoCorrection"), false);
66  desc.add<double>(("rhoMax"), 9.9999999E7);
67  desc.add<double>(("rhoScale"), 1.0);
68  desc.add<double>(("eMinHB"), 0.7);
69  desc.add<double>(("eMinHE"), 0.8);
70  desc.add<double>(("etMinHB"), -1.0);
71  desc.add<double>(("etMinHE"), -1.0);
72  desc.add<double>(("innerCone"), 0);
73  desc.add<double>(("outerCone"), 0.15);
74  desc.add<int>(("depth"), -1);
75  desc.add<bool>(("doEtSum"), false);
76  desc.add<double>(("effectiveAreaBarrel"), 0.105);
77  desc.add<double>(("effectiveAreaEndcap"), 0.170);
78  descriptions.add(("hltEgammaHLTHcalIsolationProducersRegional"), desc);
79 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
EgammaHLTHcalIsolationProducersRegional& EgammaHLTHcalIsolationProducersRegional::operator= ( const EgammaHLTHcalIsolationProducersRegional rhs)
inlineprivate

Definition at line 48 of file EgammaHLTHcalIsolationProducersRegional.h.

48 {return *this;}
void EgammaHLTHcalIsolationProducersRegional::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

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

81  {
82 
83  // Get the HLT filtered objects
85  iEvent.getByToken(recoEcalCandidateProducer_,recoEcalCandHandle);
86 
87  // Get the barrel hcal hits
88  edm::Handle<HBHERecHitCollection> hbheRecHitHandle;
89  iEvent.getByToken(hbheRecHitProducer_, hbheRecHitHandle);
90  const HBHERecHitCollection* hbheRecHitCollection = hbheRecHitHandle.product();
91 
92  edm::ESHandle<HcalChannelQuality> hcalChStatusHandle;
93  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatusHandle );
94  const HcalChannelQuality* hcalChStatus = hcalChStatusHandle.product();
95 
97  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComp);
98 
99  edm::Handle<double> rhoHandle;
100  double rho = 0.0;
101  if (doRhoCorrection_) {
102  iEvent.getByToken(rhoProducer_, rhoHandle);
103  rho = *(rhoHandle.product());
104  }
105 
106  if (rho > rhoMax_)
107  rho = rhoMax_;
108 
109  rho = rho*rhoScale_;
110 
111  edm::ESHandle<CaloGeometry> caloGeomHandle;
112  iSetup.get<CaloGeometryRecord>().get(caloGeomHandle);
113  const CaloGeometry* caloGeom = caloGeomHandle.product();
114 
115  reco::RecoEcalCandidateIsolationMap isoMap(recoEcalCandHandle);
116 
117 
118  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
119 
120  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand -recoEcalCandHandle ->begin());
121 
122  float isol = 0;
123  if(doEtSum_) {
124  isol = isolAlgo_->getEtSum(recoEcalCandRef->superCluster()->eta(),
125  recoEcalCandRef->superCluster()->phi(),hbheRecHitCollection,caloGeom,
126  hcalSevLvlComp.product(),hcalChStatus);
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 {
135  isol = isolAlgo_->getESum(recoEcalCandRef->superCluster()->eta(),recoEcalCandRef->superCluster()->phi(),
136  hbheRecHitCollection,caloGeom,
137  hcalSevLvlComp.product(),hcalChStatus);
138  }
139 
140  isoMap.insert(recoEcalCandRef, isol);
141  }
142 
143  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
144 
145 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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:81
const T & get() const
Definition: EventSetup.h:56
#define begin
Definition: vmac.h:30
float getESum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHitProducer_
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

bool EgammaHLTHcalIsolationProducersRegional::doEtSum_
private
bool EgammaHLTHcalIsolationProducersRegional::doRhoCorrection_
private
float EgammaHLTHcalIsolationProducersRegional::effectiveAreaBarrel_
private
float EgammaHLTHcalIsolationProducersRegional::effectiveAreaEndcap_
private
edm::EDGetTokenT<HBHERecHitCollection> EgammaHLTHcalIsolationProducersRegional::hbheRecHitProducer_
private
EgammaHLTHcalIsolation* EgammaHLTHcalIsolationProducersRegional::isolAlgo_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTHcalIsolationProducersRegional::recoEcalCandidateProducer_
private
float EgammaHLTHcalIsolationProducersRegional::rhoMax_
private
edm::EDGetTokenT<double> EgammaHLTHcalIsolationProducersRegional::rhoProducer_
private
float EgammaHLTHcalIsolationProducersRegional::rhoScale_
private