CMS 3D CMS Logo

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

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

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

Public Member Functions

 EgammaHLTPhotonTrackIsolationProducersRegional (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTPhotonTrackIsolationProducersRegional () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 countTracks_
 
const double egTrkIsoConeSize_
 
const double egTrkIsoPtMin_
 
const double egTrkIsoRSpan_
 
const double egTrkIsoStripBarrel_
 
const double egTrkIsoStripEndcap_
 
const double egTrkIsoVetoConeSize_
 
const double egTrkIsoZSpan_
 
const edm::EDGetTokenT< reco::RecoEcalCandidateCollectionrecoEcalCandidateProducer_
 
EgammaHLTTrackIsolationtest_
 
const edm::EDGetTokenT< reco::TrackCollectiontrackProducer_
 

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::ProducerBase
ProducesCollector producesCollector ()
 
- 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

Definition at line 40 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

Constructor & Destructor Documentation

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

Definition at line 69 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSize_, egTrkIsoZSpan_, and test_.

72  consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
73  trackProducer_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
74  countTracks_(config.getParameter<bool>("countTracks")),
75  egTrkIsoPtMin_(config.getParameter<double>("egTrkIsoPtMin")),
76  egTrkIsoConeSize_(config.getParameter<double>("egTrkIsoConeSize")),
77  egTrkIsoZSpan_(config.getParameter<double>("egTrkIsoZSpan")),
78  egTrkIsoRSpan_(config.getParameter<double>("egTrkIsoRSpan")),
79  egTrkIsoVetoConeSize_(config.getParameter<double>("egTrkIsoVetoConeSize")),
80  egTrkIsoStripBarrel_(config.getParameter<double>("egTrkIsoStripBarrel")),
81  egTrkIsoStripEndcap_(config.getParameter<double>("egTrkIsoStripEndcap")) {
89 
90  //register your products
91  produces<reco::RecoEcalCandidateIsolationMap>();
92 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTPhotonTrackIsolationProducersRegional::~EgammaHLTPhotonTrackIsolationProducersRegional ( )
override

Member Function Documentation

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

Definition at line 96 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

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

96  {
98  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
99  desc.add<edm::InputTag>(("trackProducer"), edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
100  desc.add<bool>(("countTracks"), false);
101  desc.add<double>(("egTrkIsoPtMin"), 1.0);
102  desc.add<double>(("egTrkIsoConeSize"), 0.29);
103  desc.add<double>(("egTrkIsoZSpan"), 999999.0);
104  desc.add<double>(("egTrkIsoRSpan"), 999999.0);
105  desc.add<double>(("egTrkIsoVetoConeSize"), 0.06);
106  desc.add<double>(("egTrkIsoStripBarrel"), 0.03);
107  desc.add<double>(("egTrkIsoStripEndcap"), 0.03);
108  descriptions.add(("hltEgammaHLTPhotonTrackIsolationProducersRegional"), desc);
109 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTPhotonTrackIsolationProducersRegional::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 112 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References countTracks_, DEFINE_FWK_MODULE, edm::Event::getByToken(), edm::AssociationMap< Tag >::insert(), EgammaHLTTrackIsolation::photonPtSum(), EgammaHLTTrackIsolation::photonTrackCount(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, test_, duplicaterechits_cfi::trackCollection, and trackProducer_.

114  {
115  // Get the HLT filtered objects
117  iEvent.getByToken(recoEcalCandidateProducer_, recoecalcandHandle);
118 
119  // Get the barrel hcal hits
121  iEvent.getByToken(trackProducer_, trackHandle);
122  const reco::TrackCollection* trackCollection = trackHandle.product();
123 
124  reco::RecoEcalCandidateIsolationMap isoMap(recoecalcandHandle);
125 
126  for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoecalcandHandle->size(); iRecoEcalCand++) {
127  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
128 
129  bool usePhotonVertex = false;
130 
131  float isol;
132  if (countTracks_) {
133  isol = test_->photonTrackCount(&(*recoecalcandref), trackCollection, usePhotonVertex);
134  } else {
135  isol = test_->photonPtSum(&(*recoecalcandref), trackCollection, usePhotonVertex);
136  }
137 
138  isoMap.insert(recoecalcandref, isol);
139  }
140 
141  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
142 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
int photonTrackCount(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
T const * product() const
Definition: Handle.h:69
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)

Member Data Documentation

const bool EgammaHLTPhotonTrackIsolationProducersRegional::countTracks_
private

Definition at line 56 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

Referenced by produce().

const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoConeSize_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoPtMin_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoRSpan_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoStripBarrel_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoStripEndcap_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoVetoConeSize_
private
const double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoZSpan_
private
const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTPhotonTrackIsolationProducersRegional::recoEcalCandidateProducer_
private

Definition at line 51 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

Referenced by produce().

EgammaHLTTrackIsolation* EgammaHLTPhotonTrackIsolationProducersRegional::test_
private
const edm::EDGetTokenT<reco::TrackCollection> EgammaHLTPhotonTrackIsolationProducersRegional::trackProducer_
private

Definition at line 52 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

Referenced by produce().