Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-27 04:04:14

0001 #ifndef SiPixelErrorsDigisToCalibDigis_h
0002 #define SiPixelErrorsDigisToCalibDigis_h
0003 
0004 /**  class SiPixelErrorsDigisToCalibDigis
0005 
0006 Description: Create monitorElements for the Errors in created in the reduction of digis to calibDigis
0007 
0008 **/
0009 
0010 // Original Author: Ricardo Vasquez Sierra on April 9, 2008
0011 
0012 // system include files
0013 #include <memory>
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0018 
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/ServiceRegistry/interface/Service.h"
0021 
0022 #include "DataFormats/Common/interface/DetSetVector.h"
0023 #include "DataFormats/DetId/interface/DetId.h"
0024 
0025 #include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigi.h"
0026 #include "DataFormats/SiPixelDigi/interface/SiPixelCalibDigiError.h"
0027 
0028 #include "DQMServices/Core/interface/DQMStore.h"
0029 
0030 #include "DQM/SiPixelCommon/interface/SiPixelHistogramId.h"
0031 #include "DQM/SiPixelCommon/interface/SiPixelFolderOrganizer.h"
0032 
0033 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0034 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0035 #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h"
0036 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0037 
0038 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0039 
0040 //
0041 // class declaration
0042 //
0043 
0044 class SiPixelErrorsDigisToCalibDigis : public edm::one::EDAnalyzer<> {
0045 public:
0046   typedef dqm::legacy::MonitorElement MonitorElement;
0047   typedef dqm::legacy::DQMStore DQMStore;
0048   explicit SiPixelErrorsDigisToCalibDigis(const edm::ParameterSet&);
0049   ~SiPixelErrorsDigisToCalibDigis() override;
0050 
0051   MonitorElement* bookDQMHistogram2D(uint32_t detid,
0052                                      std::string name,
0053                                      std::string title,
0054                                      int nchX,
0055                                      double lowX,
0056                                      double highX,
0057                                      int nchY,
0058                                      double lowY,
0059                                      double highY);
0060   MonitorElement* bookDQMHistoPlaquetteSummary2D(
0061       uint32_t detid,
0062       std::string name,
0063       std::string
0064           title);  // take the detid to determine the size of rows and columns, this saves looking up everything in the cabling map by the user.
0065 
0066   bool setDQMDirectory(std::string dirName);
0067   bool setDQMDirectory(uint32_t detID);  //automatically create directory hierachy based on DetID
0068 protected:
0069   edm::ESHandle<TrackerGeometry> geom_;
0070 
0071   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_;
0072 
0073 private:
0074   void analyze(const edm::Event&, const edm::EventSetup&) override;
0075   void endJob() override;
0076 
0077   // ----------member data ---------------------------
0078 
0079   // store the number of error per detector id encountered
0080   // store the location of the mismatching error in the detector id
0081 
0082   edm::InputTag siPixelProducerLabel_;
0083   edm::EDGetTokenT<edm::DetSetVector<SiPixelCalibDigiError> > tPixelCalibDigiError;
0084 
0085   DQMStore* daqBE_;
0086   SiPixelHistogramId* theHistogramIdWorker_;
0087   std::string outputFilename_;
0088   bool createOutputFile_;
0089 
0090   SiPixelFolderOrganizer* folderMaker_;
0091   std::map<uint32_t, MonitorElement*> SiPixelErrorsDigisToCalibDigis_2DErrorInformation_;
0092 
0093   MonitorElement* temp;
0094 };
0095 
0096 #endif