test
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
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 &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTHcalIsolationProducersRegional ()
 
- 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

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

Private Attributes

bool doEtSum_
 
bool doRhoCorrection_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
edm::EDGetTokenT
< HBHERecHitCollection
hbheRecHitProducer_
 
EgammaHLTHcalIsolationisolAlgo_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
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
 
- 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

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 26 of file EgammaHLTHcalIsolationProducersRegional.cc.

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

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

Definition at line 55 of file EgammaHLTHcalIsolationProducersRegional.cc.

References isolAlgo_.

55  {
56  delete isolAlgo_;
57 }
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 59 of file EgammaHLTHcalIsolationProducersRegional.cc.

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

59  {
61  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
62  desc.add<edm::InputTag>(("hbheRecHitProducer"), edm::InputTag("hltHbhereco"));
63  desc.add<edm::InputTag>(("rhoProducer"), edm::InputTag("fixedGridRhoFastjetAllCalo"));
64  desc.add<bool>(("doRhoCorrection"), false);
65  desc.add<double>(("rhoMax"), 9.9999999E7);
66  desc.add<double>(("rhoScale"), 1.0);
67  desc.add<double>(("eMinHB"), 0.7);
68  desc.add<double>(("eMinHE"), 0.8);
69  desc.add<double>(("etMinHB"), -1.0);
70  desc.add<double>(("etMinHE"), -1.0);
71  desc.add<double>(("innerCone"), 0);
72  desc.add<double>(("outerCone"), 0.15);
73  desc.add<int>(("depth"), -1);
74  desc.add<bool>(("doEtSum"), false);
75  desc.add<double>(("effectiveAreaBarrel"), 0.105);
76  desc.add<double>(("effectiveAreaEndcap"), 0.170);
77  descriptions.add(("hltEgammaHLTHcalIsolationProducersRegional"), desc);
78 }
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 
)
virtual

Implements edm::EDProducer.

Definition at line 80 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< class >::product(), edm::Event::put(), recoEcalCandidateProducer_, rho, rhoMax_, rhoProducer_, and rhoScale_.

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

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