58 theDbe->setCurrentFolder(
"Muons/Tests/muonRecoTest");
60 LogTrace(
metname)<<
"[MuonRecoTest] beginJob: Parameters initialization";
64 etaBin =
parameters.getParameter<
int>(
"etaBin");
67 etaEfficiency = theDbe->book1D(
"etaEfficiency_staMuon",
"#eta_{STA} efficiency", etaBin, etaMin, etaMax);
69 phiBin =
parameters.getParameter<
int>(
"phiBin");
72 phiEfficiency = theDbe->book1D(
"phiEfficiency_staMuon",
"#phi_{STA} efficiency", phiBin, phiMin, phiMax);
75 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_posMu_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}",50,0,200));
76 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_negMu_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{-}",50,0,200));
77 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}-#mu^{-}",50,0,200));
120 LogTrace(
metname)<<
"[MuonRecoTest]: endRun, performing the DQM end of run client operation";
122 string path =
"Muons/MuonRecoAnalyzer/StaEta_ifCombinedAlso";
124 path =
"Muons/MuonRecoAnalyzer/StaEta";
127 if(staEtaIfComb_histo && staEta_histo){
128 TH1F * staEtaIfComb_root = staEtaIfComb_histo->
getTH1F();
129 TH1F * staEta_root = staEta_histo->
getTH1F();
131 if(staEtaIfComb_root->GetXaxis()->GetNbins()!=etaBin
132 || staEtaIfComb_root->GetXaxis()->GetXmax()!=
etaMax
133 || staEtaIfComb_root->GetXaxis()->GetXmin()!=
etaMin){
134 LogTrace(
metname)<<
"[MuonRecoTest] wrong histo binning on eta histograms";
138 for(
int i=1;
i<=etaBin;
i++){
139 if(staEta_root->GetBinContent(
i)!=0){
140 double efficiency = double(staEtaIfComb_root->GetBinContent(
i))/
double(staEta_root->GetBinContent(
i));
141 etaEfficiency->setBinContent(
i,efficiency);
146 path =
"Muons/MuonRecoAnalyzer/StaPhi_ifCombinedAlso";
148 path =
"Muons/MuonRecoAnalyzer/StaPhi";
151 if(staPhiIfComb_histo && staPhi_histo){
153 TH1F * staPhiIfComb_root = staPhiIfComb_histo->
getTH1F();
154 TH1F * staPhi_root = staPhi_histo->
getTH1F();
156 if(staPhiIfComb_root->GetXaxis()->GetNbins()!=phiBin
157 || staPhiIfComb_root->GetXaxis()->GetXmax()!=
phiMax
158 || staPhiIfComb_root->GetXaxis()->GetXmin()!=
phiMin){
159 LogTrace(
metname)<<
"[MuonRecoTest] wrong histo binning on phi histograms";
163 for(
int i=1;
i<=etaBin;
i++){
164 if(staPhi_root->GetBinContent(
i)!=0){
165 double efficiency = double(staPhiIfComb_root->GetBinContent(
i))/
double(staPhi_root->GetBinContent(
i));
166 phiEfficiency->setBinContent(
i,efficiency);
173 string EfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"efficiencyTestName",
"EfficiencyInRange");
176 const QReport * theEtaQReport = etaEfficiency->getQReport(EfficiencyCriterionName);
178 vector<dqm::me_util::Channel> badChannels = theEtaQReport->
getBadChannels();
179 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
180 channel != badChannels.end(); channel++) {
181 LogTrace(
metname)<<
"[etaEfficiency test] bad ranges: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
183 LogTrace(
metname)<<
"-------- type: [etaEfficiency] "<<theEtaQReport->getMessage()<<
" ------- "<<theEtaQReport->getStatus()<<endl;
186 const QReport * thePhiQReport = phiEfficiency->getQReport(EfficiencyCriterionName);
188 vector<dqm::me_util::Channel> badChannels = thePhiQReport->
getBadChannels();
189 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
190 channel != badChannels.end(); channel++) {
191 LogTrace(
metname)<<
"[phiEfficiency test] bad ranges: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
197 string pathPos =
"Muons/MuonRecoAnalyzer/muVStkSytemRotation_posMu";
198 MonitorElement * muVStkSytemRotation_posMu_histo = theDbe->get(pathPos);
199 string pathNeg =
"Muons/MuonRecoAnalyzer/muVStkSytemRotation_negMu";
200 MonitorElement * muVStkSytemRotation_negMu_histo = theDbe->get(pathNeg);
201 if(muVStkSytemRotation_posMu_histo && muVStkSytemRotation_negMu_histo){
203 TH2F * muVStkSytemRotation_posMu_root = muVStkSytemRotation_posMu_histo->
getTH2F();
204 TProfile * muVStkSytemRotation_posMu_profile = muVStkSytemRotation_posMu_root->ProfileX(
"",1,100);
205 TH2F * muVStkSytemRotation_negMu_root = muVStkSytemRotation_negMu_histo->
getTH2F();
206 TProfile * muVStkSytemRotation_negMu_profile = muVStkSytemRotation_negMu_root->ProfileX(
"",1,100);
208 for(
int x=1;
x<50;
x++){
209 globalRotation[0]->Fill((
x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(
x));
210 globalRotation[0]->setBinError(
x,muVStkSytemRotation_posMu_profile->GetBinError(
x));
211 globalRotation[1]->Fill((
x*4)-1,muVStkSytemRotation_negMu_profile->GetBinContent(
x));
212 globalRotation[1]->setBinError(
x,muVStkSytemRotation_negMu_profile->GetBinError(
x));
213 globalRotation[2]->Fill((
x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(
x)-muVStkSytemRotation_negMu_profile->GetBinContent(
x));
214 globalRotation[2]->setBinError(
x,
sqrt((muVStkSytemRotation_posMu_profile->GetBinError(
x)*muVStkSytemRotation_posMu_profile->GetBinError(
x))
215 + (muVStkSytemRotation_negMu_profile->GetBinError(
x)*muVStkSytemRotation_negMu_profile->GetBinError(
x))));
224 theDbe->rmdir(
"Muons/Tests/muonRecoTest");
LuminosityBlockID id() const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
const std::string metname
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
const std::string & getMessage(void) const
get message attached to test
void beginJob(void)
BeginJob.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
const std::vector< DQMChannel > & getBadChannels(void) const
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
TH1F * getTH1F(void) const
LuminosityBlockNumber_t luminosityBlock() const
MuonRecoTest(const edm::ParameterSet &ps)
Constructor.
TH2F * getTH2F(void) const
virtual ~MuonRecoTest()
Destructor.