26 theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
parameters.getParameter<
InputTag>(
"MuonCollection"));
30 ptMax =
parameters.getParameter<
double>(
"ptMax");
31 pResBin =
parameters.getParameter<
int>(
"pResBin");
32 pResMin =
parameters.getParameter<
double>(
"pResMin");
33 pResMax =
parameters.getParameter<
double>(
"pResMax");
35 rhMin=
parameters.getParameter<
double>(
"rhMin");
36 rhMax=
parameters.getParameter<
double>(
"rhMax");
38 pMin =
parameters.getParameter<
double>(
"pMin");
39 pMax =
parameters.getParameter<
double>(
"pMax");
40 chi2Bin =
parameters.getParameter<
int>(
"chi2Bin");
41 chi2Min =
parameters.getParameter<
double>(
"chi2Min");
42 chi2Max =
parameters.getParameter<
double>(
"chi2Max");
43 phiBin =
parameters.getParameter<
int>(
"phiBin");
44 phiMin =
parameters.getParameter<
double>(
"phiMin");
45 phiMax =
parameters.getParameter<
double>(
"phiMax");
46 tunePBin=
parameters.getParameter<
int>(
"tunePBin");
47 tunePMax=
parameters.getParameter<
double>(
"tunePMax");
48 tunePMin=
parameters.getParameter<
double>(
"tunePMin");
49 thetaBin =
parameters.getParameter<
int>(
"thetaBin");
50 thetaMin =
parameters.getParameter<
double>(
"thetaMin");
51 thetaMax =
parameters.getParameter<
double>(
"thetaMax");
52 etaBin =
parameters.getParameter<
int>(
"etaBin");
53 etaMin =
parameters.getParameter<
double>(
"etaMin");
54 etaMax =
parameters.getParameter<
double>(
"etaMax");
68 muReco = ibooker.
book1D(
"muReco",
"muon reconstructed tracks", 6, 1, 7);
70 muReco->setBinLabel(2,
"glb+sta");
71 muReco->setBinLabel(3,
"tk+sta");
72 muReco->setBinLabel(4,
"tk");
73 muReco->setBinLabel(5,
"sta");
74 muReco->setBinLabel(6,
"calo");
82 etaGlbTrack .push_back(ibooker.
book1D(histname+
"Glb_eta",
"#eta_{GLB}", etaBin, etaMin, etaMax));
83 etaGlbTrack .push_back(ibooker.
book1D(histname+
"Tk_eta",
"#eta_{TKfromGLB}", etaBin, etaMin, etaMax));
84 etaGlbTrack .push_back(ibooker.
book1D(histname+
"Sta_eta",
"#eta_{STAfromGLB}", etaBin, etaMin, etaMax));
85 etaResolution.push_back(ibooker.
book1D(
"Res_TkGlb_eta",
"#eta_{TKfromGLB} - #eta_{GLB}", etaBin*binFactor, etaMin/3000, etaMax/3000));
86 etaResolution.push_back(ibooker.
book1D(
"Res_GlbSta_eta",
"#eta_{GLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100));
87 etaResolution.push_back(ibooker.
book1D(
"Res_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{STAfromGLB}", etaBin*binFactor, etaMin/100, etaMax/100));
88 etaResolution.push_back(ibooker.
book2D(
"ResVsEta_TkGlb_eta",
"(#eta_{TKfromGLB} - #eta_{GLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/3000, etaMax/3000));
89 etaResolution.push_back(ibooker.
book2D(
"ResVsEta_GlbSta_eta",
"(#eta_{GLB} - #eta_{STAfromGLB}) vs #eta_{GLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100));
90 etaResolution.push_back(ibooker.
book2D(
"ResVsEta_TkSta_eta",
"(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs #eta_{TKfromGLB}", etaBin, etaMin, etaMax, etaBin*binFactor, etaMin/100, etaMax/100));
91 etaPull = ibooker.
book1D(
"Pull_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10);
92 etaTrack = ibooker.
book1D(
"TkMuon_eta",
"#eta_{TK}", etaBin, etaMin, etaMax);
93 etaStaTrack = ibooker.
book1D(
"StaMuon_eta",
"#eta_{STA}", etaBin, etaMin, etaMax);
94 etaEfficiency.push_back(ibooker.
book1D(
"StaEta",
"#eta_{STAfromGLB}", etaBin, etaMin, etaMax));
95 etaEfficiency.push_back(ibooker.
book1D(
"StaEta_ifCombinedAlso",
"#eta_{STAfromGLB} if isGlb=true", etaBin, etaMin, etaMax));
100 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_theta",
"#theta_{GLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[0]->
setAxisTitle(
"rad");
101 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_theta",
"#theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[1]->setAxisTitle(
"rad");
102 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_theta",
"#theta_{STAfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[2]->setAxisTitle(
"rad");
103 thetaResolution.push_back(ibooker.
book1D(
"Res_TkGlb_theta",
"#theta_{TKfromGLB} - #theta_{GLB}", thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[0]->setAxisTitle(
"rad");
104 thetaResolution.push_back(ibooker.
book1D(
"Res_GlbSta_theta",
"#theta_{GLB} - #theta_{STAfromGLB}", thetaBin*binFactor,-(thetaMax/100), thetaMax/100));
105 thetaResolution[1]->setAxisTitle(
"rad");
106 thetaResolution.push_back(ibooker.
book1D(
"Res_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB}", thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
107 thetaResolution[2]->setAxisTitle(
"rad");
108 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkGlb_theta",
"(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000));
109 thetaResolution[3]->setAxisTitle(
"rad",1);
110 thetaResolution[3]->setAxisTitle(
"rad",2);
111 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_GlbSta_theta",
"(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
112 thetaResolution[4]->setAxisTitle(
"rad",1);
113 thetaResolution[4]->setAxisTitle(
"rad",2);
114 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkSta_theta",
"(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
115 thetaResolution[5]->setAxisTitle(
"rad",1);
116 thetaResolution[5]->setAxisTitle(
"rad",2);
117 thetaPull = ibooker.
book1D(
"Pull_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100,-10,10);
118 thetaTrack = ibooker.
book1D(
"TkMuon_theta",
"#theta_{TK}", thetaBin, thetaMin, thetaMax);
120 thetaStaTrack = ibooker.
book1D(
"StaMuon_theta",
"#theta_{STA}", thetaBin, thetaMin, thetaMax);
124 tunePResolution = ibooker.
book1D(
"Res_TuneP_pt",
"Pt_{MuonBestTrack}-Pt_{tunePMuonBestTrack}/Pt_{MuonBestTrack}", tunePBin, tunePMin, tunePMax);
127 phiGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_phi",
"#phi_{GLB}", phiBin, phiMin, phiMax));
129 phiGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_phi",
"#phi_{TKfromGLB}", phiBin, phiMin, phiMax));
130 phiGlbTrack[1]->setAxisTitle(
"rad");
131 phiGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_phi",
"#phi_{STAfromGLB}", phiBin, phiMin, phiMax));
132 phiGlbTrack[2]->setAxisTitle(
"rad");
133 phiResolution.push_back(ibooker.
book1D(
"Res_TkGlb_phi",
"#phi_{TKfromGLB} - #phi_{GLB}", phiBin*binFactor, phiMin/3000, phiMax/3000));
134 phiResolution[0]->setAxisTitle(
"rad");
135 phiResolution.push_back(ibooker.
book1D(
"Res_GlbSta_phi",
"#phi_{GLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100));
136 phiResolution[1]->setAxisTitle(
"rad");
137 phiResolution.push_back(ibooker.
book1D(
"Res_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB}", phiBin*binFactor, phiMin/100, phiMax/100));
138 phiResolution[2]->setAxisTitle(
"rad");
139 phiResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkGlb_phi",
"(#phi_{TKfromGLB} - #phi_{GLB}) vs #phi_GLB", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/3000, phiMax/3000));
140 phiResolution[3]->setAxisTitle(
"rad",1);
141 phiResolution[3]->setAxisTitle(
"rad",2);
142 phiResolution.push_back(ibooker.
book2D(
"ResVsPhi_GlbSta_phi",
"(#phi_{GLB} - #phi_{STAfromGLB}) vs #phi_{GLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100));
143 phiResolution[4]->setAxisTitle(
"rad",1);
144 phiResolution[4]->setAxisTitle(
"rad",2);
145 phiResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkSta_phi",
"(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs #phi_{TKfromGLB}", phiBin, phiMin, phiMax, phiBin*binFactor, phiMin/100, phiMax/100));
146 phiResolution[5]->setAxisTitle(
"rad",1);
147 phiResolution[5]->setAxisTitle(
"rad",2);
148 phiPull = ibooker.
book1D(
"Pull_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100,-10,10);
149 phiTrack = ibooker.
book1D(
"TkMuon_phi",
"#phi_{TK}", phiBin, phiMin, phiMax);
151 phiStaTrack = ibooker.
book1D(
"StaMuon_phi",
"#phi_{STA}", phiBin, phiMin, phiMax);
153 phiEfficiency.push_back(ibooker.
book1D(
"StaPhi",
"#phi_{STAfromGLB}", phiBin, phiMin, phiMax));
154 phiEfficiency[0]->setAxisTitle(
"rad");
155 phiEfficiency.push_back(ibooker.
book1D(
"StaPhi_ifCombinedAlso",
"#phi_{STAfromGLB} if the isGlb=true", phiBin, phiMin, phiMax));
156 phiEfficiency[1]->setAxisTitle(
"rad");
159 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_chi2OverDf",
"#chi_{2}OverDF_{GLB}", chi2Bin, chi2Min, chi2Max));
160 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_chi2OverDf",
"#chi_{2}OverDF_{TKfromGLB}", phiBin, chi2Min, chi2Max));
161 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_chi2OverDf",
"#chi_{2}OverDF_{STAfromGLB}", chi2Bin, chi2Min, chi2Max));
162 chi2OvDFTrack = ibooker.
book1D(
"TkMuon_chi2OverDf",
"#chi_{2}OverDF_{TK}", chi2Bin, chi2Min, chi2Max);
163 chi2OvDFStaTrack = ibooker.
book1D(
"StaMuon_chi2OverDf",
"#chi_{2}OverDF_{STA}", chi2Bin, chi2Min, chi2Max);
165 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Glb_probchi",
"Prob #chi_{GLB}", 120, chi2Min, 1.20));
166 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Tk_probchi",
"Prob #chi_{TKfromGLB}", 120, chi2Min, 1.20));
167 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Sta_probchi",
"Prob #chi_{STAfromGLB}", 120, chi2Min, 1.20));
168 probchi2Track=ibooker.
book1D(
"TkMuon_probchi",
"Prob #chi_{TK}", 120, chi2Min, 1.20);
169 probchi2StaTrack=ibooker.
book1D(
"StaMuon_probchi",
"Prob #chi_{STA}", 120, chi2Min, 1.20);
172 pGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_p",
"p_{GLB}", pBin, pMin, pMax));
174 pGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_p",
"p_{TKfromGLB}", pBin, pMin, pMax));
175 pGlbTrack[1]->setAxisTitle(
"GeV");
176 pGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_p",
"p_{STAfromGLB}", pBin, pMin, pMax));
177 pGlbTrack[2]->setAxisTitle(
"GeV");
178 pTrack = ibooker.
book1D(
"TkMuon_p",
"p_{TK}", pBin, pMin, pMax);
180 pStaTrack = ibooker.
book1D(
"StaMuon_p",
"p_{STA}", pBin, pMin, pMax);
184 ptGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_pt",
"pt_{GLB}", ptBin,
ptMin, ptMax));
185 ptGlbTrack[0]->setAxisTitle(
"GeV");
186 ptGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_pt",
"pt_{TKfromGLB}", ptBin,
ptMin, ptMax));
187 ptGlbTrack[1]->setAxisTitle(
"GeV");
188 ptGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_pt",
"pt_{STAfromGLB}", ptBin,
ptMin, ptMax));
189 ptGlbTrack[2]->setAxisTitle(
"GeV");
190 ptTrack = ibooker.
book1D(
"TkMuon_pt",
"pt_{TK}", ptBin,
ptMin, ptMax);
192 ptStaTrack = ibooker.
book1D(
"StaMuon_pt",
"pt_{STA}", ptBin,
ptMin, pMax);
196 qGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_q",
"q_{GLB}", 5, -2.5, 2.5));
197 qGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_q",
"q_{TKfromGLB}", 5, -2.5, 2.5));
198 qGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_q",
"q_{STAformGLB}", 5, -2.5, 2.5));
199 qGlbTrack.push_back(ibooker.
book1D(histname+
"qComparison",
"comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5));
200 qGlbTrack[3]->setBinLabel(1,
"qGlb=qSta");
201 qGlbTrack[3]->setBinLabel(2,
"qGlb!=qSta");
202 qGlbTrack[3]->setBinLabel(3,
"qGlb=qTk");
203 qGlbTrack[3]->setBinLabel(4,
"qGlb!=qTk");
204 qGlbTrack[3]->setBinLabel(5,
"qSta=qTk");
205 qGlbTrack[3]->setBinLabel(6,
"qSta!=qTk");
206 qGlbTrack[3]->setBinLabel(7,
"qGlb!=qSta,qGlb!=Tk");
207 qGlbTrack[3]->setBinLabel(8,
"qGlb=qSta,qGlb=Tk");
208 qTrack = ibooker.
book1D(
"TkMuon_q",
"q_{TK}", 5, -2.5, 2.5);
209 qStaTrack = ibooker.
book1D(
"StaMuon_q",
"q_{STA}", 5, -2.5, 2.5);
213 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
215 qOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverp",
"(q/p)_{GLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
216 qOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
217 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
218 qOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
219 qOverpPull = ibooker.
book1D(
"Pull_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100,-10,10);
221 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
223 oneOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverp",
"(1/p)_{GLB} - (1/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
224 oneOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
225 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
226 oneOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
227 oneOverpPull = ibooker.
book1D(
"Pull_TkSta_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100,-10,10);
230 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
232 qOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverpt",
"(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
233 qOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
234 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
235 qOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
236 qOverptPull = ibooker.
book1D(
"Pull_TkSta_qOverpt",
"(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100,-10,10);
238 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
240 oneOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverpt",
"(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
241 oneOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
242 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
243 oneOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
244 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkGlb_oneOverpt",
"(#eta_{TKfromGLB} - #eta_{GLB}) vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor*2, pResMin/10, pResMax/10));
245 oneOverptResolution[3]->setAxisTitle(
"GeV^{-1}",2);
246 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_GlbSta_oneOverpt",
"(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax));
247 oneOverptResolution[4]->setAxisTitle(
"GeV^{-1}",2);
248 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkSta_oneOverpt",
"(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", etaBin, etaMin, etaMax, pResBin*binFactor, pResMin, pResMax));
249 oneOverptResolution[5]->setAxisTitle(
"GeV^{-1}",2);
250 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkGlb_oneOverpt",
"(#phi_{TKfromGLB} - #phi_{GLB}) vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor*2, pResMin/10, pResMax/10));
251 oneOverptResolution[6]->setAxisTitle(
"rad",1);
252 oneOverptResolution[6]->setAxisTitle(
"GeV^{-1}",2);
253 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_GlbSta_oneOverpt",
"(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax));
254 oneOverptResolution[7]->setAxisTitle(
"rad",1);
255 oneOverptResolution[7]->setAxisTitle(
"GeV^{-1}",2);
256 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkSta_oneOverpt",
"(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", phiBin, phiMin, phiMax, pResBin*binFactor, pResMin, pResMax));
257 oneOverptResolution[8]->setAxisTitle(
"rad",1);
258 oneOverptResolution[8]->setAxisTitle(
"GeV^{-1}",2);
259 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPt_TkGlb_oneOverpt",
"((1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}) vs (1/p_{t})_{GLB}", ptBin/5,
ptMin, ptMax/100, pResBin*binFactor*2, pResMin/10, pResMax/10));
260 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",1);
261 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",2);
262 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPt_GlbSta_oneOverpt",
"((1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB} vs (1/p_{t})_{GLB}", ptBin/5,
ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax));
263 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",1);
264 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",2);
265 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPt_TkSta_oneOverpt",
"((1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}", ptBin/5,
ptMin, ptMax/100, pResBin*binFactor, pResMin, pResMax));
266 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",1);
267 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",2);
268 oneOverptPull = ibooker.
book1D(
"Pull_TkSta_oneOverpt",
"(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100,-10,10);
272 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_Frac_inGlb",
"recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
273 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_Frac_inGlb",
"recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
274 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_inGlb_Div_RhAssoSta",
"recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax));
275 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_inGlb_Div_RhAssoTk",
"recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax));
276 rhAnalysis.push_back(ibooker.
book1D(
"GlbRh_Div_RhAssoStaTk",
"recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax));
277 rhAnalysis.push_back(ibooker.
book1D(
"invalidRh_Frac_inTk",
"Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax));
281 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_posMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2));
282 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_negMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2));
288 float p1=0,
p2=0, p1e=1, p2e=1;
291 p1 = t1->eta(); p1e = t1->etaError();
292 p2 = t2->eta(); p2e = t2->etaError();
294 else if(par ==
"theta") {
295 p1 = t1->theta(); p1e = t1->thetaError();
296 p2 = t2->theta(); p2e = t2->thetaError();
298 else if(par ==
"phi") {
299 p1 = t1->phi(); p1e = t1->phiError();
300 p2 = t2->phi(); p2e = t2->phiError();
302 else if(par ==
"qOverp") {
303 p1 = t1->charge()/t1->p(); p1e = t1->qoverpError();
304 p2 = t2->charge()/t2->p(); p2e = t2->qoverpError();
306 else if(par ==
"oneOverp") {
307 p1 = 1./t1->p(); p1e = t1->qoverpError();
308 p2 = 1./t2->p(); p2e = t2->qoverpError();
310 else if(par ==
"qOverpt") {
311 p1 = t1->charge()/t1->pt(); p1e = t1->ptError()*p1*
p1;
312 p2 = t2->charge()/t2->pt(); p2e = t2->ptError()*
p2*
p2;
314 else if(par ==
"oneOverpt") {
315 p1 = 1./t1->pt(); p1e = t1->ptError()*p1*
p1;
316 p2 = 1./t2->pt(); p2e = t2->ptError()*
p2*
p2;
320 if(p1e!=0 || p2e!=0) pull = res /
sqrt(p1e*p1e + p2e*p2e);
326 theService->update(iSetup);
330 iEvent.
getByToken(theMuonCollectionLabel_,muons);
336 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
338 if(recoMu->isGlobalMuon()) {
340 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
341 if(recoMu->isTrackerMuon() && recoMu->isStandAloneMuon())
343 if(!(recoMu->isTrackerMuon()) && recoMu->isStandAloneMuon())
345 if(!recoMu->isStandAloneMuon())
346 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
356 etaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta());
357 etaGlbTrack[1]->Fill(recoTkGlbTrack->eta());
358 etaGlbTrack[2]->Fill(recoStaGlbTrack->eta());
360 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
361 etaResolution[0]->Fill(res);
362 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
363 etaResolution[1]->Fill(res);
364 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
365 etaResolution[2]->Fill(res);
368 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
369 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
370 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
373 thetaGlbTrack[0]->Fill(recoCombinedGlbTrack->theta());
374 thetaGlbTrack[1]->Fill(recoTkGlbTrack->theta());
375 thetaGlbTrack[2]->Fill(recoStaGlbTrack->theta());
376 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
377 thetaResolution[0]->Fill(res);
379 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
380 thetaResolution[1]->Fill(res);
382 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
383 thetaResolution[2]->Fill(res);
384 thetaPull->Fill(pull);
386 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
387 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
388 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
392 phiGlbTrack[0]->Fill(recoCombinedGlbTrack->phi());
393 phiGlbTrack[1]->Fill(recoTkGlbTrack->phi());
394 phiGlbTrack[2]->Fill(recoStaGlbTrack->phi());
395 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
396 phiResolution[0]->Fill(res);
397 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
398 phiResolution[1]->Fill(res);
399 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
400 phiResolution[2]->Fill(res);
402 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
403 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
404 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
406 chi2OvDFGlbTrack[0]->Fill(recoCombinedGlbTrack->normalizedChi2());
407 chi2OvDFGlbTrack[1]->Fill(recoTkGlbTrack->normalizedChi2());
408 chi2OvDFGlbTrack[2]->Fill(recoStaGlbTrack->normalizedChi2());
412 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
413 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
414 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
418 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
419 pGlbTrack[1]->Fill(recoTkGlbTrack->p());
420 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
422 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
423 ptGlbTrack[1]->Fill(recoTkGlbTrack->pt());
424 ptGlbTrack[2]->Fill(recoStaGlbTrack->pt());
426 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
427 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
428 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
429 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge()) qGlbTrack[3]->
Fill(1);
430 else qGlbTrack[3]->Fill(2);
431 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(3);
432 else qGlbTrack[3]->Fill(4);
433 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(5);
434 else qGlbTrack[3]->Fill(6);
435 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(7);
436 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(8);
438 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
439 qOverpResolution[0]->Fill(res);
440 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
441 qOverpResolution[1]->Fill(res);
442 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
443 qOverpResolution[2]->Fill(res);
444 qOverpPull->Fill(pull);
447 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
448 oneOverpResolution[0]->Fill(res);
449 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
450 oneOverpResolution[1]->Fill(res);
451 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
452 oneOverpResolution[2]->Fill(res);
453 oneOverpPull->Fill(pull);
456 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
457 qOverptResolution[0]->Fill(res);
458 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
459 qOverptResolution[1]->Fill(res);
460 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
461 qOverptResolution[2]->Fill(res);
462 qOverptPull->Fill(pull);
464 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
465 oneOverptResolution[0]->Fill(res);
466 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
467 oneOverptResolution[1]->Fill(res);
468 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
469 oneOverptResolution[2]->Fill(res);
470 oneOverptPull->Fill(pull);
479 double bestTrackPt = recoBestTrack->pt();
481 double tunePBestTrackPt = recoTunePBestTrack->pt();
483 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
485 tunePResolution->Fill(tunePBestTrackRes);
488 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
489 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
490 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
491 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
492 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
493 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
494 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
495 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
496 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
499 double rhGlb = recoCombinedGlbTrack->found();
501 double rhGlb_StaProvenance=0;
503 double rhGlb_TkProvenance=0;
505 recHit!=recoCombinedGlbTrack->recHitsEnd(); ++recHit){
506 if((*recHit)->isValid()){
507 DetId id = (*recHit)->geographicalId();
509 rhGlb_StaProvenance++;
511 rhGlb_TkProvenance++;
515 double rhStaGlb = recoStaGlbTrack->recHitsSize();
517 double rhTkGlb = recoTkGlbTrack->found();
519 double rhTkGlb_notValid = recoTkGlbTrack->lost();
522 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
523 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
524 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
525 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
526 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
527 rhAnalysis[5]->Fill(rhTkGlb_notValid/rhGlb);
530 if(recoCombinedGlbTrack->charge()>0)
531 muVStkSytemRotation[0]->
Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
533 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
538 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon())) {
539 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
540 if(recoMu->isStandAloneMuon())
542 if(!(recoMu->isStandAloneMuon()))
548 etaTrack->Fill(recoTrack->eta());
549 thetaTrack->Fill(recoTrack->theta());
550 phiTrack->Fill(recoTrack->phi());
551 chi2OvDFTrack->Fill(recoTrack->normalizedChi2());
552 probchi2Track->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
553 pTrack->Fill(recoTrack->p());
554 ptTrack->Fill(recoTrack->pt());
555 qTrack->Fill(recoTrack->charge());
559 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon())) {
560 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
561 if(!(recoMu->isTrackerMuon()))
567 etaStaTrack->Fill(recoStaTrack->eta());
568 thetaStaTrack->Fill(recoStaTrack->theta());
569 phiStaTrack->Fill(recoStaTrack->phi());
570 chi2OvDFStaTrack->Fill(recoStaTrack->normalizedChi2());
571 probchi2StaTrack->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
572 pStaTrack->Fill(recoStaTrack->p());
573 ptStaTrack->Fill(recoStaTrack->pt());
574 qStaTrack->Fill(recoStaTrack->charge());
578 if(recoMu->isCaloMuon() && !(recoMu->isGlobalMuon()) && !(recoMu->isTrackerMuon()) && !(recoMu->isStandAloneMuon()))
586 if(recoMu->isStandAloneMuon()){
587 etaEfficiency[0]->Fill(recoStaGlbTrack->eta());
588 phiEfficiency[0]->Fill(recoStaGlbTrack->phi());
590 if(recoMu->isStandAloneMuon() && recoMu->isGlobalMuon()){
591 etaEfficiency[1]->Fill(recoStaGlbTrack->eta());
592 phiEfficiency[1]->Fill(recoStaGlbTrack->phi());
virtual ~MuonRecoAnalyzer()
Destructor.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void analyze(const edm::Event &, const edm::EventSetup &)
Inizialize parameters for histo binning.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * book1D(Args &&...args)
void GetRes(reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
MuonRecoAnalyzer(const edm::ParameterSet &)
Constructor.