CMS 3D CMS Logo

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

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

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

Public Member Functions

 EgammaHLTEcalIsolationProducersRegional (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTEcalIsolationProducersRegional () 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 int algoType_
 
const edm::EDGetTokenT< reco::BasicClusterCollectionbcBarrelProducer_
 
const edm::EDGetTokenT< reco::BasicClusterCollectionbcEndcapProducer_
 
const edm::ParameterSet conf_
 
const double egEcalIsoConeSize_
 
const double egEcalIsoEtMin_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
const edm::EDGetTokenT< reco::SuperClusterCollectionscIslandBarrelProducer_
 
const edm::EDGetTokenT< reco::SuperClusterCollectionscIslandEndcapProducer_
 
EgammaHLTEcalIsolation const *const test_
 

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Author
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 45 of file EgammaHLTEcalIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file EgammaHLTEcalIsolationProducersRegional.cc.

18  : conf_(config)
19  , recoEcalCandidateProducer_ (consumes<reco::RecoEcalCandidateCollection>(conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer")))
20  , bcBarrelProducer_ (consumes<reco::BasicClusterCollection>(conf_.getParameter<edm::InputTag>("bcBarrelProducer")))
21  , bcEndcapProducer_ (consumes<reco::BasicClusterCollection>(conf_.getParameter<edm::InputTag>("bcEndcapProducer")))
22  , scIslandBarrelProducer_ (consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scIslandBarrelProducer")))
23  , scIslandEndcapProducer_ (consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scIslandEndcapProducer")))
24  , egEcalIsoEtMin_ (conf_.getParameter<double>("egEcalIsoEtMin"))
25  , egEcalIsoConeSize_ (conf_.getParameter<double>("egEcalIsoConeSize"))
26  , algoType_ (conf_.getParameter<int>("SCAlgoType"))
28 {
29 
30  //register your products
31  produces < reco::RecoEcalCandidateIsolationMap >();
32 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::BasicClusterCollection > bcBarrelProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandBarrelProducer_
const edm::EDGetTokenT< reco::BasicClusterCollection > bcEndcapProducer_
EgammaHLTEcalIsolationProducersRegional::~EgammaHLTEcalIsolationProducersRegional ( )
override

Definition at line 34 of file EgammaHLTEcalIsolationProducersRegional.cc.

References test_.

34  {
35  delete test_;
36 }

Member Function Documentation

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

Definition at line 38 of file EgammaHLTEcalIsolationProducersRegional.cc.

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

38  {
40  desc.add<edm::InputTag>("bcBarrelProducer", edm::InputTag(""));
41  desc.add<edm::InputTag>("bcEndcapProducer", edm::InputTag(""));
42  desc.add<edm::InputTag>("scIslandBarrelProducer", edm::InputTag(""));
43  desc.add<edm::InputTag>("scIslandEndcapProducer", edm::InputTag(""));
44  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag(""));
45  desc.add<double>("egEcalIsoEtMin", 0.);
46  desc.add<double>("egEcalIsoConeSize", 0.3);
47  desc.add<int>("SCAlgoType", 1);
48  descriptions.add("hltEgammaHLTEcalIsolationProducersRegional", desc);
49 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTEcalIsolationProducersRegional::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 52 of file EgammaHLTEcalIsolationProducersRegional.cc.

References bcBarrelProducer_, bcEndcapProducer_, begin, edm::Event::getByToken(), edm::AssociationMap< Tag >::insert(), EgammaHLTEcalIsolation::isolPtSum(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, cleanAndMergeSuperClusters_cfi::scCollection, scIslandBarrelProducer_, scIslandEndcapProducer_, and test_.

52  {
53 
54  // Get the basic cluster collection in the Barrel
56  iEvent.getByToken(bcBarrelProducer_, bcBarrelHandle);
57  const reco::BasicClusterCollection* clusterBarrelCollection = bcBarrelHandle.product();
58  // Get the basic cluster collection in the endcap
60  iEvent.getByToken(bcEndcapProducer_, bcEndcapHandle);
61  const reco::BasicClusterCollection* clusterEndcapCollection = (bcEndcapHandle.product());
62  // Get the Barrel Super Cluster collection
64  iEvent.getByToken(scIslandBarrelProducer_,scBarrelHandle);
65  const reco::SuperClusterCollection* scBarrelCollection = (scBarrelHandle.product());
66  // Get the Endcap Super Cluster collection
68  iEvent.getByToken(scIslandEndcapProducer_,scEndcapHandle);
69  const reco::SuperClusterCollection* scEndcapCollection = (scEndcapHandle.product());
70  // Get the RecoEcalCandidate Collection
72  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
73 
74  std::vector<const reco::BasicCluster*> clusterCollection;
75  for (reco::BasicClusterCollection::const_iterator ibc = clusterBarrelCollection->begin();
76  ibc < clusterBarrelCollection->end(); ibc++ ){clusterCollection.push_back(&(*ibc));}
77  for (reco::BasicClusterCollection::const_iterator iec = clusterEndcapCollection->begin();
78  iec < clusterEndcapCollection->end(); iec++ ){clusterCollection.push_back(&(*iec));}
79  std::vector<const reco::SuperCluster*> scCollection;
80  for (reco::SuperClusterCollection::const_iterator ibsc = scBarrelCollection->begin();
81  ibsc < scBarrelCollection->end(); ibsc++ ){scCollection.push_back(&(*ibsc));}
82  for (reco::SuperClusterCollection::const_iterator iesc = scEndcapCollection->begin();
83  iesc < scEndcapCollection->end(); iesc++ ){scCollection.push_back(&(*iesc));}
84 
86 
87 
88 
89  for (reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand= recoecalcandHandle->begin(); iRecoEcalCand!=recoecalcandHandle->end(); iRecoEcalCand++) {
90 
91 
92  reco::RecoEcalCandidateRef recoecalcandref(reco::RecoEcalCandidateRef(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin()));
93 
94 
95  const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);
96  float isol = test_->isolPtSum(tempiRecoEcalCand,scCollection, clusterCollection);
97 
98  isoMap.insert(recoecalcandref, isol);
99 
100  }
101 
102  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
103 
104 }
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< reco::BasicClusterCollection > bcBarrelProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandBarrelProducer_
const edm::EDGetTokenT< reco::BasicClusterCollection > bcEndcapProducer_
float isolPtSum(const reco::RecoCandidate *recocandidate, const std::vector< const reco::SuperCluster * > &sclusters, const std::vector< const reco::BasicCluster * > &bclusters) const
T const * product() const
Definition: Handle.h:74
void insert(const key_type &k, const data_type &v)
insert an association
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
#define begin
Definition: vmac.h:32

Member Data Documentation

const int EgammaHLTEcalIsolationProducersRegional::algoType_
private

Definition at line 63 of file EgammaHLTEcalIsolationProducersRegional.h.

const edm::EDGetTokenT<reco::BasicClusterCollection> EgammaHLTEcalIsolationProducersRegional::bcBarrelProducer_
private

Definition at line 56 of file EgammaHLTEcalIsolationProducersRegional.h.

Referenced by produce().

const edm::EDGetTokenT<reco::BasicClusterCollection> EgammaHLTEcalIsolationProducersRegional::bcEndcapProducer_
private

Definition at line 57 of file EgammaHLTEcalIsolationProducersRegional.h.

Referenced by produce().

const edm::ParameterSet EgammaHLTEcalIsolationProducersRegional::conf_
private

Definition at line 53 of file EgammaHLTEcalIsolationProducersRegional.h.

const double EgammaHLTEcalIsolationProducersRegional::egEcalIsoConeSize_
private

Definition at line 62 of file EgammaHLTEcalIsolationProducersRegional.h.

const double EgammaHLTEcalIsolationProducersRegional::egEcalIsoEtMin_
private

Definition at line 61 of file EgammaHLTEcalIsolationProducersRegional.h.

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTEcalIsolationProducersRegional::recoEcalCandidateProducer_
private

Definition at line 55 of file EgammaHLTEcalIsolationProducersRegional.h.

Referenced by produce().

const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTEcalIsolationProducersRegional::scIslandBarrelProducer_
private

Definition at line 58 of file EgammaHLTEcalIsolationProducersRegional.h.

Referenced by produce().

const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTEcalIsolationProducersRegional::scIslandEndcapProducer_
private

Definition at line 59 of file EgammaHLTEcalIsolationProducersRegional.h.

Referenced by produce().

EgammaHLTEcalIsolation const* const EgammaHLTEcalIsolationProducersRegional::test_
private