Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:07

0001 #ifndef DTDataIntegrityROSOffline_H
0002 #define DTDataIntegrityROSOffline_H
0003 
0004 /** \class DTDataIntegrityROSOffline
0005  *
0006  * Class for DT Data Integrity.
0007  *
0008  *
0009  * \author Marco Zanetti (INFN Padova), Gianluca Cerminara (INFN Torino)
0010  *
0011  */
0012 
0013 #include "EventFilter/DTRawToDigi/interface/DTROChainCoding.h"
0014 
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 
0019 #include "DQMServices/Core/interface/DQMStore.h"
0020 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0021 
0022 #include "DataFormats/DTDigi/interface/DTControlData.h"
0023 
0024 #include <fstream>
0025 #include <map>
0026 #include <string>
0027 #include <vector>
0028 #include <list>
0029 
0030 class DTROS25Data;
0031 class DTDDUData;
0032 
0033 class DTDataIntegrityROSOffline : public DQMEDAnalyzer {
0034 public:
0035   DTDataIntegrityROSOffline(const edm::ParameterSet& ps);
0036 
0037   ~DTDataIntegrityROSOffline() override;
0038 
0039   void processROS25(DTROS25Data& data, int dduID, int ros);
0040   void processFED(DTDDUData& dduData, const std::vector<DTROS25Data>& rosData, int dduID);
0041 
0042   // log number of times the payload of each fed is unpacked
0043   void fedEntry(int dduID);
0044   // log number of times the payload of each fed is skipped (no ROS inside)
0045   void fedFatal(int dduID);
0046   // log number of times the payload of each fed is partially skipped (some ROS skipped)
0047   void fedNonFatal(int dduID);
0048 
0049   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0050 
0051 protected:
0052   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0053 
0054 private:
0055   void bookHistos(DQMStore::IBooker&, const int fedMin, const int fedMax);
0056   void bookHistos(DQMStore::IBooker&, std::string folder, DTROChainCoding code);
0057   void bookHistosROS25(DQMStore::IBooker&, DTROChainCoding code);
0058 
0059   void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
0060   void channelsInROS(int cerosMask, std::vector<int>& channels);
0061 
0062   std::string topFolder(bool isFEDIntegrity) const;
0063 
0064   // Plot quantities about SC
0065   bool getSCInfo;
0066 
0067   int nevents;
0068 
0069   // Monitor Elements
0070   MonitorElement* nEventMonitor;
0071   // <histoType, <index , histo> >
0072   std::map<std::string, std::map<int, MonitorElement*> > fedHistos;
0073   // <histoType, histo> >
0074   std::map<std::string, std::map<int, MonitorElement*> > summaryHistos;
0075   // <histoType, <index , histo> >
0076   std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
0077 
0078   // standard ME for monitoring of FED integrity
0079   MonitorElement* hFEDEntry;
0080   MonitorElement* hFEDFatal;
0081   MonitorElement* hFEDNonFatal;
0082   MonitorElement* hCorruptionSummary;
0083 
0084   // one for all FEDS
0085   MonitorElement* hTTSSummary;
0086 
0087   int neventsFED;
0088   int neventsROS;
0089 
0090   // Number of ROS per FED
0091   const int nROS = 12;
0092 
0093   int FEDIDmin;
0094   int FEDIDmax;
0095 
0096   // event error flag: true when errors are detected
0097   // can be used for the selection of the debug stream
0098   bool eventErrorFlag;
0099 
0100   std::map<int, std::set<int> > rosBxIdsPerFED;
0101   std::set<int> fedBXIds;
0102   std::map<int, std::set<int> > rosL1AIdsPerFED;
0103 
0104   std::string fedIntegrityFolder;
0105 
0106   // The label to retrieve the digis
0107   edm::EDGetTokenT<DTDDUCollection> dduToken;
0108 
0109   edm::EDGetTokenT<DTROS25Collection> ros25Token;
0110 };
0111 
0112 #endif
0113 
0114 /* Local Variables: */
0115 /* show-trailing-whitespace: t */
0116 /* truncate-lines: t */
0117 /* End: */