1 #include "../interface/DBReaderWorkers.h"
2 #include "../interface/LogicIDTranslation.h"
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;
116 std::map<std::string, double(*)(MonTTConsistencyDat const&)> extList;
131 std::map<std::string, double(*)(MonMemChConsistencyDat const&)> extList;
145 std::map<std::string, double(*)(MonMemTTConsistencyDat const&)> extList;
160 std::map<std::string, double(*)(MonLaserBlueDat const&)> extList;
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;
215 std::map<std::string, double(*)(MonPNGreenDat const&)> extList;
217 extList[
"adc_mean_g1"] = [](
MonPNGreenDat const&
dat){
return double(
dat.getADCMeanG1()); };
219 extList[
"ped_mean_g1"] = [](
MonPNGreenDat const&
dat){
return double(
dat.getPedMeanG1()); };
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;
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;
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;
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;
343 std::map<std::string, double(*)(MonTestPulseDat const&)> extList;
358 std::map<std::string, double(*)(MonPulseShapeDat const&)> extList;
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()); };
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
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
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
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
static std::vector< std::string > checklist dat
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