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 
10 
11 // C++ stuff
12 #include <iostream>
13 
14 // CMSSW stuff
18 
19 // DQM Stuff
21 
23  SiPixelPhase1Base(iConfig)
24 {
25  srcToken_ = consumes<edm::DetSetVector<PixelDigi>>(iConfig.getParameter<edm::InputTag>("src"));
26 }
27 
29  if( !checktrigger(iEvent,iSetup,DCS) ) return;
30 
32  iEvent.getByToken(srcToken_, input);
33  if (!input.isValid()) return;
34  bool hasDigis=false;
35 
37  for (it = input->begin(); it != input->end(); ++it) {
38  for(PixelDigi const& digi : *it) {
39  hasDigis=true;
40  histo[ADC].fill((double) digi.adc(), DetId(it->detId()), &iEvent, digi.column(), digi.row());
41  histo[MAP].fill(DetId(it->detId()), &iEvent, digi.column(), digi.row());
42  histo[OCCUPANCY].fill(DetId(it->detId()), &iEvent, digi.column(), digi.row());
43  histo[NDIGIS ].fill(DetId(it->detId()), &iEvent); // count
44  histo[NDIGISINCLUSIVE].fill(DetId(it->detId()), &iEvent); // count
45  histo[NDIGIS_FED].fill(DetId(it->detId()), &iEvent);
46  histo[NDIGIS_FEDtrend].fill(DetId(it->detId()), &iEvent);
47  }
48  }
49  if (hasDigis) histo[EVENT].fill(DetId(0), &iEvent);
50  histo[NDIGIS ].executePerEventHarvesting(&iEvent);
51  histo[NDIGISINCLUSIVE].executePerEventHarvesting(&iEvent);
52  histo[NDIGIS_FED].executePerEventHarvesting(&iEvent);
53  histo[NDIGIS_FEDtrend].executePerEventHarvesting(&iEvent);
54 }
55 
57 
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
T getParameter(std::string const &) const
SiPixelPhase1Digis(const edm::ParameterSet &conf)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static std::string const input
Definition: EdmProvDump.cc:44
bool checktrigger(const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
int iEvent
Definition: GenABIO.cc:230
void analyze(const edm::Event &, const edm::EventSetup &) override
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
std::vector< HistogramManager > histo
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104