CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQM/DTMonitorModule/interface/DTDataIntegrityTask.h

Go to the documentation of this file.
00001 #ifndef DTDataIntegrityTask_H
00002 #define DTDataIntegrityTask_H
00003 
00015 #include "EventFilter/DTRawToDigi/interface/DTDataMonitorInterface.h"
00016 #include "EventFilter/DTRawToDigi/interface/DTROChainCoding.h"
00017 
00018 #include "FWCore/Framework/interface/Frameworkfwd.h"
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 #include <FWCore/Framework/interface/LuminosityBlock.h>
00022 
00023 #include "DQMServices/Core/interface/DQMStore.h"
00024 
00025 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00026 #include "DQMServices/Core/interface/MonitorElement.h"
00027 
00028 #include <fstream>
00029 #include <map>
00030 #include <string>
00031 #include <vector>
00032 #include <list>
00033 
00034 class DTROS25Data;
00035 class DTDDUData;
00036 
00037 
00038 class DTDataIntegrityTask : public DTDataMonitorInterface {
00039 
00040 public:
00041 
00042   explicit DTDataIntegrityTask( const edm::ParameterSet& ps,edm::ActivityRegistry& reg);
00043   
00044   virtual ~DTDataIntegrityTask();
00045 
00046   void TimeHistos(std::string histoType);
00047 
00048   void processROS25(DTROS25Data & data, int dduID, int ros);
00049   void processFED(DTDDUData & dduData, const std::vector<DTROS25Data> & rosData, int dduID);
00050 
00051   // log number of times the payload of each fed is unpacked 
00052   void fedEntry(int dduID);
00053   // log number of times the payload of each fed is skipped (no ROS inside)
00054   void fedFatal(int dduID);
00055   // log number of times the payload of each fed is partially skipped (some ROS skipped)
00056   void fedNonFatal(int dduID);
00057 
00058   bool eventHasErrors() const;
00059   void postBeginJob();
00060   void postEndJob();
00061   void preProcessEvent(const edm::EventID& iEvtid, const edm::Timestamp& iTime);
00062 
00063 private:
00064 
00065   void bookHistos(const int fedMin, const int fedMax);
00066   void bookHistos(std::string folder, DTROChainCoding code);
00067   void bookHistosROS25(DTROChainCoding code);
00068 
00069   void channelsInCEROS(int cerosId, int chMask, std::vector<int>& channels);
00070   void channelsInROS(int cerosMask, std::vector<int>& channels);
00071 
00072   std::string topFolder(bool isFEDIntegrity) const;
00073 
00074   std::multimap<std::string, std::string> names;
00075   std::multimap<std::string, std::string>::iterator it;
00076 
00077   edm::ParameterSet parameters;
00078 
00079   //If you want info VS time histos
00080   bool doTimeHisto;
00081   // Plot quantities about SC
00082   bool getSCInfo;
00083 
00084   int nevents;
00085 
00086   // back-end interface
00087   DQMStore * dbe;
00088   
00089   DTROChainCoding coding;
00090 
00091   // Monitor Elements
00092   MonitorElement* nEventMonitor;
00093   // <histoType, <index , histo> >    
00094   std::map<std::string, std::map<int, MonitorElement*> > dduHistos;
00095   // <histoType, histo> >    
00096   std::map<std::string, std::map<int, MonitorElement*> > rosSHistos;
00097   // <histoType, <index , histo> >    
00098   std::map<std::string, std::map<int, MonitorElement*> > rosHistos;
00099   // <histoType, <tdcID, histo> >   
00100   std::map<std::string, std::map<int, MonitorElement*> > robHistos;
00101 
00102   // standard ME for monitoring of FED integrity
00103   MonitorElement* hFEDEntry;
00104   MonitorElement* hFEDFatal;
00105   MonitorElement* hFEDNonFatal;
00106   MonitorElement* hCorruptionSummary;
00107 
00108   // one for all FEDS
00109   MonitorElement* hTTSSummary;
00110 
00111   int neventsDDU;
00112   int neventsROS25;
00113   float trigger_counter;
00114   std::string outputFile;
00115   double rob_max[25];
00116   
00117   //Event counter for the graphs VS time
00118   int myPrevEv;
00119   
00120   //Monitor TTS,ROS,FIFO VS time
00121   int myPrevTtsVal;
00122   int myPrevRosVal;
00123   int myPrevFifoVal[7];
00124  
00125   // event error flag: true when errors are detected
00126   // can be used for the selection of the debug stream
00127   bool eventErrorFlag;
00128 
00129   std::map<int, std::set<int> > rosBxIdsPerFED;
00130   std::set<int> fedBXIds;
00131   std::map<int, std::set<int> > rosL1AIdsPerFED;
00132 
00133   // flag to toggle the creation of only the summaries (for HLT running)
00134   int mode;
00135   std::string fedIntegrityFolder;
00136 
00137 };
00138 
00139 
00140 #endif
00141