SiPixelRawDataErrorSource

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
#ifndef SiPixelMonitorRawData_SiPixelRawDataErrorSource_h
#define SiPixelMonitorRawData_SiPixelRawDataErrorSource_h
// -*- C++ -*-
//
// Package:     SiPixelMonitorRawData
// Class  :     SiPixelRawDataErrorSource
//
/**

 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).

*/
//
// Original Author:  Andrew York
//

#include <memory>

// user include files
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQM/SiPixelMonitorRawData/interface/SiPixelRawDataErrorModule.h"
#include "DataFormats/Common/interface/DetSetVector.h"
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include <cstdint>

class SiPixelRawDataErrorSource : public DQMEDAnalyzer {
public:
  explicit SiPixelRawDataErrorSource(const edm::ParameterSet &conf);
  ~SiPixelRawDataErrorSource() override;

  typedef edm::DetSet<SiPixelRawDataError>::const_iterator ErrorIterator;

  void analyze(const edm::Event &, const edm::EventSetup &) override;
  void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override;
  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;

  virtual void buildStructure(edm::EventSetup const &);
  virtual void bookMEs(DQMStore::IBooker &);

private:
  edm::ParameterSet conf_;
  edm::EDGetTokenT<edm::DetSetVector<SiPixelRawDataError>> src_;
  edm::EDGetTokenT<FEDRawDataCollection> inputSourceToken_;
  edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoTokenBeginRun_;
  edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomTokenBeginRun_;
  std::string topFolderName_;
  bool saveFile;
  bool isPIB;
  bool slowDown;
  bool reducedSet;
  bool modOn;
  bool ladOn;
  bool bladeOn;
  bool isUpgrade;
  int eventNo;
  std::map<uint32_t, SiPixelRawDataErrorModule *> thePixelStructure;
  std::map<uint32_t, SiPixelRawDataErrorModule *> theFEDStructure;
  bool firstRun;
  MonitorElement *byLumiErrors;
  MonitorElement *errorRate;
  MonitorElement *fedcounter;

  MonitorElement *meErrorType_[40];
  MonitorElement *meNErrors_[40];
  MonitorElement *meFullType_[40];
  MonitorElement *meTBMMessage_[40];
  MonitorElement *meTBMType_[40];
  MonitorElement *meEvtNbr_[40];
  MonitorElement *meEvtSize_[40];

  MonitorElement *meFedChNErr_[40];
  MonitorElement *meFedChLErr_[40];
  MonitorElement *meFedETypeNErr_[40];

  std::map<std::string, MonitorElement **> meMapFEDs_;
};

#endif