Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:22

0001 #ifndef SiPixelMonitorRawData_SiPixelRawDataErrorSource_h
0002 #define SiPixelMonitorRawData_SiPixelRawDataErrorSource_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     SiPixelMonitorRawData
0006 // Class  :     SiPixelRawDataErrorSource
0007 //
0008 /**
0009 
0010  Description:
0011  Produces histograms for error information generated at the raw2digi stage for
0012  the pixel tracker.
0013 
0014  Usage:
0015  Takes a DetSetVector<SiPixelRawDataError> as input, and uses it to populate  a
0016  folder hierarchy (organized by detId) with histograms containing information
0017  about the errors.  Uses SiPixelRawDataErrorModule class to book and fill
0018  individual folders. Note that this source is different than other DQM sources
0019  in the creation of an unphysical detId folder (detId=0xffffffff) to hold
0020  information about errors for which there is no detId available (except the
0021  dummy detId given to it at raw2digi).
0022 
0023 */
0024 //
0025 // Original Author:  Andrew York
0026 //
0027 
0028 #include <memory>
0029 
0030 // user include files
0031 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0032 #include "DQM/SiPixelMonitorRawData/interface/SiPixelRawDataErrorModule.h"
0033 #include "DataFormats/Common/interface/DetSetVector.h"
0034 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0035 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0036 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0037 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0038 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0039 #include <cstdint>
0040 
0041 class SiPixelRawDataErrorSource : public DQMEDAnalyzer {
0042 public:
0043   explicit SiPixelRawDataErrorSource(const edm::ParameterSet &conf);
0044   ~SiPixelRawDataErrorSource() override;
0045 
0046   typedef edm::DetSet<SiPixelRawDataError>::const_iterator ErrorIterator;
0047 
0048   void analyze(const edm::Event &, const edm::EventSetup &) override;
0049   void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override;
0050   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0051 
0052   virtual void buildStructure(edm::EventSetup const &);
0053   virtual void bookMEs(DQMStore::IBooker &);
0054 
0055 private:
0056   edm::ParameterSet conf_;
0057   edm::EDGetTokenT<edm::DetSetVector<SiPixelRawDataError>> src_;
0058   edm::EDGetTokenT<FEDRawDataCollection> inputSourceToken_;
0059   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoTokenBeginRun_;
0060   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomTokenBeginRun_;
0061   std::string topFolderName_;
0062   bool saveFile;
0063   bool isPIB;
0064   bool slowDown;
0065   bool reducedSet;
0066   bool modOn;
0067   bool ladOn;
0068   bool bladeOn;
0069   bool isUpgrade;
0070   int eventNo;
0071   std::map<uint32_t, SiPixelRawDataErrorModule *> thePixelStructure;
0072   std::map<uint32_t, SiPixelRawDataErrorModule *> theFEDStructure;
0073   bool firstRun;
0074   MonitorElement *byLumiErrors;
0075   MonitorElement *errorRate;
0076   MonitorElement *fedcounter;
0077 
0078   MonitorElement *meErrorType_[40];
0079   MonitorElement *meNErrors_[40];
0080   MonitorElement *meFullType_[40];
0081   MonitorElement *meTBMMessage_[40];
0082   MonitorElement *meTBMType_[40];
0083   MonitorElement *meEvtNbr_[40];
0084   MonitorElement *meEvtSize_[40];
0085 
0086   MonitorElement *meFedChNErr_[40];
0087   MonitorElement *meFedChLErr_[40];
0088   MonitorElement *meFedETypeNErr_[40];
0089 
0090   std::map<std::string, MonitorElement **> meMapFEDs_;
0091 };
0092 
0093 #endif