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_Cache.h"
33 #include "CSCDQM_Logger.h"
34 #include "CSCDQM_Lock.h"
35 
36 namespace cscdqm {
37 
43  class EventProcessorMutex : public Lock {
44 
45  private:
46 
49 
52 
55 
58 
59  public:
60 
65  EventProcessorMutex(Configuration* const p_config) : processor(p_config) {
66  config = p_config;
67  fullStandbyProcessed = false;
68  }
69 
76  config->updateFraTimer(true);
78  config->updateFraTimer(false);
79  if (config->getPROCESS_EFF_HISTOS()) {
80  config->updateEffTimer(true);
82  config->updateEffTimer(false);
83  }
84  }
85 
91  unsigned int maskHWElements(std::vector<std::string>& tokens) {
92  return processor.maskHWElements(tokens);
93  }
94 
95 
100  void processStandby(HWStandbyType& standby) {
101  if (lastStandby != standby) {
103  if (config->getIN_FULL_STANDBY()) {
104  // Lets mark CSCs as BAD - have not ever ever been in !STANDBY
105  if (!fullStandbyProcessed) {
108  fullStandbyProcessed = true;
109  }
110  }
111  lastStandby = standby;
112  }
113  }
114 
115  };
116 
121  class Dispatcher {
122 
123  public:
124 
125  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider);
126 
127 #ifdef DQMGLOBAL
128  Dispatcher(Configuration* const p_config, MonitorObjectProvider* const p_provider,
129  const edm::InputTag& itag, edm::ConsumesCollector&& coco);
130 #endif
131 
136 #ifdef DQMMT
137  threads.join_all();
138 #endif
139  }
140 
141  void init();
143  const bool getHisto(const HistoDef& histoD, MonitorObject*& me);
144  unsigned int maskHWElements(std::vector<std::string>& tokens);
145  void processStandby(HWStandbyType& standby);
146 
147  private:
148 
149  // Old content of ctor into separate function so it can be called by both ctors
150  void commonConstruct(Configuration* const p_config, MonitorObjectProvider* const p_provider);
151 
153 
156 
159 
162 
165 
168 
171 
172 #ifdef DQMMT
173 
175  boost::thread_group threads;
176 
177 #endif
178 
179 #ifdef DQMLOCAL
180 
181  public:
182 
183  void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
184 
185 #endif
186 
187 #ifdef DQMGLOBAL
188 
189  public:
190 
191  void processEvent(const edm::Event& e, const edm::InputTag& inputTag, HWStandbyType& standby);
192 
193 #endif
194 
195  };
196 
197 }
198 
199 #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!
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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...