CMS 3D CMS Logo

CSCDQM_Dispatcher.h
Go to the documentation of this file.
1 
2 /*
3  * =====================================================================================
4  *
5  * Filename: CSCDQM_Dispatcher.h
6  *
7  * Description: CSCDQM Framework frontend and Histogram Cache controller
8  *
9  * Version: 1.0
10  * Created: 10/03/2008 10:26:04 AM
11  * Revision: none
12  * Compiler: gcc
13  *
14  * Author: Valdas Rapsevicius, valdas.rapsevicius@cern.ch
15  * Company: CERN, CH
16  *
17  * =====================================================================================
18  */
19 
20 #ifndef CSCDQM_Dispatcher_H
21 #define CSCDQM_Dispatcher_H
22 
23 #include <typeinfo>
24 
25 #ifdef DQMMT
26 #include <boost/thread.hpp>
27 #endif
28 
29 #include "CSCDQM_Configuration.h"
30 #include "CSCDQM_EventProcessor.h"
31 #include "CSCDQM_Collection.h"
32 #include "CSCDQM_HistoDef.h"
33 #include "CSCDQM_Cache.h"
34 #include "CSCDQM_Logger.h"
35 #include "CSCDQM_Lock.h"
36 
37 namespace cscdqm {
38 
44  class EventProcessorMutex : public Lock {
45  private:
48 
51 
54 
57 
58  public:
63  EventProcessorMutex(Configuration* const p_config) : processor(p_config) {
64  config = p_config;
65  fullStandbyProcessed = false;
66  }
67 
74  config->updateFraTimer(true);
76  config->updateFraTimer(false);
77  if (config->getPROCESS_EFF_HISTOS()) {
78  config->updateEffTimer(true);
80  config->updateEffTimer(false);
81  }
82  }
83 
89  unsigned int maskHWElements(std::vector<std::string>& tokens) { return processor.maskHWElements(tokens); }
90 
95  void processStandby(HWStandbyType& standby) {
96  if (lastStandby != standby) {
98  if (config->getIN_FULL_STANDBY()) {
99  // Lets mark CSCs as BAD - have not ever ever been in !STANDBY
100  if (!fullStandbyProcessed) {
103  fullStandbyProcessed = true;
104  }
105  }
106  lastStandby = standby;
107  }
108  }
109  };
110 
115  class Dispatcher {
116  public:
117  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider);
118 
119 #ifdef DQMGLOBAL
120  Dispatcher(Configuration* const p_config,
121  MonitorObjectProvider* const p_provider,
122  const edm::InputTag& itag,
123  edm::ConsumesCollector&& coco);
124 #endif
125 
130 #ifdef DQMMT
131  threads.join_all();
132 #endif
133  }
134 
135  void init();
136  void book();
138  const bool getHisto(const HistoDef& histoD, MonitorObject*& me);
139  unsigned int maskHWElements(std::vector<std::string>& tokens);
140  void processStandby(HWStandbyType& standby);
141 
142  private:
143  // Old content of ctor into separate function so it can be called by both ctors
144  void commonConstruct(Configuration* const p_config, MonitorObjectProvider* const p_provider);
145 
147 
150 
153 
156 
159 
162 
165 
166 #ifdef DQMMT
167 
169  boost::thread_group threads;
170 
171 #endif
172 
173 #ifdef DQMLOCAL
174 
175  public:
176  void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
177 
178 #endif
179 
180 #ifdef DQMGLOBAL
181 
182  public:
183  void processEvent(const edm::Event& e, const edm::InputTag& inputTag, HWStandbyType& standby);
184 
185 #endif
186  };
187 
188 } // namespace cscdqm
189 
190 #endif
Object used to process Events and compute statistics.
void init()
Initialize Dispatcher: book histograms, init processor, etc.
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
void updateEfficiencyHistos()
Update Efficiency MOs.
dispatcher processEvent(e, inputTag, standby)
Abstract Base Histogram Definition.
EventProcessorMutex processorFract
Definition: config.py:1
~Dispatcher()
Destructor. Joins and waits to complete all threads.
CSCDQM Framework frontend and Histogram Cache controller.
void updateFractionAndEfficiencyHistosAuto()
Automatically called fraction and efficiency MOs update function.
void processStandby(HWStandbyType &standby)
Set HW Standby modes.
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
Dispatcher(Configuration *const p_config, MonitorObjectProvider *const p_provider)
Constructor.
EventProcessorMutex(Configuration *const p_config)
Constructor.
CSCDQM Framework Global Configuration.
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
MonitorObject cache - list objects and routines to manage cache.
Definition: CSCDQM_Cache.h:99
Manage collection of histograms, load histogram definitions from XML file and book histograms by call...
void processStandby(HWStandbyType &standby)
Process standby information.
EventProcessor processor
Configuration * config
const bool getHisto(const HistoDef &histoD, MonitorObject *&me)
Global get MO function. If request has reached this function it means that histo is not in cache! ...
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
MonitorObjectProvider * provider
Interface for Histogram providing objects. Used by Event Processor to retrieve MonitorObject &#39;s and b...
void updateFractionAndEfficiencyHistos()
Update Fraction and Efficiency histograms.
void updateFractionHistos()
Update Fractional MOs.
void standbyEfficiencyHistos(HWStandbyType &standby)
apply standby flags/parameters
void commonConstruct(Configuration *const p_config, MonitorObjectProvider *const p_provider)
Lockable interface that blocks thread.
Definition: CSCDQM_Lock.h:42
Locking object (wrapper) that holds a separate EventProcessor. This object can be used (theoretically...