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::EDProducer edm::ProducerBase edm::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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 beamSpotProducer_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoStripBarrel_, egTrkIsoStripEndcap_, egTrkIsoVetoConeSizeBarrel_, egTrkIsoVetoConeSizeEndcap_, egTrkIsoZSpan_, electronProducer_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, trackProducer_, useGsfTrack_, and useSCRefs_.

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

Definition at line 45 of file EgammaHLTElectronTrackIsolationProducers.cc.

46 {}

Member Function Documentation

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

Definition at line 48 of file EgammaHLTElectronTrackIsolationProducers.cc.

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

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

Implements edm::EDProducer.

Definition at line 67 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_, trackProducer_, useGsfTrack_, and useSCRefs_.

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

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> 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::EDGetTokenT<reco::ElectronCollection> EgammaHLTElectronTrackIsolationProducers::electronProducer_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTElectronTrackIsolationProducers::recoEcalCandidateProducer_
private
edm::EDGetTokenT<reco::TrackCollection> EgammaHLTElectronTrackIsolationProducers::trackProducer_
private
bool EgammaHLTElectronTrackIsolationProducers::useGsfTrack_
private
bool EgammaHLTElectronTrackIsolationProducers::useSCRefs_
private