CMS 3D CMS Logo

PFBlockProducer.cc
Go to the documentation of this file.
7 
19 class FSimEvent;
20 
22 public:
23  explicit PFBlockProducer(const edm::ParameterSet&);
24 
25  void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
26 
27  void produce(edm::Event&, const edm::EventSetup&) override;
28 
29 private:
31  const bool verbose_;
33 
36 };
37 
39 
40 using namespace std;
41 using namespace edm;
42 
44  : verbose_{iConfig.getUntrackedParameter<bool>("verbose", false)}, putToken_{produces<reco::PFBlockCollection>()} {
45  bool debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
46  pfBlockAlgo_.setDebug(debug_);
47 
48  edm::ConsumesCollector coll = consumesCollector();
49  const std::vector<edm::ParameterSet>& importers = iConfig.getParameterSetVector("elementImporters");
50  pfBlockAlgo_.setImporters(importers, coll);
51 
52  const std::vector<edm::ParameterSet>& linkdefs = iConfig.getParameterSetVector("linkDefinitions");
53  pfBlockAlgo_.setLinkers(linkdefs);
54 }
55 
58 }
59 
62 
64 
65  if (verbose_) {
66  ostringstream str;
67  str << pfBlockAlgo_ << endl;
68  str << "number of blocks : " << blocks.size() << endl;
69  str << endl;
70 
71  for (auto const& block : blocks) {
72  str << block << endl;
73  }
74 
75  LogInfo("PFBlockProducer") << str.str() << endl;
76  }
77 
78  iEvent.emplace(putToken_, blocks);
79 }
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 &)
Particle Flow Algorithm.
Definition: PFBlockAlgo.h:34
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:59
void updateEventSetup(const edm::EventSetup &)
Definition: PFBlockAlgo.cc:277
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
Definition: PFBlockAlgo.cc:126
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:421
reco::PFBlockCollection findBlocks()
build blocks
Definition: PFBlockAlgo.cc:141
HLT enums.
Producer for particle flow blocks.
void buildElements(const edm::Event &)
Definition: PFBlockAlgo.cc:286
#define str(s)
void setLinkers(const std::vector< edm::ParameterSet > &)
Definition: PFBlockAlgo.cc:86