CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HFEMClusterProducer Class Reference
Inheritance diagram for HFEMClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) final
 
 HFEMClusterProducer (edm::ParameterSet const &conf)
 
void produce (edm::Event &e, edm::EventSetup const &iSetup) 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
 

Private Attributes

HFClusterAlgo algo_
 
const edm::ESGetToken
< CaloGeometry,
CaloGeometryRecord
geometryToken_
 
const edm::EDGetTokenT
< HFRecHitCollection
hfreco_
 

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 18 of file HFEMClusterProducer.cc.

Constructor & Destructor Documentation

HFEMClusterProducer::HFEMClusterProducer ( edm::ParameterSet const &  conf)
explicit

Definition at line 34 of file HFEMClusterProducer.cc.

References DeDxTools::esConsumes().

35  : hfreco_(consumes(conf.getParameter<edm::InputTag>("hits"))), geometryToken_{esConsumes()} {
36  produces<reco::HFEMClusterShapeCollection>();
37  produces<reco::BasicClusterCollection>();
38  produces<reco::SuperClusterCollection>();
39  produces<reco::HFEMClusterShapeAssociationCollection>();
40  algo_.setup(conf.getParameter<double>("minTowerEnergy"),
41  conf.getParameter<double>("seedThresholdET"),
42  conf.getParameter<double>("maximumSL"),
43  conf.getParameter<double>("maximumRenergy"),
44  conf.getParameter<bool>("usePMTFlag"),
45  conf.getParameter<bool>("usePulseFlag"),
46  conf.getParameter<bool>("forcePulseFlagMC"),
47  conf.getParameter<int>("correctionType"));
48 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
const edm::EDGetTokenT< HFRecHitCollection > hfreco_
void setup(double minTowerEnergy, double seedThreshold, double maximumSL, double m_maximumRenergy, bool usePMTflag, bool usePulseflag, bool forcePulseFlagMC, int correctionSet)
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283

Member Function Documentation

void HFEMClusterProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlinefinal

Definition at line 22 of file HFEMClusterProducer.cc.

References algo_, and HFClusterAlgo::resetForRun().

22 { algo_.resetForRun(); }
void HFEMClusterProducer::produce ( edm::Event e,
edm::EventSetup const &  iSetup 
)
override

Definition at line 50 of file HFEMClusterProducer.cc.

References algo_, HFClusterAlgo::clusterize(), relativeConstraints::geometry, geometryToken_, edm::Event::get(), edm::EventSetup::getData(), hfreco_, mps_fire::i, HFClusterAlgo::isMC(), edm::EventBase::isRealData(), eostools::move(), and edm::Event::put().

50  {
51  auto const& hf_hits = e.get(hfreco_);
52  auto const& geometry = iSetup.getData(geometryToken_);
53 
54  // create return data
55  auto retdata1 = std::make_unique<HFEMClusterShapeCollection>();
56  auto retdata2 = std::make_unique<SuperClusterCollection>();
57 
58  algo_.isMC(!e.isRealData());
59 
60  algo_.clusterize(hf_hits, geometry, *retdata1, *retdata2);
63 
64  // put the results
65  ShapeHandle = e.put(std::move(retdata1));
66  SupHandle = e.put(std::move(retdata2));
67 
68  auto retdata3 = std::make_unique<HFEMClusterShapeAssociationCollection>(SupHandle, ShapeHandle);
69 
70  for (unsigned int i = 0; i < ShapeHandle->size(); i++) {
71  retdata3->insert(edm::Ref<reco::SuperClusterCollection>(SupHandle, i),
73  }
74 
75  e.put(std::move(retdata3));
76 }
void clusterize(const HFRecHitCollection &hf, const CaloGeometry &geom, reco::HFEMClusterShapeCollection &clusters, reco::SuperClusterCollection &SuperClusters)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
bool isRealData() const
Definition: EventBase.h:62
def move
Definition: eostools.py:511
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
const edm::EDGetTokenT< HFRecHitCollection > hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:31

Member Data Documentation

HFClusterAlgo HFEMClusterProducer::algo_
private

Definition at line 27 of file HFEMClusterProducer.cc.

Referenced by beginRun(), and produce().

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HFEMClusterProducer::geometryToken_
private

Definition at line 26 of file HFEMClusterProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<HFRecHitCollection> HFEMClusterProducer::hfreco_
private

Definition at line 25 of file HFEMClusterProducer.cc.

Referenced by produce().