CMS 3D CMS Logo

PFBlockProducer.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 using namespace edm;
5 
7  verbose_{ iConfig.getUntrackedParameter<bool>("verbose",false)},
8  putToken_{produces<reco::PFBlockCollection>()}
9 {
10  bool debug_ =
11  iConfig.getUntrackedParameter<bool>("debug",false);
12  pfBlockAlgo_.setDebug(debug_);
13 
14  edm::ConsumesCollector coll = consumesCollector();
15  const std::vector<edm::ParameterSet>& importers
16  = iConfig.getParameterSetVector("elementImporters");
17  pfBlockAlgo_.setImporters(importers,coll);
18 
19  const std::vector<edm::ParameterSet>& linkdefs
20  = iConfig.getParameterSetVector("linkDefinitions");
21  pfBlockAlgo_.setLinkers(linkdefs);
22 
23 }
24 
25 
26 
28 
29 
32  edm::EventSetup const& es) {
34 }
35 
36 void
38  const EventSetup& iSetup) {
39 
41 
43 
44  if(verbose_) {
45  ostringstream str;
46  str<<pfBlockAlgo_<<endl;
47  str<<"number of blocks : "<<blocks.size()<<endl;
48  str<<endl;
49 
50  for(auto const& block : blocks) {
51  str<< block <<endl;
52  }
53 
54  LogInfo("PFBlockProducer") << str.str()<<endl;
55  }
56 
57  iEvent.emplace(putToken_,blocks);
58 
59 }
T getUntrackedParameter(std::string const &, T const &) const
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDPutTokenT< reco::PFBlockCollection > putToken_
PFBlockProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:63
void updateEventSetup(const edm::EventSetup &)
Definition: PFBlockAlgo.cc:290
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
Definition: PFBlockAlgo.cc:132
~PFBlockProducer() override
const bool verbose_
verbose ?
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
JetCorrectorParametersCollection coll
Definition: classes.h:10
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:413
reco::PFBlockCollection findBlocks()
build blocks
Definition: PFBlockAlgo.cc:151
HLT enums.
void buildElements(const edm::Event &)
Definition: PFBlockAlgo.cc:299
#define str(s)
void setLinkers(const std::vector< edm::ParameterSet > &)
Definition: PFBlockAlgo.cc:86