test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
46  private:
47 
50 
53 
56 
59 
60  public:
61 
66  EventProcessorMutex(Configuration* const p_config) : processor(p_config) {
67  config = p_config;
68  fullStandbyProcessed = false;
69  }
70 
77  config->updateFraTimer(true);
79  config->updateFraTimer(false);
80  if (config->getPROCESS_EFF_HISTOS()) {
81  config->updateEffTimer(true);
83  config->updateEffTimer(false);
84  }
85  }
86 
92  unsigned int maskHWElements(std::vector<std::string>& tokens) {
93  return processor.maskHWElements(tokens);
94  }
95 
96 
101  void processStandby(HWStandbyType& standby) {
102  if (lastStandby != standby) {
104  if (config->getIN_FULL_STANDBY()) {
105  // Lets mark CSCs as BAD - have not ever ever been in !STANDBY
106  if (!fullStandbyProcessed) {
109  fullStandbyProcessed = true;
110  }
111  }
112  lastStandby = standby;
113  }
114  }
115 
116  };
117 
122  class Dispatcher {
123 
124  public:
125 
126  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider);
127 
128 #ifdef DQMGLOBAL
129  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider,
130  const edm::InputTag& itag, edm::ConsumesCollector&& coco);
131 #endif
132 
137 #ifdef DQMMT
138  threads.join_all();
139 #endif
140  }
141 
142  void init();
143  void book();
145  const bool getHisto(const HistoDef& histoD, MonitorObject*& me);
146  unsigned int maskHWElements(std::vector<std::string>& tokens);
147  void processStandby(HWStandbyType& standby);
148 
149  private:
150 
151  // Old content of ctor into separate function so it can be called by both ctors
152  void commonConstruct(Configuration* const p_config, MonitorObjectProvider* const p_provider);
153 
155 
158 
161 
164 
167 
170 
173 
174 #ifdef DQMMT
175 
177  boost::thread_group threads;
178 
179 #endif
180 
181 #ifdef DQMLOCAL
182 
183  public:
184 
185  void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
186 
187 #endif
188 
189 #ifdef DQMGLOBAL
190 
191  public:
192 
193  void processEvent(const edm::Event& e, const edm::InputTag& inputTag, HWStandbyType& standby);
194 
195 #endif
196 
197  };
198 
199 }
200 
201 #endif
void updateFraTimer(const bool start)
Switch on/off fractional MO processing timer.
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
void updateEffTimer(const bool start)
Switch on/off efficiency MO processing timer.
~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:112
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!
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...