Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:30

0001 #ifndef DQM_SiStripCommissioningSources_SiStripCommissioningSource_H
0002 #define DQM_SiStripCommissioningSources_SiStripCommissioningSource_H
0003 
0004 #include "FWCore/Utilities/interface/EDGetToken.h"
0005 #include "CalibFormats/SiStripObjects/interface/SiStripFecCabling.h"
0006 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
0007 #include "CondFormats/DataRecord/interface/SiStripFedCablingRcd.h"
0008 #include "DataFormats/Common/interface/DetSetVector.h"
0009 #include "DataFormats/Common/interface/DetSetVectorNew.h"
0010 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0011 #include "DataFormats/SiStripCommon/interface/SiStripHistoTitle.h"
0012 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
0013 #include "DataFormats/SiStripDigi/interface/SiStripRawDigi.h"
0014 #include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
0015 #include "FWCore/Framework/interface/EDAnalyzer.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
0019 #include "CondFormats/DataRecord/interface/SiStripPedestalsRcd.h"
0020 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
0021 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
0022 #include <string>
0023 #include <vector>
0024 #include <map>
0025 #include <cstdint>
0026 
0027 class CommissioningTask;
0028 class FedChannelConnection;
0029 class SiStripEventSummary;
0030 
0031 /**
0032    @class SiStripCommissioningSource
0033 */
0034 class SiStripCommissioningSource : public edm::EDAnalyzer {
0035 public:  // ---------- Public interface ----------
0036   /** Map of task objects, identified through FedChanelId */
0037   typedef std::map<unsigned int, CommissioningTask*> TaskMap;
0038   typedef std::vector<CommissioningTask*> VecOfTasks;
0039   typedef std::vector<VecOfTasks> VecOfVecOfTasks;
0040   typedef dqm::legacy::DQMStore DQMStore;
0041   typedef dqm::legacy::MonitorElement MonitorElement;
0042 
0043   SiStripCommissioningSource(const edm::ParameterSet&);
0044 
0045   /** Private default constructor. */
0046   SiStripCommissioningSource() = delete;
0047 
0048   ~SiStripCommissioningSource() override;
0049 
0050   void beginRun(edm::Run const&, const edm::EventSetup&) override;
0051   void analyze(const edm::Event&, const edm::EventSetup&) override;
0052   void endJob() override;
0053 
0054 private:  // ---------- Private methods ----------
0055   /** */
0056   DQMStore* const dqm(std::string method = "") const;
0057 
0058   /** */
0059   void createRunNumber();
0060 
0061   /** */
0062   void createTask(const SiStripEventSummary* const, const edm::EventSetup&);
0063 
0064   /** */
0065   void createCablingTasks();
0066 
0067   /** */
0068   void createTasks(sistrip::RunType, const edm::EventSetup&);
0069 
0070   /** */
0071   void clearCablingTasks();
0072 
0073   /** */
0074   void clearTasks();
0075 
0076   /** */
0077   void fillCablingHistos(const SiStripEventSummary* const, const edm::DetSetVector<SiStripRawDigi>&);
0078 
0079   /** */
0080   void fillHistos(const SiStripEventSummary* const,
0081                   const edm::DetSetVector<SiStripRawDigi>&,
0082                   const edm::DetSetVector<SiStripRawDigi>& = edm::DetSetVector<SiStripRawDigi>(),
0083                   const edmNew::DetSetVector<SiStripCluster>& = edmNew::DetSetVector<SiStripCluster>());
0084 
0085   /** */
0086   void remove();
0087 
0088   /** */
0089   void directory(std::stringstream&, uint32_t run_number = 0);
0090 
0091   /** */
0092   //void cablingForConnectionRun( const sistrip::RunType& ); //@@ do not use!
0093 
0094   // ---------- DQM fwk and cabling ----------
0095 
0096   /** Interface to Data Quality Monitoring framework. */
0097   DQMStore* dqm_;
0098 
0099   /** */
0100   edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> fedCablingToken_;
0101   SiStripFedCabling* fedCabling_;
0102 
0103   /** */
0104   SiStripFecCabling* fecCabling_;
0105 
0106   // ---------- Input / output ----------
0107   edm::EDGetTokenT<SiStripEventSummary> inputModuleSummaryToken_;
0108   edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > digiVirginRawToken_;
0109   edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > digiReorderedToken_;
0110   edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > digiScopeModeToken_;
0111   edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > digiFineDelaySelectionToken_;
0112   edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > clustersToken_;
0113 
0114   /** Name of digi input module. */
0115   std::string inputModuleLabel_;
0116   std::string inputModuleLabelAlt_;
0117   std::string inputModuleLabelSummary_;
0118   std::string inputClusterLabel_;
0119 
0120   /** Filename of output root file containing source histos. */
0121   std::string filename_;
0122 
0123   /** Run number used for naming of root file. */
0124   uint32_t run_;
0125 
0126   /** Partition name used for root files in spy */
0127   std::string partitionName_;
0128 
0129   /** Record of time used to calculate event rate. */
0130   int32_t time_;
0131 
0132   /** Is this a spy run ? */
0133   bool isSpy_;
0134 
0135   // ---------- Histogram-related ----------
0136 
0137   /** Identifies commissioning task read from cfg file. */
0138   std::string taskConfigurable_;
0139 
0140   /** Identifies commissioning task. */
0141   sistrip::RunType task_;
0142 
0143   /** Vector of vector of task objects (indexed using FED id.ch. */
0144   VecOfVecOfTasks tasks_;
0145 
0146   /** Map of cabling task objects (indexed using FEC key). */
0147   TaskMap cablingTasks_;
0148 
0149   /** Flag to indicate whether histo objects exist or not. */
0150   bool tasksExist_;
0151 
0152   /** Flag to indicate whether task is FED cabling or not. */
0153   bool cablingTask_;
0154 
0155   /** Update frequency for histograms (ignored for cabling). */
0156   int updateFreq_;
0157 
0158   /** */
0159   std::string base_;
0160 
0161   /** flag for choosing the organizational 'view' the DQM histogram tree */
0162   std::string view_;
0163 
0164   /** parameters to pass to the tasks */
0165   edm::ParameterSet parameters_;
0166 
0167   edm::ESGetToken<SiStripPedestals, SiStripPedestalsRcd> pedestalToken_;
0168   edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> noiseToken_;
0169 };
0170 
0171 #endif  // DQM_SiStripCommissioningSources_SiStripCommissioningSource_H