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

Producer for particle flow superclusters (PFSuperCluster). More...

#include <PFHCALSuperClusterProducer.h>

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

Public Member Functions

virtual void endJob ()
 
 PFHCALSuperClusterProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PFHCALSuperClusterProducer ()
 
- 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 ()
 

Private Attributes

PFHcalSuperClusterAlgo hcalSuperClusterAlgo_
 clustering algorithm More...
 
edm::InputTag inputTagPFClusters_
 
edm::InputTag inputTagPFClustersHO_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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

Producer for particle flow superclusters (PFSuperCluster).

This producer makes use of PFHcalSuperClusterAlgo, the clustering algorithm for particle flow superclusters.

Author
Chris Tully
Date
July 2012

Definition at line 42 of file PFHCALSuperClusterProducer.h.

Constructor & Destructor Documentation

PFHCALSuperClusterProducer::PFHCALSuperClusterProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file PFHCALSuperClusterProducer.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

19 {
20 
21  verbose_ =
22  iConfig.getUntrackedParameter<bool>("verbose",false);
23 
24  // parameters for clustering
25 
26 
27  // access to the collections of clusters:
28 
29  inputTagPFClusters_ = iConfig.getParameter<InputTag>("PFClusters");
30  inputTagPFClustersHO_ = iConfig.getParameter<InputTag>("PFClustersHO");
31 
32  produces<reco::PFClusterCollection>();
33  produces<reco::PFSuperClusterCollection>();
34 
35 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PFHCALSuperClusterProducer::~PFHCALSuperClusterProducer ( )

Definition at line 39 of file PFHCALSuperClusterProducer.cc.

39 {}

Member Function Documentation

void PFHCALSuperClusterProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 91 of file PFHCALSuperClusterProducer.cc.

91  {
92 
94 
95 }
PFHcalSuperClusterAlgo hcalSuperClusterAlgo_
clustering algorithm
void PFHCALSuperClusterProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 44 of file PFHCALSuperClusterProducer.cc.

References edm::hlt::Exception, newFWLiteAna::found, edm::Event::getByLabel(), and edm::Event::put().

45  {
46 
47 
50 
51  // access the clusters in the event
52  bool found = iEvent.getByLabel( inputTagPFClusters_, clustersHandle );
53  bool foundHO = iEvent.getByLabel( inputTagPFClustersHO_, clustersHOHandle );
54 
55  if(!found ) {
56 
57  ostringstream err;
58  err<<"cannot find clusters: "<<inputTagPFClusters_;
59  LogError("PFHCALSuperClusterProducer")<<err.str()<<endl;
60 
61  throw cms::Exception( "MissingProduct", err.str());
62  }
63 
64  if(!foundHO ) {
65 
66  ostringstream err;
67  err<<"cannot find HO clusters: "<<inputTagPFClustersHO_;
68  LogError("PFHCALSuperClusterProducer")<<err.str()<<endl;
69 
70  throw cms::Exception( "MissingProduct", err.str());
71  }
72 
73  // do clustering
74  hcalSuperClusterAlgo_.doClustering( clustersHandle, clustersHOHandle );
75 
76  if( verbose_ ) {
77  LogInfo("PFHCALSuperClusterProducer")
78  <<" superclusters --------------------------------- "<<endl
79  <<hcalSuperClusterAlgo_<<endl;
80  }
81 
82  // get clusters out of the clustering algorithm
83  // and put them in the event. There is no copy.
84  auto_ptr< vector<reco::PFCluster> > outClusters( hcalSuperClusterAlgo_.clusters() );
85  auto_ptr< vector<reco::PFSuperCluster> > outSuperClusters( hcalSuperClusterAlgo_.superClusters() );
86  iEvent.put( outClusters );
87  iEvent.put( outSuperClusters );
88 
89 }
std::auto_ptr< std::vector< reco::PFSuperCluster > > & superClusters()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const edm::PtrVector< reco::PFCluster > & clusters() const
PFHcalSuperClusterAlgo hcalSuperClusterAlgo_
clustering algorithm
void doClustering(const reco::PFClusterCollection &clusters, const reco::PFClusterCollection &clustersHO)
perform clustering

Member Data Documentation

PFHcalSuperClusterAlgo PFHCALSuperClusterProducer::hcalSuperClusterAlgo_
private

clustering algorithm

Definition at line 58 of file PFHCALSuperClusterProducer.h.

edm::InputTag PFHCALSuperClusterProducer::inputTagPFClusters_
private

Definition at line 65 of file PFHCALSuperClusterProducer.h.

edm::InputTag PFHCALSuperClusterProducer::inputTagPFClustersHO_
private

Definition at line 66 of file PFHCALSuperClusterProducer.h.

bool PFHCALSuperClusterProducer::verbose_
private

verbose ?

Definition at line 62 of file PFHCALSuperClusterProducer.h.