CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SiPixelRawDataErrorSource Class Reference

#include <SiPixelRawDataErrorSource.h>

Inheritance diagram for SiPixelRawDataErrorSource:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Types

typedef edm::DetSet
< SiPixelRawDataError >
::const_iterator 
ErrorIterator
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void bookMEs (DQMStore::IBooker &)
 
virtual void buildStructure (edm::EventSetup const &)
 
void dqmBeginRun (const edm::Run &, edm::EventSetup const &) override
 
 SiPixelRawDataErrorSource (const edm::ParameterSet &conf)
 
 ~SiPixelRawDataErrorSource () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

bool bladeOn
 
MonitorElementbyLumiErrors
 
edm::ParameterSet conf_
 
MonitorElementerrorRate
 
int eventNo
 
MonitorElementfedcounter
 
bool firstRun
 
edm::EDGetTokenT
< FEDRawDataCollection
inputSourceToken_
 
bool isPIB
 
bool isUpgrade
 
bool ladOn
 
MonitorElementmeErrorType_ [40]
 
MonitorElementmeEvtNbr_ [40]
 
MonitorElementmeEvtSize_ [40]
 
MonitorElementmeFedChLErr_ [40]
 
MonitorElementmeFedChNErr_ [40]
 
MonitorElementmeFedETypeNErr_ [40]
 
MonitorElementmeFullType_ [40]
 
std::map< std::string,
MonitorElement ** > 
meMapFEDs_
 
MonitorElementmeNErrors_ [40]
 
MonitorElementmeTBMMessage_ [40]
 
MonitorElementmeTBMType_ [40]
 
bool modOn
 
bool reducedSet
 
bool saveFile
 
bool slowDown
 
edm::EDGetTokenT
< edm::DetSetVector
< SiPixelRawDataError > > 
src_
 
std::map< uint32_t,
SiPixelRawDataErrorModule * > 
theFEDStructure
 
std::map< uint32_t,
SiPixelRawDataErrorModule * > 
thePixelStructure
 
std::string topFolderName_
 
edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
trackerGeomTokenBeginRun_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
trackerTopoTokenBeginRun_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: Produces histograms for error information generated at the raw2digi stage for the pixel tracker.

Usage: Takes a DetSetVector<SiPixelRawDataError> as input, and uses it to populate a folder hierarchy (organized by detId) with histograms containing information about the errors. Uses SiPixelRawDataErrorModule class to book and fill individual folders. Note that this source is different than other DQM sources in the creation of an unphysical detId folder (detId=0xffffffff) to hold information about errors for which there is no detId available (except the dummy detId given to it at raw2digi).

Definition at line 41 of file SiPixelRawDataErrorSource.h.

Member Typedef Documentation

Definition at line 46 of file SiPixelRawDataErrorSource.h.

Constructor & Destructor Documentation

SiPixelRawDataErrorSource::SiPixelRawDataErrorSource ( const edm::ParameterSet conf)
explicit

Definition at line 53 of file SiPixelRawDataErrorSource.cc.

References conf_, firstRun, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputSourceToken_, AlCaHLTBitMon_QueryRunRegistry::string, topFolderName_, trackerGeomTokenBeginRun_, and trackerTopoTokenBeginRun_.

54  : conf_(iConfig),
56  saveFile(conf_.getUntrackedParameter<bool>("saveFile", false)),
57  isPIB(conf_.getUntrackedParameter<bool>("isPIB", false)),
58  slowDown(conf_.getUntrackedParameter<bool>("slowDown", false)),
59  reducedSet(conf_.getUntrackedParameter<bool>("reducedSet", false)),
60  modOn(conf_.getUntrackedParameter<bool>("modOn", true)),
61  ladOn(conf_.getUntrackedParameter<bool>("ladOn", false)),
62  bladeOn(conf_.getUntrackedParameter<bool>("bladeOn", false)),
63  isUpgrade(conf_.getUntrackedParameter<bool>("isUpgrade", false)) {
64  firstRun = true;
65  LogInfo("PixelDQM") << "SiPixelRawDataErrorSource::SiPixelRawDataErrorSource:"
66  " Got DQM BackEnd interface"
67  << endl;
68  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
69  inputSourceToken_ = consumes<FEDRawDataCollection>(conf_.getUntrackedParameter<string>("inputSource", "source"));
70  trackerTopoTokenBeginRun_ = esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>();
71  trackerGeomTokenBeginRun_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>();
72 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > src_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
Log< level::Info, false > LogInfo
edm::EDGetTokenT< FEDRawDataCollection > inputSourceToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoTokenBeginRun_
SiPixelRawDataErrorSource::~SiPixelRawDataErrorSource ( )
override

Definition at line 74 of file SiPixelRawDataErrorSource.cc.

74  {
75  // do anything here that needs to be done at desctruction time
76  // (e.g. close files, deallocate resources etc.)
77  LogInfo("PixelDQM") << "SiPixelRawDataErrorSource::~SiPixelRawDataErrorSource: Destructor" << endl;
78 }
Log< level::Info, false > LogInfo

Member Function Documentation

void SiPixelRawDataErrorSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 104 of file SiPixelRawDataErrorSource.cc.

References bladeOn, byLumiErrors, FEDRawData::data(), errorRate, eventNo, fedcounter, FEDRawDataCollection::FEDData(), dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), mps_fire::i, input, inputSourceToken_, edm::HandleBase::isValid(), ladOn, edm::EventBase::luminosityBlock(), meMapFEDs_, modOn, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, dqm::impl::MonitorElement::setBinContent(), FEDRawData::size(), slowDown, src_, DetId::subdetId(), theFEDStructure, and thePixelStructure.

104  {
105  eventNo++;
106  // check feds in readout
107  if (eventNo == 1) {
108  // check if any Pixel FED is in readout:
109  edm::Handle<FEDRawDataCollection> rawDataHandle;
110  iEvent.getByToken(inputSourceToken_, rawDataHandle);
111  if (!rawDataHandle.isValid()) {
112  edm::LogInfo("SiPixelRawDataErrorSource") << "inputsource is empty";
113  } else {
114  const FEDRawDataCollection &rawDataCollection = *rawDataHandle;
115  for (int i = 0; i != 40; i++) {
116  if (rawDataCollection.FEDData(i).size() && rawDataCollection.FEDData(i).data())
117  fedcounter->setBinContent(i + 1, 1);
118  }
119  }
120  }
121  // get input data
123  iEvent.getByToken(src_, input);
124  if (!input.isValid())
125  return;
126 
127  int lumiSection = (int)iEvent.luminosityBlock();
128 
129  int nEventBPIXModuleErrors = 0;
130  int nEventFPIXModuleErrors = 0;
131  int nEventBPIXFEDErrors = 0;
132  int nEventFPIXFEDErrors = 0;
133  int nErrors = 0;
134 
135  std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter;
136  std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter2;
137  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
138  int numberOfModuleErrors = (*struct_iter).second->fill(*input, &meMapFEDs_, modOn, ladOn, bladeOn);
139  if (DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel))
140  nEventBPIXModuleErrors = nEventBPIXModuleErrors + numberOfModuleErrors;
141  if (DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap))
142  nEventFPIXModuleErrors = nEventFPIXModuleErrors + numberOfModuleErrors;
143  // cout<<"NErrors: "<<nEventBPIXModuleErrors<<"
144  // "<<nEventFPIXModuleErrors<<endl;
145  nErrors = nErrors + numberOfModuleErrors;
146  // if(nErrors>0) cout<<"MODULES: nErrors: "<<nErrors<<endl;
147  }
148  for (struct_iter2 = theFEDStructure.begin(); struct_iter2 != theFEDStructure.end(); struct_iter2++) {
149  int numberOfFEDErrors = (*struct_iter2).second->fillFED(*input, &meMapFEDs_);
150  if ((*struct_iter2).first <= 31)
151  nEventBPIXFEDErrors = nEventBPIXFEDErrors + numberOfFEDErrors; // (*struct_iter2).first >= 0, since
152  // (*struct_iter2).first is unsigned
153  if ((*struct_iter2).first >= 32 && (*struct_iter2).first <= 39)
154  nEventFPIXFEDErrors = nEventFPIXFEDErrors + numberOfFEDErrors;
155  // cout<<"NFEDErrors: "<<nEventBPIXFEDErrors<<"
156  // "<<nEventFPIXFEDErrors<<endl;
157  nErrors = nErrors + numberOfFEDErrors;
158  // if(nErrors>0) cout<<"FEDS: nErrors: "<<nErrors<<endl;
159  }
160  if (byLumiErrors) {
162  // cout<<"NErrors: "<<nEventBPIXModuleErrors<<" "<<nEventFPIXModuleErrors<<"
163  // "<<nEventBPIXFEDErrors<<" "<<nEventFPIXFEDErrors<<endl;
164  if (nEventBPIXModuleErrors + nEventBPIXFEDErrors > 0)
165  byLumiErrors->Fill(0, 1.);
166  if (nEventFPIXModuleErrors + nEventFPIXFEDErrors > 0)
167  byLumiErrors->Fill(1, 1.);
168  // cout<<"histo: "<<byLumiErrors->getBinContent(0)<<"
169  // "<<byLumiErrors->getBinContent(1)<<"
170  // "<<byLumiErrors->getBinContent(2)<<endl;
171  }
172 
173  // Rate of errors per lumi section:
174  if (errorRate)
175  errorRate->Fill(lumiSection, nErrors);
176 
177  // slow down...
178  if (slowDown)
179  usleep(100000);
180 }
edm::EDGetTokenT< edm::DetSetVector< SiPixelRawDataError > > src_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
static std::string const input
Definition: EdmProvDump.cc:47
void Fill(long long x)
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::map< uint32_t, SiPixelRawDataErrorModule * > theFEDStructure
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool isValid() const
Definition: HandleBase.h:70
Log< level::Info, false > LogInfo
Definition: DetId.h:17
std::map< uint32_t, SiPixelRawDataErrorModule * > thePixelStructure
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
edm::EDGetTokenT< FEDRawDataCollection > inputSourceToken_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
std::map< std::string, MonitorElement ** > meMapFEDs_
void SiPixelRawDataErrorSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 94 of file SiPixelRawDataErrorSource.cc.

References bookMEs().

96  {
97  // Book Monitoring Elements
98  bookMEs(iBooker);
99 }
virtual void bookMEs(DQMStore::IBooker &)
void SiPixelRawDataErrorSource::bookMEs ( DQMStore::IBooker iBooker)
virtual

Create folder tree and book histograms

Create folder tree for errors without detId and book histograms

Definition at line 277 of file SiPixelRawDataErrorSource.cc.

References bladeOn, dqm::implementation::IBooker::book1D(), byLumiErrors, dqm::implementation::NavigatorBase::cd(), conf_, errorRate, Exception, fedcounter, edm::ParameterSet::getParameter(), gpuClustering::id, isPIB, isUpgrade, edm::InputTag::label(), ladOn, LogDebug, meErrorType_, meEvtNbr_, meEvtSize_, meFedChLErr_, meFedChNErr_, meFedETypeNErr_, meFullType_, meMapFEDs_, meNErrors_, meTBMMessage_, meTBMType_, modOn, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), SiPixelFolderOrganizer::setFedFolder(), SiPixelFolderOrganizer::setModuleFolder(), alcazmumu_cfi::src, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, theFEDStructure, thePixelStructure, runGCPTkAlMap::title, and topFolderName_.

Referenced by bookHistograms().

277  {
278  iBooker.setCurrentFolder(topFolderName_ + "/EventInfo/DAQContents");
279  char title0[80];
280  sprintf(title0, "FED isPresent;FED ID;isPresent");
281  fedcounter = iBooker.book1D("fedcounter", title0, 40, -0.5, 39.5);
282  iBooker.setCurrentFolder(topFolderName_ + "/AdditionalPixelErrors");
283  char title[80];
284  sprintf(title, "By-LumiSection Error counters");
285  {
286  auto scope = DQMStore::IBooker::UseLumiScope(iBooker);
287  byLumiErrors = iBooker.book1D("byLumiErrors", title, 2, 0., 2.);
288  }
289  char title1[80];
290  sprintf(title1, "Errors per LumiSection;LumiSection;NErrors");
291  errorRate = iBooker.book1D("errorRate", title1, 5000, 0., 5000.);
292 
293  std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter;
294  std::map<uint32_t, SiPixelRawDataErrorModule *>::iterator struct_iter2;
295 
296  SiPixelFolderOrganizer theSiPixelFolder(false);
297 
298  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
300 
301  if (modOn) {
302  if (!theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 0, isUpgrade)) {
303  // std::cout<<"PIB! not booking histograms for non-PIB
304  // modules!"<<std::endl;
305  if (!isPIB)
306  throw cms::Exception("LogicError") << "[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder "
307  "failed";
308  }
309  }
310 
311  if (ladOn) {
312  if (!theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 1, isUpgrade)) {
313  LogDebug("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
314  }
315  }
316 
317  if (bladeOn) {
318  if (!theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 4, isUpgrade)) {
319  LogDebug("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
320  }
321  }
322 
323  } // for loop
324 
325  for (struct_iter2 = theFEDStructure.begin(); struct_iter2 != theFEDStructure.end(); struct_iter2++) {
327  if (!theSiPixelFolder.setFedFolder(iBooker, (*struct_iter2).first)) {
328  throw cms::Exception("LogicError") << "[SiPixelRawDataErrorSource::bookMEs] Creation of DQM folder "
329  "failed";
330  }
331  }
332 
333  // Booking FED histograms
334  std::string hid;
335  // Get collection name and instantiate Histo Id builder
337  SiPixelHistogramId *theHistogramId = new SiPixelHistogramId(src.label());
338 
339  for (uint32_t id = 0; id < 40; id++) {
340  char temp[50];
341  sprintf(temp, (topFolderName_ + "/AdditionalPixelErrors/FED_%d").c_str(), id);
342  iBooker.cd(temp);
343  // Types of errors
344  hid = theHistogramId->setHistoId("errorType", id);
345  meErrorType_[id] = iBooker.book1D(hid, "Type of errors", 15, 24.5, 39.5);
346  meErrorType_[id]->setAxisTitle("Type of errors", 1);
347  // Number of errors
348  hid = theHistogramId->setHistoId("NErrors", id);
349  meNErrors_[id] = iBooker.book1D(hid, "Number of errors", 36, 0., 36.);
350  meNErrors_[id]->setAxisTitle("Number of errors", 1);
351  // Type of FIFO full (errorType = 28). FIFO 1 is 1-5 (where fullType =
352  // channel of FIFO 1), fullType = 6 signifies FIFO 2 nearly full, 7
353  // signifies trigger FIFO nearly full, 8 indicates an unexpected result
354  hid = theHistogramId->setHistoId("fullType", id);
355  meFullType_[id] = iBooker.book1D(hid, "Type of FIFO full", 7, 0.5, 7.5);
356  meFullType_[id]->setAxisTitle("FIFO type", 1);
357  // For error type 30, the type of problem encoded in the TBM trailer
358  // 0 = stack full, 1 = Pre-cal issued, 2 = clear trigger counter, 3 = sync
359  // trigger, 4 = sync trigger error, 5 = reset ROC, 6 = reset TBM, 7 = no
360  // token bit pass
361  hid = theHistogramId->setHistoId("TBMMessage", id);
362  meTBMMessage_[id] = iBooker.book1D(hid, "TBM trailer message", 8, -0.5, 7.5);
363  meTBMMessage_[id]->setAxisTitle("TBM message", 1);
364  // For error type 30, the type of problem encoded in the TBM error trailer 0
365  // = none 1 = data stream too long, 2 = FSM errors, 3 = invalid # of ROCs, 4
366  // = multiple
367  hid = theHistogramId->setHistoId("TBMType", id);
368  meTBMType_[id] = iBooker.book1D(hid, "Type of TBM trailer", 5, -0.5, 4.5);
369  meTBMType_[id]->setAxisTitle("TBM Type", 1);
370  // For error type 31, the event number of the TBM header with the error
371  hid = theHistogramId->setHistoId("EvtNbr", id);
372  meEvtNbr_[id] = iBooker.book1D(hid, "Event number", 1, 0, 1);
373  // For errorType = 34, datastream size according to error word
374  hid = theHistogramId->setHistoId("evtSize", id);
375  meEvtSize_[id] = iBooker.book1D(hid, "Event size", 1, 0, 1);
376  //
377  hid = theHistogramId->setHistoId("FedChNErr", id);
378  meFedChNErr_[id] = iBooker.book1D(hid, "Number of errors per FED channel", 37, 0, 37);
379  meFedChNErr_[id]->setAxisTitle("FED channel", 1);
380  //
381  hid = theHistogramId->setHistoId("FedChLErr", id);
382  meFedChLErr_[id] = iBooker.book1D(hid, "Last error per FED channel", 37, 0, 37);
383  meFedChLErr_[id]->setAxisTitle("FED channel", 1);
384  //
385  hid = theHistogramId->setHistoId("FedETypeNErr", id);
386  meFedETypeNErr_[id] = iBooker.book1D(hid, "Number of errors per type", 21, 0, 21);
387  meFedETypeNErr_[id]->setAxisTitle("Error type", 1);
388  }
389  // Add the booked histograms to the histogram map for booking
390  meMapFEDs_["meErrorType_"] = meErrorType_;
391  meMapFEDs_["meNErrors_"] = meNErrors_;
392  meMapFEDs_["meFullType_"] = meFullType_;
393  meMapFEDs_["meTBMMessage_"] = meTBMMessage_;
394  meMapFEDs_["meTBMType_"] = meTBMType_;
395  meMapFEDs_["meEvtNbr_"] = meEvtNbr_;
396  meMapFEDs_["meEvtSize_"] = meEvtSize_;
397  meMapFEDs_["meFedChNErr_"] = meFedChNErr_;
398  meMapFEDs_["meFedChLErr_"] = meFedChLErr_;
399  meMapFEDs_["meFedETypeNErr_"] = meFedETypeNErr_;
400 
401  // cout<<"...leaving SiPixelRawDataErrorSource::bookMEs now! "<<endl;
402 }
uint16_t *__restrict__ id
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * meFedETypeNErr_[40]
std::map< uint32_t, SiPixelRawDataErrorModule * > theFEDStructure
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:463
std::map< uint32_t, SiPixelRawDataErrorModule * > thePixelStructure
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string const & label() const
Definition: InputTag.h:36
std::map< std::string, MonitorElement ** > meMapFEDs_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
#define LogDebug(id)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void SiPixelRawDataErrorSource::buildStructure ( edm::EventSetup const &  iSetup)
virtual

Definition at line 185 of file SiPixelRawDataErrorSource.cc.

References PixelEndcapName::bladeName(), PixelEndcapName::diskName(), l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::EventSetup::getHandle(), PixelEndcapName::halfCylinder(), isPIB, isUpgrade, LogDebug, FEDNumbering::MAXSiPixelFEDID, FEDNumbering::MINSiPixelFEDID, callgraph::module, PixelEndcapName::pannelName(), PixelEndcapName::plaquetteName(), edm::ESHandle< class >::product(), DetId::rawId(), PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, theFEDStructure, thePixelStructure, trackerGeomTokenBeginRun_, and trackerTopoTokenBeginRun_.

Referenced by dqmBeginRun().

185  {
186  LogInfo("PixelDQM") << " SiPixelRawDataErrorSource::buildStructure";
187 
189 
190  edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(trackerTopoTokenBeginRun_);
191  const TrackerTopology *pTT = tTopoHandle.product();
192 
193  LogVerbatim("PixelDQM") << " *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
194  LogVerbatim("PixelDQM") << " *** I have " << pDD->detsPXB().size() << " barrel pixel detectors" << std::endl;
195  LogVerbatim("PixelDQM") << " *** I have " << pDD->detsPXF().size() << " endcap pixel detectors" << std::endl;
196  // LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<"
197  // types"<<std::endl;
198 
199  for (TrackerGeometry::DetContainer::const_iterator it = pDD->detsPXB().begin(); it != pDD->detsPXB().end(); it++) {
200  const GeomDetUnit *geoUnit = dynamic_cast<const GeomDetUnit *>(*it);
201  // check if it is a detUnit
202  if (geoUnit == nullptr)
203  LogError("PixelDQM") << "Pixel GeomDet is not a GeomDetUnit!" << std::endl;
204  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
205  int nrows = (pixDet->specificTopology()).nrows();
206  int ncols = (pixDet->specificTopology()).ncolumns();
207 
208  if (isPIB)
209  continue;
210  DetId detId = (*it)->geographicalId();
211  LogDebug("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
212  uint32_t id = detId();
213  SiPixelRawDataErrorModule *theModule = new SiPixelRawDataErrorModule(id, ncols, nrows);
214  thePixelStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(id, theModule));
215  }
216 
217  for (TrackerGeometry::DetContainer::const_iterator it = pDD->detsPXF().begin(); it != pDD->detsPXF().end(); it++) {
218  const GeomDetUnit *geoUnit = dynamic_cast<const GeomDetUnit *>(*it);
219  // check if it is a detUnit
220  if (geoUnit == nullptr)
221  LogError("PixelDQM") << "Pixel GeomDet is not a GeomDetUnit!" << std::endl;
222  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
223  int nrows = (pixDet->specificTopology()).nrows();
224  int ncols = (pixDet->specificTopology()).ncolumns();
225 
226  DetId detId = (*it)->geographicalId();
227  LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
228  uint32_t id = detId();
229  SiPixelRawDataErrorModule *theModule = new SiPixelRawDataErrorModule(id, ncols, nrows);
230 
232  int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
233  int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
234  int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
236 
237  char sside[80];
238  sprintf(sside, "HalfCylinder_%i", side);
239  char sdisk[80];
240  sprintf(sdisk, "Disk_%i", disk);
241  char sblade[80];
242  sprintf(sblade, "Blade_%02i", blade);
243  char spanel[80];
244  sprintf(spanel, "Panel_%i", panel);
245  char smodule[80];
246  sprintf(smodule, "Module_%i", module);
247  std::string side_str = sside;
248  std::string disk_str = sdisk;
249  bool mask = side_str.find("HalfCylinder_1") != string::npos || side_str.find("HalfCylinder_2") != string::npos ||
250  side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
251  // clutch to take all of FPIX, but no BPIX:
252  mask = false;
253  if (isPIB && mask)
254  continue;
255 
256  thePixelStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(id, theModule));
257  }
258 
259  LogDebug("PixelDQM") << " ---> Adding Module for Additional Errors " << endl;
261 
262  fedIds.first = 0;
263  fedIds.second = 39;
264 
265  for (int fedId = fedIds.first; fedId <= fedIds.second; fedId++) {
266  // std::cout<<"Adding FED module: "<<fedId<<std::endl;
267  uint32_t id = static_cast<uint32_t>(fedId);
269  theFEDStructure.insert(pair<uint32_t, SiPixelRawDataErrorModule *>(id, theModule));
270  }
271 
272  LogInfo("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
273 }
int plaquetteName() const
plaquetteId (in pannel)
Log< level::Info, true > LogVerbatim
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
Log< level::Error, false > LogError
int bladeName() const
blade id
std::map< uint32_t, SiPixelRawDataErrorModule * > theFEDStructure
Log< level::Info, false > LogInfo
Definition: DetId.h:17
std::map< uint32_t, SiPixelRawDataErrorModule * > thePixelStructure
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T const * product() const
Definition: ESHandle.h:86
int pannelName() const
pannel id
int diskName() const
disk id
HalfCylinder halfCylinder() const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoTokenBeginRun_
tuple module
Definition: callgraph.py:69
#define LogDebug(id)
void SiPixelRawDataErrorSource::dqmBeginRun ( const edm::Run r,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 80 of file SiPixelRawDataErrorSource.cc.

References bladeOn, buildStructure(), eventNo, firstRun, ladOn, and modOn.

80  {
81  LogInfo("PixelDQM") << " SiPixelRawDataErrorSource::beginRun - Initialisation ... " << std::endl;
82  LogInfo("PixelDQM") << "Mod/Lad/Blade " << modOn << "/" << ladOn << "/" << bladeOn << std::endl;
83 
84  if (firstRun) {
85  eventNo = 0;
86 
87  firstRun = false;
88  }
89 
90  // Build map
91  buildStructure(iSetup);
92 }
Log< level::Info, false > LogInfo
virtual void buildStructure(edm::EventSetup const &)

Member Data Documentation

bool SiPixelRawDataErrorSource::bladeOn
private

Definition at line 68 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), bookMEs(), and dqmBeginRun().

MonitorElement* SiPixelRawDataErrorSource::byLumiErrors
private

Definition at line 74 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and bookMEs().

edm::ParameterSet SiPixelRawDataErrorSource::conf_
private

Definition at line 56 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs(), and SiPixelRawDataErrorSource().

MonitorElement* SiPixelRawDataErrorSource::errorRate
private

Definition at line 75 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and bookMEs().

int SiPixelRawDataErrorSource::eventNo
private

Definition at line 70 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and dqmBeginRun().

MonitorElement* SiPixelRawDataErrorSource::fedcounter
private

Definition at line 76 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and bookMEs().

bool SiPixelRawDataErrorSource::firstRun
private

Definition at line 73 of file SiPixelRawDataErrorSource.h.

Referenced by dqmBeginRun(), and SiPixelRawDataErrorSource().

edm::EDGetTokenT<FEDRawDataCollection> SiPixelRawDataErrorSource::inputSourceToken_
private

Definition at line 58 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and SiPixelRawDataErrorSource().

bool SiPixelRawDataErrorSource::isPIB
private

Definition at line 63 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs(), and buildStructure().

bool SiPixelRawDataErrorSource::isUpgrade
private

Definition at line 69 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs(), and buildStructure().

bool SiPixelRawDataErrorSource::ladOn
private

Definition at line 67 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), bookMEs(), and dqmBeginRun().

MonitorElement* SiPixelRawDataErrorSource::meErrorType_[40]
private

Definition at line 78 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meEvtNbr_[40]
private

Definition at line 83 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meEvtSize_[40]
private

Definition at line 84 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meFedChLErr_[40]
private

Definition at line 87 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meFedChNErr_[40]
private

Definition at line 86 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meFedETypeNErr_[40]
private

Definition at line 88 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meFullType_[40]
private

Definition at line 80 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

std::map<std::string, MonitorElement **> SiPixelRawDataErrorSource::meMapFEDs_
private

Definition at line 90 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), and bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meNErrors_[40]
private

Definition at line 79 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meTBMMessage_[40]
private

Definition at line 81 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

MonitorElement* SiPixelRawDataErrorSource::meTBMType_[40]
private

Definition at line 82 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs().

bool SiPixelRawDataErrorSource::modOn
private

Definition at line 66 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), bookMEs(), and dqmBeginRun().

bool SiPixelRawDataErrorSource::reducedSet
private

Definition at line 65 of file SiPixelRawDataErrorSource.h.

bool SiPixelRawDataErrorSource::saveFile
private

Definition at line 62 of file SiPixelRawDataErrorSource.h.

bool SiPixelRawDataErrorSource::slowDown
private

Definition at line 64 of file SiPixelRawDataErrorSource.h.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<SiPixelRawDataError> > SiPixelRawDataErrorSource::src_
private

Definition at line 57 of file SiPixelRawDataErrorSource.h.

Referenced by analyze().

std::map<uint32_t, SiPixelRawDataErrorModule *> SiPixelRawDataErrorSource::theFEDStructure
private

Definition at line 72 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), bookMEs(), and buildStructure().

std::map<uint32_t, SiPixelRawDataErrorModule *> SiPixelRawDataErrorSource::thePixelStructure
private

Definition at line 71 of file SiPixelRawDataErrorSource.h.

Referenced by analyze(), bookMEs(), and buildStructure().

std::string SiPixelRawDataErrorSource::topFolderName_
private

Definition at line 61 of file SiPixelRawDataErrorSource.h.

Referenced by bookMEs(), and SiPixelRawDataErrorSource().

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelRawDataErrorSource::trackerGeomTokenBeginRun_
private

Definition at line 60 of file SiPixelRawDataErrorSource.h.

Referenced by buildStructure(), and SiPixelRawDataErrorSource().

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelRawDataErrorSource::trackerTopoTokenBeginRun_
private

Definition at line 59 of file SiPixelRawDataErrorSource.h.

Referenced by buildStructure(), and SiPixelRawDataErrorSource().