CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFEMClusterProducer Class Reference

#include <HFEMClusterProducer.h>

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

HFClusterAlgo algo_
 
edm::EDGetToken hfreco_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 15 of file HFEMClusterProducer.h.

Constructor & Destructor Documentation

◆ HFEMClusterProducer()

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

Definition at line 14 of file HFEMClusterProducer.cc.

15  : hfreco_(consumes<HFRecHitCollection>(conf.getParameter<edm::InputTag>("hits"))) {
16  produces<reco::HFEMClusterShapeCollection>();
17  produces<reco::BasicClusterCollection>();
18  produces<reco::SuperClusterCollection>();
19  produces<reco::HFEMClusterShapeAssociationCollection>();
20  algo_.setup(conf.getParameter<double>("minTowerEnergy"),
21  conf.getParameter<double>("seedThresholdET"),
22  conf.getParameter<double>("maximumSL"),
23  conf.getParameter<double>("maximumRenergy"),
24  conf.getParameter<bool>("usePMTFlag"),
25  conf.getParameter<bool>("usePulseFlag"),
26  conf.getParameter<bool>("forcePulseFlagMC"),
27  conf.getParameter<int>("correctionType"));
28 }

References algo_, edm::ParameterSet::getParameter(), and HFClusterAlgo::setup().

Member Function Documentation

◆ beginRun()

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

Definition at line 19 of file HFEMClusterProducer.h.

19 { algo_.resetForRun(); }

References algo_, and HFClusterAlgo::resetForRun().

◆ produce()

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

Definition at line 30 of file HFEMClusterProducer.cc.

30  {
32 
33  e.getByToken(hfreco_, hf_hits);
34 
36  iSetup.get<CaloGeometryRecord>().get(geometry);
37 
38  // create return data
39  auto retdata1 = std::make_unique<HFEMClusterShapeCollection>();
40  auto retdata2 = std::make_unique<SuperClusterCollection>();
41 
42  algo_.isMC(!e.isRealData());
43 
44  algo_.clusterize(*hf_hits, *geometry, *retdata1, *retdata2);
47 
48  // put the results
49  ShapeHandle = e.put(std::move(retdata1));
50  SupHandle = e.put(std::move(retdata2));
51 
52  auto retdata3 = std::make_unique<HFEMClusterShapeAssociationCollection>(SupHandle, ShapeHandle);
53 
54  for (unsigned int i = 0; i < ShapeHandle->size(); i++) {
55  retdata3->insert(edm::Ref<reco::SuperClusterCollection>(SupHandle, i),
57  }
58 
59  e.put(std::move(retdata3));
60 }

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

Member Data Documentation

◆ algo_

HFClusterAlgo HFEMClusterProducer::algo_
private

Definition at line 23 of file HFEMClusterProducer.h.

Referenced by beginRun(), HFEMClusterProducer(), and produce().

◆ hfreco_

edm::EDGetToken HFEMClusterProducer::hfreco_
private

Definition at line 22 of file HFEMClusterProducer.h.

Referenced by produce().

geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
mps_fire.i
i
Definition: mps_fire.py:428
HFClusterAlgo::clusterize
void clusterize(const HFRecHitCollection &hf, const CaloGeometry &geom, reco::HFEMClusterShapeCollection &clusters, reco::SuperClusterCollection &SuperClusters)
Definition: HFClusterAlgo.cc:89
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
geometry
Definition: geometry.py:1
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
edm::ESHandle< CaloGeometry >
HFClusterAlgo::setup
void setup(double minTowerEnergy, double seedThreshold, double maximumSL, double m_maximumRenergy, bool usePMTflag, bool usePulseflag, bool forcePulseFlagMC, int correctionSet)
Definition: HFClusterAlgo.cc:40
HFEMClusterProducer::hfreco_
edm::EDGetToken hfreco_
Definition: HFEMClusterProducer.h:22
HFClusterAlgo::resetForRun
void resetForRun()
Definition: HFClusterAlgo.cc:403
HFEMClusterProducer::algo_
HFClusterAlgo algo_
Definition: HFEMClusterProducer.h:23
get
#define get
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
HFClusterAlgo::isMC
void isMC(bool isMC)
Definition: HFClusterAlgo.h:35
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37