CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFBlockElementSuperClusterProducer.cc
Go to the documentation of this file.
9 
10 
13  = iConfig.getParameter<std::vector<edm::InputTag> >("ECALSuperClusters");
14 
15  outputName_ = iConfig.getParameter<std::string>("PFBESuperClusters");
16 
17  produces<reco::PFBlockElementSuperClusterCollection>(outputName_);
18 
19 }
20 
22 
24 
26  const edm::EventSetup& iSetup) {
27 
28  std::auto_ptr<reco::PFBlockElementSuperClusterCollection>
29  pfbeSuperClusters_p(new reco::PFBlockElementSuperClusterCollection);
30 
31 
32  for(unsigned icol=0; icol<inputTagSuperClusters_.size() ; ++icol) {
34  bool found=iEvent.getByLabel(inputTagSuperClusters_[icol],scH);
35  if(!found) {
36  std::ostringstream err;
37  err<<" cannot get SuperClusters: "
38  <<inputTagSuperClusters_[icol]<<std::endl;
39  edm::LogError("PFBlockElementSuperClusterProducer")<<err.str();
40  throw cms::Exception( "MissingProduct", err.str());
41  }
42 
43  unsigned nsc=scH->size();;
44 
45  for(unsigned isc=0;isc<nsc;++isc) {
46  reco::SuperClusterRef theRef(scH,isc);
47  reco::PFBlockElementSuperCluster myPFBE(theRef);
48  myPFBE.setTrackIso(0.);
49  myPFBE.setEcalIso(0.);
50  myPFBE.setHcalIso(0.);
51  myPFBE.setHoE(0.);
52  pfbeSuperClusters_p->push_back(myPFBE);
53  }
54  }
55  std::cout << "Size " << pfbeSuperClusters_p->size() << std::endl;
56  iEvent.put(pfbeSuperClusters_p,outputName_);
57 }
58 
T getParameter(std::string const &) const
void setHcalIso(float val)
set the had Iso
int iEvent
Definition: GenABIO.cc:243
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void setTrackIso(float val)
set the track Iso
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::vector< reco::PFBlockElementSuperCluster > PFBlockElementSuperClusterCollection
tuple cout
Definition: gather_cfg.py:41
void setEcalIso(float val)
set the ecal Iso
virtual void beginRun(edm::Run &run, const edm::EventSetup &c)
Definition: Run.h:31