CMS 3D CMS Logo

SiPixelPhase1Digis.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1Digis
4 // Class: SiPixelPhase1Digis
5 //
6 
7 // Original Author: Marcel Schneider
8 
9 // C++ stuff
10 #include <iostream>
11 
12 // CMSSW stuff
16 
17 // DQM Stuff
19 
20 // Input data stuff
23 
24 // PixelDQM Framework
26 
27 namespace {
28 
29 class SiPixelPhase1Digis final : public SiPixelPhase1Base {
30  // List of quantities to be plotted.
31  enum {
32  ADC, // digi ADC readouts
33  NDIGIS, // number of digis per event and module
34  NDIGISINCLUSIVE, //Total number of digis in BPix and FPix
35  NDIGIS_FED, // number of digis per event and FED
36  NDIGIS_FEDtrend, // number of digis per event and FED
37  EVENT, // event frequency
38  MAP, // digi hitmap per module
39  OCCUPANCY, // like map but coarser
40 
41  MAX_HIST // a sentinel that gives the number of quantities (not a plot).
42  };
43  public:
44  explicit SiPixelPhase1Digis(const edm::ParameterSet& conf);
45 
46  void analyze(const edm::Event&, const edm::EventSetup&) override ;
47 
48  private:
50 
51 };
52 
53 SiPixelPhase1Digis::SiPixelPhase1Digis(const edm::ParameterSet& iConfig) :
54  SiPixelPhase1Base(iConfig)
55 {
56  srcToken_ = consumes<edm::DetSetVector<PixelDigi>>(iConfig.getParameter<edm::InputTag>("src"));
57 }
58 
60  if( !checktrigger(iEvent,iSetup,DCS) ) return;
61 
63  iEvent.getByToken(srcToken_, input);
64  if (!input.isValid()) return;
65  bool hasDigis=false;
66 
68  for (it = input->begin(); it != input->end(); ++it) {
69  for(PixelDigi const& digi : *it) {
70  hasDigis=true;
71  histo[ADC].fill((double) digi.adc(), DetId(it->detId()), &iEvent, digi.column(), digi.row());
72  histo[MAP].fill(DetId(it->detId()), &iEvent, digi.column(), digi.row());
73  histo[OCCUPANCY].fill(DetId(it->detId()), &iEvent, digi.column(), digi.row());
74  histo[NDIGIS ].fill(DetId(it->detId()), &iEvent); // count
75  histo[NDIGISINCLUSIVE].fill(DetId(it->detId()), &iEvent); // count
76  histo[NDIGIS_FED].fill(DetId(it->detId()), &iEvent);
77  histo[NDIGIS_FEDtrend].fill(DetId(it->detId()), &iEvent);
78  }
79  }
80  if (hasDigis) histo[EVENT].fill(DetId(0), &iEvent);
81  histo[NDIGIS ].executePerEventHarvesting(&iEvent);
82  histo[NDIGISINCLUSIVE].executePerEventHarvesting(&iEvent);
83  histo[NDIGIS_FED].executePerEventHarvesting(&iEvent);
84  histo[NDIGIS_FEDtrend].executePerEventHarvesting(&iEvent);
85 }
86 
87 } //namespace
88 
89 DEFINE_FWK_MODULE(SiPixelPhase1Digis);
90 
T getParameter(std::string const &) const
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static std::string const input
Definition: EdmProvDump.cc:44
int iEvent
Definition: GenABIO.cc:230
bool isValid() const
Definition: HandleBase.h:74
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override=0
Definition: DetId.h:18
struct ADC ADC
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104