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 }
void clusterize(const HFRecHitCollection &hf, const CaloGeometry &geom, reco::HFEMClusterShapeCollection &clusters, reco::SuperClusterCollection &SuperClusters)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void produce(edm::Event &e, edm::EventSetup const &iSetup) override
void beginRun(edm::Run const &, edm::EventSetup const &) final
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
HFEMClusterProducer(edm::ParameterSet const &conf)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::EDGetTokenT< HFRecHitCollection > hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:31
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45