56 template <
typename DataType>
61 typedef std::map<EcalLogicID, DataType> DataSet;
62 typedef double (*DataExtractor)(
DataType const &);
63 typedef std::map<std::string, DataExtractor> ExtractorList;
67 for (
typename ExtractorList::const_iterator eItr(_extractors.begin()); eItr != _extractors.end(); ++eItr)
68 if (_formula.find(eItr->first) != std::string::npos)
69 varMap[eItr->first] = eItr->second;
71 if (varMap.size() > 4)
72 throw cms::Exception(
"EcalDQM") << _formula <<
" has too many variables";
77 char varChars[4][2] = {
"x",
"y",
"z",
"t"};
78 for (
typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr)
79 formula.ReplaceAll(vItr->first, varChars[iV++]);
81 TFormula tformula(
"formula",
formula);
82 if (tformula.Compile() != 0)
83 throw cms::Exception(
"EcalDQM") << _formula <<
" could not be compiled";
90 for (
typename DataSet::const_iterator dItr(
dataSet.begin()); dItr !=
dataSet.end(); ++dItr) {
93 for (
typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr)
94 vars[iV++] = vItr->second(dItr->second);
103 std::map<std::string, double (*)(MonCrystalConsistencyDat const &)> extList;
107 return double(dat.getProblematicEvents());
111 return double(dat.getProblemsGainZero());
114 return double(dat.getProblemsGainSwitch());
121 std::map<std::string, double (*)(MonTTConsistencyDat const &)> extList;
123 extList[
"processed_events"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProcessedEvents()); };
124 extList[
"problematic_events"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProblematicEvents()); };
125 extList[
"problems_id"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProblemsID()); };
126 extList[
"problems_size"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProblemsSize()); };
127 extList[
"problems_LV1"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProblemsLV1()); };
128 extList[
"problems_bunch_X"] = [](
MonTTConsistencyDat const &dat) {
return double(dat.getProblemsBunchX()); };
134 std::map<std::string, double (*)(MonMemChConsistencyDat const &)> extList;
136 extList[
"processed_events"] = [](
MonMemChConsistencyDat const &dat) {
return double(dat.getProcessedEvents()); };
138 return double(dat.getProblematicEvents());
141 extList[
"problems_gain_zero"] = [](
MonMemChConsistencyDat const &dat) {
return double(dat.getProblemsGainZero()); };
143 return double(dat.getProblemsGainSwitch());
150 std::map<std::string, double (*)(MonMemTTConsistencyDat const &)> extList;
152 extList[
"processed_events"] = [](
MonMemTTConsistencyDat const &dat) {
return double(dat.getProcessedEvents()); };
154 return double(dat.getProblematicEvents());
157 extList[
"problems_size"] = [](
MonMemTTConsistencyDat const &dat) {
return double(dat.getProblemsSize()); };
159 extList[
"problems_bunch_X"] = [](
MonMemTTConsistencyDat const &dat) {
return double(dat.getProblemsBunchX()); };
165 std::map<std::string, double (*)(MonLaserBlueDat const &)> extList;
167 extList[
"apd_mean"] = [](
MonLaserBlueDat const &dat) {
return double(dat.getAPDMean()); };
168 extList[
"apd_rms"] = [](
MonLaserBlueDat const &dat) {
return double(dat.getAPDRMS()); };
169 extList[
"apd_over_pn_mean"] = [](
MonLaserBlueDat const &dat) {
return double(dat.getAPDOverPNMean()); };
170 extList[
"apd_over_pn_rms"] = [](
MonLaserBlueDat const &dat) {
return double(dat.getAPDOverPNRMS()); };
180 std::map<std::string, double (*)(MonPNBlueDat const &)> extList;
182 extList[
"adc_mean_g1"] = [](
MonPNBlueDat const &dat) {
return double(dat.getADCMeanG1()); };
183 extList[
"adc_rms_g1"] = [](
MonPNBlueDat const &dat) {
return double(dat.getADCRMSG1()); };
184 extList[
"ped_mean_g1"] = [](
MonPNBlueDat const &dat) {
return double(dat.getPedMeanG1()); };
185 extList[
"ped_rms_g1"] = [](
MonPNBlueDat const &dat) {
return double(dat.getPedRMSG1()); };
186 extList[
"adc_mean_g16"] = [](
MonPNBlueDat const &dat) {
return double(dat.getADCMeanG16()); };
187 extList[
"adc_rms_g16"] = [](
MonPNBlueDat const &dat) {
return double(dat.getADCRMSG16()); };
188 extList[
"ped_mean_g16"] = [](
MonPNBlueDat const &dat) {
return double(dat.getPedMeanG16()); };
189 extList[
"ped_rms_g16"] = [](
MonPNBlueDat const &dat) {
return double(dat.getPedMeanG16()); };
195 std::map<std::string, double (*)(MonLaserGreenDat const &)> extList;
197 extList[
"apd_mean"] = [](
MonLaserGreenDat const &dat) {
return double(dat.getAPDMean()); };
198 extList[
"apd_rms"] = [](
MonLaserGreenDat const &dat) {
return double(dat.getAPDRMS()); };
199 extList[
"apd_over_pn_mean"] = [](
MonLaserGreenDat const &dat) {
return double(dat.getAPDOverPNMean()); };
200 extList[
"apd_over_pn_rms"] = [](
MonLaserGreenDat const &dat) {
return double(dat.getAPDOverPNRMS()); };
210 std::map<std::string, double (*)(MonPNGreenDat const &)> extList;
212 extList[
"adc_mean_g1"] = [](
MonPNGreenDat const &dat) {
return double(dat.getADCMeanG1()); };
213 extList[
"adc_rms_g1"] = [](
MonPNGreenDat const &dat) {
return double(dat.getADCRMSG1()); };
214 extList[
"ped_mean_g1"] = [](
MonPNGreenDat const &dat) {
return double(dat.getPedMeanG1()); };
215 extList[
"ped_rms_g1"] = [](
MonPNGreenDat const &dat) {
return double(dat.getPedRMSG1()); };
216 extList[
"adc_mean_g16"] = [](
MonPNGreenDat const &dat) {
return double(dat.getADCMeanG16()); };
217 extList[
"adc_rms_g16"] = [](
MonPNGreenDat const &dat) {
return double(dat.getADCRMSG16()); };
218 extList[
"ped_mean_g16"] = [](
MonPNGreenDat const &dat) {
return double(dat.getPedMeanG16()); };
219 extList[
"ped_rms_g16"] = [](
MonPNGreenDat const &dat) {
return double(dat.getPedMeanG16()); };
225 std::map<std::string, double (*)(MonLaserIRedDat const &)> extList;
227 extList[
"apd_mean"] = [](
MonLaserIRedDat const &dat) {
return double(dat.getAPDMean()); };
228 extList[
"apd_rms"] = [](
MonLaserIRedDat const &dat) {
return double(dat.getAPDRMS()); };
229 extList[
"apd_over_pn_mean"] = [](
MonLaserIRedDat const &dat) {
return double(dat.getAPDOverPNMean()); };
230 extList[
"apd_over_pn_rms"] = [](
MonLaserIRedDat const &dat) {
return double(dat.getAPDOverPNRMS()); };
240 std::map<std::string, double (*)(MonPNIRedDat const &)> extList;
242 extList[
"adc_mean_g1"] = [](
MonPNIRedDat const &dat) {
return double(dat.getADCMeanG1()); };
243 extList[
"adc_rms_g1"] = [](
MonPNIRedDat const &dat) {
return double(dat.getADCRMSG1()); };
244 extList[
"ped_mean_g1"] = [](
MonPNIRedDat const &dat) {
return double(dat.getPedMeanG1()); };
245 extList[
"ped_rms_g1"] = [](
MonPNIRedDat const &dat) {
return double(dat.getPedRMSG1()); };
246 extList[
"adc_mean_g16"] = [](
MonPNIRedDat const &dat) {
return double(dat.getADCMeanG16()); };
247 extList[
"adc_rms_g16"] = [](
MonPNIRedDat const &dat) {
return double(dat.getADCRMSG16()); };
248 extList[
"ped_mean_g16"] = [](
MonPNIRedDat const &dat) {
return double(dat.getPedMeanG16()); };
249 extList[
"ped_rms_g16"] = [](
MonPNIRedDat const &dat) {
return double(dat.getPedMeanG16()); };
255 std::map<std::string, double (*)(MonLaserRedDat const &)> extList;
257 extList[
"apd_mean"] = [](
MonLaserRedDat const &dat) {
return double(dat.getAPDMean()); };
258 extList[
"apd_rms"] = [](
MonLaserRedDat const &dat) {
return double(dat.getAPDRMS()); };
259 extList[
"apd_over_pn_mean"] = [](
MonLaserRedDat const &dat) {
return double(dat.getAPDOverPNMean()); };
260 extList[
"apd_over_pn_rms"] = [](
MonLaserRedDat const &dat) {
return double(dat.getAPDOverPNRMS()); };
270 std::map<std::string, double (*)(MonPNRedDat const &)> extList;
272 extList[
"adc_mean_g1"] = [](
MonPNRedDat const &dat) {
return double(dat.getADCMeanG1()); };
273 extList[
"adc_rms_g1"] = [](
MonPNRedDat const &dat) {
return double(dat.getADCRMSG1()); };
274 extList[
"ped_mean_g1"] = [](
MonPNRedDat const &dat) {
return double(dat.getPedMeanG1()); };
275 extList[
"ped_rms_g1"] = [](
MonPNRedDat const &dat) {
return double(dat.getPedRMSG1()); };
276 extList[
"adc_mean_g16"] = [](
MonPNRedDat const &dat) {
return double(dat.getADCMeanG16()); };
277 extList[
"adc_rms_g16"] = [](
MonPNRedDat const &dat) {
return double(dat.getADCRMSG16()); };
278 extList[
"ped_mean_g16"] = [](
MonPNRedDat const &dat) {
return double(dat.getPedMeanG16()); };
279 extList[
"ped_rms_g16"] = [](
MonPNRedDat const &dat) {
return double(dat.getPedMeanG16()); };
285 std::map<std::string, double (*)(MonPedestalsDat const &)> extList;
287 extList[
"ped_mean_g1"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedMeanG1()); };
288 extList[
"ped_rms_g1"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedRMSG1()); };
289 extList[
"ped_mean_g6"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedMeanG6()); };
290 extList[
"ped_rms_g6"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedRMSG6()); };
291 extList[
"ped_mean_g12"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedMeanG12()); };
292 extList[
"ped_rms_g12"] = [](
MonPedestalsDat const &dat) {
return double(dat.getPedRMSG12()); };
298 std::map<std::string, double (*)(MonPNPedDat const &)> extList;
300 extList[
"ped_mean_g1"] = [](
MonPNPedDat const &dat) {
return double(dat.getPedMeanG1()); };
301 extList[
"ped_rms_g1"] = [](
MonPNPedDat const &dat) {
return double(dat.getPedRMSG1()); };
302 extList[
"ped_mean_g16"] = [](
MonPNPedDat const &dat) {
return double(dat.getPedMeanG16()); };
303 extList[
"ped_rms_g16"] = [](
MonPNPedDat const &dat) {
return double(dat.getPedRMSG16()); };
309 std::map<std::string, double (*)(MonPedestalsOnlineDat const &)> extList;
311 extList[
"adc_mean_g12"] = [](
MonPedestalsOnlineDat const &dat) {
return double(dat.getADCMeanG12()); };
312 extList[
"adc_rms_g12"] = [](
MonPedestalsOnlineDat const &dat) {
return double(dat.getADCRMSG12()); };
318 std::map<std::string, double (*)(MonTestPulseDat const &)> extList;
320 extList[
"adc_mean_g1"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCMeanG1()); };
321 extList[
"adc_rms_g1"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCRMSG1()); };
322 extList[
"adc_mean_g6"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCMeanG6()); };
323 extList[
"adc_rms_g6"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCRMSG6()); };
324 extList[
"adc_mean_g12"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCMeanG12()); };
325 extList[
"adc_rms_g12"] = [](
MonTestPulseDat const &dat) {
return double(dat.getADCRMSG12()); };
331 std::map<std::string, double (*)(MonPulseShapeDat const &)> extList;
333 extList[
"g1_avg_sample_01"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[0]); };
334 extList[
"g1_avg_sample_02"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[1]); };
335 extList[
"g1_avg_sample_03"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[2]); };
336 extList[
"g1_avg_sample_04"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[3]); };
337 extList[
"g1_avg_sample_05"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[4]); };
338 extList[
"g1_avg_sample_06"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[5]); };
339 extList[
"g1_avg_sample_07"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[6]); };
340 extList[
"g1_avg_sample_08"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[7]); };
341 extList[
"g1_avg_sample_09"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[8]); };
342 extList[
"g1_avg_sample_10"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(1)[9]); };
343 extList[
"g6_avg_sample_01"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[0]); };
344 extList[
"g6_avg_sample_02"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[1]); };
345 extList[
"g6_avg_sample_03"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[2]); };
346 extList[
"g6_avg_sample_04"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[3]); };
347 extList[
"g6_avg_sample_05"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[4]); };
348 extList[
"g6_avg_sample_06"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[5]); };
349 extList[
"g6_avg_sample_07"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[6]); };
350 extList[
"g6_avg_sample_08"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[7]); };
351 extList[
"g6_avg_sample_09"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[8]); };
352 extList[
"g6_avg_sample_10"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(6)[9]); };
353 extList[
"g12_avg_sample_01"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[0]); };
354 extList[
"g12_avg_sample_02"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[1]); };
355 extList[
"g12_avg_sample_03"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[2]); };
356 extList[
"g12_avg_sample_04"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[3]); };
357 extList[
"g12_avg_sample_05"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[4]); };
358 extList[
"g12_avg_sample_06"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[5]); };
359 extList[
"g12_avg_sample_07"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[6]); };
360 extList[
"g12_avg_sample_08"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[7]); };
361 extList[
"g12_avg_sample_09"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[8]); };
362 extList[
"g12_avg_sample_10"] = [](
MonPulseShapeDat const &dat) {
return double(dat.getSamples(12)[9]); };
368 std::map<std::string, double (*)(MonPNMGPADat const &)> extList;
370 extList[
"adc_mean_g1"] = [](
MonPNMGPADat const &dat) {
return double(dat.getADCMeanG1()); };
371 extList[
"adc_rms_g1"] = [](
MonPNMGPADat const &dat) {
return double(dat.getADCRMSG1()); };
372 extList[
"ped_mean_g1"] = [](
MonPNMGPADat const &dat) {
return double(dat.getPedMeanG1()); };
373 extList[
"ped_rms_g1"] = [](
MonPNMGPADat const &dat) {
return double(dat.getPedRMSG1()); };
374 extList[
"adc_mean_g16"] = [](
MonPNMGPADat const &dat) {
return double(dat.getADCMeanG16()); };
375 extList[
"adc_rms_g16"] = [](
MonPNMGPADat const &dat) {
return double(dat.getADCRMSG16()); };
376 extList[
"ped_mean_g16"] = [](
MonPNMGPADat const &dat) {
return double(dat.getPedMeanG16()); };
377 extList[
"ped_rms_g16"] = [](
MonPNMGPADat const &dat) {
return double(dat.getPedRMSG16()); };
385 std::map<std::string, double (*)(MonLed1Dat const &)> extList;
387 extList[
"vpt_mean"] = [](
MonLed1Dat const &dat) {
return double(dat.getVPTMean()); };
388 extList[
"vpt_rms"] = [](
MonLed1Dat const &dat) {
return double(dat.getVPTRMS()); };
389 extList[
"vpt_over_pn_mean"] = [](
MonLed1Dat const &dat) {
return double(dat.getVPTOverPNMean()); };
390 extList[
"vpt_over_pn_rms"] = [](
MonLed1Dat const &dat) {
return double(dat.getVPTOverPNRMS()); };
400 std::map<std::string, double (*)(MonLed2Dat const &)> extList;
402 extList[
"vpt_mean"] = [](
MonLed2Dat const &dat) {
return double(dat.getVPTMean()); };
403 extList[
"vpt_rms"] = [](
MonLed2Dat const &dat) {
return double(dat.getVPTRMS()); };
404 extList[
"vpt_over_pn_mean"] = [](
MonLed2Dat const &dat) {
return double(dat.getVPTOverPNMean()); };
405 extList[
"vpt_over_pn_rms"] = [](
MonLed2Dat const &dat) {
return double(dat.getVPTOverPNRMS()); };
415 std::map<std::string, double (*)(MonOccupancyDat const &)> extList;
417 extList[
"events_over_low_threshold"] = [](
MonOccupancyDat const &dat) {
418 return double(dat.getEventsOverLowThreshold());
420 extList[
"events_over_high_threshold"] = [](
MonOccupancyDat const &dat) {
421 return double(dat.getEventsOverHighThreshold());
423 extList[
"avg_energy"] = [](
MonOccupancyDat const &dat) {
return double(dat.getAvgEnergy()); };
ReturnType fetchAndFill(std::map< std::string, double(*)(DataType const &)> const &_extractors, EcalCondDBInterface *_db, MonRunIOV &_iov, std::string const &_formula)
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > ReturnType
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
DetId toDetId(EcalLogicID const &)
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override
std::map< DetId, double > run(EcalCondDBInterface *, MonRunIOV &, std::string const &) override