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);
75  processor.updateFractionHistos();
76  config->updateFraTimer(false);
77  if (config->getPROCESS_EFF_HISTOS()) {
78  config->updateEffTimer(true);
79  processor.updateEfficiencyHistos();
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) {
97  processor.standbyEfficiencyHistos(standby);
98  if (config->getIN_FULL_STANDBY()) {
99  // Lets mark CSCs as BAD - have not ever ever been in !STANDBY
100  if (!fullStandbyProcessed) {
101  processor.standbyEfficiencyHistos(standby);
102  processor.writeShifterHistograms();
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 
146  void updateFractionAndEfficiencyHistosAuto();
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
void updateFraTimer(const bool start)
Switch on/off fractional MO processing timer.
Object used to process Events and compute statistics.
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.
int init
Definition: HydjetWrapper.h:64
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.
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
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:79
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...