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
 
- 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)
 
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::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::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 39 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

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

16  :
17  recoEcalCandidateProducer_(consumes<reco::RecoEcalCandidateCollection> (config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
18  trackProducer_ (consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
19  countTracks_ (config.getParameter<bool>("countTracks")),
20  egTrkIsoPtMin_ (config.getParameter<double>("egTrkIsoPtMin")),
21  egTrkIsoConeSize_ (config.getParameter<double>("egTrkIsoConeSize")),
22  egTrkIsoZSpan_ (config.getParameter<double>("egTrkIsoZSpan")),
23  egTrkIsoRSpan_ (config.getParameter<double>("egTrkIsoRSpan")),
24  egTrkIsoVetoConeSize_ (config.getParameter<double>("egTrkIsoVetoConeSize")),
25  egTrkIsoStripBarrel_ (config.getParameter<double>("egTrkIsoStripBarrel")),
26  egTrkIsoStripEndcap_ (config.getParameter<double>("egTrkIsoStripEndcap")) {
27 
31 
32  //register your products
33  produces < reco::RecoEcalCandidateIsolationMap >();
34 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
EgammaHLTPhotonTrackIsolationProducersRegional::~EgammaHLTPhotonTrackIsolationProducersRegional ( )
override

Definition at line 36 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References test_.

Member Function Documentation

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

Definition at line 40 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

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

40  {
42  desc.add<edm::InputTag>(("recoEcalCandidateProducer"), edm::InputTag("hltL1SeededRecoEcalCandidate"));
43  desc.add<edm::InputTag>(("trackProducer"), edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
44  desc.add<bool>(("countTracks"), false);
45  desc.add<double>(("egTrkIsoPtMin"), 1.0);
46  desc.add<double>(("egTrkIsoConeSize"), 0.29);
47  desc.add<double>(("egTrkIsoZSpan"), 999999.0);
48  desc.add<double>(("egTrkIsoRSpan"), 999999.0);
49  desc.add<double>(("egTrkIsoVetoConeSize"), 0.06);
50  desc.add<double>(("egTrkIsoStripBarrel"), 0.03);
51  desc.add<double>(("egTrkIsoStripEndcap"), 0.03);
52  descriptions.add(("hltEgammaHLTPhotonTrackIsolationProducersRegional"), desc);
53 }
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 58 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

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

58  {
59 
60  // Get the HLT filtered objects
62  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
63 
64  // Get the barrel hcal hits
66  iEvent.getByToken(trackProducer_, trackHandle);
67  const reco::TrackCollection* trackCollection = trackHandle.product();
68 
69  reco::RecoEcalCandidateIsolationMap isoMap(recoecalcandHandle);
70 
71  for(unsigned int iRecoEcalCand=0; iRecoEcalCand<recoecalcandHandle->size(); iRecoEcalCand++) {
72 
73  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle, iRecoEcalCand);
74 
75  bool usePhotonVertex = false;
76 
77  float isol;
78  if (countTracks_) {
79  isol = test_->photonTrackCount(&(*recoecalcandref), trackCollection, usePhotonVertex);
80  } else {
81  isol = test_->photonPtSum(&(*recoecalcandref), trackCollection, usePhotonVertex);
82  }
83 
84  isoMap.insert(recoecalcandref, isol);
85 
86  }
87 
88  iEvent.put(std::make_unique<reco::RecoEcalCandidateIsolationMap>(isoMap));
89 
90 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
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:81
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)

Member Data Documentation

const bool EgammaHLTPhotonTrackIsolationProducersRegional::countTracks_
private

Definition at line 55 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.

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 50 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.

Referenced by produce().

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

Definition at line 51 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.

Referenced by produce().