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 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 }
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
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void updateEventSetup(const edm::EventSetup &)
Definition: PFBlockAlgo.cc:275
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const bool verbose_
verbose ?
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Log< level::Info, false > LogInfo
reco::PFBlockCollection findBlocks()
build blocks
Definition: PFBlockAlgo.cc:139
HLT enums.
Producer for particle flow blocks.
void buildElements(const edm::Event &)
Definition: PFBlockAlgo.cc:284
#define str(s)