25 doMVA =
parameters.getParameter<
bool>(
"doMVA");
28 theMuonCollectionLabel_ = consumes<edm::View<reco::Muon> > (
parameters.getParameter<
edm::InputTag>(
"MuonCollection"));
29 theVertexLabel_ = consumes<reco::VertexCollection> (pSet.
getParameter<
InputTag>(
"inputTagVertex"));
36 pResBin =
parameters.getParameter<
int>(
"pResBin");
37 pResMin =
parameters.getParameter<
double>(
"pResMin");
38 pResMax =
parameters.getParameter<
double>(
"pResMax");
40 rhMin=
parameters.getParameter<
double>(
"rhMin");
41 rhMax=
parameters.getParameter<
double>(
"rhMax");
45 chi2Bin =
parameters.getParameter<
int>(
"chi2Bin");
51 tunePBin=
parameters.getParameter<
int>(
"tunePBin");
52 tunePMax=
parameters.getParameter<
double>(
"tunePMax");
53 tunePMin=
parameters.getParameter<
double>(
"tunePMin");
54 thetaBin =
parameters.getParameter<
int>(
"thetaBin");
55 thetaMin =
parameters.getParameter<
double>(
"thetaMin");
56 thetaMax =
parameters.getParameter<
double>(
"thetaMax");
61 theFolder =
parameters.getParameter<
string>(
"folder");
75 muReco = ibooker.
book1D(
"muReco",
"muon reconstructed tracks", 6, 1, 7);
77 muReco->setBinLabel(2,
"glb+sta");
78 muReco->setBinLabel(3,
"tk+sta");
79 muReco->setBinLabel(4,
"tk");
80 muReco->setBinLabel(5,
"sta");
81 muReco->setBinLabel(6,
"calo");
98 etaPull = ibooker.
book1D(
"Pull_TkSta_eta",
"#eta_{TKfromGLB} - #eta_{GLB} / error", 100, -10, 10);
102 etaEfficiency.push_back(ibooker.
book1D(
"StaEta_ifCombinedAlso",
"#eta_{STAfromGLB} if isGlb=true",
etaBin,
etaMin,
etaMax));
107 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_theta",
"#theta_{GLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[0]->
setAxisTitle(
"rad");
108 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_theta",
"#theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[1]->setAxisTitle(
"rad");
109 thetaGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_theta",
"#theta_{STAfromGLB}", thetaBin, thetaMin, thetaMax)); thetaGlbTrack[2]->setAxisTitle(
"rad");
110 thetaResolution.push_back(ibooker.
book1D(
"Res_TkGlb_theta",
"#theta_{TKfromGLB} - #theta_{GLB}", thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000)); thetaResolution[0]->setAxisTitle(
"rad");
111 thetaResolution.push_back(ibooker.
book1D(
"Res_GlbSta_theta",
"#theta_{GLB} - #theta_{STAfromGLB}", thetaBin*binFactor,-(thetaMax/100), thetaMax/100));
112 thetaResolution[1]->setAxisTitle(
"rad");
113 thetaResolution.push_back(ibooker.
book1D(
"Res_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB}", thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
114 thetaResolution[2]->setAxisTitle(
"rad");
115 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkGlb_theta",
"(#theta_{TKfromGLB} - #theta_{GLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/3000), thetaMax/3000));
116 thetaResolution[3]->setAxisTitle(
"rad",1);
117 thetaResolution[3]->setAxisTitle(
"rad",2);
118 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_GlbSta_theta",
"(#theta_{GLB} - #theta_{STAfromGLB}) vs #theta_{GLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
119 thetaResolution[4]->setAxisTitle(
"rad",1);
120 thetaResolution[4]->setAxisTitle(
"rad",2);
121 thetaResolution.push_back(ibooker.
book2D(
"ResVsTheta_TkSta_theta",
"(#theta_{TKfromGLB} - #theta_{STAfromGLB}) vs #theta_{TKfromGLB}", thetaBin, thetaMin, thetaMax, thetaBin*binFactor, -(thetaMax/100), thetaMax/100));
122 thetaResolution[5]->setAxisTitle(
"rad",1);
123 thetaResolution[5]->setAxisTitle(
"rad",2);
124 thetaPull = ibooker.
book1D(
"Pull_TkSta_theta",
"#theta_{TKfromGLB} - #theta_{STAfromGLB} / error", 100,-10,10);
125 thetaTrack = ibooker.
book1D(
"TkMuon_theta",
"#theta_{TK}", thetaBin, thetaMin, thetaMax);
127 thetaStaTrack = ibooker.
book1D(
"StaMuon_theta",
"#theta_{STA}", thetaBin, thetaMin, thetaMax);
131 tunePResolution = ibooker.
book1D(
"Res_TuneP_pt",
"Pt_{MuonBestTrack}-Pt_{tunePMuonBestTrack}/Pt_{MuonBestTrack}", tunePBin, tunePMin, tunePMax);
137 phiGlbTrack[1]->setAxisTitle(
"rad");
139 phiGlbTrack[2]->setAxisTitle(
"rad");
155 phiPull = ibooker.
book1D(
"Pull_TkSta_phi",
"#phi_{TKfromGLB} - #phi_{STAfromGLB} / error", 100,-10,10);
161 phiEfficiency[0]->setAxisTitle(
"rad");
162 phiEfficiency.push_back(ibooker.
book1D(
"StaPhi_ifCombinedAlso",
"#phi_{STAfromGLB} if the isGlb=true",
phiBin,
phiMin,
phiMax));
163 phiEfficiency[1]->setAxisTitle(
"rad");
166 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_chi2OverDf",
"#chi_{2}OverDF_{GLB}", chi2Bin,
chi2Min,
chi2Max));
168 chi2OvDFGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_chi2OverDf",
"#chi_{2}OverDF_{STAfromGLB}", chi2Bin,
chi2Min,
chi2Max));
169 chi2OvDFTrack = ibooker.
book1D(
"TkMuon_chi2OverDf",
"#chi_{2}OverDF_{TK}", chi2Bin,
chi2Min,
chi2Max);
170 chi2OvDFStaTrack = ibooker.
book1D(
"StaMuon_chi2OverDf",
"#chi_{2}OverDF_{STA}", chi2Bin,
chi2Min,
chi2Max);
172 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Glb_probchi",
"Prob #chi_{GLB}", 120,
chi2Min, 1.20));
173 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Tk_probchi",
"Prob #chi_{TKfromGLB}", 120,
chi2Min, 1.20));
174 probchi2GlbTrack.push_back(ibooker.
book1D(histname+
"Sta_probchi",
"Prob #chi_{STAfromGLB}", 120,
chi2Min, 1.20));
175 probchi2Track=ibooker.
book1D(
"TkMuon_probchi",
"Prob #chi_{TK}", 120,
chi2Min, 1.20);
176 probchi2StaTrack=ibooker.
book1D(
"StaMuon_probchi",
"Prob #chi_{STA}", 120,
chi2Min, 1.20);
179 pGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_p",
"p_{GLB}", pBin,
pMin,
pMax));
181 pGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_p",
"p_{TKfromGLB}", pBin,
pMin,
pMax));
182 pGlbTrack[1]->setAxisTitle(
"GeV");
183 pGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_p",
"p_{STAfromGLB}", pBin,
pMin,
pMax));
184 pGlbTrack[2]->setAxisTitle(
"GeV");
187 pStaTrack = ibooker.
book1D(
"StaMuon_p",
"p_{STA}", pBin,
pMin,
pMax);
192 ptGlbTrack[0]->setAxisTitle(
"GeV");
194 ptGlbTrack[1]->setAxisTitle(
"GeV");
196 ptGlbTrack[2]->setAxisTitle(
"GeV");
205 ptSoftMuonMVA = ibooker.
book1D(
"ptSoftMuonMVA",
"pt_{SoftMuon}", 50, 0, 50);
206 deltaRSoftMuonMVA = ibooker.
book1D(
"deltaRSoftMuonMVA",
"#Delta R", 50, 0, 5);
207 gNchi2SoftMuonMVA = ibooker.
book1D(
"gNchi2SoftMuonMVA",
"gNchi2", 50, 0, 3);
208 vMuHitsSoftMuonMVA = ibooker.
book1D(
"vMuHitsSoftMuonMVA",
"vMuHits", 50, 0, 50);
209 mNuStationsSoftMuonMVA = ibooker.
book1D(
"mNuStationsSoftMuonMVA",
"mNuStations", 6, 0, 6);
210 dxyRefSoftMuonMVA = ibooker.
book1D(
"dxyRefSoftMuonMVA",
"dxyRef", 50, -0.1, 0.1);
211 dzRefSoftMuonMVA = ibooker.
book1D(
"dzRefSoftMuonMVA",
"dzRef", 50, -0.1, 0.1);
212 LWHSoftMuonMVA = ibooker.
book1D(
"LWHSoftMuonMVA",
"LWH", 20, 0, 20);
213 valPixHitsSoftMuonMVA = ibooker.
book1D(
"valPixHitsSoftMuonMVA",
"valPixHits", 8, 0, 8);
214 innerChi2SoftMuonMVA = ibooker.
book1D(
"innerChi2SoftMuonMVA",
"innerChi2", 50, 0, 3);
215 outerChi2SoftMuonMVA = ibooker.
book1D(
"outerChi2SoftMuonMVA",
"outerChi2", 50, 0, 4);
216 iValFracSoftMuonMVA = ibooker.
book1D(
"iValFracSoftMuonMVA",
"iValFrac", 50, 0.5, 1.0);
217 segCompSoftMuonMVA = ibooker.
book1D(
"segCompSoftMuonMVA",
"segComp", 50, 0, 1.2);
218 chi2LocMomSoftMuonMVA = ibooker.
book1D(
"chi2LocMomSoftMuonMVA",
"chi2LocMom", 50, 0, 40);
219 chi2LocPosSoftMuonMVA = ibooker.
book1D(
"chi2LocPosSoftMuonMVA",
"chi2LocPos", 0, 0, 8);
220 glbTrackTailProbSoftMuonMVA = ibooker.
book1D(
"glbTrackTailProbSoftMuonMVA",
"glbTrackTailProb", 50, 0, 8);
221 NTrkVHitsSoftMuonMVA = ibooker.
book1D(
"NTrkVHitsSoftMuonMVA",
"NTrkVHits", 50, 0, 35);
222 kinkFinderSoftMuonMVA = ibooker.
book1D(
"kinkFinderSoftMuonMVA",
"kinkFinder", 50, 0, 30);
223 vRPChitsSoftMuonMVA = ibooker.
book1D(
"vRPChitsSoftMuonMVA",
"vRPChits", 50, 0, 50);
224 glbKinkFinderSoftMuonMVA = ibooker.
book1D(
"glbKinkFinderSoftMuonMVA",
"glbKinkFinder", 50, 0, 50);
225 glbKinkFinderLogSoftMuonMVA = ibooker.
book1D(
"glbKinkFinderLogSoftMuonMVA",
"glbKinkFinderLog", 50, 0, 50);
226 staRelChi2SoftMuonMVA = ibooker.
book1D(
"staRelChi2SoftMuonMVA",
"staRelChi2", 50, 0, 2);
227 glbDeltaEtaPhiSoftMuonMVA = ibooker.
book1D(
"glbDeltaEtaPhiSoftMuonMVA",
"glbDeltaEtaPhi", 50, 0, 0.15);
228 trkRelChi2SoftMuonMVA = ibooker.
book1D(
"trkRelChi2SoftMuonMVA",
"trkRelChi2", 50, 0, 1.2);
229 vDThitsSoftMuonMVA = ibooker.
book1D(
"vDThitsSoftMuonMVA",
"vDThits", 50, 0, 50);
230 vCSChitsSoftMuonMVA = ibooker.
book1D(
"vCSChitsSoftMuonMVA",
"vCSChits", 50, 0, 50);
231 timeAtIpInOutSoftMuonMVA = ibooker.
book1D(
"timeAtIpInOutSoftMuonMVA",
"timeAtIpInOut", 50, -10.0, 10.0);
232 timeAtIpInOutErrSoftMuonMVA = ibooker.
book1D(
"timeAtIpInOutErrSoftMuonMVA",
"timeAtIpInOutErr", 50, 0, 3.5);
233 getMuonHitsPerStationSoftMuonMVA = ibooker.
book1D(
"getMuonHitsPerStationSoftMuonMVA",
"getMuonHitsPerStation", 6, 0, 6);
234 QprodSoftMuonMVA = ibooker.
book1D(
"QprodSoftMuonMVA",
"Qprod", 4, -2, 2);
239 qGlbTrack.push_back(ibooker.
book1D(histname+
"Glb_q",
"q_{GLB}", 5, -2.5, 2.5));
240 qGlbTrack.push_back(ibooker.
book1D(histname+
"Tk_q",
"q_{TKfromGLB}", 5, -2.5, 2.5));
241 qGlbTrack.push_back(ibooker.
book1D(histname+
"Sta_q",
"q_{STAformGLB}", 5, -2.5, 2.5));
242 qGlbTrack.push_back(ibooker.
book1D(histname+
"qComparison",
"comparison between q_{GLB} and q_{TKfromGLB}, q_{STAfromGLB}", 8, 0.5, 8.5));
244 qGlbTrack[3]->setBinLabel(2,
"qGlb!=qSta");
245 qGlbTrack[3]->setBinLabel(3,
"qGlb=qTk");
246 qGlbTrack[3]->setBinLabel(4,
"qGlb!=qTk");
247 qGlbTrack[3]->setBinLabel(5,
"qSta=qTk");
248 qGlbTrack[3]->setBinLabel(6,
"qSta!=qTk");
249 qGlbTrack[3]->setBinLabel(7,
"qGlb!=qSta,qGlb!=Tk");
250 qGlbTrack[3]->setBinLabel(8,
"qGlb=qSta,qGlb=Tk");
251 qTrack = ibooker.
book1D(
"TkMuon_q",
"q_{TK}", 5, -2.5, 2.5);
252 qStaTrack = ibooker.
book1D(
"StaMuon_q",
"q_{STA}", 5, -2.5, 2.5);
256 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
258 qOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverp",
"(q/p)_{GLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
259 qOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
260 qOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
261 qOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
262 qOverpPull = ibooker.
book1D(
"Pull_TkSta_qOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB} / error", 100,-10,10);
264 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
266 oneOverpResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverp",
"(1/p)_{GLB} - (1/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
267 oneOverpResolution[1]->setAxisTitle(
"GeV^{-1}");
268 oneOverpResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverp",
"(q/p)_{TKfromGLB} - (q/p)_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
269 oneOverpResolution[2]->setAxisTitle(
"GeV^{-1}");
270 oneOverpPull = ibooker.
book1D(
"Pull_TkSta_oneOverp",
"(1/p)_{TKfromGLB} - (1/p)_{STAfromGLB} / error", 100,-10,10);
273 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
275 qOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_qOverpt",
"(q/p_{t})_{GLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
276 qOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
277 qOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_qOverpt",
"(q/p_{t})_{TKfromGLB} - (q/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
278 qOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
279 qOverptPull = ibooker.
book1D(
"Pull_TkSta_qOverpt",
"(q/pt)_{TKfromGLB} - (q/pt)_{STAfromGLB} / error", 100,-10,10);
281 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkGlb_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{GLB}", pResBin*binFactor*2, pResMin/10, pResMax/10));
283 oneOverptResolution.push_back(ibooker.
book1D(
"Res_GlbSta_oneOverpt",
"(1/p_{t})_{GLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
284 oneOverptResolution[1]->setAxisTitle(
"GeV^{-1}");
285 oneOverptResolution.push_back(ibooker.
book1D(
"Res_TkSta_oneOverpt",
"(1/p_{t})_{TKfromGLB} - (1/p_{t})_{STAfromGLB}", pResBin*binFactor, pResMin, pResMax));
286 oneOverptResolution[2]->setAxisTitle(
"GeV^{-1}");
287 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));
288 oneOverptResolution[3]->setAxisTitle(
"GeV^{-1}",2);
289 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_GlbSta_oneOverpt",
"(#eta_{GLB} - #eta_{STAfromGLB} vs (1/p_{t})_{GLB}",
etaBin,
etaMin,
etaMax, pResBin*binFactor, pResMin, pResMax));
290 oneOverptResolution[4]->setAxisTitle(
"GeV^{-1}",2);
291 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsEta_TkSta_oneOverpt",
"(#eta_{TKfromGLB} - #eta_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
etaBin,
etaMin,
etaMax, pResBin*binFactor, pResMin, pResMax));
292 oneOverptResolution[5]->setAxisTitle(
"GeV^{-1}",2);
293 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));
294 oneOverptResolution[6]->setAxisTitle(
"rad",1);
295 oneOverptResolution[6]->setAxisTitle(
"GeV^{-1}",2);
296 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_GlbSta_oneOverpt",
"(#phi_{GLB} - #phi_{STAfromGLB} vs (1/p_{t})_{GLB}",
phiBin,
phiMin,
phiMax, pResBin*binFactor, pResMin, pResMax));
297 oneOverptResolution[7]->setAxisTitle(
"rad",1);
298 oneOverptResolution[7]->setAxisTitle(
"GeV^{-1}",2);
299 oneOverptResolution.push_back(ibooker.
book2D(
"ResVsPhi_TkSta_oneOverpt",
"(#phi_{TKfromGLB} - #phi_{STAfromGLB}) vs (1/p_{t})_{TKfromGLB}",
phiBin,
phiMin,
phiMax, pResBin*binFactor, pResMin, pResMax));
300 oneOverptResolution[8]->setAxisTitle(
"rad",1);
301 oneOverptResolution[8]->setAxisTitle(
"GeV^{-1}",2);
302 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));
303 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",1);
304 oneOverptResolution[9]->setAxisTitle(
"GeV^{-1}",2);
305 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));
306 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",1);
307 oneOverptResolution[10]->setAxisTitle(
"GeV^{-1}",2);
308 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));
309 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",1);
310 oneOverptResolution[11]->setAxisTitle(
"GeV^{-1}",2);
311 oneOverptPull = ibooker.
book1D(
"Pull_TkSta_oneOverpt",
"(1/pt)_{TKfromGLB} - (1/pt)_{STAfromGLB} / error", 100,-10,10);
326 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_Frac_inGlb",
"recHits_{STAinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
327 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_Frac_inGlb",
"recHits_{TKinGLB} / recHits_{GLB}", rhBin, rhMin, rhMax));
328 rhAnalysis.push_back(ibooker.
book1D(
"StaRh_inGlb_Div_RhAssoSta",
"recHits_{STAinGLB} / recHits_{STAfromGLB}", rhBin, rhMin, rhMax));
329 rhAnalysis.push_back(ibooker.
book1D(
"TkRh_inGlb_Div_RhAssoTk",
"recHits_{TKinGLB} / recHits_{TKfromGLB}", rhBin, rhMin, rhMax));
330 rhAnalysis.push_back(ibooker.
book1D(
"GlbRh_Div_RhAssoStaTk",
"recHits_{GLB} / (recHits_{TKfromGLB}+recHits_{STAfromGLB})", rhBin, rhMin, rhMax));
331 rhAnalysis.push_back(ibooker.
book1D(
"invalidRh_Frac_inTk",
"Invalid recHits / rechits_{GLB}", rhBin, rhMin, rhMax));
335 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_posMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{+}", 50,0,200,100,0.8,1.2));
336 muVStkSytemRotation.push_back(ibooker.
book2D(
"muVStkSytemRotation_negMu",
"pT_{TK} / pT_{GLB} vs pT_{GLB} for #mu^{-}", 50,0,200,100,0.8,1.2));
342 float p1=0,
p2=0, p1e=1, p2e=1;
345 p1 = t1->eta(); p1e = t1->etaError();
346 p2 = t2->eta(); p2e = t2->etaError();
348 else if(par ==
"theta") {
349 p1 = t1->theta(); p1e = t1->thetaError();
350 p2 = t2->theta(); p2e = t2->thetaError();
352 else if(par ==
"phi") {
353 p1 = t1->phi(); p1e = t1->phiError();
354 p2 = t2->phi(); p2e = t2->phiError();
356 else if(par ==
"qOverp") {
357 p1 = t1->charge()/t1->p(); p1e = t1->qoverpError();
358 p2 = t2->charge()/t2->p(); p2e = t2->qoverpError();
360 else if(par ==
"oneOverp") {
361 p1 = 1./t1->p(); p1e = t1->qoverpError();
362 p2 = 1./t2->p(); p2e = t2->qoverpError();
364 else if(par ==
"qOverpt") {
365 p1 = t1->charge()/t1->pt(); p1e = t1->ptError()*p1*
p1;
366 p2 = t2->charge()/t2->pt(); p2e = t2->ptError()*
p2*
p2;
368 else if(par ==
"oneOverpt") {
369 p1 = 1./t1->pt(); p1e = t1->ptError()*p1*
p1;
370 p2 = 1./t2->pt(); p2e = t2->ptError()*
p2*
p2;
374 if(p1e!=0 || p2e!=0) pull = res /
sqrt(p1e*p1e + p2e*p2e);
389 theService->update(iSetup);
393 iEvent.
getByToken(theMuonCollectionLabel_,muons);
398 iEvent.
getByToken(theBeamSpotLabel_, beamSpot);
399 if(!beamSpot.
isValid()) {
edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the beamspot" << endl; doMVA =
false;}
401 if(!vertex.
isValid()) {
edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the vertex collection" << endl; doMVA =
false;}
406 bool fillBadLumi =
false;
408 for (
auto const & dcsStatusItr : *dcsStatus) {
454 pvIndex = getPv(iTrack.
index(), &(*vertex));
456 refPoint = vertex->at(pvIndex).position();
461 edm::LogInfo(
"MuonRecoAnalyzer") <<
"ERROR: No beam sport found!" << endl;
465 ptSoftMuonMVA->Fill(iTrack->eta());
466 deltaRSoftMuonMVA->Fill(getDeltaR(*iTrack,*oTrack));
467 gNchi2SoftMuonMVA->Fill(gTrack->normalizedChi2());
469 mNuStationsSoftMuonMVA->Fill(
muon->numberOfMatchedStations());
471 dxyRefSoftMuonMVA->Fill(iTrack->dxy(refPoint));
472 dzRefSoftMuonMVA->Fill(iTrack->dz(refPoint));
476 innerChi2SoftMuonMVA->Fill(iTrack->normalizedChi2());
477 outerChi2SoftMuonMVA->Fill(oTrack->normalizedChi2());
478 iValFracSoftMuonMVA->Fill(iTrack->validFraction());
484 kinkFinderSoftMuonMVA->Fill(muonQuality.
trkKink);
486 glbKinkFinderSoftMuonMVA->Fill(muonQuality.
glbKink);
487 glbKinkFinderLogSoftMuonMVA->Fill(TMath::Log(2+muonQuality.
glbKink));
488 staRelChi2SoftMuonMVA->Fill(muonQuality.
staRelChi2);
490 trkRelChi2SoftMuonMVA->Fill(muonQuality.
trkRelChi2);
493 timeAtIpInOutSoftMuonMVA->Fill(
muon->time().timeAtIpInOut);
494 timeAtIpInOutErrSoftMuonMVA->Fill(
muon->time().timeAtIpInOutErr);
496 QprodSoftMuonMVA->Fill((iTrack->charge() * oTrack->charge()));
499 if(
muon->isGlobalMuon()) {
500 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
501 if(
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
503 if(!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
505 if(!
muon->isStandAloneMuon())
506 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
514 etaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta());
515 etaGlbTrack[1]->Fill(recoTkGlbTrack->eta());
516 etaGlbTrack[2]->Fill(recoStaGlbTrack->eta());
518 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
519 phiVsetaGlbTrack[1]->Fill(recoTkGlbTrack->eta() , recoTkGlbTrack->phi());
520 phiVsetaGlbTrack[2]->Fill(recoStaGlbTrack->eta() , recoStaGlbTrack->phi());
523 phiVsetaGlbTrack_badlumi[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
524 phiVsetaGlbTrack_badlumi[1]->Fill(recoTkGlbTrack->eta() , recoTkGlbTrack->phi());
525 phiVsetaGlbTrack_badlumi[2]->Fill(recoStaGlbTrack->eta() , recoStaGlbTrack->phi());
528 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
530 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
532 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
535 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
536 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
537 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
539 thetaGlbTrack[0]->Fill(recoCombinedGlbTrack->theta());
540 thetaGlbTrack[1]->Fill(recoTkGlbTrack->theta());
541 thetaGlbTrack[2]->Fill(recoStaGlbTrack->theta());
542 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
543 thetaResolution[0]->Fill(res);
544 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
545 thetaResolution[1]->Fill(res);
547 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
548 thetaResolution[2]->Fill(res);
549 thetaPull->Fill(pull);
550 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
551 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
552 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
554 phiGlbTrack[0]->Fill(recoCombinedGlbTrack->phi());
555 phiGlbTrack[1]->Fill(recoTkGlbTrack->phi());
556 phiGlbTrack[2]->Fill(recoStaGlbTrack->phi());
557 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
559 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
561 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
564 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
565 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
566 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
568 chi2OvDFGlbTrack[0]->Fill(recoCombinedGlbTrack->normalizedChi2());
569 chi2OvDFGlbTrack[1]->Fill(recoTkGlbTrack->normalizedChi2());
570 chi2OvDFGlbTrack[2]->Fill(recoStaGlbTrack->normalizedChi2());
574 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
575 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
576 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
580 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
581 pGlbTrack[1]->Fill(recoTkGlbTrack->p());
582 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
584 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
585 ptGlbTrack[1]->Fill(recoTkGlbTrack->pt());
586 ptGlbTrack[2]->Fill(recoStaGlbTrack->pt());
588 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
589 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
590 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
591 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge()) qGlbTrack[3]->
Fill(1);
592 else qGlbTrack[3]->Fill(2);
593 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(3);
594 else qGlbTrack[3]->Fill(4);
595 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(5);
596 else qGlbTrack[3]->Fill(6);
597 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(7);
598 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge()) qGlbTrack[3]->
Fill(8);
600 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
601 qOverpResolution[0]->Fill(res);
602 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
603 qOverpResolution[1]->Fill(res);
604 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
605 qOverpResolution[2]->Fill(res);
606 qOverpPull->Fill(pull);
609 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
610 oneOverpResolution[0]->Fill(res);
611 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
612 oneOverpResolution[1]->Fill(res);
613 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
614 oneOverpResolution[2]->Fill(res);
615 oneOverpPull->Fill(pull);
618 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
619 qOverptResolution[0]->Fill(res);
620 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
621 qOverptResolution[1]->Fill(res);
622 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
623 qOverptResolution[2]->Fill(res);
624 qOverptPull->Fill(pull);
626 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
627 oneOverptResolution[0]->Fill(res);
628 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
629 oneOverptResolution[1]->Fill(res);
630 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
631 oneOverptResolution[2]->Fill(res);
632 oneOverptPull->Fill(pull);
641 double bestTrackPt = recoBestTrack->pt();
643 double tunePBestTrackPt = recoTunePBestTrack->pt();
645 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
647 tunePResolution->Fill(tunePBestTrackRes);
649 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
650 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
651 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
652 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
653 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
654 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
655 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
656 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
657 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
662 double rhGlb = recoCombinedGlbTrack->found();
664 double rhGlb_StaProvenance=0;
666 double rhGlb_TkProvenance=0;
673 if((*recHit)->isValid()){
674 DetId id = (*recHit)->geographicalId();
676 rhGlb_StaProvenance++;
678 rhGlb_TkProvenance++;
682 double rhStaGlb = recoStaGlbTrack->recHitsSize();
684 double rhTkGlb = recoTkGlbTrack->found();
686 double rhTkGlb_notValid = recoTkGlbTrack->lost();
689 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
690 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
691 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
692 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
693 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
694 rhAnalysis[5]->Fill(rhTkGlb_notValid/rhGlb);
697 if(recoCombinedGlbTrack->charge()>0)
698 muVStkSytemRotation[0]->
Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
700 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
705 if(
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
706 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
707 if(
muon->isStandAloneMuon())
709 if(!(
muon->isStandAloneMuon()))
715 etaTrack->Fill(recoTrack->eta());
716 thetaTrack->Fill(recoTrack->theta());
717 phiTrack->Fill(recoTrack->phi());
718 chi2OvDFTrack->Fill(recoTrack->normalizedChi2());
719 probchi2Track->Fill(TMath::Prob(recoTrack->chi2(),recoTrack->ndof()));
720 pTrack->Fill(recoTrack->p());
721 ptTrack->Fill(recoTrack->pt());
722 qTrack->Fill(recoTrack->charge());
726 if(
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
727 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
728 if(!(
muon->isTrackerMuon()))
734 etaStaTrack->Fill(recoStaTrack->eta());
735 thetaStaTrack->Fill(recoStaTrack->theta());
736 phiStaTrack->Fill(recoStaTrack->phi());
737 chi2OvDFStaTrack->Fill(recoStaTrack->normalizedChi2());
738 probchi2StaTrack->Fill(TMath::Prob(recoStaTrack->chi2(),recoStaTrack->ndof()));
739 pStaTrack->Fill(recoStaTrack->p());
740 ptStaTrack->Fill(recoStaTrack->pt());
741 qStaTrack->Fill(recoStaTrack->charge());
745 if(
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
753 if(
muon->isStandAloneMuon()){
754 etaEfficiency[0]->Fill(recoStaGlbTrack->eta());
755 phiEfficiency[0]->Fill(recoStaGlbTrack->phi());
757 if(
muon->isStandAloneMuon() &&
muon->isGlobalMuon()){
758 etaEfficiency[1]->Fill(recoStaGlbTrack->eta());
759 phiEfficiency[1]->Fill(recoStaGlbTrack->phi());
769 double dphi = acos(
cos(track1.
phi() - track2.
phi()));
770 double deta = track1.
eta() - track2.
eta();
771 return sqrt(dphi*dphi + deta*deta);
779 for (
unsigned int i = 0;
i < vc->size(); ++
i) {
783 for (v1TrackIter = v1TrackBegin; v1TrackIter != v1TrackEnd; v1TrackIter++) {
784 if (static_cast<unsigned int>(tidx) == v1TrackIter->key())
return i;
float chi2LocalPosition
chi2 value for the STA-TK matching of local position
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool isNonnull() const
Checks for non-null.
float chi2LocalMomentum
chi2 value for the STA-TK matching of local momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
float glbKink
value of the kink algorithm applied to the global track
float glbTrackProbability
the tail probability (-ln(P)) of the global fit
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)
double phi() const
azimuthal angle of momentum vector
std::vector< Vertex > VertexCollection
collection of Vertex objects
float trkKink
value of the kink algorithm applied to the inner track stub
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
int trackerLayersWithMeasurement() const
void analyze(const edm::Event &, const edm::EventSetup &) override
Inizialize parameters for histo binning.
int numberOfValidMuonCSCHits() const
int numberOfValidMuonRPCHits() const
double getDeltaR(reco::Track track1, reco::Track track2)
double eta() const
pseudorapidity of momentum vector
void setCurrentFolder(std::string const &fullpath)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Cos< T >::type cos(const T &t)
MonitorElement * book1D(Args &&...args)
float globalDeltaEtaPhi
global delta-Eta-Phi of STA-TK matching
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
float staRelChi2
chi2 value for the outer track stub with respect to the global track
MonitorElement * book2D(Args &&...args)
int getPv(int tidx, const reco::VertexCollection *vc)
XYZPointD XYZPoint
point in space with cartesian internal representation
int numberOfValidTrackerHits() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
int numberOfValidMuonDTHits() const
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
int numberOfValidPixelHits() const
const Point & position() const
position
int numberOfValidMuonHits() const
~MuonRecoAnalyzer() override
Destructor.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MuonRecoAnalyzer(const edm::ParameterSet &)
Constructor.