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 
19 #include "CSCDQM_EventProcessor.h"
20 
21 namespace cscdqm {
22 
28 
29  config = p_config;
30  // fFirstEvent = true;
31  fCloseL1As = true;
32 
33  }
34 
35 #ifdef DQMGLOBAL
36 
43  EventProcessor::EventProcessor(Configuration* const p_config, const edm::InputTag& itag,
44  edm::ConsumesCollector& coco) {
45 
46  config = p_config;
47 
48  // set token for data access
50 
51  // fFirstEvent = true;
52  fCloseL1As = true;
53 
54  }
55 
56 #endif
57 
62 
63  }
64 
72  if (config->fnGetCacheEMUHisto(histo, me)) return (me != NULL);
73  EMUHistoDef histoD(histo);
74  if (config->fnGetHisto(histoD, me)) return (me != NULL);
75  return false;
76  }
77 
85  const bool EventProcessor::getFEDHisto(const HistoId& histo, const HwId& fedID, MonitorObject*& me) {
86  if (config->fnGetCacheFEDHisto(histo, fedID, me)) return (me != NULL);
87  FEDHistoDef histoD(histo, fedID);
88  if (config->fnGetHisto(histoD, me)) return (me != NULL);
89  return false;
90  }
91 
99  const bool EventProcessor::getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me) {
100  if (config->fnGetCacheDDUHisto(histo, dduID, me)) return (me != NULL);
101  DDUHistoDef histoD(histo, dduID);
102  if (config->fnGetHisto(histoD, me)) return (me != NULL);
103  return false;
104  }
105 
114  const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me) {
115  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me)) return (me != NULL);
116  CSCHistoDef histoD(histo, crateID, dmbSlot);
117  if (config->fnGetHisto(histoD, me)) return (me != NULL);
118  return false;
119  }
120 
131  const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me) {
132  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me)) return (me != NULL);
133  CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
134  if (config->fnGetHisto(histoD, me)) return (me != NULL);
135  return false;
136  }
137 
145  if (config->fnGetCacheParHisto(histo, me)) return (me != NULL);
146  ParHistoDef histoD(histo);
147  if (config->fnGetHisto(histoD, me)) return (me != NULL);
148  return false;
149  }
150 
159  const bool EventProcessor::getCSCFromMap(const unsigned int& crateId, const unsigned int& dmbId, unsigned int& cscType, unsigned int& cscPosition) const {
160  bool result = false;
161 
162  CSCDetId cid;
163  if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
164  cscPosition = cid.chamber();
165  int iring = cid.ring();
166  int istation = cid.station();
167  int iendcap = cid.endcap();
168  std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
169  cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
170  result = true;
171  }
172 
173  /*
174  if (!result) {
175  LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
176  }
177  */
178 
179  return result;
180 
181  }
182 
189  unsigned int EventProcessor::maskHWElements(std::vector<std::string>& tokens) {
190  unsigned int masked = summary.setMaskedHWElements(tokens);
191  LOG_INFO << masked << " HW Elements masked";
192  return masked;
193  }
194 
195 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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
edm::EDGetTokenT< FEDRawDataCollection > frdtoken
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