test
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
EgammaHLTEcalIsolationProducersRegional Class Reference

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

Inheritance diagram for EgammaHLTEcalIsolationProducersRegional:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTEcalIsolationProducersRegional (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~EgammaHLTEcalIsolationProducersRegional ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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

int algoType_
 
edm::EDGetTokenT
< reco::BasicClusterCollection
bcBarrelProducer_
 
edm::EDGetTokenT
< reco::BasicClusterCollection
bcEndcapProducer_
 
edm::ParameterSet conf_
 
double egEcalIsoConeSize_
 
double egEcalIsoEtMin_
 
edm::EDGetTokenT
< reco::RecoEcalCandidateCollection
recoEcalCandidateProducer_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
scIslandBarrelProducer_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
scIslandEndcapProducer_
 
EgammaHLTEcalIsolationtest_
 

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Author
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 45 of file EgammaHLTEcalIsolationProducersRegional.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file EgammaHLTEcalIsolationProducersRegional.cc.

References algoType_, bcBarrelProducer_, bcEndcapProducer_, conf_, egEcalIsoConeSize_, egEcalIsoEtMin_, edm::ParameterSet::getParameter(), recoEcalCandidateProducer_, scIslandBarrelProducer_, scIslandEndcapProducer_, and test_.

17  : conf_(config) {
18 
19  // use configuration file to setup input/output collection names
20 
21  bcBarrelProducer_ = consumes<reco::BasicClusterCollection>(conf_.getParameter<edm::InputTag>("bcBarrelProducer"));
22  bcEndcapProducer_ = consumes<reco::BasicClusterCollection>(conf_.getParameter<edm::InputTag>("bcEndcapProducer"));
23  scIslandBarrelProducer_ = consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scIslandBarrelProducer"));
24  scIslandEndcapProducer_ = consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scIslandEndcapProducer"));
25  recoEcalCandidateProducer_ = consumes<reco::RecoEcalCandidateCollection>(conf_.getParameter<edm::InputTag>("recoEcalCandidateProducer"));
26 
27  egEcalIsoEtMin_ = conf_.getParameter<double>("egEcalIsoEtMin");
28  egEcalIsoConeSize_ = conf_.getParameter<double>("egEcalIsoConeSize");
29  algoType_ = conf_.getParameter<int>("SCAlgoType");
31 
32  //register your products
33  produces < reco::RecoEcalCandidateIsolationMap >();
34 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
edm::EDGetTokenT< reco::BasicClusterCollection > bcEndcapProducer_
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandBarrelProducer_
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
edm::EDGetTokenT< reco::BasicClusterCollection > bcBarrelProducer_
EgammaHLTEcalIsolationProducersRegional::~EgammaHLTEcalIsolationProducersRegional ( )

Definition at line 36 of file EgammaHLTEcalIsolationProducersRegional.cc.

References test_.

36  {
37  delete test_;
38 }

Member Function Documentation

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

Definition at line 40 of file EgammaHLTEcalIsolationProducersRegional.cc.

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

40  {
42  desc.add<edm::InputTag>("bcBarrelProducer", edm::InputTag(""));
43  desc.add<edm::InputTag>("bcEndcapProducer", edm::InputTag(""));
44  desc.add<edm::InputTag>("scIslandBarrelProducer", edm::InputTag(""));
45  desc.add<edm::InputTag>("scIslandEndcapProducer", edm::InputTag(""));
46  desc.add<edm::InputTag>("recoEcalCandidateProducer", edm::InputTag(""));
47  desc.add<double>("egEcalIsoEtMin", 0.);
48  desc.add<double>("egEcalIsoConeSize", 0.3);
49  desc.add<int>("SCAlgoType", 1);
50  descriptions.add("hltEgammaHLTEcalIsolationProducersRegional", desc);
51 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTEcalIsolationProducersRegional::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 54 of file EgammaHLTEcalIsolationProducersRegional.cc.

References bcBarrelProducer_, bcEndcapProducer_, begin, edm::Event::getByToken(), edm::AssociationMap< Tag >::insert(), EgammaHLTEcalIsolation::isolPtSum(), edm::Handle< T >::product(), edm::Event::put(), recoEcalCandidateProducer_, scIslandBarrelProducer_, scIslandEndcapProducer_, and test_.

54  {
55 
56  // Get the basic cluster collection in the Barrel
58  iEvent.getByToken(bcBarrelProducer_, bcBarrelHandle);
59  const reco::BasicClusterCollection* clusterBarrelCollection = bcBarrelHandle.product();
60  // Get the basic cluster collection in the endcap
62  iEvent.getByToken(bcEndcapProducer_, bcEndcapHandle);
63  const reco::BasicClusterCollection* clusterEndcapCollection = (bcEndcapHandle.product());
64  // Get the Barrel Super Cluster collection
66  iEvent.getByToken(scIslandBarrelProducer_,scBarrelHandle);
67  const reco::SuperClusterCollection* scBarrelCollection = (scBarrelHandle.product());
68  // Get the Endcap Super Cluster collection
70  iEvent.getByToken(scIslandEndcapProducer_,scEndcapHandle);
71  const reco::SuperClusterCollection* scEndcapCollection = (scEndcapHandle.product());
72  // Get the RecoEcalCandidate Collection
74  iEvent.getByToken(recoEcalCandidateProducer_,recoecalcandHandle);
75 
76  std::vector<const reco::BasicCluster*> clusterCollection;
77  for (reco::BasicClusterCollection::const_iterator ibc = clusterBarrelCollection->begin();
78  ibc < clusterBarrelCollection->end(); ibc++ ){clusterCollection.push_back(&(*ibc));}
79  for (reco::BasicClusterCollection::const_iterator iec = clusterEndcapCollection->begin();
80  iec < clusterEndcapCollection->end(); iec++ ){clusterCollection.push_back(&(*iec));}
81  std::vector<const reco::SuperCluster*> scCollection;
82  for (reco::SuperClusterCollection::const_iterator ibsc = scBarrelCollection->begin();
83  ibsc < scBarrelCollection->end(); ibsc++ ){scCollection.push_back(&(*ibsc));}
84  for (reco::SuperClusterCollection::const_iterator iesc = scEndcapCollection->begin();
85  iesc < scEndcapCollection->end(); iesc++ ){scCollection.push_back(&(*iesc));}
86 
88 
89 
90 
91  for (reco::RecoEcalCandidateCollection::const_iterator iRecoEcalCand= recoecalcandHandle->begin(); iRecoEcalCand!=recoecalcandHandle->end(); iRecoEcalCand++) {
92 
93 
94  reco::RecoEcalCandidateRef recoecalcandref(reco::RecoEcalCandidateRef(recoecalcandHandle,iRecoEcalCand -recoecalcandHandle ->begin()));
95 
96 
97  const reco::RecoCandidate *tempiRecoEcalCand = &(*recoecalcandref);
98  float isol = test_->isolPtSum(tempiRecoEcalCand,scCollection, clusterCollection);
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 }
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateProducer_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
float isolPtSum(const reco::RecoCandidate *recocandidate, const std::vector< const reco::SuperCluster * > &sclusters, const std::vector< const reco::BasicCluster * > &bclusters)
edm::EDGetTokenT< reco::BasicClusterCollection > bcEndcapProducer_
void insert(const key_type &k, const data_type &v)
insert an association
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandBarrelProducer_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
T const * product() const
Definition: Handle.h:81
#define begin
Definition: vmac.h:30
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
edm::EDGetTokenT< reco::BasicClusterCollection > bcBarrelProducer_

Member Data Documentation

int EgammaHLTEcalIsolationProducersRegional::algoType_
private
edm::EDGetTokenT<reco::BasicClusterCollection> EgammaHLTEcalIsolationProducersRegional::bcBarrelProducer_
private
edm::EDGetTokenT<reco::BasicClusterCollection> EgammaHLTEcalIsolationProducersRegional::bcEndcapProducer_
private
edm::ParameterSet EgammaHLTEcalIsolationProducersRegional::conf_
private
double EgammaHLTEcalIsolationProducersRegional::egEcalIsoConeSize_
private
double EgammaHLTEcalIsolationProducersRegional::egEcalIsoEtMin_
private
edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaHLTEcalIsolationProducersRegional::recoEcalCandidateProducer_
private
edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTEcalIsolationProducersRegional::scIslandBarrelProducer_
private
edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTEcalIsolationProducersRegional::scIslandEndcapProducer_
private
EgammaHLTEcalIsolation* EgammaHLTEcalIsolationProducersRegional::test_
private