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 30 of file HGCalMultiClusterProducer.cc.

Constructor & Destructor Documentation

◆ HGCalMultiClusterProducer()

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

Definition at line 51 of file HGCalMultiClusterProducer.cc.

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

52  : doSharing(ps.getParameter<bool>("doSharing")),
54  std::vector<double> multicluster_radii = ps.getParameter<std::vector<double>>("multiclusterRadii");
55  double minClusters = ps.getParameter<unsigned>("minClusters");
56  clusters_token = consumes<std::vector<reco::BasicCluster>>(ps.getParameter<edm::InputTag>("HGCLayerClusters"));
58  consumes<std::vector<reco::BasicCluster>>(ps.getParameter<edm::InputTag>("HGCLayerClustersSharing"));
59  hits_ee_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCEEInput"));
60  hits_fh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCFHInput"));
61  hits_bh_token = consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("HGCBHInput"));
62  auto sumes = consumesCollector();
63 
64  multicluster_algo = std::make_unique<HGCal3DClustering>(ps, sumes, multicluster_radii, minClusters);
65 
66  produces<std::vector<reco::HGCalMultiCluster>>();
67  produces<std::vector<reco::HGCalMultiCluster>>("sharing");
68 }
edm::EDGetTokenT< std::vector< reco::BasicCluster > > clusters_token
edm::EDGetTokenT< HGCRecHitCollection > hits_fh_token
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 33 of file HGCalMultiClusterProducer.cc.

33 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 70 of file HGCalMultiClusterProducer.cc.

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

70  {
71  // hgcalMultiClusters
73  desc.add<edm::InputTag>("HGCLayerClusters", edm::InputTag("hgcalLayerClusters"));
74  desc.addUntracked<unsigned int>("verbosity", 3);
75  desc.add<bool>("doSharing", false);
76  desc.add<edm::InputTag>("HGCEEInput", edm::InputTag("HGCalRecHit", "HGCEERecHits"));
77  desc.add<edm::InputTag>("HGCFHInput", edm::InputTag("HGCalRecHit", "HGCHEFRecHits"));
78  desc.add<std::vector<double>>("multiclusterRadii",
79  {
80  2.0,
81  5.0,
82  5.0,
83  });
84  desc.add<edm::InputTag>("HGCBHInput", edm::InputTag("HGCalRecHit", "HGCHEBRecHits"));
85  desc.add<edm::InputTag>("HGCLayerClustersSharing", edm::InputTag("hgcalLayerClusters", "sharing"));
86  desc.add<unsigned int>("minClusters", 3);
87  descriptions.add("hgcalMultiClusters", desc);
88 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 90 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().

90  {
92  edm::Handle<std::vector<reco::BasicCluster>> clusterSharingHandle;
93 
94  evt.getByToken(clusters_token, clusterHandle);
95  if (doSharing)
96  evt.getByToken(clusters_sharing_token, clusterSharingHandle);
97 
98  edm::PtrVector<reco::BasicCluster> clusterPtrs, clusterPtrsSharing;
99  for (unsigned i = 0; i < clusterHandle->size(); ++i) {
100  edm::Ptr<reco::BasicCluster> ptr(clusterHandle, i);
101  clusterPtrs.push_back(ptr);
102  }
103 
104  if (doSharing) {
105  for (unsigned i = 0; i < clusterSharingHandle->size(); ++i) {
106  edm::Ptr<reco::BasicCluster> ptr(clusterSharingHandle, i);
107  clusterPtrsSharing.push_back(ptr);
108  }
109  }
110 
111  auto multiclusters = std::make_unique<std::vector<reco::HGCalMultiCluster>>();
112  auto multiclusters_sharing = std::make_unique<std::vector<reco::HGCalMultiCluster>>();
113 
114  multicluster_algo->getEvent(evt);
115  multicluster_algo->getEventSetup(es);
116 
117  *multiclusters = multicluster_algo->makeClusters(clusterPtrs);
118  if (doSharing)
119  *multiclusters_sharing = multicluster_algo->makeClusters(clusterPtrsSharing);
120  evt.put(std::move(multiclusters));
121  if (doSharing)
122  evt.put(std::move(multiclusters_sharing), "sharing");
123 }
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:149
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:540
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 43 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ clusters_token

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

Definition at line 42 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ doSharing

bool HGCalMultiClusterProducer::doSharing
private

Definition at line 45 of file HGCalMultiClusterProducer.cc.

Referenced by produce().

◆ hits_bh_token

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

Definition at line 41 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ hits_ee_token

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

Definition at line 40 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ hits_fh_token

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

Definition at line 39 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer().

◆ multicluster_algo

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

Definition at line 44 of file HGCalMultiClusterProducer.cc.

Referenced by HGCalMultiClusterProducer(), and produce().

◆ verbosity

HGCalClusteringAlgoBase::VerbosityLevel HGCalMultiClusterProducer::verbosity
private

Definition at line 46 of file HGCalMultiClusterProducer.cc.