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
EgammaHLTPhotonTrackIsolationProducersRegional Class Reference

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

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

Public Member Functions

 EgammaHLTPhotonTrackIsolationProducersRegional (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTPhotonTrackIsolationProducersRegional ()
 
- 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::ParameterSet conf_
 
bool countTracks_
 
double egTrkIsoConeSize_
 
double egTrkIsoPtMin_
 
double egTrkIsoRSpan_
 
double egTrkIsoVetoConeSize_
 
double egTrkIsoZSpan_
 
edm::InputTag recoEcalCandidateProducer_
 
EgammaHLTTrackIsolationtest_
 
edm::InputTag trackProducer_
 

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:

Definition at line 34 of file EgammaHLTPhotonTrackIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

References conf_, countTracks_, egTrkIsoConeSize_, egTrkIsoPtMin_, egTrkIsoRSpan_, egTrkIsoVetoConeSize_, egTrkIsoZSpan_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, test_, and trackProducer_.

33  : conf_(config)
34 {
35 
36  recoEcalCandidateProducer_ = conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer");
37  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
38 
39  countTracks_ = conf_.getParameter<bool>("countTracks");
40 
41  egTrkIsoPtMin_ = conf_.getParameter<double>("egTrkIsoPtMin");
42  egTrkIsoConeSize_ = conf_.getParameter<double>("egTrkIsoConeSize");
43  egTrkIsoZSpan_ = conf_.getParameter<double>("egTrkIsoZSpan");
44  egTrkIsoRSpan_ = conf_.getParameter<double>("egTrkIsoRSpan");
45  egTrkIsoVetoConeSize_ = conf_.getParameter<double>("egTrkIsoVetoConeSize");
46  double egTrkIsoStripBarrel = conf_.getParameter<double>("egTrkIsoStripBarrel");
47  double egTrkIsoStripEndcap = conf_.getParameter<double>("egTrkIsoStripEndcap");
48 
49  test_ = new EgammaHLTTrackIsolation(egTrkIsoPtMin_,egTrkIsoConeSize_,
50  egTrkIsoZSpan_,egTrkIsoRSpan_,egTrkIsoVetoConeSize_,
51  egTrkIsoStripBarrel,egTrkIsoStripEndcap);
52 
53 
54  //register your products
55  produces < reco::RecoEcalCandidateIsolationMap >();
56 
57 }
T getParameter(std::string const &) const
EgammaHLTPhotonTrackIsolationProducersRegional::~EgammaHLTPhotonTrackIsolationProducersRegional ( )

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 69 of file EgammaHLTPhotonTrackIsolationProducersRegional.cc.

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

70 {
71 
72  // Get the HLT filtered objects
74  iEvent.getByLabel(recoEcalCandidateProducer_,recoecalcandHandle);
75 
76  // Get the barrel hcal hits
78  iEvent.getByLabel(trackProducer_, trackHandle);
79  const reco::TrackCollection* trackCollection = trackHandle.product();
80 
81 
83 
84 
85 
86  for(reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand = recoecalcandHandle->begin(); iRecoEcalCand != recoecalcandHandle->end(); iRecoEcalCand++){
87 
88  reco::RecoEcalCandidateRef recoecalcandref(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin());
89  const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);
90 
91  bool usePhotonVertex = false;
92 
93  float isol;
94  if (countTracks_) {
95  isol = test_->photonTrackCount(tempiRecoEcalCand,trackCollection,usePhotonVertex);
96  } else {
97  isol = test_->photonPtSum(tempiRecoEcalCand,trackCollection,usePhotonVertex);
98  }
99 
100  isoMap.insert(recoecalcandref, isol);
101 
102  }
103 
104  std::auto_ptr<reco::RecoEcalCandidateIsolationMap> isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap));
105  iEvent.put(isolMap);
106 
107 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
int photonTrackCount(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
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
#define begin
Definition: vmac.h:31
float photonPtSum(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)

Member Data Documentation

edm::ParameterSet EgammaHLTPhotonTrackIsolationProducersRegional::conf_
private
bool EgammaHLTPhotonTrackIsolationProducersRegional::countTracks_
private
double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoConeSize_
private
double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoPtMin_
private
double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoRSpan_
private
double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoVetoConeSize_
private
double EgammaHLTPhotonTrackIsolationProducersRegional::egTrkIsoZSpan_
private
edm::InputTag EgammaHLTPhotonTrackIsolationProducersRegional::recoEcalCandidateProducer_
private
EgammaHLTTrackIsolation* EgammaHLTPhotonTrackIsolationProducersRegional::test_
private
edm::InputTag EgammaHLTPhotonTrackIsolationProducersRegional::trackProducer_
private