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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 ( edm::ParameterSet const &  conf)
explicit

Definition at line 14 of file HFEMClusterProducer.cc.

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

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

Member Function Documentation

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

Definition at line 19 of file HFEMClusterProducer.h.

References algo_, and HFClusterAlgo::resetForRun().

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

Definition at line 29 of file HFEMClusterProducer.cc.

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

29  {
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 
45  algo_.clusterize(*hf_hits, *geometry, *retdata1, *retdata2);
48 
49  // put the results
50  ShapeHandle=e.put(std::move(retdata1));
51  SupHandle=e.put(std::move(retdata2));
52 
53  auto retdata3 = std::make_unique<HFEMClusterShapeAssociationCollection>(SupHandle, ShapeHandle);
54 
55  for (unsigned int i=0; i < ShapeHandle->size();i++){
57  }
58 
59 
60  e.put(std::move(retdata3));
61 
62 }
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:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
bool isRealData() const
Definition: EventBase.h:64
edm::EDGetToken hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:28
ESHandle< TrackerGeometry > geometry
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

HFClusterAlgo HFEMClusterProducer::algo_
private

Definition at line 22 of file HFEMClusterProducer.h.

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

edm::EDGetToken HFEMClusterProducer::hfreco_
private

Definition at line 21 of file HFEMClusterProducer.h.

Referenced by produce().