CMS 3D CMS Logo

HFEMClusterProducer.cc
Go to the documentation of this file.
1 //Package: EgammaHFProdcers
2 // Class : HFEMClusterProducer
3 // Original Author: Kevin Klapoetke (minnesota)
4 //
5 // $Id: HFEMClusterProducer.cc,v 1.2 2007/09/19 Kevin Klapoetke
6 //
7 
15 
16 #include "HFClusterAlgo.h"
17 
19 public:
20  explicit HFEMClusterProducer(edm::ParameterSet const& conf);
21  void produce(edm::Event& e, edm::EventSetup const& iSetup) override;
22  void beginRun(edm::Run const&, edm::EventSetup const&) final { algo_.resetForRun(); }
23 
24 private:
28 };
29 
32 
33 using namespace reco;
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 }
49 
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 }
HFEMClusterProducer::produce
void produce(edm::Event &e, edm::EventSetup const &iSetup) override
Definition: HFEMClusterProducer.cc:50
Handle.h
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:86
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HFEMClusterProducer::geometryToken_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
Definition: HFEMClusterProducer.cc:26
geometry
Definition: geometry.py:1
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
HFEMClusterProducer::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) final
Definition: HFEMClusterProducer.cc:22
EDProducer.h
HFEMClusterProducer
Definition: HFEMClusterProducer.cc:18
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
BasicClusterFwd.h
edm::Ref
Definition: AssociativeIterator.h:58
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HFClusterAlgo.h
CaloGeometryRecord.h
HFClusterAlgo::resetForRun
void resetForRun()
Definition: HFClusterAlgo.cc:400
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
HFEMClusterProducer::algo_
HFClusterAlgo algo_
Definition: HFEMClusterProducer.cc:27
HFEMClusterProducer::HFEMClusterProducer
HFEMClusterProducer(edm::ParameterSet const &conf)
Definition: HFEMClusterProducer.cc:34
edm::stream::EDProducer
Definition: EDProducer.h:36
edm::EventSetup
Definition: EventSetup.h:58
edm::ESGetToken< CaloGeometry, CaloGeometryRecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HFClusterAlgo
Definition: HFClusterAlgo.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
HFEMClusterProducer::hfreco_
const edm::EDGetTokenT< HFRecHitCollection > hfreco_
Definition: HFEMClusterProducer.cc:25
EventSetup.h
HFClusterAlgo::isMC
void isMC(bool isMC)
Definition: HFClusterAlgo.h:31
ParameterSet.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37