24 IsminiAOD =
parameters.getParameter<
bool>(
"IsminiAOD");
28 theMuonCollectionLabel_ = consumes<edm::View<reco::Muon> > (
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
33 pResBin =
parameters.getParameter<
int>(
"pResBin");
34 pResMin =
parameters.getParameter<
double>(
"pResMin");
35 pResMax =
parameters.getParameter<
double>(
"pResMax");
37 rhMin=
parameters.getParameter<
double>(
"rhMin");
38 rhMax=
parameters.getParameter<
double>(
"rhMax");
42 chi2Bin =
parameters.getParameter<
int>(
"chi2Bin");
48 tunePBin=
parameters.getParameter<
int>(
"tunePBin");
49 tunePMax=
parameters.getParameter<
double>(
"tunePMax");
50 tunePMin=
parameters.getParameter<
double>(
"tunePMin");
51 thetaBin =
parameters.getParameter<
int>(
"thetaBin");
52 thetaMin =
parameters.getParameter<
double>(
"thetaMin");
53 thetaMax =
parameters.getParameter<
double>(
"thetaMax");
58 theFolder =
parameters.getParameter<
string>(
"folder");
72 muReco = ibooker.
book1D(
"muReco",
"muon reconstructed tracks", 6, 1, 7);
74 muReco->setBinLabel(2,
"glb+sta");
75 muReco->setBinLabel(3,
"tk+sta");
76 muReco->setBinLabel(4,
"tk");
77 muReco->setBinLabel(5,
"sta");
78 muReco->setBinLabel(6,
"calo");
95 etaPull = ibooker.
book1D(
"Pull_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10);
99 etaEfficiency.push_back(ibooker.
book1D(
"StaEta_ifCombinedAlso",
"#eta_{STAfromGLB} if isGlb=true",
etaBin,
etaMin,
etaMax));
104 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_theta",
"#theta_{GLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[0]->
setAxisTitle(
"rad");
105 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_theta",
"#theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[1]->setAxisTitle(
"rad");
106 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_theta",
"#theta_{STAfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[2]->setAxisTitle(
"rad");
107 thetaResolution.push_back(ibooker.
book1D(
"Res_TkGlb_theta",
"#theta_{TKfromGLB} - #theta_{GLB}", thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[0]->setAxisTitle(
"rad");
108 thetaResolution.push_back(ibooker.
book1D(
"Res_GlbSta_theta",
"#theta_{GLB} - #theta_{STAfromGLB}", thetaBin*binFactor,-(thetaMax/100), thetaMax/100));
109 thetaResolution[1]->setAxisTitle(
"rad");
110 thetaResolution.push_back(ibooker.
book1D(
"Res_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB}", thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
111 thetaResolution[2]->setAxisTitle(
"rad");
112 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkGlb_theta",
"(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000));
113 thetaResolution[3]->setAxisTitle(
"rad",1);
114 thetaResolution[3]->setAxisTitle(
"rad",2);
115 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_GlbSta_theta",
"(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
116 thetaResolution[4]->setAxisTitle(
"rad",1);
117 thetaResolution[4]->setAxisTitle(
"rad",2);
118 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkSta_theta",
"(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
119 thetaResolution[5]->setAxisTitle(
"rad",1);
120 thetaResolution[5]->setAxisTitle(
"rad",2);
121 thetaPull = ibooker.
book1D(
"Pull_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100,-10,10);
122 thetaTrack = ibooker.
book1D(
"TkMuon_theta",
"#theta_{TK}", thetaBin, thetaMin, thetaMax);
124 thetaStaTrack = ibooker.
book1D(
"StaMuon_theta",
"#theta_{STA}", thetaBin, thetaMin, thetaMax);
128 tunePResolution = ibooker.
book1D(
"Res_TuneP_pt",
"Pt_{MuonBestTrack}-Pt_{tunePMuonBestTrack}/Pt_{MuonBestTrack}", tunePBin, tunePMin, tunePMax);
134 phiGlbTrack[1]->setAxisTitle(
"rad");
136 phiGlbTrack[2]->setAxisTitle(
"rad");
152 phiPull = ibooker.
book1D(
"Pull_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100,-10,10);
158 phiEfficiency[0]->setAxisTitle(
"rad");
159 phiEfficiency.push_back(ibooker.
book1D(
"StaPhi_ifCombinedAlso",
"#phi_{STAfromGLB} if the isGlb=true",
phiBin,
phiMin,
phiMax));
160 phiEfficiency[1]->setAxisTitle(
"rad");
163 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_chi2OverDf",
"#chi_{2}OverDF_{GLB}", chi2Bin,
chi2Min,
chi2Max));
165 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_chi2OverDf",
"#chi_{2}OverDF_{STAfromGLB}", chi2Bin,
chi2Min,
chi2Max));
166 chi2OvDFTrack = ibooker.
book1D(
"TkMuon_chi2OverDf",
"#chi_{2}OverDF_{TK}", chi2Bin,
chi2Min,
chi2Max);
167 chi2OvDFStaTrack = ibooker.
book1D(
"StaMuon_chi2OverDf",
"#chi_{2}OverDF_{STA}", chi2Bin,
chi2Min,
chi2Max);
169 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Glb_probchi",
"Prob #chi_{GLB}", 120,
chi2Min, 1.20));
170 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Tk_probchi",
"Prob #chi_{TKfromGLB}", 120,
chi2Min, 1.20));
171 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Sta_probchi",
"Prob #chi_{STAfromGLB}", 120,
chi2Min, 1.20));
172 probchi2Track=ibooker.
book1D(
"TkMuon_probchi",
"Prob #chi_{TK}", 120,
chi2Min, 1.20);
173 probchi2StaTrack=ibooker.
book1D(
"StaMuon_probchi",
"Prob #chi_{STA}", 120,
chi2Min, 1.20);
176 pGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_p",
"p_{GLB}", pBin,
pMin,
pMax));
178 pGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_p",
"p_{TKfromGLB}", pBin,
pMin,
pMax));
179 pGlbTrack[1]->setAxisTitle(
"GeV");
180 pGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_p",
"p_{STAfromGLB}", pBin,
pMin,
pMax));
181 pGlbTrack[2]->setAxisTitle(
"GeV");
184 pStaTrack = ibooker.
book1D(
"StaMuon_p",
"p_{STA}", pBin,
pMin,
pMax);
189 ptGlbTrack[0]->setAxisTitle(
"GeV");
191 ptGlbTrack[1]->setAxisTitle(
"GeV");
193 ptGlbTrack[2]->setAxisTitle(
"GeV");
200 qGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_q",
"q_{GLB}", 5, -2.5, 2.5));
201 qGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_q",
"q_{TKfromGLB}", 5, -2.5, 2.5));
202 qGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_q",
"q_{STAformGLB}", 5, -2.5, 2.5));
203 qGlbTrack.push_back(ibooker.
book1D(histname+
"qComparison",
"comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5));
204 qGlbTrack[3]->setBinLabel(1,
"qGlb=qSta");
205 qGlbTrack[3]->setBinLabel(2,
"qGlb!=qSta");
206 qGlbTrack[3]->setBinLabel(3,
"qGlb=qTk");
207 qGlbTrack[3]->setBinLabel(4,
"qGlb!=qTk");
208 qGlbTrack[3]->setBinLabel(5,
"qSta=qTk");
209 qGlbTrack[3]->setBinLabel(6,
"qSta!=qTk");
210 qGlbTrack[3]->setBinLabel(7,
"qGlb!=qSta,qGlb!=Tk");
211 qGlbTrack[3]->setBinLabel(8,
"qGlb=qSta,qGlb=Tk");
212 qTrack = ibooker.
book1D(
"TkMuon_q",
"q_{TK}", 5, -2.5, 2.5);
213 qStaTrack = ibooker.
book1D(
"StaMuon_q",
"q_{STA}", 5, -2.5, 2.5);
217 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
219 qOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverp",
"(q/p)_{GLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
220 qOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
221 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
222 qOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
223 qOverpPull = ibooker.
book1D(
"Pull_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100,-10,10);
225 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
227 oneOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverp",
"(1/p)_{GLB} - (1/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
228 oneOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
229 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
230 oneOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
231 oneOverpPull = ibooker.
book1D(
"Pull_TkSta_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100,-10,10);
234 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
236 qOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverpt",
"(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
237 qOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
238 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
239 qOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
240 qOverptPull = ibooker.
book1D(
"Pull_TkSta_qOverpt",
"(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100,-10,10);
242 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
244 oneOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverpt",
"(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
245 oneOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
246 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
247 oneOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
248 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));
249 oneOverptResolution[3]->setAxisTitle(
"GeV^{-1}",2);
250 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_GlbSta_oneOverpt",
"(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}",
etaBin,
etaMin,
etaMax, pResBin*binFactor, pResMin, pResMax));
251 oneOverptResolution[4]->setAxisTitle(
"GeV^{-1}",2);
252 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkSta_oneOverpt",
"(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
etaBin,
etaMin,
etaMax, pResBin*binFactor, pResMin, pResMax));
253 oneOverptResolution[5]->setAxisTitle(
"GeV^{-1}",2);
254 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));
255 oneOverptResolution[6]->setAxisTitle(
"rad",1);
256 oneOverptResolution[6]->setAxisTitle(
"GeV^{-1}",2);
257 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_GlbSta_oneOverpt",
"(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}",
phiBin,
phiMin,
phiMax, pResBin*binFactor, pResMin, pResMax));
258 oneOverptResolution[7]->setAxisTitle(
"rad",1);
259 oneOverptResolution[7]->setAxisTitle(
"GeV^{-1}",2);
260 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkSta_oneOverpt",
"(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
phiBin,
phiMin,
phiMax, pResBin*binFactor, pResMin, pResMax));
261 oneOverptResolution[8]->setAxisTitle(
"rad",1);
262 oneOverptResolution[8]->setAxisTitle(
"GeV^{-1}",2);
263 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));
264 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",1);
265 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",2);
266 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));
267 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",1);
268 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",2);
269 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));
270 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",1);
271 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",2);
272 oneOverptPull = ibooker.
book1D(
"Pull_TkSta_oneOverpt",
"(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100,-10,10);
283 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_Frac_inGlb",
"recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
284 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_Frac_inGlb",
"recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
285 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_inGlb_Div_RhAssoSta",
"recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax));
286 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_inGlb_Div_RhAssoTk",
"recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax));
287 rhAnalysis.push_back(ibooker.
book1D(
"GlbRh_Div_RhAssoStaTk",
"recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax));
288 rhAnalysis.push_back(ibooker.
book1D(
"invalidRh_Frac_inTk",
"Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax));
292 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_posMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2));
293 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_negMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2));
299 float p1=0,
p2=0, p1e=1, p2e=1;
302 p1 = t1->eta(); p1e = t1->etaError();
303 p2 = t2->eta(); p2e = t2->etaError();
305 else if(par ==
"theta") {
306 p1 = t1->theta(); p1e = t1->thetaError();
307 p2 = t2->theta(); p2e = t2->thetaError();
309 else if(par ==
"phi") {
310 p1 = t1->phi(); p1e = t1->phiError();
311 p2 = t2->phi(); p2e = t2->phiError();
313 else if(par ==
"qOverp") {
314 p1 = t1->charge()/t1->p(); p1e = t1->qoverpError();
315 p2 = t2->charge()/t2->p(); p2e = t2->qoverpError();
317 else if(par ==
"oneOverp") {
318 p1 = 1./t1->p(); p1e = t1->qoverpError();
319 p2 = 1./t2->p(); p2e = t2->qoverpError();
321 else if(par ==
"qOverpt") {
322 p1 = t1->charge()/t1->pt(); p1e = t1->ptError()*p1*
p1;
323 p2 = t2->charge()/t2->pt(); p2e = t2->ptError()*
p2*
p2;
325 else if(par ==
"oneOverpt") {
326 p1 = 1./t1->pt(); p1e = t1->ptError()*p1*
p1;
327 p2 = 1./t2->pt(); p2e = t2->ptError()*
p2*
p2;
331 if(p1e!=0 || p2e!=0) pull = res /
sqrt(p1e*p1e + p2e*p2e);
337 theService->update(iSetup);
341 iEvent.
getByToken(theMuonCollectionLabel_,muons);
349 if(
muon->isGlobalMuon()) {
350 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
351 if(
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
353 if(!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
355 if(!
muon->isStandAloneMuon())
356 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
366 etaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta());
367 etaGlbTrack[1]->Fill(recoTkGlbTrack->eta());
368 etaGlbTrack[2]->Fill(recoStaGlbTrack->eta());
370 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
371 phiVsetaGlbTrack[1]->Fill(recoTkGlbTrack->eta() , recoTkGlbTrack->phi());
372 phiVsetaGlbTrack[2]->Fill(recoStaGlbTrack->eta() , recoStaGlbTrack->phi());
374 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
376 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
378 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
382 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
383 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
384 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
387 thetaGlbTrack[0]->Fill(recoCombinedGlbTrack->theta());
388 thetaGlbTrack[1]->Fill(recoTkGlbTrack->theta());
389 thetaGlbTrack[2]->Fill(recoStaGlbTrack->theta());
390 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
391 thetaResolution[0]->Fill(res);
393 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
394 thetaResolution[1]->Fill(res);
396 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
397 thetaResolution[2]->Fill(res);
398 thetaPull->Fill(pull);
400 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
401 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
402 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
405 phiGlbTrack[0]->Fill(recoCombinedGlbTrack->phi());
406 phiGlbTrack[1]->Fill(recoTkGlbTrack->phi());
407 phiGlbTrack[2]->Fill(recoStaGlbTrack->phi());
408 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
410 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
412 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
415 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
416 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
417 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
419 chi2OvDFGlbTrack[0]->Fill(recoCombinedGlbTrack->normalizedChi2());
420 chi2OvDFGlbTrack[1]->Fill(recoTkGlbTrack->normalizedChi2());
421 chi2OvDFGlbTrack[2]->Fill(recoStaGlbTrack->normalizedChi2());
425 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
426 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
427 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
431 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
432 pGlbTrack[1]->Fill(recoTkGlbTrack->p());
433 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
435 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
436 ptGlbTrack[1]->Fill(recoTkGlbTrack->pt());
437 ptGlbTrack[2]->Fill(recoStaGlbTrack->pt());
439 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
440 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
441 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
442 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge()) qGlbTrack[3]->
Fill(1);
443 else qGlbTrack[3]->Fill(2);
444 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(3);
445 else qGlbTrack[3]->Fill(4);
446 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(5);
447 else qGlbTrack[3]->Fill(6);
448 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(7);
449 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(8);
451 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
452 qOverpResolution[0]->Fill(res);
453 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
454 qOverpResolution[1]->Fill(res);
455 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
456 qOverpResolution[2]->Fill(res);
457 qOverpPull->Fill(pull);
460 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
461 oneOverpResolution[0]->Fill(res);
462 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
463 oneOverpResolution[1]->Fill(res);
464 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
465 oneOverpResolution[2]->Fill(res);
466 oneOverpPull->Fill(pull);
469 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
470 qOverptResolution[0]->Fill(res);
471 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
472 qOverptResolution[1]->Fill(res);
473 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
474 qOverptResolution[2]->Fill(res);
475 qOverptPull->Fill(pull);
477 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
478 oneOverptResolution[0]->Fill(res);
479 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
480 oneOverptResolution[1]->Fill(res);
481 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
482 oneOverptResolution[2]->Fill(res);
483 oneOverptPull->Fill(pull);
492 double bestTrackPt = recoBestTrack->pt();
494 double tunePBestTrackPt = recoTunePBestTrack->pt();
496 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
498 tunePResolution->Fill(tunePBestTrackRes);
500 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
501 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
502 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
503 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
504 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
505 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
506 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
507 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
508 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
513 double rhGlb = recoCombinedGlbTrack->found();
515 double rhGlb_StaProvenance=0;
517 double rhGlb_TkProvenance=0;
524 if((*recHit)->isValid()){
525 DetId id = (*recHit)->geographicalId();
527 rhGlb_StaProvenance++;
529 rhGlb_TkProvenance++;
533 double rhStaGlb = recoStaGlbTrack->recHitsSize();
535 double rhTkGlb = recoTkGlbTrack->found();
537 double rhTkGlb_notValid = recoTkGlbTrack->lost();
540 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
541 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
542 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
543 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
544 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
545 rhAnalysis[5]->Fill(rhTkGlb_notValid/rhGlb);
548 if(recoCombinedGlbTrack->charge()>0)
549 muVStkSytemRotation[0]->
Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
551 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
556 if(
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
557 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
558 if(
muon->isStandAloneMuon())
560 if(!(
muon->isStandAloneMuon()))
566 etaTrack->Fill(recoTrack->eta());
567 thetaTrack->Fill(recoTrack->theta());
568 phiTrack->Fill(recoTrack->phi());
569 chi2OvDFTrack->Fill(recoTrack->normalizedChi2());
570 probchi2Track->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
571 pTrack->Fill(recoTrack->p());
572 ptTrack->Fill(recoTrack->pt());
573 qTrack->Fill(recoTrack->charge());
577 if(
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
578 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
579 if(!(
muon->isTrackerMuon()))
585 etaStaTrack->Fill(recoStaTrack->eta());
586 thetaStaTrack->Fill(recoStaTrack->theta());
587 phiStaTrack->Fill(recoStaTrack->phi());
588 chi2OvDFStaTrack->Fill(recoStaTrack->normalizedChi2());
589 probchi2StaTrack->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
590 pStaTrack->Fill(recoStaTrack->p());
591 ptStaTrack->Fill(recoStaTrack->pt());
592 qStaTrack->Fill(recoStaTrack->charge());
596 if(
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
604 if(
muon->isStandAloneMuon()){
605 etaEfficiency[0]->Fill(recoStaGlbTrack->eta());
606 phiEfficiency[0]->Fill(recoStaGlbTrack->phi());
608 if(
muon->isStandAloneMuon() &&
muon->isGlobalMuon()){
609 etaEfficiency[1]->Fill(recoStaGlbTrack->eta());
610 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 &) override
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)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
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.