CMS 3D CMS Logo

CSCDQM_EventProcessor.h
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: EventProcessor.h
5  *
6  * Description: Object which processes Event and provides Hits to
7  * HitHandler object.
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_EventProcessor_H
21 #define CSCDQM_EventProcessor_H
22 
23 #include <set>
24 #include <string>
25 #include <cmath>
26 
27 #include <TString.h>
28 
29 #ifdef DQMGLOBAL
30 
37 
38 #endif
39 
40 #include "CSCDQM_Logger.h"
41 #include "CSCDQM_Summary.h"
43 #include "CSCDQM_Configuration.h"
44 #include "CSCDQM_Configuration.h"
45 
50 
53 
54 namespace cscdqm {
55 
59  struct HWStandbyType {
60  // if standby flag should be considered at all?
61  // at the start it will be false, thus good for last value ;)
62  bool process;
63 
64  // ME+
65  bool MeP;
66 
67  // ME-
68  bool MeM;
69 
70  HWStandbyType() { process = MeP = MeM = false; }
71 
72  void applyMeP(bool ready) { MeP = MeP || !ready; }
73 
74  void applyMeM(bool ready) { MeM = MeM || !ready; }
75 
76  bool fullStandby() const { return (MeM && MeP); }
77 
78  bool operator==(const HWStandbyType& t) const { return (t.MeP == MeP && t.MeM == MeM && t.process == process); }
79 
80  bool operator!=(const HWStandbyType& t) const { return !(*this == t); }
81 
83  MeP = t.MeP;
84  MeM = t.MeM;
85  process = t.process;
86  return *this;
87  }
88  };
89 
90  typedef std::map<CSCIdType, ExaminerStatusType> CSCExaminerMapType;
91  typedef std::vector<DDUIdType> DDUExaminerVectorType;
92  // typedef std::map<int, long> CSCExaminerMapType;
93  // typedef std::vector<int> DDUExaminerVectorType;
94 
100  // ===================================================================================================
101  // General stuff
102  // ===================================================================================================
103 
104  public:
105  EventProcessor(Configuration* const p_config);
106 
107 #ifdef DQMGLOBAL
108 
109  EventProcessor(Configuration* const p_config, const edm::InputTag& itag, edm::ConsumesCollector& coco);
110 
111 #endif
112 
117 
118  void init();
119 
120  void updateFractionHistos();
121  void updateEfficiencyHistos();
122  void standbyEfficiencyHistos(HWStandbyType& standby);
123  void writeShifterHistograms();
124 
125  unsigned int maskHWElements(std::vector<std::string>& tokens);
126 
127  private:
128  bool processExaminer(const CSCDCCExaminer& binChecker);
129  bool processExaminer(const CSCDCCExaminer& binChecker, const CSCDCCFormatStatusDigi& digi);
130  void processDDU(const CSCDDUEventData& data, const CSCDCCExaminer& binChecker);
131  void processCSC(const CSCEventData& data, const int dduID, const CSCDCCExaminer& binChecker);
132 
133  void calcEMUFractionHisto(const HistoId& result, const HistoId& set, const HistoId& subset);
134 
135  const bool getEMUHisto(const HistoId& histo, MonitorObject*& me);
136  const bool getFEDHisto(const HistoId& histo, const HwId& fedID, MonitorObject*& me);
137  const bool getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me);
138  const bool getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me);
139  const bool getCSCHisto(
140  const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me);
141  const bool getParHisto(const HistoId& histo, MonitorObject*& me);
142  void preProcessEvent();
143 
144  const bool getCSCFromMap(const unsigned int& crateId,
145  const unsigned int& dmbId,
146  unsigned int& cscType,
147  unsigned int& cscPosition) const;
148  void setEmuEventDisplayBit(MonitorObject*& mo, const unsigned int x, const unsigned int y, const unsigned int bit);
149  void resetEmuEventDisplays();
150 
153 
156 
157  std::map<uint32_t, uint32_t> L1ANumbers;
158  std::map<uint32_t, bool> fNotFirstEvent;
159  uint32_t L1ANumber;
160  uint32_t BXN;
161  uint32_t cntDMBs;
162  uint32_t cntCFEBs;
163  uint32_t cntALCTs;
164  uint32_t cntTMBs;
165 
166  uint16_t theFormatVersion;
167 
168  // bool fFirstEvent;
169  bool fCloseL1As; // Close L1A bit from DDU Trailer
171 
172  // token for input
174 
175  // ===================================================================================================
176  // Local ONLY stuff
177  // ===================================================================================================
178 
179 #ifdef DQMLOCAL
180 
181  public:
182  void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
183 
184 #endif
185 
186  // ===================================================================================================
187  // Global ONLY stuff
188  // ===================================================================================================
189 
190 #ifdef DQMGLOBAL
191 
192  private:
193  bool bCSCEventCounted;
194 
195  public:
196  void processEvent(const edm::Event& e, const edm::InputTag& inputTag);
197 
198 #endif
199  };
200 
201 } // namespace cscdqm
202 
203 #endif
FEDNumbering.h
CSCDQM_Logger.h
cscdqm::EventProcessor::getEMUHisto
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
Definition: CSCDQM_EventProcessor.cc:66
cscdqm::CSCExaminerMapType
std::map< CSCIdType, ExaminerStatusType > CSCExaminerMapType
Definition: CSCDQM_EventProcessor.h:90
cscdqm::EventProcessor::resetEmuEventDisplays
void resetEmuEventDisplays()
Reset Emu level EventDisplay histograms once per event.
Definition: CSCDQM_EventProcessor_processCSC.cc:56
cscdqm::EventProcessor::fCloseL1As
bool fCloseL1As
Data Format version (2005, 2013)
Definition: CSCDQM_EventProcessor.h:169
cscdqm::EventProcessor::standbyEfficiencyHistos
void standbyEfficiencyHistos(HWStandbyType &standby)
apply standby flags/parameters
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:348
cscdqm::HWStandbyType
Definition: CSCDQM_EventProcessor.h:59
CSCEventData
Definition: CSCEventData.h:28
cscdqm::HistoId
unsigned int HistoId
Definition: CSCDQM_HistoDef.h:35
cscdqm::Summary
Hardware and Physics Efficiency data structures and routines.
Definition: CSCDQM_Summary.h:78
cscdqm::EventProcessor::processCSC
void processCSC(const CSCEventData &data, const int dduID, const CSCDCCExaminer &binChecker)
Process Chamber Data and fill MOs.
Definition: CSCDQM_EventProcessor_processCSC.cc:81
cscdqm::EventProcessor::writeShifterHistograms
void writeShifterHistograms()
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:231
edm::EDGetTokenT< FEDRawDataCollection >
CSCCFEBData.h
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
cscdqm::HWStandbyType::operator==
bool operator==(const HWStandbyType &t) const
Definition: CSCDQM_EventProcessor.h:78
CSCDQM_Summary.h
CSCDDUEventData.h
cscdqm::EventProcessor::cntALCTs
uint32_t cntALCTs
Total Number of CFEBs per event from DMB DAV.
Definition: CSCDQM_EventProcessor.h:163
cscdqm::HWStandbyType::process
bool process
Definition: CSCDQM_EventProcessor.h:62
cscdqm::EventProcessor::preProcessEvent
void preProcessEvent()
Common Local and Global DQM function to be called before processing Event.
Definition: CSCDQM_EventProcessor_processEvent.cc:26
cscdqm::EventProcessor::processDDU
void processDDU(const CSCDDUEventData &data, const CSCDCCExaminer &binChecker)
Process DDU output and fill MOs.
Definition: CSCDQM_EventProcessor_processDDU.cc:27
cscdqm::EventProcessor::getCSCFromMap
const bool getCSCFromMap(const unsigned int &crateId, const unsigned int &dmbId, unsigned int &cscType, unsigned int &cscPosition) const
Get CSC type and position from crate and dmb identifiers.
Definition: CSCDQM_EventProcessor.cc:170
cscdqm::EventProcessor::processExaminer
bool processExaminer(const CSCDCCExaminer &binChecker)
cscdqm::EventProcessor::getDDUHisto
const bool getDDUHisto(const HistoId &histo, const HwId &dduID, MonitorObject *&me)
Get DDU Level Monitoring Object.
Definition: CSCDQM_EventProcessor.cc:98
cscdqm::HWStandbyType::MeM
bool MeM
Definition: CSCDQM_EventProcessor.h:68
cscdqm::EventProcessor::updateEfficiencyHistos
void updateEfficiencyHistos()
Update Efficiency MOs.
Definition: CSCDQM_EventProcessor_updateEffHistos.cc:26
CSCCFEBTimeSlice.h
cscdqm::HWStandbyType::operator=
const HWStandbyType & operator=(const HWStandbyType &t)
Definition: CSCDQM_EventProcessor.h:82
CSCDQM_Configuration.h
CSCDCCFormatStatusDigi
CSC Format Status Object.
Definition: CSCDCCFormatStatusDigi.h:160
cscdqm::EventProcessor::init
void init()
Initialize EventProcessor: reading out config information.
Definition: CSCDQM_EventProcessor.cc:58
cscdqm::HwId
unsigned int HwId
Definition: CSCDQM_HistoDef.h:38
CSCDCCEventData.h
cscdqm::HWStandbyType::operator!=
bool operator!=(const HWStandbyType &t) const
Definition: CSCDQM_EventProcessor.h:80
OrderedSet.t
t
Definition: OrderedSet.py:90
processEvent
dispatcher processEvent(e, inputTag, standby)
cscdqm::EventProcessor::summary
Summary summary
Definition: CSCDQM_EventProcessor.h:155
CSCDCCFormatStatusDigi.h
cscdqm::EventProcessor::~EventProcessor
~EventProcessor()
Destructor.
Definition: CSCDQM_EventProcessor.h:116
cscdqm::HWStandbyType::HWStandbyType
HWStandbyType()
Definition: CSCDQM_EventProcessor.h:70
cscdqm::EventProcessor::setEmuEventDisplayBit
void setEmuEventDisplayBit(MonitorObject *&mo, const unsigned int x, const unsigned int y, const unsigned int bit)
Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x !...
Definition: CSCDQM_EventProcessor_processCSC.cc:41
cscdqm::EventProcessor::calcEMUFractionHisto
void calcEMUFractionHisto(const HistoId &result, const HistoId &set, const HistoId &subset)
Calculate fractional histogram.
Definition: CSCDQM_EventProcessor_updateFracHistos.cc:86
Event.h
cscdqm
Definition: CSCDQM_DCSBase.h:29
cscdqm::EventProcessor::getCSCHisto
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
Definition: CSCDQM_EventProcessor.cc:115
cscdqm::EventProcessor::theFormatVersion
uint16_t theFormatVersion
Total Number of TMBs per event from DMB DAV.
Definition: CSCDQM_EventProcessor.h:166
CSCDCCExaminer
Definition: CSCDCCExaminer.h:15
cscdqm::EventProcessor::BXN
uint32_t BXN
Definition: CSCDQM_EventProcessor.h:160
FEDRawDataCollection.h
cscdqm::HWStandbyType::applyMeM
void applyMeM(bool ready)
Definition: CSCDQM_EventProcessor.h:74
cscdqm::EventProcessor::EventProcessor
EventProcessor(Configuration *const p_config)
Constructor.
Definition: CSCDQM_EventProcessor.cc:27
cscdqm::EventProcessor::updateFractionHistos
void updateFractionHistos()
Update Fractional MOs.
Definition: CSCDQM_EventProcessor_updateFracHistos.cc:26
cscdqm::EventProcessor::frdtoken
edm::EDGetTokenT< FEDRawDataCollection > frdtoken
Definition: CSCDQM_EventProcessor.h:173
cscdqm::EventProcessor::EmuEventDisplayWasReset
bool EmuEventDisplayWasReset
Definition: CSCDQM_EventProcessor.h:170
cscdqm::EventProcessor::config
Configuration * config
Definition: CSCDQM_EventProcessor.h:152
cscdqm::EventProcessor::cntTMBs
uint32_t cntTMBs
Total Number of ALCTs per event from DMB DAV.
Definition: CSCDQM_EventProcessor.h:164
cscdqm::EventProcessor::getFEDHisto
const bool getFEDHisto(const HistoId &histo, const HwId &fedID, MonitorObject *&me)
Get FED Level Monitoring Object.
Definition: CSCDQM_EventProcessor.cc:82
InputTag.h
cscdqm::Configuration
CSCDQM Framework Global Configuration.
Definition: CSCDQM_Configuration.h:233
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDCCExaminer.h
cscdqm::EventProcessor::L1ANumber
uint32_t L1ANumber
Definition: CSCDQM_EventProcessor.h:159
cscdqm::EventProcessor::getParHisto
const bool getParHisto(const HistoId &histo, MonitorObject *&me)
Get Parameter Monitoring Object.
Definition: CSCDQM_EventProcessor.cc:153
cscdqm::HWStandbyType::applyMeP
void applyMeP(bool ready)
Definition: CSCDQM_EventProcessor.h:72
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
mps_fire.result
result
Definition: mps_fire.py:303
ConsumesCollector.h
cscdqm::HWStandbyType::fullStandby
bool fullStandby() const
Definition: CSCDQM_EventProcessor.h:76
cscdqm::EventProcessor::cntCFEBs
uint32_t cntCFEBs
Total Number of DMBs per event from DDU Header DAV.
Definition: CSCDQM_EventProcessor.h:162
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
edm::Event
Definition: Event.h:73
cscdqm::HWStandbyType::MeP
bool MeP
Definition: CSCDQM_EventProcessor.h:65
cscdqm::EventProcessor::cntDMBs
uint32_t cntDMBs
Definition: CSCDQM_EventProcessor.h:161
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
cscdqm::DDUExaminerVectorType
std::vector< DDUIdType > DDUExaminerVectorType
Definition: CSCDQM_EventProcessor.h:91
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCDQM_StripClusterFinder.h
cscdqm::EventProcessor::fNotFirstEvent
std::map< uint32_t, bool > fNotFirstEvent
Definition: CSCDQM_EventProcessor.h:158
CSCDCCFormatStatusDigiCollection.h
cscdqm::EventProcessor::L1ANumbers
std::map< uint32_t, uint32_t > L1ANumbers
Definition: CSCDQM_EventProcessor.h:157