1 #include "../interface/CalibrationSummaryClient.h" 28 std::vector<std::string> sourceList(_params.
getUntrackedParameter<std::vector<std::string> >(
"activeSources"));
29 if(
std::find(sourceList.begin(), sourceList.end(),
"Laser") == sourceList.end()){
33 if(
std::find(sourceList.begin(), sourceList.end(),
"Led") == sourceList.end()){
37 if(
std::find(sourceList.begin(), sourceList.end(),
"TestPulse") == sourceList.end()){
41 if(
std::find(sourceList.begin(), sourceList.end(),
"Pedestal") == sourceList.end()){
50 std::vector<int> laserWavelengths(_params.
getUntrackedParameter<std::vector<int> >(
"laserWavelengths"));
52 unsigned nWL(laserWavelengths.size());
53 for(
unsigned iWL(0); iWL != nWL; ++iWL){
54 int wl(laserWavelengths[iWL]);
55 if(wl <= 0 || wl >= 5)
throw cms::Exception(
"InvalidConfiguration") <<
"Laser Wavelength";
56 repl[
"wl"] = std::to_string(wl);
65 unsigned nWL(ledWavelengths.size());
66 for(
unsigned iWL(0); iWL != nWL; ++iWL){
67 int wl(ledWavelengths[iWL]);
68 if(wl <= 0 || wl >= 5)
throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength";
69 repl[
"wl"] = std::to_string(wl);
78 unsigned nG(tpMGPAGains.size());
79 for(
unsigned iG(0); iG != nG; ++iG){
80 int gain(tpMGPAGains[iG]);
81 if(gain != 1 && gain != 6 && gain != 12)
throw cms::Exception(
"InvalidConfiguration") <<
"MGPA gain";
82 repl[
"gain"] = std::to_string(gain);
87 std::vector<int> tpMGPAGainsPN(_params.
getUntrackedParameter<std::vector<int> >(
"testPulseMGPAGainsPN"));
89 unsigned nGPN(tpMGPAGainsPN.size());
90 for(
unsigned iG(0); iG != nGPN; ++iG){
91 int gain(tpMGPAGainsPN[iG]);
92 if(gain != 1 && gain != 16)
throw cms::Exception(
"InvalidConfiguration") <<
"PN MGPA gain";
93 repl[
"pngain"] = std::to_string(gain);
100 std::vector<int> pedMGPAGains(_params.
getUntrackedParameter<std::vector<int> >(
"pedestalMGPAGains"));
102 unsigned nG(pedMGPAGains.size());
103 for(
unsigned iG(0); iG != nG; ++iG){
104 int gain(pedMGPAGains[iG]);
105 if(gain != 1 && gain != 6 && gain != 12)
throw cms::Exception(
"InvalidConfiguration") <<
"MGPA gain";
106 repl[
"gain"] = std::to_string(gain);
111 std::vector<int> pedMGPAGainsPN(_params.
getUntrackedParameter<std::vector<int> >(
"pedestalMGPAGainsPN"));
113 unsigned nGPN(pedMGPAGainsPN.size());
114 for(
unsigned iG(0); iG != nGPN; ++iG){
115 int gain(pedMGPAGainsPN[iG]);
116 if(gain != 1 && gain != 16)
throw cms::Exception(
"InvalidConfiguration") <<
"PN MGPA gain";
117 repl[
"pngain"] = std::to_string(gain);
131 MESet& meQualitySummary(
MEs_.at(
"QualitySummary"));
132 MESet& mePNQualitySummary(
MEs_.at(
"PNQualitySummary"));
138 MESetMulti const* sTestPulse(
using_(
"TestPulse") ? static_cast<MESetMulti const*>(&
sources_.at(
"TestPulse")) :
nullptr);
139 MESetMulti const* sTestPulsePN(
using_(
"TestPulsePN") ? static_cast<MESetMulti const*>(&
sources_.at(
"TestPulsePN")) :
nullptr);
140 MESetMulti const* sPedestal(
using_(
"Pedestal") ? static_cast<MESetMulti const*>(&
sources_.at(
"Pedestal")) :
nullptr);
141 MESetMulti const* sPedestalPN(
using_(
"PedestalPN") ? static_cast<MESetMulti const*>(&
sources_.at(
"PedestalPN")) :
nullptr);
150 if(status ==
kGood && sLaser){
152 sLaser->use(wlItr->second);
153 if(sLaser->getBinContent(
id) ==
kBad){
160 if(status ==
kGood && sLed){
163 for(map<int, unsigned>::iterator wlItr(
ledWlToME_.begin()); wlItr !=
ledWlToME_.end(); ++wlItr){
164 sLed->
use(wlItr->second);
173 if(status ==
kGood && sTestPulse){
175 sTestPulse->
use(gainItr->second);
183 if(status ==
kGood && sPedestal){
185 sPedestal->
use(gainItr->second);
193 qItr->setBinContent(status);
196 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
197 if(
memDCCIndex(iDCC + 1) ==
unsigned(-1))
continue;
198 for(
unsigned iPN(0); iPN < 10; ++iPN){
207 if(sPNIntegrity.getBinContent(
id) ==
kBad) status =
kBad;
209 if(status ==
kGood && sLaserPN){
211 sLaserPN->
use(wlItr->second);
219 if(status ==
kGood && sLedPN){
220 for(map<int, unsigned>::iterator wlItr(
ledWlToME_.begin()); wlItr !=
ledWlToME_.end(); ++wlItr){
221 sLedPN->
use(wlItr->second);
229 if(status ==
kGood && sTestPulsePN){
231 sTestPulsePN->
use(gainItr->second);
239 if(status ==
kGood && sPedestalPN){
241 sPedestalPN->
use(gainItr->second);
249 mePNQualitySummary.setBinContent(
id, status);
std::map< int, unsigned > pedGainToME_
unsigned memDCCIndex(unsigned)
T getUntrackedParameter(std::string const &, T const &) const
void producePlots(ProcessType) override
#define DEFINE_ECALDQM_WORKER(TYPE)
std::map< int, unsigned > pedPNGainToME_
double getBinContent(DetId const &_id, int _bin=0) const override
bool using_(std::string const &_name, ProcessType _type=kJob) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const_iterator & toNextChannel()
CalibrationSummaryClient()
std::map< int, unsigned > ledWlToME_
void setParams(edm::ParameterSet const &) override
std::map< int, unsigned > tpGainToME_
std::set< std::string > qualitySummaries_
std::map< int, unsigned > laserWlToME_
std::map< int, unsigned > tpPNGainToME_
std::map< std::string, std::string > PathReplacements
unsigned getIndex(PathReplacements const &) const