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

#include <PFECALSuperClusterProducer.h>

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

Public Member Functions

 PFECALSuperClusterProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~PFECALSuperClusterProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

PFECALSuperClusterAlgo::clustering_type _theclusteringtype
 
edm::InputTag inputTagPFClusters_
 
edm::InputTag inputTagPFClustersES_
 
std::string PFBasicClusterCollectionBarrel_
 
std::string PFBasicClusterCollectionEndcap_
 
std::string PFBasicClusterCollectionPreshower_
 
std::string PFSuperClusterCollectionBarrel_
 
std::string PFSuperClusterCollectionEndcap_
 
std::string PFSuperClusterCollectionEndcapWithPreshower_
 
PFECALSuperClusterAlgo superClusterAlgo_
 clustering algorithm More...
 
std::shared_ptr
< PFEnergyCalibration
thePFEnergyCalibration_
 
bool verbose_
 verbose ? More...
 

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
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
Nicolas Chanon Additional authors for Mustache: Y. Gershtein, R. Patel, L. Gray
Date
July 2012

Definition at line 34 of file PFECALSuperClusterProducer.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file PFECALSuperClusterProducer.cc.

References edm::hlt::Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), PFECALSuperClusterAlgo::kBOX, PFECALSuperClusterAlgo::kMustache, and AlCaHLTBitMon_QueryRunRegistry::string.

27 {
28 
29  verbose_ =
30  iConfig.getUntrackedParameter<bool>("verbose",false);
31 
32  std::string _typename = iConfig.getParameter<std::string>("ClusteringType");
33  if( _typename == ClusterType__BOX ) {
35  } else if ( _typename == ClusterType__Mustache ) {
37  } else {
38  throw cms::Exception("InvalidClusteringType")
39  << "You have not chosen a valid clustering type,"
40  << " please choose from \"Box\" or \"Mustache\"!";
41  }
42 
43 
44  // parameters for clustering
45 
46  bool useDynamicDPhi = iConfig.getParameter<bool>("useDynamicDPhiWindow");
47 
48  double threshPFClusterSeedBarrel = iConfig.getParameter<double>("thresh_PFClusterSeedBarrel");
49  double threshPFClusterBarrel = iConfig.getParameter<double>("thresh_PFClusterBarrel");
50 
51  double threshPFClusterSeedEndcap = iConfig.getParameter<double>("thresh_PFClusterSeedEndcap");
52  double threshPFClusterEndcap = iConfig.getParameter<double>("thresh_PFClusterEndcap");
53 
54  double phiwidthSuperClusterBarrel = iConfig.getParameter<double>("phiwidth_SuperClusterBarrel");
55  double etawidthSuperClusterBarrel = iConfig.getParameter<double>("etawidth_SuperClusterBarrel");
56 
57  double phiwidthSuperClusterEndcap = iConfig.getParameter<double>("phiwidth_SuperClusterEndcap");
58  double etawidthSuperClusterEndcap = iConfig.getParameter<double>("etawidth_SuperClusterEndcap");
59 
60  double threshPFClusterES = iConfig.getParameter<double>("thresh_PFClusterES");
61 
62  //double threshPFClusterMustacheOutBarrel = iConfig.getParameter<double>("thresh_PFClusterMustacheOutBarrel");
63  //double threshPFClusterMustacheOutEndcap = iConfig.getParameter<double>("thresh_PFClusterMustacheOutEndcap");
64 
65  double doSatelliteClusterMerge =
66  iConfig.getParameter<bool>("doSatelliteClusterMerge");
67  double satelliteClusterSeedThreshold =
68  iConfig.getParameter<double>("satelliteClusterSeedThreshold");
69  double satelliteMajorityFraction =
70  iConfig.getParameter<double>("satelliteMajorityFraction");
71 
74  superClusterAlgo_.setUseDynamicDPhi(useDynamicDPhi);
75 
76  superClusterAlgo_.setThreshPFClusterSeedBarrel( threshPFClusterSeedBarrel );
77  superClusterAlgo_.setThreshPFClusterBarrel( threshPFClusterBarrel );
78 
79  superClusterAlgo_.setThreshPFClusterSeedEndcap( threshPFClusterSeedEndcap );
80  superClusterAlgo_.setThreshPFClusterEndcap( threshPFClusterEndcap );
81 
82  superClusterAlgo_.setPhiwidthSuperClusterBarrel( phiwidthSuperClusterBarrel );
83  superClusterAlgo_.setEtawidthSuperClusterBarrel( etawidthSuperClusterBarrel );
84 
85  superClusterAlgo_.setPhiwidthSuperClusterEndcap( phiwidthSuperClusterEndcap );
86  superClusterAlgo_.setEtawidthSuperClusterEndcap( etawidthSuperClusterEndcap );
87 
88  superClusterAlgo_.setThreshPFClusterES( threshPFClusterES );
89 
90  superClusterAlgo_.setSatelliteMerging( doSatelliteClusterMerge );
91  superClusterAlgo_.setSatelliteThreshold( satelliteClusterSeedThreshold );
92  superClusterAlgo_.setMajorityFraction( satelliteMajorityFraction );
93  //superClusterAlgo_.setThreshPFClusterMustacheOutBarrel( threshPFClusterMustacheOutBarrel );
94  //superClusterAlgo_.setThreshPFClusterMustacheOutEndcap( threshPFClusterMustacheOutEndcap );
95 
96  //Load the ECAL energy calibration
98  std::shared_ptr<PFEnergyCalibration>(new PFEnergyCalibration());
100  superClusterAlgo_.setUsePS(iConfig.getParameter<bool>("use_preshower"));
101 
102  bool applyCrackCorrections_ = iConfig.getParameter<bool>("applyCrackCorrections");
103  superClusterAlgo_.setCrackCorrections(applyCrackCorrections_);
104 
105 
106 
107  inputTagPFClusters_ = iConfig.getParameter<InputTag>("PFClusters");
108  inputTagPFClustersES_ = iConfig.getParameter<InputTag>("PFClustersES");
109 
110  PFBasicClusterCollectionBarrel_ = iConfig.getParameter<string>("PFBasicClusterCollectionBarrel");
111  PFSuperClusterCollectionBarrel_ = iConfig.getParameter<string>("PFSuperClusterCollectionBarrel");
112 
113  PFBasicClusterCollectionEndcap_ = iConfig.getParameter<string>("PFBasicClusterCollectionEndcap");
114  PFSuperClusterCollectionEndcap_ = iConfig.getParameter<string>("PFSuperClusterCollectionEndcap");
115 
116  PFBasicClusterCollectionPreshower_ = iConfig.getParameter<string>("PFBasicClusterCollectionPreshower");
117  PFSuperClusterCollectionEndcapWithPreshower_ = iConfig.getParameter<string>("PFSuperClusterCollectionEndcapWithPreshower");
118 
119  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionBarrel_);
120  produces<reco::SuperClusterCollection>(PFSuperClusterCollectionEndcapWithPreshower_);
121 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setMajorityFraction(const double f)
void setSatelliteMerging(const bool doit)
void setThreshPFClusterSeedEndcap(double thresh)
PFECALSuperClusterAlgo::clustering_type _theclusteringtype
void setCrackCorrections(bool applyCrackCorrections)
void setThreshPFClusterBarrel(double thresh)
std::shared_ptr< PFEnergyCalibration > thePFEnergyCalibration_
void setEtawidthSuperClusterBarrel(double etawidth)
void setClusteringType(clustering_type thetype)
void setEtawidthSuperClusterEndcap(double etawidth)
void setPhiwidthSuperClusterBarrel(double phiwidth)
void setVerbosityLevel(bool verbose)
void setThreshPFClusterEndcap(double thresh)
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
void setThreshPFClusterSeedBarrel(double thresh)
void setUseDynamicDPhi(bool useit)
void setPhiwidthSuperClusterEndcap(double phiwidth)
void setThreshPFClusterES(double thresh)
void setSatelliteThreshold(const double t)
void setPFClusterCalibration(const std::shared_ptr< PFEnergyCalibration > &)
PFECALSuperClusterProducer::~PFECALSuperClusterProducer ( )

Definition at line 125 of file PFECALSuperClusterProducer.cc.

125 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 130 of file PFECALSuperClusterProducer.cc.

References edm::Event::getByLabel(), and edm::Event::put().

131  {
132 
133 
134  //Load the pfcluster collections
135  edm::Handle<edm::View<reco::PFCluster> > pfclustersHandle;
136  iEvent.getByLabel( inputTagPFClusters_, pfclustersHandle );
137 
138  edm::Handle<edm::View<reco::PFCluster> > preshowerpfclustersHandle;
139  iEvent.getByLabel( inputTagPFClustersES_, preshowerpfclustersHandle);
140 
141 
142  // do clustering
143  superClusterAlgo_.loadAndSortPFClusters(*pfclustersHandle,
144  *preshowerpfclustersHandle);
146 
147  //store in the event
152 }
std::auto_ptr< reco::SuperClusterCollection > getEEOutputSCCollection()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
PFECALSuperClusterAlgo superClusterAlgo_
clustering algorithm
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void loadAndSortPFClusters(const edm::View< reco::PFCluster > &ecalclusters, const edm::View< reco::PFCluster > &psclusters)
std::auto_ptr< reco::SuperClusterCollection > getEBOutputSCCollection()

Member Data Documentation

PFECALSuperClusterAlgo::clustering_type PFECALSuperClusterProducer::_theclusteringtype
private

Definition at line 49 of file PFECALSuperClusterProducer.h.

edm::InputTag PFECALSuperClusterProducer::inputTagPFClusters_
private

Definition at line 56 of file PFECALSuperClusterProducer.h.

edm::InputTag PFECALSuperClusterProducer::inputTagPFClustersES_
private

Definition at line 57 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionBarrel_
private

Definition at line 59 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionEndcap_
private

Definition at line 61 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFBasicClusterCollectionPreshower_
private

Definition at line 63 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionBarrel_
private

Definition at line 60 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcap_
private

Definition at line 62 of file PFECALSuperClusterProducer.h.

std::string PFECALSuperClusterProducer::PFSuperClusterCollectionEndcapWithPreshower_
private

Definition at line 64 of file PFECALSuperClusterProducer.h.

PFECALSuperClusterAlgo PFECALSuperClusterProducer::superClusterAlgo_
private

clustering algorithm

Definition at line 48 of file PFECALSuperClusterProducer.h.

std::shared_ptr<PFEnergyCalibration> PFECALSuperClusterProducer::thePFEnergyCalibration_
private

Definition at line 51 of file PFECALSuperClusterProducer.h.

bool PFECALSuperClusterProducer::verbose_
private

verbose ?

Definition at line 54 of file PFECALSuperClusterProducer.h.