CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
20 
21 namespace cscdqm {
22 
23 
29 
30  config = p_config;
31  // fFirstEvent = true;
32  fCloseL1As = true;
33 
34  }
35 
40 
41  }
42 
50  if (config->fnGetCacheEMUHisto(histo, me)) return (me != NULL);
51  EMUHistoDef histoD(histo);
52  if (config->fnGetHisto(histoD, me)) return (me != NULL);
53  return false;
54  }
55 
63  const bool EventProcessor::getFEDHisto(const HistoId& histo, const HwId& fedID, MonitorObject*& me) {
64  if (config->fnGetCacheFEDHisto(histo, fedID, me)) return (me != NULL);
65  FEDHistoDef histoD(histo, fedID);
66  if (config->fnGetHisto(histoD, me)) return (me != NULL);
67  return false;
68  }
69 
77  const bool EventProcessor::getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me) {
78  if (config->fnGetCacheDDUHisto(histo, dduID, me)) return (me != NULL);
79  DDUHistoDef histoD(histo, dduID);
80  if (config->fnGetHisto(histoD, me)) return (me != NULL);
81  return false;
82  }
83 
92  const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me) {
93  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me)) return (me != NULL);
94  CSCHistoDef histoD(histo, crateID, dmbSlot);
95  if (config->fnGetHisto(histoD, me)) return (me != NULL);
96  return false;
97  }
98 
109  const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me) {
110  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me)) return (me != NULL);
111  CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
112  if (config->fnGetHisto(histoD, me)) return (me != NULL);
113  return false;
114  }
115 
123  if (config->fnGetCacheParHisto(histo, me)) return (me != NULL);
124  ParHistoDef histoD(histo);
125  if (config->fnGetHisto(histoD, me)) return (me != NULL);
126  return false;
127  }
128 
137  const bool EventProcessor::getCSCFromMap(const unsigned int& crateId, const unsigned int& dmbId, unsigned int& cscType, unsigned int& cscPosition) const {
138  bool result = false;
139 
140  CSCDetId cid;
141  if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
142  cscPosition = cid.chamber();
143  int iring = cid.ring();
144  int istation = cid.station();
145  int iendcap = cid.endcap();
146  std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
147  cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
148  result = true;
149  }
150 
151  /*
152  if (!result) {
153  LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
154  }
155  */
156 
157  return result;
158 
159  }
160 
167  unsigned int EventProcessor::maskHWElements(std::vector<std::string>& tokens) {
168  unsigned int masked = summary.setMaskedHWElements(tokens);
169  LOG_INFO << masked << " HW Elements masked";
170  return masked;
171  }
172 
173 }
int chamber() const
Definition: CSCDetId.h:70
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
boost::function< bool(const HistoId id, MonitorObject *&mo) > fnGetCacheParHisto
#define LOG_INFO
Definition: CSCDQM_Logger.h:43
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.
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoId id, const HwId &id1, const HwId &id2, const HwId &id3, MonitorObject *&mo) > fnGetCacheCSCHisto
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:95
CSCDQM Framework Global Configuration.
unsigned int HistoId
EventProcessor(Configuration *const p_config)
Constructor.
tuple result
Definition: query.py:137
boost::function< bool(const HistoDef &histoT, MonitorObject *&) > fnGetHisto
boost::function< bool(const unsigned int, const unsigned int, CSCDetId &) > fnGetCSCDetId
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.
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
int ring() const
Definition: CSCDetId.h:77
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.
boost::function< bool(const HistoId id, const HwId &id1, MonitorObject *&mo) > fnGetCacheFEDHisto
bool fCloseL1As
Total Number of TMBs per event from DMB DAV.
int station() const
Definition: CSCDetId.h:88
boost::function< bool(const HistoId id, const HwId &id1, MonitorObject *&mo) > fnGetCacheDDUHisto
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
boost::function< bool(const HistoId id, MonitorObject *&mo) > fnGetCacheEMUHisto