CMS 3D CMS Logo

MuonTrackResidualsTest.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author G. Mila - INFN Torino
6  */
7 
9 
10 // Framework
17 
21 
22 #include <iostream>
23 #include <cstdio>
24 #include <string>
25 #include <cmath>
26 #include "TF1.h"
27 
28 using namespace edm;
29 using namespace std;
30 
32  parameters = ps;
33 
34  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
35 
36  GaussianCriterionName =
37  parameters.getUntrackedParameter<string>("resDistributionTestName", "ResidualsDistributionGaussianTest");
38  SigmaCriterionName = parameters.getUntrackedParameter<string>("sigmaTestName", "ResidualsSigmaInRange");
39  MeanCriterionName = parameters.getUntrackedParameter<string>("meanTestName", "ResidualsMeanInRange");
40 }
42  DQMStore::IGetter& igetter,
43  edm::Run const&,
44  edm::EventSetup const&) {
48  ibooker.setCurrentFolder("Muons/Tests/trackResidualsTest");
49 
50  string histName, MeanHistoName, SigmaHistoName, MeanHistoTitle, SigmaHistoTitle;
51  vector<string> type;
52  type.push_back("eta");
53  type.push_back("theta");
54  type.push_back("phi");
55 
56  for (unsigned int c = 0; c < type.size(); c++) {
57  MeanHistoName = "MeanTest_" + type[c];
58  SigmaHistoName = "SigmaTest_" + type[c];
59 
60  MeanHistoTitle = "Mean of the #" + type[c] + " residuals distribution";
61  SigmaHistoTitle = "Sigma of the #" + type[c] + " residuals distribution";
62 
63  histName = "Res_GlbSta_" + type[c];
64  histoNames[type[c]].push_back(histName);
65  histName = "Res_TkGlb_" + type[c];
66  histoNames[type[c]].push_back(histName);
67  histName = "Res_TkSta_" + type[c];
68  histoNames[type[c]].push_back(histName);
69 
70  MeanHistos[type[c]] = ibooker.book1D(MeanHistoName.c_str(), MeanHistoTitle.c_str(), 3, 0.5, 3.5);
71  (MeanHistos[type[c]])->setBinLabel(1, "Res_StaGlb", 1);
72  (MeanHistos[type[c]])->setBinLabel(2, "Res_TkGlb", 1);
73  (MeanHistos[type[c]])->setBinLabel(3, "Res_TkSta", 1);
74 
75  SigmaHistos[type[c]] = ibooker.book1D(SigmaHistoName.c_str(), SigmaHistoTitle.c_str(), 3, 0.5, 3.5);
76  (SigmaHistos[type[c]])->setBinLabel(1, "Res_StaGlb", 1);
77  (SigmaHistos[type[c]])->setBinLabel(2, "Res_TkGlb", 1);
78  (SigmaHistos[type[c]])->setBinLabel(3, "Res_TkSta", 1);
79  }
80 
84  for (map<string, vector<string> >::const_iterator histo = histoNames.begin(); histo != histoNames.end(); histo++) {
85  for (unsigned int type = 0; type < (*histo).second.size(); type++) {
86  string path = "Muons/MuonRecoAnalyzer/" + (*histo).second[type];
87  MonitorElement* res_histo = igetter.get(path);
88  if (res_histo) {
89  // gaussian test
90  // const QReport *GaussianReport = res_histo->getQReport(GaussianCriterionName);
91  int BinNumber = type + 1;
92  float mean = (*res_histo).getMean(1);
93  float sigma = (*res_histo).getRMS(1);
94  MeanHistos.find((*histo).first)->second->setBinContent(BinNumber, mean);
95  SigmaHistos.find((*histo).first)->second->setBinContent(BinNumber, sigma);
96  }
97  }
98  }
99 }
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
Handle.h
MessageLogger.h
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
ESHandle.h
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
MuonTrackResidualsTest::dqmEndRun
void dqmEndRun(DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &) override
Definition: MuonTrackResidualsTest.cc:41
MakerMacros.h
Run.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
Skims_PDWG_cff.prescaleFactor
prescaleFactor
Definition: Skims_PDWG_cff.py:25
edm::EventSetup
Definition: EventSetup.h:58
std
Definition: JetResolutionObject.h:76
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
EventSetup.h
MuonTrackResidualsTest::MuonTrackResidualsTest
MuonTrackResidualsTest(const edm::ParameterSet &ps)
Constructor.
Definition: MuonTrackResidualsTest.cc:31
MuonTrackResidualsTest.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
genParticles_cff.map
map
Definition: genParticles_cff.py:11
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98