56 theDbe->setCurrentFolder(
"Muons/Tests/muonRecoTest");
58 LogTrace(
metname)<<
"[MuonRecoTest] beginJob: Parameters initialization";
62 etaBin =
parameters.getParameter<
int>(
"etaBin");
65 etaEfficiency = theDbe->book1D(
"etaEfficiency_staMuon",
"#eta_{STA} efficiency", etaBin, etaMin, etaMax);
67 phiBin =
parameters.getParameter<
int>(
"phiBin");
70 phiEfficiency = theDbe->book1D(
"phiEfficiency_staMuon",
"#phi_{STA} efficiency", phiBin, phiMin, phiMax);
73 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_posMu_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}",50,0,200));
74 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_negMu_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{-}",50,0,200));
75 globalRotation.push_back(theDbe->book1D(
"muVStkSytemRotation_profile",
"pT_{TK} / pT_{GLB} vs pT_{GLB} profile for #mu^{+}-#mu^{-}",50,0,200));
118 LogTrace(
metname)<<
"[MuonRecoTest]: endRun, performing the DQM end of run client operation";
120 string path =
"Muons/MuonRecoAnalyzer/StaEta_ifCombinedAlso";
122 path =
"Muons/MuonRecoAnalyzer/StaEta";
125 if(staEtaIfComb_histo && staEta_histo){
126 TH1F * staEtaIfComb_root = staEtaIfComb_histo->
getTH1F();
127 TH1F * staEta_root = staEta_histo->
getTH1F();
129 if(staEtaIfComb_root->GetXaxis()->GetNbins()!=etaBin
130 || staEtaIfComb_root->GetXaxis()->GetXmax()!=
etaMax
131 || staEtaIfComb_root->GetXaxis()->GetXmin()!=
etaMin){
132 LogTrace(
metname)<<
"[MuonRecoTest] wrong histo binning on eta histograms";
136 for(
int i=1;
i<=etaBin;
i++){
137 if(staEta_root->GetBinContent(
i)!=0){
138 double efficiency = double(staEtaIfComb_root->GetBinContent(
i))/
double(staEta_root->GetBinContent(
i));
139 etaEfficiency->setBinContent(
i,efficiency);
144 path =
"Muons/MuonRecoAnalyzer/StaPhi_ifCombinedAlso";
146 path =
"Muons/MuonRecoAnalyzer/StaPhi";
149 if(staPhiIfComb_histo && staPhi_histo){
151 TH1F * staPhiIfComb_root = staPhiIfComb_histo->
getTH1F();
152 TH1F * staPhi_root = staPhi_histo->
getTH1F();
154 if(staPhiIfComb_root->GetXaxis()->GetNbins()!=phiBin
155 || staPhiIfComb_root->GetXaxis()->GetXmax()!=
phiMax
156 || staPhiIfComb_root->GetXaxis()->GetXmin()!=
phiMin){
157 LogTrace(
metname)<<
"[MuonRecoTest] wrong histo binning on phi histograms";
161 for(
int i=1;
i<=etaBin;
i++){
162 if(staPhi_root->GetBinContent(
i)!=0){
163 double efficiency = double(staPhiIfComb_root->GetBinContent(
i))/
double(staPhi_root->GetBinContent(
i));
164 phiEfficiency->setBinContent(
i,efficiency);
171 string EfficiencyCriterionName =
parameters.getUntrackedParameter<
string>(
"efficiencyTestName",
"EfficiencyInRange");
174 const QReport * theEtaQReport = etaEfficiency->getQReport(EfficiencyCriterionName);
176 vector<dqm::me_util::Channel> badChannels = theEtaQReport->
getBadChannels();
177 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
178 channel != badChannels.end(); channel++) {
179 LogTrace(
metname)<<
"[etaEfficiency test] bad ranges: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
181 LogTrace(
metname)<<
"-------- type: [etaEfficiency] "<<theEtaQReport->getMessage()<<
" ------- "<<theEtaQReport->getStatus()<<endl;
184 const QReport * thePhiQReport = phiEfficiency->getQReport(EfficiencyCriterionName);
186 vector<dqm::me_util::Channel> badChannels = thePhiQReport->
getBadChannels();
187 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin();
188 channel != badChannels.end(); channel++) {
189 LogTrace(
metname)<<
"[phiEfficiency test] bad ranges: "<<(*channel).getBin()<<
" Contents : "<<(*channel).getContents()<<endl;
195 string pathPos =
"Muons/MuonRecoAnalyzer/muVStkSytemRotation_posMu";
196 MonitorElement * muVStkSytemRotation_posMu_histo = theDbe->get(pathPos);
197 string pathNeg =
"Muons/MuonRecoAnalyzer/muVStkSytemRotation_negMu";
198 MonitorElement * muVStkSytemRotation_negMu_histo = theDbe->get(pathNeg);
199 if(muVStkSytemRotation_posMu_histo && muVStkSytemRotation_negMu_histo){
201 TH2F * muVStkSytemRotation_posMu_root = muVStkSytemRotation_posMu_histo->
getTH2F();
202 TProfile * muVStkSytemRotation_posMu_profile = muVStkSytemRotation_posMu_root->ProfileX(
"",1,100);
203 TH2F * muVStkSytemRotation_negMu_root = muVStkSytemRotation_negMu_histo->
getTH2F();
204 TProfile * muVStkSytemRotation_negMu_profile = muVStkSytemRotation_negMu_root->ProfileX(
"",1,100);
206 for(
int x=1;
x<50;
x++){
207 globalRotation[0]->Fill((
x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(
x));
208 globalRotation[0]->setBinError(
x,muVStkSytemRotation_posMu_profile->GetBinError(
x));
209 globalRotation[1]->Fill((
x*4)-1,muVStkSytemRotation_negMu_profile->GetBinContent(
x));
210 globalRotation[1]->setBinError(
x,muVStkSytemRotation_negMu_profile->GetBinError(
x));
211 globalRotation[2]->Fill((
x*4)-1,muVStkSytemRotation_posMu_profile->GetBinContent(
x)-muVStkSytemRotation_negMu_profile->GetBinContent(
x));
212 globalRotation[2]->setBinError(
x,
sqrt((muVStkSytemRotation_posMu_profile->GetBinError(
x)*muVStkSytemRotation_posMu_profile->GetBinError(
x))
213 + (muVStkSytemRotation_negMu_profile->GetBinError(
x)*muVStkSytemRotation_negMu_profile->GetBinError(
x))));
222 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.