CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
8 #include <iostream>
13 using namespace reco;
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 }
29 
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 }
T getParameter(std::string const &) const
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:131
void produce(edm::Event &e, edm::EventSetup const &iSetup) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool isRealData() const
Definition: EventBase.h:62
HFEMClusterProducer(edm::ParameterSet const &conf)
edm::EDGetToken hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:35
ESHandle< TrackerGeometry > geometry
fixed size matrix
HLT enums.
T get() const
Definition: EventSetup.h:73
void setup(double minTowerEnergy, double seedThreshold, double maximumSL, double m_maximumRenergy, bool usePMTflag, bool usePulseflag, bool forcePulseFlagMC, int correctionSet)
def move(src, dest)
Definition: eostools.py:511