CMS 3D CMS Logo

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