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");
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");
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);
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 phiVsetaGlbTrack.push_back(ibooker.
book2D(histname+
"Glb_phiVSeta",
"#phi vs #eta (GLB)", etaBin/2,
etaMin,
etaMax, phiBin/2, phiMin, phiMax));
273 phiVsetaGlbTrack.push_back(ibooker.
book2D(histname+
"Tk_phiVSeta",
"#phi vs #eta (TKfromGLB)", etaBin/2,
etaMin,
etaMax, phiBin/2, phiMin, phiMax));
274 phiVsetaGlbTrack.push_back(ibooker.
book2D(histname+
"Sta_phiVseta",
"#phi vs #eta (STAfromGLB)", etaBin/2,
etaMin,
etaMax, phiBin/2, phiMin, phiMax));
279 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_Frac_inGlb",
"recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
280 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_Frac_inGlb",
"recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
281 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_inGlb_Div_RhAssoSta",
"recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax));
282 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_inGlb_Div_RhAssoTk",
"recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax));
283 rhAnalysis.push_back(ibooker.
book1D(
"GlbRh_Div_RhAssoStaTk",
"recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax));
284 rhAnalysis.push_back(ibooker.
book1D(
"invalidRh_Frac_inTk",
"Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax));
288 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_posMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2));
289 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_negMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2));
295 float p1=0,
p2=0, p1e=1, p2e=1;
298 p1 = t1->eta(); p1e = t1->etaError();
299 p2 = t2->eta(); p2e = t2->etaError();
301 else if(par ==
"theta") {
302 p1 = t1->theta(); p1e = t1->thetaError();
303 p2 = t2->theta(); p2e = t2->thetaError();
305 else if(par ==
"phi") {
306 p1 = t1->phi(); p1e = t1->phiError();
307 p2 = t2->phi(); p2e = t2->phiError();
309 else if(par ==
"qOverp") {
310 p1 = t1->charge()/t1->p(); p1e = t1->qoverpError();
311 p2 = t2->charge()/t2->p(); p2e = t2->qoverpError();
313 else if(par ==
"oneOverp") {
314 p1 = 1./t1->p(); p1e = t1->qoverpError();
315 p2 = 1./t2->p(); p2e = t2->qoverpError();
317 else if(par ==
"qOverpt") {
318 p1 = t1->charge()/t1->pt(); p1e = t1->ptError()*p1*
p1;
319 p2 = t2->charge()/t2->pt(); p2e = t2->ptError()*
p2*
p2;
321 else if(par ==
"oneOverpt") {
322 p1 = 1./t1->pt(); p1e = t1->ptError()*p1*
p1;
323 p2 = 1./t2->pt(); p2e = t2->ptError()*
p2*
p2;
327 if(p1e!=0 || p2e!=0) pull = res /
sqrt(p1e*p1e + p2e*p2e);
333 theService->update(iSetup);
337 iEvent.
getByToken(theMuonCollectionLabel_,muons);
343 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
345 if(recoMu->isGlobalMuon()) {
347 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
348 if(recoMu->isTrackerMuon() && recoMu->isStandAloneMuon())
350 if(!(recoMu->isTrackerMuon()) && recoMu->isStandAloneMuon())
352 if(!recoMu->isStandAloneMuon())
353 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
363 etaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta());
364 etaGlbTrack[1]->Fill(recoTkGlbTrack->eta());
365 etaGlbTrack[2]->Fill(recoStaGlbTrack->eta());
367 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
368 phiVsetaGlbTrack[1]->Fill(recoTkGlbTrack->eta() , recoTkGlbTrack->phi());
369 phiVsetaGlbTrack[2]->Fill(recoStaGlbTrack->eta() , recoStaGlbTrack->phi());
371 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
372 etaResolution[0]->Fill(res);
373 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
374 etaResolution[1]->Fill(res);
375 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
376 etaResolution[2]->Fill(res);
379 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
380 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
381 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
384 thetaGlbTrack[0]->Fill(recoCombinedGlbTrack->theta());
385 thetaGlbTrack[1]->Fill(recoTkGlbTrack->theta());
386 thetaGlbTrack[2]->Fill(recoStaGlbTrack->theta());
387 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
388 thetaResolution[0]->Fill(res);
390 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
391 thetaResolution[1]->Fill(res);
393 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
394 thetaResolution[2]->Fill(res);
395 thetaPull->Fill(pull);
397 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
398 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
399 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
403 phiGlbTrack[0]->Fill(recoCombinedGlbTrack->phi());
404 phiGlbTrack[1]->Fill(recoTkGlbTrack->phi());
405 phiGlbTrack[2]->Fill(recoStaGlbTrack->phi());
406 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
407 phiResolution[0]->Fill(res);
408 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
409 phiResolution[1]->Fill(res);
410 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
411 phiResolution[2]->Fill(res);
413 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
414 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
415 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
417 chi2OvDFGlbTrack[0]->Fill(recoCombinedGlbTrack->normalizedChi2());
418 chi2OvDFGlbTrack[1]->Fill(recoTkGlbTrack->normalizedChi2());
419 chi2OvDFGlbTrack[2]->Fill(recoStaGlbTrack->normalizedChi2());
423 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
424 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
425 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
429 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
430 pGlbTrack[1]->Fill(recoTkGlbTrack->p());
431 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
433 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
434 ptGlbTrack[1]->Fill(recoTkGlbTrack->pt());
435 ptGlbTrack[2]->Fill(recoStaGlbTrack->pt());
437 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
438 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
439 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
440 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge()) qGlbTrack[3]->
Fill(1);
441 else qGlbTrack[3]->Fill(2);
442 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(3);
443 else qGlbTrack[3]->Fill(4);
444 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(5);
445 else qGlbTrack[3]->Fill(6);
446 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(7);
447 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(8);
449 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
450 qOverpResolution[0]->Fill(res);
451 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
452 qOverpResolution[1]->Fill(res);
453 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
454 qOverpResolution[2]->Fill(res);
455 qOverpPull->Fill(pull);
458 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
459 oneOverpResolution[0]->Fill(res);
460 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
461 oneOverpResolution[1]->Fill(res);
462 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
463 oneOverpResolution[2]->Fill(res);
464 oneOverpPull->Fill(pull);
467 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
468 qOverptResolution[0]->Fill(res);
469 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
470 qOverptResolution[1]->Fill(res);
471 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
472 qOverptResolution[2]->Fill(res);
473 qOverptPull->Fill(pull);
475 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
476 oneOverptResolution[0]->Fill(res);
477 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
478 oneOverptResolution[1]->Fill(res);
479 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
480 oneOverptResolution[2]->Fill(res);
481 oneOverptPull->Fill(pull);
490 double bestTrackPt = recoBestTrack->pt();
492 double tunePBestTrackPt = recoTunePBestTrack->pt();
494 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
496 tunePResolution->Fill(tunePBestTrackRes);
499 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
500 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
501 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
502 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
503 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
504 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
505 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
506 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
507 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
510 double rhGlb = recoCombinedGlbTrack->found();
512 double rhGlb_StaProvenance=0;
514 double rhGlb_TkProvenance=0;
516 recHit!=recoCombinedGlbTrack->recHitsEnd(); ++recHit){
517 if((*recHit)->isValid()){
518 DetId id = (*recHit)->geographicalId();
520 rhGlb_StaProvenance++;
522 rhGlb_TkProvenance++;
526 double rhStaGlb = recoStaGlbTrack->recHitsSize();
528 double rhTkGlb = recoTkGlbTrack->found();
530 double rhTkGlb_notValid = recoTkGlbTrack->lost();
533 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
534 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
535 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
536 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
537 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
538 rhAnalysis[5]->Fill(rhTkGlb_notValid/rhGlb);
541 if(recoCombinedGlbTrack->charge()>0)
542 muVStkSytemRotation[0]->
Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
544 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
549 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon())) {
550 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
551 if(recoMu->isStandAloneMuon())
553 if(!(recoMu->isStandAloneMuon()))
559 etaTrack->Fill(recoTrack->eta());
560 thetaTrack->Fill(recoTrack->theta());
561 phiTrack->Fill(recoTrack->phi());
562 chi2OvDFTrack->Fill(recoTrack->normalizedChi2());
563 probchi2Track->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
564 pTrack->Fill(recoTrack->p());
565 ptTrack->Fill(recoTrack->pt());
566 qTrack->Fill(recoTrack->charge());
570 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon())) {
571 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
572 if(!(recoMu->isTrackerMuon()))
578 etaStaTrack->Fill(recoStaTrack->eta());
579 thetaStaTrack->Fill(recoStaTrack->theta());
580 phiStaTrack->Fill(recoStaTrack->phi());
581 chi2OvDFStaTrack->Fill(recoStaTrack->normalizedChi2());
582 probchi2StaTrack->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
583 pStaTrack->Fill(recoStaTrack->p());
584 ptStaTrack->Fill(recoStaTrack->pt());
585 qStaTrack->Fill(recoStaTrack->charge());
589 if(recoMu->isCaloMuon() && !(recoMu->isGlobalMuon()) && !(recoMu->isTrackerMuon()) && !(recoMu->isStandAloneMuon()))
597 if(recoMu->isStandAloneMuon()){
598 etaEfficiency[0]->Fill(recoStaGlbTrack->eta());
599 phiEfficiency[0]->Fill(recoStaGlbTrack->phi());
601 if(recoMu->isStandAloneMuon() && recoMu->isGlobalMuon()){
602 etaEfficiency[1]->Fill(recoStaGlbTrack->eta());
603 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.
auto const T2 &decltype(t1.eta()) t2
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.