CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HGCalMultiClusterProducer Class Reference
Inheritance diagram for HGCalMultiClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

 HGCalMultiClusterProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HGCalMultiClusterProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_sharing_token
 
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_token
 
bool doSharing
 
edm::EDGetTokenT< HGCRecHitCollectionhits_bh_token
 
edm::EDGetTokenT< HGCRecHitCollectionhits_ee_token
 
edm::EDGetTokenT< HGCRecHitCollectionhits_fh_token
 
std::unique_ptr< HGCal3DClusteringmulticluster_algo
 
HGCalClusteringAlgoBase::VerbosityLevel verbosity
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 22 of file HGCalMultiClusterProducer.cc.

Constructor & Destructor Documentation

◆ HGCalMultiClusterProducer()

HGCalMultiClusterProducer::HGCalMultiClusterProducer ( const edm::ParameterSet ps)

Definition at line 41 of file HGCalMultiClusterProducer.cc.

References clusters_sharing_token, clusters_token, edm::ParameterSet::getParameter(), hits_bh_token, hits_ee_token, hits_fh_token, PbPb_UPC_Monopole_cff::minClusters, and multicluster_algo.

42  : doSharing(ps.getParameter<bool>("doSharing")),
44  std::vector<double> multicluster_radii = ps.getParameter<std::vector<double>>("multiclusterRadii");
45  double minClusters = ps.getParameter<unsigned>("minClusters");
46  clusters_token = consumes<std::vector<reco::BasicCluster>>(ps.getParameter<edm::InputTag>("HGCLayerClusters"));
48  consumes<std::vector<reco::BasicCluster>>(ps.getParameter<edm::InputTag>("HGCLayerClustersSharing"));
49  hits_ee_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCEEInput"));
50  hits_fh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCFHInput"));
51  hits_bh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCBHInput"));
52  auto sumes = consumesCollector();
53 
54  multicluster_algo = std::make_unique<HGCal3DClustering>(ps, sumes, multicluster_radii, minClusters);
55 
56  produces<std::vector<reco::HGCalMultiCluster>>();
57  produces<std::vector<reco::HGCalMultiCluster>>("sharing");
58 }
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_token
edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_sharing_token
edm::EDGetTokenT< HGCRecHitCollection > hits_bh_token
T getUntrackedParameter(std::string const &, T const &) const
HGCalClusteringAlgoBase::VerbosityLevel verbosity
edm::EDGetTokenT< HGCRecHitCollection > hits_ee_token
std::unique_ptr< HGCal3DClustering > multicluster_algo

◆ ~HGCalMultiClusterProducer()

HGCalMultiClusterProducer::~HGCalMultiClusterProducer ( )
inlineoverride

Definition at line 25 of file HGCalMultiClusterProducer.cc.

25 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 60 of file HGCalMultiClusterProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

60  {
61  // hgcalMultiClusters
63  desc.add<edm::InputTag>("HGCLayerClusters", edm::InputTag("hgcalMergeLayerClusters"));
64  desc.addUntracked<unsigned int>("verbosity", 3);
65  desc.add<bool>("doSharing", false);
66  desc.add<edm::InputTag>("HGCEEInput", edm::InputTag("HGCalRecHit", "HGCEERecHits"));
67  desc.add<edm::InputTag>("HGCFHInput", edm::InputTag("HGCalRecHit", "HGCHEFRecHits"));
68  desc.add<std::vector<double>>("multiclusterRadii",
69  {
70  2.0,
71  5.0,
72  5.0,
73  });
74  desc.add<edm::InputTag>("HGCBHInput", edm::InputTag("HGCalRecHit", "HGCHEBRecHits"));
75  desc.add<edm::InputTag>("hgcalHitMap", {"recHitMapProducer", "hgcalRecHitMap"});
76  desc.add<edm::InputTag>("HGCLayerClustersSharing", edm::InputTag("hgcalMergeLayerClusters", "sharing"));
77  desc.add<unsigned int>("minClusters", 3);
78  descriptions.add("hgcalMultiClusters", desc);
79 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void HGCalMultiClusterProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 81 of file HGCalMultiClusterProducer.cc.

References clusters_sharing_token, clusters_token, doSharing, edm::Event::getByToken(), mps_fire::i, eostools::move(), multicluster_algo, edm::PtrVector< T >::push_back(), and edm::Event::put().

81  {
83  edm::Handle<std::vector<reco::BasicCluster>> clusterSharingHandle;
84 
85  evt.getByToken(clusters_token, clusterHandle);
86  if (doSharing)
87  evt.getByToken(clusters_sharing_token, clusterSharingHandle);
88 
89  edm::PtrVector<reco::BasicCluster> clusterPtrs, clusterPtrsSharing;
90  for (unsigned i = 0; i < clusterHandle->size(); ++i) {
91  edm::Ptr<reco::BasicCluster> ptr(clusterHandle, i);
92  clusterPtrs.push_back(ptr);
93  }
94 
95  if (doSharing) {
96  for (unsigned i = 0; i < clusterSharingHandle->size(); ++i) {
97  edm::Ptr<reco::BasicCluster> ptr(clusterSharingHandle, i);
98  clusterPtrsSharing.push_back(ptr);
99  }
100  }
101 
102  auto multiclusters = std::make_unique<std::vector<reco::HGCalMultiCluster>>();
103  auto multiclusters_sharing = std::make_unique<std::vector<reco::HGCalMultiCluster>>();
104 
105  multicluster_algo->getEvent(evt);
106  multicluster_algo->getEventSetup(es);
107 
108  *multiclusters = multicluster_algo->makeClusters(clusterPtrs);
109  if (doSharing)
110  *multiclusters_sharing = multicluster_algo->makeClusters(clusterPtrsSharing);
111  evt.put(std::move(multiclusters));
112  if (doSharing)
113  evt.put(std::move(multiclusters_sharing), "sharing");
114 }
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_token
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_sharing_token
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:152
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
std::unique_ptr< HGCal3DClustering > multicluster_algo
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ clusters_sharing_token

edm::EDGetTokenT<std::vector<reco::BasicCluster> > HGCalMultiClusterProducer::clusters_sharing_token
private

Definition at line 35 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ clusters_token

edm::EDGetTokenT<std::vector<reco::BasicCluster> > HGCalMultiClusterProducer::clusters_token
private

Definition at line 34 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ doSharing

bool HGCalMultiClusterProducer::doSharing
private

Definition at line 37 of file HGCalMultiClusterProducer.cc.

Referenced by produce().

◆ hits_bh_token

edm::EDGetTokenT<HGCRecHitCollection> HGCalMultiClusterProducer::hits_bh_token
private

Definition at line 33 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ hits_ee_token

edm::EDGetTokenT<HGCRecHitCollection> HGCalMultiClusterProducer::hits_ee_token
private

Definition at line 32 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ hits_fh_token

edm::EDGetTokenT<HGCRecHitCollection> HGCalMultiClusterProducer::hits_fh_token
private

Definition at line 31 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ multicluster_algo

std::unique_ptr<HGCal3DClustering> HGCalMultiClusterProducer::multicluster_algo
private

Definition at line 36 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ verbosity

HGCalClusteringAlgoBase::VerbosityLevel HGCalMultiClusterProducer::verbosity
private

Definition at line 38 of file HGCalMultiClusterProducer.cc.