CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EgammaHLTElectronTrackIsolationProducers Class Reference

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

Inheritance diagram for EgammaHLTElectronTrackIsolationProducers:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTElectronTrackIsolationProducers (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTElectronTrackIsolationProducers ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::InputTag beamSpotProducer_
 
double egTrkIsoConeSize_
 
double egTrkIsoPtMin_
 
double egTrkIsoRSpan_
 
double egTrkIsoStripBarrel_
 
double egTrkIsoStripEndcap_
 
double egTrkIsoVetoConeSizeBarrel_
 
double egTrkIsoVetoConeSizeEndcap_
 
double egTrkIsoZSpan_
 
edm::InputTag electronProducer_
 
edm::InputTag recoEcalCandidateProducer_
 
edm::InputTag trackProducer_
 
bool useGsfTrack_
 
bool useSCRefs_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Author
Monica Vazquez Acosta (CERN)
Id:
EgammaHLTElectronTrackIsolationProducers.cc,v 1.10 2012/01/23 12:56:38 sharper Exp

Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file EgammaHLTElectronTrackIsolationProducers.cc.

References beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, trackProducer_, useGsfTrack_, and useSCRefs_.

35 {
36 
37  electronProducer_ = config.getParameter<edm::InputTag>("electronProducer");
38  trackProducer_ = config.getParameter<edm::InputTag>("trackProducer");
39  recoEcalCandidateProducer_ = config.getParameter<edm::InputTag>("recoEcalCandidateProducer");
40  beamSpotProducer_ = config.getParameter<edm::InputTag>("beamSpotProducer");
41 
42  useGsfTrack_ = config.getParameter<bool>("useGsfTrack");
43  useSCRefs_ = config.getParameter<bool>("useSCRefs");
44 
45  egTrkIsoPtMin_ = config.getParameter<double>("egTrkIsoPtMin");
46  egTrkIsoConeSize_ = config.getParameter<double>("egTrkIsoConeSize");
47  egTrkIsoZSpan_ = config.getParameter<double>("egTrkIsoZSpan");
48  egTrkIsoRSpan_ = config.getParameter<double>("egTrkIsoRSpan");
49  egTrkIsoVetoConeSizeBarrel_ = config.getParameter<double>("egTrkIsoVetoConeSizeBarrel");
50  egTrkIsoVetoConeSizeEndcap_ = config.getParameter<double>("egTrkIsoVetoConeSizeEndcap");
51  // egCheckForOtherEleInCone_ = config.getUntrackedParameter<bool>("egCheckForOtherEleInCone",false);
52  egTrkIsoStripBarrel_ = config.getParameter<double>("egTrkIsoStripBarrel");
53  egTrkIsoStripEndcap_ = config.getParameter<double>("egTrkIsoStripEndcap");
54 
55 
56 
57 
58  //register your products
59  if(useSCRefs_) produces < reco::RecoEcalCandidateIsolationMap >();
60  else produces < reco::ElectronIsolationMap >();
61 }
T getParameter(std::string const &) const
EgammaHLTElectronTrackIsolationProducers::~EgammaHLTElectronTrackIsolationProducers ( )

Definition at line 64 of file EgammaHLTElectronTrackIsolationProducers.cc.

64 {}

Member Function Documentation

void EgammaHLTElectronTrackIsolationProducers::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 73 of file EgammaHLTElectronTrackIsolationProducers.cc.

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

74 {
75 
77  iEvent.getByLabel(electronProducer_,electronHandle);
78 
79 
80  // Get the general tracks
82  iEvent.getByLabel(trackProducer_, trackHandle);
83  const reco::TrackCollection* trackCollection = trackHandle.product();
84 
87 
88  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
89  iEvent.getByLabel(beamSpotProducer_,recoBeamSpotHandle);
90 
91  const reco::BeamSpot::Point& beamSpotPosition = recoBeamSpotHandle->position();
92 
94 
95  if(useSCRefs_){
97  iEvent.getByLabel(recoEcalCandidateProducer_,recoEcalCandHandle);
98  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoEcalCandHandle->begin(); iRecoEcalCand != recoEcalCandHandle->end(); iRecoEcalCand++){
99 
100  reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle,iRecoEcalCand-recoEcalCandHandle->begin());
101 
102  reco::ElectronRef eleRef;
103  for(reco::ElectronCollection::const_iterator eleIt = electronHandle->begin(); eleIt != electronHandle->end(); eleIt++){
104  if(eleIt->superCluster()==recoEcalCandRef->superCluster()){
105  eleRef = reco::ElectronRef(electronHandle,eleIt - electronHandle->begin());
106  break;
107  }
108  }
109  float isol=999999;
110  if(eleRef.isNonnull()){
111  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
112  isol = isoAlgo.getIso(eleTrk).second;
113  }
114  recoEcalCandMap.insert(recoEcalCandRef,isol);
115  }//end reco ecal candidate ref
116  }else{ //we are going to loop over electron instead
117  for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){
118  reco::ElectronRef eleRef(reco::ElectronRef(electronHandle,iElectron - electronHandle->begin()));
119  const reco::Track* eleTrk = useGsfTrack_ ? &*eleRef->gsfTrack() : &*eleRef->track();
120  float isol = isoAlgo.getIso(eleTrk).second;
121  eleMap.insert(eleRef, isol);
122  }
123  }
124 
125  if(useSCRefs_){
126  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap));
127  iEvent.put(mapForEvent);
128  }else{
129  std::auto_ptr<reco::ElectronIsolationMap> mapForEvent(new reco::ElectronIsolationMap(eleMap));
130  iEvent.put(mapForEvent);
131  }
132 
133 
134 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:30
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void insert(const key_type &k, const data_type &v)
insert an association
T const * product() const
Definition: Handle.h:74

Member Data Documentation

edm::InputTag EgammaHLTElectronTrackIsolationProducers::beamSpotProducer_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoConeSize_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoPtMin_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoRSpan_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripBarrel_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoStripEndcap_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeBarrel_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoVetoConeSizeEndcap_
private
double EgammaHLTElectronTrackIsolationProducers::egTrkIsoZSpan_
private
edm::InputTag EgammaHLTElectronTrackIsolationProducers::electronProducer_
private
edm::InputTag EgammaHLTElectronTrackIsolationProducers::recoEcalCandidateProducer_
private
edm::InputTag EgammaHLTElectronTrackIsolationProducers::trackProducer_
private
bool EgammaHLTElectronTrackIsolationProducers::useGsfTrack_
private
bool EgammaHLTElectronTrackIsolationProducers::useSCRefs_
private