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 Attributes
EgammaHLTElectronTrackIsolationProducers Class Reference

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

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

Public Member Functions

 EgammaHLTElectronTrackIsolationProducers (const edm::ParameterSet &)
 
void produce (edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
 
 ~EgammaHLTElectronTrackIsolationProducers ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT
< reco::BeamSpot
beamSpotProducer_
 
const double egTrkIsoConeSize_
 
const double egTrkIsoPtMin_
 
const double egTrkIsoRSpan_
 
const double egTrkIsoStripBarrel_
 
const double egTrkIsoStripEndcap_
 
const double egTrkIsoVetoConeSizeBarrel_
 
const double egTrkIsoVetoConeSizeEndcap_
 
const double egTrkIsoZSpan_
 
const edm::EDGetTokenT
< reco::ElectronCollection
electronProducer_
 
const edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
const edm::EDGetTokenT
< reco::TrackCollection
trackProducer_
 
const bool useGsfTrack_
 
const bool useSCRefs_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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:
EgammaHLTElectronTrackIsolationProducers.cc,v 1.9 2011/12/19 11:17:28 sani Exp

Definition at line 37 of file EgammaHLTElectronTrackIsolationProducers.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file EgammaHLTElectronTrackIsolationProducers.cc.

References useSCRefs_.

19  :
20  electronProducer_ (consumes<reco::ElectronCollection>(config.getParameter<edm::InputTag>("electronProducer"))),
21  trackProducer_ (consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackProducer"))),
22  recoEcalCandidateProducer_ (consumes<reco::RecoEcalCandidateCollection>(config.getParameter<edm::InputTag>("recoEcalCandidateProducer"))),
23  beamSpotProducer_ (consumes<reco::BeamSpot>(config.getParameter<edm::InputTag>("beamSpotProducer"))),
24  useGsfTrack_ (config.getParameter<bool>("useGsfTrack")),
25  useSCRefs_ (config.getParameter<bool>("useSCRefs")),
26  egTrkIsoPtMin_ (config.getParameter<double>("egTrkIsoPtMin")),
27  egTrkIsoConeSize_ (config.getParameter<double>("egTrkIsoConeSize")),
28  egTrkIsoZSpan_ (config.getParameter<double>("egTrkIsoZSpan")),
29  egTrkIsoRSpan_ (config.getParameter<double>("egTrkIsoRSpan")),
30  egTrkIsoVetoConeSizeBarrel_ (config.getParameter<double>("egTrkIsoVetoConeSizeBarrel")),
31  egTrkIsoVetoConeSizeEndcap_ (config.getParameter<double>("egTrkIsoVetoConeSizeEndcap")),
32  egTrkIsoStripBarrel_ (config.getParameter<double>("egTrkIsoStripBarrel")),
33  egTrkIsoStripEndcap_ (config.getParameter<double>("egTrkIsoStripEndcap")) {
34 
35  //register your products
36  if(useSCRefs_)
37  produces < reco::RecoEcalCandidateIsolationMap >();
38  else
39  produces < reco::ElectronIsolationMap >();
40 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotProducer_
const edm::EDGetTokenT< reco::ElectronCollection > electronProducer_
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_
EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers ( )

Definition at line 42 of file EgammaHLTElectronTrackIsolationProducers.cc.

43 {}

Member Function Documentation

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

Definition at line 45 of file EgammaHLTElectronTrackIsolationProducers.cc.

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

45  {
47  desc.add<edm::InputTag>("electronProducer", edm::InputTag("hltEleAnyWP80PixelMatchElectronsL1Seeded"));
48  desc.add<edm::InputTag>("trackProducer", edm::InputTag("hltL1SeededEgammaRegionalCTFFinalFitWithMaterial"));
49  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag());
50  desc.add<edm::InputTag>("beamSpotProducer", edm::InputTag("hltOnlineBeamSpot"));
51  desc.add<double>("egTrkIsoPtMin", 1.0);
52  desc.add<double>("egTrkIsoConeSize", 0.3);
53  desc.add<double>("egTrkIsoZSpan", 0.15);
54  desc.add<double>("egTrkIsoRSpan", 999999.0);
55  desc.add<double>("egTrkIsoVetoConeSizeBarrel", 0.03);
56  desc.add<double>("egTrkIsoVetoConeSizeEndcap", 0.03);
57  desc.add<double>("egTrkIsoStripBarrel", 0.03);
58  desc.add<double>("egTrkIsoStripEndcap", 0.03);
59  desc.add<bool>("useGsfTrack", false);
60  desc.add<bool>("useSCRefs", false);
61 
62  descriptions.add("hltEgammaHLTElectronTrackIsolationProducers", desc);
63 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTElectronTrackIsolationProducers::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 64 of file EgammaHLTElectronTrackIsolationProducers.cc.

References beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, edm::Event::getByToken(), ElectronTkIsolation::getIso(), edm::AssociationMap< Tag >::insert(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, HLT_25ns14e33_v3_cff::trackCollection, trackProducer_, useGsfTrack_, and useSCRefs_.

64  {
65 
67  iEvent.getByToken(electronProducer_,electronHandle);
68 
69  // Get the general tracks
71  iEvent.getByToken(trackProducer_, trackHandle);
72  const reco::TrackCollection* trackCollection = trackHandle.product();
73 
76 
77  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
78  iEvent.getByToken(beamSpotProducer_,recoBeamSpotHandle);
79 
80  const reco::BeamSpot::Point& beamSpotPosition = recoBeamSpotHandle->position();
81 
83 
84  if(useSCRefs_){
86  iEvent.getByToken(recoEcalCandidateProducer_,recoEcalCandHandle);
87  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
88 
89  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand-recoEcalCandHandle->begin());
90 
91  reco::ElectronRef eleRef;
92  for(reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end(); eleIt++){
93  if(eleIt->superCluster()==recoEcalCandRef->superCluster()){
94  eleRef = reco::ElectronRef(electronHandle,eleIt - electronHandle->begin());
95  break;
96  }
97  }
98  float isol=999999;
99  if(eleRef.isNonnull()){
100  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
101  isol = isoAlgo.getIso(eleTrk).second;
102  }
103  recoEcalCandMap.insert(recoEcalCandRef,isol);
104  }//end reco ecal candidate ref
105  }else{ //we are going to loop over electron instead
106  for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
107  reco::ElectronRef eleRef(reco::ElectronRef(electronHandle,iElectron - electronHandle->begin()));
108  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
109  float isol = isoAlgo.getIso(eleTrk).second;
110  eleMap.insert(eleRef, isol);
111  }
112  }
113 
114  if(useSCRefs_){
115  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap));
116  iEvent.put(mapForEvent);
117  }else{
118  std::auto_ptr<reco::ElectronIsolationMap> mapForEvent(new reco::ElectronIsolationMap(eleMap));
119  iEvent.put(mapForEvent);
120  }
121 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:29
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
const edm::EDGetTokenT< reco::BeamSpot > beamSpotProducer_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
const edm::EDGetTokenT< reco::ElectronCollection > electronProducer_
T const * product() const
Definition: Handle.h:81
void insert(const key_type &k, const data_type &v)
insert an association
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_

Member Data Documentation

const edm::EDGetTokenT<reco::BeamSpot> EgammaHLTElectronTrackIsolationProducers::beamSpotProducer_
private

Definition at line 48 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_
private

Definition at line 54 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_
private

Definition at line 53 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_
private

Definition at line 56 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripBarrel_
private

Definition at line 59 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripEndcap_
private

Definition at line 60 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeBarrel_
private

Definition at line 57 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeEndcap_
private

Definition at line 58 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const double EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_
private

Definition at line 55 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const edm::EDGetTokenT<reco::ElectronCollection> EgammaHLTElectronTrackIsolationProducers::electronProducer_
private

Definition at line 45 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

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

Definition at line 47 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const edm::EDGetTokenT<reco::TrackCollection> EgammaHLTElectronTrackIsolationProducers::trackProducer_
private

Definition at line 46 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const bool EgammaHLTElectronTrackIsolationProducers::useGsfTrack_
private

Definition at line 50 of file EgammaHLTElectronTrackIsolationProducers.h.

Referenced by produce().

const bool EgammaHLTElectronTrackIsolationProducers::useSCRefs_
private