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
CSCDQM_Logger.h
cscdqm::HistoDef
Abstract Base Histogram Definition.
Definition: CSCDQM_HistoDef.h:62
cscdqm::EventProcessor::standbyEfficiencyHistos
void standbyEfficiencyHistos(HWStandbyType &standby)
apply standby flags/parameters
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:348
cscdqm::HWStandbyType
Definition: CSCDQM_EventProcessor.h:59
cscdqm::Dispatcher::cache
Cache cache
Definition: CSCDQM_Dispatcher.h:161
cscdqm::Dispatcher::Dispatcher
Dispatcher(Configuration *const p_config, MonitorObjectProvider *const p_provider)
Constructor.
Definition: CSCDQM_Dispatcher.cc:29
cscdqm::EventProcessor::writeShifterHistograms
void writeShifterHistograms()
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:231
cscdqm::Collection
Manage collection of histograms, load histogram definitions from XML file and book histograms by call...
Definition: CSCDQM_Collection.h:71
cscdqm::Dispatcher::updateFractionAndEfficiencyHistos
void updateFractionAndEfficiencyHistos()
On demand update fraction and efficiency MOs.
Definition: CSCDQM_Dispatcher.cc:244
cscdqm::EventProcessorMutex::EventProcessorMutex
EventProcessorMutex(Configuration *const p_config)
Constructor.
Definition: CSCDQM_Dispatcher.h:63
cscdqm::EventProcessorMutex::lastStandby
HWStandbyType lastStandby
Definition: CSCDQM_Dispatcher.h:56
cscdqm::Dispatcher::~Dispatcher
~Dispatcher()
Destructor. Joins and waits to complete all threads.
Definition: CSCDQM_Dispatcher.h:129
cscdqm::Dispatcher::processorFract
EventProcessorMutex processorFract
Definition: CSCDQM_Dispatcher.h:164
CSCDQM_Cache.h
CSCDQM_Collection.h
CSCDQM_HistoDef.h
cscdqm::EventProcessor::updateEfficiencyHistos
void updateEfficiencyHistos()
Update Efficiency MOs.
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:26
config
Definition: config.py:1
CSCDQM_Configuration.h
cscdqm::Dispatcher::config
Configuration * config
Definition: CSCDQM_Dispatcher.h:149
cscdqm::Lock
Lockable interface that blocks thread.
Definition: CSCDQM_Lock.h:42
cscdqm::EventProcessorMutex::config
Configuration * config
Definition: CSCDQM_Dispatcher.h:50
cscdqm::Dispatcher::updateFractionAndEfficiencyHistosAuto
void updateFractionAndEfficiencyHistosAuto()
Automatically called fraction and efficiency MOs update function.
Definition: CSCDQM_Dispatcher.cc:233
processEvent
dispatcher processEvent(e, inputTag, standby)
cscdqm::EventProcessorMutex::processStandby
void processStandby(HWStandbyType &standby)
Process standby information.
Definition: CSCDQM_Dispatcher.h:95
cscdqm::EventProcessorMutex
Locking object (wrapper) that holds a separate EventProcessor. This object can be used (theoretically...
Definition: CSCDQM_Dispatcher.h:44
cscdqm::Cache
MonitorObject cache - list objects and routines to manage cache.
Definition: CSCDQM_Cache.h:99
CommonMethods.lock
def lock()
Definition: CommonMethods.py:82
cscdqm
Definition: CSCDQM_DCSBase.h:29
cscdqm::Dispatcher::maskHWElements
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
Definition: CSCDQM_Dispatcher.cc:177
cscdqm::Dispatcher::commonConstruct
void commonConstruct(Configuration *const p_config, MonitorObjectProvider *const p_provider)
Definition: CSCDQM_Dispatcher.cc:54
cscdqm::EventProcessor::updateFractionHistos
void updateFractionHistos()
Update Fractional MOs.
Definition: CSCDQM_EventProcessor_updateFracHistos.cc:26
cscdqm::Dispatcher::collection
Collection collection
Definition: CSCDQM_Dispatcher.h:155
cscdqm::EventProcessorMutex::maskHWElements
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
Definition: CSCDQM_Dispatcher.h:89
cscdqm::Dispatcher::processor
EventProcessor processor
Definition: CSCDQM_Dispatcher.h:158
cscdqm::Dispatcher::processStandby
void processStandby(HWStandbyType &standby)
Set HW Standby modes.
Definition: CSCDQM_Dispatcher.cc:263
cscdqm::EventProcessorMutex::processor
EventProcessor processor
Definition: CSCDQM_Dispatcher.h:47
cscdqm::Configuration
CSCDQM Framework Global Configuration.
Definition: CSCDQM_Configuration.h:233
cscdqm::Dispatcher::provider
MonitorObjectProvider * provider
Definition: CSCDQM_Dispatcher.h:152
cscdqm::EventProcessorMutex::fullStandbyProcessed
bool fullStandbyProcessed
Definition: CSCDQM_Dispatcher.h:53
cscdqm::LockType
Definition: CSCDQM_Lock.h:31
CSCDQM_EventProcessor.h
cscdqm::Dispatcher::init
void init()
Initialize Dispatcher: book histograms, init processor, etc.
Definition: CSCDQM_Dispatcher.cc:85
cscdqm::Dispatcher::getHisto
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!
Definition: CSCDQM_Dispatcher.cc:187
cscdqm::Dispatcher
CSCDQM Framework frontend and Histogram Cache controller.
Definition: CSCDQM_Dispatcher.h:115
cscdqm::EventProcessor::maskHWElements
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
Definition: CSCDQM_EventProcessor.cc:202
cscdqm::MonitorObject
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
Definition: CSCDQM_MonitorObject.h:35
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cscdqm::Lock::mutex
bool mutex
Definition: CSCDQM_Lock.h:48
cscdqm::EventProcessor
Object used to process Events and compute statistics.
Definition: CSCDQM_EventProcessor.h:99
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
CSCDQM_Lock.h
cscdqm::Dispatcher::book
void book()
Definition: CSCDQM_Dispatcher.cc:91
edm::Event
Definition: Event.h:73
cscdqm::EventProcessorMutex::updateFractionAndEfficiencyHistos
void updateFractionAndEfficiencyHistos()
Update Fraction and Efficiency histograms.
Definition: CSCDQM_Dispatcher.h:72
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
cscdqm::MonitorObjectProvider
Interface for Histogram providing objects. Used by Event Processor to retrieve MonitorObject 's and b...
Definition: CSCDQM_MonitorObjectProvider.h:124