CMS 3D CMS Logo

CSCDQM_EventProcessor.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: EventProcessor.cc
5  *
6  * Description: EventProcessor Object General methods
7  *
8  * Version: 1.0
9  * Created: 10/03/2008 10:47:11 AM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius (VR), Valdas.Rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
19 #include "CSCDQM_EventProcessor.h"
20 
21 namespace cscdqm {
22 
28  config = p_config;
29  // fFirstEvent = true;
30  fCloseL1As = true;
31  }
32 
33 #ifdef DQMGLOBAL
34 
42  const edm::InputTag& itag,
43  edm::ConsumesCollector& coco) {
44  config = p_config;
45 
46  // set token for data access
48 
49  // fFirstEvent = true;
50  fCloseL1As = true;
51  }
52 
53 #endif
54 
59 
67  if (config->fnGetCacheEMUHisto(histo, me))
68  return (me != nullptr);
69  EMUHistoDef histoD(histo);
70  if (config->fnGetHisto(histoD, me))
71  return (me != nullptr);
72  return false;
73  }
74 
82  const bool EventProcessor::getFEDHisto(const HistoId& histo, const HwId& fedID, MonitorObject*& me) {
83  if (config->fnGetCacheFEDHisto(histo, fedID, me))
84  return (me != nullptr);
85  FEDHistoDef histoD(histo, fedID);
86  if (config->fnGetHisto(histoD, me))
87  return (me != nullptr);
88  return false;
89  }
90 
98  const bool EventProcessor::getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me) {
99  if (config->fnGetCacheDDUHisto(histo, dduID, me))
100  return (me != nullptr);
101  DDUHistoDef histoD(histo, dduID);
102  if (config->fnGetHisto(histoD, me))
103  return (me != nullptr);
104  return false;
105  }
106 
116  const HwId& crateID,
117  const HwId& dmbSlot,
118  MonitorObject*& me) {
119  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me))
120  return (me != nullptr);
121  CSCHistoDef histoD(histo, crateID, dmbSlot);
122  if (config->fnGetHisto(histoD, me))
123  return (me != nullptr);
124  return false;
125  }
126 
138  const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me) {
139  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me))
140  return (me != nullptr);
141  CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
142  if (config->fnGetHisto(histoD, me))
143  return (me != nullptr);
144  return false;
145  }
146 
154  if (config->fnGetCacheParHisto(histo, me))
155  return (me != nullptr);
156  ParHistoDef histoD(histo);
157  if (config->fnGetHisto(histoD, me))
158  return (me != nullptr);
159  return false;
160  }
161 
170  const bool EventProcessor::getCSCFromMap(const unsigned int& crateId,
171  const unsigned int& dmbId,
172  unsigned int& cscType,
173  unsigned int& cscPosition) const {
174  bool result = false;
175 
176  CSCDetId cid;
177  if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
178  cscPosition = cid.chamber();
179  int iring = cid.ring();
180  int istation = cid.station();
181  int iendcap = cid.endcap();
182  std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
183  cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
184  result = true;
185  }
186 
187  /*
188  if (!result) {
189  LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
190  }
191  */
192 
193  return result;
194  }
195 
202  unsigned int EventProcessor::maskHWElements(std::vector<std::string>& tokens) {
203  unsigned int masked = summary.setMaskedHWElements(tokens);
204  LOG_INFO << masked << " HW Elements masked";
205  return masked;
206  }
207 
208 } // namespace cscdqm
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int chamber() const
Definition: CSCDetId.h:62
const unsigned int setMaskedHWElements(std::vector< std::string > &tokens)
Read HW element masks (strings), create Address and apply to detector map.
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.
unsigned int HwId
#define LOG_INFO
Definition: CSCDQM_Logger.h:42
const bool getDDUHisto(const HistoId &histo, const HwId &dduID, MonitorObject *&me)
Get DDU Level Monitoring Object.
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
Parameter Histogram Definition.
Definition: config.py:1
void init()
Initialize EventProcessor: reading out config information.
CSC Level Histogram Type.
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
int endcap() const
Definition: CSCDetId.h:85
CSCDQM Framework Global Configuration.
unsigned int HistoId
EventProcessor(Configuration *const p_config)
Constructor.
static std::string getCSCTypeLabel(int endcap, int station, int ring)
Get CSC label from CSC parameters.
const bool getParHisto(const HistoId &histo, MonitorObject *&me)
Get Parameter Monitoring Object.
EMU Level Histogram Definition.
DDU Level Histogram Definition.
tlabel
Definition: compare.py:28
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
int ring() const
Definition: CSCDetId.h:68
unsigned int maskHWElements(std::vector< std::string > &tokens)
Mask HW elements from the efficiency calculations. Can be applied on runtime!
FED Level Histogram Definition.
const bool getFEDHisto(const HistoId &histo, const HwId &fedID, MonitorObject *&me)
Get FED Level Monitoring Object.
edm::EDGetTokenT< FEDRawDataCollection > frdtoken
bool fCloseL1As
Data Format version (2005, 2013)
int station() const
Definition: CSCDetId.h:79
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.