CMS 3D CMS Logo

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, CaloGeometryRecordgeometryToken_
 
const edm::EDGetTokenT< HFRecHitCollectionhfreco_
 

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::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 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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)

Member Function Documentation

◆ beginRun()

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(); }

◆ produce()

void HFEMClusterProducer::produce ( edm::Event e,
edm::EventSetup const &  iSetup 
)
override

Definition at line 50 of file HFEMClusterProducer.cc.

References algo_, HFClusterAlgo::clusterize(), MillePedeFileConverter_cfg::e, geometryToken_, edm::EventSetup::getData(), hfreco_, mps_fire::i, HFClusterAlgo::isMC(), and eostools::move().

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)
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
const edm::EDGetTokenT< HFRecHitCollection > hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:31
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

HFClusterAlgo HFEMClusterProducer::algo_
private

Definition at line 27 of file HFEMClusterProducer.cc.

Referenced by beginRun(), and produce().

◆ geometryToken_

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

Definition at line 26 of file HFEMClusterProducer.cc.

Referenced by produce().

◆ hfreco_

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

Definition at line 25 of file HFEMClusterProducer.cc.

Referenced by produce().