110 std::vector<std::pair<RefToBase<Track>,
double> > rvGlb;
112 if (glbsimToRecoCollection.
find(
tp) != glbsimToRecoCollection.
end()) {
113 rvGlb = glbsimToRecoCollection[
tp];
114 if (!rvGlb.empty()) {
115 rGlb = rvGlb.begin()->first;
119 std::vector<std::pair<RefToBase<Track>,
double> > rvSta;
121 if (stasimToRecoCollection.
find(
tp) != stasimToRecoCollection.
end()) {
122 rvSta = stasimToRecoCollection[
tp];
123 if (!rvSta.empty()) {
124 rSta = rvSta.begin()->first;
128 std::vector<std::pair<RefToBase<Track>,
double> > rvTk;
130 if (tksimToRecoCollection.
find(
tp) != tksimToRecoCollection.
end()) {
131 rvTk = tksimToRecoCollection[
tp];
133 rTk = rvTk.begin()->first;
137 if (!rvSta.empty() && !rvTk.empty()) {
142 for (reco::MuonTrackLinksCollection::const_iterator
links = muHandle->begin();
links != muHandle->end(); ++
links) {
162 for (reco::MuonTrackLinksCollection::const_iterator
links = muHandle->begin();
links != muHandle->end(); ++
links) {
167 std::vector<std::pair<TrackingParticleRef, double> > tp1;
169 if (glbrecoToSimCollection.
find(glbRef) != glbrecoToSimCollection.
end()) {
170 tp1 = glbrecoToSimCollection[glbRef];
172 tp1r = tp1.begin()->first;
176 std::vector<std::pair<TrackingParticleRef, double> > tp2;
178 if (starecoToSimCollection.
find(staRef) != starecoToSimCollection.
end()) {
179 tp2 = starecoToSimCollection[staRef];
181 tp2r = tp2.begin()->first;
185 std::vector<std::pair<TrackingParticleRef, double> > tp3;
187 if (tkrecoToSimCollection.
find(tkRef) != tkrecoToSimCollection.
end()) {
188 tp3 = tkrecoToSimCollection[tkRef];
190 tp3r = tp3.begin()->first;
229 ibooker.
setScope(MonitorElementData::Scope::RUN);
235 h_shouldMatch = ibooker.
book2D(
"h_shouldMatch",
"SIM associated to Tk and Sta", 50, -2.5, 2.5, 100, 0., 500.);
236 h_goodMatchSim = ibooker.
book2D(
"h_goodMatchSim",
"SIM associated to Glb Sta Tk", 50, -2.5, 2.5, 100, 0., 500.);
237 h_tkOnlySim = ibooker.
book2D(
"h_tkOnlySim",
"SIM associated to Glb Tk", 50, -2.5, 2.5, 100, 0., 500.);
238 h_staOnlySim = ibooker.
book2D(
"h_staOnlySim",
"SIM associated to Glb Sta", 50, -2.5, 2.5, 100, 0., 500.);
240 h_totReco = ibooker.
book2D(
"h_totReco",
"Total Glb Reconstructed", 50, -2.5, 2.5, 100, 0., 500.);
241 h_goodMatch = ibooker.
book2D(
"h_goodMatch",
"Sta and Tk from same SIM", 50, -2.5, 2.5, 100, 0., 500.);
242 h_fakeMatch = ibooker.
book2D(
"h_fakeMatch",
"Sta and Tk not from same SIM", 50, -2.5, 2.5, 100, 0., 500.);
244 h_effic = ibooker.
book1D(
"h_effic",
"Efficiency vs #eta", 50, -2.5, 2.5);
245 h_efficPt = ibooker.
book1D(
"h_efficPt",
"Efficiency vs p_{T}", 100, 0., 100.);
247 h_fake = ibooker.
book1D(
"h_fake",
"Fake fraction vs #eta", 50, -2.5, 2.5);
248 h_fakePt = ibooker.
book1D(
"h_fakePt",
"Fake fraction vs p_{T}", 100, 0., 100.);
255 TH1D *
reco = h1->ProjectionX();
258 TH1D *
sim = h2->ProjectionX();
260 TH1F *hEff = (TH1F *)
reco->Clone();
264 hEff->SetName(
"tmp_" + TString(
reco->GetName()));
269 float nSimHit =
sim->GetBinContent(
bin);
270 float eff = hEff->GetBinContent(
bin);
272 if (nSimHit != 0 && eff <= 1) {
285 TH1D *
reco = h1->ProjectionY();
288 TH1D *
sim = h2->ProjectionY();
290 TH1F *hEff = (TH1F *)
reco->Clone();
294 hEff->SetName(
"tmp_" + TString(
reco->GetName()));
297 int nBinsPt = hEff->GetNbinsX();
298 for (
int bin = 1;
bin <= nBinsPt;
bin++) {
299 float nSimHit =
sim->GetBinContent(
bin);
300 float eff = hEff->GetBinContent(
bin);
302 if (nSimHit != 0 && eff <= 1) {