CMS 3D CMS Logo

PixelClusterCountsAuditor.cc
Go to the documentation of this file.
7 
9 
11 
13 
14 namespace {
15  struct Empty {};
16 } // namespace
17 class PixelClusterCountsAuditor : public edm::global::EDAnalyzer<edm::LuminosityBlockCache<Empty>> {
18 public:
20 
21  void analyze(edm::StreamID id, edm::Event const&, edm::EventSetup const&) const final {}
22  std::shared_ptr<Empty> globalBeginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const final;
23 
24  void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const final;
25 
27 
28 private:
29  std::vector<edm::EDGetTokenT<reco::PixelClusterCounts>> tokens_;
30 };
31 
33  auto tags = iPSet.getUntrackedParameter<std::vector<edm::InputTag>>("counts");
34  tokens_.reserve(tags.size());
35  for (auto const& t : tags) {
36  tokens_.emplace_back(consumes<reco::PixelClusterCounts, edm::InLumi>(t));
37  }
38 }
41  desc.addUntracked<std::vector<edm::InputTag>>("counts")->setComment(
42  "Which PixelClusterCounts to retrieve from the LuminosityBlock");
43  iConfig.addDefault(desc);
44 }
45 
47  edm::EventSetup const&) const {
48  for (auto t : tokens_) {
49  auto h = iLumi.getHandle(t);
50  auto prov = h.provenance();
51  auto const& c = *h;
52  edm::LogSystem("PixelClusterCountsAudit")
53  .format("Branch: {}\n readCounts: {}\n readRocCounts: {}\n readEvents: {}\n readModID: {}\n readRocID: {}",
54  prov->branchName(),
55  c.readCounts().size(),
56  c.readRocCounts().size(),
57  c.readEvents().size(),
58  c.readModID().size(),
59  c.readRocID().size());
60  }
61  return {};
62 }
63 
65 
Log< level::System, false > LogSystem
std::shared_ptr< Empty > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const final
T getUntrackedParameter(std::string const &, T const &) const
std::vector< edm::EDGetTokenT< reco::PixelClusterCounts > > tokens_
static void fillDescriptions(edm::ConfigurationDescriptions &)
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const final
PixelClusterCountsAuditor(edm::ParameterSet const &iPSet)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void analyze(edm::StreamID id, edm::Event const &, edm::EventSetup const &) const final