57 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) varMap[eItr->first] = eItr->second;
70 if(varMap.size() > 4)
throw cms::Exception(
"EcalDQM") << _formula <<
" has too many variables";
75 char varChars[4][2] = {
"x",
"y",
"z",
"t"};
76 for(
typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr)
77 formula.ReplaceAll(vItr->first, varChars[iV++]);
79 TFormula tformula(
"formula", formula);
80 if(tformula.Compile() != 0)
throw cms::Exception(
"EcalDQM") << _formula <<
" could not be compiled";
87 for(
typename DataSet::const_iterator dItr(dataSet.begin()); dItr != dataSet.end(); ++dItr){
90 for(
typename ExtractorList::iterator vItr(varMap.begin()); vItr != varMap.end(); ++vItr)
91 vars[iV++] = vItr->second(dItr->second);
93 result[
toDetId(dItr->first)] = tformula.EvalPar(vars);
102 std::map<std::string, double(*)(MonCrystalConsistencyDat const&)> extList;
105 extList[
"problematic_events"] = [](
MonCrystalConsistencyDat const& dat){
return double(dat.getProblematicEvents()); };
107 extList[
"problems_gain_zero"] = [](
MonCrystalConsistencyDat const& dat){
return double(dat.getProblemsGainZero()); };
108 extList[
"problems_gain_switch"] = [](
MonCrystalConsistencyDat const& dat){
return double(dat.getProblemsGainSwitch()); };
116 std::map<std::string, double(*)(MonTTConsistencyDat const&)> extList;
118 extList[
"processed_events"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProcessedEvents()); };
119 extList[
"problematic_events"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProblematicEvents()); };
120 extList[
"problems_id"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProblemsID()); };
121 extList[
"problems_size"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProblemsSize()); };
122 extList[
"problems_LV1"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProblemsLV1()); };
123 extList[
"problems_bunch_X"] = [](
MonTTConsistencyDat const& dat){
return double(dat.getProblemsBunchX()); };
131 std::map<std::string, double(*)(MonMemChConsistencyDat const&)> extList;
133 extList[
"processed_events"] = [](
MonMemChConsistencyDat const& dat){
return double(dat.getProcessedEvents()); };
134 extList[
"problematic_events"] = [](
MonMemChConsistencyDat const& dat){
return double(dat.getProblematicEvents()); };
136 extList[
"problems_gain_zero"] = [](
MonMemChConsistencyDat const& dat){
return double(dat.getProblemsGainZero()); };
137 extList[
"problems_gain_switch"] = [](
MonMemChConsistencyDat const& dat){
return double(dat.getProblemsGainSwitch()); };
145 std::map<std::string, double(*)(MonMemTTConsistencyDat const&)> extList;
147 extList[
"processed_events"] = [](
MonMemTTConsistencyDat const& dat){
return double(dat.getProcessedEvents()); };
148 extList[
"problematic_events"] = [](
MonMemTTConsistencyDat const& dat){
return double(dat.getProblematicEvents()); };
150 extList[
"problems_size"] = [](
MonMemTTConsistencyDat const& dat){
return double(dat.getProblemsSize()); };
152 extList[
"problems_bunch_X"] = [](
MonMemTTConsistencyDat const& dat){
return double(dat.getProblemsBunchX()); };
160 std::map<std::string, double(*)(MonLaserBlueDat const&)> extList;
162 extList[
"apd_mean"] = [](
MonLaserBlueDat const& dat){
return double(dat.getAPDMean()); };
163 extList[
"apd_rms"] = [](
MonLaserBlueDat const& dat){
return double(dat.getAPDRMS()); };
164 extList[
"apd_over_pn_mean"] = [](
MonLaserBlueDat const& dat){
return double(dat.getAPDOverPNMean()); };
165 extList[
"apd_over_pn_rms"] = [](
MonLaserBlueDat const& dat){
return double(dat.getAPDOverPNRMS()); };
179 std::map<std::string, double(*)(MonPNBlueDat const&)> extList;
181 extList[
"adc_mean_g1"] = [](
MonPNBlueDat const& dat){
return double(dat.getADCMeanG1()); };
182 extList[
"adc_rms_g1"] = [](
MonPNBlueDat const& dat){
return double(dat.getADCRMSG1()); };
183 extList[
"ped_mean_g1"] = [](
MonPNBlueDat const& dat){
return double(dat.getPedMeanG1()); };
184 extList[
"ped_rms_g1"] = [](
MonPNBlueDat const& dat){
return double(dat.getPedRMSG1()); };
185 extList[
"adc_mean_g16"] = [](
MonPNBlueDat const& dat){
return double(dat.getADCMeanG16()); };
186 extList[
"adc_rms_g16"] = [](
MonPNBlueDat const& dat){
return double(dat.getADCRMSG16()); };
187 extList[
"ped_mean_g16"] = [](
MonPNBlueDat const& dat){
return double(dat.getPedMeanG16()); };
188 extList[
"ped_rms_g16"] = [](
MonPNBlueDat const& dat){
return double(dat.getPedMeanG16()); };
196 std::map<std::string, double(*)(MonLaserGreenDat const&)> extList;
198 extList[
"apd_mean"] = [](
MonLaserGreenDat const& dat){
return double(dat.getAPDMean()); };
199 extList[
"apd_rms"] = [](
MonLaserGreenDat const& dat){
return double(dat.getAPDRMS()); };
200 extList[
"apd_over_pn_mean"] = [](
MonLaserGreenDat const& dat){
return double(dat.getAPDOverPNMean()); };
201 extList[
"apd_over_pn_rms"] = [](
MonLaserGreenDat const& dat){
return double(dat.getAPDOverPNRMS()); };
215 std::map<std::string, double(*)(MonPNGreenDat const&)> extList;
217 extList[
"adc_mean_g1"] = [](
MonPNGreenDat const& dat){
return double(dat.getADCMeanG1()); };
218 extList[
"adc_rms_g1"] = [](
MonPNGreenDat const& dat){
return double(dat.getADCRMSG1()); };
219 extList[
"ped_mean_g1"] = [](
MonPNGreenDat const& dat){
return double(dat.getPedMeanG1()); };
220 extList[
"ped_rms_g1"] = [](
MonPNGreenDat const& dat){
return double(dat.getPedRMSG1()); };
221 extList[
"adc_mean_g16"] = [](
MonPNGreenDat const& dat){
return double(dat.getADCMeanG16()); };
222 extList[
"adc_rms_g16"] = [](
MonPNGreenDat const& dat){
return double(dat.getADCRMSG16()); };
223 extList[
"ped_mean_g16"] = [](
MonPNGreenDat const& dat){
return double(dat.getPedMeanG16()); };
224 extList[
"ped_rms_g16"] = [](
MonPNGreenDat const& dat){
return double(dat.getPedMeanG16()); };
232 std::map<std::string, double(*)(MonLaserIRedDat const&)> extList;
234 extList[
"apd_mean"] = [](
MonLaserIRedDat const& dat){
return double(dat.getAPDMean()); };
235 extList[
"apd_rms"] = [](
MonLaserIRedDat const& dat){
return double(dat.getAPDRMS()); };
236 extList[
"apd_over_pn_mean"] = [](
MonLaserIRedDat const& dat){
return double(dat.getAPDOverPNMean()); };
237 extList[
"apd_over_pn_rms"] = [](
MonLaserIRedDat const& dat){
return double(dat.getAPDOverPNRMS()); };
251 std::map<std::string, double(*)(MonPNIRedDat const&)> extList;
253 extList[
"adc_mean_g1"] = [](
MonPNIRedDat const& dat){
return double(dat.getADCMeanG1()); };
254 extList[
"adc_rms_g1"] = [](
MonPNIRedDat const& dat){
return double(dat.getADCRMSG1()); };
255 extList[
"ped_mean_g1"] = [](
MonPNIRedDat const& dat){
return double(dat.getPedMeanG1()); };
256 extList[
"ped_rms_g1"] = [](
MonPNIRedDat const& dat){
return double(dat.getPedRMSG1()); };
257 extList[
"adc_mean_g16"] = [](
MonPNIRedDat const& dat){
return double(dat.getADCMeanG16()); };
258 extList[
"adc_rms_g16"] = [](
MonPNIRedDat const& dat){
return double(dat.getADCRMSG16()); };
259 extList[
"ped_mean_g16"] = [](
MonPNIRedDat const& dat){
return double(dat.getPedMeanG16()); };
260 extList[
"ped_rms_g16"] = [](
MonPNIRedDat const& dat){
return double(dat.getPedMeanG16()); };
268 std::map<std::string, double(*)(MonLaserRedDat const&)> extList;
270 extList[
"apd_mean"] = [](
MonLaserRedDat const& dat){
return double(dat.getAPDMean()); };
271 extList[
"apd_rms"] = [](
MonLaserRedDat const& dat){
return double(dat.getAPDRMS()); };
272 extList[
"apd_over_pn_mean"] = [](
MonLaserRedDat const& dat){
return double(dat.getAPDOverPNMean()); };
273 extList[
"apd_over_pn_rms"] = [](
MonLaserRedDat const& dat){
return double(dat.getAPDOverPNRMS()); };
287 std::map<std::string, double(*)(MonPNRedDat const&)> extList;
289 extList[
"adc_mean_g1"] = [](
MonPNRedDat const& dat){
return double(dat.getADCMeanG1()); };
290 extList[
"adc_rms_g1"] = [](
MonPNRedDat const& dat){
return double(dat.getADCRMSG1()); };
291 extList[
"ped_mean_g1"] = [](
MonPNRedDat const& dat){
return double(dat.getPedMeanG1()); };
292 extList[
"ped_rms_g1"] = [](
MonPNRedDat const& dat){
return double(dat.getPedRMSG1()); };
293 extList[
"adc_mean_g16"] = [](
MonPNRedDat const& dat){
return double(dat.getADCMeanG16()); };
294 extList[
"adc_rms_g16"] = [](
MonPNRedDat const& dat){
return double(dat.getADCRMSG16()); };
295 extList[
"ped_mean_g16"] = [](
MonPNRedDat const& dat){
return double(dat.getPedMeanG16()); };
296 extList[
"ped_rms_g16"] = [](
MonPNRedDat const& dat){
return double(dat.getPedMeanG16()); };
304 std::map<std::string, double(*)(MonPedestalsDat const&)> extList;
306 extList[
"ped_mean_g1"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedMeanG1()); };
307 extList[
"ped_rms_g1"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedRMSG1()); };
308 extList[
"ped_mean_g6"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedMeanG6()); };
309 extList[
"ped_rms_g6"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedRMSG6()); };
310 extList[
"ped_mean_g12"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedMeanG12()); };
311 extList[
"ped_rms_g12"] = [](
MonPedestalsDat const& dat){
return double(dat.getPedRMSG12()); };
319 std::map<std::string, double(*)(MonPNPedDat const&)> extList;
321 extList[
"ped_mean_g1"] = [](
MonPNPedDat const& dat){
return double(dat.getPedMeanG1()); };
322 extList[
"ped_rms_g1"] = [](
MonPNPedDat const& dat){
return double(dat.getPedRMSG1()); };
323 extList[
"ped_mean_g16"] = [](
MonPNPedDat const& dat){
return double(dat.getPedMeanG16()); };
324 extList[
"ped_rms_g16"] = [](
MonPNPedDat const& dat){
return double(dat.getPedRMSG16()); };
332 std::map<std::string, double(*)(MonPedestalsOnlineDat const&)> extList;
334 extList[
"adc_mean_g12"] = [](
MonPedestalsOnlineDat const& dat){
return double(dat.getADCMeanG12()); };
343 std::map<std::string, double(*)(MonTestPulseDat const&)> extList;
345 extList[
"adc_mean_g1"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCMeanG1()); };
346 extList[
"adc_rms_g1"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCRMSG1()); };
347 extList[
"adc_mean_g6"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCMeanG6()); };
348 extList[
"adc_rms_g6"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCRMSG6()); };
349 extList[
"adc_mean_g12"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCMeanG12()); };
350 extList[
"adc_rms_g12"] = [](
MonTestPulseDat const& dat){
return double(dat.getADCRMSG12()); };
358 std::map<std::string, double(*)(MonPulseShapeDat const&)> extList;
360 extList[
"g1_avg_sample_01"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[0]); };
361 extList[
"g1_avg_sample_02"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[1]); };
362 extList[
"g1_avg_sample_03"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[2]); };
363 extList[
"g1_avg_sample_04"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[3]); };
364 extList[
"g1_avg_sample_05"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[4]); };
365 extList[
"g1_avg_sample_06"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[5]); };
366 extList[
"g1_avg_sample_07"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[6]); };
367 extList[
"g1_avg_sample_08"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[7]); };
368 extList[
"g1_avg_sample_09"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[8]); };
369 extList[
"g1_avg_sample_10"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(1)[9]); };
370 extList[
"g6_avg_sample_01"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[0]); };
371 extList[
"g6_avg_sample_02"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[1]); };
372 extList[
"g6_avg_sample_03"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[2]); };
373 extList[
"g6_avg_sample_04"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[3]); };
374 extList[
"g6_avg_sample_05"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[4]); };
375 extList[
"g6_avg_sample_06"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[5]); };
376 extList[
"g6_avg_sample_07"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[6]); };
377 extList[
"g6_avg_sample_08"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[7]); };
378 extList[
"g6_avg_sample_09"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[8]); };
379 extList[
"g6_avg_sample_10"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(6)[9]); };
380 extList[
"g12_avg_sample_01"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[0]); };
381 extList[
"g12_avg_sample_02"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[1]); };
382 extList[
"g12_avg_sample_03"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[2]); };
383 extList[
"g12_avg_sample_04"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[3]); };
384 extList[
"g12_avg_sample_05"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[4]); };
385 extList[
"g12_avg_sample_06"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[5]); };
386 extList[
"g12_avg_sample_07"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[6]); };
387 extList[
"g12_avg_sample_08"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[7]); };
388 extList[
"g12_avg_sample_09"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[8]); };
389 extList[
"g12_avg_sample_10"] = [](
MonPulseShapeDat const& dat){
return double(dat.getSamples(12)[9]); };
397 std::map<std::string, double(*)(MonPNMGPADat const&)> extList;
399 extList[
"adc_mean_g1"] = [](
MonPNMGPADat const& dat){
return double(dat.getADCMeanG1()); };
400 extList[
"adc_rms_g1"] = [](
MonPNMGPADat const& dat){
return double(dat.getADCRMSG1()); };
401 extList[
"ped_mean_g1"] = [](
MonPNMGPADat const& dat){
return double(dat.getPedMeanG1()); };
402 extList[
"ped_rms_g1"] = [](
MonPNMGPADat const& dat){
return double(dat.getPedRMSG1()); };
403 extList[
"adc_mean_g16"] = [](
MonPNMGPADat const& dat){
return double(dat.getADCMeanG16()); };
404 extList[
"adc_rms_g16"] = [](
MonPNMGPADat const& dat){
return double(dat.getADCRMSG16()); };
405 extList[
"ped_mean_g16"] = [](
MonPNMGPADat const& dat){
return double(dat.getPedMeanG16()); };
406 extList[
"ped_rms_g16"] = [](
MonPNMGPADat const& dat){
return double(dat.getPedRMSG16()); };
420 std::map<std::string, double(*)(MonLed1Dat const&)> extList;
422 extList[
"vpt_mean"] = [](
MonLed1Dat const& dat){
return double(dat.getVPTMean()); };
423 extList[
"vpt_rms"] = [](
MonLed1Dat const& dat){
return double(dat.getVPTRMS()); };
424 extList[
"vpt_over_pn_mean"] = [](
MonLed1Dat const& dat){
return double(dat.getVPTOverPNMean()); };
425 extList[
"vpt_over_pn_rms"] = [](
MonLed1Dat const& dat){
return double(dat.getVPTOverPNRMS()); };
439 std::map<std::string, double(*)(MonLed2Dat const&)> extList;
441 extList[
"vpt_mean"] = [](
MonLed2Dat const& dat){
return double(dat.getVPTMean()); };
442 extList[
"vpt_rms"] = [](
MonLed2Dat const& dat){
return double(dat.getVPTRMS()); };
443 extList[
"vpt_over_pn_mean"] = [](
MonLed2Dat const& dat){
return double(dat.getVPTOverPNMean()); };
444 extList[
"vpt_over_pn_rms"] = [](
MonLed2Dat const& dat){
return double(dat.getVPTOverPNRMS()); };
458 std::map<std::string, double(*)(MonOccupancyDat const&)> extList;
460 extList[
"events_over_low_threshold"] = [](
MonOccupancyDat const& dat){
return double(dat.getEventsOverLowThreshold()); };
461 extList[
"events_over_high_threshold"] = [](
MonOccupancyDat const& dat){
return double(dat.getEventsOverHighThreshold()); };
462 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