57 theDbe->setCurrentFolder(
"Muons/Tests/trackResidualsTest");
59 LogTrace(
metname) <<
"[MuonTrackResidualsTest] beginJob: Parameters initialization"<<endl;
62 string histName, MeanHistoName, SigmaHistoName, MeanHistoTitle, SigmaHistoTitle;
64 type.push_back(
"eta");
65 type.push_back(
"theta");
66 type.push_back(
"phi");
69 for(
unsigned int c=0;
c<type.size();
c++){
71 MeanHistoName =
"MeanTest_" + type[
c];
72 SigmaHistoName =
"SigmaTest_" + type[
c];
74 MeanHistoTitle =
"Mean of the #" + type[
c] +
" residuals distribution";
75 SigmaHistoTitle =
"Sigma of the #" + type[
c] +
" residuals distribution";
77 histName =
"Res_GlbSta_"+type[
c];
78 histoNames[type[
c]].push_back(histName);
79 histName =
"Res_TkGlb_"+type[
c];
80 histoNames[type[
c]].push_back(histName);
81 histName =
"Res_TkSta_"+type[
c];
82 histoNames[type[
c]].push_back(histName);
85 MeanHistos[type[
c]] = theDbe->book1D(MeanHistoName.c_str(),MeanHistoTitle.c_str(),3,0.5,3.5);
86 (MeanHistos[type[
c]])->setBinLabel(1,
"Res_StaGlb",1);
87 (MeanHistos[type[
c]])->setBinLabel(2,
"Res_TkGlb",1);
88 (MeanHistos[type[
c]])->setBinLabel(3,
"Res_TkSta",1);
91 SigmaHistos[type[
c]] = theDbe->book1D(SigmaHistoName.c_str(),SigmaHistoTitle.c_str(),3,0.5,3.5);
92 (SigmaHistos[type[
c]])->setBinLabel(1,
"Res_StaGlb",1);
93 (SigmaHistos[type[
c]])->setBinLabel(2,
"Res_TkGlb",1);
94 (SigmaHistos[type[
c]])->setBinLabel(3,
"Res_TkSta",1);
144 LogTrace(
metname)<<
"[MuonTrackResidualsTest]: endRun, performing the DQM end of run client operation";
146 for(
map<
string, vector<string> > ::const_iterator
histo = histoNames.begin();
147 histo != histoNames.end();
150 for (
unsigned int type=0;
type< (*histo).second.size();
type++){
152 string path =
"Muons/MuonRecoAnalyzer/" + (*histo).second[
type];
157 string GaussianCriterionName =
158 parameters.getUntrackedParameter<
string>(
"resDistributionTestName",
159 "ResidualsDistributionGaussianTest");
162 LogTrace(
metname) <<
"-------- histo : "<<(*histo).second[
type]<<
" "<<GaussianReport->getMessage()<<
" ------- "<<GaussianReport->getStatus();
164 int BinNumber =
type+1;
165 float mean = (*res_histo).getMean(1);
166 float sigma = (*res_histo).getRMS(1);
167 MeanHistos.find((*histo).first)->second->setBinContent(BinNumber, mean);
168 SigmaHistos.find((*histo).first)->second->setBinContent(BinNumber, sigma);
175 string MeanCriterionName =
parameters.getUntrackedParameter<
string>(
"meanTestName",
"ResidualsMeanInRange");
176 for(map<string, MonitorElement*>::const_iterator hMean = MeanHistos.begin();
177 hMean != MeanHistos.end();
179 const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
181 vector<dqm::me_util::Channel> badChannels = theMeanQReport->
getBadChannels();
182 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
183 channel != badChannels.end(); channel++) {
184 LogTrace(
metname)<<
"type:"<<(*hMean).first<<
" Bad mean channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
191 string SigmaCriterionName =
parameters.getUntrackedParameter<
string>(
"sigmaTestName",
"ResidualsSigmaInRange");
192 for(map<string, MonitorElement*>::const_iterator hSigma = SigmaHistos.begin();
193 hSigma != SigmaHistos.end();
195 const QReport * theSigmaQReport = (*hSigma).second->getQReport(SigmaCriterionName);
196 if(theSigmaQReport) {
197 vector<dqm::me_util::Channel> badChannels = theSigmaQReport->
getBadChannels();
198 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
199 channel != badChannels.end(); channel++) {
200 LogTrace(
metname)<<
"type:"<<(*hSigma).first<<
" Bad sigma channels: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
210 theDbe->rmdir(
"Muons/Tests/trackResidualsTest");
LuminosityBlockID id() const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
void beginJob(void)
BeginJob.
const std::string metname
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
const std::string & getMessage(void) const
get message attached to test
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MuonTrackResidualsTest(const edm::ParameterSet &ps)
Constructor.
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
virtual ~MuonTrackResidualsTest()
Destructor.
const std::vector< DQMChannel > & getBadChannels(void) const
LuminosityBlockNumber_t luminosityBlock() const
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)