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  * Filename: CSCDQM_Dispatcher.h
5  *
6  * Description: CSCDQM Framework frontend and Histogram Cache controller
7  *
8  * Version: 1.0
9  * Created: 10/03/2008 10:26:04 AM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius, valdas.rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
19 #ifndef CSCDQM_Dispatcher_H
20 #define CSCDQM_Dispatcher_H
21 
22 #include <typeinfo>
23 
24 #ifdef DQMMT
25 #include <boost/thread.hpp>
26 #endif
27 
34 
35 namespace cscdqm {
36 
42  class EventProcessorMutex : public Lock {
43 
44  private:
45 
48 
51 
54 
57 
58  public:
59 
64  EventProcessorMutex(Configuration* const p_config) : processor(p_config) {
65  config = p_config;
66  fullStandbyProcessed = false;
67  }
68 
75  config->updateFraTimer(true);
77  config->updateFraTimer(false);
78  if (config->getPROCESS_EFF_HISTOS()) {
79  config->updateEffTimer(true);
81  config->updateEffTimer(false);
82  }
83  }
84 
90  unsigned int maskHWElements(std::vector<std::string>& tokens) {
91  return processor.maskHWElements(tokens);
92  }
93 
94 
99  void processStandby(HWStandbyType& standby) {
100  if (lastStandby != standby) {
102  if (config->getIN_FULL_STANDBY()) {
103  // Lets mark CSCs as BAD - have not ever ever been in !STANDBY
104  if (!fullStandbyProcessed) {
107  fullStandbyProcessed = true;
108  }
109  }
110  lastStandby = standby;
111  }
112  }
113 
114  };
115 
120  class Dispatcher {
121 
122  public:
123 
124  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider);
125 
130 #ifdef DQMMT
131  threads.join_all();
132 #endif
133  }
134 
135  void init();
137  const bool getHisto(const HistoDef& histoD, MonitorObject*& me);
138  unsigned int maskHWElements(std::vector<std::string>& tokens);
139  void processStandby(HWStandbyType& standby);
140 
141  private:
142 
144 
147 
150 
153 
156 
159 
162 
163 #ifdef DQMMT
164 
166  boost::thread_group threads;
167 
168 #endif
169 
170 #ifdef DQMLOCAL
171 
172  public:
173 
174  void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
175 
176 #endif
177 
178 #ifdef DQMGLOBAL
179 
180  public:
181 
182  void processEvent(const edm::Event& e, const edm::InputTag& inputTag, HWStandbyType& standby);
183 
184 #endif
185 
186  };
187 
188 }
189 
190 #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.
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:109
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
Lockable interface that blocks thread.
Definition: CSCDQM_Lock.h:42
Locking object (wrapper) that holds a separate EventProcessor. This object can be used (theoretically...