test
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;
14 HFEMClusterProducer::HFEMClusterProducer(edm::ParameterSet const& conf): 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 }
28 
30 
32 
33  e.getByToken(hfreco_,hf_hits);
34 
36  iSetup.get<CaloGeometryRecord>().get(geometry);
37 
38  // create return data
39  std::auto_ptr<reco::HFEMClusterShapeCollection> retdata1(new HFEMClusterShapeCollection());
40  std::auto_ptr<reco::SuperClusterCollection> retdata2(new 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(retdata1);
51  SupHandle=e.put(retdata2);
52 
53  std::auto_ptr<reco::HFEMClusterShapeAssociationCollection> retdata3(
54  new HFEMClusterShapeAssociationCollection(SupHandle, ShapeHandle));
55 
56  for (unsigned int i=0; i < ShapeHandle->size();i++){
58  }
59 
60 
61  e.put(retdata3);
62 
63 }
virtual void produce(edm::Event &e, edm::EventSetup const &iSetup)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
void clusterize(const HFRecHitCollection &hf, const CaloGeometry &geom, reco::HFEMClusterShapeCollection &clusters, reco::SuperClusterCollection &SuperClusters)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< HFEMClusterShape > HFEMClusterShapeCollection
bool isRealData() const
Definition: EventBase.h:63
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
HFEMClusterProducer(edm::ParameterSet const &conf)
edm::AssociationMap< edm::OneToOne< SuperClusterCollection, HFEMClusterShapeCollection > > HFEMClusterShapeAssociationCollection
const T & get() const
Definition: EventSetup.h:56
edm::EDGetToken hfreco_
void isMC(bool isMC)
Definition: HFClusterAlgo.h:28
ESHandle< TrackerGeometry > geometry
void setup(double minTowerEnergy, double seedThreshold, double maximumSL, double m_maximumRenergy, bool usePMTflag, bool usePulseflag, bool forcePulseFlagMC, int correctionSet)