CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 cc = consumesCollector();
49  const std::vector<edm::ParameterSet>& importers = iConfig.getParameterSetVector("elementImporters");
50  pfBlockAlgo_.setImporters(importers, cc);
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
VParameterSet const & getParameterSetVector(std::string const &name) const
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDPutTokenT< reco::PFBlockCollection > putToken_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFBlockProducer(const edm::ParameterSet &)
tuple blocks
Definition: gather_cfg.py:90
Particle Flow Algorithm.
Definition: PFBlockAlgo.h:34
int iEvent
Definition: GenABIO.cc:224
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:59
void updateEventSetup(const edm::EventSetup &)
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
const bool verbose_
verbose ?
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Log< level::Info, false > LogInfo
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
reco::PFBlockCollection findBlocks()
build blocks
Producer for particle flow blocks.
void buildElements(const edm::Event &)
#define str(s)
void setLinkers(const std::vector< edm::ParameterSet > &)